(* Gabriel Braun November 2012 *)

Require Export GeoCoq.Tarski_dev.Ch12_parallel.

Section Quadrilateral.

Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.

Lemma cong_identity_inv :
 forall A B C, A <> B -> ~ Cong A B C C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
apply H.
eapply cong_identity.
(* Goal: False *)
apply H0.
Qed.

Lemma midpoint_midpoint_col : forall A B A' B' M,
 A <> B ->
 Midpoint M A A' -> Midpoint M B B' ->
 Col A B B' ->
 A' <> B' /\ Col A A' B' /\ Col B A' B'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
assert(A' <> B').
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
apply H.
assert(Cong A' B' A B).
eapply l7_13.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_symmetry in H4.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H4.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(HH0:= H0).
assert(HH1:= H1).
unfold Midpoint in HH0.
unfold Midpoint in HH1.
(* Goal: False *)
spliter.

assert(Col M A A').
apply bet_col in H6.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
assert(Col M B B').
apply bet_col in H4.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

induction(eq_dec_points B B').
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
apply l7_3 in H1.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
Col5.

assert(Col A A' B').

assert(Col B M A).
eapply col_transitivity_1.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

assert(Col A M B').

eapply col_transitivity_1.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

induction(eq_dec_points A M).
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply cong_symmetry in H7.
(* Goal: False *)
(* Goal: @Bet Tn C B D' *)
apply cong_identity in H7.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

eapply col_transitivity_1.
apply H13.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
repeat split;
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

induction(eq_dec_points A B').
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
assert(A'=B).
eapply l7_9.
2: apply H1.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
Qed.

Lemma midpoint_par_strict :
 forall A B A' B' M,
 A <> B ->
 ~ Col A B B' ->
 Midpoint M A A' ->
 Midpoint M B B' ->
 Par_strict A B A' B'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Par_strict Tn A B A' B' *)
assert(Par A B A' B').
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
eapply (l12_17 A B A' B' M); assumption.
(* Goal: @Midpoint Tn A B C *)
induction H3.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
spliter.
(* Goal: and (@OS Tn A B C D) (@OS Tn C D A B) *)
apply False_ind.

(* Goal: False *)
assert(HH:=midpoint_midpoint_col B' A' B A M).
(* Goal: False *)
assert(B <> A /\ Col B' B A /\ Col A' B A).
(* Goal: and (not (@eq (@Tpoint Tn) B A)) (and (@Col Tn B' B A) (@Col Tn A' B A)) *)
(* Goal: False *)
apply HH.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
spliter.
(* Goal: False *)
apply H0.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma bet3_cong3_bet : forall A B C D D', A <> B -> A <> C -> A <> D -> Bet D A C -> Bet A C B -> Bet D C D' -> Cong A B C D -> Cong A D B C -> Cong D C C D'
                              -> Bet C B D'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Bet Tn C B D' *)
assert(Bet D C B).
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C B D' *)
assert(B <> C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: False *)
(* Goal: @Bet Tn C B D' *)
apply cong_identity in H6.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Bet Tn C B D' *)
assert(D' <> C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: or (@Bet Tn D B D') (@Bet Tn D D' B) *)
(* Goal: @Bet Tn C B D' *)
subst D'.
(* Goal: False *)
(* Goal: @Bet Tn C B D' *)
apply cong_identity in H7.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H5.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Bet Tn C B D' *)
assert(D <> C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H5.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Bet Tn C B D' *)
assert (Out C B D').
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (l5_2 D); auto.

(* Goal: @Bet Tn C B D' *)
assert(Out D B D').
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.

(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: not (@eq (@Tpoint Tn) D' D) *)
(* Goal: or (@Bet Tn D B D') (@Bet Tn D D' B) *)
(* Goal: @Bet Tn C B D' *)
apply between_identity in H8.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: or (@Bet Tn D B D') (@Bet Tn D D' B) *)
(* Goal: @Bet Tn C B D' *)
subst D'.
apply between_identity  in H4.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (l5_1 _ C); auto.

(* Goal: @Bet Tn C B D' *)
assert(Le D A D C).
(* Goal: @Le Tn D A D C *)
(* Goal: @Bet Tn C B D' *)
unfold Le.
(* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Bet Tn D E C) (@Cong Tn D A D E)) *)
(* Goal: @Bet Tn C B D' *)
exists A.
(* Goal: and (@Plg Tn A A B B) (@Cong Tn A B A B) *)
split; Cong.

(* Goal: @Bet Tn C B D' *)
assert(Le D B D D').
(* Goal: @Le Tn D B D D' *)
(* Goal: @Bet Tn C B D' *)
eapply (bet2_le2__le1346 _ A _ _ C).
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Le Tn A B C D' *)
(* Goal: @Bet Tn C B D' *)
apply cong__le; eCong.

(* Goal: @Bet Tn C B D' *)
assert(Bet D B D').

(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
apply l6_13_1; auto.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (between_exchange3 D); auto.
Qed.

Lemma bet_double_bet :
 forall A B C B' C',
 Midpoint B' A B ->
 Midpoint C' A C ->
 Bet A B' C' ->
 Bet A B C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
assert(Le A B' A C').
(* Goal: @Le Tn D A D C *)
(* Goal: @Bet Tn C B D' *)
unfold Le.
exists B'.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply cong_reflexivity.
assert (Le B' B C' C).
eapply l5_6.
apply H4.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
assert(Le A B A C).
eapply bet2_le2__le1346.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

induction (eq_dec_points A B').
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
apply cong_symmetry in H3.
apply cong_identity in H3.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
apply between_trivial2.

assert( A <> C').
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
subst C'.
apply le_zero in H4.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Col Tn A B C *)
assert(A <> B).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
apply between_identity in H.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert(A <> C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
subst C.
apply between_identity in H0.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

assert(Out A B C).

assert(Bet A B C' \/ Bet A C' B).
eapply l5_1.
apply H7.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
induction H11.

eapply l6_7.
apply bet_out.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
apply H11.
apply bet_out.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet A B C \/ Bet A C B).
eapply l5_1.
2: apply H11.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
induction H12.
apply bet_out.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply l6_6.
apply bet_out.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
eapply l6_13_1.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.


Lemma bet_half_bet :
 forall A B C B' C',
 Bet A B C  ->
 Midpoint B' A B ->
 Midpoint C' A C ->
 Bet A B' C'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
assert(HH0:= H0).
assert(HH1:= H1).
(* Goal: @Col Tn A B C *)
unfold Midpoint in H0.
unfold Midpoint in H1.
(* Goal: False *)
spliter.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
apply between_identity in H0.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
apply between_trivial2.
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert(A <> C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
subst C.
apply between_identity in H1.
subst C'.
apply between_identity in H.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Col Tn A B C *)
assert(A <> B').
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
apply cong_symmetry in H3.
apply cong_identity in H3.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
assert(A <> C').
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
subst C'.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H2.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

assert(Col A B' C').
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
apply bet_col in H.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H8.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H8.
apply between_symmetry in H8.

assert(Bet A C B).
eapply bet_double_bet.
apply HH1.
apply HH0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(B = C).
eapply between_equality.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: False *)
(* Goal: False *)
subst C.
assert(B' = C').
eapply l7_17.
apply HH0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
subst C'.
apply between_trivial.

(***********************************)

assert(Bet A B' C).
eapply between_exchange4.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Out A B' C').
unfold Out.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
eapply l5_3.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
eapply l6_4_1 in H10.
(* Goal: False *)
spliter.
apply between_symmetry in H8.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.

Lemma midpoint_preserves_bet :
 forall A B C B' C',
  Midpoint B' A B ->
  Midpoint C' A C ->
 (Bet A B C <-> Bet A B' C').
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
eapply bet_half_bet.
(* Goal: @Bet Tn B M D *)
(* Goal: @Par Tn A B C D *)
(* Goal: @Cong Tn A B C D *)
apply H1.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
eapply bet_double_bet.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma symmetry_preseves_bet1 :
 forall A B M A' B',
  Midpoint M A A' ->
  Midpoint M B B' ->
  Bet M A B ->
  Bet M A' B'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
eapply l7_15.
(* Goal: False *)
(* Goal: False *)
2: apply H.
(* Goal: False *)
2: apply H0.
2: apply H1.
apply l7_3_2.
Qed.

Lemma symmetry_preseves_bet2 :
 forall A B M A' B',
  Midpoint M A A' ->
  Midpoint M B B' ->
  Bet M A' B' ->
  Bet M A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
eapply l7_15.
apply l7_3_2.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma symmetry_preserves_bet :
 forall A B M A' B',
  Midpoint M A A' ->
  Midpoint M B B' ->
 (Bet M A' B' <-> Bet M A B).
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
apply symmetry_preseves_bet2;
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
eapply (symmetry_preseves_bet1 A B);
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma bet_cong_bet :
 forall A B C D,
  A <> B ->
  Bet A B C ->
  Bet A B D ->
  Cong A C B D ->
  Bet B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

(* Goal: @Bet Tn B C D *)
assert(Bet B C D \/ Bet B D C).
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (l5_2 A); auto.
(* Goal: @Midpoint Tn A B C *)
induction H3.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

(* Goal: @Bet Tn B C D *)
assert(D = C /\ A = B).
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (bet_cong_eq A B D C); auto.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.

Lemma col_cong_mid :
 forall A B A' B',
  Par A B A' B' ->
  ~ Par_strict A B A' B' ->
  Cong A B A' B' ->
  exists M,  Midpoint M A A' /\ Midpoint M B B' \/
             Midpoint M A B' /\ Midpoint M B A'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
unfold Par in H.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: False *)
spliter.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction (eq_dec_points A A').
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
assert(B = B' \/ Midpoint A B B').
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply l7_20; auto.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H5.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
assert( HH:= midpoint_existence A B).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Bet Tn D E C) (@Cong Tn D A D E)) *)
(* Goal: @Bet Tn C B D' *)
exists A.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
apply l7_3_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

induction (eq_dec_points B B').
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
assert(A = A' \/ Midpoint B A A').
(* Goal: or (@eq (@Tpoint Tn) B C) (@Midpoint Tn A B C) *)
(* Goal: @Midpoint Tn A B C *)
eapply l7_20.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
induction H6.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
assert( HH:= midpoint_existence A B).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
exists B.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply l7_3_2.

induction (eq_dec_points A B').
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
assert(B = A' \/ Midpoint A B A').
(* Goal: or (@eq (@Tpoint Tn) B C) (@Midpoint Tn A B C) *)
(* Goal: @Midpoint Tn A B C *)
eapply l7_20.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
induction H7.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
assert( HH:= midpoint_existence A B).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Bet Tn D E C) (@Cong Tn D A D E)) *)
(* Goal: @Bet Tn C B D' *)
exists A.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
apply l7_3_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

induction (eq_dec_points A' B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
assert(A = B' \/ Midpoint B A B').
(* Goal: or (@eq (@Tpoint Tn) B C) (@Midpoint Tn A B C) *)
(* Goal: @Midpoint Tn A B C *)
eapply l7_20.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H8.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
assert( HH:= midpoint_existence A B).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
exists B.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply l7_3_2.

assert(Col A B A').
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
assert(Col A B B').
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

induction H10.
(* Goal: @Midpoint Tn A B C *)
induction H4.

assert( HH:= midpoint_existence A' B).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
assert(HH:= H11).
unfold Midpoint in HH.
(* Goal: False *)
spliter.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.

assert(Bet B M B').

eapply between_exchange4.
2: apply H4.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

assert(Bet A M B').
eapply between_exchange2.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
assert(Cong A M B' M).
eapply (l2_11 A  B _  _ A').
eapply between_inner_transitivity.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
eapply between_inner_transitivity.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H4.

(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

(* Goal: @Midpoint Tn A B C *)
induction H4.

assert( HH:= midpoint_existence B B').
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.

assert(HH:= H11).
unfold Midpoint in HH.
(* Goal: False *)
spliter.

(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.

assert(Bet A' M B).
eapply between_exchange2.
apply H4.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
assert(Bet M B A).
eapply between_exchange3.

(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H12.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

assert(Bet A' M A).
eapply outer_transitivity_between.
apply H14.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply is_midpoint_id in H11.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
assert(Cong A M A' M).
eapply l2_11.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H15.
eapply between_inner_transitivity.
apply H4.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet B A' A).
eapply (bet_cong_bet B').
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

assert( HH:= midpoint_existence A' B).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
assert(HH:=H12).
unfold Midpoint in HH.
(* Goal: False *)
spliter.

(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
assert(Bet B M A).
eapply between_exchange4.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H13.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet B' B M).
eapply between_inner_transitivity.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet M A' A).
eapply between_exchange3.
2:apply H11.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
assert(Bet B' M A').
eapply outer_transitivity_between2.
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply l7_2 in H12.
apply is_midpoint_id in H12.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
assert(Bet B' M A).
eapply outer_transitivity_between.
apply H18.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
apply is_midpoint_id in H12.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

assert(Cong A M B' M).
eapply l4_3.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H15.
apply H18.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M D B *)
Midpoint.

induction H10.
(* Goal: @Midpoint Tn A B C *)
induction H3.


assert(B' = B /\ A = A').
eapply bet_cong_eq.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Midpoint Tn A B C *)
induction H3.

assert(Bet B' B A').
eapply bet_cong_bet.
apply H7.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

assert( HH:= midpoint_existence B B').
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.

assert(HH:=H12).
unfold Midpoint in HH.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.

(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.

assert(Bet A' M B').
eapply between_exchange2.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H11.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet M B' A).
eapply between_exchange3.
apply H13.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
assert(Bet A' M A).
eapply outer_transitivity_between.
apply H15.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply l7_2 in H12.
apply is_midpoint_id in H12.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

assert(Bet A M B).
eapply outer_transitivity_between2.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply l7_2 in H12.
apply is_midpoint_id in H12.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

assert(Cong A' M A M).
eapply l4_3.
apply H15.
apply H18.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert( HH:= midpoint_existence A B').
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
assert(HH:=H11).
unfold Midpoint in HH.
(* Goal: False *)
spliter.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet A' A M).
eapply between_inner_transitivity.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H3.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet A M B).
eapply between_exchange4.
apply H11.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

assert(Bet A' M B).
eapply outer_transitivity_between2.
apply H14.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply is_midpoint_id in H11.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

assert(Cong B M A' M).
eapply l4_3.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H15.
eapply between_exchange2.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H3.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H9.

assert(Bet B' B A').
eapply outer_transitivity_between2.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(B = A' /\ B' = A).
eapply bet_cong_eq.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H9.

assert( HH:= midpoint_existence A A').
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
assert(HH:=H11).
unfold Midpoint in HH.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet B A' M).
eapply between_inner_transitivity.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

assert(Bet B M A).
eapply outer_transitivity_between2.
apply H14.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply l7_2 in H11.
apply is_midpoint_id in H11.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

assert(Bet B M B').
eapply between_exchange4.
apply H15.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

assert(Cong B M B' M).
eapply l4_3.
apply H15.

assert(Bet B' A A').
eapply between_inner_transitivity.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
eapply between_exchange2.
(* Goal: @Bet Tn M B D *)
(* Goal: False *)
(* Goal: False *)
apply H17.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
assert(Bet A B' A' \/ Bet A A' B').
(* Goal: or (@Bet Tn A B' A') (@Bet Tn A A' B') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (l5_2 B).
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
induction H11.

assert( HH:= midpoint_existence A B').
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
assert(HH:=H12).
unfold Midpoint in HH.
(* Goal: False *)
spliter.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet B M B').
eapply between_exchange2.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
assert(Bet A' B' M).
eapply between_inner_transitivity.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H11.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

assert(Bet A' M B).
eapply outer_transitivity_between2.
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply l7_2 in H12.
apply is_midpoint_id in H12.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

assert(Cong M A' M B).
eapply l2_11.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
eapply between_exchange3.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H13.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

assert( HH:= midpoint_existence A A').
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
assert(HH:=H12).
unfold Midpoint in HH.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet B A M).
eapply between_inner_transitivity.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
assert(Bet B' M A).
eapply between_exchange2.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H11.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
assert(Bet B' M B).
eapply outer_transitivity_between.
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply is_midpoint_id in H12.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
assert(Cong B' M B M).
eapply l2_11.
eapply between_inner_transitivity.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H11.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
apply H15.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
Qed.

Lemma mid_par_cong1 :
 forall A B A' B' M,
  A <> B ->
  Midpoint M A A' ->
  Midpoint M B B' ->
  Cong A B A' B' /\ Par A B A' B'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
eapply (l7_13 M);
(* Goal: @Midpoint Tn M D B *)
Midpoint.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
apply (l12_17 _ _ _ _ M); auto.
Qed.

Lemma mid_par_cong2 :
 forall A B A' B' M,
  A <> B' ->
  Midpoint M A A' ->
  Midpoint M B B' ->
  Cong A B' A' B /\ Par A B' A' B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: False *)
spliter.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Midpoint Tn M D B *)
apply (l7_13 M); Midpoint.
(* Goal: @Midpoint Tn M D B *)
eapply (l12_17 _ _ _ _ M); Midpoint.
Qed.


Lemma mid_par_cong :
 forall A B A' B' M,
  A <> B -> A <> B' ->
  Midpoint M A A' ->
  Midpoint M B B' ->
  Cong A B A' B' /\ Cong A B' A' B /\ Par A B A' B' /\ Par A B' A' B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: False *)
spliter.
(* Goal: and (@Cong Tn A B A' B') (and (@Cong Tn A B' A' B) (and (@Par Tn A B A' B') (@Par Tn A B' A' B))) *)
assert(Cong A B A' B' /\ Par A B A' B').
(* Goal: @Midpoint Tn M D B *)
eapply (mid_par_cong1 _  _ _ _ M); Midpoint.
(* Goal: and (@Cong Tn A B A' B') (and (@Cong Tn A B' A' B) (and (@Par Tn A B A' B') (@Par Tn A B' A' B))) *)
assert(Cong A B' A' B /\ Par A B' A' B).
(* Goal: @Midpoint Tn M D B *)
apply (mid_par_cong2 _ _ _ _ M);Midpoint.
(* Goal: False *)
spliter.
repeat split;
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma Parallelogram_strict_Parallelogram :
 forall A B C D,
  Parallelogram_strict A B C D -> Parallelogram A B C D.
Proof.
(* Goal: @Parallelogram Tn A B C D *)
unfold Parallelogram.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

Lemma plgf_permut :
 forall A B C D,
  Parallelogram_flat A B C D ->
  Parallelogram_flat B C D A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram_flat Tn A A C C *)
unfold Parallelogram_flat in *.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A A)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' A)) (or (and (@Bet Tn A A' A) (@Bet Tn A' A B')) (and (@Bet Tn A A A') (@Bet Tn A A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H1.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: False *)
subst D.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col.
apply  cong_trivial_identity.
induction H3;
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
left; assumption.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => or (and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) (and (@Midpoint Tn M A D) (@Midpoint Tn M B C))) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(C <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn A B C *)
induction H3.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
left; assumption.
Qed.

Lemma plgf_sym :
 forall A B C D,
 Parallelogram_flat A B C D ->
 Parallelogram_flat C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram_flat Tn B C D A *)
apply plgf_permut.
(* Goal: @Parallelogram_flat Tn B C D A *)
apply plgf_permut.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma plgf_irreflexive :
 forall A B,
 ~ Parallelogram_flat A B A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram_flat Tn A A B B *)
unfold Parallelogram_flat.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H3; tauto.
Qed.

Lemma plgs_irreflexive :
 forall A B,
  ~ Parallelogram_strict A B A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) D A)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B D)))))) *)
unfold Parallelogram_strict in H.
(* Goal: False *)
spliter.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) D A)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B D)))))) *)
unfold TS in H.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply H2.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma plg_irreflexive :
 forall A B,
 ~ Parallelogram A B A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.
(* Goal: False *)
(* Goal: False *)
apply plgs_irreflexive in H.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
apply plgf_irreflexive in H.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma plgf_mid :
 forall A B C D,
  Parallelogram_flat A B C D ->
  exists M, Midpoint M A C /\ Midpoint M B D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Midpoint Tn A B C *)
unfold Parallelogram_flat in H.
(* Goal: False *)
spliter.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A A)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' A)) (or (and (@Bet Tn A A' A) (@Bet Tn A' A B')) (and (@Bet Tn A A A') (@Bet Tn A A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H1.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: False *)
subst D.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
assert(HH:=midpoint_existence A C).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
split; assumption.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => or (and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) (and (@Midpoint Tn M A D) (@Midpoint Tn M B C))) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(C <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(Par A B C D).
(* Goal: @Par Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply par_symmetry.
(* Goal: @Par Tn C D A B *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
unfold Par.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(~Par_strict A B C D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
unfold Par_strict in H7.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
exists C.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
split; Col.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(HH:= col_cong_mid A B C D H6 H7 H1).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H8.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction(eq_dec_points B C).
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: False *)
subst D.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M B A)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply l7_3 in H8.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M B A)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply l7_3 in H9.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(A <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H2.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: and (@OS Tn A B C D) (@OS Tn C D A B) *)
apply False_ind.
(* Goal: False *)
assert(Col A B M).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Col Tn A B M *)
(* Goal: False *)
eapply (col_transitivity_1 _ D).
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn A D M *)
(* Goal: False *)
apply bet_col in H8.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

(* Goal: False *)
assert(B <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: False *)
apply is_midpoint_id in H9.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: False *)
assert(A <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: False *)
apply is_midpoint_id in H8.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: False *)
induction H12.

(* Goal: False *)
(* Goal: False *)
assert(HH:=symmetry_preserves_bet B A M C D H9 H8).
(* Goal: False *)
destruct HH.
(* Goal: False *)
(* Goal: False *)
assert(Bet M C D).
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: False *)
clear H15 H16.

(* Goal: False *)
(* Goal: False *)
assert(B = A /\ D = C).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D) *)
(* Goal: False *)
apply bet_cong_eq.

(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: False *)
induction H12.

(* Goal: False *)
(* Goal: False *)
assert(Bet M A C \/ Bet M C A).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
eapply (l5_2 B); assumption.
(* Goal: False *)
(* Goal: False *)
induction H15.

(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert(Bet M D B <-> Bet M A C).
(* Goal: iff (@Bet Tn M D B) (@Bet Tn M A C) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply(symmetry_preserves_bet A C M D B).
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M D B *)
Midpoint.
(* Goal: False *)
(* Goal: False *)
destruct H16.
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert(Bet M D B).
(* Goal: @Bet Tn M B D *)
(* Goal: False *)
(* Goal: False *)
apply H17.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
clear H17 H16.

(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert(A = C /\ B = D).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D) *)
(* Goal: False *)
apply bet_cong_eq.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: @Midpoint Tn A B C *)
induction H3.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
(* Goal: False *)
subst D.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: False *)
(* Goal: False *)
assert(Bet M B D <-> Bet M C A).
(* Goal: @Midpoint Tn M D B *)
apply(symmetry_preserves_bet); Midpoint.
(* Goal: False *)
(* Goal: False *)
destruct H16.
(* Goal: False *)
(* Goal: False *)
assert(Bet M B D).
(* Goal: @Bet Tn M B D *)
(* Goal: False *)
(* Goal: False *)
apply H17.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
(* Goal: False *)
clear H16 H17.

(* Goal: False *)
(* Goal: False *)
assert(C = A /\ D = B).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D) *)
(* Goal: False *)
apply bet_cong_eq.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: @Midpoint Tn A B C *)
induction H3.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
(* Goal: False *)
subst D.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

assert(HH:=symmetry_preserves_bet  A B M D C H8 H9).
(* Goal: False *)
destruct HH.
(* Goal: False *)
assert(Bet M D C).
(* Goal: @Bet Tn M D C *)
(* Goal: False *)
apply H16.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: False *)
clear H15 H16.

(* Goal: False *)
assert(A = B /\ C = D).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D) *)
(* Goal: False *)
apply bet_cong_eq.

(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

Lemma mid_plgs :
 forall A B C D M,
  ~ Col A B C ->
  Midpoint M A C -> Midpoint M B D ->
  Parallelogram_strict A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Parallelogram_strict Tn A B C D), @Parallelogram_strict Tn C D A B *)
unfold Parallelogram_strict.
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert(A <>C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert(B <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
apply l7_3 in H1.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: @Col Tn A B C *)
unfold Midpoint in H0.
(* Goal: False *)
spliter.
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert(M <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
apply l7_2 in H1.
(* Goal: False *)
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
apply is_midpoint_id in H1.
(* Goal: False *)
subst D.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert( M <> A).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
apply is_midpoint_id in H0.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.

(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn A B C *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A C) (@Bet Tn B T D)) *)
(* Goal: @Par Tn A B C D *)
(* Goal: @Cong Tn A B C D *)
assert(Col M A D).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Col Tn A B C *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T A C) (@Bet Tn B T D)) *)
(* Goal: @Par Tn A B C D *)
(* Goal: @Cong Tn A B C D *)
assert(Col M A B).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Bet Tn B M D *)
(* Goal: @Par Tn A B C D *)
(* Goal: @Cong Tn A B C D *)
apply H1.
(* Goal: @Par Tn A B C D *)
(* Goal: @Cong Tn A B C D *)
apply (l12_17 _ _ _ _ M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M D B *)
eapply (l7_13 M); Midpoint.
Qed.

Lemma mid_plgf_aux :
 forall A B C D M,
  A <> C ->
  Col A B C ->
  Midpoint M A C -> Midpoint M B D ->
  Parallelogram_flat A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram_flat Tn A A B B *)
unfold Parallelogram_flat.
induction(eq_dec_points B D).
(* Goal: False *)
subst D.
apply l7_3 in H2.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
unfold Midpoint in H1.
(* Goal: False *)
spliter.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: False *)
assert(Col A B M).
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
assert(M <> B).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply is_midpoint_id in H2.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
assert(M <> A).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: and (@TS Tn A C B D) (and (@Par Tn A B C D) (@Cong Tn A B C D)) *)
apply is_midpoint_id in H1.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Midpoint Tn A B C *)
induction H4.

assert(HH:=symmetry_preserves_bet B A M D C H2 H1).
(* Goal: False *)
destruct HH.
(* Goal: False *)
assert(Bet M D C).
apply H8.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
clear H8 H7.

(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
apply bet_col in H4.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

eapply l4_3.
apply H4.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
unfold Midpoint in H1.
(* Goal: False *)
spliter.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
unfold Midpoint in H2.
(* Goal: False *)
spliter.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
eapply (l2_11 _ M _ _ M _).
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

(* Goal: @Midpoint Tn A B C *)
induction H4.

assert(Bet M A D \/ Bet M D A).
(* Goal: or (@Bet Tn A B' A') (@Bet Tn A A' B') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (l5_2 B).
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
unfold Midpoint in H2.
(* Goal: False *)
spliter.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
induction H7.

assert(Bet M C B <-> Bet M A D).

apply (symmetry_preserves_bet A D M C B).
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Midpoint Tn M D B *)
Midpoint.
destruct H8.
assert(Bet M C B).
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
clear H9 H8.

(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply bet_col in H4.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
eapply (l2_11 _ M _ _ M _).
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
apply cong_commutativity.
eapply (l4_3).
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H7.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet M B C <-> Bet M D A).

apply (symmetry_preserves_bet D A M B C).
(* Goal: @Midpoint Tn M D B *)
Midpoint.
(* Goal: @Midpoint Tn M D B *)
Midpoint.
destruct H8.
assert(Bet M B C).
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
clear H8 H9.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply bet_col in H4.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

eapply (l2_11 _ M _ _ M _).
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

eapply l4_3.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H7.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(Bet M C D <-> Bet M A B).
apply (symmetry_preserves_bet A B M C D H1 H2).

destruct H7.
(* Goal: False *)
(* Goal: False *)
assert(Bet M C D).
apply H8.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
clear H8 H7.

(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
apply bet_col in H4.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
apply cong_commutativity.
eapply l4_3.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
apply H4.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
unfold Midpoint in H2.
(* Goal: False *)
spliter.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
unfold Midpoint in H1.
(* Goal: False *)
spliter.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
eapply (l2_11 _ M _ _ M _).
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Bet Tn C A B *)
(* Goal: @Cong Tn D A C B *)
(* Goal: False *)
eBetween.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.


Lemma mid_plgf :
 forall A B C D M,
  (A <> C \/ B <> D ) ->
  Col A B C ->
  Midpoint M A C -> Midpoint M B D ->
  Parallelogram_flat A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
eapply (mid_plgf_aux A B C D M); assumption.
(* Goal: @Parallelogram_flat Tn C D A B *)
apply plgf_sym.
(* Goal: @Parallelogram Tn A B C D *)
induction(eq_dec_points A C).
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
apply l7_3 in H1.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
unfold Midpoint in H2.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn A A B B *)
unfold Parallelogram_flat.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn C D A B *)
eapply (mid_plgf_aux C D A B M).
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.

(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
assert( M <> C).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H5.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
assert( M <> B).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_symmetry in H4.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H4.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Midpoint Tn M D B *)
Midpoint.
(* Goal: @Midpoint Tn M D B *)
Midpoint.
Qed.

Lemma mid_plg :
 forall A B C D M,
 (A <> C \/ B <> D ) ->
 Midpoint M A C -> Midpoint M B D ->
 Parallelogram A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram Tn A B C D *)
unfold Parallelogram.

(* Goal: or (@Parallelogram_strict Tn A B C D) (@Parallelogram_flat Tn A B C D) *)
induction(col_dec A B C).
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
apply (mid_plgf _ _ _ _ M);
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
apply (mid_plgs _ _ _ _ M);
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma mid_plg_1 :
 forall A B C D M,
 A <> C ->
 Midpoint M A C -> Midpoint M B D ->
 Parallelogram A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram Tn A B C D *)
apply mid_plg with M; intuition.
Qed.

Lemma mid_plg_2 :
 forall A B C D M,
 B <> D ->
 Midpoint M A C -> Midpoint M B D ->
 Parallelogram A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram Tn A B C D *)
apply mid_plg with M; intuition.
Qed.

Lemma midpoint_cong_uniqueness :
 forall A B C D M,
  Col A B C ->
  Midpoint M A B /\ Midpoint M C D ->
  Cong A B C D ->
  A = C /\ B = D \/ A = D /\ B = C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction (eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply l7_3 in H0.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A A)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' A)) (or (and (@Bet Tn A A' A) (@Bet Tn A' A B')) (and (@Bet Tn A A A') (@Bet Tn A A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H1.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: False *)
subst D.
apply l7_3 in H2.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
split; assumption.

(* Goal: @Parallelogram Tn A B C D *)
induction(eq_dec_points A C).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: False *)
spliter.
eapply symmetric_point_uniqueness.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: False *)
spliter.
assert(HH:=cong_cong_half_1 A M B C M D H0 H4 H1).
assert(A = C \/ Midpoint M A C).
apply l7_20.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
unfold Midpoint in *.
(* Goal: False *)
spliter.
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
apply bet_col in H4.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H5.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
assert(B = C).
eapply symmetric_point_uniqueness.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: False *)
(* Goal: False *)
subst C.
eapply symmetric_point_uniqueness.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: False *)
apply H0.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.



Lemma plgf_not_comm :
 forall A B C D, A <> B ->
  Parallelogram_flat A B C D ->
  ~ Parallelogram_flat A B D C /\ ~ Parallelogram_flat B A C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

assert(HH0:=plgf_mid  A B C D H0).
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
assert(HH1:=plgf_mid  A B D C H1).

(* Goal: @Parallelogram_flat Tn A A C C *)
unfold Parallelogram_flat in *.
(* Goal: False *)
spliter.
(* Goal: not (@Parallelogram_flat Tn B A C D) *)
ex_and HH0 M.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
assert(A = B /\ C = D \/ A = D /\ C = B).
(* Goal: or (and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D)) (and (@eq (@Tpoint Tn) A D) (@eq (@Tpoint Tn) C B)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
apply(midpoint_cong_uniqueness A C B D M).
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
split; assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
induction H12.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: False *)
spliter.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H5; tauto.

(* Goal: not (@Parallelogram_flat Tn B A C D) *)
ex_and HH0 M.
(* Goal: @Parallelogram_flat Tn A A C C *)
unfold Parallelogram_flat in *.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
assert(A = B /\ C = D \/ A = D /\ C = B).
(* Goal: or (and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D)) (and (@eq (@Tpoint Tn) A D) (@eq (@Tpoint Tn) C B)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
apply(midpoint_cong_uniqueness A C B D M).
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
split; assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
induction H12.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: False *)
spliter.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H7; tauto.
Qed.

Lemma plgf_cong :
 forall A B C D,
  Parallelogram_flat A B C D ->
  Cong A B C D /\ Cong A D B C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Midpoint Tn A B C *)
unfold Parallelogram_flat in H.
(* Goal: False *)
spliter.
(* Goal: and (@Plg Tn A A B B) (@Cong Tn A B A B) *)
split; Cong.
Qed.

Lemma plg_to_parallelogram : forall A B C D, Plg A B C D -> Parallelogram A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: False *)
unfold Plg in H.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram Tn A B C D *)
ex_and H0 M.
(* Goal: @Parallelogram Tn A B C D *)
eapply (mid_plg _ _ _ _ M).
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
induction H;[left|right]; assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma plgs_one_side :
 forall A B C D,
 Parallelogram_strict A B C D ->
 OS A B C D /\ OS C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) D A)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B D)))))) *)
unfold Parallelogram_strict in H.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H0.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @OS Tn C D A B *)
(* Goal: and (@OS Tn A B C D) (@OS Tn C D A B) *)
apply l12_6.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @OS Tn C D A B *)
(* Goal: and (@OS Tn A B C D) (@OS Tn C D A B) *)
apply par_strict_symmetry in H0.
(* Goal: @OS Tn C D A B *)
(* Goal: and (@OS Tn A B C D) (@OS Tn C D A B) *)
apply l12_6.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: and (@OS Tn A B C D) (@OS Tn C D A B) *)
apply False_ind.
(* Goal: False *)
spliter.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) D A)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B D)))))) *)
unfold TS in H.
(* Goal: False *)
spliter.
(* Goal: False *)
apply H5.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma parallelogram_strict_not_col : forall A B C D,
 Parallelogram_strict A B C D ->
 ~ Col A B C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Parallelogram_strict Tn A B C D), @Parallelogram_strict Tn C D A B *)
unfold Parallelogram_strict.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: False *)
spliter.
(* Goal: not (@Col Tn A B C) *)
apply two_sides_not_col in H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma parallelogram_strict_not_col_2 : forall A B C D,
 Parallelogram_strict A B C D ->
 ~ Col B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (@Col Tn A B D) *)
apply plgs_one_side in H.
(* Goal: not (@Col Tn A B D) *)
destruct H.
(* Goal: not (@Col Tn B C D) *)
apply one_side_not_col124 in H0.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma parallelogram_strict_not_col_3 : forall A B C D,
 Parallelogram_strict A B C D ->
 ~ Col C D A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Parallelogram_strict Tn A B C D), not (@Col Tn C D A) *)
unfold Parallelogram_strict, TS.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: False *)
spliter.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma parallelogram_strict_not_col_4 : forall A B C D,
 Parallelogram_strict A B C D ->
 ~ Col A B D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (@Col Tn A B D) *)
apply plgs_one_side in H.
(* Goal: not (@Col Tn A B D) *)
destruct H.
(* Goal: not (@Col Tn A B D) *)
apply one_side_not_col124 in H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma plgs__pars :
 forall A B C D,
 Parallelogram_strict A B C D ->
 Par_strict A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Par_strict Tn A B C D *)
assert (HH := H).
(* Goal: False *)
unfold Parallelogram_strict in HH; spliter.
(* Goal: False *)
destruct H1; auto; spliter.
(* Goal: @Par_strict Tn A B C D *)
apply parallelogram_strict_not_col_2 in H.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.

Lemma plgs_sym :
 forall A B C D,
  Parallelogram_strict A B C D ->
  Parallelogram_strict C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Parallelogram_strict Tn A B C D), @Parallelogram_strict Tn C D A B *)
unfold Parallelogram_strict.
(* Goal: False *)
intros; spliter.
(* Goal: and (@TS Tn C A D B) (and (@Par Tn C D A B) (@Cong Tn C D A B)) *)
repeat (split; finish).
Qed.

Lemma plg_sym :
 forall A B C D,
  Parallelogram A B C D ->
  Parallelogram C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Parallelogram_strict Tn C D A B *)
(* Goal: @Parallelogram Tn C D A B *)
apply plgs_sym.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Parallelogram_flat Tn C D A B *)
apply plgf_sym.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma Rhombus_Plg : forall A B C D, Rhombus A B C D -> Plg A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D), @Plg Tn A B C D *)
unfold Rhombus.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

Lemma Rectangle_Plg : forall A B C D,
  Rectangle A B C D ->
  Plg A B C D.
Proof.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
unfold Rectangle;tauto.
Qed.

Lemma Rectangle_Parallelogram : forall A B C D,
  Rectangle A B C D ->
  Parallelogram A B C D.
Proof.
(* Goal: not (@Rectangle Tn A B A B) *)
unfold Rectangle.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram Tn A B C D *)
decompose [and] H.
(* Goal: @Parallelogram Tn A B C D *)
apply plg_to_parallelogram in H0.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
Qed.

Lemma plg_cong_rectangle :
 forall A B C D,
  Plg A B C D ->
  Cong A C B D ->
  Rectangle A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (@Rectangle Tn A B A B) *)
unfold Rectangle.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

(*////////////////////////////////////////////////////////////////*)

Lemma plg_trivial : forall A B, A <> B -> Parallelogram A B B A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Parallelogram_flat Tn A A B B *)
unfold Parallelogram_flat.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
Qed.

Lemma plg_trivial1 : forall A B, A <> B -> Parallelogram A A B B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Parallelogram_flat Tn A A B B *)
unfold Parallelogram_flat.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
Qed.

Lemma col_not_plgs : forall A B C D, Col A B C -> ~Parallelogram_strict A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
unfold Parallelogram_strict in H0.
(* Goal: False *)
spliter.
(* Goal: False *)
unfold TS in H0.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: False *)
spliter.
(* Goal: False *)
apply H0.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma plg_col_plgf : forall A B C D, Col A B C -> Parallelogram A B C D -> Parallelogram_flat A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H0.
(* Goal: @Parallelogram_flat Tn A B C D *)
(* Goal: @Parallelogram_flat Tn A B C D *)
eapply (col_not_plgs A B C D) in H.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.





Lemma plg_bet1 : forall A B C D, Parallelogram A B C D -> Bet A C B -> Bet D A C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

(* Goal: @Bet Tn D A C *)
apply plg_col_plgf in H.
(* Goal: @Midpoint Tn A B C *)
unfold Parallelogram_flat in H.
(* Goal: False *)
spliter.
(* Goal: @Bet Tn D A C *)
(* Goal: @Col Tn A B C *)
apply between_symmetry.
(* Goal: @Bet Tn C A D *)
(* Goal: @Col Tn A B C *)
apply (col_cong2_bet1 B).
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
Qed.

Lemma plgf_trivial1 : forall A B, A <> B -> Parallelogram_flat A B B A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
Qed.

Lemma plgf_trivial2 : forall A B, A <> B -> Parallelogram_flat A A B B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
Qed.

Lemma plgf_not_point : forall A B, Parallelogram_flat A A B B -> A <> B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Midpoint Tn A B C *)
unfold Parallelogram_flat in H.
(* Goal: False *)
spliter.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H3; tauto.
Qed.

Lemma plgf_trivial_neq : forall A C D, Parallelogram_flat A A C D -> C = D /\ A <> C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Midpoint Tn A B C *)
unfold Parallelogram_flat in H.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A A)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' A)) (or (and (@Bet Tn A A' A) (@Bet Tn A' A B')) (and (@Bet Tn A A A') (@Bet Tn A A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H1.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: False *)
subst D.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @eq (@Tpoint Tn) C C *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
reflexivity.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H3; auto.
Qed.

Lemma plgf_trivial_trans : forall A B C, Parallelogram_flat A A B B -> Parallelogram_flat B B C C 
                                           -> Parallelogram_flat A A C C \/ A = C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

(* Goal: @Parallelogram Tn A B C D *)
induction(eq_dec_points A C).
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Parallelogram_flat Tn A A C C *)
unfold Parallelogram_flat in *.
(* Goal: False *)
spliter.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
Qed.


(**********************************************************************************************************)

Lemma plgf_trivial : forall A B, A <> B -> Parallelogram_flat A B B A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
Qed.



Lemma plgf3_mid : forall A B C, Parallelogram_flat A B A C -> Midpoint A B C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Midpoint Tn A B C *)
unfold Parallelogram_flat in H.
(* Goal: False *)
spliter.

(* Goal: @Midpoint Tn A B C *)
assert(B=C \/ Midpoint A B C).
(* Goal: or (@eq (@Tpoint Tn) B C) (@Midpoint Tn A B C) *)
(* Goal: @Midpoint Tn A B C *)
eapply l7_20.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Midpoint Tn A B C *)
induction H3.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
(* Goal: @Midpoint Tn A B C *)
induction H4.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma cong3_id : forall A B C D, A <> B -> Col A B C -> Col A B D -> Cong A B C D -> Cong A D B C -> Cong A C B D 
                             -> A = D /\ B = C \/ A = C /\ B = D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

(* Goal: @Parallelogram Tn A B C D *)
induction(eq_dec_points A C).
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_symmetry in H4.
(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H4.
(* Goal: False *)
subst D.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @eq (@Tpoint Tn) C C *)
(* Goal: not (@eq (@Tpoint Tn) A C) *)
split; reflexivity.

assert(exists M,  (Midpoint M A B /\ Midpoint M C D) \/ (Midpoint M A D /\ Midpoint M C B)).
apply col_cong_mid.
(* Goal: @Par Tn C D A B *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
unfold Par.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.

(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.

(* Goal: False *)
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply cong_identity in H4.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
unfold Par_strict in H6.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Bet Tn D E C) (@Cong Tn D A D E)) *)
(* Goal: @Bet Tn C B D' *)
exists A.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
split; Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
ex_and H6 M.

induction H7.

eapply midpoint_cong_uniqueness.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
spliter.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
apply H6.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

assert(Col A D C).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

assert(Cong A D C B).
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

assert(HH:= midpoint_cong_uniqueness A D C B M H7 H6 H8).
induction HH.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.


Lemma col_cong_mid1 : forall A B C D, A <> D -> Col A B C -> Col A B D -> Cong A B C D -> Cong A C B D 
                                 -> exists M, Midpoint M A D /\ Midpoint M B C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

assert(exists M : Tpoint,
       Midpoint M A C /\ Midpoint M B D \/
       Midpoint M A D /\ Midpoint M B C).

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H2.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: False *)
subst D.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
assert(HH:=midpoint_existence A C).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => or (and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) (and (@Midpoint Tn M A D) (@Midpoint Tn M B C))) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert (C <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => or (and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) (and (@Midpoint Tn M A D) (@Midpoint Tn M B C))) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply (col_cong_mid A B C D).
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; ColR.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
unfold Par_strict in H6.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
exists C.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
split; Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
ex_and H4 M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H5.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
assert(A = B /\ C = D \/ A = D /\ C = B).

(* Goal: or (and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) C D)) (and (@eq (@Tpoint Tn) A D) (@eq (@Tpoint Tn) C B)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A D) (@Midpoint Tn M B C)) *)
apply (midpoint_cong_uniqueness A C B D M).
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H5.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: False *)
subst D.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma col_cong_mid2 : forall A B C D, A <> C -> Col A B C -> Col A B D -> Cong A B C D -> Cong A D B C 
                                 -> exists M, Midpoint M A C /\ Midpoint M B D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

assert(exists M : Tpoint,
       Midpoint M A C /\ Midpoint M B D \/
       Midpoint M A D /\ Midpoint M B C).

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H2.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: False *)
subst D.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
assert(HH:=midpoint_existence A C).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => or (and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) (and (@Midpoint Tn M A D) (@Midpoint Tn M B C))) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert (C <> D).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => or (and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) (and (@Midpoint Tn M A D) (@Midpoint Tn M B C))) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply (col_cong_mid A B C D).
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; ColR.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
unfold Par_strict in H6.
(* Goal: False *)
spliter.
(* Goal: False *)
(* Goal: @Cong Tn A B C D *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H9.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
exists C.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
split; Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
ex_and H4 M.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H5.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
assert(A = B /\ D = C \/ A = C /\ D = B).

(* Goal: or (and (@eq (@Tpoint Tn) A B) (@eq (@Tpoint Tn) D C)) (and (@eq (@Tpoint Tn) A C) (@eq (@Tpoint Tn) D B)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply (midpoint_cong_uniqueness A D B C M).
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
induction H5.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: False *)
subst D.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.

(*******************************************************************************************************)

Lemma plgs_not_col : forall A B C D, Parallelogram_strict A B C D ->
  ~ Col A B C /\ ~ Col B C D /\ ~ Col C D A /\ ~ Col A B D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
repeat split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
apply parallelogram_strict_not_col in H; assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
apply parallelogram_strict_not_col_2 in H; assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
apply parallelogram_strict_not_col_3 in H; assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
apply parallelogram_strict_not_col_4 in H; assumption.
Qed.

Lemma not_col_sym_not_col : forall A B B' C , ~Col A B C -> Midpoint A B B' -> ~Col A B' C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn A B C *)
unfold Midpoint in H0.
(* Goal: False *)
spliter.
(* Goal: @Col Tn A B C *)
assert(A <> B).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Col Tn A B C *)
assert(A <> B').
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
(* Goal: @Col Tn A B C *)
apply bet_col in H0.
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
Qed.

Lemma plg_existence : forall A B C, A <> B -> exists D, Parallelogram A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
assert(HH:=midpoint_existence A C).
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
ex_and HH M.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
prolong B M D B M.

(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
assert(Midpoint M B D).
(* Goal: @Midpoint Tn M B D *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram Tn A B C D) *)
unfold Midpoint.
(* Goal: and (@Plg Tn A A B B) (@Cong Tn A B A B) *)
split; Cong.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D) *)
exists D.

(* Goal: @Parallelogram Tn A B C D *)
induction (eq_dec_points A C).
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply l7_3 in H0.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
repeat split; Col; Cong.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: @Parallelogram Tn A B C D *)
apply l7_3 in H3.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: @Parallelogram Tn A B C D *)
apply (mid_plg _ _ _ _ M).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma plgs_diff : forall A B C D, Parallelogram_strict A B C D -> Parallelogram_strict A B C D /\ A <> B /\ B <> C /\ C <> D /\ D <> A /\ A <> C /\ B <> D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) D A)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B D)))))) *)
unfold Parallelogram_strict in H.
(* Goal: False *)
spliter.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) B C)) (and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) D A)) (and (not (@eq (@Tpoint Tn) A C)) (not (@eq (@Tpoint Tn) B D)))))) *)
unfold TS in H.
(* Goal: False *)
spliter.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
repeat split; intro.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply H2.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
subst D.
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply H2.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
(* Goal: False *)
subst C.
(* Goal: False *)
(* Goal: False *)
apply H.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
subst D.
(* Goal: False *)
ex_and H3 T.
(* Goal: False *)
apply between_identity in H4.
(* Goal: False *)
subst T.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.

Lemma sym_par : forall A B M, A <> B -> forall A' B', Midpoint M A A' -> Midpoint M B B' -> Par A B A' B'.

Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
eapply (l12_17 _ _ _ _ M); assumption.
Qed.

Lemma symmetry_preserves_two_sides : forall A B X Y M A' B', Col X Y M -> TS X Y A B -> Midpoint M A A' -> Midpoint M B B'
                                               -> TS X Y A' B'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

assert(X <> Y /\ ~Col A X Y /\ ~Col B X Y).
(* Goal: False *)
unfold TS in H0.
(* Goal: False *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
subst Y.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
spliter.

(* Goal: False *)
assert(A <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply H4.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

assert(A' <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply H6.
apply sym_equal.
apply is_midpoint_id.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

(* Goal: False *)
assert(B <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
apply H5.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

assert(B' <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply H8.
apply sym_equal.
apply is_midpoint_id.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(TS X Y A A').
unfold TS.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
apply H4.
unfold Midpoint in H1.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.

assert(Col M A' X).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

assert(Col M A' Y).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
eapply (col3 A' M); Col.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
apply midpoint_bet.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(TS X Y B B').
unfold TS.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
apply H5.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
unfold Midpoint in H2.
(* Goal: False *)
spliter.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.

assert(Col M B' X).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

assert(Col M B' Y).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
eapply (col3 B' M); Col.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
apply midpoint_bet.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(OS X Y A' B).
eapply l9_8_1.
apply l9_2.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
apply l9_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
eapply l9_8_2.
apply H11.
apply one_side_symmetry.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma symmetry_preserves_one_side : forall A B X Y M A' B', Col X Y M -> OS X Y A B -> Midpoint M A A' -> Midpoint M B B'
                                               -> OS X Y A' B'.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

assert(X <> Y /\ ~Col A X Y /\ ~Col B X Y).
unfold OS in H0.
ex_and H0 P.
(* Goal: False *)
unfold TS in H0.
unfold TS in H3.
(* Goal: False *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
subst Y.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: False *)
spliter.

(* Goal: False *)
assert(A <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply H4.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

assert(A' <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply H6.
apply sym_equal.
apply is_midpoint_id.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

(* Goal: False *)
assert(B <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
(* Goal: False *)
apply H5.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.

assert(B' <> M).
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: @Parallelogram Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
subst M.
apply H8.
apply sym_equal.
apply is_midpoint_id.
(* Goal: @Midpoint Tn M A' A *)
(* Goal: @Col Tn B' A' A *)
(* Goal: False *)
apply l7_2.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(TS X Y A A').
unfold TS.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
apply H4.
unfold Midpoint in H1.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_flat Tn A B A D *)
(* Goal: @Parallelogram Tn A B C D *)
apply bet_col in H1.

assert(Col M A' X).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

assert(Col M A' Y).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
eapply (col3 A' M); Col.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
apply midpoint_bet.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.

assert(TS X Y B B').
unfold TS.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
repeat split; auto.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
apply H5.
(* Goal: @Parallelogram_flat Tn A D A B *)
(* Goal: @Parallelogram_flat Tn C D A B *)
unfold Midpoint in H2.
(* Goal: False *)
spliter.
(* Goal: @Col Tn C D A *)
(* Goal: @Midpoint Tn M C A *)
(* Goal: @Midpoint Tn M D B *)
apply bet_col in H2.

assert(Col M B' X).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

assert(Col M B' Y).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
eapply (col3 B' M); Col.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M A C)) *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
exists M.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
apply midpoint_bet.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
eapply l9_8_1.
apply l9_2.
(* Goal: False *)
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A C) (@Midpoint Tn M B D)) *)
apply H10.
apply l9_2.

eapply l9_8_2.
apply H11.
apply one_side_symmetry.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma plgf_bet : forall A B A' B', Parallelogram_flat A B B' A' 
                                 -> Bet A' B' A /\ Bet B' A B 
                                 \/ Bet A' A B' /\ Bet A B' B
                                 \/ Bet A A' B /\ Bet A' B B'
                                 \/ Bet A B A' /\ Bet B A' B'.

Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.
(* Goal: False *)
spliter.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A B).
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A A)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' A)) (or (and (@Bet Tn A A' A) (@Bet Tn A' A B')) (and (@Bet Tn A A A') (@Bet Tn A A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H1.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
split;
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
assert(A' <> B').
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: False *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H1.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
assert(Col A' B' A).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
assert(Col A' B' B).
(* Goal: @Col Tn A' B' B *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
ColR.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H0.
(* Goal: or (not (@eq (@Tpoint Tn) A A)) (not (@eq (@Tpoint Tn) B D)) *)
(* Goal: @Parallelogram Tn A B C D *)
right; right; right.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
apply (col_cong2_bet1 A);
Col;
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H0.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
right;right; left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn A' B B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
eapply(col_cong2_bet2 _ A).
(* Goal: @Col Tn B A B' *)
(* Goal: @Bet Tn B A' A *)
(* Goal: @Cong Tn B A A' B' *)
(* Goal: @Cong Tn B B' A A' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Col.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
assert(Bet A' B B').
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (outer_transitivity_between2 _ A); auto.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
assert(B = B' /\ A' = A).
(* Goal: and (@eq (@Tpoint Tn) B B') (@eq (@Tpoint Tn) A' A) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply(bet_cong_eq A' A B B' H0 H8).
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
Cong.
(* Goal: False *)
spliter.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
right;left.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
split; Between.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction H.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
right;left.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
split;auto.
eapply (between_inner_transitivity _ _ _ B);
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
induction(eq_dec_points A A').
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst A'.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_symmetry in H2.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply cong_identity in H2.
(* Goal: or (and (@Bet Tn A B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A B) (@Bet Tn A B B')) (and (@Bet Tn A B A) (@Bet Tn B A B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
subst B'.
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
right;left.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
split; Between.

(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
left.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.

(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
assert(Bet A B' A' \/ Bet A A' B').
(* Goal: or (@Bet Tn A B' A') (@Bet Tn A A' B') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (l5_2 B).
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
induction H9.
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.

(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
assert(Bet B' A' B).
(* Goal: @Bet Tn B' A' B *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (outer_transitivity_between _ _ A).
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
auto.

(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
assert(Bet B A' B').
(* Goal: @Bet Tn B A' B' *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
eapply (outer_transitivity_between2 _ A).
(* Goal: @Bet Tn B A A' *)
(* Goal: @Bet Tn A A' B' *)
(* Goal: not (@eq (@Tpoint Tn) A A') *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
Between.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.



(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
assert(A = B /\ B' = A').
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
apply(bet_cong_eq); Between; Cong.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma plgs_existence : forall A B, A <> B -> exists C, exists D, Parallelogram_strict A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.

(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
assert(HH:=not_col_exists A B H).
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
ex_and HH C.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
assert(HH:=plg_existence A B C H).
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
ex_and HH D.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D)) *)
exists C.
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Parallelogram_strict Tn A B C D) *)
exists D.
(* Goal: @Parallelogram_strict Tn A B C D *)
induction H1.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Parallelogram_strict Tn A B C D *)
unfold Parallelogram_flat in H1.
(* Goal: False *)
spliter.
(* Goal: @Parallelogram_strict Tn A B C D *)
contradiction.
Qed.

Lemma Rectangle_not_triv : forall A,
 ~ Rectangle A A A A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (@Rectangle Tn A B A B) *)
unfold Rectangle.
(* Goal: @Plg Tn A A B B *)
unfold Plg.
(* Goal: False *)
intuition.
Qed.

Lemma Rectangle_triv : forall A B,
 A<>B ->
 Rectangle A A B B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (@Rectangle Tn A B A B) *)
unfold Rectangle.
(* Goal: @Cong Tn A B A' B' *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
(* Goal: or (and (@Bet Tn A' B' A) (@Bet Tn B' A B)) (or (and (@Bet Tn A' A B') (@Bet Tn A B' B)) (or (and (@Bet Tn A A' B) (@Bet Tn A' B B')) (and (@Bet Tn A B A') (@Bet Tn B A' B')))) *)
split;Cong.
(* Goal: @Plg Tn A A B B *)
unfold Plg.
(* Goal: and (or (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) A B))) (@ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B))) *)
split.
(* Goal: False *)
intuition.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B)) *)
elim (midpoint_existence A B).
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun M : @Tpoint Tn => and (@Midpoint Tn M A B) (@Midpoint Tn M A B)) *)
exists x.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

Lemma Rectangle_not_triv_2 : forall A B,
 ~ Rectangle A B A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: not (@Rectangle Tn A B A B) *)
unfold Rectangle.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
spliter.
(* Goal: False *)
unfold Plg in H.
(* Goal: False *)
intuition.
Qed.

Lemma Square_not_triv : forall A,
 ~ Square A A A A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Square Tn A B C D *)
unfold Square.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
spliter.
(* Goal: False *)
firstorder using Rectangle_not_triv.
Qed.

Lemma Square_not_triv_2 : forall A B,
 ~ Square A A B B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Square Tn A B C D *)
unfold Square.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
spliter.
(* Goal: False *)
treat_equalities.
(* Goal: False *)
firstorder using Rectangle_not_triv.
Qed.

Lemma Square_not_triv_3 : forall A B,
 ~ Square A B A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Square Tn A B C D *)
unfold Square.
(* Goal: not (and (@Rectangle Tn A B A B) (@Cong Tn A B B A)) *)
intro.
(* Goal: False *)
spliter.
(* Goal: False *)
firstorder using Rectangle_not_triv_2.
Qed.



Lemma Square_Rectangle : forall A B C D,
 Square A B C D -> Rectangle A B C D.
Proof.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
unfold Square;tauto.
Qed.

Lemma Square_Parallelogram :  forall A B C D,
 Square A B C D -> Parallelogram A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Parallelogram Tn A B C D *)
apply Square_Rectangle in H.
(* Goal: @Parallelogram Tn A B C D *)
apply Rectangle_Parallelogram in H.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
Qed.

Lemma Rhombus_Rectangle_Square : forall A B C D,
 Rhombus A B C D ->
 Rectangle A B C D ->
 Square A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Square Tn A B C D *)
unfold Square.
(* Goal: and (@Rectangle Tn A B C D) (@Cong Tn A B B C) *)
unfold Rhombus in *.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

Lemma rhombus_cong_square : forall A B C D,
 Rhombus A B C D ->
 Cong A C B D ->
 Square A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Rhombus Tn A B C D) (_ : @Cong Tn A C B D), @Square Tn A B C D *)
intros.
(* Goal: @Square Tn A B C D *)
apply Rhombus_Rectangle_Square.
(* Goal: @Rhombus Tn A B C D *)
(* Goal: @Rectangle Tn A B C D *)
assumption.
(* Goal: @Rectangle Tn A B C D *)
apply Rhombus_Plg in H.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
apply plg_cong_rectangle;auto.
Qed.

Lemma Kite_comm : forall A B C D,
 Kite A B C D -> Kite C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Kite Tn A B C D), @Kite Tn C D A B *)
unfold Kite.
(* Goal: not (@eq (@Tpoint Tn) A' A) *)
(* Goal: @Bet Tn A' B' A *)
(* Goal: @Bet Tn B' A B *)
tauto.
Qed.

End Quadrilateral.