我被困在一个关于归纳谓词的简单证明上。我必须证明自然 0 不是正数,其中自然是位列表,而 0 是任何只有位为 0 的列表。
H1: pos Empt
____________ (1/1)
Nat
Certified Programming with Dependents Types这一章似乎建议我使用inversion
,但我收到一条错误消息。
Require Import Coq.Program.Program.
Inductive Bit: Type :=
| Zer: Bit
| One: Bit.
Inductive List (type1: Type): Type :=
| Empt: List type1
| Fill: type1 -> List type1 -> List type1.
Implicit Arguments Empt [[type1]].
Implicit Arguments Fill [[type1]].
Definition Nat: Type := List Bit.
Inductive pos: Nat -> Prop :=
| pos_1: forall nat1: Nat, pos (Fill One nat1)
| pos_2: forall nat1: Nat, pos nat1 -> forall bit1: Bit, pos (Fill bit1 nat1).
Program Fixpoint pred (nat1: Nat) (H1: pos nat1): Nat :=
match nat1 with
| Empt => _
| Fill Zer nat2 => Fill One (pred nat2 H1)
| Fill One nat2 => Fill Zer nat2
end.
Next Obligation.
inversion H1.