mirror of https://github.com/nmvdw/HITs-Examples
Clean up the interface.v proofs
This commit is contained in:
parent
4a98d84cbc
commit
4ade6e60cc
|
@ -53,28 +53,30 @@ Section properties.
|
||||||
Definition set_subset : forall A, T A -> T A -> hProp :=
|
Definition set_subset : forall A, T A -> T A -> hProp :=
|
||||||
fun A X Y => (f A X) ⊆ (f A Y).
|
fun A X Y => (f A X) ⊆ (f A Y).
|
||||||
|
|
||||||
Ltac reduce := intros ; repeat (rewrite ?(f_empty _ _) ; rewrite ?(f_singleton _ _) ;
|
Ltac reduce :=
|
||||||
rewrite ?(f_union _ _) ; rewrite ?(f_filter _ _) ;
|
intros ;
|
||||||
rewrite ?(f_member _ _)).
|
repeat (rewrite (f_empty _ _)
|
||||||
|
|| rewrite ?(f_singleton _ _)
|
||||||
|
|| rewrite ?(f_union _ _)
|
||||||
|
|| rewrite ?(f_filter _ _)
|
||||||
|
|| rewrite ?(f_member _ _)).
|
||||||
|
|
||||||
Definition empty_isIn : forall (A : Type) (a : A), member a empty = False_hp.
|
Definition empty_isIn : forall (A : Type) (a : A),
|
||||||
|
member a empty = False_hp.
|
||||||
Proof.
|
Proof.
|
||||||
reduce.
|
by reduce.
|
||||||
reflexivity.
|
|
||||||
Defined.
|
Defined.
|
||||||
|
|
||||||
Definition singleton_isIn : forall (A : Type) (a b : A),
|
Definition singleton_isIn : forall (A : Type) (a b : A),
|
||||||
member a (singleton b) = BuildhProp (Trunc (-1) (a = b)).
|
member a (singleton b) = merely (a = b).
|
||||||
Proof.
|
Proof.
|
||||||
reduce.
|
by reduce.
|
||||||
reflexivity.
|
|
||||||
Defined.
|
Defined.
|
||||||
|
|
||||||
Definition union_isIn : forall (A : Type) (a : A) (X Y : T A),
|
Definition union_isIn : forall (A : Type) (a : A) (X Y : T A),
|
||||||
member a (union X Y) = lor (member a X) (member a Y).
|
member a (union X Y) = lor (member a X) (member a Y).
|
||||||
Proof.
|
Proof.
|
||||||
reduce.
|
by reduce.
|
||||||
reflexivity.
|
|
||||||
Defined.
|
Defined.
|
||||||
|
|
||||||
Definition filter_isIn : forall (A : Type) (a : A) (ϕ : A -> Bool) (X : T A),
|
Definition filter_isIn : forall (A : Type) (a : A) (ϕ : A -> Bool) (X : T A),
|
||||||
|
@ -86,15 +88,11 @@ Section properties.
|
||||||
|
|
||||||
Definition reflect_eq : forall (A : Type) (X Y : T A),
|
Definition reflect_eq : forall (A : Type) (X Y : T A),
|
||||||
f A X = f A Y -> set_eq A X Y.
|
f A X = f A Y -> set_eq A X Y.
|
||||||
Proof.
|
Proof. done. Defined.
|
||||||
auto.
|
|
||||||
Defined.
|
|
||||||
|
|
||||||
Definition reflect_subset : forall (A : Type) (X Y : T A),
|
Definition reflect_subset : forall (A : Type) (X Y : T A),
|
||||||
subset (f A X) (f A Y) -> set_subset A X Y.
|
subset (f A X) (f A Y) -> set_subset A X Y.
|
||||||
Proof.
|
Proof. done. Defined.
|
||||||
auto.
|
|
||||||
Defined.
|
|
||||||
|
|
||||||
Hint Unfold set_eq set_subset.
|
Hint Unfold set_eq set_subset.
|
||||||
|
|
||||||
|
@ -103,27 +101,24 @@ Section properties.
|
||||||
Definition well_defined_union : forall (A : Type) (X1 X2 Y1 Y2 : T A),
|
Definition well_defined_union : forall (A : Type) (X1 X2 Y1 Y2 : T A),
|
||||||
set_eq A X1 Y1 -> set_eq A X2 Y2 -> set_eq A (union X1 X2) (union Y1 Y2).
|
set_eq A X1 Y1 -> set_eq A X2 Y2 -> set_eq A (union X1 X2) (union Y1 Y2).
|
||||||
Proof.
|
Proof.
|
||||||
|
intros A X1 X2 Y1 Y2 HXY1 HXY2.
|
||||||
simplify.
|
simplify.
|
||||||
rewrite X, X0.
|
by rewrite HXY1, HXY2.
|
||||||
reflexivity.
|
|
||||||
Defined.
|
Defined.
|
||||||
|
|
||||||
Definition well_defined_filter : forall (A : Type) (ϕ : A -> Bool) (X Y : T A),
|
Definition well_defined_filter : forall (A : Type) (ϕ : A -> Bool) (X Y : T A),
|
||||||
set_eq A X Y -> set_eq A (filter ϕ X) (filter ϕ Y).
|
set_eq A X Y -> set_eq A (filter ϕ X) (filter ϕ Y).
|
||||||
Proof.
|
Proof.
|
||||||
|
intros A ϕ X Y HXY.
|
||||||
simplify.
|
simplify.
|
||||||
rewrite X0.
|
by rewrite HXY.
|
||||||
reflexivity.
|
|
||||||
Defined.
|
Defined.
|
||||||
|
|
||||||
Variable (A : Type).
|
Lemma union_comm : forall A (X Y : T A),
|
||||||
Context `{DecidablePaths A}.
|
|
||||||
|
|
||||||
Lemma union_comm : forall (X Y : T A),
|
|
||||||
set_eq A (union X Y) (union Y X).
|
set_eq A (union X Y) (union Y X).
|
||||||
Proof.
|
Proof.
|
||||||
simplify.
|
simplify.
|
||||||
apply lattice_fset.
|
apply comm.
|
||||||
Defined.
|
Defined.
|
||||||
|
|
||||||
End properties.
|
End properties.
|
Loading…
Reference in New Issue