Ltac Circle := auto with circle.Ltac treat_equalities :=
try treat_equalities_aux;
repeat
  match goal with
   | H:(Cong ?X3 ?X3 ?X1 ?X2) |- _ =>
      apply cong_symmetry in H; apply cong_identity in H;
      smart_subst X2;clean_reap_hyps
   | H:(Cong ?X1 ?X2 ?X3 ?X3) |- _ =>
      apply cong_identity in H;smart_subst X2;clean_reap_hyps
   | H:(Bet ?X1 ?X2 ?X1) |- _ =>
      apply  between_identity in H;smart_subst X2;clean_reap_hyps
   | H:(Midpoint ?X ?Y ?Y) |- _ => apply l7_3 in H; smart_subst Y;clean_reap_hyps
   | H : Bet ?A ?B ?C, H2 : Bet ?B ?A ?C |- _ =>
     let T := fresh in not_exist_hyp (A=B); assert (T : A=B) by (apply (between_equality A B C); finish);
                       smart_subst A;clean_reap_hyps
   | H : Bet ?A ?B ?C, H2 : Bet ?A ?C ?B |- _ =>
     let T := fresh in not_exist_hyp (B=C); assert (T : B=C) by (apply (between_equality_2 A B C); finish);
                       smart_subst B;clean_reap_hyps
   | H : Bet ?A ?B ?C, H2 : Bet ?C ?A ?B |- _ =>
     let T := fresh in not_exist_hyp (A=B); assert (T : A=B) by (apply (between_equality A B C); finish);
                       smart_subst A;clean_reap_hyps
   | H : Bet ?A ?B ?C, H2 : Bet ?B ?C ?A |- _ =>
     let T := fresh in not_exist_hyp (B=C); assert (T : B=C) by (apply (between_equality_2 A B C); finish);
                       smart_subst A;clean_reap_hyps
   | H:(Le ?X1 ?X2 ?X3 ?X3) |- _ =>
      apply le_zero in H;smart_subst X2;clean_reap_hyps
   | H : Midpoint ?P ?A ?P1, H2 : Midpoint ?P ?A ?P2 |- _ =>
     let T := fresh in not_exist_hyp (P1=P2);
                      assert (T := symmetric_point_uniqueness A P P1 P2 H H2);
                      smart_subst P1;clean_reap_hyps
   | H : Midpoint ?A ?P ?X, H2 : Midpoint ?A ?Q ?X |- _ =>
     let T := fresh in not_exist_hyp (P=Q); assert (T := l7_9 P Q A X H H2);
                       smart_subst P;clean_reap_hyps
   | H : Midpoint ?A ?P ?X, H2 : Midpoint ?A ?X ?Q |- _ =>
     let T := fresh in not_exist_hyp (P=Q); assert (T := l7_9_bis P Q A X H H2);
                       smart_subst P;clean_reap_hyps
   | H : Midpoint ?M ?A ?A |- _ =>
     let T := fresh in not_exist_hyp (M=A); assert (T : l7_3 M A H);
                       smart_subst M;clean_reap_hyps
   | H : Midpoint ?A ?P ?P', H2 : Midpoint ?B ?P ?P' |- _ =>
     let T := fresh in not_exist_hyp (A=B); assert (T := l7_17 P P' A B H H2);
                       smart_subst A;clean_reap_hyps
   | H : Midpoint ?A ?P ?P', H2 : Midpoint ?B ?P' ?P |- _ =>
     let T := fresh in not_exist_hyp (A=B); assert (T := l7_17_bis P P' A B H H2);
                       smart_subst A;clean_reap_hyps
   | H : Midpoint ?A ?B ?A |- _ =>
     let T := fresh in not_exist_hyp (A=B); assert (T := is_midpoint_id_2 A B H);
                       smart_subst A;clean_reap_hyps
   | H : Midpoint ?A ?A ?B |- _ =>
     let T := fresh in not_exist_hyp (A=B); assert (T := is_midpoint_id A B H);
                       smart_subst A;clean_reap_hyps
   | H : OnCircle ?A ?A ?B |- _ =>
      apply cong_reverse_identity in H;smart_subst B;clean_reap_hyps
   | H : OnCircle ?B ?A ?A |- _ =>
      apply cong_identity in H;smart_subst B;clean_reap_hyps
   | H : InCircle ?B ?A ?A |- _ =>
      apply le_zero in H;smart_subst B;clean_reap_hyps
   | H : OutCircle ?A ?A ?B |- _ =>
      apply le_zero in H;smart_subst B;clean_reap_hyps
end.

(* Specifications: *)
Lemma bet_inc2__incs : forall O P U V X, X <> U -> X <> V -> Bet U X V -> InCircle U O P -> InCircle V O P -> InCircleS X O P.
Lemma bet_incs2__incs : forall O P U V X, Bet U X V -> InCircleS U O P -> InCircleS V O P -> InCircleS X O P.
Lemma bet_inc2__inc : forall A B U V P, InCircle U A B -> InCircle V A B -> Bet U P V -> InCircle P A B.
Lemma col_inc_onc2__bet : forall A B U V P, U <> V -> OnCircle U A B -> OnCircle V A B -> Col U V P -> InCircle P A B -> Bet U P V.
Lemma onc2_out__outcs : forall A B U V P, U <> V -> OnCircle U A B -> OnCircle V A B -> Out P U V -> OutCircleS P A B.
Lemma col_inc2_outcs__out : forall A B U V P, InCircle U A B -> InCircle V A B -> Col U V P -> OutCircleS P A B -> Out P U V.
Lemma col_onc2__mid : forall A B U V, U <> V -> OnCircle U A B -> OnCircle V A B -> Col U V A -> Midpoint A U V.
Lemma chord_completion : forall A B U P, OnCircle U A B -> InCircle P A B -> exists V, OnCircle V A B /\ Bet U P V.
Lemma outcs_exists : forall O P, exists Q, OutCircleS Q O P.
Lemma outcs_exists1 : forall O P X, X <> O -> exists Q, Out O X Q /\ OutCircleS Q O P.
Lemma incs_exists : forall O P, O <> P -> exists Q, InCircleS Q O P.
Lemma incs_exists1 : forall O P X, X <> O -> P <> O -> exists Q, Out O X Q /\ InCircleS Q O P.
Lemma onc_exists : forall O P X, X <> O -> O <> P -> exists Q, OnCircle Q O P /\ Out O X Q.
Lemma diam_points : forall O P X, exists Q1 Q2, Bet Q1 O Q2 /\ Col Q1 Q2 X /\ OnCircle Q1 O P /\ OnCircle Q2 O P.
Lemma symmetric_oncircle : forall X Y O P, Midpoint O X Y -> OnCircle X O P -> OnCircle Y O P.
Lemma mid_onc2__per : forall O P U V X, OnCircle U O P -> OnCircle V O P -> Midpoint X U V -> Per O X U.
Lemma mid_onc2__perp : forall O P A B X, O <> X -> A <> B -> OnCircle A O P -> OnCircle B O P -> Midpoint X A B -> Perp O X A B.
Lemma col_onc2_perp__mid : forall O P A B X, O<>X -> A<>B -> Col A B X -> OnCircle A O P -> OnCircle B O P -> Perp O X A B -> Midpoint X A B.
Lemma circle_circle_os : forall A B C D I P, OnCircle I A B -> OnCircle I C D -> ~ Col A C I -> ~ Col A C P -> exists Z, OnCircle Z A B /\ OnCircle Z C D /\ OS A C P Z.
Lemma circle_circle_cop : forall A B C D I P, OnCircle I A B -> OnCircle I C D -> exists Z, OnCircle Z A B /\ OnCircle Z C D /\ Coplanar A C P Z.
Lemma line_circle_two_points : forall O P U V W, U <> V -> Col U V W -> OnCircle U O P -> OnCircle V O P -> OnCircle W O P -> W = U \/ W = V.
Lemma onc2_mid__incs : forall O P U V M, U <> V -> OnCircle U O P -> OnCircle V O P -> Midpoint M U V -> InCircleS M O P.
Lemma circle_cases : forall O P X, OnCircle X O P \/ InCircleS X O P \/ OutCircleS X O P.
Lemma inc__radius : forall O P X, InCircle X O P -> exists Y, OnCircle Y O P /\ Bet O X Y.
Lemma onc_not_center : forall O P A, O <> P -> OnCircle A O P -> A <> O.
Lemma onc2_per__mid : forall O P U V M, U <> V -> M <> U -> OnCircle U O P -> OnCircle V O P -> Col M U V -> Per O M U -> Midpoint M U V .
Lemma cong_chord_cong_center : forall O P A B C D M N, OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> OnCircle D O P -> Midpoint M A B -> Midpoint N C D -> Cong A B C D -> Cong O N O M.
Lemma cong_chord_cong_center1 : forall O P A B C D M N, A <> B -> C <> D -> M <> A -> N <> C -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> OnCircle D O P -> Col M A B -> Col N C D -> Per O M A -> Per O N C -> Cong A B C D -> Cong O N O M.
Lemma onc_sym__onc : forall O P A B X Y, Bet O A B -> OnCircle A O P -> OnCircle B O P -> OnCircle X O P -> ReflectL X Y A B -> OnCircle Y O P.
Lemma mid_onc__diam : forall O P A B, OnCircle A O P -> Midpoint O A B -> Diam A B O P.
Lemma chord_le_diam : forall O P A B U V, Diam A B O P -> OnCircle U O P -> OnCircle V O P -> Le U V A B.
Lemma chord_lt_diam : forall O P A B U V, ~ Col O U V -> Diam A B O P -> OnCircle U O P -> OnCircle V O P -> Lt U V A B.
Lemma inc2_le_diam: forall O P A B U V, Diam A B O P -> InCircle U O P -> InCircle V O P -> Le U V A B.
Lemma onc_col_diam__eq : forall O P A B X, Diam A B O P -> OnCircle X O P -> Col A B X -> X = A \/ X = B.
Lemma onc2_out__eq : forall O P A B, OnCircle A O P -> OnCircle B O P -> Out O A B -> A = B.
Lemma bet_onc_le_a : forall O P A B T X, Diam A B O P -> Bet B O T -> OnCircle X O P -> Le T A T X.
Lemma bet_onc_lt_a : forall O P A B T X, Diam A B O P -> O <> P -> O <> T -> X <> A -> Bet B O T -> OnCircle X O P -> Lt T A T X.
Lemma bet_onc_le_b : forall O P A B T X, Diam A B O P -> Bet A O T -> OnCircle X O P -> Le T X T A.
Lemma bet_onc_lt_b : forall O P A B T X, Diam A B O P -> T <> O -> X <> A -> Bet A O T -> OnCircle X O P -> Lt T X T A.
Lemma incs2_lt_diam : forall O P A B U V, Diam A B O P -> InCircleS U O P -> InCircleS V O P -> Lt U V A B.
Lemma incs_onc_diam__lt : forall O P A B U V, Diam A B O P -> InCircleS U O P -> OnCircle V O P -> Lt U V A B.
Lemma diam_cong_incs__outcs : forall O P A B U V, Diam A B O P -> Cong A B U V -> InCircleS U O P -> OutCircleS V O P.
Lemma diam_uniqueness : forall O P A B X, Diam A B O P -> Cong A X A B -> OnCircle X O P -> X = B.
Lemma onc3__ncol : forall O P A B C, A <> B -> A <> C -> B <> C -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> ~ Col A B C.
Lemma diam_exists : forall O P T, exists A, exists B, Diam A B O P /\ Col A B T.
Lemma chord_intersection : forall O P A B X Y, OnCircle A O P -> OnCircle B O P -> OnCircle X O P -> OnCircle Y O P -> TS A B X Y -> TS X Y A B.
Lemma ray_cut_chord : forall O P A B X Y, Diam A B O P -> OnCircle X O P -> OnCircle Y O P -> TS A B X Y -> OS X Y O A -> TS X Y O B.
Lemma center_col__diam : forall O P A B, A <> B -> Col O A B -> OnCircle A O P -> OnCircle B O P -> Diam A B O P.
Lemma diam__midpoint: forall O P A B, Diam A B O P -> Midpoint O A B.
Lemma diam_sym : forall O P A B, Diam A B O P -> Diam B A O P.
Lemma diam_end_uniqueness : forall O P A B C, Diam A B O P -> Diam A C O P -> B = C.
Lemma center_onc2_mid__ncol : forall O P A B M , O <> P -> ~ Col O A B -> OnCircle A O P -> OnCircle B O P -> Midpoint M A B -> ~ Col A O M.
Lemma bet_chord__diam_or_ncol : forall O P A B T, A <> B -> T <> A -> T <> B -> OnCircle A O P -> OnCircle B O P -> Bet A T B -> Diam A B O P \/ ~Col O A T /\ ~Col O B T.
Lemma mid_chord__diam_or_ncol : forall O P A B T, A <> B -> OnCircle A O P -> OnCircle B O P -> Midpoint T A B -> Diam A B O P \/ ~Col O A T /\ ~Col O B T.
Lemma cop_mid_onc2_perp__col : forall O P A B X Y, A <> B -> OnCircle A O P -> OnCircle B O P -> Midpoint X A B -> Perp X Y A B -> Coplanar O A B Y -> Col X Y O.
Lemma cong2_cop2_onc3__eq : forall O P X A B C, A <> B -> A <> C -> B <> C -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> Coplanar A B C O -> Cong X A X B -> Cong X A X C -> Coplanar A B C X -> X = O.
Lemma tree_points_onc_cop : forall O P, O <> P -> exists A B C, A <> B /\ A <> C /\ B <> C /\ OnCircle A O P /\ OnCircle B O P /\ OnCircle C O P /\ Coplanar A B C O.
Lemma tree_points_onc_cop2 : forall O P Q, O <> P -> exists A B C, A <> B /\ A <> C /\ B <> C /\ OnCircle A O P /\ OnCircle B O P /\ OnCircle C O P /\ Coplanar A B C O /\ Coplanar A B C Q.
Lemma tree_points_onc : forall O P, O <> P -> exists A B C, A <> B /\ A <> C /\ B <> C /\ OnCircle A O P /\ OnCircle B O P /\ OnCircle C O P.
Lemma bet_cop_onc2__ex_onc_os_out : forall O P A B C I, A <> I -> B <> I -> ~ Col A B C -> ~ Col A B O -> OnCircle A O P -> OnCircle B O P -> Bet A I B -> Coplanar A B C O -> exists C1, Out C1 O I /\ OnCircle C1 O P /\ OS A B C C1.
Lemma EqC_chara: forall A B C D, EqC A B C D <-> A = C /\ Cong A B C D.
Lemma nEqC_chara : forall A B C D, A <> B -> ~ EqC A B C D <-> (exists X, OnCircle X A B /\ ~ OnCircle X C D).
Lemma EqC_sym : forall A B C D, EqC A B C D -> EqC C D A B.
Lemma mid_onc2_perp__col : forall O P A B X Y, A <> B -> OnCircle A O P -> OnCircle B O P -> Midpoint X A B -> Perp X Y A B -> Col X Y O.
Lemma mid2_onc4__eq : forall O P A B C D X, B <> C-> A <> B -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> OnCircle D O P -> Midpoint X A C -> Midpoint X B D -> X=O.
Lemma cong2_onc3__eq : forall O P X A B C, A <> B -> A <> C -> B <> C -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> Cong X A X B -> Cong X A X C -> X = O.
Lemma onc2_mid_cong_col : forall O P U V M X, U <> V ->OnCircle U O P -> OnCircle V O P -> Midpoint M U V -> Cong U X V X -> Col O X M.
Lemma cong_onc3_cases : forall O P A X Y, Cong A X A Y -> OnCircle A O P -> OnCircle X O P -> OnCircle Y O P -> X = Y \/ ReflectL X Y O A.
Lemma bet_cong_onc3_cases : forall O P A X Y T, T <> O -> Bet A O T -> Cong T X T Y -> OnCircle A O P -> OnCircle X O P -> OnCircle Y O P -> X = Y \/ ReflectL X Y O A.
Lemma prop_7_8 : forall O P A B T X Y , Diam A B O P -> Bet A O T -> OnCircle X O P -> OnCircle Y O P -> LeA A O X A O Y -> Le T Y T X.
Lemma Prop_7_8_uniqueness : forall O P A X Y Z T, T <> O -> X <> Y -> Bet A O T -> Cong T X T Y -> Cong T X T Z -> OnCircle A O P -> OnCircle X O P -> OnCircle Y O P -> OnCircle Z O P -> Z = X \/ Z = Y.
Lemma chords_midpoints_col_par : forall O P A M B C N D, O <> P -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> OnCircle D O P -> Midpoint M A B -> Midpoint N C D -> Col O M N -> ~ Col O A B -> ~ Col O C D -> Par A B C D.
Lemma onc3_mid2__ncol : forall O P A B C A' B', O <> P -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> Midpoint A' A C -> Midpoint B' B C -> ~ Col A B C -> ~ Col O A' B' \/ A' = O \/ B' = O.
Lemma onc4_cong2__eq: forall A B C D O P X, A<>B -> C<>D -> ~ Par A B C D -> OnCircle A O P -> OnCircle B O P -> OnCircle C O P -> OnCircle D O P -> Cong A X B X -> Cong C X D X -> O=X.