@@ -303,6 +303,12 @@ Abbreviation reflect := Datatypes.reflect.
303303Abbreviation ReflectT := Datatypes.ReflectT.
304304Abbreviation ReflectF := Datatypes.ReflectF.
305305
306+ Structure decProp := DecProp {
307+ prop :> Prop ;
308+ propb :> bool;
309+ propbP : reflect prop propb
310+ }.
311+
306312Reserved Notation "~~ b" (at level 35, right associativity).
307313Reserved Notation "b ==> c" (at level 55, right associativity).
308314Reserved Notation "b1 (+) b2" (at level 50, left associativity).
@@ -649,37 +655,34 @@ End BoolIf.
649655
650656Section ReflectCore.
651657
652- Variables (P Q : Prop) (b c : bool).
653-
654- Hypothesis Hb : reflect P b.
658+ Variables (P : decProp) (Q : Prop) (b : bool).
655659
656- Lemma introNTF : (if c then ~ P else P) -> ~~ b = c .
657- Proof . by case c ; case Hb . Qed .
660+ Lemma introNTF : (if b then ~ P else P) -> ~~ P = b .
661+ Proof . by case b ; case (propbP P) . Qed .
658662
659- Lemma introTF : (if c then P else ~ P) -> b = c .
660- Proof . by case c ; case Hb . Qed .
663+ Lemma introTF : (if b then P : Prop else ~ P) -> P = b :> bool .
664+ Proof . by case b ; case (propbP P) . Qed .
661665
662- Lemma elimNTF : ~~ b = c -> if c then ~ P else P.
663- Proof . by move <-; case Hb . Qed .
666+ Lemma elimNTF : ~~ P = b -> if b then ~ P else P.
667+ Proof . by move <-; case (propbP P) . Qed .
664668
665- Lemma elimTF : b = c -> if c then P else ~ P.
666- Proof . by move <-; case Hb . Qed .
669+ Lemma elimTF : P = b :> bool -> if b then P : Prop else ~ P.
670+ Proof . by move <-; case (propbP P) . Qed .
667671
668- Lemma equivPif : (Q -> P) -> (P -> Q) -> if b then Q else ~ Q.
669- Proof . by case Hb ; auto. Qed .
672+ Lemma equivPif : (Q -> P) -> (P -> Q) -> if P then Q else ~ Q.
673+ Proof . by case (propbP P) ; auto. Qed .
670674
671- Lemma xorPif : Q \/ P -> ~ (Q /\ P) -> if b then ~ Q else Q.
672- Proof . by case Hb => [? _ H ? | ? H _]; case: H. Qed .
675+ Lemma xorPif : Q \/ P -> ~ (Q /\ P) -> if P then ~ Q else Q.
676+ Proof . by case (propbP P) => [? _ H ? | ? H _]; case: H. Qed .
673677
674678End ReflectCore.
675679
676680(** Internal negated reflection lemmas * *)
677681Section ReflectNegCore.
678682
679- Variables (P Q : Prop) (b c : bool).
680- Hypothesis Hb : reflect P (~~ b).
683+ Variables (P : decProp) (Q : Prop) (b : bool).
681684
682- Lemma introTFn : (if c then ~ P else P) -> b = c .
685+ Lemma introTFn : (if ~~ b then ~ P else P) -> P = b :> bool .
683686Proof . by move/(introNTF Hb) <-; case b. Qed .
684687
685688Lemma elimTFn : b = c -> if c then ~ P else P.
0 commit comments