Skip to content

Commit

Permalink
Generalization in the type of contra_eq/contra_neq.
Browse files Browse the repository at this point in the history
Thanks B. Grégoire for this suggestion.
  • Loading branch information
amahboubi committed Oct 5, 2016
1 parent fa7635a commit b0c734b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mathcomp/ssreflect/eqtype.v
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ Hint Resolve eq_refl eq_sym.

Section Contrapositives.

Variable T : eqType.
Implicit Types (A : pred T) (b : bool) (x : T).
Variables (T1 T2 : eqType).
Implicit Types (A : pred T1) (b : bool) (x : T1) (z : T2).

Lemma contraTeq b x y : (x != y -> ~~ b) -> b -> x = y.
Proof. by move=> imp hyp; apply/eqP; apply: contraTT hyp. Qed.
Expand Down Expand Up @@ -207,10 +207,10 @@ Proof. by move=> imp /eqP; apply: contraTF. Qed.
Lemma contra_eqT b x y : (~~ b -> x != y) -> x = y -> b.
Proof. by move=> imp /eqP; apply: contraLR. Qed.

Lemma contra_eq x1 y1 x2 y2 : (x2 != y2 -> x1 != y1) -> x1 = y1 -> x2 = y2.
Lemma contra_eq z1 z2 x1 x2 : (x1 != x2 -> z1 != z2) -> z1 = z2 -> x1 = x2.
Proof. by move=> imp /eqP; apply: contraTeq. Qed.

Lemma contra_neq x1 y1 x2 y2 : (x2 = y2 -> x1 = y1) -> x1 != y1 -> x2 != y2.
Lemma contra_neq z1 z2 x1 x2 : (x1 = x2 -> z1 = z2) -> z1 != z2 -> x1 != x2.
Proof. by move=> imp; apply: contraNneq => /imp->. Qed.

Lemma memPn A x : reflect {in A, forall y, y != x} (x \notin A).
Expand All @@ -230,8 +230,8 @@ Proof. by rewrite eq_sym; apply: ifN. Qed.

End Contrapositives.

Implicit Arguments memPn [T A x].
Implicit Arguments memPnC [T A x].
Implicit Arguments memPn [T1 A x].
Implicit Arguments memPnC [T1 A x].

Theorem eq_irrelevance (T : eqType) x y : forall e1 e2 : x = y :> T, e1 = e2.
Proof.
Expand Down

0 comments on commit b0c734b

Please sign in to comment.