之前,我能够证明forall nat1: Nat, Trim nat1 -> Trim (pred nat1)
的以下定义pred
。
Fixpoint pred (nat1: Nat): Nat :=
match nat1 with
| Empt => Empt
| Fill Zer nat3 => Fill One (pred nat3)
| Fill One nat3 => trim (Fill Zer nat3)
end.
但是用下面的新定义pred
我不知道如何证明forall nat1: {nat2: Nat | Trim nat2 /\ Pos nat2}, Trim (pred nat1)
。
Program Fixpoint pred (nat1: Nat | Trim nat1 /\ Pos nat1) {measure (meas nat1)}: Nat :=
match nat1 with
| Empt => _
| Fill Zer nat3 => Fill One (pred nat3)
| Fill One nat3 => trim (Fill Zer nat3)
end.