帰納述語についての簡単な証明に行き詰まっています。自然の 0 が正ではないことを証明する必要があります。ここで、自然はビットのリストであり、0 は 0 のビットのみを含む任意のリストです。
H1: pos Empt
____________ (1/1)
Nat
依存型を使用した認定プログラミングのこの章では、を使用することをお勧めしているようです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.