Заседнал съм на просто доказателство за индуктивен предикат. Трябва да докажа, че естествената 0 не е положителна, където естествената е списък от битове, а 0 е всеки списък само с битове, които са 0s.
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.
Theorem T1: pos Empt -> False. Proof. intro H1. inversion H1. Qed.
- person user1494846   schedule 27.11.2012