diff --git a/EuclideanGeometry/Check.lean b/EuclideanGeometry/Check.lean index ab1ad822..2550a369 100644 --- a/EuclideanGeometry/Check.lean +++ b/EuclideanGeometry/Check.lean @@ -90,7 +90,7 @@ theorem let_test_prop (α : Prop) (a : α) (p : α → Prop) : (let x := a; p x) intro x exact x _ -def main_theorem (A B C : P) (h : ¬ collinear A B C) : Prop := by +def main_theorem (A B C : P) (h : ¬ Collinear A B C) : Prop := by let hAB : B≠A := by exact (ne_of_not_collinear h).2.2 let hCB : C ≠ B := by exact (ne_of_not_collinear h).1 let l₁ := LIN A B hAB @@ -99,7 +99,7 @@ def main_theorem (A B C : P) (h : ¬ collinear A B C) : Prop := by let E := Line.inx l₁ l₂ h' exact (E = B) -example (A B C : P) (h : ¬ collinear A B C) : main_theorem A B C h := by +example (A B C : P) (h : ¬ Collinear A B C) : main_theorem A B C h := by unfold main_theorem -- rw [let_test (α := B≠A) (a := (ne_of_not_collinear h).2.2) (p := fun x => let hCB := (_ : C ≠ B); -- let l₁ := LIN A B x; diff --git a/EuclideanGeometry/Example/AOPS/Chap3.lean b/EuclideanGeometry/Example/AOPS/Chap3.lean index 1d6f1fe0..9f909bed 100644 --- a/EuclideanGeometry/Example/AOPS/Chap3.lean +++ b/EuclideanGeometry/Example/AOPS/Chap3.lean @@ -15,7 +15,7 @@ Theorem: We have $BX = CY$ and $MX = MY$. -/ -- Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} +variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- Claim: $A \ne B$ and $A \neq C$. This is because vertices of nondegenerate triangles are distinct. lemma A_ne_B : A ≠ B := (ne_of_not_collinear hnd).2.2.symm lemma A_ne_C : A ≠ C := (ne_of_not_collinear hnd).2.1 diff --git a/EuclideanGeometry/Example/AOPS/Chap5.lean b/EuclideanGeometry/Example/AOPS/Chap5.lean index d2fb19d3..75942170 100644 --- a/EuclideanGeometry/Example/AOPS/Chap5.lean +++ b/EuclideanGeometry/Example/AOPS/Chap5.lean @@ -12,7 +12,7 @@ namespace AOPS_Problem_5_7 Prove that $\frac{EY}{EX}=\frac{AD}{DB} -/ --Triangle A B C -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} lemma b_ne_a : B ≠ A := sorry lemma c_ne_a : C ≠ A := sorry lemma c_ne_b : C ≠ B := sorry @@ -60,7 +60,7 @@ Prove that $IJ\prar BC$-/ --It is simpler to use vectors but I think we should avoid vectors. --Nontrivial triangle A B C -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} lemma b_ne_a : B ≠ A := sorry lemma c_ne_a : C ≠ A := sorry lemma c_ne_b : C ≠ B := sorry @@ -82,7 +82,7 @@ namespace AOPS_Problem_5_14 Prove that AX^2 = BX \codt CX. -/ -- In right triangle $\triangle PQR$, $\angle QPR = 90^{\circ}$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma a_ne_b : A ≠ B := sorry lemma b_ne_c : B ≠ C := sorry @@ -102,7 +102,7 @@ $M$ is the midpoint of $AB$ Prove that $MQ \parallel BC$ -/ -- We have triangle $\triangle ABC$ with $AC \ne BC$ -variable {A B C : P} {hnd : ¬ collinear A B C} {hne : (SEG A C).length ≠ (SEG B C).length} +variable {A B C : P} {hnd : ¬ Collinear A B C} {hne : (SEG A C).length ≠ (SEG B C).length} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma a_ne_b : A ≠ B := sorry lemma b_ne_c : B ≠ C := sorry diff --git a/EuclideanGeometry/Example/AOPS/Chap5a.lean b/EuclideanGeometry/Example/AOPS/Chap5a.lean index 7d965d86..66c256df 100644 --- a/EuclideanGeometry/Example/AOPS/Chap5a.lean +++ b/EuclideanGeometry/Example/AOPS/Chap5a.lean @@ -18,7 +18,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Claim :$C \ne A$ B_ne_A : B ≠ A := -- This is because vertices $B, C$ of a nondegenerate triangle are distinct. @@ -86,7 +86,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Claim :$C \ne A$ B_ne_A : B ≠ A := -- This is because vertices $B, C$ of a nondegenerate triangle are distinct. diff --git a/EuclideanGeometry/Example/ArefWernick/Chap1.lean b/EuclideanGeometry/Example/ArefWernick/Chap1.lean index 1d1f6f8b..94f7d839 100644 --- a/EuclideanGeometry/Example/ArefWernick/Chap1.lean +++ b/EuclideanGeometry/Example/ArefWernick/Chap1.lean @@ -14,7 +14,7 @@ In other words, let $\triangle A_1B_1C_1$ and $\triangle A_2B_2C_2$ be two trian Prove that $\triangle A_1B_1C_1$ is congruent to $\triangle A_2B_2C_2$. -/ -- We have two triangles $\triangle A_1B_1C_1,A_2B_2C_2$ . -variable {A₁ B₁ C₁ A₂ B₂ C₂ : P} {hnd₁ : ¬ collinear A₁ B₁ C₁} {hnd₂ : ¬ collinear A₂ B₂ C₂} +variable {A₁ B₁ C₁ A₂ B₂ C₂ : P} {hnd₁ : ¬ Collinear A₁ B₁ C₁} {hnd₂ : ¬ Collinear A₂ B₂ C₂} -- $M_1,M_2$ are midpoints of $B_1C_1,B_2,C_2$ variable {M₁ M₂ : P} {hm₁ : M₁ = (SEG B₁ C₁).midpoint} {hm₂ : M₂ = (SEG B₂ C₂).midpoint} -- We have $A_1B_1 = A_2B_2$, $A_1C_1 = A_2C_2$, and $A_1M_1 = A_2M_2$. @@ -32,7 +32,7 @@ namespace Aref_Wernick_Exercise_1_2 Prove that $\angle BFD = \pi / 2 - \angle CAB$. -/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $B \ne A$ and $C \ne A$ and $B \ne C$. --This is because vertices of nondegenerate triangles are distinct. lemma B_ne_a : B ≠ A := (ne_of_not_collinear hnd).2.2 @@ -60,8 +60,8 @@ lemma B_ne_f : B ≠ F := by have inxb : is_inx B (LIN B C (ne_of_not_collinear hnd).1) (LIN A B (ne_of_not_collinear hnd).2.2) := by exact ⟨(SegND B C (ne_of_not_collinear hnd).1).source_lies_on_toLine , (SegND A B (ne_of_not_collinear hnd).2.2).target_lies_on_toLine ⟩ exact d_ne_b (unique_of_inx_of_line_of_not_para line_neq inxb.symm inxd.symm) - have bcd_notcoli : ¬ collinear B C D := (Line.lies_on_line_of_pt_pt_iff_collinear (b_ne_c (hnd := hnd)).symm D).mpr.mt d_not_lies_on_bc - have b_not_lies_on_cd : ¬ B LiesOn (LIN C D d_ne_c) := (Line.lies_on_line_of_pt_pt_iff_collinear d_ne_c B).mp.mt (flip_collinear_snd_trd.mt (flip_collinear_fst_snd.mt bcd_notcoli)) + have bcd_notcoli : ¬ Collinear B C D := (Line.lies_on_line_of_pt_pt_iff_collinear (b_ne_c (hnd := hnd)).symm D).mpr.mt d_not_lies_on_bc + have b_not_lies_on_cd : ¬ B LiesOn (LIN C D d_ne_c) := (Line.lies_on_line_of_pt_pt_iff_collinear d_ne_c B).mp.mt (Collinear.perm₁₃₂.mt (Collinear.perm₂₁₃.mt bcd_notcoli)) have f_lies_on_seg_cd : F LiesOn (SegND C D d_ne_c).1 := hf.2 exact (ne_of_lieson_and_not_lieson (SegND.lies_on_toLine_of_lie_on f_lies_on_seg_cd) b_not_lies_on_cd).symm lemma d_ne_f : D ≠ F := sorry diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_1.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_1.lean index 89a8d66e..b6e2c1c4 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_1.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_1.lean @@ -24,8 +24,8 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where -- $A, E$ do not lie on $l$. A : Plane E : Plane - ABC_nd : ¬collinear A B C - EDF_nd : ¬collinear E D F + ABC_nd : ¬Collinear A B C + EDF_nd : ¬Collinear E D F -- need A and E be at the same side of l!! A_side : IsOnLeftSide A (SEG_nd B F) E_side : IsOnLeftSide E (SEG_nd B F) @@ -34,11 +34,11 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where -- $BC = DE$ h₂ : (SEG B C).length = (SEG D E).length attribute [instance] Setting1.B_ne_F -lemma hnd₁ {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane}: ¬ collinear e.B e.A e.C := by - apply flip_collinear_fst_snd.mt +lemma hnd₁ {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane}: ¬ Collinear e.B e.A e.C := by + apply Collinear.perm₂₁₃.mt exact e.ABC_nd -lemma hnd₂ {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane}: ¬ collinear e.D e.F e.E := by - apply perm_collinear_trd_fst_snd.mt +lemma hnd₂ {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane}: ¬ Collinear e.D e.F e.E := by + apply Collinear.perm₃₁₂.mt exact e.EDF_nd instance A_ne_B {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane}: PtNe e.A e.B := ⟨(ne_of_not_collinear hnd₁).2.2⟩ instance D_ne_E {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane}: PtNe e.D e.E := ⟨(ne_of_not_collinear hnd₂).2.1⟩ diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_2.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_2.lean index 55ab3ff4..ed7feca4 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_2.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_2.lean @@ -20,8 +20,8 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where h₁ : (SEG A B).length = (SEG D C).length h₂ : (SEG D B).length = (SEG A C).length -- nondegenerate - hnd₁ : ¬ collinear D B A - hnd₂ : ¬ collinear A C D + hnd₁ : ¬ Collinear D B A + hnd₂ : ¬ Collinear A C D D_ne_A : D ≠ A :=(ne_of_not_collinear hnd₁).2.1 -- $B,C$ is on the same side of line $AD$. B_side : IsOnRightSide B (SEG_nd A D D_ne_A) diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_3.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_3.lean index 8ba41e4a..f0d4570b 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_3.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_3.lean @@ -33,12 +33,12 @@ theorem Result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : ∠ Because $DB = DC$ ,we have $\angle D B C = -\angle D C B$ $\angle A B D = \angle A B C - \angle D B C = \angle D C B - \angle A C B = --\angle A C D$ -/ - have h₁ : ¬ collinear e.A e.B e.C := by + have h₁ : ¬ Collinear e.A e.B e.C := by exact (Quadrilateral_cvx.not_collinear₁₂₄ (QDR_cvx e.A e.B e.D e.C e.cvx_ABDC)) - have h₂ : ¬ collinear e.D e.B e.C := by - have h₂' : ¬ collinear e.B e.D e.C := by + have h₂ : ¬ Collinear e.D e.B e.C := by + have h₂' : ¬ Collinear e.B e.D e.C := by exact (Quadrilateral_cvx.not_collinear₂₃₄ (QDR_cvx e.A e.B e.D e.C e.cvx_ABDC)) - apply flip_collinear_fst_snd.mt h₂' + apply Collinear.perm₂₁₃.mt h₂' have C_ne_B : e.C ≠ e.B := by exact (Quadrilateral_cvx.nd₂₄ (QDR_cvx e.A e.B e.D e.C e.cvx_ABDC)) --Because $AB = AC$ ,we have $\angle A B C = -\angle A C B$. diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_4.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_4.lean index f717382d..37d261e3 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_4.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_4.lean @@ -18,8 +18,8 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where C : Plane D : Plane --some nondegenerate - hnd₁ : ¬ collinear B C A - hnd₂ : ¬ collinear B C D + hnd₁ : ¬ Collinear B C A + hnd₂ : ¬ Collinear B C D --$A,D$ are on the opposite side of line $BC$,which satisfies $BD \para CA$(lemma needed), $BD = BC$ BD_eq_BC : (SEG B D).length = (SEG B C).length instance B_ne_C {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane} : PtNe e.B e.C := ⟨(ne_of_not_collinear e.hnd₁).2.2.symm⟩ @@ -36,7 +36,7 @@ structure Setting2 (Plane : Type _) [EuclideanPlane Plane] extends Setting1 Plan E : Plane E_int : E LiesInt (SEG_nd B C) E_position : (SEG B E).length = (SEG A C).length -lemma hnd₃ {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane}: ¬ collinear e.B e.E e.D := by sorry +lemma hnd₃ {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane}: ¬ Collinear e.B e.E e.D := by sorry instance E_ne_D {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane} : PtNe e.E e.D := ⟨(ne_of_not_collinear hnd₃).1.symm⟩ instance A_ne_B {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane} : PtNe e.A e.B := ⟨(ne_of_not_collinear e.hnd₁).2.1.symm⟩ instance B_ne_E {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane} : PtNe e.B e.E := ⟨(ne_of_not_collinear hnd₃).2.2.symm⟩ @@ -52,8 +52,8 @@ theorem Result {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane} : We have $\triangle B E D \congr_a \triangle C A B$ Thus $\angle B D E = -\angle C B A $. -/ - have hnd₁' : ¬ collinear e.C e.A e.B := by - apply perm_collinear_trd_fst_snd.mt + have hnd₁' : ¬ Collinear e.C e.A e.B := by + apply Collinear.perm₃₁₂.mt exact e.hnd₁ --$DB = BC$ have e₂ : (SEG e.D e.B).length = (SEG e.B e.C).length := by diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_6.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_6.lean index 7553546b..9dccc891 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_6.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_6.lean @@ -13,11 +13,11 @@ In $▵ ABC$, $D, E$ are two different points on side $BC$, $AD = AE$, $∠ BAD Prove that $AB = AC$. -/ -- Define $▵ ABC$. -variable {A B C : P} {hnd1 : ¬ collinear A B C} +variable {A B C : P} {hnd1 : ¬ Collinear A B C} -- $D, E$ are two different points on side $BC$. variable {D E : P} {hd : D LiesInt SEG B C} {he : E LiesInt SEG B C} -- nondegenerate -lemma hnd2 : ¬ collinear A D E := by sorry +lemma hnd2 : ¬ Collinear A D E := by sorry lemma a_ne_b : A ≠ B := by sorry lemma a_ne_d : A ≠ D := by sorry lemma a_ne_c : A ≠ C := by sorry @@ -29,8 +29,8 @@ variable {hang : ∠ B A D a_ne_b a_ne_d = -∠ C A E a_ne_c a_ne_e} -- State the main goal. theorem Wuwowuji_Problem_1_6 : (SEG A B).length = (SEG A C).length := by -- nondegenerate - have hnd3 : ¬ collinear B D A := by sorry - have hnd4 : ¬ collinear C E A := by sorry + have hnd3 : ¬ Collinear B D A := by sorry + have hnd4 : ¬ Collinear C E A := by sorry -- Use ASA to prove $▵ BDA ≅ₐ ▵ CEA$. have h : (TRI_nd B D A hnd3) ≅ₐ (TRI_nd C E A hnd4) := by apply TriangleND.acongr_of_ASA diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_7.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_7.lean index ba898093..79b27052 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_7.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_7.lean @@ -15,7 +15,7 @@ Prove that $AD = BC$. -- $AD$ and $BC$ intersect at $O$. variable {A B C D O: P} {h1 : O LiesInt (SEG A D)} {h2 : O LiesInt (SEG B C)} -- nondegenerate -variable {hnd1 : ¬ collinear C B A} {hnd2 : ¬ collinear D A B} +variable {hnd1 : ¬ Collinear C B A} {hnd2 : ¬ Collinear D A B} lemma a_ne_b : A ≠ B := by sorry lemma a_ne_c : A ≠ C := by sorry lemma a_ne_d : A ≠ D := by sorry @@ -33,7 +33,7 @@ theorem Wuwowuji_Problem_1_7 : (SEG A D).length = (SEG B C).length := by have o_ne_b : O ≠ B := by sorry have o_ne_c : O ≠ C := by sorry have o_ne_d : O ≠ D := by sorry - have hnd3 : ¬ collinear O A B := by sorry + have hnd3 : ¬ Collinear O A B := by sorry -- $▵ OAB$ is isoceles because $OA = OB$. have hisoc : (TRI_nd O A B hnd3).1.IsIsoceles := by calc diff --git a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_8.lean b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_8.lean index 67b80bd8..71f28a7d 100644 --- a/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_8.lean +++ b/EuclideanGeometry/Example/Congruence_Exercise_ygr/Problem_8.lean @@ -14,7 +14,7 @@ Prove that $▵ OPD ≅ₐ ▵ OPE$. -/ -- Define $A, B, C, O$ on the plane. -variable {A B C O : Plane} {hnd1 : ¬ collinear O A B} {hnd2 : ¬ collinear O B C} {hnd3 : ¬ collinear O C A} +variable {A B C O : Plane} {hnd1 : ¬ Collinear O A B} {hnd2 : ¬ Collinear O B C} {hnd3 : ¬ Collinear O C A} -- nondegenerate lemma o_ne_a : O ≠ A:= by sorry lemma o_ne_b : O ≠ B := by sorry @@ -26,8 +26,8 @@ variable {P : Plane} {hp : P LiesInt (SEG O C)} -- $D, E$ is the perpendicular foot from $P$ to line $OA, OB$. variable {D E : Plane} {hd : D = perp_foot P (LIN O A o_ne_a.symm)} {he : E = perp_foot P (LIN O B o_ne_b.symm)} -- State the main goal. -lemma hnd4 : ¬ collinear O P D := by sorry -lemma hnd5 : ¬ collinear O P E := by sorry +lemma hnd4 : ¬ Collinear O P D := by sorry +lemma hnd5 : ¬ Collinear O P E := by sorry theorem Wuwowuji_Problem_1_8 : (TRI_nd O P D hnd4) ≅ₐ (TRI_nd O P E hnd5) := by sorry diff --git a/EuclideanGeometry/Example/ExerciseXT8.lean b/EuclideanGeometry/Example/ExerciseXT8.lean index ad7ed15d..bf515faa 100644 --- a/EuclideanGeometry/Example/ExerciseXT8.lean +++ b/EuclideanGeometry/Example/ExerciseXT8.lean @@ -16,7 +16,7 @@ Prove that $\angle AY_1Z_2 + \angle BZ_1X_2 + \angle CX_1Y_2 + \angle Y_1Z_2A + -/ -- Let $\triangle ABC$ be a nondegenerate triangle. -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} lemma c_ne_B : C ≠ B := sorry lemma B_ne_a : B ≠ A := sorry diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.1.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.1.lean index 94e3e144..0c6cafd3 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.1.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.1.lean @@ -16,7 +16,7 @@ Prove that $DM = EM$. -/ /--/ --Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {not_collinear_ABC: ¬ collinear A B C} {isoceles_ABC: (▵ A B C).IsIsoceles} +variable {A B C : P} {not_collinear_ABC: ¬ Collinear A B C} {isoceles_ABC: (▵ A B C).IsIsoceles} --Let $D$ be a point on $AB$. variable {D : P} {D_on_seg: D LiesInt (SEG A B)} --Let $E$ be a point on $AC$ @@ -31,7 +31,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C isoc_ABC : (▵ A B C).IsIsoceles --Let $D$ be a point on $AB$. D : Plane @@ -66,9 +66,9 @@ theorem Result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : (SE _ = (SEG e.C e.A).length := e.isoc_ABC.symm _ = (SEG e.A e.C).length := length_of_rev_eq_length' --Triangle B D M nondegenerate. - have h₁ : ¬ collinear e.B e.D e.M := by sorry + have h₁ : ¬ Collinear e.B e.D e.M := by sorry --Triangle C E M nondegenerate. - have h₂ : ¬ collinear e.C e.E e.M := by sorry + have h₂ : ¬ Collinear e.C e.E e.M := by sorry --Points not equal for the definition of angle is not invalid. --$D \ne B$ and $M \ne B$ for ∠ D B M. haveI d_ne_b : PtNe e.D e.B := ⟨ (ne_of_not_collinear h₁).2.2⟩ diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.12.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.12.lean index 352a6fca..b5bd0fee 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.12.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.12.lean @@ -54,7 +54,7 @@ theorem SCHAUM_Problem_1_12 : Quadrilateral.IsParallelogram (QDR A B C D) := by sorry /- apply is_prg_of_para_eq_length' - · unfold perpendicular at * + · unfold Perpendicular at * unfold parallel have h : toProj (SegND B C (c_ne_B (hconv := hconv))) = toProj (SegND A D (A_ne_d (hconv := hconv)).symm) := by calc diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.14.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.14.lean index dbd6ba64..baa4828c 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.14.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.14.lean @@ -64,8 +64,8 @@ theorem result1 {Plane : Type _} [EuclideanPlane Plane] (e : Setting2 Plane) : ( Thus $\triangle MBP \congr \triangle NCQ$ (by AAS), which implies $PM = QN$. -/ - have not_collinear_MBP : ¬ collinear e.M e.B e.P := by sorry - have not_collinear_NDQ : ¬ collinear e.N e.D e.Q := by sorry + have not_collinear_MBP : ¬ Collinear e.M e.B e.P := by sorry + have not_collinear_NDQ : ¬ Collinear e.N e.D e.Q := by sorry have B_ne_M : e.B ≠ e.M := by sorry have P_ne_M : e.P ≠ e.M := by sorry have D_ne_N : e.D ≠ e.N := by sorry @@ -85,7 +85,7 @@ theorem result2 {Plane : Type _} [EuclideanPlane Plane] (e : Setting2 Plane) : ( -- We have $BD \perp QN$ because $N$ is the perpendicular foot from $Q$ to $BD$. have BD_perp_QN : LIN e.B e.D e.D_ne_B ⟂ LIN e.Q e.N e.N_ne_Q := by simp only [e.perp_foot_N] - exact perpendicular.symm (line_of_self_perp_foot_perp_line_of_not_lies_on e.not_Q_lieson_BD) + exact Perpendicular.symm (line_of_self_perp_foot_perp_line_of_not_lies_on e.not_Q_lieson_BD) -- then $PM \perp QN$ because $PM \perp BD$ and $BD \perp QN$. exact parallel_of_perp_perp (l₂ := (LIN e.B e.D e.D_ne_B)) PM_perp_BD BD_perp_QN diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.2'.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.2'.lean index ed78d33a..d7dfb41a 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.2'.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.2'.lean @@ -19,7 +19,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C isoceles_ABC : (▵ A B C).IsIsoceles --Let $D$ be a point on $AB$. D : Plane @@ -46,7 +46,7 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C hisoc : (▵ A B C).IsIsoceles --Let $D$ be a point on $AB$. D : Plane @@ -118,7 +118,7 @@ theorem result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : (SE -- We have $C \ne B$. have C_ne_B : e.C ≠ e.B := (ne_of_not_collinear e.not_collinear_ABC).1 -- We have $\triangle PBD$ is nondegenerate - have not_collinear_PBD : ¬ collinear e.P e.B e.D := by sorry + have not_collinear_PBD : ¬ Collinear e.P e.B e.D := by sorry -- We have $B \ne D$. have B_ne_D : e.B ≠ e.D := (ne_of_not_collinear not_collinear_PBD).1.symm -- We have $P \ne D$. @@ -126,7 +126,7 @@ theorem result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : (SE -- We have $P \ne B$. have P_ne_B : e.P ≠ e.B := (ne_of_not_collinear not_collinear_PBD).2.2.symm -- We have $\triangle QCE$ is nondegenerate - have not_collinear_QCE : ¬ collinear e.Q e.C e.E := by sorry + have not_collinear_QCE : ¬ Collinear e.Q e.C e.E := by sorry -- We have $C \ne E$. have C_ne_E : e.C ≠ e.E := (ne_of_not_collinear not_collinear_QCE).1.symm -- We have $Q \ne E$. diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.2.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.2.lean index e23d836e..e5d1e284 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.2.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.2.lean @@ -15,7 +15,7 @@ Prove that $DP = EQ$. -/ --Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : Plane} {not_collinear_ABC: ¬ collinear A B C} {isoceles_ABC: (▵ A B C).IsIsoceles} +variable {A B C : Plane} {not_collinear_ABC: ¬ Collinear A B C} {isoceles_ABC: (▵ A B C).IsIsoceles} --Let $D$ be a point on $AB$. variable {D : Plane} {D_int_AB: D LiesInt (SEG A B)} --Let $E$ be a point on $AC$ @@ -96,7 +96,7 @@ theorem Problem1_2_ : (SEG D P).length = (SEG E Q).length := by -- We have $C \ne B$. have c_ne_b : C ≠ B := (ne_of_not_collinear not_collinear_ABC).1 -- We have $\triangle PBD$ is nondegenerate - have not_collinear_ABC1 : ¬ collinear P B D := by sorry + have not_collinear_ABC1 : ¬ Collinear P B D := by sorry -- We have $B \ne D$. have b_ne_d : B ≠ D := (ne_of_not_collinear not_collinear_ABC1).1.symm -- We have $P \ne D$. @@ -104,7 +104,7 @@ theorem Problem1_2_ : (SEG D P).length = (SEG E Q).length := by -- We have $P \ne B$. have p_ne_b : P ≠ B := (ne_of_not_collinear not_collinear_ABC1).2.2.symm -- We have $\triangle QCE$ is nondegenerate - have not_collinear_ABC2 : ¬ collinear Q C E := by sorry + have not_collinear_ABC2 : ¬ Collinear Q C E := by sorry -- We have $C \ne E$. have c_ne_e : C ≠ E := (ne_of_not_collinear not_collinear_ABC2).1.symm -- We have $Q \ne E$. diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.3.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.3.lean index 7d44a017..9c6b6b83 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.3.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.3.lean @@ -14,7 +14,7 @@ Prove that $∠DAB = ∠CAE$. -/ /--/ --Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {not_collinear_ABC: ¬ collinear A B C} {isoceles_ABC: (▵ A B C).IsIsoceles} +variable {A B C : P} {not_collinear_ABC: ¬ Collinear A B C} {isoceles_ABC: (▵ A B C).IsIsoceles} --Let $D$ and $E$ be two points on $BC$ variable {D : P} {D_Int_BC: D LiesInt (SEG B C)} variable {E : P} {E_Int_BC: E LiesInt (SEG B C)} @@ -35,7 +35,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C isoc_ABC : (▵ A B C).IsIsoceles --Let $D$ and $E$ be two points on $BC$ D : Plane @@ -78,9 +78,9 @@ theorem Result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : ∠ _= (SEG e.A e.B).length := length_of_rev_eq_length' --$BA = AB$ by symmetry _= (SEG e.C e.A).length := e.isoc_ABC.symm -- $AB = CA$ by isoceles. --Triangle B A D nondegenerate. - have hnd₁ : ¬ collinear e.B e.A e.D := by sorry + have hnd₁ : ¬ Collinear e.B e.A e.D := by sorry --Triangle C A E nondegenerate. - have hnd₂ : ¬ collinear e.C e.A e.E := by sorry + have hnd₂ : ¬ Collinear e.C e.A e.E := by sorry --Beacause $BD = CE$ we have $DB = EC$. have h₁ : (SEG e.D e.B).length = (SEG e.E e.C).length := by calc diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.4.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.4.lean index b88db782..36557861 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.4.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.4.lean @@ -21,12 +21,12 @@ variable {D : Plane} {D_on_seg: D LiesInt (SEG A F)} -- $AD = BF$. variable {seg_eq : (SEG A D).length = (SEG B F).length} --Let $C$ be a point. -variable {C : Plane} {C_off_lin: ¬ collinear A F C} --Implied by opposite side. +variable {C : Plane} {C_off_lin: ¬ Collinear A F C} --Implied by opposite side. --Let $E$ be a point on the opposite side of $AF$ to $C$, such that EF ∥ AC and ED ∥ BC. -variable {E : Plane} {E_off_lin: ¬ collinear A F E} --Implied by opposite side. +variable {E : Plane} {E_off_lin: ¬ Collinear A F E} --Implied by opposite side. -- Claim:$C \ne A$ , $C \ne B$, $C, A, B$ is not collinear, $E, F, D$ is not collinear. -lemma cabnd : ¬ collinear C A B := by sorry -lemma efdnd : ¬ collinear E F D := by sorry +lemma cabnd : ¬ Collinear C A B := by sorry +lemma efdnd : ¬ Collinear E F D := by sorry lemma c_ne_a : C ≠ A := (ne_of_not_collinear C_off_lin).2.1.symm lemma c_ne_B : C ≠ B :=by by_contra h diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.5.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.5.lean index 70e034d8..1d87ffc6 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.5.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.5.lean @@ -79,9 +79,9 @@ As a consequence, we know that $PQRS$ is a parallelogram. -- We have $C \ne B$. have C_ne_B : e.C ≠ e.B := by sorry -- We have that $A, P, C$ is not collinear. - have not_collinear_APC : ¬ collinear e.A e.P e.C := by sorry + have not_collinear_APC : ¬ Collinear e.A e.P e.C := by sorry -- We have that $A, S, C$ is not collinear. - have not_collinear_ASC : ¬ collinear e.A e.S e.C := by sorry + have not_collinear_ASC : ¬ Collinear e.A e.S e.C := by sorry -- We have that $S$ lies on $AD$ by applying symmetry to the fact that $S$ lies on $DA$. have S_int_AD : e.S LiesInt (SEG e.A e.D) := Seg.lies_int_rev_iff_lies_int.mp e.S_int_DA -- We have that $Q$ lies on $CB$ by applying symmetry to the fact that $Q$ lies on $BC$. diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.7.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.7.lean index e055f103..4e980dda 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.7.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.7.lean @@ -23,7 +23,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C isoceles_ABC : (▵ A B C).IsIsoceles --Let $D$ be point on the segment $BC$ D : Plane @@ -105,7 +105,7 @@ Therefore, $DX = EY$. -- We have $Y \ne C$ as Y is on the interior of ray $CA$ and therefore different to the source $C$. have Y_ne_C : e.Y ≠ e.C := Y_int_ray_CA.2 -- We have $Y, C, E$ are not collinear because $E$ doesn't lies on line $AC$ and $C$ doesn't coincide with $Y$. - have not_collinear_YCE : ¬ collinear e.Y e.C e.E := by exact not_collinear_with_perp_foot_of_ne_perp_foot e.E e.C e.Y (LIN e.A e.C e.C_ne_A) (Line.snd_pt_lies_on_mk_pt_pt e.C_ne_A) E_not_on_AC e.he (Y_ne_C).symm + have not_collinear_YCE : ¬ Collinear e.Y e.C e.E := by exact not_collinear_with_perp_foot_of_ne_perp_foot e.E e.C e.Y (LIN e.A e.C e.C_ne_A) (Line.snd_pt_lies_on_mk_pt_pt e.C_ne_A) E_not_on_AC e.he (Y_ne_C).symm -- We have $E \ne Y$. have E_ne_Y : e.E ≠ e.Y := by sorry @@ -135,7 +135,7 @@ Therefore, $DX = EY$. -- We have $X \ne B$ as X is on the interior of ray $BA$ and therefore different to the source $B$. have X_ne_B : e.X ≠ e.B := X_int_ray_BA.2 -- We have $X, B, D$ are not collinear because $D$ doesn't lies on line $AB$ and $B$ doesn't coincide with $X$. - have not_collinear_XBD : ¬ collinear e.X e.B e.D := by + have not_collinear_XBD : ¬ Collinear e.X e.B e.D := by exact not_collinear_with_perp_foot_of_ne_perp_foot e.D e.B e.X (LIN e.A e.B e.B_ne_A) (Line.snd_pt_lies_on_mk_pt_pt e.B_ne_A) D_not_on_AB e.hd (X_ne_B).symm -- We have $D \ne X$. have D_ne_X : e.D ≠ e.X := by sorry diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.8.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.8.lean index 3eabf5d9..9d238f9f 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.8.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.8.lean @@ -21,7 +21,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C regular_ABC : (▵ A B C).IsRegular --Claim $A \ne B$ A_ne_B : A ≠ B := @@ -61,9 +61,9 @@ Thus, $\triangle BDA \cong \triangle CEB$ (by SAS). Therefore, $BD = CE$. -/ --We have that $B, D, A$ is not collinear. - have not_collinear_BDA : ¬ collinear e.B e.D e.A := by sorry + have not_collinear_BDA : ¬ Collinear e.B e.D e.A := by sorry --We have that $C, E, B$ is not collinear. - have not_collinear_CEB : ¬ collinear e.C e.E e.B := by sorry + have not_collinear_CEB : ¬ Collinear e.C e.E e.B := by sorry --We have $D \ne B$. have D_ne_B : e.D ≠ e.B := by sorry --We have $A \ne B$. diff --git a/EuclideanGeometry/Example/SCHAUM/Problem1.9.lean b/EuclideanGeometry/Example/SCHAUM/Problem1.9.lean index 7bce34f2..94021f15 100644 --- a/EuclideanGeometry/Example/SCHAUM/Problem1.9.lean +++ b/EuclideanGeometry/Example/SCHAUM/Problem1.9.lean @@ -22,7 +22,7 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C isoceles_ABC : (▵ A B C).IsIsoceles -- Claim $B \ne A$. B_ne_A : B ≠ A := diff --git a/EuclideanGeometry/Example/ShanZun-Ex1a.lean b/EuclideanGeometry/Example/ShanZun-Ex1a.lean index c7ff5978..892148a3 100644 --- a/EuclideanGeometry/Example/ShanZun-Ex1a.lean +++ b/EuclideanGeometry/Example/ShanZun-Ex1a.lean @@ -13,7 +13,7 @@ namespace Shan_Problem_1_3 Prove that $CD = 2 \cdot CE$. -/ -- Define an isosceles triangle ABC - variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} + variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- A ≠ B lemma A_ne_B : A ≠ B := (ne_of_not_collinear hnd).2.2.symm -- Since D is on line AB and AB = BD, it is trivial that D is on ray AB. Position can be determined here. @@ -23,8 +23,8 @@ Prove that $CD = 2 \cdot CE$. -/ variable {E : P} {E_midpoint : E = (SEG A B).midpoint} -- State the main goal theorem Shan_Problem_1_3 : (SEG C D).length = 2 * (SEG C E).length := by - have h_AEC_nd : ¬ collinear A E C := by sorry - have h_ACD_nd : ¬ collinear A C D := by sorry + have h_AEC_nd : ¬ Collinear A E C := by sorry + have h_ACD_nd : ¬ Collinear A C D := by sorry have h_AC_over_AE : (SEG A C).length / (SEG A E).length = 2 := by sorry have h_AD_over_AC : (SEG A D).length / (SEG A C).length = 2 := by sorry have h_sim: (TRI_nd A E C h_AEC_nd) ∼ₐ (TRI_nd A C D h_ACD_nd) := sorry @@ -39,7 +39,7 @@ namespace Shan_Problem_1_4 Prove that $BD = AC + CD$.-/ -- Define a triangle ABC - variable {A B C : P} {hnd : ¬ collinear A B C} + variable {A B C : P} {hnd : ¬ Collinear A B C} -- Possibly needed non-linear conditions lemma A_ne_B : A ≠ B := (ne_of_not_collinear hnd).2.2.symm lemma A_ne_C : A ≠ C := (ne_of_not_collinear hnd).2.1 diff --git a/EuclideanGeometry/Example/ShanZun-Ex1b.lean b/EuclideanGeometry/Example/ShanZun-Ex1b.lean index 4ca3a262..2ced19d9 100644 --- a/EuclideanGeometry/Example/ShanZun-Ex1b.lean +++ b/EuclideanGeometry/Example/ShanZun-Ex1b.lean @@ -14,7 +14,7 @@ namespace Shan_Problem_1_5 Prove that $AF = EF$. -/ -- Let $\triangle ABC$ be an triangle. - variable {A B C : P} {hnd : ¬ collinear A B C} + variable {A B C : P} {hnd : ¬ Collinear A B C} lemma B_ne_C : B ≠ C := (ne_of_not_collinear hnd).1.symm variable {D : P} {median_D_position : D = (SEG B C).midpoint} variable {median : SegND P} {defmedian: median = (SEG A D)} @@ -30,7 +30,7 @@ namespace Shan_Problem_1_6 Prove that For any point $D$ on the base $BC$, the sum of the the distance of $D$ to $AB$ and to $AC$ is independent of $D$. -/ -- Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. - variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} + variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- Claim: $A \ne B$ and $A \neq C$. This is because vertices of nondegenerate triangles are distinct. lemma B_ne_a : B ≠ A := (ne_of_not_collinear hnd).2.2 lemma c_ne_a : C ≠ A := (ne_of_not_collinear hnd).2.1.symm diff --git a/EuclideanGeometry/Example/ShanZun/Ex1.lean b/EuclideanGeometry/Example/ShanZun/Ex1.lean index 8db822f4..1accc03e 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1.lean @@ -13,7 +13,7 @@ namespace Shan_Problem_1_1 Prove that $\angle DAE = (\angle CBA - \angle ACB) / 2$. -/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -50,7 +50,7 @@ such that $\angle EBC = \angle BCD$. Prove that $\angle CDA = \angle BEA$. -/ -- Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} +variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- Claim: $B \ne A$ and $C \ne A$ and $B \ne C$. This is because vertices of nondegenerate triangles are distinct. lemma B_ne_a : B ≠ A := (ne_of_not_collinear hnd).2.2 lemma c_ne_a : C ≠ A := (ne_of_not_collinear hnd).2.1.symm @@ -59,7 +59,7 @@ lemma B_ne_C : B ≠ C := (ne_of_not_collinear hnd).1.symm variable {D E : P} {hd : D LiesInt (SEG_nd A B (B_ne_a (hnd := hnd))).extension} {he : E LiesInt (SEG_nd A C (c_ne_a (hnd := hnd))).extension} -- Claim: $E \ne B$ and $D \ne C$. This is because $E$ lies on line $AC$, but $B$ doesn't lies on $AC$; $D$ lies on line $AB$, but $C$ doesn't lies on $AB$. lemma e_ne_B : E ≠ B := by -- for $E \ne B$ - have b_not_lieson_ac := (Line.lies_on_line_of_pt_pt_iff_collinear (_h := ⟨ c_ne_a (hnd := hnd)⟩) B).mp.mt (flip_collinear_snd_trd.mt hnd) -- $B$ doesn't lies on line $AC$ because $A, B, C$ not collinear + have b_not_lieson_ac := (Line.lies_on_line_of_pt_pt_iff_collinear (_h := ⟨ c_ne_a (hnd := hnd)⟩) B).mp.mt (Collinear.perm₁₃₂.mt hnd) -- $B$ doesn't lies on line $AC$ because $A, B, C$ not collinear have e_lieson_ac := SegND.lies_on_toLine_of_lies_on_extn (Ray.lies_on_of_lies_int he) -- $E$ lieson line $AC$ because $E$ lies in the extension of $AC$ exact ne_of_lieson_and_not_lieson e_lieson_ac b_not_lieson_ac -- $E \ne B$ because $E$ lies on line $AC$, but $B$ doesn't lies on line $AC$ lemma d_ne_c : D ≠ C := by -- for $D \ne C$ @@ -89,9 +89,9 @@ theorem Shan_Problem_1_2 : ∠ C D A (d_ne_c (hnd := hnd) (hd := hd)).symm (d_ne -- $\angle CBD = \angle ECB$ have ang₂ : ∠ C B D (B_ne_C (hnd := hnd)).symm d_ne_B = ∠ E C B e_ne_C (B_ne_C (hnd := hnd)) := sorry -- $C,B,D$ are not collinear - have not_coli_cbd : ¬ collinear C B D := sorry + have not_coli_cbd : ¬ Collinear C B D := sorry -- $B,C,E$ are not collinear - have not_coli_bec : ¬ collinear B C E := sorry + have not_coli_bec : ¬ Collinear B C E := sorry -- $\triangle CBD \cong \triangle BCE$ have iso : (TRI_nd C B D not_coli_cbd) IsCongrTo (TRI_nd B C E not_coli_bec) := sorry -- $\angle CDB == \angle CDA$ diff --git a/EuclideanGeometry/Example/ShanZun/Ex1a.lean b/EuclideanGeometry/Example/ShanZun/Ex1a.lean index d89b6965..18510ab5 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1a.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1a.lean @@ -14,7 +14,7 @@ namespace Shan_Problem_1_3 Prove that $CD = 2 \cdot CE$. -/ -- Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} +variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -47,7 +47,7 @@ namespace Shan_Problem_1_4 Prove that $BD = AC + CD$.-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -66,7 +66,7 @@ theorem Shan_Problem_1_4 : (SEG B D).length = (SEG A C).length + (SEG C D).lengt -- $DE = AC + CD$ have de_eq_ac_plus_cd : (SEG D E).length = (SEG A C).length + (SEG C D).length := sorry -- $C A E$ is not collinear - have cae_not_collinear : ¬ collinear C A E := sorry + have cae_not_collinear : ¬ Collinear C A E := sorry -- $\triangle CAE$ is isoceles have isoceles₁ : (TRI_nd C A E cae_not_collinear).1.IsIsoceles := by rw[← Seg.length_of_rev_eq_length (seg := (SEG C E))] at ce_eq_ca @@ -83,7 +83,7 @@ theorem Shan_Problem_1_4 : (SEG B D).length = (SEG A C).length + (SEG C D).lengt -- $\angle EBA = \angle AEB$ have ang₃ : ∠ E B A e_ne_b A_ne_B = ∠ A E B e_ne_a.symm e_ne_b.symm := sorry -- $ABE$ is not collinear - have abe_not_collinear : ¬ collinear A B E := sorry + have abe_not_collinear : ¬ Collinear A B E := sorry -- $\triangle ABE$ is isoceles have isoceles₂ : (TRI_nd A B E abe_not_collinear).1.IsIsoceles := by apply is_isoceles_tri_iff_ang_eq_ang_of_nd_tri.mpr diff --git a/EuclideanGeometry/Example/ShanZun/Ex1b.lean b/EuclideanGeometry/Example/ShanZun/Ex1b.lean index f7b1cfd1..910259cf 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1b.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1b.lean @@ -14,7 +14,7 @@ namespace Shan_Problem_1_5 Prove that $AF = EF$. -/ -- Let $\triangle ABC$ be an triangle. -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} def tri : Triangle P := ▵ A B C -- Claim: $B \ne C$. This is because vertices of nondegenerate triangles are distinct. lemma A_ne_C : A ≠ C := (ne_of_not_collinear hnd).2.1 @@ -52,7 +52,7 @@ Prove that for any point $D$ on the base $BC$, the sum of the the distance of $D$ to $AB$ and to $AC$ is independent of $D$. -/ -- Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} +variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry diff --git a/EuclideanGeometry/Example/ShanZun/Ex1c'.lean b/EuclideanGeometry/Example/ShanZun/Ex1c'.lean index 57274653..a972254f 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1c'.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1c'.lean @@ -18,7 +18,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Claim :$C \ne A$ C_ne_A : C ≠ A := -- This is because vertices $A, C$ of a nondegenerate triangle are distinct. @@ -52,12 +52,12 @@ theorem result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : (SE rw[hE] apply (SegND.midpt_lies_int (seg_nd := SEG_nd e.A e.C e.C_ne_A)).2.2 --midpoint lies on the segment - have adb_collinear : collinear e.A e.D e.B := by + have adb_collinear : Collinear e.A e.D e.B := by apply collinear_of_vec_eq_smul_vec' use 2 simp only [e.hD,Seg.midpoint,one_div, seg_toVec_eq_vec, vec_of_pt_vadd_pt_eq_vec,smul_smul] norm_num - have aec_collinear : collinear e.A E e.C := by + have aec_collinear : Collinear e.A E e.C := by apply collinear_of_vec_eq_smul_vec' use 2 simp only [hE,Seg.midpoint,one_div, seg_toVec_eq_vec, vec_of_pt_vadd_pt_eq_vec,smul_smul] @@ -88,26 +88,26 @@ theorem result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) : (SE exact hE rw[hE] apply Seg.midpt_lies_on - have not_collinear_ADE: ¬ collinear e.A e.D E := by + have not_collinear_ADE: ¬ Collinear e.A e.D E := by intro h' - have : collinear e.A e.B E := by + have : Collinear e.A e.B E := by apply collinear_of_collinear_collinear_ne adb_collinear h' D_ne_A - have neghnd : collinear e.A e.B e.C := by - apply collinear_of_collinear_collinear_ne (flip_collinear_snd_trd this) aec_collinear E_ne_A + have neghnd : Collinear e.A e.B e.C := by + apply collinear_of_collinear_collinear_ne (Collinear.perm₁₃₂ this) aec_collinear E_ne_A exact e.not_collinear_ABC neghnd - have not_collinear_CDE : ¬ collinear e.C e.D E := by + have not_collinear_CDE : ¬ Collinear e.C e.D E := by intro h - have : collinear e.C e.D e.A := by - apply flip_collinear_snd_trd + have : Collinear e.C e.D e.A := by + apply Collinear.perm₁₃₂ apply collinear_of_collinear_collinear_ne - apply (flip_collinear_snd_trd (flip_collinear_fst_snd (flip_collinear_snd_trd aec_collinear))) - apply flip_collinear_snd_trd h + apply (Collinear.perm₁₃₂ (Collinear.perm₂₁₃ (Collinear.perm₁₃₂ aec_collinear))) + apply Collinear.perm₁₃₂ h apply E_ne_C - have : collinear e.A e.B e.C := by + have : Collinear e.A e.B e.C := by apply collinear_of_collinear_collinear_ne apply adb_collinear -- apply e.hD - apply (flip_collinear_snd_trd (flip_collinear_fst_snd (flip_collinear_snd_trd this))) + apply (Collinear.perm₁₃₂ (Collinear.perm₂₁₃ (Collinear.perm₁₃₂ this))) apply D_ne_A apply e.not_collinear_ABC this @@ -184,7 +184,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Claim :$C \ne A$ C_ne_A : C ≠ A := -- This is because vertices $A, C$ of a nondegenerate triangle are distinct. diff --git a/EuclideanGeometry/Example/ShanZun/Ex1c.lean b/EuclideanGeometry/Example/ShanZun/Ex1c.lean index e0e51207..5676b29a 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1c.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1c.lean @@ -13,7 +13,7 @@ namespace Shan_Problem_1_7 Prove that $CD = AB / 2$. -/ -variable {A B C: P} {hnd : ¬ collinear A B C} +variable {A B C: P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $A \ne C$ and $B \ne C$. -- This is because vertices of nondegenerate triangles are distinct. lemma B_ne_a : B ≠ A := (ne_of_not_collinear hnd).2.2 @@ -28,8 +28,8 @@ lemma d_ne_a: D ≠ A := by apply (SegND.midpt_lies_int (SegND := SegND A B (b_ne_a).symm)).2.1 use C by_contra h - have : collinear A B C :=by - apply flip_collinear_fst_snd h + have : Collinear A B C :=by + apply Collinear.perm₂₁₃ h trivial --Introduce the midpoint E of AC variable {E : P} {he : E= (SEG A C).midpoint} @@ -44,12 +44,12 @@ lemma e_ne_C: E ≠ C := by use B exact hnd --midpoint lies on the segment -lemma adb_collinear : collinear A D B := by +lemma adb_collinear : Collinear A D B := by apply collinear_of_vec_eq_smul_vec' use 2 simp only [hd,Seg.midpoint,one_div, seg_toVec_eq_vec, vec_of_pt_vadd_pt_eq_vec,smul_smul] norm_num -lemma aec_collinear : collinear A E C := by +lemma aec_collinear : Collinear A E C := by apply collinear_of_vec_eq_smul_vec' use 2 simp only [he,Seg.midpoint,one_div, seg_toVec_eq_vec, vec_of_pt_vadd_pt_eq_vec,smul_smul] @@ -82,40 +82,40 @@ lemma ae_ratio : (SEG A E).length / (SEG A C).length = 2⁻¹ :=by rw[he] apply Seg.midpt_lies_on -lemma hnd': ¬ collinear A D E := by +lemma hnd': ¬ Collinear A D E := by intro h' - have : collinear A B E := by + have : Collinear A B E := by apply collinear_of_collinear_collinear_ne adb_collinear h' d_ne_a exact hd use B use C exact hnd exact hd - have neghnd : collinear A B C := by - apply collinear_of_collinear_collinear_ne (flip_collinear_snd_trd this) aec_collinear e_ne_a + have neghnd : Collinear A B C := by + apply collinear_of_collinear_collinear_ne (Collinear.perm₁₃₂ this) aec_collinear e_ne_a exact he use B use C exact hnd exact he apply hnd neghnd -lemma hnd'' : ¬ collinear C D E := by +lemma hnd'' : ¬ Collinear C D E := by intro h - have : collinear C D A := by - apply flip_collinear_snd_trd + have : Collinear C D A := by + apply Collinear.perm₁₃₂ apply collinear_of_collinear_collinear_ne - apply (flip_collinear_snd_trd (flip_collinear_fst_snd (flip_collinear_snd_trd aec_collinear))) + apply (Collinear.perm₁₃₂ (Collinear.perm₂₁₃ (Collinear.perm₁₃₂ aec_collinear))) use E exact he - apply flip_collinear_snd_trd h + apply Collinear.perm₁₃₂ h apply e_ne_C apply hnd exact he - have : collinear A B C := by + have : Collinear A B C := by apply collinear_of_collinear_collinear_ne apply adb_collinear apply hd - apply (flip_collinear_snd_trd (flip_collinear_fst_snd (flip_collinear_snd_trd this))) + apply (Collinear.perm₁₃₂ (Collinear.perm₂₁₃ (Collinear.perm₁₃₂ this))) apply d_ne_a apply hnd exact hd @@ -210,7 +210,7 @@ namespace Shan_Problem_1_8 /- In $\triangle ABC$, let $BD$ and $CE$ be the heights, with foots $D$ and $E$, respectively. Let $F$ and $G$ be the midpoint of $BC$ and $DE$, respectively. Prove that $FG \perp DE$. -/ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry diff --git a/EuclideanGeometry/Example/ShanZun/Ex1d.lean b/EuclideanGeometry/Example/ShanZun/Ex1d.lean index 4e37365a..3785e5ee 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1d.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1d.lean @@ -14,7 +14,7 @@ namespace Shan_Problem_1_9 Prove that $AB = 2\cdot DE$. -/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma a_ne_b : A ≠ B := sorry lemma b_ne_c : B ≠ C := sorry @@ -49,7 +49,7 @@ theorem Shan_Problem_1_9 : (SEG A B).length = 2 * (SEG D E).length := by -- $\angle DFE = \angle FED$ have ang₄ : ∠ E F D f_ne_e.symm f_ne_d.symm = ∠ D E F d_ne_e f_ne_e := sorry -- $D F E$ is not collinear - have dfe_not_collinear : ¬ collinear D F E := sorry + have dfe_not_collinear : ¬ Collinear D F E := sorry -- $ED = DF$ because $\triangle DFE$ is isoceles have dfe_isoceles : (TRI_nd D F E dfe_not_collinear).1.IsIsoceles := by apply is_isoceles_tri_iff_ang_eq_ang_of_nd_tri.mpr @@ -68,7 +68,7 @@ namespace Shan_Problem_1_10 Prove that $AD = DC$. -/ -- Let $\triangle ABC$ be an isosceles triangle in which $AB = AC$. -variable {A B C : P} {hnd : ¬ collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} +variable {A B C : P} {hnd : ¬ Collinear A B C} {isoceles_ABC : (▵ A B C).IsIsoceles} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma a_ne_b : A ≠ B := sorry lemma b_ne_c : B ≠ C := sorry @@ -116,7 +116,7 @@ theorem Shan_Problem_1_10 : (SEG A D).length = (SEG D C).length := by -- $\angle BMC = 2\pi / 5$ have ang₁ : ∠ B M C b_ne_m m_ne_c.symm = ↑ (2 * π / 5) := sorry -- $BAM$ is not collinear - have bam_not_collinear : ¬ collinear B A M := sorry + have bam_not_collinear : ¬ Collinear B A M := sorry -- $\triangle BAM$ is isoceles have isocele₁ : (TRI_nd B A M bam_not_collinear).1.IsIsoceles := sorry -- Let $N$ be the midpoint of $AC$ diff --git a/EuclideanGeometry/Example/ShanZun/Ex1e'.lean b/EuclideanGeometry/Example/ShanZun/Ex1e'.lean index 6bdf39da..3524919c 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1e'.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1e'.lean @@ -15,7 +15,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Claim : $B \ne A$ B_ne_A : B ≠ A := -- This is because vertices $B, C$ of a nondegenerate triangle are distinct. @@ -57,7 +57,7 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Claim :$C \ne A$ C_ne_A : C ≠ A := -- This is because vertices $A, C$ of a nondegenerate triangle are distinct. diff --git a/EuclideanGeometry/Example/ShanZun/Ex1e.lean b/EuclideanGeometry/Example/ShanZun/Ex1e.lean index 065f408e..d3af9003 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1e.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1e.lean @@ -12,7 +12,7 @@ the perpendicular line passing through $D$ of the bisector of $\angle BAC$ inter Prove that $BE=CF=\frac{1}{2}|AB-AC|$. -/ -- We have triagngle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -34,7 +34,7 @@ namespace Shan_Problem_2_18 Prove that $E$ liesInt $DF$ -/ -- We have triagngle $\triangle ABC$ such that $AC < BC$ -variable {A B C : P} {hnd : ¬ collinear A B C} {hedge : (SEG A C).length < (SEG B C).length} +variable {A B C : P} {hnd : ¬ Collinear A B C} {hedge : (SEG A C).length < (SEG B C).length} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -56,7 +56,7 @@ namespace Shan_Problem_2_18' If $\angle ACB = 90^{circ}$, prove that $CE$ is the bisector of $\angle FCD$. -/ -- We have triagngle $\triangle ABC$ such that $AC < BC$ -variable {A B C : P} {hnd : ¬ collinear A B C} {hedge : (SEG A C).length < (SEG B C).length} +variable {A B C : P} {hnd : ¬ Collinear A B C} {hedge : (SEG A C).length < (SEG B C).length} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry diff --git a/EuclideanGeometry/Example/ShanZun/Ex1f'.lean b/EuclideanGeometry/Example/ShanZun/Ex1f'.lean index fbb48aff..db9d0575 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1f'.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1f'.lean @@ -18,7 +18,7 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - hnd : ¬ collinear A B C + hnd : ¬ Collinear A B C hreg : (▵ A B C).IsRegular -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. instance A_ne_B {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane} : PtNe e.A e.B := ⟨(ne_of_not_collinear e.hnd).2.2.symm⟩ @@ -115,8 +115,8 @@ theorem Result {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane} : (S right exact sixty₂ -- $BFE$ is not collinear because $\angle FBE = \frac{\pi}{3}$ or $ - \frac{\pi}{3}$ - have BFE_not_collinear : ¬ collinear e.B e.F e.E := sorry - have BEF_not_collinear : ¬ collinear e.B e.E e.F := sorry + have BFE_not_collinear : ¬ Collinear e.B e.F e.E := sorry + have BEF_not_collinear : ¬ Collinear e.B e.E e.F := sorry -- $\triangle BFE$ is regular because $BF = EB$ and $\angle FBE = \frac{\pi}{3}$ or $ - \frac{\pi}{3}$ have BFE_is_regular : (TRI_nd e.B e.F e.E BFE_not_collinear).1.IsRegular := by apply regular_tri_of_isoceles_tri_of_fst_ang_eq_sixty_deg @@ -161,8 +161,8 @@ theorem Result {Plane : Type _} [EuclideanPlane Plane] {e : Setting2 Plane} : (S _ = (SEG e.B e.E).length := by simp only [length_of_rev_eq_length'] -- $BEC$ is not collinear and $FED$ is not collinear - have BEC_not_collinear : ¬ collinear e.B e.E e.C := sorry - have FED_not_collinear : ¬ collinear e.F e.E e.D := sorry + have BEC_not_collinear : ¬ Collinear e.B e.E e.C := sorry + have FED_not_collinear : ¬ Collinear e.F e.E e.D := sorry -- $\triangle BCE$ is anti-congruence to $\triangle FDE$ have cong : (TRI_nd e.B e.E e.C BEC_not_collinear) ≅ₐ (TRI_nd e.F e.E e.D FED_not_collinear) := TriangleND.acongr_of_SAS DF_eq_CB.symm ang_EBC_eq_neg_ang_EFD FE_eq_BE.symm -- $EC = ED$ because $\triangle BCE \cong \triangle FDE$ @@ -182,7 +182,7 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - hnd : ¬ collinear A B C + hnd : ¬ Collinear A B C -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. instance A_ne_B {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane} : PtNe e.A e.B := ⟨(ne_of_not_collinear e.hnd).2.2.symm⟩ instance B_ne_C {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane} : PtNe e.B e.C := ⟨(ne_of_not_collinear e.hnd).1.symm⟩ @@ -226,7 +226,7 @@ structure Setting1 (Plane : Type _) [EuclideanPlane Plane] where A : Plane B : Plane C : Plane - hnd : ¬ collinear A B C + hnd : ¬ Collinear A B C -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. instance A_ne_B {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane} : PtNe e.A e.B := ⟨(ne_of_not_collinear e.hnd).2.2.symm⟩ instance B_ne_C {Plane : Type _} [EuclideanPlane Plane] {e : Setting1 Plane} : PtNe e.B e.C := ⟨(ne_of_not_collinear e.hnd).1.symm⟩ @@ -269,7 +269,7 @@ such that $AE = 2 EC$ Prove that $AF = 3 FB$ -/ -- We have acute triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} {hacute : TriangleND.IsAcute (TRI_nd A B C hnd)} +variable {A B C : P} {hnd : ¬ Collinear A B C} {hacute : TriangleND.IsAcute (TRI_nd A B C hnd)} -- 这个题应该需要加锐角三角形的限制,否则需要条件中的$AE = 2 EC$是有向线段的相等 -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry @@ -292,7 +292,7 @@ let the angle bisectors of $\angle ADB$ and $\angle ADC$ intersect $AB$ and $AC$ Prove that $EF \parallel BC$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -320,7 +320,7 @@ $CD,BE$ intersects at $O$ Prove that $OE = \frac{1}{4} BE$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- $D$ is midpoint of $AB$ variable {D : P} {hd : D = (SEG A B).midpoint} -- $E$ lies on $AC$ such that $AE = 2 CE$, @@ -339,7 +339,7 @@ The parallel line to $AC$ of $E,F$ intersect $BC$ at $G,H$ respectively, Prove that $EG + FH = AC$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -396,7 +396,7 @@ the angle bisector of $\angle ABC$ intersect $AD$ and $AC$ at $M,N$ respectively Prove that $AB^2 - AN^2 = BM \times BN$-/ -- Let triangle $\triangle ABC$ be a right triangle with $\angle BAC = 90^{circ}$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma a_ne_b : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry diff --git a/EuclideanGeometry/Example/ShanZun/Ex1f.lean b/EuclideanGeometry/Example/ShanZun/Ex1f.lean index b6e2b0aa..905be2b9 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1f.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1f.lean @@ -14,7 +14,7 @@ such that $AE = BD$, connect $CE,DE$ Prove that $CE = DE$ -/ -- Let $\triangle ABC$ be a regular triangle -variable {A B C : P} {hnd : ¬ collinear A B C} {hreg : (▵ A B C).IsRegular} +variable {A B C : P} {hnd : ¬ Collinear A B C} {hreg : (▵ A B C).IsRegular} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -121,7 +121,7 @@ theorem Shan_Problem_2_11 : (SEG C E).length = (SEG D E).length := by right exact sixty₂ -- $BFE$ is not collinear - have BFE_not_collinear : ¬ collinear B F E := sorry + have BFE_not_collinear : ¬ Collinear B F E := sorry -- $\triangle BFE$ is regular have BFE_is_regular : (TRI_nd B F E BFE_not_collinear).1.IsRegular := by apply regular_tri_of_isoceles_tri_of_fst_ang_eq_sixty_deg @@ -146,8 +146,8 @@ theorem Shan_Problem_2_11 : (SEG C E).length = (SEG D E).length := by _ = (SEG B E).length := by simp only [length_of_rev_eq_length'] -- $BEC$ is not collinear and $FED$ is not collinear - have BEC_not_collinear : ¬ collinear B E C := sorry - have FED_not_collinear : ¬ collinear F E D := sorry + have BEC_not_collinear : ¬ Collinear B E C := sorry + have FED_not_collinear : ¬ Collinear F E D := sorry -- $\triangle BCE$ is anti-congruence to $\triangle FDE$ have cong : (TRI_nd B E C BEC_not_collinear) ≅ₐ (TRI_nd F E D FED_not_collinear) := TriangleND.acongr_of_SAS DF_eq_CB.symm ang_EBC_eq_neg_ang_EFD FE_eq_BE.symm -- $EC = ED$ because $\triangle BCE \cong \triangle FDE$ @@ -163,7 +163,7 @@ line $DF$ and $EG$ intersect at $H$ Prove that quadrilateral $ABCH$ is parallelogram -/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -191,7 +191,7 @@ such that $FB = CG$ and $AF \parallel BE$ , Prove that $AG \parallel DC$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -224,7 +224,7 @@ such that $AE = 2 EC$ Prove that $AF = 3 FB$ -/ -- We have acute triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} {hacute : TriangleND.IsAcute (TRI_nd A B C hnd)} +variable {A B C : P} {hnd : ¬ Collinear A B C} {hacute : TriangleND.IsAcute (TRI_nd A B C hnd)} -- 这个题应该需要加锐角三角形的限制,否则需要条件中的$AE = 2 EC$是有向线段的相等 -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry @@ -247,7 +247,7 @@ let the angle bisectors of $\angle ADB$ and $\angle ADC$ intersect $AB$ and $AC$ Prove that $EF \parallel BC$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -275,7 +275,7 @@ $CD,BE$ intersects at $O$ Prove that $OE = \frac{1}{4} BE$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- $D$ is midpoint of $AB$ variable {D : P} {hd : D = (SEG A B).midpoint} -- $E$ lies on $AC$ such that $AE = 2 CE$, @@ -294,7 +294,7 @@ The parallel line to $AC$ of $E,F$ intersect $BC$ at $G,H$ respectively, Prove that $EG + FH = AC$-/ -- We have triangle $\triangle ABC$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma A_ne_B : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry @@ -351,7 +351,7 @@ the angle bisector of $\angle ABC$ intersect $AD$ and $AC$ at $M,N$ respectively Prove that $AB^2 - AN^2 = BM \times BN$-/ -- Let triangle $\triangle ABC$ be a right triangle with $\angle BAC = 90^{circ}$ -variable {A B C : P} {hnd : ¬ collinear A B C} +variable {A B C : P} {hnd : ¬ Collinear A B C} -- Claim: $A \ne B$ and $B \ne C$ and $C \ne A$. lemma a_ne_b : A ≠ B := sorry lemma B_ne_C : B ≠ C := sorry diff --git a/EuclideanGeometry/Example/ShanZun/Ex1h'.lean b/EuclideanGeometry/Example/ShanZun/Ex1h'.lean index df140326..c8da9eab 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1h'.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1h'.lean @@ -107,15 +107,15 @@ structure Setting (Plane : Type _) [EuclideanPlane Plane] where --The pair of points (G,H) divides the segement AC into three segments with the same length. theorem result {Plane : Type _} [EuclideanPlane Plane] (e : Setting Plane) :(SEG e.A e.G).length=(SEG e.G e.H).length ∧ (SEG e.A e.G).length=(SEG e.H e.C).length := by -- $▵AFG$ is nontrivial - have AFG_nd : ¬ collinear e.A e.F e.G := sorry + have AFG_nd : ¬ Collinear e.A e.F e.G := sorry -- $▵CBG$ is nontrivial - have CBG_nd : ¬ collinear e.C e.B e.G :=sorry + have CBG_nd : ¬ Collinear e.C e.B e.G :=sorry -- $▵ AFG ∼ ▵ CBG$ with ratio 1/2 by AAA have AFG_sim_CBG : (TRI_nd e.A e.F e.G AFG_nd) ∼ (TRI_nd e.C e.B e.G CBG_nd) := sorry --The following three may not be necessary since we can use the above three lemmas instead - have CEH_nd : ¬ collinear e.C e.E e.H := sorry - have ADH_nd : ¬ collinear e.A e.D e.H := sorry + have CEH_nd : ¬ Collinear e.C e.E e.H := sorry + have ADH_nd : ¬ Collinear e.A e.D e.H := sorry -- $▵ CEH ∼ ▵ ADH$ with ratio 1/2 by AAA have CEH_sim_ADH : (TRI_nd e.C e.E e.H CEH_nd) ∼ (TRI_nd e.A e.D e.H ADH_nd) := sorry -- length of segment AG is half of segment CG diff --git a/EuclideanGeometry/Example/ShanZun/Ex1h.lean b/EuclideanGeometry/Example/ShanZun/Ex1h.lean index c3e864dd..b1f7bb12 100644 --- a/EuclideanGeometry/Example/ShanZun/Ex1h.lean +++ b/EuclideanGeometry/Example/ShanZun/Ex1h.lean @@ -64,15 +64,15 @@ lemma b_ne_f : B ≠ F := sorry -- G is the intersection point of AC and BF, H is the intersection point of AC and DE variable {G H : P} {hg : is_inx G (LIN A C c_ne_a.symm) (LIN B F b_ne_f)} {hh : is_inx H (LIN A C c_ne_a.symm) (LIN D E d_ne_e)} -- $▵AFG$ is nontrivial -lemma afg_nd : ¬ collinear A F G := sorry +lemma afg_nd : ¬ Collinear A F G := sorry -- $▵CBG$ is nontrivial -lemma cbg_nd : ¬ collinear C B G :=sorry +lemma cbg_nd : ¬ Collinear C B G :=sorry -- $▵ AFG ∼ ▵ CBG$ with ratio 1/2 by AAA lemma afg_sim_cbg : (TRI_nd A F G afg_nd) ∼ (TRI_nd C B G cbg_nd) := sorry --The following three may not be necessary since we can use the above three lemmas instead -- -lemma ceh_nd : ¬ collinear C E H := sorry -lemma adh_nd : ¬ collinear A D H :=sorry +lemma ceh_nd : ¬ Collinear C E H := sorry +lemma adh_nd : ¬ Collinear A D H :=sorry -- $▵ CEH ∼ ▵ ADH$ with ratio 1/2 by AAA lemma ceh_sim_adh : (TRI_nd C E H ceh_nd) ∼ (TRI_nd A D H adh_nd) := sorry -- length of segment AG is half of segment CG diff --git a/EuclideanGeometry/Foundation/Axiom/Basic/Class.lean b/EuclideanGeometry/Foundation/Axiom/Basic/Class.lean index e8ba91fb..1cce6e08 100644 --- a/EuclideanGeometry/Foundation/Axiom/Basic/Class.lean +++ b/EuclideanGeometry/Foundation/Axiom/Basic/Class.lean @@ -42,14 +42,6 @@ variable {P : Type*} {α β γ} section carrier -abbrev PtNe [EuclideanPlane P] (A B : P) : Prop := - Fact <| A ≠ B - -instance PtNe.symm [EuclideanPlane P] {A B : P} [h : PtNe A B] : PtNe B A := ⟨h.out.symm⟩ - -@[simp] -lemma pt_ne [EuclideanPlane P] {A B : P} [h : PtNe A B] : A ≠ B := @Fact.out _ h - /-- The class of plane figures. We say `α` is a plane figure, if for every given Euclidean plane `P`, `α P` is a collection of specific figures on `P`, each equipped with a carrier set of type `Set P`. -/ class Fig (α : Type*) (P : outParam <| Type*) where carrier : α → Set P diff --git a/EuclideanGeometry/Foundation/Axiom/Basic/Plane.lean b/EuclideanGeometry/Foundation/Axiom/Basic/Plane.lean index c33ca522..b64163dc 100644 --- a/EuclideanGeometry/Foundation/Axiom/Basic/Plane.lean +++ b/EuclideanGeometry/Foundation/Axiom/Basic/Plane.lean @@ -33,6 +33,14 @@ class EuclideanPlane (P : Type _) extends MetricSpace P, NormedAddTorsor Vec P variable {P : Type _} [EuclideanPlane P] +abbrev PtNe (A B : P) : Prop := + Fact <| A ≠ B + +instance PtNe.symm [EuclideanPlane P] {A B : P} [h : PtNe A B] : PtNe B A := ⟨h.out.symm⟩ + +@[simp] +lemma pt_ne [EuclideanPlane P] {A B : P} [h : PtNe A B] : A ≠ B := @Fact.out _ h + def Vec.mkPtPt (A B : P) : Vec := (B -ᵥ A) scoped notation "VEC" => Vec.mkPtPt @@ -60,14 +68,18 @@ theorem neg_vec_norm_eq (A B : P) : ‖- VEC A B‖ = ‖VEC A B‖ := by theorem vec_norm_eq_rev (A B : P) : ‖VEC A B‖ = ‖VEC B A‖ := by rw [← neg_vec, neg_vec_norm_eq] -theorem eq_iff_vec_eq_zero (A B : P) : B = A ↔ VEC A B = 0 := vsub_eq_zero_iff_eq.symm +theorem eq_iff_vec_eq_zero {A B : P} : B = A ↔ VEC A B = 0 := vsub_eq_zero_iff_eq.symm -theorem ne_iff_vec_ne_zero (A B : P) : B ≠ A ↔ VEC A B ≠ 0 := (eq_iff_vec_eq_zero A B).not +theorem ne_iff_vec_ne_zero {A B : P} : B ≠ A ↔ VEC A B ≠ 0 := eq_iff_vec_eq_zero.not @[simp] theorem vec_add_vec (A B C : P) : VEC A B + VEC B C = VEC A C := by rw [add_comm, Vec.mkPtPt, Vec.mkPtPt, Vec.mkPtPt, vsub_add_vsub_cancel] +theorem vec_vadd_right (A B : P) (v : Vec) : VEC A (v +ᵥ B) = v + VEC A B := vadd_vsub_assoc v B A + +theorem vec_vadd_left (A B : P) (v : Vec) : VEC (v +ᵥ A) B = VEC A B - v := vsub_vadd_eq_vsub_sub B A v + @[simp] theorem vec_of_pt_vadd_pt_eq_vec (A : P) (v : Vec) : VEC A (v +ᵥ A) = v := vadd_vsub v A @@ -88,10 +100,10 @@ theorem vec_sub_vec' (O A B: P) : VEC A O - VEC B O = VEC A B := by theorem pt_eq_pt_of_eq_smul_smul {O A B : P} {v : Vec} {tA tB : ℝ} (h : tA = tB) (ha : VEC O A = tA • v) (hb : VEC O B = tB • v) : A = B := by have hc : VEC A B = VEC O B - VEC O A := (vec_sub_vec O A B).symm rw [ha, hb, ← sub_smul, Iff.mpr sub_eq_zero h.symm, zero_smul] at hc - exact ((eq_iff_vec_eq_zero A B).2 hc).symm + exact (eq_iff_vec_eq_zero.2 hc).symm -def VecND.mkPtPt (A B : P) (h : B ≠ A) : VecND := ⟨Vec.mkPtPt A B, (ne_iff_vec_ne_zero A B).mp h⟩ +def VecND.mkPtPt (A B : P) (h : B ≠ A) : VecND := ⟨Vec.mkPtPt A B, ne_iff_vec_ne_zero.mp h⟩ @[inherit_doc VecND.mkPtPt] scoped syntax "VEC_nd" ws term:max ws term:max (ws term:max)? : term @@ -117,4 +129,63 @@ def delabVecNDMkPtPt : Delab := do @[simp] lemma VecND.coe_mkPtPt (A B : P) [_h : Fact (B ≠ A)] : VEC_nd A B = VEC A B := rfl +/- Definition of the wedge of three points.-/ + +section wedge + +def wedge (A B C : P) : ℝ := Vec.det (VEC A B) (VEC A C) + +def oarea (A B C : P) : ℝ := wedge A B C / 2 + +@[simp] +theorem wedge_self₁₂ (A C : P) : wedge A A C = 0 := by + unfold wedge + simp + +@[simp] +theorem wedge_self₂₃ (A C : P) : wedge C A A = 0 := by + unfold wedge + simp + +@[simp] +theorem wedge_self₃₁ (A C : P) : wedge A C A = 0 := by + unfold wedge + simp + +theorem wedge213 (A B C : P) : wedge B A C = - wedge A B C := by + unfold wedge + rw [← neg_vec A B, ← vec_sub_vec A B C, map_sub] + simp only [map_neg, LinearMap.neg_apply, Vec.det_self, neg_zero, sub_zero] + +theorem wedge132 (A B C : P) : wedge A C B = - wedge A B C := by + unfold wedge + rw [Vec.det_skew] + +theorem wedge231 (A B C : P) : wedge C A B = wedge A B C := by + rw [wedge213, wedge132, neg_neg] + +theorem wedge312 (A B C : P) : wedge B C A = wedge A B C := by rw [wedge231, wedge231] + +theorem wedge321 (A B C : P) : wedge C B A = - wedge A B C := by rw [wedge213, wedge312] + +lemma wedge_def₁ (A B C : P) : wedge A B C = Vec.det (VEC A B) (VEC A C) := rfl + +lemma wedge_def₂ (A B C : P) : wedge A B C = Vec.det (VEC B C) (VEC B A) := by + rw [← wedge_def₁, wedge231] + +lemma wedge_def₃ (A B C : P) : wedge A B C = Vec.det (VEC C A) (VEC C B) := by + rw [← wedge_def₂, wedge231] + +lemma wedge_vadd (A B C : P) (v : Vec) : wedge A B (v +ᵥ C) = Vec.det (VEC A B) v + wedge A B C := by + simp [wedge, vec_vadd_right] + +lemma wedge_smul_vec_self_vadd (A B C : P) (k : ℝ) : wedge A B (k • VEC A B +ᵥ C) = wedge A B C := by + simp [wedge_vadd] + +lemma wedge_eq_wedge_iff (A B C D : P) [PtNe B A] : wedge A B C = wedge A B D ↔ ∃ k : ℝ, VEC C D = k • VEC A B := by + rw [eq_comm, ← sub_eq_zero, wedge, wedge, ← map_sub, vec_sub_vec, Vec.det_eq_zero_iff_eq_smul_left, + or_iff_right (ne_iff_vec_ne_zero.mp pt_ne)] + +end wedge + end EuclidGeom diff --git a/EuclideanGeometry/Foundation/Axiom/Circle/Basic.lean b/EuclideanGeometry/Foundation/Axiom/Circle/Basic.lean index 507d6d09..0a2bce79 100644 --- a/EuclideanGeometry/Foundation/Axiom/Circle/Basic.lean +++ b/EuclideanGeometry/Foundation/Axiom/Circle/Basic.lean @@ -23,7 +23,7 @@ def mk_pt_pt (O A : P) [h : PtNe O A] : Circle P where radius := dist O A rad_pos := dist_pos.mpr h.out -def mk_pt_pt_pt (A B C: P) (h : ¬ collinear A B C) : Circle P := sorry +def mk_pt_pt_pt (A B C: P) (h : ¬ Collinear A B C) : Circle P := sorry end Circle @@ -156,7 +156,7 @@ end Circle end position -section collinear +section Collinear namespace Circle @@ -182,8 +182,8 @@ lemma pts_lieson_circle_vec_eq {A B : P} {ω : Circle P} [hne : PtNe B A] (hl₁ linarith⟩ apply distinct_pts_same_dist_vec_eq · have : (perp_foot ω.center (LIN A B)) LiesOn (LIN A B) := perp_foot_lies_on_line _ _ - have : collinear A B (perp_foot ω.center (LIN A B)) := Line.pt_pt_linear this - have : collinear (perp_foot ω.center (LIN A B)) A B := perm_collinear_trd_fst_snd this + have : Collinear A B (perp_foot ω.center (LIN A B)) := Line.pt_pt_linear this + have : Collinear (perp_foot ω.center (LIN A B)) A B := Collinear.perm₃₁₂ this apply Line.pt_pt_maximal this apply (sq_eq_sq dist_nonneg dist_nonneg).mp calc @@ -201,12 +201,12 @@ theorem pts_lieson_circle_perpfoot_eq_midpoint {A B : P} {ω : Circle P} [hne : _ = (1 / 2 : ℝ) • ((2 : ℝ) • VEC A (perp_foot ω.center (LIN A B))) := by rw [← (pts_lieson_circle_vec_eq hl₁ hl₂), two_smul] _ = VEC A (perp_foot ω.center (LIN A B)) := by simp have eq₂ : VEC A (SEG A B).midpoint = (1 / 2 : ℝ) • (VEC A B) := Seg.vec_source_midpt - apply (eq_iff_vec_eq_zero _ _).mpr + apply eq_iff_vec_eq_zero.mpr calc _ = VEC A (perp_foot ω.center (LIN A B)) - VEC A (SEG A B).midpoint := by rw [vec_sub_vec] _ = 0 := by rw [eq₁, eq₂]; simp -theorem three_pts_lieson_circle_not_collinear {A B C : P} {ω : Circle P} [hne₁ : PtNe B A] [hne₂ : PtNe C B] [hne₃ : PtNe A C] (hl₁ : A LiesOn ω) (hl₂ : B LiesOn ω) (hl₃ : C LiesOn ω) : ¬ (collinear A B C) := by +theorem three_pts_lieson_circle_not_collinear {A B C : P} {ω : Circle P} [hne₁ : PtNe B A] [hne₂ : PtNe C B] [hne₃ : PtNe A C] (hl₁ : A LiesOn ω) (hl₂ : B LiesOn ω) (hl₃ : C LiesOn ω) : ¬ (Collinear A B C) := by intro h have eq₁ : VEC A (perp_foot ω.center (LIN A B)) = VEC (perp_foot ω.center (LIN A B)) B := pts_lieson_circle_vec_eq hl₁ hl₂ have eq₂ : VEC A (perp_foot ω.center (LIN A C)) = VEC (perp_foot ω.center (LIN A C)) C := pts_lieson_circle_vec_eq hl₁ hl₃ @@ -218,12 +218,12 @@ theorem three_pts_lieson_circle_not_collinear {A B C : P} {ω : Circle P} [hne calc _ = VEC (perp_foot ω.center (LIN A B)) C - VEC (perp_foot ω.center (LIN A B)) B := by rw [vec_sub_vec] _ = 0 := by rw [← eq₁, ← eq₂, sub_self] - have : VEC B C ≠ 0 := (ne_iff_vec_ne_zero _ _).mp hne₂.out + have : VEC B C ≠ 0 := ne_iff_vec_ne_zero.mp hne₂.out tauto end Circle -end collinear +end Collinear section antipode @@ -255,7 +255,7 @@ theorem antipode_distinct {A : P} {ω : Circle P} {ha : A LiesOn ω} : antipode apply (eq_vadd_iff_vsub_eq _ _ _).mp eq.symm have neq : A ≠ ω.center := (pt_lieson_ne_center ha).out contrapose! neq - apply (eq_iff_vec_eq_zero _ _).mpr + apply eq_iff_vec_eq_zero.mpr have : 2 • (VEC ω.center A) = 0 := by rw [two_smul] nth_rw 1 [this] diff --git a/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean b/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean index 700a92d8..0ff726c2 100644 --- a/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean +++ b/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean @@ -106,7 +106,7 @@ theorem extangent_pt_lieson_circles {ω₁ : Circle P} {ω₂ : Circle P} (h : rw [norm_smul, Dir.norm_unitVec, mul_one, Real.norm_of_nonneg ω₂.rad_pos.le] exact this -theorem extangent_pt_centers_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Extangent ω₂) : collinear ω₁.center (Extangentpt h) ω₂.center := by +theorem extangent_pt_centers_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Extangent ω₂) : Collinear ω₁.center (Extangentpt h) ω₂.center := by haveI : PtNe ω₁.center ω₂.center := ⟨extangent_centers_distinct h⟩ have : VEC ω₁.center (Extangentpt h) = (ω₁.radius * ‖VEC ω₁.center ω₂.center‖⁻¹) • (VEC ω₁.center ω₂.center) := by calc @@ -115,7 +115,7 @@ theorem extangent_pt_centers_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h simp _ = ω₁.radius • (‖VEC ω₁.center ω₂.center‖⁻¹ • (VEC ω₁.center ω₂.center)) := rfl _ = (ω₁.radius * ‖VEC ω₁.center ω₂.center‖⁻¹) • (VEC ω₁.center ω₂.center) := by apply smul_smul - apply flip_collinear_snd_trd (collinear_of_vec_eq_smul_vec this) + apply Collinear.perm₁₃₂ (collinear_of_vec_eq_smul_vec this) end CC @@ -176,7 +176,7 @@ theorem intangent_pt_lieson_circles {ω₁ : Circle P} {ω₂ : Circle P} (h : show Circle.IsOn (Intangentpt h) ω₂ exact this -theorem intangentpt_centers_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Intangent ω₂) : collinear ω₁.center ω₂.center (Intangentpt h) := by +theorem intangentpt_centers_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Intangent ω₂) : Collinear ω₁.center ω₂.center (Intangentpt h) := by haveI : PtNe ω₁.center ω₂.center := ⟨h.2⟩ have : VEC ω₁.center (Intangentpt h) = (- ω₁.radius * ‖(VEC ω₁.center ω₂.center)‖⁻¹) • VEC ω₁.center ω₂.center := by calc @@ -298,7 +298,7 @@ def Inxpts {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Intersect ω₂) : C right := (- Real.sqrt (ω₁.radius ^ 2 - (radical_axis_dist_to_the_first ω₁ ω₂) ^ 2) * Complex.I + (radical_axis_dist_to_the_first ω₁ ω₂)) • (VEC_nd ω₁.center ω₂.center (intersected_centers_distinct h).symm).toDir.unitVec +ᵥ ω₁.center theorem inx_pts_distinct {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Intersect ω₂) : (Inxpts h).left ≠ (Inxpts h).right := by - apply (ne_iff_vec_ne_zero _ _).mpr + apply ne_iff_vec_ne_zero.mpr unfold Vec.mkPtPt Inxpts simp only [neg_mul, vadd_vsub_vadd_cancel_right, ne_eq, ← sub_smul] simp only [add_sub_add_right_eq_sub, sub_neg_eq_add, smul_eq_zero, add_self_eq_zero, mul_eq_zero, @@ -391,11 +391,11 @@ theorem inx_pts_lieson_circles {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ apply Real.sqrt_sq (by linarith [ω₂.rad_pos]) apply mul_ne_zero (by norm_num) (dist_ne_zero.mpr cne.out) -lemma inx_pts_not_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Intersect ω₂) : (¬ collinear (Inxpts h).left ω₁.center ω₂.center) ∧ (¬ collinear (Inxpts h).right ω₁.center ω₂.center) := by +lemma inx_pts_not_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Intersect ω₂) : (¬ Collinear (Inxpts h).left ω₁.center ω₂.center) ∧ (¬ Collinear (Inxpts h).right ω₁.center ω₂.center) := by constructor · intro hc set tri : Triangle P := ▵ (Inxpts h).left ω₁.center ω₂.center with tri_def - have : collinear tri.1 tri.2 tri.3 := hc + have : Collinear tri.1 tri.2 tri.3 := hc rw [Triangle.edge_sum_eq_edge_iff_collinear] at this rcases this with heq | (heq | heq) · rw [tri_def] at heq @@ -430,7 +430,7 @@ lemma inx_pts_not_collinear {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Int linarith intro hc set tri : Triangle P := ▵ (Inxpts h).right ω₁.center ω₂.center with tri_def - have : collinear tri.1 tri.2 tri.3 := hc + have : Collinear tri.1 tri.2 tri.3 := hc rw [Triangle.edge_sum_eq_edge_iff_collinear] at this rcases this with heq | (heq | heq) · rw [tri_def] at heq @@ -513,7 +513,7 @@ theorem inx_pts_line_perp_center_line {ω₁ : Circle P} {ω₂ : Circle P} (h : rw [← hn] show ‖VEC (Inxpts h).left (Inxpts h).right‖ ≠ 0 apply norm_ne_zero_iff.mpr - apply (ne_iff_vec_ne_zero _ _).mp (inx_pts_distinct h).symm + apply ne_iff_vec_ne_zero.mp (inx_pts_distinct h).symm have hdir: (VEC_nd (Inxpts h).left (Inxpts h).right (inx_pts_distinct h).symm).toDir = - (Dir.I * (VEC_nd ω₁.center ω₂.center (intersected_centers_distinct h).symm).toDir) := by ext; rw [this]; rw [this] calc diff --git a/EuclideanGeometry/Foundation/Axiom/Circle/IncribedAngle.lean b/EuclideanGeometry/Foundation/Axiom/Circle/IncribedAngle.lean index 2e25fe40..8e83dc17 100644 --- a/EuclideanGeometry/Foundation/Axiom/Circle/IncribedAngle.lean +++ b/EuclideanGeometry/Foundation/Axiom/Circle/IncribedAngle.lean @@ -91,8 +91,8 @@ def complement (β : Arc P) : Arc P where lemma liesint_arc_not_lieson_dlin {β : Arc P} {p : P} (h : p LiesInt β) : ¬ (p LiesOn (DLIN β.source β.target)) := by intro hl have hl : p LiesOn (LIN β.source β.target) := hl - have hco : collinear β.source β.target p := Line.pt_pt_linear hl - have hco' : ¬ (collinear β.source β.target p) := Circle.three_pts_lieson_circle_not_collinear (hne₂ := ⟨h.2.2⟩) (hne₃ := ⟨h.2.1.symm⟩) β.ison.1 β.ison.2 h.1.1 + have hco : Collinear β.source β.target p := Line.pt_pt_linear hl + have hco' : ¬ (Collinear β.source β.target p) := Circle.three_pts_lieson_circle_not_collinear (hne₂ := ⟨h.2.2⟩) (hne₃ := ⟨h.2.1.symm⟩) β.ison.1 β.ison.2 h.1.1 tauto theorem liesint_arc_liesonright_dlin {β : Arc P} {p : P} (h : p LiesInt β) : p LiesOnRight (DLIN β.source β.target) := by @@ -132,7 +132,7 @@ theorem cangle_of_complementary_arc_are_opposite (β : Arc P) : β.cangle.value show (∠ β.source β.circle.center β.target = -∠ β.target β.circle.center β.source) apply neg_value_of_rev_ang -theorem antipode_iff_collinear (A B : P) {ω : Circle P} [h : PtNe B A] (h₁ : A LiesOn ω) (h₂ : B LiesOn ω) : Arc.IsAntipode A B h₁ h₂ ↔ collinear ω.center A B := by +theorem antipode_iff_collinear (A B : P) {ω : Circle P} [h : PtNe B A] (h₁ : A LiesOn ω) (h₂ : B LiesOn ω) : Arc.IsAntipode A B h₁ h₂ ↔ Collinear ω.center A B := by haveI : PtNe A ω.center := Circle.pt_lieson_ne_center h₁ haveI : PtNe B ω.center := Circle.pt_lieson_ne_center h₂ constructor @@ -160,8 +160,8 @@ theorem antipode_iff_collinear (A B : P) {ω : Circle P} [h : PtNe B A] (h₁ : exact value_eq_pi_of_lies_int_seg_nd hli theorem mk_pt_pt_diam_isantipode {A B : P} [h : PtNe A B] : Arc.IsAntipode A B (Circle.mk_pt_pt_diam_fst_lieson) (Circle.mk_pt_pt_diam_snd_lieson) := by - have hc : collinear (SEG A B).midpoint A B := by - apply perm_collinear_trd_fst_snd + have hc : Collinear (SEG A B).midpoint A B := by + apply Collinear.perm₃₁₂ apply Line.pt_pt_linear show (SEG A B).midpoint LiesOn (SEG_nd A B).toLine apply SegND.lies_on_toLine_of_lie_on diff --git a/EuclideanGeometry/Foundation/Axiom/Circle/LCPosition.lean b/EuclideanGeometry/Foundation/Axiom/Circle/LCPosition.lean index c5232b41..4520d488 100644 --- a/EuclideanGeometry/Foundation/Axiom/Circle/LCPosition.lean +++ b/EuclideanGeometry/Foundation/Axiom/Circle/LCPosition.lean @@ -276,8 +276,8 @@ theorem DirLC_intersection_eq_inxpts {l : DirLine P} {ω : Circle P} {A : P} (h have : dist_pt_line ω.center l = ω.radius := h'' have : dist_pt_line ω.center l < ω.radius := h' linarith⟩ - have hc : collinear A (Inxpts h).front (Inxpts h).back := Line.linear h₁ (inx_pts_lieson_dlin h).1 (inx_pts_lieson_dlin h).2 - have hnc : ¬ (collinear A (Inxpts h).front (Inxpts h).back) := three_pts_lieson_circle_not_collinear h₃ (inx_pts_lieson_circle h).1 (inx_pts_lieson_circle h).2 + have hc : Collinear A (Inxpts h).front (Inxpts h).back := Line.linear h₁ (inx_pts_lieson_dlin h).1 (inx_pts_lieson_dlin h).2 + have hnc : ¬ (Collinear A (Inxpts h).front (Inxpts h).back) := three_pts_lieson_circle_not_collinear h₃ (inx_pts_lieson_circle h).1 (inx_pts_lieson_circle h).2 tauto theorem pt_pt_tangent_eq_tangent_pt {A B : P} {ω : Circle P} (h₁ : A LiesOut ω) (h₂ : B LiesOn ω) (ht : (DLIN A B (pt_liesout_ne_pt_lieson h₁ h₂).out.symm) Tangent ω) : B = Tangentpt ht := by diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Class.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Class.lean index 46586fb5..873d60ac 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Class.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Class.lean @@ -42,7 +42,7 @@ noncomputable section namespace EuclidGeom class LinFig (α : Type*) (P : outParam <| Type*) [outParam <| EuclideanPlane P] extends Fig α P where - collinear' : ∀ {A B C : P} {F : α}, A LiesOn F → B LiesOn F → C LiesOn F → collinear A B C + collinear' : ∀ {A B C : P} {F : α}, A LiesOn F → B LiesOn F → C LiesOn F → Collinear A B C class ProjObj (β : Type _) where toProj : β → Proj diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Collinear.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Collinear.lean index fccfad1c..8153b7c4 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Collinear.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Collinear.lean @@ -10,164 +10,134 @@ open Classical variable {P : Type _} [EuclideanPlane P] -section collinear - -/-- Given three distinct (ordered) points $A$, $B$, $C$, this function returns whether they are collinear, i.e. whether the projective direction of the vector $\overrightarrow{AB}$ is the same as the projective direction of the vector $\overrightarrow{AC}$. -/ -def collinear_of_nd {A B C : P} [_hac : PtNe A C] [_hba : PtNe B A] : Prop := - VecND.toProj (VEC_nd A B) = VecND.toProj (VEC_nd A C) +section Collinear /-- Given three points $A$, $B$, $C$, return whether they are collinear: if at least two of them are equal, then they are considered collinear; if the three points are distinct, we use the earlier definition of colinarity for distinct points. -/ -def collinear (A B C : P) : Prop := - if h : (C = B) ∨ (A = C) ∨ (B = A) then True - else by - push_neg at h - exact collinear_of_nd (_hac := ⟨h.2.1⟩) (_hba := ⟨h.2.2⟩) +def Collinear (A B C : P) : Prop := wedge A B C = 0 + +theorem collinear_iff_wedge_eq_zero (A B C : P) : (Collinear A B C) ↔ (wedge A B C = 0) := .rfl --- The definition of collinear now includes two cases: the degenerate case and the nondegenerate case. We use to_dir' to avoid problems involving using conditions of an "if" in its "then" and "else". And we only use VEC to define collinear. +theorem not_collinear_iff_wedge_ne_zero (A B C : P) : (¬ Collinear A B C) ↔ (wedge A B C ≠ 0) := .rfl + +lemma collinear_iff_collinear {A B C D : P} [PtNe B A] (h : ∃ k : ℝ, VEC C D = k • VEC A B) : Collinear A B C ↔ Collinear A B D := by + unfold Collinear + rw [← wedge_eq_wedge_iff] at h + rw [h] /-- Given three points $A$, $B$, $C$ and a real number $t$, if the vector $\overrightarrow{AC}$ is $t$ times the vector $\overrightarrow{AB}$, then $A$, $B$, and $C$ are collinear. -/ -theorem collinear_of_vec_eq_smul_vec {A B C : P} {t : ℝ} (e : VEC A C = t • VEC A B) : collinear A B C := by - have : collinear A B C = True := by - unfold collinear - apply dite_eq_left_iff.mpr - simp only [eq_iff_iff, iff_true] - intro h' - push_neg at h' - unfold collinear_of_nd - rw [eq_comm, VecND.toProj_eq_toProj_iff] - exact ⟨t, e⟩ - tauto +theorem collinear_of_vec_eq_smul_vec {A B C : P} {t : ℝ} (e : VEC A C = t • VEC A B) : Collinear A B C := by + unfold Collinear wedge + rw [e] + simp /-- Given three points $A$, $B$, $C$, if the vector $\overrightarrow{AC}$ is a scalar multiple of the vector $\overrightarrow{AB}$, then $A$, $B$, $C$ are collinear. -/ -theorem collinear_of_vec_eq_smul_vec' {A B C : P} : (∃ t : ℝ, VEC A C = t • VEC A B) → collinear A B C := by +theorem collinear_of_vec_eq_smul_vec' {A B C : P} : (∃ t : ℝ, VEC A C = t • VEC A B) → Collinear A B C := by intro ⟨_, e⟩ exact collinear_of_vec_eq_smul_vec e /-- Given three points $A$, $B$, $C$ such that $B \neq A$, we have $A$, $B$, $C$ are collinear if and only if the vector $\overrightarrow{AC}$ is a scalar multiple of the vector $\overrightarrow{AB}$. -/ -theorem collinear_iff_eq_smul_vec_of_ne {A B C : P} [g : PtNe B A] : collinear A B C ↔ ∃ r : ℝ , VEC A C = r • VEC A B := by +theorem collinear_iff_eq_smul_vec_of_ne {A B C : P} [g : PtNe B A] : Collinear A B C ↔ ∃ r : ℝ, VEC A C = r • VEC A B := by constructor · intro c - rw [← iff_true (collinear A B C), ← eq_iff_iff] at c - unfold collinear at c - rw [dite_eq_left_iff] at c - by_cases h : (C = B) ∨ (A = C) ∨ (B = A) - · by_cases h : C = A - · use 0 - rw [h] - simp only [vec_same_eq_zero, zero_smul] - · have h : B = C := by have := g.out; tauto - use 1 - rw [h] - simp only [one_smul] - · specialize c h - push_neg at h - unfold collinear_of_nd at c - simp only [ne_eq, eq_iff_iff, iff_true] at c - rwa [eq_comm, VecND.toProj_eq_toProj_iff] at c - · intro ⟨_, e⟩ - exact collinear_of_vec_eq_smul_vec e - + unfold Collinear wedge at c + rwa [Vec.det_eq_zero_iff_eq_smul_left, or_iff_right] at c + rw [← Ne, ← ne_iff_vec_ne_zero] + exact g.elim + · exact collinear_of_vec_eq_smul_vec' -- Please rewrite this part, use minimal theorems, but create a tactic called `collinearity` /-- For any two points $A$ and $C$, the points $A$, $A$, $C$ are collinear. -/ -theorem triv_collinear (A C : P) : (collinear A A C) := by - rw [← iff_true (collinear A A C), ← eq_iff_iff] - unfold collinear - rw [dite_eq_left_iff] - intro h - push_neg at h - exfalso - exact h.2.2 rfl +@[simp] +theorem triv_collinear₁₂ (A C : P) : (Collinear A A C) := by + unfold Collinear + simp -theorem collinear_of_trd_eq_snd (A : P) {B C : P} (h : C = B) : collinear A B C := - (dite_prop_iff_or (C = B ∨ A = C ∨ B = A)).mpr (.inl ⟨.inl h, trivial⟩) +/-- For any two points $A$ and $C$, the points $A$, $C$, $C$ are collinear. -/ +@[simp] +theorem triv_collinear₁₂₂₃ (A C : P) : (Collinear A C C) := by + unfold Collinear + simp -theorem collinear_of_fst_eq_snd (B : P) {A C : P} (h : A = C) : collinear A B C := - (dite_prop_iff_or (C = B ∨ A = C ∨ B = A)).mpr (.inl ⟨.inr (.inl h), trivial⟩) +/-- For any two points $A$ and $C$, the points $A$, $C$, $A$ are collinear. -/ +@[simp] +theorem triv_collinear₁₂₃₁ (A C : P) : (Collinear A C A) := by + unfold Collinear + simp -theorem collinear_of_snd_eq_fst {A B : P} (C : P) (h : B = A) : collinear A B C := - (dite_prop_iff_or (C = B ∨ A = C ∨ B = A)).mpr (.inl ⟨.inr (.inr h), trivial⟩) +theorem collinear_of_trd_eq_snd (A : P) {B C : P} (h : C = B) : Collinear A B C := by + simp [h] + +theorem collinear_of_fst_eq_snd (B : P) {A C : P} (h : A = C) : Collinear A B C := by + simp [h] + +theorem collinear_of_snd_eq_fst {A B : P} (C : P) (h : B = A) : Collinear A B C := by + simp [h] /-- Given three points $A$, $B$, and $C$, if $A$, $B$, $C$ are collinear (in that order), then $A$, $C$, $B$ are collinear (in that order); in other words, swapping the last two of the three points does not change the definition of colinarity. -/ -theorem flip_collinear_snd_trd {A B C : P} (c : collinear A B C) : collinear A C B := by - by_cases h : B ≠ A ∧ C ≠ A - · haveI : PtNe B A := ⟨h.1⟩ - rcases collinear_iff_eq_smul_vec_of_ne.1 c with ⟨t, e⟩ - have ht : t ≠ 0 := by - by_contra ht' - rw [ht', zero_smul] at e - have _ : C = A := ((eq_iff_vec_eq_zero A C).2 e) - tauto - exact collinear_of_vec_eq_smul_vec (Eq.symm ((inv_smul_eq_iff₀ ht).2 e)) - · rw [← iff_true (collinear _ _ _), ← eq_iff_iff] - unfold collinear - rw [dite_eq_left_iff] - intro g - exfalso - push_neg at * - exact g.2.2 $ h g.2.1.symm +theorem collinear132 {A B C : P} : Collinear A B C ↔ Collinear A C B := by + unfold Collinear + rw [wedge132, neg_eq_zero] + +alias ⟨Collinear.perm₁₃₂, _⟩ := collinear132 /-- Given three points $A$, $B$, and $C$, if $A$, $B$, $C$ are collinear (in that order), then $B$, $A$, $C$ are collinear (in that order); in other words, in the definition of colinarity, swapping the first two of the three points does not change property of the three points being collinear. -/ -theorem flip_collinear_fst_snd {A B C : P} (c : collinear A B C) : collinear B A C := by - by_cases h : B = A - · rw [h] - exact triv_collinear _ _ - · haveI : PtNe B A := ⟨h⟩ - rw [collinear_iff_eq_smul_vec_of_ne] at c - rcases c with ⟨r, e⟩ - have e' : VEC B C = (1 - r) • VEC B A := by - rw [← vec_sub_vec A B C, e, ← neg_vec A B, smul_neg, sub_smul, neg_sub, one_smul] - exact collinear_of_vec_eq_smul_vec e' - -theorem perm_collinear_snd_trd_fst {A B C : P} (h : collinear A B C) : collinear B C A := - flip_collinear_snd_trd (flip_collinear_fst_snd h) - -theorem perm_collinear_trd_fst_snd {A B C : P} (h : collinear A B C) : collinear C A B := - perm_collinear_snd_trd_fst (perm_collinear_snd_trd_fst h) - -theorem flip_collinear_fst_trd {A B C : P} (h : collinear A B C) : collinear C B A := - perm_collinear_snd_trd_fst (flip_collinear_snd_trd h) +theorem collinear213 {A B C : P} : Collinear A B C ↔ Collinear B A C := by + unfold Collinear + rw [wedge213, neg_eq_zero] + +alias ⟨Collinear.perm₂₁₃, _⟩ := collinear213 + +theorem collinear231 {A B C : P} : Collinear A B C ↔ Collinear B C A := by + unfold Collinear + rw [wedge231] + +alias ⟨Collinear.perm₂₃₁, _⟩ := collinear231 + +theorem collinear312 {A B C : P} : Collinear A B C ↔ Collinear C A B := by + unfold Collinear + rw [wedge312] + +alias ⟨Collinear.perm₃₁₂, _⟩ := collinear312 + +theorem collinear321 {A B C : P} : Collinear A B C ↔ Collinear C B A := by + unfold Collinear + rw [wedge321, neg_eq_zero] + +alias ⟨Collinear.perm₃₂₁, _⟩ := collinear321 -- the proof of this theorem using def of line seems to be easier /-- Given four points $A$, $B$, $C$, $D$ with $B \neq A$, if $A$, $B$, $C$ are collinear, and if $A$, $B$, $D$ are collinear, then $A$, $C$, $D$ are collinear. -/ -theorem collinear_of_collinear_collinear_ne {A B C D: P} (h₁ : collinear A B C) (h₂ : collinear A B D) [h : PtNe B A] : (collinear A C D) := by +theorem collinear_of_collinear_collinear_ne {A B C D: P} (h₁ : Collinear A B C) (h₂ : Collinear A B D) [h : PtNe B A] : (Collinear A C D) := by have ac : ∃ r : ℝ , VEC A C = r • VEC A B := collinear_iff_eq_smul_vec_of_ne.mp h₁ have ad : ∃ s : ℝ , VEC A D = s • VEC A B := collinear_iff_eq_smul_vec_of_ne.mp h₂ rcases ac with ⟨r,eq⟩ rcases ad with ⟨s,eq'⟩ by_cases nd : r = 0 . simp only [nd, zero_smul] at eq - have : C = A := (eq_iff_vec_eq_zero A C).mpr eq - rw [this] ; apply triv_collinear + have : C = A := eq_iff_vec_eq_zero.mpr eq + rw [this] ; apply triv_collinear₁₂ apply collinear_of_vec_eq_smul_vec' rw [eq,eq'] use s/r rw [smul_smul, div_mul_cancel _ nd] +set_option push_neg.use_distrib true in /-- Given three points $A$, $B$, $C$, if they are not collinear, then they are pairwise distinct, i.e. $C \neq B$, $A \neq C$, and $B \neq A$. -/ -theorem ne_of_not_collinear {A B C : P} (h : ¬ collinear A B C) : (C ≠ B) ∧ (A ≠ C) ∧ (B ≠ A) := by - rw [← iff_true (collinear A B C), ← eq_iff_iff] at h - unfold collinear at h - rw [dite_eq_left_iff] at h - push_neg at h - rcases h with ⟨g, _⟩ - tauto - -theorem collinear_iff_toProj_eq_of_ptNe {A B C : P} [hba : PtNe B A] [hca : PtNe C A] : collinear A B C ↔ (VEC_nd A B).toProj = (VEC_nd A C).toProj := by - if hbc : B = C then simp only [hbc, collinear_of_trd_eq_snd A rfl] - else - refine' ⟨fun h ↦ _, fun h ↦ _⟩ - exact ((dite_prop_iff_and _).mp h).2 <| by - push_neg - exact ⟨Ne.symm hbc, hca.1.symm, hba.1⟩ - exact (dite_prop_iff_and _).mpr ⟨fun _ ↦ trivial, fun _ ↦ h⟩ - -end collinear +theorem ne_of_not_collinear {A B C : P} (h : ¬ Collinear A B C) : (C ≠ B) ∧ (A ≠ C) ∧ (B ≠ A) := by + push_neg + contrapose! h + obtain (rfl | rfl | rfl) := h <;> simp + +theorem collinear_iff_toProj_eq_of_ptNe {A B C : P} [hba : PtNe B A] [hca : PtNe C A] : Collinear A B C ↔ (VEC_nd A C).toProj = (VEC_nd A B).toProj := by + rw [collinear_iff_eq_smul_vec_of_ne, VecND.toProj_eq_toProj_iff] + rfl + +end Collinear section compatibility /-- If $A$, $B$, $C$ are three points which lie on a ray, then they are collinear. -/ -theorem Ray.collinear_of_lies_on {A B C : P} {ray : Ray P} (hA : A LiesOn ray) (hB : B LiesOn ray) (hC : C LiesOn ray) : collinear A B C := by +theorem Ray.collinear_of_lies_on {A B C : P} {ray : Ray P} (hA : A LiesOn ray) (hB : B LiesOn ray) (hC : C LiesOn ray) : Collinear A B C := by rcases hA with ⟨a,_,Ap⟩ rcases hB with ⟨b,_,Bp⟩ rcases hC with ⟨c,_,Cp⟩ @@ -181,22 +151,22 @@ theorem Ray.collinear_of_lies_on {A B C : P} {ray : Ray P} (hA : A LiesOn ray) ( apply add_right_cancel_iff.mp nd rw [this] at ab rw [sub_self, zero_smul] at ab - have : B = A := by apply (eq_iff_vec_eq_zero A B).mpr ab - rw [this] ; apply triv_collinear + have : B = A := by apply eq_iff_vec_eq_zero.mpr ab + rw [this] ; apply triv_collinear₁₂ apply collinear_of_vec_eq_smul_vec' use (c - a)/(b - a) rw [ac, ab, smul_smul, div_mul_cancel _ nd] /-- If $A$, $B$, $C$ are three points which lie on a segment, then they are collinear. -/ -theorem Seg.collinear_of_lies_on {A B C : P} {seg : Seg P} (hA : A LiesOn seg) (hB : B LiesOn seg) (hC : C LiesOn seg) : collinear A B C := by +theorem Seg.collinear_of_lies_on {A B C : P} {seg : Seg P} (hA : A LiesOn seg) (hB : B LiesOn seg) (hC : C LiesOn seg) : Collinear A B C := by by_cases nd : seg.source =seg.target . rcases hA with ⟨_,_,_,a⟩ simp only [nd, vec_same_eq_zero, smul_zero] at a - have a_d : A = seg.target := by apply (eq_iff_vec_eq_zero seg.target A).mpr a + have a_d : A = seg.target := by apply eq_iff_vec_eq_zero.mpr a rcases hB with ⟨_,_,_,b⟩ simp only [nd, vec_same_eq_zero, smul_zero] at b - have b_d : B = seg.target := by apply (eq_iff_vec_eq_zero seg.target B).mpr b - rw [a_d,b_d] ; apply triv_collinear + have b_d : B = seg.target := by apply eq_iff_vec_eq_zero.mpr b + rw [a_d,b_d] ; apply triv_collinear₁₂ rw [<-ne_eq] at nd let seg_nd := SegND.mk seg.source seg.target nd.symm have ha : A LiesOn seg_nd.1 := by apply hA @@ -214,7 +184,7 @@ Note that we do not need all reverse, extension line,... here. instead we should end compatibility /-- There exists three points $A$, $B$, $C$ on the plane such that they are not collinear. -/ -theorem nontriv_of_plane {H : Type _} [h : EuclideanPlane H] : ∃ A B C : H, ¬(collinear A B C) := by +theorem nontriv_of_plane {H : Type _} [h : EuclideanPlane H] : ∃ A B C : H, ¬(Collinear A B C) := by rcases h.nonempty with ⟨A⟩ let B := (⟨1, 0⟩ : Vec) +ᵥ A let C := (⟨0, 1⟩ : Vec) +ᵥ A diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Line.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Line.lean index 2f8893c5..76dd8ba9 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Line.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Line.lean @@ -893,21 +893,23 @@ end lieson -section collinear +section Collinear namespace Line /-- Given three points $A$, $B$ and $C$, if $A$ and $B$ are distinct and $C$ lies on the line $AB$, then $A$, $B$, and $C$ are collinear. -/ -theorem pt_pt_linear {A B C : P} [_h : PtNe B A] (hc : C LiesOn (LIN A B)) : collinear A B C := +theorem pt_pt_linear {A B C : P} [_h : PtNe B A] (hc : C LiesOn (LIN A B)) : Collinear A B C := if hcb : C = B then collinear_of_trd_eq_snd A hcb else if hac : A = C then collinear_of_fst_eq_snd B hac - else haveI : PtNe C B := ⟨hcb⟩ - perm_collinear_trd_fst_snd <| (dite_prop_iff_or _).mpr <| .inr ⟨by push_neg; exact ⟨hac, Fact.out, hcb⟩, - ((lies_on_iff_eq_toProj_of_lies_on snd_pt_lies_on_mk_pt_pt).mp hc).trans <| - congrArg toProj line_of_pt_pt_eq_rev⟩ + else haveI : PtNe C B := ⟨hcb⟩; haveI : PtNe A C := ⟨hac⟩; Collinear.perm₂₁₃ <| by + rw [Line.lies_on_iff_eq_toProj_of_lies_on snd_pt_lies_on_mk_pt_pt] at hc + rw [collinear_iff_toProj_eq_of_ptNe] + trans (VEC_nd A B).toProj + · exact hc + · exact Ray.toProj_eq_toProj_of_mk_pt_pt -- TODO: refactor /-- The theorem states that if three points $A$, $B$, and $C$ lie on the same line $l$, then they are collinear. -/ -theorem linear {l : Line P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) (h₃ : C LiesOn l) : collinear A B C := by +theorem linear {l : Line P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) (h₃ : C LiesOn l) : Collinear A B C := by if h : B = A then exact collinear_of_snd_eq_fst C h else haveI : PtNe B A := ⟨h⟩ @@ -916,33 +918,33 @@ theorem linear {l : Line P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) exact h₃ /-- If $A$ and $B$ are two distinct points and $C$ is a point such that $A$, $B$ and $C$ are collinear, then $C$ lies on the line $AB$. -/ -theorem pt_pt_maximal {A B C : P} [_h : PtNe B A] (Co : collinear A B C) : C LiesOn (LIN A B) := +theorem pt_pt_maximal {A B C : P} [_h : PtNe B A] (Co : Collinear A B C) : C LiesOn (LIN A B) := if hcb : C = B then by rw [hcb] exact snd_pt_lies_on_mk_pt_pt else haveI : PtNe C B := ⟨hcb⟩ (lies_on_iff_eq_toProj_of_lies_on snd_pt_lies_on_mk_pt_pt).mpr <| - (collinear_iff_toProj_eq_of_ptNe.mp (perm_collinear_snd_trd_fst Co)).trans <| + (collinear_iff_toProj_eq_of_ptNe.mp Co.perm₂₁₃).trans <| congrArg Line.toProj (line_of_pt_pt_eq_rev (_h := _h)).symm /-- Given two distinct points $A$ and $B$ on a line $l$, if a point $C$ is so that $A$, $B$, and $C$ are collinear, then $C$ lines on $l$. -/ -theorem maximal {l : Line P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) [_h : PtNe B A] (Co : collinear A B C) : C LiesOn l := by +theorem maximal {l : Line P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) [_h : PtNe B A] (Co : Collinear A B C) : C LiesOn l := by rw [← eq_line_of_pt_pt_of_ne h₁ h₂] exact pt_pt_maximal Co /-- Given two distinct points $A$ and $B$, a point $X$ lies on the line through $A$ and $B$ if and only if $A$, $B$, and $X$ are collinear. -/ -theorem lies_on_line_of_pt_pt_iff_collinear {A B : P} [_h : PtNe B A] (X : P) : (X LiesOn (LIN A B)) ↔ collinear A B X := ⟨ +theorem lies_on_line_of_pt_pt_iff_collinear {A B : P} [_h : PtNe B A] (X : P) : (X LiesOn (LIN A B)) ↔ Collinear A B X := ⟨ fun hx ↦ (LIN A B).linear fst_pt_lies_on_mk_pt_pt snd_pt_lies_on_mk_pt_pt hx, fun c ↦ (LIN A B).maximal fst_pt_lies_on_mk_pt_pt snd_pt_lies_on_mk_pt_pt c⟩ -- This is also a typical proof that shows how to use linear, maximal, nontriv of a line. Please write it shorter in future. /-- This theorem states that if $A$ and $B$ are two distinct points on a line $l$, then a point $C$ lies on $l$ if and only if $A$, $B$, and $C$ are collinear. -/ -theorem lies_on_iff_collinear_of_ne_lies_on_lies_on {A B : P} {l : Line P} [_h : PtNe B A] (ha : A LiesOn l) (hb : B LiesOn l) (C : P) : (C LiesOn l) ↔ collinear A B C := +theorem lies_on_iff_collinear_of_ne_lies_on_lies_on {A B : P} {l : Line P} [_h : PtNe B A] (ha : A LiesOn l) (hb : B LiesOn l) (C : P) : (C LiesOn l) ↔ Collinear A B C := ⟨fun hc ↦ l.linear ha hb hc, fun c ↦ l.maximal ha hb c⟩ /-- The given theorem is an equivalence statement between the collinearity of three points and the existence of a line on which all three points lie. -/ -theorem collinear_iff_exist_line_lies_on (A B C : P) : collinear A B C ↔ ∃ l : Line P, (A LiesOn l) ∧ (B LiesOn l) ∧ (C LiesOn l) := by +theorem collinear_iff_exist_line_lies_on (A B C : P) : Collinear A B C ↔ ∃ l : Line P, (A LiesOn l) ∧ (B LiesOn l) ∧ (C LiesOn l) := by constructor · intro c by_cases h : PtNe B A @@ -959,39 +961,39 @@ theorem collinear_iff_exist_line_lies_on (A B C : P) : collinear A B C ↔ ∃ l if h : PtNe B A then exact (lies_on_iff_collinear_of_ne_lies_on_lies_on ha hb C).mp hc else simp [PtNe, fact_iff] at h - simp only [h, collinear, or_true, dite_true] + simp [h] end Line namespace DirLine /-- If $A$, $B$ and $C$ are three points on the same directed line $l$, then they are collinear. -/ -theorem linear {l : DirLine P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) (h₃ : C LiesOn l) : collinear A B C := +theorem linear {l : DirLine P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) (h₃ : C LiesOn l) : Collinear A B C := Line.linear h₁ h₂ h₃ /-- If $A$, $B$ and $C$ are three collinear points in which $A \neq B$, then $C$ lies on the directed line associated to $AB$. -/ -theorem pt_pt_maximal {A B C : P} [_h : PtNe B A] (Co : collinear A B C) : C LiesOn (DLIN A B) := +theorem pt_pt_maximal {A B C : P} [_h : PtNe B A] (Co : Collinear A B C) : C LiesOn (DLIN A B) := Line.pt_pt_maximal Co /-- Given two points $A$ and $B$ on a directed line $l$, if a point $C$ is so that $A$, $B$, and $C$ are collinear, then $C$ lies on $l$. -/ -theorem maximal {l : DirLine P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) [_h : PtNe B A] (Co : collinear A B C) : C LiesOn l := +theorem maximal {l : DirLine P} {A B C : P} (h₁ : A LiesOn l) (h₂ : B LiesOn l) [_h : PtNe B A] (Co : Collinear A B C) : C LiesOn l := Line.maximal h₁ h₂ Co /-- Given two distinct points $A$ and $B$, a point $X$ lies on the directed line from $A$ to $B$ if and only if $A$, $B$, and $X$ are collinear. -/ -theorem lies_on_dirline_of_pt_pt_iff_collinear {A B : P} [_h : PtNe B A] (X : P) : (X LiesOn (DLIN A B)) ↔ collinear A B X := +theorem lies_on_dirline_of_pt_pt_iff_collinear {A B : P} [_h : PtNe B A] (X : P) : (X LiesOn (DLIN A B)) ↔ Collinear A B X := Line.lies_on_line_of_pt_pt_iff_collinear X /-- Let $A$ and $B$ be two distinct points on a directed line $l$, then a point $C$ lies on $l$ if and only if $A$, $B$ and $C$ are collinear. -/ -theorem lies_on_iff_collinear_of_ne_lies_on_lies_on {A B : P} {l : DirLine P} [_h : PtNe B A] (ha : A LiesOn l) (hb : B LiesOn l) (C : P) : (C LiesOn l) ↔ collinear A B C := +theorem lies_on_iff_collinear_of_ne_lies_on_lies_on {A B : P} {l : DirLine P} [_h : PtNe B A] (ha : A LiesOn l) (hb : B LiesOn l) (C : P) : (C LiesOn l) ↔ Collinear A B C := Line.lies_on_iff_collinear_of_ne_lies_on_lies_on ha hb C /-- The theorem states that three points $A$, $B$, and $C$ are collinear if and only if there exists a line $l$ such that $A$, $B$, and $C$ all lie on $l$. -/ -theorem collinear_iff_exist_line_lies_on (A B C : P) : collinear A B C ↔ ∃ l : Line P, (A LiesOn l) ∧ (B LiesOn l) ∧ (C LiesOn l) := +theorem collinear_iff_exist_line_lies_on (A B C : P) : Collinear A B C ↔ ∃ l : Line P, (A LiesOn l) ∧ (B LiesOn l) ∧ (C LiesOn l) := Line.collinear_iff_exist_line_lies_on A B C end DirLine -end collinear +end Collinear diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Line_trash.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Line_trash.lean index 55ed99f5..517c95c4 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Line_trash.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Line_trash.lean @@ -9,7 +9,7 @@ theorem same_dist_eq_or_eq_neg {A B C : P} [hne : PtNe B A] (h : C LiesOn (LIN A have : LIN A B = (RAY A B).toLine := rfl rw [this] at h rcases Ray.lies_on_toLine_iff_lies_on_or_lies_on_rev.mp h with h | h - · left; apply (eq_iff_vec_eq_zero _ _).mpr + · left; apply eq_iff_vec_eq_zero.mpr have : VEC A C = (dist A C) • (RAY A B).2.unitVec := Ray.vec_eq_dist_smul_toDir_of_lies_on h calc _ = VEC A C - VEC A B := by rw [vec_sub_vec] @@ -49,7 +49,7 @@ theorem midpoint_dist_eq_iff_eq_endpts {A B C : P} [hne : PtNe B C] (h : A LiesO rcases same_dist_eq_or_eq_neg this hh with h₁ | h₂ · left; exact h₁ right - apply (eq_iff_vec_eq_zero _ _).mpr + apply eq_iff_vec_eq_zero.mpr calc _ = VEC (SEG B C).midpoint A - VEC (SEG B C).midpoint C := by rw [vec_sub_vec] _ = VEC B (SEG B C).midpoint - VEC (SEG B C).midpoint C := by rw [h₂] diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Parallel.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Parallel.lean index e150f9b8..76d29bcf 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Parallel.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Parallel.lean @@ -46,21 +46,32 @@ instance : LinearObj (Line P) where -- Our definition of parallel for LinearObj is very general. Not only can it apply to different types of Objs, but also include degenerate cases, such as ⊆(inclusions), =(equal). /-- Given two linear objects $l_1$ and $l_2$ (not necessarily of the same type), this function returns whether they are parallel, defined as having the same associated projective direction. -/ -def parallel {α β : Type*} [ProjObj α] [ProjObj β] (l₁ : α) (l₂ : β) : Prop := +def Parallel {α β : Type*} [ProjObj α] [ProjObj β] (l₁ : α) (l₂ : β) : Prop := toProj l₁ = toProj l₂ +/-- This is to rewrite \verb|parallel l l'| as \verb|l ParallelTo l'| -/ +scoped infix : 50 " ParallelTo " => Parallel + +/-- This is to rewrite \verb|parallel l l'| as $l \parallel l'$. -/ +scoped infix : 50 " ∥ " => Parallel + +@[refl] +lemma Parallel.refl {α : Type*} [ProjObj α] (l : α) : l ∥ l := rfl + +@[symm] +lemma Parallel.symm {α β : Type*} [ProjObj α] [ProjObj β] {l₁ : α} {l₂ : β} : l₁ ∥ l₂ → l₂ ∥ l₁ := Eq.symm + +lemma parallel_comm {α β : Type*} [ProjObj α] [ProjObj β] {l₁ : α} {l₂ : β} : l₁ ∥ l₂ ↔ l₂ ∥ l₁ := eq_comm + +@[trans] +lemma Parallel.trans {α β γ : Type*} [ProjObj α] [ProjObj β] [ProjObj γ] {l₁ : α} {l₂ : β} {l₃ : γ} : l₁ ∥ l₂ → l₂ ∥ l₃ → l₁ ∥ l₃ := Eq.trans + /-- Being parallel defines an equivalence relation among all linear objects, that is they satisfy the three conditions: (1) reflexive: every linear object $l$ is parallel to itself; (2) symmetric: if the linear object $l_1$ is parallel to the linear object $l_2$, then $l_2$ is $l_1$; (3) transitive: if the linear object $l_1$ is parallel to the linear object $l_2$, and if the linear object $l_2$ is parallel to the linear object $l_3$, then $l_1$ is parallel to $l_3$. -/ -instance (α : Type*) [ProjObj α] : IsEquiv α parallel where +instance (α : Type*) [ProjObj α] : IsEquiv α Parallel where refl _ := rfl symm _ _ := Eq.symm trans _ _ _ := Eq.trans -/-- This is to rewrite \verb|parallel l l'| as \verb|l ParallelTo l'| -/ -scoped infix : 50 " ParallelTo " => parallel - -/-- This is to rewrite \verb|parallel l l'| as $l \parallel l'$. -/ -scoped infix : 50 " ∥ " => parallel - /- lots of trivial parallel relation of vec of 2 pt lies on Line, coercions, ... -/ section coercion_theorem diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular.lean index 391f7ae9..2c707e23 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular.lean @@ -8,12 +8,12 @@ open Line variable {P : Type _} [EuclideanPlane P] {α β γ : Type*} [ProjObj α] [ProjObj β] [ProjObj γ] {l₁ : α} {l₂ : β} {l₃ : γ} -def perpendicular (l₁ : α) (l₂ : β) : Prop := +def Perpendicular (l₁ : α) (l₂ : β) : Prop := ProjObj.toProj l₁ = (ProjObj.toProj l₂).perp -scoped infix : 50 " IsPerpendicularTo " => perpendicular +scoped infix : 50 " IsPerpendicularTo " => Perpendicular -scoped infix : 50 " ⟂ " => perpendicular +scoped infix : 50 " ⟂ " => Perpendicular section Notation open Lean @@ -21,34 +21,40 @@ open Lean syntax (name := perpendicularNotation) (priority := high) term:50 " ⟂ " term:51 : term @[macro perpendicularNotation] def perpendicularNotationImpl : Macro - | `($l:term ⟂ $r:term) => `(perpendicular $l $r) + | `($l:term ⟂ $r:term) => `(Perpendicular $l $r) | _ => Macro.throwUnsupported end Notation -namespace perpendicular +namespace Perpendicular @[simp] protected theorem irrefl (l : α) : ¬ (l ⟂ l) := sorry protected theorem symm (h : l₁ ⟂ l₂) : (l₂ ⟂ l₁) := by - rw [perpendicular, Proj.perp, h, Proj.perp, vadd_vadd] + rw [Perpendicular, Proj.perp, h, Proj.perp, vadd_vadd] norm_cast simp -end perpendicular +end Perpendicular section Perpendicular_and_parallel theorem parallel_of_perp_perp (h₁ : l₁ ⟂ l₂) (h₂ : l₂ ⟂ l₃) : l₁ ∥ l₃ := by - unfold perpendicular at h₂ - simp only [perpendicular, h₂, Proj.perp_perp] at h₁ + unfold Perpendicular at h₂ + simp only [Perpendicular, h₂, Proj.perp_perp] at h₁ exact h₁ -theorem perp_of_parallel_perp (h₁ : l₁ ∥ l₂) (h₂ : l₂ ⟂ l₃) : l₁ ⟂ l₃ := h₁.trans h₂ +alias Perpendicular.trans := parallel_of_perp_perp -theorem perp_of_perp_parallel (h₁ : l₁ ⟂ l₂) (h₂ : l₂ ∥ l₃) : l₁ ⟂ l₃ := h₁.trans (congrArg Proj.perp h₂) +theorem perp_of_parallel_perp (h₁ : l₁ ∥ l₂) (h₂ : l₂ ⟂ l₃) : l₁ ⟂ l₃ := Eq.trans h₁ h₂ + +alias Parallel.trans_perp := perp_of_parallel_perp + +theorem perp_of_perp_parallel (h₁ : l₁ ⟂ l₂) (h₂ : l₂ ∥ l₃) : l₁ ⟂ l₃ := Eq.trans h₁ (congrArg Proj.perp h₂) + +alias Perpendicular.trans_parallel := perp_of_perp_parallel theorem toProj_ne_toProj_of_perp (h : l₁ ⟂ l₂) : ProjObj.toProj l₁ ≠ ProjObj.toProj l₂ := sorry @@ -68,7 +74,7 @@ theorem toProj_of_perp_line_eq_toProj_perp (A : P) (l : Line P) : (perp_line A l theorem perp_line_perp (A : P) (l : Line P) : perp_line A l ⟂ l := toProj_of_perp_line_eq_toProj_perp A l theorem toProj_ne_perp_toProj (A : P) (l : Line P) : l.toProj ≠ (perp_line A l).toProj := - Ne.trans_eq (perpendicular.irrefl l) (toProj_of_perp_line_eq_toProj_perp A l).symm + Ne.trans_eq (Perpendicular.irrefl l) (toProj_of_perp_line_eq_toProj_perp A l).symm def perp_foot (A : P) (l : Line P) : P := Line.inx l (perp_line A l) (toProj_ne_perp_toProj A l) diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular_trash.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular_trash.lean index 8550b9a6..165c8ef0 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular_trash.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Perpendicular_trash.lean @@ -12,7 +12,7 @@ theorem segnd_perp_line_of_line_perp_line {A B : P} (B_ne_A : B ≠ A) {l : Line theorem perp_foot_unique' {A B : P} {l : DirLine P} (h : A LiesOn l) (hne : B ≠ A) (hp : (DLIN B A hne.symm) ⟂ l) : perp_foot B l = A := sorry -theorem not_collinear_with_perp_foot_of_ne_perp_foot (A B C : P) (l : Line P) (B_on_l : B LiesOn l) (A_not_on_l : ¬ A LiesOn l) (C_is_perp_foot : C = (perp_foot A l)) (B_ne_C : B ≠ C): ¬ collinear C B A := sorry +theorem not_collinear_with_perp_foot_of_ne_perp_foot (A B C : P) (l : Line P) (B_on_l : B LiesOn l) (A_not_on_l : ¬ A LiesOn l) (C_is_perp_foot : C = (perp_foot A l)) (B_ne_C : B ≠ C): ¬ Collinear C B A := sorry theorem perp_foot_unique {A B : P} {l : DirLine P} (h : A LiesOn l) [_hne : PtNe A B] (hp : (DLIN B A) ⟂ l) : perp_foot B l = A := sorry diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Ratio.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Ratio.lean index 43d6bf56..4b8886be 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Ratio.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Ratio.lean @@ -12,16 +12,16 @@ section ratio /- Below is the definition of divratio using ddist, which I think might not be a good idea. -def divratio (A B C : P) (colin : collinear A B C) (cnea : C ≠ A) : ℝ := (DirLine.ddist (B := B) (DirLine.pt_pt_maximal cnea (flip_collinear_snd_trd (triv_collinear A C))) (DirLine.pt_pt_maximal cnea (flip_collinear_snd_trd colin))) / (DirLine.ddist (DirLine.pt_pt_maximal cnea (flip_collinear_snd_trd (triv_collinear A C))) (DirLine.pt_pt_maximal cnea (perm_collinear_trd_fst_snd (triv_collinear C A)))) +def divratio (A B C : P) (colin : Collinear A B C) (cnea : C ≠ A) : ℝ := (DirLine.ddist (B := B) (DirLine.pt_pt_maximal cnea (Collinear.perm₁₃₂ (triv_collinear₁₂ A C))) (DirLine.pt_pt_maximal cnea (Collinear.perm₁₃₂ colin))) / (DirLine.ddist (DirLine.pt_pt_maximal cnea (Collinear.perm₁₃₂ (triv_collinear₁₂ A C))) (DirLine.pt_pt_maximal cnea (Collinear.perm₃₁₂ (triv_collinear₁₂ C A)))) -/ def divratio (A B C : P) : ℝ := ((VEC A B)/(VEC A C)).1 -theorem ratio_is_real' (A B C : P) (colin : collinear A B C) [cnea : PtNe C A] : ((VEC A B)/(VEC A C)).2 = 0 := by - have h0 : collinear A C B := flip_collinear_snd_trd colin +theorem ratio_is_real' (A B C : P) (colin : Collinear A B C) [cnea : PtNe C A] : ((VEC A B)/(VEC A C)).2 = 0 := by + have h0 : Collinear A C B := Collinear.perm₁₃₂ colin rw [collinear_iff_eq_smul_vec_of_ne] at h0 rcases h0 with ⟨r , h1⟩ - have h2 : VEC A C ≠ 0 := (ne_iff_vec_ne_zero A C).mp cnea.out + have h2 : VEC A C ≠ 0 := ne_iff_vec_ne_zero.mp cnea.out rw [h1] calc (r • VEC A C / VEC A C).im = ((r : ℂ) • VEC A C / VEC A C).im := rfl @@ -29,21 +29,21 @@ theorem ratio_is_real' (A B C : P) (colin : collinear A B C) [cnea : PtNe C A] : rw [Vec.smul_cdiv_cancel _ h2] rfl -theorem ratio_is_real (A B C : P) (colin : collinear A B C) [cnea : PtNe C A] : (VEC A B)/(VEC A C) = divratio A B C := by +theorem ratio_is_real (A B C : P) (colin : Collinear A B C) [cnea : PtNe C A] : (VEC A B)/(VEC A C) = divratio A B C := by have h0 : (divratio A B C : ℂ).re = ((VEC A B)/(VEC A C)).re := rfl have h1 : (divratio A B C : ℂ).im = ((VEC A B)/(VEC A C)).im := by rw [ratio_is_real' A B C colin] simp exact Complex.ext h0 h1.symm -theorem vec_eq_vec_smul_ratio (A B C : P) (colin : collinear A B C) [cnea : PtNe C A] : VEC A B = (divratio A B C) • (VEC A C) := by - have h0 : VEC A C ≠ 0 := (ne_iff_vec_ne_zero A C).mp cnea.out +theorem vec_eq_vec_smul_ratio (A B C : P) (colin : Collinear A B C) [cnea : PtNe C A] : VEC A B = (divratio A B C) • (VEC A C) := by + have h0 : VEC A C ≠ 0 := ne_iff_vec_ne_zero.mp cnea.out have h1 : VEC A B = ((VEC A B) / (VEC A C)) • VEC A C := by field_simp rw [h1, ratio_is_real A B C colin] field_simp -theorem ratio_eq_ratio_div_ratio_minus_one (A B C : P) [cnea : PtNe C A] (colin : collinear A B C) : divratio B A C = (divratio A B C) / (divratio A B C - 1) := by +theorem ratio_eq_ratio_div_ratio_minus_one (A B C : P) [cnea : PtNe C A] (colin : Collinear A B C) : divratio B A C = (divratio A B C) / (divratio A B C - 1) := by have h0 : VEC B A = (-divratio A B C) • VEC A C := by rw [← neg_vec A B, vec_eq_vec_smul_ratio A B C colin] field_simp @@ -58,7 +58,7 @@ theorem ratio_eq_ratio_div_ratio_minus_one (A B C : P) [cnea : PtNe C A] (colin rw[h3] have h4 : VEC B A / VEC B C = (((divratio A B C / (divratio A B C - 1)) : ℝ ) : ℂ) := by rw [h0, h1] - have h5 : VEC A C ≠ 0 := (ne_iff_vec_ne_zero A C).mp cnea.out + have h5 : VEC A C ≠ 0 := ne_iff_vec_ne_zero.mp cnea.out field_simp norm_cast rw [Vec.neg_cdiv, Vec.smul_cdiv, Vec.cdiv_self h5, neg_div, ← div_neg] @@ -69,11 +69,11 @@ theorem ratio_eq_ratio_div_ratio_minus_one (A B C : P) [cnea : PtNe C A] (colin rw [h4] rw [Complex.ofReal_re] -theorem pt_eq_of_ratio_eq_of_ne_ne (A B C D : P) [cned : PtNe C D] [dnea : PtNe D A] [dneb : PtNe D B] (colinacd : collinear A C D) (colinbcd : collinear B C D) (req : divratio A C D = divratio B C D) : A = B := by +theorem pt_eq_of_ratio_eq_of_ne_ne (A B C D : P) [cned : PtNe C D] [dnea : PtNe D A] [dneb : PtNe D B] (colinacd : Collinear A C D) (colinbcd : Collinear B C D) (req : divratio A C D = divratio B C D) : A = B := by have h0 : divratio C A D = divratio C B D := by rw [ratio_eq_ratio_div_ratio_minus_one A C D colinacd, req, ratio_eq_ratio_div_ratio_minus_one B C D colinbcd] have h1 : VEC C A = VEC C B := by - rw [vec_eq_vec_smul_ratio C A D (flip_collinear_fst_snd colinacd), vec_eq_vec_smul_ratio C B D (flip_collinear_fst_snd colinbcd), h0] + rw [vec_eq_vec_smul_ratio C A D (Collinear.perm₂₁₃ colinacd), vec_eq_vec_smul_ratio C B D (Collinear.perm₂₁₃ colinbcd), h0] rw [← start_vadd_vec_eq_end C A, h1, start_vadd_vec_eq_end C B] theorem ratio_eq_zero_of_point_eq1 (A B : P) : divratio A A B = 0 := by diff --git a/EuclideanGeometry/Foundation/Axiom/Linear/Ray.lean b/EuclideanGeometry/Foundation/Axiom/Linear/Ray.lean index f2aa651b..32ecf7e4 100644 --- a/EuclideanGeometry/Foundation/Axiom/Linear/Ray.lean +++ b/EuclideanGeometry/Foundation/Axiom/Linear/Ray.lean @@ -84,7 +84,6 @@ end Seg /-- A \emph{nondegenerate segment} is a segment $AB$ that is nondegenerate, i.e. $A \neq B$. -/ def SegND (P : Type _) [EuclideanPlane P] := {seg : Seg P // seg.IsND} - end definition variable {P : Type _} [EuclideanPlane P] @@ -241,9 +240,11 @@ abbrev source (seg_nd : SegND P) : P := seg_nd.1.source @[pp_dot] abbrev target (seg_nd : SegND P) : P := seg_nd.1.target +instance {s : SegND P} : PtNe s.target s.source := ⟨s.2⟩ + /-- Given a nondegenerate segment $AB$, this function returns the nondegenerate vector $\overrightarrow{AB}$. -/ @[pp_dot] -def toVecND (seg_nd : SegND P) : VecND := ⟨VEC seg_nd.source seg_nd.target, (ne_iff_vec_ne_zero _ _).mp seg_nd.2⟩ +def toVecND (seg_nd : SegND P) : VecND := ⟨VEC seg_nd.source seg_nd.target, ne_iff_vec_ne_zero.mp seg_nd.2⟩ /-- Given a nondegenerate segment $AB$, this function returns the direction associated to the segment, defined by normalizing the nondegenerate vector $\overrightarrow{AB}$. -/ @[pp_dot] @@ -804,8 +805,15 @@ theorem nd_of_rev_of_nd {seg : Seg P} (nd : seg.IsND) : seg.reverse.IsND := by apply nd /-- Given a nondegenerate segment $AB$, this function returns the reversed nondegenerate segment $BA$. -/ +@[pp_dot] def SegND.reverse (seg_nd : SegND P) : SegND P := ⟨seg_nd.1.reverse, nd_of_rev_of_nd seg_nd.2⟩ +@[simp] +lemma SegND.reverse_source (seg_nd : SegND P) : seg_nd.reverse.source = seg_nd.target := rfl + +@[simp] +lemma SegND.reverse_target (seg_nd : SegND P) : seg_nd.reverse.target = seg_nd.source := rfl + /-- The reverse of a nondegenerate segment $AB$ is the nondegenerate segment $BA$. -/ @[simp] theorem seg_nd_rev {A B : P} [_h : PtNe B A] : (SEG_nd A B).reverse = SEG_nd B A := rfl @@ -1182,7 +1190,7 @@ theorem target_lies_int_seg_source_pt_of_pt_lies_int_extn {X : P} {seg_nd : SegN have: A=0:=by linarith rw [this] at ha simp only [Dir.toVec_neg_eq_neg_toVec, smul_neg, zero_smul, neg_zero] at ha - apply (eq_iff_vec_eq_zero _ _).mpr + apply eq_iff_vec_eq_zero.mpr exact ha have raysourcesource:seg_nd.extension.source=seg_nd.1.target:=by rfl @@ -1538,7 +1546,7 @@ theorem SegND.exist_pt_beyond_pt (l : SegND P) : (∃ q : P, l.target LiesInt (S If a segment contains an interior point, then it is nondegenerate-/ theorem Seg.nd_of_exist_int_pt {X : P} {seg : Seg P} (h : X LiesInt seg) : seg.IsND := by rcases h with ⟨⟨_, ⟨_, _, e⟩⟩, p_ne_s, _⟩ - have t : VEC seg.source X ≠ 0 := (ne_iff_vec_ne_zero seg.source X).mp p_ne_s + have t : VEC seg.source X ≠ 0 := ne_iff_vec_ne_zero.mp p_ne_s rw [e] at t exact Iff.mp vsub_ne_zero (right_ne_zero_of_smul t) diff --git a/EuclideanGeometry/Foundation/Axiom/Position/Angle.lean b/EuclideanGeometry/Foundation/Axiom/Position/Angle.lean index 4f04c63f..e094d8d0 100644 --- a/EuclideanGeometry/Foundation/Axiom/Position/Angle.lean +++ b/EuclideanGeometry/Foundation/Axiom/Position/Angle.lean @@ -618,19 +618,19 @@ theorem dir_perp_iff_isRight : ang.dir₁ ⟂ ang.dir₂ ↔ ang.IsRight := theorem value_eq_pi_of_lies_int_seg_nd {A B C : P} [PtNe C A] (h : B LiesInt (SEG_nd A C)) : ∠ A B C h.2.symm h.3.symm = π := value_eq_pi_of_eq_neg_dir ((SEG_nd A C).toDir_eq_neg_toDir_of_lies_int h) -theorem collinear_iff_dvalue_eq_zero : collinear O A B ↔ (ANG A O B).dvalue = 0 := - collinear_iff_toProj_eq_of_ptNe.trans (eq_comm.trans vsub_eq_zero_iff_eq.symm) +theorem collinear_iff_dvalue_eq_zero : Collinear O A B ↔ (ANG A O B).dvalue = 0 := + collinear_iff_toProj_eq_of_ptNe.trans vsub_eq_zero_iff_eq.symm -theorem collinear_iff_not_isND : collinear O A B ↔ ¬ (ANG A O B).IsND := +theorem collinear_iff_not_isND : Collinear O A B ↔ ¬ (ANG A O B).IsND := collinear_iff_dvalue_eq_zero.trans not_isND_iff_coe.symm -theorem not_collinear_iff_isND : ¬ collinear O A B ↔ (ANG A O B).IsND := +theorem not_collinear_iff_isND : ¬ Collinear O A B ↔ (ANG A O B).IsND := collinear_iff_not_isND.not.trans not_not -theorem collinear_of_angle_eq_zero (h : ∠ A O B = 0) : collinear O A B := +theorem collinear_of_angle_eq_zero (h : ∠ A O B = 0) : Collinear O A B := collinear_iff_not_isND.mpr (not_isND_of_eq_zero h) -theorem collinear_of_angle_eq_pi (h : ∠ A O B = π ) : collinear O A B := +theorem collinear_of_angle_eq_pi (h : ∠ A O B = π ) : Collinear O A B := collinear_iff_not_isND.mpr (not_isND_of_eq_pi h) end angle_value diff --git a/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex.lean b/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex.lean index aec5dfbf..500dc928 100644 --- a/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex.lean +++ b/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex.lean @@ -51,7 +51,7 @@ theorem IsND_of_oppo_of_IsND (nontriv : ang.IsND) : ang.oppo.IsND := by sorry end Angle -section parallel +section Parallel variable {P : Type _} [EuclideanPlane P] -- should be stated use mod 2pi first, then back to pi or -pi @@ -90,7 +90,7 @@ theorem value_eq_of_isalternateintang {ang₁ ang₂ : Angle P} (h : IsAlternate theorem value_eq_of_corresponding_angle {l₁ l₂ l : DirLine P} (h : l₁.toDir = l₂.toDir) (g : ¬ l ∥ l₁) : (Angle.mk_dirline_dirline l₁ l (Ne.symm g)).value = (Angle.mk_dirline_dirline l₂ l (Ne.symm (ne_of_ne_of_eq g (Quotient.sound (h ▸ PM.con.refl _))))).value := sorry -/ -end parallel +end Parallel namespace Angle diff --git a/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex_trash.lean b/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex_trash.lean index d7967ef4..b22e6eb7 100644 --- a/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex_trash.lean +++ b/EuclideanGeometry/Foundation/Axiom/Position/Angle_ex_trash.lean @@ -8,9 +8,9 @@ variable {P : Type _} [EuclideanPlane P] theorem perp_foot_lies_int_ray_of_acute_ang {A B C : P} (b_ne_a : B ≠ A) (c_ne_a : C ≠ A) (acu : Angle.IsAcu (ANG B A C b_ne_a c_ne_a)) : (perp_foot C (LIN A B b_ne_a)) LiesInt (RAY A B b_ne_a) := by sorry -theorem ang_acute_of_is_isoceles {A B C : P} (not_collinear_ABC : ¬ collinear A B C) (isoceles_ABC : (▵ A B C).IsIsoceles) : Angle.IsAcu (ANG C B A (ne_of_not_collinear not_collinear_ABC).1 (ne_of_not_collinear not_collinear_ABC).2.2.symm) := by sorry +theorem ang_acute_of_is_isoceles {A B C : P} (not_collinear_ABC : ¬ Collinear A B C) (isoceles_ABC : (▵ A B C).IsIsoceles) : Angle.IsAcu (ANG C B A (ne_of_not_collinear not_collinear_ABC).1 (ne_of_not_collinear not_collinear_ABC).2.2.symm) := by sorry -theorem ang_acute_of_is_isoceles_variant {A B C : P} (not_collinear_ABC : ¬ collinear A B C) (isoceles_ABC : (▵ A B C).IsIsoceles) : Angle.IsAcu (ANG A C B (ne_of_not_collinear not_collinear_ABC).2.1 (ne_of_not_collinear not_collinear_ABC).1.symm) := by sorry +theorem ang_acute_of_is_isoceles_variant {A B C : P} (not_collinear_ABC : ¬ Collinear A B C) (isoceles_ABC : (▵ A B C).IsIsoceles) : Angle.IsAcu (ANG A C B (ne_of_not_collinear not_collinear_ABC).2.1 (ne_of_not_collinear not_collinear_ABC).1.symm) := by sorry theorem is_acute_of_is_acute_rev {O A B : P} (h1 : A ≠ O) (h2 : B ≠ O) (h3 : Angle.IsAcu (ANG A O B h1 h2)) : Angle.IsAcu (ANG B O A h2 h1) := by sorry diff --git a/EuclideanGeometry/Foundation/Axiom/Position/Orientation.lean b/EuclideanGeometry/Foundation/Axiom/Position/Orientation.lean index 02561e16..3a47643e 100644 --- a/EuclideanGeometry/Foundation/Axiom/Position/Orientation.lean +++ b/EuclideanGeometry/Foundation/Axiom/Position/Orientation.lean @@ -1,7 +1,4 @@ -import EuclideanGeometry.Foundation.Axiom.Linear.Collinear -import EuclideanGeometry.Foundation.Axiom.Linear.Parallel import EuclideanGeometry.Foundation.Axiom.Position.Angle -import EuclideanGeometry.Foundation.Axiom.Position.Angle_trash import EuclideanGeometry.Foundation.Axiom.Linear.Line_trash /- This file discuss the relative positions of points and rays on a plane. -/ @@ -12,30 +9,8 @@ open Classical AngValue Angle variable {P : Type*} [EuclideanPlane P] -/- Definition of the wedge of three points.-/ - section wedge -def wedge (A B C : P) : ℝ := Vec.det (VEC A B) (VEC A C) - -def oarea (A B C : P) : ℝ := wedge A B C / 2 - -theorem wedge213 (A B C : P) : wedge B A C = - wedge A B C := by - unfold wedge - rw [← neg_vec A B,← vec_sub_vec A B C, map_sub] - simp only [map_neg, LinearMap.neg_apply, Vec.det_self, neg_zero, sub_zero] - -theorem wedge132 (A B C : P) : wedge A C B = - wedge A B C := by - unfold wedge - rw [Vec.det_skew] - -theorem wedge312 (A B C : P) : wedge C A B = wedge A B C := by - rw [wedge213, wedge132, neg_neg] - -theorem wedge231 (A B C : P) : wedge B C A = wedge A B C := by rw [wedge312, wedge312] - -theorem wedge321 (A B C : P) : wedge C B A = - wedge A B C := by rw [wedge213, wedge231] - theorem wedge_eq_length_mul_length_mul_sin (A B C : P) [bnea : PtNe B A] [cnea : PtNe C A] : wedge A B C = (SEG A B).length * (SEG A C).length * sin (ANG B A C).value := by unfold wedge have h0 : (ANG B A C).value = VecND.angle (VEC_nd A B) (VEC_nd A C) := rfl @@ -43,32 +18,7 @@ theorem wedge_eq_length_mul_length_mul_sin (A B C : P) [bnea : PtNe B A] [cnea : rw [Seg.length_eq_norm_toVec, Seg.length_eq_norm_toVec] exact (VecND.norm_mul_sin (VEC_nd A B) (VEC_nd A C)).symm -theorem collinear_iff_wedge_eq_zero (A B C : P) : (collinear A B C) ↔ (wedge A B C = 0) := by - dsimp only [wedge] - by_cases h : PtNe B A - · have vecabnd : VEC A B ≠ 0 := by - exact (ne_iff_vec_ne_zero A B).mp h.out - rw [← Vec.det_skew, neg_eq_zero, Vec.det_eq_zero_iff_eq_smul_right] - simp only [vecabnd, false_or] - constructor - · intro k - exact collinear_iff_eq_smul_vec_of_ne.mp k - · intro k - exact collinear_iff_eq_smul_vec_of_ne.mpr k - · simp [PtNe, fact_iff] at h - have vecab0 : VEC A B = 0 := by - exact (eq_iff_vec_eq_zero A B).mp h - constructor - intro - field_simp [vecab0] - intro - rw [h] - exact triv_collinear A C - -theorem not_collinear_iff_wedge_ne_zero (A B C : P) : (¬ collinear A B C) ↔ (wedge A B C ≠ 0) := by - rw [collinear_iff_wedge_eq_zero] - -theorem wedge_pos_iff_angle_pos (A B C : P) (nd : ¬collinear A B C) : (0 < wedge A B C) ↔ (Angle.mk_pt_pt_pt B A C (ne_of_not_collinear nd).2.2 (ne_of_not_collinear nd).2.1.symm).value.IsPos := by +theorem wedge_pos_iff_angle_pos (A B C : P) (nd : ¬Collinear A B C) : (0 < wedge A B C) ↔ (Angle.mk_pt_pt_pt B A C (ne_of_not_collinear nd).2.2 (ne_of_not_collinear nd).2.1.symm).value.IsPos := by have h1 : 0 < dist A B := by have abnd : (SEG A B).IsND := (ne_of_not_collinear nd).2.2 exact dist_pos.mpr (abnd.symm) @@ -112,9 +62,9 @@ theorem odist'_eq_length_mul_sin (A : P) (ray : Ray P) [h : PtNe A ray.source] : theorem wedge_eq_length_mul_odist' (A B C : P) [bnea : PtNe B A] : (wedge A B C) = (SEG A B).length * odist' C (RAY A B) := by by_cases p : C = A - · have vecrayc0 : VEC (RAY A B).source C = 0 := (eq_iff_vec_eq_zero A C).mp p + · have vecrayc0 : VEC (RAY A B).source C = 0 := eq_iff_vec_eq_zero.mp p dsimp only [wedge, odist'] - field_simp [(eq_iff_vec_eq_zero A C).mp p, vecrayc0] + field_simp [eq_iff_vec_eq_zero.mp p, vecrayc0] · haveI cnea : PtNe C A := ⟨p⟩ rw [wedge_eq_length_mul_length_mul_sin, @odist'_eq_length_mul_sin _ _ C (RAY A B) cnea, ← mul_assoc] @@ -164,7 +114,7 @@ theorem odist_reverse_eq_neg_odist {α} (A : P) [DirFig α P] (df : α) : odist rw [odist_reverse_eq_neg_odist'' A (toDirLine df)] rfl -theorem wedge_eq_wedge_iff_odist_eq_odist_of_ne (A B C D : P) [bnea : PtNe B A] : (odist C (SEG_nd A B) = odist D (SEG_nd A B)) ↔ (wedge A B C = wedge A B D) := by +theorem odist_eq_odist_iff_wedge_eq_wedge (A B C D : P) [bnea : PtNe B A] : (odist C (SEG_nd A B) = odist D (SEG_nd A B)) ↔ (wedge A B C = wedge A B D) := by rw [wedge_eq_length_mul_odist' A B C, wedge_eq_length_mul_odist' A B D] field_simp tauto @@ -335,7 +285,7 @@ theorem LiesOnLeft_or_LiesOnRight_of_not_LiesOn {A : P} [DirFig α P] {df : α} · exact lr -theorem not_collinear_of_LiesOnLeft_or_LiesOnRight (A B C : P) [bnea : PtNe B A] (hlr : (IsOnLeftSide C (RAY A B)) ∨ (IsOnRightSide C (RAY A B))) : ¬ collinear A B C := by +theorem not_collinear_of_LiesOnLeft_or_LiesOnRight (A B C : P) [bnea : PtNe B A] (hlr : (IsOnLeftSide C (RAY A B)) ∨ (IsOnRightSide C (RAY A B))) : ¬ Collinear A B C := by apply (not_collinear_iff_wedge_ne_zero A B C).mpr have hw : (wedge A B C) = (SEG A B).length * odist' C (RAY A B) := by exact wedge_eq_length_mul_odist' A B C @@ -377,21 +327,21 @@ theorem oarea_eq_length_mul_odist_div_two (A B C : P) [bnea : PtNe B A] : oarea rw [h2] at h1 rw [h1] -theorem oarea_eq_oarea_iff_odist_eq_odist_of_ne (A B C D : P) [bnea : PtNe B A] : odist C (SEG_nd A B) = odist D (SEG_nd A B) ↔ oarea A B C = oarea A B D := by +theorem odist_eq_odist_iff_oarea_eq_oarea (A B C D : P) [bnea : PtNe B A] : odist C (SEG_nd A B) = odist D (SEG_nd A B) ↔ oarea A B C = oarea A B D := by unfold oarea field_simp - exact wedge_eq_wedge_iff_odist_eq_odist_of_ne A B C D + exact odist_eq_odist_iff_wedge_eq_wedge A B C D theorem oarea_eq_sin_mul_length_mul_length_div_two (A B C : P) [bnea : PtNe B A] [cnea : PtNe C A] : oarea A B C = (SEG A B).length * (SEG A C).length * sin (ANG B A C).value / 2 := by unfold oarea rw [wedge_eq_length_mul_length_mul_sin A B C] -theorem oarea_eq_zero_iff_collinear (A B C : P) : oarea A B C = 0 ↔ collinear A B C := by +theorem oarea_eq_zero_iff_collinear (A B C : P) : oarea A B C = 0 ↔ Collinear A B C := by unfold oarea field_simp exact (collinear_iff_wedge_eq_zero A B C).symm -theorem oarea_tri_nd_ne_zero (A B C : P) (trind : ¬ collinear A B C) : oarea A B C ≠ 0 := by +theorem oarea_tri_nd_ne_zero (A B C : P) (trind : ¬ Collinear A B C) : oarea A B C ≠ 0 := by rw[← oarea_eq_zero_iff_collinear A B C] at trind tauto @@ -399,12 +349,12 @@ end oriented_area section cooperation_with_parallel -theorem odist_eq_odist_of_parallel' (A B : P) (ray : Ray P) [bnea : PtNe B A] (para : parallel (SEG_nd A B) ray) : odist A ray =odist B ray := by +theorem odist_eq_odist_of_parallel' (A B : P) (ray : Ray P) [bnea : PtNe B A] (para : Parallel (SEG_nd A B) ray) : odist A ray =odist B ray := by unfold odist have h1 : Vec.det ray.2.unitVec (VEC ray.1 B) = Vec.det ray.2.unitVec (VEC ray.1 A) + Vec.det ray.2.unitVec (VEC A B) · rw [← map_add, ←vec_add_vec ray.1 A B] have h2 : Vec.det ray.2.unitVec (VEC A B) = 0 - · unfold parallel at para + · unfold Parallel at para have h3 : Dir.toProj ray.2 = (VEC_nd A B).toProj := para.symm have h4 : VecND.toProj ray.2.unitVecND = (VEC_nd A B).toProj := by rw [← h3] @@ -417,11 +367,11 @@ theorem odist_eq_odist_of_parallel' (A B : P) (ray : Ray P) [bnea : PtNe B A] (p rw [add_zero] at h1 exact h1.symm ---theorem odist_eq_odist_of_parallel {α} [DirFig α P] (A B : P) (df : α) [bnea : PtNe B A] (para : parallel (SEG_nd A B) df) : odist A df = odist B df := sorry +--theorem odist_eq_odist_of_parallel {α} [DirFig α P] (A B : P) (df : α) [bnea : PtNe B A] (para : Parallel (SEG_nd A B) df) : odist A df = odist B df := sorry -theorem odist_eq_odist_iff_parallel_ne {α} [DirFig α P] (A B : P) (df : α) [bnea : PtNe B A] : (parallel (SEG_nd A B) df) ↔ odist A df = odist B df := by - have coer1 : (parallel (SEG_nd A B) df) = (parallel (SEG_nd A B) (toDirLine df)) := by - unfold parallel +theorem parallel_iff_odist_eq_odist_right {α} [DirFig α P] (A B : P) (df : α) [bnea : PtNe B A] : Parallel (SEG_nd A B) df ↔ odist A df = odist B df := by + have coer1 : (Parallel (SEG_nd A B) df) = (Parallel (SEG_nd A B) (toDirLine df)) := by + unfold Parallel have : toProj df = toProj (toDirLine df) := by simp only [← DirObj.toDir_toProj_eq_toProj] congr @@ -464,7 +414,7 @@ theorem odist_eq_odist_iff_parallel_ne {α} [DirFig α P] (A B : P) (df : α) [b simp only [eq_iff_iff] exact VecND.det_eq_zero_iff_toProj_eq_toProj (u := ray.toDir.unitVecND) (v := VEC_nd A B) simp only [h,h'] - unfold parallel + unfold Parallel have : toProj (SEG_nd A B) = (VEC_nd A B).toProj := by rfl constructor · intro p @@ -477,38 +427,33 @@ theorem odist_eq_odist_iff_parallel_ne {α} [DirFig α P] (A B : P) (df : α) [b simp only [Dir.unitVecND_toProj] rfl -theorem wedge_eq_wedge_iff_parallel_of_ne_ne (A B C D : P) [bnea : PtNe B A] [dnec : PtNe D C] : (parallel (SEG_nd A B) (SEG_nd C D)) ↔ wedge A B C = wedge A B D := by - have : (wedge A B C = wedge A B D) = (odist C (SEG_nd A B) = odist D (SEG_nd A B)) := by - symm - simp only [eq_iff_iff] - exact wedge_eq_wedge_iff_odist_eq_odist_of_ne A B C D - simp only [this] - have : (parallel (SEG_nd A B) (SEG_nd C D)) = (parallel (SEG_nd C D) (SEG_nd A B)) := by - unfold parallel - simp only [eq_iff_iff] - constructor - · intro P - exact P.symm - · intro P - exact P.symm - simp only [this] - exact odist_eq_odist_iff_parallel_ne C D (SEG_nd A B) - -theorem oarea_eq_oarea_iff_parallel_ne (A B C D : P) [bnea : PtNe B A] [dnec : PtNe D C] : (parallel (SEG_nd A B) (SEG_nd C D)) ↔ oarea A B C = oarea A B D := by +theorem wedge_eq_wedge_iff_parallel_left {A B C D : P} [bnea : PtNe B A] [dnec : PtNe D C] : wedge A B C = wedge A B D ↔ SEG_nd A B ∥ SEG_nd C D := by + rw [← odist_eq_odist_iff_wedge_eq_wedge, parallel_comm, parallel_iff_odist_eq_odist_right] + +theorem wedge_eq_wedge_iff_parallel_right {A B C D : P} [bnea : PtNe B A] [dnec : PtNe D C] : wedge C D A = wedge C D B ↔ SEG_nd A B ∥ SEG_nd C D := by + rw [← odist_eq_odist_iff_wedge_eq_wedge, parallel_iff_odist_eq_odist_right] + +theorem parallel_iff_wedge_eq_wedge_left {s₁ s₂ : SegND P} : s₁ ∥ s₂ ↔ wedge s₁.source s₁.target s₂.source = wedge s₁.source s₁.target s₂.target := + wedge_eq_wedge_iff_parallel_left.symm + +theorem parallel_iff_wedge_eq_wedge_right {s₁ s₂ : SegND P} : s₁ ∥ s₂ ↔ wedge s₂.source s₂.target s₁.source = wedge s₂.source s₂.target s₁.target := + wedge_eq_wedge_iff_parallel_right.symm + +theorem oarea_eq_oarea_iff_parallel_left {A B C D : P} [bnea : PtNe B A] [dnec : PtNe D C] : oarea A B C = oarea A B D ↔ SEG_nd A B ∥ SEG_nd C D := by + rw [← wedge_eq_wedge_iff_parallel_left] unfold oarea - have : (wedge A B C / 2 = wedge A B D / 2) = (wedge A B C = wedge A B D) := by - simp only [eq_iff_iff] - constructor - · intro P - calc - _= wedge A B C /2 *2 := by simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, - div_mul_cancel] - _= wedge A B D /2 *2 := by simp only [P] - _=_ := by simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, div_mul_cancel] - · intro P - simp only [P] - simp only [this] - exact wedge_eq_wedge_iff_parallel_of_ne_ne A B C D + field_simp + +theorem oarea_eq_oarea_iff_parallel_right {A B C D : P} [bnea : PtNe B A] [dnec : PtNe D C] : oarea C D A = oarea C D B ↔ SEG_nd A B ∥ SEG_nd C D := by + rw [← wedge_eq_wedge_iff_parallel_right] + unfold oarea + field_simp + +theorem parallel_iff_oarea_eq_oarea_left {s₁ s₂ : SegND P} : s₁ ∥ s₂ ↔ oarea s₁.source s₁.target s₂.source = oarea s₁.source s₁.target s₂.target := + oarea_eq_oarea_iff_parallel_left.symm + +theorem parallel_iff_oarea_eq_oarea_right {s₁ s₂ : SegND P} : s₁ ∥ s₂ ↔ oarea s₂.source s₂.target s₁.source = oarea s₂.source s₂.target s₁.target := + oarea_eq_oarea_iff_parallel_right.symm end cooperation_with_parallel @@ -517,7 +462,7 @@ scoped infix : 55 " LiesOnRight " => IsOnRightSide section handside -theorem same_sign_of_parallel (A B : P) (ray : Ray P) [bnea : PtNe B A] (para : parallel (RAY A B) ray) : odist_sign A ray = odist_sign B ray := by +theorem same_sign_of_parallel (A B : P) (ray : Ray P) [bnea : PtNe B A] (para : Parallel (RAY A B) ray) : odist_sign A ray = odist_sign B ray := by unfold odist_sign rw [odist_eq_odist_of_parallel' A B ray para] @@ -1067,7 +1012,7 @@ theorem LiesOnLeft_iff_LiesOnLeft_rev_of_IsOnOppositeSide (A B : P) (dl : DirLin simp [this] at h0 exact h0 -theorem not_collinear_of_IsOnSameSide (A B C D : P) [bnea : PtNe B A] (h : IsOnSameSide C D (RAY A B)) : (¬ collinear A B C) ∧ (¬ collinear A B D) := by +theorem not_collinear_of_IsOnSameSide (A B C D : P) [bnea : PtNe B A] (h : IsOnSameSide C D (RAY A B)) : (¬ Collinear A B C) ∧ (¬ Collinear A B D) := by have hlr : (IsOnLeftSide C (RAY A B)) ∨ (IsOnRightSide C (RAY A B)) := by rcases h with l|r · simp only [l.1, true_or] @@ -1076,15 +1021,15 @@ theorem not_collinear_of_IsOnSameSide (A B C D : P) [bnea : PtNe B A] (h : IsOnS rcases h with l|r · simp only [l.2, true_or] · simp only [r.2, or_true] - have c : ¬ collinear A B C := by + have c : ¬ Collinear A B C := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight exact hlr - have d : ¬ collinear A B D := by + have d : ¬ Collinear A B D := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight exact hlr' simp only [c, not_false_eq_true, d, and_self] -theorem not_collinear_of_IsOnOppositeSide (A B C D : P) [bnea : PtNe B A] (h : IsOnOppositeSide C D (RAY A B)) : (¬ collinear A B C) ∧ (¬ collinear A B D) := by +theorem not_collinear_of_IsOnOppositeSide (A B C D : P) [bnea : PtNe B A] (h : IsOnOppositeSide C D (RAY A B)) : (¬ Collinear A B C) ∧ (¬ Collinear A B D) := by have hlr : (IsOnLeftSide C (RAY A B)) ∨ (IsOnRightSide C (RAY A B)) := by rcases h with l|r · simp only [l.1, true_or] @@ -1093,10 +1038,10 @@ theorem not_collinear_of_IsOnOppositeSide (A B C D : P) [bnea : PtNe B A] (h : I rcases h with l|r · simp only [l.2, or_true] · simp only [r.2, true_or] - have c : ¬ collinear A B C := by + have c : ¬ Collinear A B C := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight exact hlr - have d : ¬ collinear A B D := by + have d : ¬ Collinear A B D := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight exact hlr' simp only [c, not_false_eq_true, d, and_self] diff --git a/EuclideanGeometry/Foundation/Axiom/Triangle/Basic.lean b/EuclideanGeometry/Foundation/Axiom/Triangle/Basic.lean index a2b52b95..b2a01792 100644 --- a/EuclideanGeometry/Foundation/Axiom/Triangle/Basic.lean +++ b/EuclideanGeometry/Foundation/Axiom/Triangle/Basic.lean @@ -38,7 +38,7 @@ def oarea (tr : Triangle P) : ℝ := EuclidGeom.oarea tr.1 tr.2 tr.3 def area (tr : Triangle P) : ℝ := |tr.oarea| @[pp_dot] -def IsND (tr : Triangle P) : Prop := ¬ collinear tr.1 tr.2 tr.3 +def IsND (tr : Triangle P) : Prop := ¬ Collinear tr.1 tr.2 tr.3 end Triangle @@ -73,13 +73,13 @@ abbrev edge₂ : Seg P := tr_nd.1.edge₂ abbrev edge₃ : Seg P := tr_nd.1.edge₃ @[pp_dot] -def edge_nd₁ : SegND P := ⟨tr_nd.1.edge₁, tr_nd.nontriv₁.out⟩ +def edgeND₁ : SegND P := ⟨tr_nd.1.edge₁, tr_nd.nontriv₁.out⟩ @[pp_dot] -def edge_nd₂ : SegND P := ⟨tr_nd.1.edge₂, tr_nd.nontriv₂.out⟩ +def edgeND₂ : SegND P := ⟨tr_nd.1.edge₂, tr_nd.nontriv₂.out⟩ @[pp_dot] -def edge_nd₃ : SegND P := ⟨tr_nd.1.edge₃, tr_nd.nontriv₃.out⟩ +def edgeND₃ : SegND P := ⟨tr_nd.1.edge₃, tr_nd.nontriv₃.out⟩ @[pp_dot] abbrev oarea : ℝ := tr_nd.1.oarea @@ -108,7 +108,7 @@ namespace Triangle -- When we have DirFig, rewrite this definition. protected def IsInt (A : P) (tr : Triangle P) : Prop := by - by_cases h : collinear tr.1 tr.2 tr.3 + by_cases h : Collinear tr.1 tr.2 tr.3 -- why not using ¬ tr.IsND? · exact False · let tr_nd : TriangleND P := ⟨tr, h⟩ @@ -192,9 +192,9 @@ end Triangle namespace TriangleND -def perm_vertices : (TriangleND P) := ⟨tr_nd.1.perm_vertices, flip_collinear_snd_trd.mt $ flip_collinear_fst_snd.mt tr_nd.2⟩ +def perm_vertices : (TriangleND P) := ⟨tr_nd.1.perm_vertices, Collinear.perm₁₃₂.mt $ Collinear.perm₂₁₃.mt tr_nd.2⟩ -def flip_vertices : (TriangleND P) := ⟨tr_nd.1.flip_vertices, flip_collinear_snd_trd.mt tr_nd.2⟩ +def flip_vertices : (TriangleND P) := ⟨tr_nd.1.flip_vertices, Collinear.perm₁₃₂.mt tr_nd.2⟩ theorem eq_self_of_perm_vertices_three_times : tr_nd.perm_vertices.perm_vertices.perm_vertices = tr_nd := rfl --exact tr_nd.1.eq_self_of_perm_vertices_three_times @@ -212,7 +212,7 @@ theorem same_orient_of_perm_vertices : tr_nd.is_cclock = (tr_nd.perm_vertices.is have eq : wedge tr_nd.perm_vertices.point₁ tr_nd.perm_vertices.point₂ tr_nd.perm_vertices.point₃ = wedge tr_nd.point₁ tr_nd.point₂ tr_nd.point₃ := by calc _= wedge tr_nd.point₂ tr_nd.point₃ tr_nd.point₁ := by rfl - _=_ := by exact wedge231 tr_nd.point₁ tr_nd.point₂ tr_nd.point₃ + _=_ := by exact wedge312 tr_nd.point₁ tr_nd.point₂ tr_nd.point₃ simp only [w1,w2,eq] theorem reverse_orient_of_flip_vertices : tr_nd.is_cclock = ¬ tr_nd.flip_vertices.is_cclock := by @@ -230,7 +230,7 @@ theorem reverse_orient_of_flip_vertices : tr_nd.is_cclock = ¬ tr_nd.flip_vertic · intro P simp at P have ne0' : wedge tr_nd.point₁ tr_nd.point₂ tr_nd.point₃ ≠ 0 := by - have : ¬ collinear tr_nd.point₁ tr_nd.point₂ tr_nd.point₃ := by + have : ¬ Collinear tr_nd.point₁ tr_nd.point₂ tr_nd.point₃ := by exact tr_nd.2 apply (collinear_iff_wedge_eq_zero tr_nd.point₁ tr_nd.point₂ tr_nd.point₃).not.mp exact this @@ -245,7 +245,7 @@ theorem is_inside_of_is_inside_flip_vertices (tr_nd : Triangle P) (p : P) (insid end TriangleND -def TriangleND.mk (A B C : P) (h : ¬ collinear A B C) : TriangleND P := Subtype.mk (Triangle.mk A B C) h +def TriangleND.mk (A B C : P) (h : ¬ Collinear A B C) : TriangleND P := Subtype.mk (Triangle.mk A B C) h scoped notation "TRI" => Triangle.mk scoped notation "▵" => Triangle.mk @@ -313,20 +313,20 @@ theorem trivial_of_edge_sum_eq_edge : tr.edge₁.length + tr.edge₂.length = tr unfold IsND rw [not_not] by_cases h₁ : VEC B C = 0 - · simp only [(eq_iff_vec_eq_zero B C).2 h₁] - apply flip_collinear_fst_trd - exact triv_collinear _ _ + · simp only [eq_iff_vec_eq_zero.2 h₁] + apply Collinear.perm₃₂₁ + exact triv_collinear₁₂ _ _ · by_cases h₂ : VEC C A = 0 - · simp only [(eq_iff_vec_eq_zero C A).2 h₂] - apply flip_collinear_snd_trd - exact triv_collinear _ _ + · simp only [eq_iff_vec_eq_zero.2 h₂] + apply Collinear.perm₁₃₂ + exact triv_collinear₁₂ _ _ · have g : SameRay ℝ (VEC B C) (VEC C A) · rw [sameRay_iff_norm_add, ← eq] congr <;> exact Seg.length_eq_norm_toVec rcases SameRay.exists_pos g h₁ h₂ with ⟨_, ⟨_, ⟨_, ⟨_, g⟩⟩⟩⟩ rw [← neg_vec C B, ← neg_one_smul ℝ, ← mul_smul, mul_neg_one, ← eq_inv_smul_iff₀ (by linarith), ← mul_smul] at g - exact perm_collinear_snd_trd_fst (collinear_of_vec_eq_smul_vec g) + exact Collinear.perm₂₃₁ (collinear_of_vec_eq_smul_vec g) theorem triangle_ineq' (nontriv : tr.IsND) : tr.edge₁.length + tr.edge₂.length > tr.edge₃.length := by have ne : tr.edge₁.length + tr.edge₂.length ≠ tr.edge₃.length := by @@ -345,7 +345,7 @@ theorem nontrivial_of_edge_sum_gt_edge : tr.edge₁.length + tr.edge₂.length > So funny. Can you get it? -/ -theorem edge_sum_eq_edge_iff_collinear : collinear tr.1 tr.2 tr.3 ↔ (tr.edge₁.length + tr.edge₂.length = tr.edge₃.length) ∨ (tr.edge₂.length + tr.edge₃.length = tr.edge₁.length) ∨ (tr.edge₃.length + tr.edge₁.length = tr.edge₂.length) := sorry +theorem edge_sum_eq_edge_iff_collinear : Collinear tr.1 tr.2 tr.3 ↔ (tr.edge₁.length + tr.edge₂.length = tr.edge₃.length) ∨ (tr.edge₂.length + tr.edge₃.length = tr.edge₁.length) ∨ (tr.edge₃.length + tr.edge₁.length = tr.edge₂.length) := sorry /- area ≥ 0, nontrivial → >0, =0 → trivial -/ end Triangle @@ -374,11 +374,11 @@ theorem angle₁_pos_iff_cclock : tr_nd.is_cclock ↔ tr_nd.angle₁.value.IsPos simp only [eq_iff_iff] have pos3 : tr_nd.edge₃.length > 0 := by calc - _= tr_nd.edge_nd₃.length := by rfl + _= tr_nd.edgeND₃.length := by rfl _>0 := by apply EuclidGeom.length_pos have pos2 : tr_nd.edge₂.length > 0 := by calc - _= tr_nd.edge_nd₂.length := by rfl + _= tr_nd.edgeND₂.length := by rfl _>0 := by apply EuclidGeom.length_pos constructor · intro P diff --git a/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_ex.lean b/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_ex.lean index 57a41600..29c7c76f 100644 --- a/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_ex.lean +++ b/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_ex.lean @@ -104,15 +104,15 @@ the uniqueness of the graph and how to use it to determine the orientation. -/ variable (tr_nd : TriangleND P) -theorem iscclock_iff_liesonleft₃ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr_nd.1.3 LiesOnLeft tr_nd.edge_nd₃ := by +theorem iscclock_iff_liesonleft₃ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr_nd.1.3 LiesOnLeft tr_nd.edgeND₃ := by unfold is_cclock unfold IsOnLeftSide - have h : (0 < tr_nd.oarea) = (0 < odist tr_nd.1.3 tr_nd.edge_nd₃) := by - have : EuclidGeom.oarea tr_nd.1.1 tr_nd.1.2 tr_nd.1.3 = tr_nd.edge₃.length * odist tr_nd.1.3 tr_nd.edge_nd₃ /2 := by + have h : (0 < tr_nd.oarea) = (0 < odist tr_nd.1.3 tr_nd.edgeND₃) := by + have : EuclidGeom.oarea tr_nd.1.1 tr_nd.1.2 tr_nd.1.3 = tr_nd.edge₃.length * odist tr_nd.1.3 tr_nd.edgeND₃ /2 := by apply oarea_eq_length_mul_odist_div_two unfold oarea unfold Triangle.oarea - have pos : tr_nd.edge_nd₃.length > 0 := by + have pos : tr_nd.edgeND₃.length > 0 := by apply EuclidGeom.length_pos simp only [this, eq_iff_iff] symm @@ -121,17 +121,17 @@ theorem iscclock_iff_liesonleft₃ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr positivity · intro p apply pos_of_mul_pos_left (b := tr_nd.edge₃.length/2) - · have simp : odist tr_nd.1.3 tr_nd.edge_nd₃ * (tr_nd.edge₃.length / 2) = tr_nd.edge₃.length * odist tr_nd.1.3 tr_nd.edge_nd₃ / 2 := by ring + · have simp : odist tr_nd.1.3 tr_nd.edgeND₃ * (tr_nd.edge₃.length / 2) = tr_nd.edge₃.length * odist tr_nd.1.3 tr_nd.edgeND₃ / 2 := by ring rw [simp] exact p · positivity exact h -theorem iscclock_iff_liesonleft₁ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr_nd.1.1 LiesOnLeft tr_nd.edge_nd₁ := by +theorem iscclock_iff_liesonleft₁ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr_nd.1.1 LiesOnLeft tr_nd.edgeND₁ := by have h : tr_nd.is_cclock = (tr_nd.perm_vertices.is_cclock) := by apply same_orient_of_perm_vertices simp only [h] apply iscclock_iff_liesonleft₃ -theorem iscclock_iff_liesonleft₂ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr_nd.1.2 LiesOnLeft tr_nd.edge_nd₂ := by +theorem iscclock_iff_liesonleft₂ (tr_nd : TriangleND P) : tr_nd.is_cclock = tr_nd.1.2 LiesOnLeft tr_nd.edgeND₂ := by have h : tr_nd.is_cclock = (tr_nd.perm_vertices.is_cclock) := by apply same_orient_of_perm_vertices simp only [h] @@ -175,7 +175,7 @@ theorem anti_cclock_of_IsOnOppositeSide (A B C D : P) [hne : PtNe B A] (h : IsOn lemma liesonleft_ne_pts {A B C : P} [hne : PtNe B A] (h : C LiesOnLeft (DLIN A B)) : (C ≠ A) ∧ (C ≠ B) := by have h': C LiesOnLeft (RAY A B) := by exact h - have : ¬ collinear A B C := by + have : ¬ Collinear A B C := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight simp only [h', true_or] have c_ne_a : C ≠ A := (ne_of_not_collinear this).2.1.symm @@ -184,7 +184,7 @@ lemma liesonleft_ne_pts {A B C : P} [hne : PtNe B A] (h : C LiesOnLeft (DLIN A B theorem liesonleft_angle_ispos {A B C : P} [hne : PtNe B A] (h : C LiesOnLeft (DLIN A B)) : (∠ A C B (liesonleft_ne_pts h).1.symm (liesonleft_ne_pts h).2.symm).IsPos := by have h': C LiesOnLeft (RAY A B) := by exact h - have ABC_nd: ¬ collinear A B C := by + have ABC_nd: ¬ Collinear A B C := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight simp only [h', true_or] have c : (TRI_nd A B C ABC_nd).is_cclock = C LiesOnLeft (SEG_nd A B) := by @@ -201,7 +201,7 @@ theorem liesonleft_angle_ispos {A B C : P} [hne : PtNe B A] (h : C LiesOnLeft (D lemma liesonright_ne_pts {A B C : P} [hne : PtNe B A] (h : C LiesOnRight (DLIN A B)) : (C ≠ A) ∧ (C ≠ B) := by have h': C LiesOnRight (RAY A B) := by exact h - have : ¬ collinear A B C := by + have : ¬ Collinear A B C := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight simp only [h', or_true] have c_ne_a : C ≠ A := (ne_of_not_collinear this).2.1.symm @@ -211,7 +211,7 @@ lemma liesonright_ne_pts {A B C : P} [hne : PtNe B A] (h : C LiesOnRight (DLIN A theorem liesonright_angle_isneg {A B C : P} [hne : PtNe B A] (h : C LiesOnRight (DLIN A B)) : (∠ A C B (liesonright_ne_pts h).1.symm (liesonright_ne_pts h).2.symm).IsNeg := by have h': C LiesOnRight (RAY A B) := by exact h have h'' : C LiesOnRight (SEG_nd A B) := by exact h - have ABC_nd: ¬ collinear A B C := by + have ABC_nd: ¬ Collinear A B C := by apply not_collinear_of_LiesOnLeft_or_LiesOnRight simp only [h', or_true] have c : (TRI_nd A B C ABC_nd).is_cclock = C LiesOnLeft (SEG_nd A B) := by diff --git a/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_trash.lean b/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_trash.lean index 001c308c..d546e59d 100644 --- a/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_trash.lean +++ b/EuclideanGeometry/Foundation/Axiom/Triangle/Basic_trash.lean @@ -13,7 +13,7 @@ structure TriangleND.IsAcute (tr_nd : TriangleND P) : Prop where variable {tr_nd₁ tr_nd₂ : TriangleND P} -theorem edge_toLine_not_para_of_not_collinear {A B C : P} (h : ¬ collinear A B C) : ¬ (SEG_nd A B (ne_of_not_collinear h).2.2) ∥ SEG_nd B C (ne_of_not_collinear h).1 ∧ ¬ (SEG_nd B C (ne_of_not_collinear h).1) ∥ SEG_nd C A (ne_of_not_collinear h).2.1 ∧ ¬ (SEG_nd C A (ne_of_not_collinear h).2.1) ∥ SEG_nd A B (ne_of_not_collinear h).2.2 := by +theorem edge_toLine_not_para_of_not_collinear {A B C : P} (h : ¬ Collinear A B C) : ¬ (SEG_nd A B (ne_of_not_collinear h).2.2) ∥ SEG_nd B C (ne_of_not_collinear h).1 ∧ ¬ (SEG_nd B C (ne_of_not_collinear h).1) ∥ SEG_nd C A (ne_of_not_collinear h).2.1 ∧ ¬ (SEG_nd C A (ne_of_not_collinear h).2.1) ∥ SEG_nd A B (ne_of_not_collinear h).2.2 := by constructor by_contra h1 have eq1 : LIN A B (ne_of_not_collinear h).2.2 = LIN B C (ne_of_not_collinear h).1 := by @@ -22,7 +22,7 @@ theorem edge_toLine_not_para_of_not_collinear {A B C : P} (h : ¬ collinear A B exact (SEG_nd B C (ne_of_not_collinear h).1).source_lies_on_toLine exact h1 have a_lies_on_ab : A LiesOn (LIN A B (ne_of_not_collinear h).2.2) := (SEG_nd A B (ne_of_not_collinear h).2.2).source_lies_on_toLine - have a_not_lies_on_bc := (Line.lies_on_line_of_pt_pt_iff_collinear (_h := ⟨(ne_of_not_collinear h).1⟩) A).mp.mt (flip_collinear_snd_trd.mt (flip_collinear_fst_snd.mt h)) + have a_not_lies_on_bc := (Line.lies_on_line_of_pt_pt_iff_collinear (_h := ⟨(ne_of_not_collinear h).1⟩) A).mp.mt (Collinear.perm₁₃₂.mt (Collinear.perm₂₁₃.mt h)) simp only[← eq1] at a_not_lies_on_bc apply a_not_lies_on_bc exact a_lies_on_ab @@ -34,7 +34,7 @@ theorem edge_toLine_not_para_of_not_collinear {A B C : P} (h : ¬ collinear A B exact (SEG_nd C A (ne_of_not_collinear h).2.1).source_lies_on_toLine exact h2 have b_lies_on_bc : B LiesOn (LIN B C (ne_of_not_collinear h).1) := (SEG_nd B C (ne_of_not_collinear h).1).source_lies_on_toLine - have b_not_lies_on_ca := (Line.lies_on_line_of_pt_pt_iff_collinear (_h := ⟨(ne_of_not_collinear h).2.1⟩) B).mp.mt (flip_collinear_fst_snd.mt (flip_collinear_snd_trd.mt h)) + have b_not_lies_on_ca := (Line.lies_on_line_of_pt_pt_iff_collinear (_h := ⟨(ne_of_not_collinear h).2.1⟩) B).mp.mt (Collinear.perm₂₁₃.mt (Collinear.perm₁₃₂.mt h)) simp only[← eq2] at b_not_lies_on_ca apply b_not_lies_on_ca exact b_lies_on_bc @@ -71,15 +71,15 @@ theorem edge_eq_edge_of_perm_vertices_two_times (tr_nd : TriangleND P) : tr_nd.1 theorem angle_eq_angle_of_perm_vertices_two_times (tr_nd : TriangleND P) : tr_nd.angle₁.value = tr_nd.perm_vertices.perm_vertices.angle₃.value ∧ tr_nd.angle₂.value = tr_nd.perm_vertices.perm_vertices.angle₁.value ∧ tr_nd.angle₃.value = tr_nd.perm_vertices.perm_vertices.angle₂.value := by sorry -theorem points_ne_of_collinear_of_not_collinear1 {A B C D : P} (ncolin : ¬ collinear A B C) (colin : collinear D B C) : D ≠ A := sorry +theorem points_ne_of_collinear_of_not_collinear1 {A B C D : P} (ncolin : ¬ Collinear A B C) (colin : Collinear D B C) : D ≠ A := sorry -theorem points_ne_of_collinear_of_not_collinear2 {A B C D : P} (ncolin : ¬ collinear A B C) (colin : collinear D C A) : D ≠ B := sorry +theorem points_ne_of_collinear_of_not_collinear2 {A B C D : P} (ncolin : ¬ Collinear A B C) (colin : Collinear D C A) : D ≠ B := sorry -theorem points_ne_of_collinear_of_not_collinear3 {A B C D : P} (ncolin : ¬ collinear A B C) (colin : collinear D A B) : D ≠ C := sorry +theorem points_ne_of_collinear_of_not_collinear3 {A B C D : P} (ncolin : ¬ Collinear A B C) (colin : Collinear D A B) : D ≠ C := sorry -theorem not_parallel_of_not_collinear_of_collinear_collinear {A B C D E : P} (nd : ¬ collinear A B C) (colindbc : collinear D B C) (colineca : collinear E C A) : ¬ (LIN A D (points_ne_of_collinear_of_not_collinear1 nd colindbc)) ∥ (LIN B E (points_ne_of_collinear_of_not_collinear2 nd colineca)) := sorry +theorem not_parallel_of_not_collinear_of_collinear_collinear {A B C D E : P} (nd : ¬ Collinear A B C) (colindbc : Collinear D B C) (colineca : Collinear E C A) : ¬ (LIN A D (points_ne_of_collinear_of_not_collinear1 nd colindbc)) ∥ (LIN B E (points_ne_of_collinear_of_not_collinear2 nd colineca)) := sorry -theorem intersection_not_collinear_of_nondegenerate {A B C D E : P} (nd : ¬ collinear A B C) (colindbc : collinear D B C) (colineca : collinear E C A) (dneb : D ≠ B) (dnec : D ≠ C) (enea : E ≠ A) (enec : E ≠ C) (F : P) (fdef : F = Line.inx (LIN A D (points_ne_of_collinear_of_not_collinear1 nd colindbc)) (LIN B E (points_ne_of_collinear_of_not_collinear2 nd colineca)) (not_parallel_of_not_collinear_of_collinear_collinear nd colindbc colineca)) : (¬ collinear A B F) ∧ (¬ collinear B C F) ∧ (¬ collinear C A F) := by sorry +theorem intersection_not_collinear_of_nondegenerate {A B C D E : P} (nd : ¬ Collinear A B C) (colindbc : Collinear D B C) (colineca : Collinear E C A) (dneb : D ≠ B) (dnec : D ≠ C) (enea : E ≠ A) (enec : E ≠ C) (F : P) (fdef : F = Line.inx (LIN A D (points_ne_of_collinear_of_not_collinear1 nd colindbc)) (LIN B E (points_ne_of_collinear_of_not_collinear2 nd colineca)) (not_parallel_of_not_collinear_of_collinear_collinear nd colindbc colineca)) : (¬ Collinear A B F) ∧ (¬ Collinear B C F) ∧ (¬ Collinear C A F) := by sorry theorem cclock_of_eq_angle (tr_nd₁ tr_nd₂ : TriangleND P)(a : tr_nd₁.angle₁.value = tr_nd₂.angle₁.value) : tr_nd₁.is_cclock ↔ tr_nd₂.is_cclock := by sorry diff --git a/EuclideanGeometry/Foundation/Axiom/Triangle/Congruence.lean b/EuclideanGeometry/Foundation/Axiom/Triangle/Congruence.lean index d14743d2..d80a840e 100644 --- a/EuclideanGeometry/Foundation/Axiom/Triangle/Congruence.lean +++ b/EuclideanGeometry/Foundation/Axiom/Triangle/Congruence.lean @@ -41,17 +41,17 @@ theorem nd_of_nd (h : tr₁.IsCongr tr₂) (nd : tr₁.IsND) : tr₂.IsND := by rw [Triangle.edge_sum_eq_edge_iff_collinear] at col rcases col with l₁ | l₂ | l₃ . simp only [<-h.1, <-h.2, <-h.3] at l₁ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inl l₁ exact nd col' . simp only [<-h.1, <-h.2, <-h.3] at l₂ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inr (.inl l₂) exact nd col' . simp only [<-h.1, <-h.2, <-h.3] at l₃ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inr (.inr l₃) exact nd col' @@ -161,17 +161,17 @@ theorem nd_of_nd (h : tr₁.IsACongr tr₂) (nd : tr₁.IsND) : tr₂.IsND := by rw [Triangle.edge_sum_eq_edge_iff_collinear] at col rcases col with l₁ | l₂ | l₃ . simp only [<-h.1, <-h.2, <-h.3] at l₁ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inl l₁ exact nd col' . simp only [<-h.1, <-h.2, <-h.3] at l₂ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inr (.inl l₂) exact nd col' . simp only [<-h.1, <-h.2, <-h.3] at l₃ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inr (.inr l₃) exact nd col' @@ -590,9 +590,9 @@ theorem cosine_eq_of_SSS (e₁ : tr_nd₁.1.edge₁.length = tr_nd₂.1.edge₁. rw [e₁,e₂,e₃,←cos₂] at cos₁ field_simp at cos₁ have u₁ : 0 < tr_nd₂.1.edge₃.length := by - exact length_pos_iff_nd.mpr tr_nd₂.edge_nd₃.2 + exact length_pos_iff_nd.mpr tr_nd₂.edgeND₃.2 have u₂ : 0 < tr_nd₂.1.edge₂.length := by - exact length_pos_iff_nd.mpr tr_nd₂.edge_nd₂.2 + exact length_pos_iff_nd.mpr tr_nd₂.edgeND₂.2 have h0 : (tr_nd₂.1.edge₃.length * tr_nd₂.1.edge₂.length) > 0 := by field_simp [u₁,u₂] rcases cos₁ with x | y @@ -930,17 +930,17 @@ theorem congr_or_acongr_of_SSS (e₁ : tr₁.edge₁.length = tr₂.edge₁.leng rw [Triangle.edge_sum_eq_edge_iff_collinear] at nd₂ rcases nd₂ with l₁ | l₂ | l₃ . simp only [<-e₁, <-e₂, <-e₃] at l₁ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inl l₁ exact nd₁ col' . simp only [<-e₁, <-e₂, <-e₃] at l₂ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inr (.inl l₂) exact nd₁ col' . simp only [<-e₁, <-e₂, <-e₃] at l₃ - have col' : collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by + have col' : Collinear tr₁.point₁ tr₁.point₂ tr₁.point₃ := by rw [Triangle.edge_sum_eq_edge_iff_collinear] exact .inr (.inr l₃) exact nd₁ col' diff --git a/EuclideanGeometry/Foundation/Axiom/Triangle/Similarity.lean b/EuclideanGeometry/Foundation/Axiom/Triangle/Similarity.lean index 3eac3dbc..18e345b5 100644 --- a/EuclideanGeometry/Foundation/Axiom/Triangle/Similarity.lean +++ b/EuclideanGeometry/Foundation/Axiom/Triangle/Similarity.lean @@ -70,17 +70,17 @@ theorem ratio₂ : h.ratio = tr₁.edge₂.length / tr₂.edge₂.length := by rw [h.1,h.2] at sine₁ have s₁₂: tr₁.edge₁.length / tr₁.edge₂.length = (sin (Angle.value tr₂.angle₁)) / (sin (Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₁ - exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₁.edge_nd₂.2).symm).mpr sine₁).symm + exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₁.edgeND₂.2).symm).mpr sine₁).symm have t₁₂: tr₂.edge₁.length / tr₂.edge₂.length = (sin (Angle.value tr₂.angle₁)) / (sin (Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₂ - exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mpr sine₂).symm + exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mpr sine₂).symm rw [<-t₁₂] at s₁₂ unfold ratio - have eq := mul_eq_mul_of_div_eq_div tr₁.edge₁.length tr₂.edge₁.length (length_ne_zero_iff_nd.mpr tr₁.edge_nd₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm s₁₂ - apply (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edge_nd₁.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mpr - have e₂ : (tr₂.edge_nd₂).1.length = tr₂.edge₂.length := rfl - have e₁ : (tr₂.edge_nd₁).1.length = tr₂.edge₁.length := rfl - have e₂' : (tr₁.edge_nd₂).1.length = tr₁.edge₂.length := rfl + have eq := mul_eq_mul_of_div_eq_div tr₁.edge₁.length tr₂.edge₁.length (length_ne_zero_iff_nd.mpr tr₁.edgeND₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm s₁₂ + apply (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edgeND₁.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mpr + have e₂ : (tr₂.edgeND₂).1.length = tr₂.edge₂.length := rfl + have e₁ : (tr₂.edgeND₁).1.length = tr₂.edge₁.length := rfl + have e₂' : (tr₁.edgeND₂).1.length = tr₁.edge₂.length := rfl rw [e₂, e₂'] at eq simp only [e₂, e₁, eq, mul_comm] @@ -93,10 +93,10 @@ theorem ratio₁₂ : tr₁.edge₁.length / tr₁.edge₂.length = tr₂.edge rw [h.1,h.2] at sine₁ have s₁₂: tr₁.edge₁.length / tr₁.edge₂.length = (sin (Angle.value tr₂.angle₁)) / (sin (Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₁ - exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₁.edge_nd₂.2).symm).mpr sine₁).symm + exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₁.edgeND₂.2).symm).mpr sine₁).symm have t₁₂: tr₂.edge₁.length / tr₂.edge₂.length = (sin (Angle.value tr₂.angle₁)) / (sin (Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₂ - exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mpr sine₂).symm + exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mpr sine₂).symm rw [<-t₁₂] at s₁₂ exact s₁₂ @@ -155,18 +155,18 @@ theorem ratio₂ : h.ratio = tr₁.edge₂.length / tr₂.edge₂.length := by rw [<-this,<-(angle_eq_angle_of_perm_vertices (perm_vertices tr₂)).2.2,<-(angle_eq_angle_of_perm_vertices tr₂).2.1] at nd have s₁₂: tr₁.edge₁.length / tr₁.edge₂.length = (sin (- Angle.value tr₂.angle₁)) / (sin (-Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₁ - exact ((div_eq_div_iff nd (length_ne_zero_iff_nd.mpr tr₁.edge_nd₂.2).symm).mpr sine₁).symm + exact ((div_eq_div_iff nd (length_ne_zero_iff_nd.mpr tr₁.edgeND₂.2).symm).mpr sine₁).symm have t₁₂: tr₂.edge₁.length / tr₂.edge₂.length = (sin (Angle.value tr₂.angle₁)) / (sin (Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₂ - exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mpr sine₂).symm + exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mpr sine₂).symm rw [sin_neg (Angle.value tr₂.angle₁),sin_neg (Angle.value tr₂.angle₂),neg_div_neg_eq] at s₁₂ rw [<-t₁₂] at s₁₂ unfold ratio - have eq := mul_eq_mul_of_div_eq_div tr₁.edge₁.length tr₂.edge₁.length (length_ne_zero_iff_nd.mpr tr₁.edge_nd₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm s₁₂ - apply (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edge_nd₁.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mpr - have e₂ : (tr₂.edge_nd₂).1.length = tr₂.edge₂.length := rfl - have e₁ : (tr₂.edge_nd₁).1.length = tr₂.edge₁.length := rfl - have e₂' : (tr₁.edge_nd₂).1.length = tr₁.edge₂.length := rfl + have eq := mul_eq_mul_of_div_eq_div tr₁.edge₁.length tr₂.edge₁.length (length_ne_zero_iff_nd.mpr tr₁.edgeND₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm s₁₂ + apply (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edgeND₁.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mpr + have e₂ : (tr₂.edgeND₂).1.length = tr₂.edge₂.length := rfl + have e₁ : (tr₂.edgeND₁).1.length = tr₂.edge₁.length := rfl + have e₂' : (tr₁.edgeND₂).1.length = tr₁.edge₂.length := rfl rw [e₂, e₂'] at eq simp only [e₂, e₁, eq, mul_comm] @@ -183,10 +183,10 @@ theorem ratio₁₂ : tr₁.edge₁.length / tr₁.edge₂.length = tr₂.edge rw [<-this,<-(angle_eq_angle_of_perm_vertices (perm_vertices tr₂)).2.2,<-(angle_eq_angle_of_perm_vertices tr₂).2.1] at nd have s₁₂: tr₁.edge₁.length / tr₁.edge₂.length = (sin (- Angle.value tr₂.angle₁)) / (sin (-Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₁ - exact ((div_eq_div_iff nd (length_ne_zero_iff_nd.mpr tr₁.edge_nd₂.2).symm).mpr sine₁).symm + exact ((div_eq_div_iff nd (length_ne_zero_iff_nd.mpr tr₁.edgeND₂.2).symm).mpr sine₁).symm have t₁₂: tr₂.edge₁.length / tr₂.edge₂.length = (sin (Angle.value tr₂.angle₁)) / (sin (Angle.value tr₂.angle₂)) := by rw [mul_comm] at sine₂ - exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mpr sine₂).symm + exact ((div_eq_div_iff (sine_ne_zero_of_nd (perm_vertices tr₂)) (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mpr sine₂).symm rw [sin_neg (Angle.value tr₂.angle₁), sin_neg (Angle.value tr₂.angle₂), neg_div_neg_eq, ← t₁₂] at s₁₂ exact s₁₂ @@ -284,9 +284,9 @@ theorem asim_of_AA (tr₁ tr₂ : TriangleND P) (h₂ : tr₁.angle₂.value = - /- SAS -/ theorem sim_of_SAS (tr₁ tr₂ : TriangleND P) (e : tr₁.edge₂.length / tr₂.edge₂.length = tr₁.edge₃.length / tr₂.edge₃.length) (a : tr₁.angle₁.value = tr₂.angle₁.value): tr₁ ∼ tr₂ := by have eq : tr₁.edge₂.length * tr₂.edge₃.length = tr₁.edge₃.length * tr₂.edge₂.length := by - exact (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm).mp e + exact (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm).mp e rw [mul_comm tr₁.edge₃.length tr₂.edge₂.length] at eq - have e' : tr₁.edge₂.length / tr₁.edge₃.length = tr₂.edge₂.length / tr₂.edge₃.length := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edge_nd₃.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm).mpr eq + have e' : tr₁.edge₂.length / tr₁.edge₃.length = tr₂.edge₂.length / tr₂.edge₃.length := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edgeND₃.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm).mpr eq have sine₁ := Triangle.sine_rule₁ tr₁ have sine₂ := Triangle.sine_rule₁ tr₂ have sine₁' : tr₁.edge₂.length * sin (Angle.value tr₁.angle₃) = sin (Angle.value tr₁.angle₂) * tr₁.edge₃.length := by @@ -299,8 +299,8 @@ theorem sim_of_SAS (tr₁ tr₂ : TriangleND P) (e : tr₁.edge₂.length / tr have ne₂₃ : sin (Angle.value tr₂.angle₃) ≠ 0 := by simp only [(angle_eq_angle_of_perm_vertices tr₂).2.2,ne_eq, sine_ne_zero_of_nd, not_false_eq_true] - have s₁₂ : tr₁.edge₂.length / tr₁.edge₃.length = sin (Angle.value tr₁.angle₂) / sin (Angle.value tr₁.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edge_nd₃.2).symm ne₁₃).mpr sine₁' - have t₁₂ : tr₂.edge₂.length / tr₂.edge₃.length = sin (Angle.value tr₂.angle₂) / sin (Angle.value tr₂.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm ne₂₃).mpr sine₂' + have s₁₂ : tr₁.edge₂.length / tr₁.edge₃.length = sin (Angle.value tr₁.angle₂) / sin (Angle.value tr₁.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edgeND₃.2).symm ne₁₃).mpr sine₁' + have t₁₂ : tr₂.edge₂.length / tr₂.edge₃.length = sin (Angle.value tr₂.angle₂) / sin (Angle.value tr₂.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm ne₂₃).mpr sine₂' rw [s₁₂,t₁₂] at e' have e'' := (div_eq_div_iff ne₁₃ ne₂₃).mp e' have summul := Real.cos_sub_cos ((Angle.value tr₁.angle₂).toReal + (Angle.value tr₂.angle₃).toReal) ((Angle.value tr₁.angle₂).toReal - (Angle.value tr₂.angle₃).toReal) @@ -413,9 +413,9 @@ theorem sim_of_SAS (tr₁ tr₂ : TriangleND P) (e : tr₁.edge₂.length / tr theorem asim_of_SAS (tr₁ tr₂ : TriangleND P) (e : tr₁.edge₂.length / tr₂.edge₂.length = tr₁.edge₃.length / tr₂.edge₃.length) (a : tr₁.angle₁.value = - tr₂.angle₁.value): tr₁ ∼ₐ tr₂ := by have eq : tr₁.edge₂.length * tr₂.edge₃.length = tr₁.edge₃.length * tr₂.edge₂.length := by - exact (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm).mp e + exact (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm).mp e rw [mul_comm tr₁.edge₃.length tr₂.edge₂.length] at eq - have e' : tr₁.edge₂.length / tr₁.edge₃.length = tr₂.edge₂.length / tr₂.edge₃.length := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edge_nd₃.2).symm (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm).mpr eq + have e' : tr₁.edge₂.length / tr₁.edge₃.length = tr₂.edge₂.length / tr₂.edge₃.length := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edgeND₃.2).symm (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm).mpr eq have sine₁ := Triangle.sine_rule₁ tr₁ have sine₂ := Triangle.sine_rule₁ tr₂ have sine₁' : tr₁.edge₂.length * sin (Angle.value tr₁.angle₃) = sin (Angle.value tr₁.angle₂) * tr₁.edge₃.length := by @@ -426,8 +426,8 @@ theorem asim_of_SAS (tr₁ tr₂ : TriangleND P) (e : tr₁.edge₂.length / tr simp only [(angle_eq_angle_of_perm_vertices tr₁).2.2, ne_eq,sine_ne_zero_of_nd, not_false_eq_true] have ne₂₃ : sin (Angle.value tr₂.angle₃) ≠ 0 := by simp only [(angle_eq_angle_of_perm_vertices tr₂).2.2,ne_eq, sine_ne_zero_of_nd, not_false_eq_true] - have s₁₂ : tr₁.edge₂.length / tr₁.edge₃.length = sin (Angle.value tr₁.angle₂) / sin (Angle.value tr₁.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edge_nd₃.2).symm ne₁₃).mpr sine₁' - have t₁₂ : tr₂.edge₂.length / tr₂.edge₃.length = sin (Angle.value tr₂.angle₂) / sin (Angle.value tr₂.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm ne₂₃).mpr sine₂' + have s₁₂ : tr₁.edge₂.length / tr₁.edge₃.length = sin (Angle.value tr₁.angle₂) / sin (Angle.value tr₁.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₁.edgeND₃.2).symm ne₁₃).mpr sine₁' + have t₁₂ : tr₂.edge₂.length / tr₂.edge₃.length = sin (Angle.value tr₂.angle₂) / sin (Angle.value tr₂.angle₃) := (div_eq_div_iff (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm ne₂₃).mpr sine₂' rw [s₁₂,t₁₂] at e' have e'' := (div_eq_div_iff ne₁₃ ne₂₃).mp e' have summul := Real.cos_sub_cos ((Angle.value tr₁.angle₂).toReal + (Angle.value tr₂.angle₃).toReal) ((Angle.value tr₁.angle₂).toReal - (Angle.value tr₂.angle₃).toReal) @@ -563,13 +563,13 @@ theorem IsSim.congr_of_ratio_eq_one (h : IsSim tr₁ tr₂) (hr : h.ratio = 1) : constructor have := ratio₁ h rw [hr] at this - exact (div_eq_one_iff_eq (length_ne_zero_iff_nd.mpr tr₂.edge_nd₁.2).symm).mp this.symm + exact (div_eq_one_iff_eq (length_ne_zero_iff_nd.mpr tr₂.edgeND₁.2).symm).mp this.symm have := ratio₂ h rw [hr] at this - exact (div_eq_one_iff_eq (length_ne_zero_iff_nd.mpr tr₂.edge_nd₂.2).symm).mp this.symm + exact (div_eq_one_iff_eq (length_ne_zero_iff_nd.mpr tr₂.edgeND₂.2).symm).mp this.symm have := ratio₃ h rw [hr] at this - exact (div_eq_one_iff_eq (length_ne_zero_iff_nd.mpr tr₂.edge_nd₃.2).symm).mp this.symm + exact (div_eq_one_iff_eq (length_ne_zero_iff_nd.mpr tr₂.edgeND₃.2).symm).mp this.symm exact h.1 exact h.2 exact h.3 diff --git a/EuclideanGeometry/Foundation/Axiom/Triangle/Trigonometric.lean b/EuclideanGeometry/Foundation/Axiom/Triangle/Trigonometric.lean index 6a224272..96c8ae64 100644 --- a/EuclideanGeometry/Foundation/Axiom/Triangle/Trigonometric.lean +++ b/EuclideanGeometry/Foundation/Axiom/Triangle/Trigonometric.lean @@ -70,7 +70,7 @@ theorem Pythagoras_of_perp_foot (A B : P) {l : Line P} (h : B LiesOn l) : (SEG A --let C := tr_nd.1.point₃ /-- Given ▵ A B C with ∠ B A C = π / 2, A B ^ 2 + A C ^ 2 = B C ^ 2, namely (SEG A B).length ^ 2 + (SEG A C).length ^ 2 = (SEG B C).length ^ 2. -/ -theorem Pythagoras_of_right_triangle_non_trivial (A B C : P) {hnd : ¬ collinear A B C} (right_triangle: ∠ B A C (ne_of_not_collinear hnd).2.2 (ne_of_not_collinear hnd).2.1.symm = (π / 2 : ℝ)) : (SEG A B).length ^ 2 + (SEG A C).length ^ 2 = (SEG B C).length ^ 2 := by +theorem Pythagoras_of_right_triangle_non_trivial (A B C : P) {hnd : ¬ Collinear A B C} (right_triangle: ∠ B A C (ne_of_not_collinear hnd).2.2 (ne_of_not_collinear hnd).2.1.symm = (π / 2 : ℝ)) : (SEG A B).length ^ 2 + (SEG A C).length ^ 2 = (SEG B C).length ^ 2 := by have h : cos (∠ B A C (ne_of_not_collinear hnd).2.2 (ne_of_not_collinear hnd).2.1.symm) = 0 · rw [right_triangle] simp diff --git a/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva.lean b/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva.lean index 19d384a9..e817fec9 100644 --- a/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva.lean +++ b/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva.lean @@ -14,9 +14,9 @@ class CevaCfgClass (P : outParam <| Type*) [outParam <| EuclideanPlane P] where (A B C : P) --Let $D$ be a point not lying on $AB$, $BC$ and $CA$. D : P - abd_nd : ¬collinear A B D - bcd_nd : ¬collinear B C D - cad_nd : ¬collinear C A D + abd_nd : ¬Collinear A B D + bcd_nd : ¬Collinear B C D + cad_nd : ¬Collinear C A D a_ne_b : PtNe A B := ⟨(ne_of_not_collinear abd_nd).2.2.symm⟩ b_ne_c : PtNe B C := ⟨(ne_of_not_collinear bcd_nd).2.2.symm⟩ @@ -47,90 +47,90 @@ variable {P : Type*} [EuclideanPlane P] [cfg : CevaCfgClass P] attribute [instance] a_ne_b b_ne_c c_ne_a d_ne_a d_ne_b d_ne_c --$D,C,A$ are not collinear -lemma ncolin_dca : ¬ collinear D C A := by +lemma ncolin_dca : ¬ Collinear D C A := by intro h0 - exact cad_nd (perm_collinear_snd_trd_fst h0) + exact cad_nd (Collinear.perm₂₃₁ h0) --$E,B,C$ are collinear -lemma colin_ebc : collinear E B C := by +lemma colin_ebc : Collinear E B C := by have h : E LiesOn LIN C B := by rw [e_def] apply Line.inx_lies_on_fst - exact flip_collinear_fst_trd (Line.pt_pt_linear h) + exact Collinear.perm₃₂₁ (Line.pt_pt_linear h) --$E,D,A$ are collinear -lemma colin_eda : collinear E D A := by +lemma colin_eda : Collinear E D A := by have h : E LiesOn LIN A D := by rw [e_def] apply Line.inx_lies_on_snd - exact flip_collinear_fst_trd (Line.pt_pt_linear h) + exact Collinear.perm₃₂₁ (Line.pt_pt_linear h) --$C\ne E$ instance c_ne_e : PtNe C E := Fact.mk <| by - have h : collinear E D A := colin_eda + have h : Collinear E D A := colin_eda intro k rw [←k] at h - exact ncolin_dca (flip_collinear_fst_snd h) + exact ncolin_dca (Collinear.perm₂₁₃ h) --$EB/EC=S_{\trian}DBA/S_{\trian}DCA$ lemma dratio_ebc_eq_wedge_div_wedge : divratio E B C = (wedge D B A) / (wedge D C A) := ratio_eq_wedge_div_wedge_of_collinear_collinear_notcoliear E B C D A colin_ebc colin_eda ncolin_dca --$D,A,B$ are not collinear -lemma ncolin_dab : ¬ collinear D A B := by +lemma ncolin_dab : ¬ Collinear D A B := by intro h0 - exact abd_nd (perm_collinear_snd_trd_fst h0) + exact abd_nd (Collinear.perm₂₃₁ h0) --$F,C,A$ are collinear -lemma colin_fca : collinear F C A := by +lemma colin_fca : Collinear F C A := by have h : F LiesOn LIN A C := by rw [f_def] apply Line.inx_lies_on_fst - exact flip_collinear_fst_trd (Line.pt_pt_linear h) + exact Collinear.perm₃₂₁ (Line.pt_pt_linear h) --$F,D,B$ are collinear -lemma colin_fdb : collinear F D B := by +lemma colin_fdb : Collinear F D B := by have h : F LiesOn LIN B D := by rw [f_def] apply Line.inx_lies_on_snd - exact flip_collinear_fst_trd (Line.pt_pt_linear h) + exact Collinear.perm₃₂₁ (Line.pt_pt_linear h) --$A\ne F$ instance a_ne_f : PtNe A F := Fact.mk <| by - have h : collinear F D B := colin_fdb + have h : Collinear F D B := colin_fdb intro k rw [←k] at h - exact ncolin_dab (flip_collinear_fst_snd h) + exact ncolin_dab (Collinear.perm₂₁₃ h) --$FC/FA=S_{\trian}DCB/S_{\trian}DAB$ lemma dratio_fca_eq_wedge_div_wedge : divratio F C A = (wedge D C B) / (wedge D A B) := ratio_eq_wedge_div_wedge_of_collinear_collinear_notcoliear F C A D B colin_fca colin_fdb ncolin_dab --$D,B,C$ are not collinear -lemma ncolin_dbc : ¬ collinear D B C := by +lemma ncolin_dbc : ¬ Collinear D B C := by intro h0 - exact bcd_nd (perm_collinear_snd_trd_fst h0) + exact bcd_nd (Collinear.perm₂₃₁ h0) --$G,A,B$ are collinear -lemma colin_gab : collinear G A B := by +lemma colin_gab : Collinear G A B := by have h : G LiesOn LIN B A _ := by rw [g_def] apply Line.inx_lies_on_fst - exact flip_collinear_fst_trd (Line.pt_pt_linear h) + exact Collinear.perm₃₂₁ (Line.pt_pt_linear h) --$G,D,C$ are collinear -lemma colin_gdc : collinear G D C := by +lemma colin_gdc : Collinear G D C := by have h : G LiesOn LIN C D _ := by rw [g_def] apply Line.inx_lies_on_snd - exact flip_collinear_fst_trd (Line.pt_pt_linear h) + exact Collinear.perm₃₂₁ (Line.pt_pt_linear h) --$A\ne F$ instance b_ne_g : PtNe B G := Fact.mk <| by - have h : collinear G D C := colin_gdc + have h : Collinear G D C := colin_gdc intro k rw [←k] at h - exact ncolin_dbc (flip_collinear_fst_snd h) + exact ncolin_dbc (Collinear.perm₂₁₃ h) --$GA/GB=S_{\trian}DAC/S_{\trian}DBC$ lemma dratio_gab_eq_wedge_div_wedge : divratio G A B = (wedge D A C) / (wedge D B C) := ratio_eq_wedge_div_wedge_of_collinear_collinear_notcoliear G A B D C colin_gab colin_gdc ncolin_dbc @@ -155,9 +155,9 @@ lemma CevaCfg.ceva_theorem {P : Type*} [EuclideanPlane P] (cfg : CevaCfg P) : CevaCfgClass.ceva_theorem (cfg := cfg) variable {P : Type*} [EuclideanPlane P] {A B C D : P} - (abd_nd : ¬collinear A B D) - (bcd_nd : ¬collinear B C D) - (cad_nd : ¬collinear C A D) + (abd_nd : ¬Collinear A B D) + (bcd_nd : ¬Collinear B C D) + (cad_nd : ¬Collinear C A D) (ba_npara_cd : ¬ LIN B A (ne_of_not_collinear abd_nd).2.2.symm ∥ LIN C D (ne_of_not_collinear cad_nd).2.1.symm) (cb_npara_ad : ¬ LIN C B (ne_of_not_collinear bcd_nd).2.2.symm ∥ LIN A D (ne_of_not_collinear abd_nd).2.1.symm) (ac_npara_bd : ¬ LIN A C (ne_of_not_collinear cad_nd).2.2.symm ∥ LIN B D (ne_of_not_collinear bcd_nd).2.1.symm) diff --git a/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva_converse.lean b/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva_converse.lean index c9c5ff53..5b6da2ab 100644 --- a/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva_converse.lean +++ b/EuclideanGeometry/Foundation/Construction/ComputationTool/Ceva_converse.lean @@ -13,16 +13,16 @@ structure Setting (P : Type _) [EuclideanPlane P] where A : P B : P C : P - not_collinear_ABC : ¬ collinear A B C + not_collinear_ABC : ¬ Collinear A B C -- Let $E$ be a point on $BC$. E : P - collinear_EBC : collinear E B C + collinear_EBC : Collinear E B C -- Let $F$ be a point on $CA$. F : P - collinear_FCA : collinear F C A + collinear_FCA : Collinear F C A -- Let $G$ be a point on $AB$. G : P - collinear_GAB : collinear G A B + collinear_GAB : Collinear G A B -- Claim : $E \ne A$. E_ne_A : E ≠ A := TriangleND.points_ne_of_collinear_of_not_collinear1 not_collinear_ABC collinear_EBC -- Claim : $F \ne B$. @@ -64,11 +64,11 @@ theorem Ceva_converse_theorem {P : Type _} [EuclideanPlane P] (e : Setting P) : rw [h1] at ratiomul field_simp at ratiomul /- - have collinear_DAE : collinear e.A e.E D := Line.pt_pt_linear (TriangleND.points_ne_of_collinear_of_not_collinear1 e.not_collinear_ABC e.collinear_EBC) (Line.inx_lies_on_fst (TriangleND.not_parallel_of_not_collinear_of_collinear_collinear e.not_collinear_ABC e.collinear_EBC e.collinear_FCA)) + have collinear_DAE : Collinear e.A e.E D := Line.pt_pt_linear (TriangleND.points_ne_of_collinear_of_not_collinear1 e.not_collinear_ABC e.collinear_EBC) (Line.inx_lies_on_fst (TriangleND.not_parallel_of_not_collinear_of_collinear_collinear e.not_collinear_ABC e.collinear_EBC e.collinear_FCA)) -/ - have abd_nd : ¬ collinear e.A e.B D := (TriangleND.intersection_not_collinear_of_nondegenerate e.not_collinear_ABC e.collinear_EBC e.collinear_FCA E_ne_B E_ne_C F_ne_A F_ne_C D rfl).1 - have bcd_nd : ¬ collinear e.B e.C D := (TriangleND.intersection_not_collinear_of_nondegenerate e.not_collinear_ABC e.collinear_EBC e.collinear_FCA E_ne_B E_ne_C F_ne_A F_ne_C D rfl).2.1 - have cad_nd : ¬ collinear e.C e.A D := (TriangleND.intersection_not_collinear_of_nondegenerate e.not_collinear_ABC e.collinear_EBC e.collinear_FCA E_ne_B E_ne_C F_ne_A F_ne_C D rfl).2.2 + have abd_nd : ¬ Collinear e.A e.B D := (TriangleND.intersection_not_collinear_of_nondegenerate e.not_collinear_ABC e.collinear_EBC e.collinear_FCA E_ne_B E_ne_C F_ne_A F_ne_C D rfl).1 + have bcd_nd : ¬ Collinear e.B e.C D := (TriangleND.intersection_not_collinear_of_nondegenerate e.not_collinear_ABC e.collinear_EBC e.collinear_FCA E_ne_B E_ne_C F_ne_A F_ne_C D rfl).2.1 + have cad_nd : ¬ Collinear e.C e.A D := (TriangleND.intersection_not_collinear_of_nondegenerate e.not_collinear_ABC e.collinear_EBC e.collinear_FCA E_ne_B E_ne_C F_ne_A F_ne_C D rfl).2.2 sorry end Ceva's_converse_theorem diff --git a/EuclideanGeometry/Foundation/Construction/ComputationTool/Oarea_method.lean b/EuclideanGeometry/Foundation/Construction/ComputationTool/Oarea_method.lean index f838cc2c..40a3ee28 100644 --- a/EuclideanGeometry/Foundation/Construction/ComputationTool/Oarea_method.lean +++ b/EuclideanGeometry/Foundation/Construction/ComputationTool/Oarea_method.lean @@ -18,16 +18,16 @@ theorem wedge_add_wedge_eq_wedge_add_wedge (A B C D : P) : wedge A B C + wedge C rw [← Vec.det_skew (VEC A C) (VEC A B),← Vec.det_skew (VEC A D) (VEC A B), ← Vec.det_skew (VEC A D) (VEC A C)] ring -theorem wedge_eq_wedge_add_wedge_of_collinear (A B C D : P) (colin : collinear A B C) : wedge D A C = wedge D B C + wedge D A B := by - rw[← wedge231 D B C, ← wedge_add_wedge_eq_wedge_add_wedge,← wedge231 C D A, (collinear_iff_wedge_eq_zero A B C).mp colin] +theorem wedge_eq_wedge_add_wedge_of_collinear (A B C D : P) (colin : Collinear A B C) : wedge D A C = wedge D B C + wedge D A B := by + rw[← wedge312 D B C, ← wedge_add_wedge_eq_wedge_add_wedge,← wedge312 C D A, (collinear_iff_wedge_eq_zero A B C).mp colin] field_simp -theorem wedge_eq_divratio_mul_wedge_of_collinear (A B C D : P) (colin : collinear A B C) [cnea : PtNe C A] : wedge A B D = (divratio A B C) * wedge A C D := by +theorem wedge_eq_divratio_mul_wedge_of_collinear (A B C D : P) (colin : Collinear A B C) [cnea : PtNe C A] : wedge A B D = (divratio A B C) * wedge A C D := by unfold wedge rw [vec_eq_vec_smul_ratio A B C colin] simp only [map_smul, LinearMap.smul_apply, smul_eq_mul] -theorem odist_eq_divratio_mul_odist (A B C : P) (dl : DirLine P) (colin : collinear A B C) [cnea : PtNe C A] (aisondl : A LiesOn dl) : odist B dl = (divratio A B C) * odist C dl := by +theorem odist_eq_divratio_mul_odist (A B C : P) (dl : DirLine P) (colin : Collinear A B C) [cnea : PtNe C A] (aisondl : A LiesOn dl) : odist B dl = (divratio A B C) * odist C dl := by have h0 : odist' B (Ray.mk_pt_dirline A dl aisondl)= odist B (Ray.mk_pt_dirline A dl aisondl).toDirLine := rfl have h1 : odist B dl = odist' B (Ray.mk_pt_dirline A dl aisondl) := by rw[h0,ray_of_pt_dirline_toDirLine_eq_dirline A dl aisondl] @@ -40,11 +40,11 @@ theorem odist_eq_divratio_mul_odist (A B C : P) (dl : DirLine P) (colin : collin rw [h4, vec_eq_vec_smul_ratio A B C colin] simp only [map_smul, smul_eq_mul] -theorem wedge_eq_divratio_mul_wedge_of_collinear_collinear (A B C D E : P) (colin : collinear A B C) [cnea : PtNe C A] (colin' : collinear A D E) : wedge D B E = (divratio A B C) * wedge D C E := by - rw[← wedge231 D B E, wedge_eq_wedge_add_wedge_of_collinear E A D B (perm_collinear_trd_fst_snd colin'), ← wedge231 D C E, wedge_eq_wedge_add_wedge_of_collinear E A D C (perm_collinear_trd_fst_snd colin'), wedge213 A B D, wedge231 A B E, wedge213 A C D, wedge231 A C E,wedge_eq_divratio_mul_wedge_of_collinear A B C D colin,wedge_eq_divratio_mul_wedge_of_collinear A B C E colin] +theorem wedge_eq_divratio_mul_wedge_of_collinear_collinear (A B C D E : P) (colin : Collinear A B C) [cnea : PtNe C A] (colin' : Collinear A D E) : wedge D B E = (divratio A B C) * wedge D C E := by + rw[← wedge312 D B E, wedge_eq_wedge_add_wedge_of_collinear E A D B (Collinear.perm₃₁₂ colin'), ← wedge312 D C E, wedge_eq_wedge_add_wedge_of_collinear E A D C (Collinear.perm₃₁₂ colin'), wedge213 A B D, wedge312 A B E, wedge213 A C D, wedge312 A C E,wedge_eq_divratio_mul_wedge_of_collinear A B C D colin,wedge_eq_divratio_mul_wedge_of_collinear A B C E colin] ring -theorem ratio_eq_wedge_div_wedge_of_collinear_collinear_notcoliear (A B C D E : P) (colin : collinear A B C) [cnea : PtNe C A] (colin' : collinear A D E) (ncolin : ¬ collinear D C E) : divratio A B C = (wedge D B E) / (wedge D C E) := by +theorem ratio_eq_wedge_div_wedge_of_collinear_collinear_notcoliear (A B C D E : P) (colin : Collinear A B C) [cnea : PtNe C A] (colin' : Collinear A D E) (ncolin : ¬ Collinear D C E) : divratio A B C = (wedge D B E) / (wedge D C E) := by rw [wedge_eq_divratio_mul_wedge_of_collinear_collinear A B C D E colin colin'] have h0 : ¬ wedge D C E = 0 := by rw[(collinear_iff_wedge_eq_zero D C E).symm] diff --git a/EuclideanGeometry/Foundation/Construction/Polygon/Parallelogram.lean b/EuclideanGeometry/Foundation/Construction/Polygon/Parallelogram.lean index 424b374b..53436c17 100644 --- a/EuclideanGeometry/Foundation/Construction/Polygon/Parallelogram.lean +++ b/EuclideanGeometry/Foundation/Construction/Polygon/Parallelogram.lean @@ -34,18 +34,50 @@ In this section we define two types of parallelogram. 'parallel_nd' deals with t @[pp_dot] structure Quadrilateral_nd.Parallelogram_non_triv {P : Type _} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) : Prop where - not_collinear₁₂₃: ( ¬ collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) - not_collinear₂₃₄: ( ¬ collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) - not_collinear₃₄₁: ( ¬ collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) - not_collinear₄₁₂: ( ¬ collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) + not_collinear₁₂₃: ( ¬ Collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) + not_collinear₂₃₄: ( ¬ Collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) + not_collinear₃₄₁: ( ¬ Collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) + not_collinear₄₁₂: ( ¬ Collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) /-- A quadrilateral is called parallelogram if VEC qdr.point₁ qdr.point₂ = VEC qdr.point₄ qdr.point₃.-/ @[pp_dot] def Quadrilateral.IsParallelogram {P : Type _} [EuclideanPlane P] (qdr : Quadrilateral P) : Prop := VEC qdr.point₁ qdr.point₂ = VEC qdr.point₄ qdr.point₃ +lemma Quadrilateral.isParallelogram_def₁₂ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} : + qdr.IsParallelogram ↔ VEC qdr.point₁ qdr.point₂ = VEC qdr.point₄ qdr.point₃ := + .rfl + +alias ⟨Quadrilateral.IsParallelogram.elim₁₂, _⟩ := Quadrilateral.isParallelogram_def₁₂ + +lemma Quadrilateral.isParallelogram_def₂₁ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} : + qdr.IsParallelogram ↔ VEC qdr.point₂ qdr.point₁ = VEC qdr.point₃ qdr.point₄ := by + rw [← neg_inj, neg_vec, neg_vec, qdr.isParallelogram_def₁₂] + +alias ⟨Quadrilateral.IsParallelogram.elim₂₁, _⟩ := Quadrilateral.isParallelogram_def₂₁ + +lemma Quadrilateral.isParallelogram_def₃₂ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} : + qdr.IsParallelogram ↔ VEC qdr.point₃ qdr.point₂ = VEC qdr.point₄ qdr.point₁ := by + rw [isParallelogram_def₁₂] + dsimp [(VEC · ·)] + rw [← sub_eq_zero, ← sub_eq_zero (a := _ -ᵥ _), vsub_sub_vsub_comm] + +alias ⟨Quadrilateral.IsParallelogram.elim₃₂, _⟩ := Quadrilateral.isParallelogram_def₃₂ + +lemma Quadrilateral.isParallelogram_def₂₃ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} : + qdr.IsParallelogram ↔ VEC qdr.point₂ qdr.point₃ = VEC qdr.point₁ qdr.point₄ := by + rw [← neg_inj, neg_vec, neg_vec, qdr.isParallelogram_def₃₂] + +alias ⟨Quadrilateral.IsParallelogram.elim₂₃, _⟩ := Quadrilateral.isParallelogram_def₂₃ + +lemma Quadrilateral.isParallelogram_def₁₄ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} : + qdr.IsParallelogram ↔ VEC qdr.point₁ qdr.point₄ = VEC qdr.point₂ qdr.point₃ := by + rw [qdr.isParallelogram_def₂₃, eq_comm] + +alias ⟨Quadrilateral.IsParallelogram.elim₁₄, _⟩ := Quadrilateral.isParallelogram_def₁₄ + /-- A quadrilateral satisfies IsParallelogram_para if two sets of opposite sides are parallel respectively. -/ @[pp_dot] -def Quadrilateral_nd.IsParallelogram_para {P : Type _} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) : Prop := ( qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄) ∧ (qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃) +def Quadrilateral_nd.IsParallelogram_para {P : Type _} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) : Prop := ( qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄) ∧ (qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃) /-- A quadrilateral satisfies IsParallelogram_nd if it satisfies both IsParallelogram_para and Parallelogram_non_triv. It is now what we commonly call parallelogram.-/ @[pp_dot] @@ -74,18 +106,18 @@ structure Parallelogram_nd (P : Type _) [EuclideanPlane P] extends Quadrilateral is_parallelogram_non_triv : toQuadrilateral_nd IsParallelogram_non_triv /-- We would also like to introduce a shortcut in proving statements concerning parallelograms - that is permute, the same technique used in Quadrilateral.lean. If qdr IsParallelogram, then its permute also IsParallelogram. -/ -theorem qdr_is_parallelogram_permute_iff (P : Type _) [EuclideanPlane P] (qdr : Quadrilateral P) :(qdr.IsParallelogram) ↔ ((qdr.permute).IsParallelogram) := by +theorem qdr_is_parallelogram_permute_iff {P : Type*} [EuclideanPlane P] (qdr : Quadrilateral P) :(qdr.IsParallelogram) ↔ ((qdr.permute).IsParallelogram) := by sorry /-- If qdr IsParallelogram_nd, then its permute also IsParallelogram_nd. -/ -theorem qdr_is_parallelogram_nd_permute_iff (P : Type _) [EuclideanPlane P] (qdr : Quadrilateral P) :(qdr.IsParallelogram_nd) ↔ ((qdr.permute).IsParallelogram_nd) := by +theorem qdr_is_parallelogram_nd_permute_iff {P : Type*} [EuclideanPlane P] (qdr : Quadrilateral P) :(qdr.IsParallelogram_nd) ↔ ((qdr.permute).IsParallelogram_nd) := by sorry /-- If qdr_nd IsParallelogram, then its permute also IsParallelogram. -/ -theorem qdr_nd_is_parallelogram_permute_iff (P : Type _) [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) :(qdr_nd.IsParallelogram) ↔ ((qdr_nd.permute).IsParallelogram) := by sorry +theorem qdr_nd_is_parallelogram_permute_iff {P : Type*} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) :(qdr_nd.IsParallelogram) ↔ ((qdr_nd.permute).IsParallelogram) := by sorry /-- If qdr_nd IsParallelogram_nd, then its permute also IsParallelogram. -/ -theorem qdr_nd_is_parallelogram_nd_permute_iff (P : Type _) [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) :(qdr_nd.IsParallelogram_nd) ↔ ((qdr_nd.permute).IsParallelogram_nd) := by +theorem qdr_nd_is_parallelogram_nd_permute_iff {P : Type*} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) :(qdr_nd.IsParallelogram_nd) ↔ ((qdr_nd.permute).IsParallelogram_nd) := by constructor intro h unfold Quadrilateral_nd.IsParallelogram_nd @@ -94,20 +126,20 @@ theorem qdr_nd_is_parallelogram_nd_permute_iff (P : Type _) [EuclideanPlane P] ( unfold Quadrilateral_nd.IsParallelogram_para unfold Quadrilateral_nd.IsParallelogram_para at a rcases a with ⟨k,q⟩ - unfold parallel - unfold parallel at k q - have K₁: qdr_nd.permute.edge_nd₁₂.toProj = qdr_nd.edge_nd₂₃.toProj := by rfl - have K₂: qdr_nd.permute.edge_nd₃₄.toProj = qdr_nd.edge_nd₁₄.reverse.toProj := by rfl - have K₃: qdr_nd.edge_nd₁₄.reverse.toProj = qdr_nd.edge_nd₁₄.toProj := by apply SegND.toProj_of_rev_eq_toProj + unfold Parallel + unfold Parallel at k q + have K₁: qdr_nd.permute.edgeND₁₂.toProj = qdr_nd.edgeND₂₃.toProj := by rfl + have K₂: qdr_nd.permute.edgeND₃₄.toProj = qdr_nd.edgeND₄₁.toProj := by rfl + have K₃: qdr_nd.edgeND₄₁.toProj = qdr_nd.edgeND₄₁.reverse.toProj := by apply SegND.toProj_of_rev_eq_toProj.symm rw [K₃] at K₂ - have K₄: qdr_nd.permute.edge_nd₁₂.toProj = qdr_nd.permute.edge_nd₃₄.toProj := by + have K₄: qdr_nd.permute.edgeND₁₂.toProj = qdr_nd.permute.edgeND₃₄.toProj := by rw [K₁, K₂] exact q.symm - have K₅: qdr_nd.permute.edge_nd₁₄.toProj = qdr_nd.edge_nd₁₂.reverse.toProj := by rfl - have K₆: qdr_nd.edge_nd₁₂.reverse.toProj = qdr_nd.edge_nd₁₂.toProj := by apply SegND.toProj_of_rev_eq_toProj + have K₅: qdr_nd.permute.edgeND₄₁.reverse.toProj = qdr_nd.edgeND₁₂.reverse.toProj := by rfl + have K₆: qdr_nd.edgeND₁₂.reverse.toProj = qdr_nd.edgeND₁₂.toProj := by apply SegND.toProj_of_rev_eq_toProj rw [K₆] at K₅ - have K₇: qdr_nd.permute.edge_nd₂₃.toProj = qdr_nd.edge_nd₃₄.toProj := by rfl - have K₈: qdr_nd.permute.edge_nd₁₄.toProj = qdr_nd.permute.edge_nd₂₃.toProj := by + have K₇: qdr_nd.permute.edgeND₂₃.toProj = qdr_nd.edgeND₃₄.toProj := by rfl + have K₈: qdr_nd.permute.edgeND₄₁.reverse.toProj = qdr_nd.permute.edgeND₂₃.toProj := by rw [K₅, K₇] exact k constructor @@ -127,15 +159,15 @@ theorem qdr_nd_is_parallelogram_nd_permute_iff (P : Type _) [EuclideanPlane P] ( unfold Quadrilateral_nd.IsParallelogram_para unfold Quadrilateral_nd.IsParallelogram_para at a rcases a with ⟨k,q⟩ - unfold parallel - unfold parallel at k q - have K₂: qdr_nd.permute.edge_nd₃₄.toProj = qdr_nd.edge_nd₁₄.reverse.toProj := by rfl - have K₃: qdr_nd.edge_nd₁₄.reverse.toProj = qdr_nd.edge_nd₁₄.toProj := by apply SegND.toProj_of_rev_eq_toProj + unfold Parallel + unfold Parallel at k q + have K₂: qdr_nd.permute.edgeND₃₄.toProj = qdr_nd.edgeND₄₁.toProj := by rfl + have K₃: qdr_nd.edgeND₄₁.toProj = qdr_nd.edgeND₄₁.reverse.toProj := by apply SegND.toProj_of_rev_eq_toProj.symm rw [K₃] at K₂ - have K₅: qdr_nd.permute.edge_nd₁₄.toProj = qdr_nd.edge_nd₁₂.reverse.toProj := by rfl - have K₆: qdr_nd.edge_nd₁₂.reverse.toProj = qdr_nd.edge_nd₁₂.toProj := by apply SegND.toProj_of_rev_eq_toProj + have K₅: qdr_nd.permute.edgeND₄₁.reverse.toProj = qdr_nd.edgeND₁₂.reverse.toProj := by rfl + have K₆: qdr_nd.edgeND₁₂.reverse.toProj = qdr_nd.edgeND₁₂.toProj := by apply SegND.toProj_of_rev_eq_toProj rw [K₆] at K₅ - have K₇: qdr_nd.permute.edge_nd₂₃.toProj = qdr_nd.edge_nd₃₄.toProj := by rfl + have K₇: qdr_nd.permute.edgeND₂₃.toProj = qdr_nd.edgeND₃₄.toProj := by rfl constructor constructor exact (Eq.congr (id K₅.symm) K₇).mpr q @@ -148,178 +180,45 @@ theorem qdr_nd_is_parallelogram_nd_permute_iff (P : Type _) [EuclideanPlane P] ( exact z /-- If prg IsParallelogram_nd, then its permute also IsParallelogram_nd. -/ -theorem prg_is_parallelogram_nd_permute_iff (P : Type _) [EuclideanPlane P] (prg : Parallelogram P) :(prg.IsParallelogram_nd) ↔ ((prg.permute).IsParallelogram_nd) := by +theorem prg_is_parallelogram_nd_permute_iff {P : Type*} [EuclideanPlane P] (prg : Parallelogram P) :(prg.IsParallelogram_nd) ↔ ((prg.permute).IsParallelogram_nd) := by sorry /-- If qdr_nd is non-degenerate and is a parallelogram, and its 1st, 2nd and 3rd points are not collinear, then qdr_nd is a parallelogram_nd.-/ -theorem Parallelogram_not_collinear₁₂₃ (P : Type _) [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) : qdr_nd IsParallelogram_nd := by - - have hba : qdr_nd.point₂ ≠ qdr_nd.point₁ := by - unfold collinear at h - exact (ne_of_not_collinear h).2.2 - have hbc : qdr_nd.point₂ ≠ qdr_nd.point₃ :=by - exact (ne_of_not_collinear h).1.symm - have hca: qdr_nd.point₃ ≠ qdr_nd.point₁ :=by - exact (ne_of_not_collinear h).2.1.symm - have had : qdr_nd.point₁ ≠ qdr_nd.point₄ := by - by_contra k - unfold Quadrilateral.IsParallelogram at para - have o : VEC qdr_nd.point₁ qdr_nd.point₂ = VEC qdr_nd.point₁ qdr_nd.point₃ := by - simp only [para, k.symm] - rw [EuclidGeom.Vec.mkPtPt] at o - rw [EuclidGeom.Vec.mkPtPt] at o - have oo : qdr_nd.point₂= qdr_nd.point₃ := by - exact vsub_left_cancel o - exact hbc oo - - have hbd : qdr_nd.point₂ ≠ qdr_nd.point₄ := by - by_contra k₁ - unfold Quadrilateral.IsParallelogram at para - have o: VEC qdr_nd.point₁ qdr_nd.point₂ = VEC qdr_nd.point₂ qdr_nd.point₃ := by - simp[para,k₁.symm] - have oo: collinear qdr_nd.point₂ qdr_nd.point₁ qdr_nd.point₃ := by - have ooo:∃ t : ℝ,VEC qdr_nd.point₂ qdr_nd.point₃ = t • VEC qdr_nd.point₂ qdr_nd.point₁ := by - use -1 - simp only [neg_smul, one_smul, neg_vec] - rw[o] - exact collinear_of_vec_eq_smul_vec' ooo - simp only [flip_collinear_fst_snd oo, not_true_eq_false] at h - have hcd : qdr_nd.point₃ ≠ qdr_nd.point₄ := by - by_contra k₂ - have k₂₂ : VEC qdr_nd.point₄ qdr_nd.point₃=0 := by - simp only [k₂, vec_same_eq_zero] - unfold Quadrilateral.IsParallelogram at para - have k₂₃: qdr_nd.point₁=qdr_nd.point₂ :=by - rw [k₂₂] at para - simp only [para, (eq_iff_vec_eq_zero qdr_nd.point₁ qdr_nd.point₂).mpr, vec_same_eq_zero] - simp only [k₂₃.symm, ne_eq, not_true_eq_false] at hba - have t : ¬ collinear qdr_nd.point₂ qdr_nd.point₁ qdr_nd.point₃ := by - by_contra k - simp only [flip_collinear_fst_snd k, not_true_eq_false] at h - have x : ¬ collinear_of_nd (A := qdr_nd.point₂) (B := qdr_nd.point₁) (C := qdr_nd.point₃) := by - unfold collinear at t - simp only [hca, hbc, hba.symm, or_self, dite_false] at t - simp only [t, not_false_eq_true] - have l₁ : qdr_nd.edge_nd₁₂.toProj=VecND.toProj ⟨VEC qdr_nd.point₁ qdr_nd.point₂, _⟩ := by rfl - have l₁' : qdr_nd.edge_nd₁₂.toProj=VecND.toProj ⟨VEC qdr_nd.point₂ qdr_nd.point₁, (ne_iff_vec_ne_zero _ _).mp hba.symm⟩ := by - have y₁:VecND.toProj ⟨VEC qdr_nd.point₂ qdr_nd.point₁, (ne_iff_vec_ne_zero _ _).mp hba.symm⟩=VecND.toProj ⟨VEC qdr_nd.point₁ qdr_nd.point₂, (ne_iff_vec_ne_zero _ _).mp hba⟩ := by - have z₁: VEC qdr_nd.point₂ qdr_nd.point₁ =- VEC qdr_nd.point₁ qdr_nd.point₂ := by - simp only [neg_vec] - simp only [ne_eq, z₁, VecND.mk_neg', VecND.neg_toProj] - simp only [l₁, ne_eq, y₁] - have l₂ : qdr_nd.edge_nd₂₃.toProj=VecND.toProj ⟨VEC qdr_nd.point₂ qdr_nd.point₃, _⟩ := by rfl - have l₂' : qdr_nd.edge_nd₂₃.toProj=VecND.toProj ⟨VEC qdr_nd.point₃ qdr_nd.point₂, (ne_iff_vec_ne_zero _ _).mp hbc⟩ := by - have y₂:VecND.toProj ⟨VEC qdr_nd.point₃ qdr_nd.point₂, (ne_iff_vec_ne_zero _ _).mp hbc⟩=VecND.toProj ⟨VEC qdr_nd.point₂ qdr_nd.point₃, (ne_iff_vec_ne_zero _ _).mp hbc.symm⟩ := by - have z₂: VEC qdr_nd.point₃ qdr_nd.point₂ =- VEC qdr_nd.point₂ qdr_nd.point₃ := by - simp only[neg_vec] - simp only [ne_eq, z₂, VecND.mk_neg', VecND.neg_toProj] - simp only [l₂, ne_eq, y₂] - have l₃ : qdr_nd.edge_nd₃₄.toProj=VecND.toProj ⟨VEC qdr_nd.point₃ qdr_nd.point₄, _⟩ := by rfl - have l₃' : qdr_nd.edge_nd₃₄.toProj=VecND.toProj ⟨VEC qdr_nd.point₄ qdr_nd.point₃, (ne_iff_vec_ne_zero _ _).mp hcd⟩ := by - have y₃:VecND.toProj ⟨VEC qdr_nd.point₄ qdr_nd.point₃, (ne_iff_vec_ne_zero _ _).mp hcd⟩=VecND.toProj ⟨VEC qdr_nd.point₃ qdr_nd.point₄, (ne_iff_vec_ne_zero _ _).mp hcd.symm⟩ := by - have z₃: VEC qdr_nd.point₄ qdr_nd.point₃ =- VEC qdr_nd.point₃ qdr_nd.point₄ := by - simp only [neg_vec] - simp only [ne_eq, z₃, VecND.mk_neg', VecND.neg_toProj] - simp only [l₃, ne_eq, y₃] - have l₄ : qdr_nd.edge_nd₁₄.toProj=VecND.toProj ⟨VEC qdr_nd.point₁ qdr_nd.point₄, _⟩ := by rfl - have l₄' : qdr_nd.edge_nd₁₄.toProj=VecND.toProj ⟨VEC qdr_nd.point₄ qdr_nd.point₁, (ne_iff_vec_ne_zero _ _).mp had⟩ := by - have y₄:VecND.toProj ⟨VEC qdr_nd.point₄ qdr_nd.point₁, (ne_iff_vec_ne_zero _ _).mp had⟩=VecND.toProj ⟨VEC qdr_nd.point₁ qdr_nd.point₄, (ne_iff_vec_ne_zero _ _).mp had.symm⟩ := by - have z₄: VEC qdr_nd.point₄ qdr_nd.point₁ =- VEC qdr_nd.point₁ qdr_nd.point₄ := by - simp [neg_vec] - simp only [ne_eq, z₄, VecND.mk_neg', VecND.neg_toProj] - simp only [l₄, ne_eq, y₄] - have s : ¬ qdr_nd.edge_nd₁₂.toProj = qdr_nd.edge_nd₂₃.toProj := by - unfold collinear_of_nd at x - simp only [l₁', ne_eq, l₂] - exact x - have v₁ : qdr_nd.edge_nd₁₂.toProj = qdr_nd.edge_nd₃₄.toProj := by - unfold Quadrilateral.IsParallelogram at para - have v₁₁₁:VecND.toProj ⟨VEC qdr_nd.point₁ qdr_nd.point₂, (ne_iff_vec_ne_zero _ _).mp hba⟩ = VecND.toProj ⟨VEC qdr_nd.point₄ qdr_nd.point₃, (ne_iff_vec_ne_zero _ _).mp hcd⟩ := by - simp only [ne_eq, para] - simp only [l₁, ne_eq, v₁₁₁, l₃'] - have v₁₁ : toProj qdr_nd.edge_nd₁₂ = toProj qdr_nd.edge_nd₃₄ := by exact v₁ - have v₂ : qdr_nd.edge_nd₂₃.toProj = qdr_nd.edge_nd₁₄.toProj := by - unfold Quadrilateral.IsParallelogram at para - have v₂₂: VEC qdr_nd.point₁ qdr_nd.point₄ = VEC qdr_nd.point₂ qdr_nd.point₃ := by - rw [← vec_add_vec qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₄] - rw [← vec_add_vec qdr_nd.point₂ qdr_nd.point₄ qdr_nd.point₃] - rw [para] - exact add_comm (VEC qdr_nd.point₄ qdr_nd.point₃) (VEC qdr_nd.point₂ qdr_nd.point₄) - simp only [l₂, ne_eq, v₂₂, l₄] - have v₂₁ : toProj qdr_nd.edge_nd₂₃ = toProj qdr_nd.edge_nd₁₄ := by exact v₂ - have s₁ : ¬ qdr_nd.edge_nd₁₂.toProj = qdr_nd.edge_nd₂₃.toProj := by - by_contra k₃ - have k₃₃: collinear_of_nd (A := qdr_nd.point₂) (B := qdr_nd.point₁) (C := qdr_nd.point₃) := by - rw[l₁',l₂] at k₃ - exact k₃ - have k₃₄: collinear qdr_nd.point₂ qdr_nd.point₁ qdr_nd.point₃ := by - unfold collinear - simp only [hca, hbc, hba.symm, or_self, k₃₃, dite_eq_ite, ite_self] - simp only [k₃₄, not_true_eq_false] at t - have s₂ : ¬ qdr_nd.edge_nd₂₃.toProj = qdr_nd.edge_nd₃₄.toProj := by - rw [v₁.symm] - by_contra k - exact s k.symm - have s₃ : ¬ qdr_nd.edge_nd₃₄.toProj = qdr_nd.edge_nd₁₄.toProj := by - rw [v₂.symm] - by_contra k - exact s₂ k.symm - have s₄ : ¬ qdr_nd.edge_nd₁₄.toProj = qdr_nd.edge_nd₁₂.toProj := by - rw[v₁] - by_contra k - exact s₃ k.symm - constructor - constructor - unfold parallel - simp only [v₁₁] - unfold parallel - simp only [v₂₁] - constructor - simp only [h, not_false_eq_true] - by_contra m₃ - have m₂ : ¬ collinear qdr_nd.point₃ qdr_nd.point₂ qdr_nd.point₄ := by - by_contra k₁ - unfold collinear at k₁ - simp [hbd.symm,hcd,hbc] at k₁ - unfold collinear_of_nd at k₁ - have p₄:qdr_nd.edge_nd₂₃.toProj = qdr_nd.edge_nd₃₄.toProj := by - rw[l₂',l₃] - exact k₁ - simp[p₄] at s₂ - simp [flip_collinear_fst_snd m₃] at m₂ - by_contra m₅ - have m₄ : ¬ collinear qdr_nd.point₄ qdr_nd.point₃ qdr_nd.point₁ := by - by_contra k₂ - unfold collinear at k₂ - simp [hca.symm,hcd,had.symm] at k₂ - unfold collinear_of_nd at k₂ - have p₅:qdr_nd.edge_nd₃₄.toProj = qdr_nd.edge_nd₁₄.toProj := by - rw[l₄',l₃'] - exact k₂ - simp[p₅] at s₃ - simp [flip_collinear_fst_snd m₅] at m₄ - by_contra m₇ - have m₆ : ¬ collinear qdr_nd.point₁ qdr_nd.point₄ qdr_nd.point₂ := by - by_contra k₃ - unfold collinear at k₃ - simp [hbd,hba.symm,had.symm] at k₃ - unfold collinear_of_nd at k₃ - have p₆:qdr_nd.edge_nd₁₄.toProj = qdr_nd.edge_nd₁₂.toProj := by - rw[l₄,l₁] - exact k₃ - simp [p₆] at s₄ - simp [flip_collinear_fst_snd m₇] at m₆ +theorem Parallelogram_not_collinear₁₂₃ {P : Type*} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ Collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) : qdr_nd IsParallelogram_nd := by + constructor + · constructor + · rw [parallel_iff_wedge_eq_wedge_left] + dsimp + rw [← wedge_smul_vec_self_vadd _ _ _ (-1), para] + simp + · rw [parallel_iff_wedge_eq_wedge_left] + dsimp + rw [← wedge_smul_vec_self_vadd _ _ _ 1, para.elim₁₄] + simp [wedge132 _ _ qdr_nd.point₄] + · have h₂₃₄ : ¬Collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ + · rwa [collinear231, collinear_iff_collinear] at h + use 1 + rw [para.elim₁₄, one_smul] + have h₃₄₁ : ¬Collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁ + · rwa [collinear231, collinear_iff_collinear] at h₂₃₄ + use 1 + rw [para.elim₂₁, one_smul] + have h₄₁₂ : ¬Collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ + · rwa [collinear231, collinear_iff_collinear] at h₃₄₁ + use 1 + rw [para.elim₃₂, one_smul] + constructor <;> assumption /-- If qdr_nd is non-degenerate and is a parallelogram, and its 2nd, 3rd and 4th points are not collinear, then qdr_nd is a parallelogram_nd.-/ -theorem Parallelogram_not_collinear₂₃₄ (P : Type _) [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) : qdr_nd IsParallelogram_nd := by +theorem Parallelogram_not_collinear₂₃₄ {P : Type*} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ Collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) : qdr_nd IsParallelogram_nd := by sorry /-- If qdr_nd is non-degenerate and is a parallelogram, and its 3rd, 4th and 1st points are not collinear, then qdr_nd is a parallelogram_nd.-/ -theorem Parallelogram_not_collinear₃₄₁ (P : Type _) [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) : qdr_nd IsParallelogram_nd := by +theorem Parallelogram_not_collinear₃₄₁ {P : Type*} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ Collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) : qdr_nd IsParallelogram_nd := by sorry /-- If qdr_nd is non-degenerate and is a parallelogram, and its 4th, 1st and 2nd points are not collinear, then qdr_nd is a parallelogram_nd.-/ -theorem Parallelogram_not_collinear₄₁₂ (P : Type _) [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) : qdr_nd IsParallelogram_nd := by +theorem Parallelogram_not_collinear₄₁₂ {P : Type*} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) (para: qdr_nd.1 IsParallelogram) (h: ¬ Collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) : qdr_nd IsParallelogram_nd := by sorry /-- Make a parallelogram with 4 points on a plane.-/ @@ -328,7 +227,7 @@ def Parallelogram.mk_pt_pt_pt_pt {P : Type _} [EuclideanPlane P] (A B C D : P) ( is_parallelogram := h /-- Make a parallelogram_nd with 4 points on a plane, and using condition non_collinear₁₂₃.-/ -def Parallelogram_nd.mk_pt_pt_pt_pt₄ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₁₂₃: ¬ collinear A B C) : Parallelogram_nd P where +def Parallelogram_nd.mk_pt_pt_pt_pt₄ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₁₂₃: ¬ Collinear A B C) : Parallelogram_nd P where toQuadrilateral := (QDR A B C D) is_parallelogram := h' nd := h @@ -336,7 +235,7 @@ def Parallelogram_nd.mk_pt_pt_pt_pt₄ {P : Type _} [EuclideanPlane P] (A B C D is_parallelogram_non_triv := sorry /-- Make a parallelogram_nd with 4 points on a plane, and using condition non_collinear₂₃₄.-/ -def Parallelogram_nd.mk_pt_pt_pt_pt₁ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₂₃₄: ¬ collinear B C D) : Parallelogram_nd P where +def Parallelogram_nd.mk_pt_pt_pt_pt₁ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₂₃₄: ¬ Collinear B C D) : Parallelogram_nd P where toQuadrilateral := (QDR A B C D) is_parallelogram := h' nd := h @@ -344,7 +243,7 @@ def Parallelogram_nd.mk_pt_pt_pt_pt₁ {P : Type _} [EuclideanPlane P] (A B C D is_parallelogram_non_triv := sorry /-- Make a parallelogram_nd with 4 points on a plane, and using condition non_collinear₃₄₁.-/ -def Parallelogram_nd.mk_pt_pt_pt_pt₂ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₃₄₁: ¬ collinear C D A) : Parallelogram_nd P where +def Parallelogram_nd.mk_pt_pt_pt_pt₂ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₃₄₁: ¬ Collinear C D A) : Parallelogram_nd P where toQuadrilateral := (QDR A B C D) is_parallelogram := h' nd := h @@ -352,7 +251,7 @@ def Parallelogram_nd.mk_pt_pt_pt_pt₂ {P : Type _} [EuclideanPlane P] (A B C D is_parallelogram_non_triv := sorry /-- Make a parallelogram_nd with 4 points on a plane, and using condition non_collinear₄₁₂.-/ -def Parallelogram_nd.mk_pt_pt_pt_pt₃ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₄₁₂: ¬ collinear D A B) : Parallelogram_nd P where +def Parallelogram_nd.mk_pt_pt_pt_pt₃ {P : Type _} [EuclideanPlane P] (A B C D : P) (h : (QDR A B C D).IsND) (h': (QDR A B C D) IsParallelogram) (non_collinear₄₁₂: ¬ Collinear D A B) : Parallelogram_nd P where toQuadrilateral := (QDR A B C D) is_parallelogram := h' nd := h @@ -380,7 +279,7 @@ def mk_parallelogram {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h is_parallelogram := h /-- Make parallelogram_nd with a quadrilateral, using condition non_collinear₁₂₃.-/ -def mk_parallelogram_nd₄ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₁₂₃: ¬ collinear qdr.1 qdr.2 qdr.3) : Parallelogram_nd P where +def mk_parallelogram_nd₄ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₁₂₃: ¬ Collinear qdr.1 qdr.2 qdr.3) : Parallelogram_nd P where toQuadrilateral := qdr is_parallelogram := h nd := h' @@ -388,7 +287,7 @@ def mk_parallelogram_nd₄ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral is_parallelogram_non_triv := sorry /-- Make parallelogram_nd with a quadrilateral, using condition non_collinear₂₃₄.-/ -def mk_parallelogram_nd₁ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₂₃₄: ¬ collinear qdr.2 qdr.3 qdr.4) : Parallelogram_nd P where +def mk_parallelogram_nd₁ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₂₃₄: ¬ Collinear qdr.2 qdr.3 qdr.4) : Parallelogram_nd P where toQuadrilateral := qdr is_parallelogram := h nd := h' @@ -396,7 +295,7 @@ def mk_parallelogram_nd₁ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral is_parallelogram_non_triv := sorry /-- Make parallelogram_nd with a quadrilateral, using condition non_collinear₃₁₄.-/ -def mk_parallelogram_nd₂ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₃₄₁: ¬ collinear qdr.3 qdr.4 qdr.1) : Parallelogram_nd P where +def mk_parallelogram_nd₂ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₃₄₁: ¬ Collinear qdr.3 qdr.4 qdr.1) : Parallelogram_nd P where toQuadrilateral := qdr is_parallelogram := h nd := h' @@ -404,7 +303,7 @@ def mk_parallelogram_nd₂ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral is_parallelogram_non_triv := sorry /-- Make parallelogram_nd with a quadrilateral, using condition non_collinear₄₁₂.-/ -def mk_parallelogram_nd₃ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₄₁₂: ¬ collinear qdr.4 qdr.1 qdr.2) : Parallelogram_nd P where +def mk_parallelogram_nd₃ {P : Type _} [EuclideanPlane P] {qdr : Quadrilateral P} (h : qdr IsParallelogram) (h': qdr.IsND) (non_collinear₄₁₂: ¬ Collinear qdr.4 qdr.1 qdr.2) : Parallelogram_nd P where toQuadrilateral := qdr is_parallelogram := h nd := h' @@ -442,8 +341,8 @@ variable {P : Type _} [EuclideanPlane P] variable {A B C D : P} (nd : (QDR A B C D).IsND) (cvx : (QDR A B C D).IsConvex) variable (qdr : Quadrilateral P) (qdr_nd : Quadrilateral_nd P) (qdr_cvx : Quadrilateral_cvx P) -/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄, qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃, and qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄) (h₂ : qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃) (notcollinear : ¬ collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) : qdr_nd.IsParallelogram_nd := by +/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄, qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃, and qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃ is not collinear, then qdr_nd is a Parallelogram_nd. -/ +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄) (h₂ : qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃) (notcollinear : ¬ Collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) : qdr_nd.IsParallelogram_nd := by have para_vec (Vec1 Vec2 : VecND) (para : Vec1 ∥ Vec2) : ∃ c : ℝ , (Vec1 : Vec) = c • (Vec2 : Vec) := by apply VecND.toProj_eq_toProj_iff.mp exact para @@ -455,9 +354,9 @@ theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edge rw [collinear_iff_eq_smul_vec_of_ne] at iscollinear rcases iscollinear with ⟨r,eq⟩ apply notcollinear - have para : qdr_nd.edge_nd₁₄.toVecND ∥ qdr_nd.edge_nd₂₃.toVecND := by sorry + have para : qdr_nd.edgeND₄₁.reverse.toVecND ∥ qdr_nd.edgeND₂₃.toVecND := by sorry rw [collinear_iff_eq_smul_vec_of_ne] - rcases (para_vec qdr_nd.edge_nd₁₄.toVecND qdr_nd.edge_nd₂₃.toVecND para) with ⟨c,eq'⟩ + rcases (para_vec qdr_nd.edgeND₄₁.reverse.toVecND qdr_nd.edgeND₂₃.toVecND para) with ⟨c,eq'⟩ have eq'' : (VEC qdr_nd.point₁ qdr_nd.point₄) = c • (VEC qdr_nd.point₂ qdr_nd.point₃) := eq' have l₁ : (VEC qdr_nd.point₁ qdr_nd.point₂) = (c - r) • (VEC qdr_nd.point₂ qdr_nd.point₃) := by rw [(vec_sub_vec' qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂).symm] @@ -470,7 +369,7 @@ theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edge by_contra is_zero rw [is_zero] at l₁ have not_nd₁₂ : qdr_nd.point₂ = qdr_nd.point₁ := by - apply (eq_iff_vec_eq_zero qdr_nd.point₁ qdr_nd.point₂).mpr + apply eq_iff_vec_eq_zero.mpr rw [l₁] exact zero_smul ℝ (VEC qdr_nd.point₂ qdr_nd.point₃) exact qdr_nd.nd₁₂.out not_nd₁₂ @@ -484,21 +383,21 @@ theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edge rw [collinear_iff_eq_smul_vec_of_ne] rw [collinear_iff_eq_smul_vec_of_ne] at iscollinear rcases iscollinear with ⟨r,eq⟩ - have para : qdr_nd.edge_nd₃₄.toVecND ∥ qdr_nd.edge_nd₁₂.toVecND := by sorry - rcases (para_vec qdr_nd.edge_nd₃₄.toVecND qdr_nd.edge_nd₁₂.toVecND para) with ⟨c,eq'⟩ + have para : qdr_nd.edgeND₃₄.toVecND ∥ qdr_nd.edgeND₁₂.toVecND := by sorry + rcases (para_vec qdr_nd.edgeND₃₄.toVecND qdr_nd.edgeND₁₂.toVecND para) with ⟨c,eq'⟩ have eq'' : (VEC qdr_nd.point₃ qdr_nd.point₄) = c • (VEC qdr_nd.point₁ qdr_nd.point₂) := eq' use - r * c rw [(smul_smul (- r) c (VEC qdr_nd.point₁ qdr_nd.point₂)).symm,eq''.symm,neg_smul,eq.symm] exact (neg_vec qdr_nd.point₃ qdr_nd.point₁).symm by_contra iscollinear - apply flip_collinear_fst_trd at iscollinear + apply Collinear.perm₃₂₁ at iscollinear rw [collinear_iff_eq_smul_vec_of_ne] at iscollinear rcases iscollinear with ⟨r,eq⟩ apply notcollinear - have para : qdr_nd.edge_nd₃₄.toVecND ∥ qdr_nd.edge_nd₁₂.toVecND := by sorry - apply flip_collinear_fst_trd + have para : qdr_nd.edgeND₃₄.toVecND ∥ qdr_nd.edgeND₁₂.toVecND := by sorry + apply Collinear.perm₃₂₁ rw [collinear_iff_eq_smul_vec_of_ne] - rcases (para_vec qdr_nd.edge_nd₃₄.toVecND qdr_nd.edge_nd₁₂.toVecND para) with ⟨c,eq'⟩ + rcases (para_vec qdr_nd.edgeND₃₄.toVecND qdr_nd.edgeND₁₂.toVecND para) with ⟨c,eq'⟩ have eq'' : (VEC qdr_nd.point₃ qdr_nd.point₄) = c • (VEC qdr_nd.point₁ qdr_nd.point₂) := eq' have l₁ : (VEC qdr_nd.point₃ qdr_nd.point₂) = (r + c) • (VEC qdr_nd.point₁ qdr_nd.point₂) := by rw [(vec_sub_vec' qdr_nd.point₄ qdr_nd.point₃ qdr_nd.point₂).symm] @@ -512,7 +411,7 @@ theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edge by_contra is_zero rw [is_zero] at l₁ have not_nd₂₃ : qdr_nd.point₂ = qdr_nd.point₃ := by - apply (eq_iff_vec_eq_zero qdr_nd.point₃ qdr_nd.point₂).mpr + apply eq_iff_vec_eq_zero.mpr rw [l₁] exact zero_smul ℝ (VEC qdr_nd.point₁ qdr_nd.point₂) exact qdr_nd.nd₂₃.out not_nd₂₃.symm @@ -523,58 +422,58 @@ theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (h₁ : qdr_nd.edge exact ne_zero t /-- Given four points ABCD and Quadrilateral ABCD IsNd, AB ∥ CD, AD ∥ BC, and A B C is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ collinear A B C) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ Collinear A B C) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ (QDR_nd A B C D nd) h₁ h₂ notcollinear -/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄, qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃, and qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄ (h₁ : qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄) (h₂ : qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃) (notcollinear : ¬ collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) : qdr_nd.IsParallelogram_nd := (qdr_nd_is_parallelogram_nd_permute_iff P qdr_nd).mpr (qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ qdr_nd.permute (SegND.para_rev_of_para h₂.symm) (SegND.para_rev_of_para h₁.symm).symm notcollinear) +/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄, qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃, and qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ is not collinear, then qdr_nd is a Parallelogram_nd. -/ +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄ (h₁ : qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄) (h₂ : qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃) (notcollinear : ¬ Collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) : qdr_nd.IsParallelogram_nd := (qdr_nd_is_parallelogram_nd_permute_iff qdr_nd).mpr (qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ qdr_nd.permute (SegND.para_rev_of_para h₂.symm) (SegND.para_rev_of_para h₁.symm).symm notcollinear) /-- Given four points ABCD and Quadrilateral ABCD IsNd, AB ∥ CD, AD ∥ BC, and B C D is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ collinear B C D) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ Collinear B C D) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄ (QDR_nd A B C D nd) h₁ h₂ notcollinear -/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄, qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃, and qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁ (h₁ : qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄) (h₂ : qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃) (notcollinear : ¬ collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) : qdr_nd.IsParallelogram_nd := (qdr_nd_is_parallelogram_nd_permute_iff P qdr_nd).mpr (qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄ qdr_nd.permute (SegND.para_rev_of_para h₂.symm) (SegND.para_rev_of_para h₁.symm).symm notcollinear) +/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄, qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃, and qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁ is not collinear, then qdr_nd is a Parallelogram_nd. -/ +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁ (h₁ : qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄) (h₂ : qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃) (notcollinear : ¬ Collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) : qdr_nd.IsParallelogram_nd := (qdr_nd_is_parallelogram_nd_permute_iff qdr_nd).mpr (qdr_nd_is_prg_nd_of_para_para_not_collinear₂₃₄ qdr_nd.permute (SegND.para_rev_of_para h₂.symm) (SegND.para_rev_of_para h₁.symm).symm notcollinear) /-- Given four points ABCD and Quadrilateral ABCD IsNd, AB ∥ CD, AD ∥ BC, and C D A is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ collinear C D A) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ Collinear C D A) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁ (QDR_nd A B C D nd) h₁ h₂ notcollinear -/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄, qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃, and qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₄₁₂ (h₁ : qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄) (h₂ : qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃) (notcollinear : ¬ collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) : qdr_nd.IsParallelogram_nd := (qdr_nd_is_parallelogram_nd_permute_iff P qdr_nd).mpr (qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁ qdr_nd.permute (SegND.para_rev_of_para h₂.symm) (SegND.para_rev_of_para h₁.symm).symm notcollinear) +/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄, qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃, and qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ is not collinear, then qdr_nd is a Parallelogram_nd. -/ +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₄₁₂ (h₁ : qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄) (h₂ : qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃) (notcollinear : ¬ Collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) : qdr_nd.IsParallelogram_nd := (qdr_nd_is_parallelogram_nd_permute_iff qdr_nd).mpr (qdr_nd_is_prg_nd_of_para_para_not_collinear₃₄₁ qdr_nd.permute (SegND.para_rev_of_para h₂.symm) (SegND.para_rev_of_para h₁.symm).symm notcollinear) /-- Given four points ABCD and Quadrilateral ABCD IsNd, AB ∥ CD, AD ∥ BC, and D A B is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₄₁₂_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ collinear D A B) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₄₁₂ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_para_para_not_collinear₄₁₂_variant (h₁ : (SEG_nd A B (QDR_nd A B C D nd).nd₁₂.out) ∥ (SEG_nd C D (QDR_nd A B C D nd).nd₃₄.out)) (h₂ : (SEG_nd A D (QDR_nd A B C D nd).nd₁₄.out) ∥ (SEG_nd B C (QDR_nd A B C D nd).nd₂₃.out)) (notcollinear : ¬ Collinear D A B) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_para_para_not_collinear₄₁₂ (QDR_nd A B C D nd) h₁ h₂ notcollinear /-- Given Quadrilateral_nd qdr_nd, qdr_nd.angle₁.value = qdr_nd.angle₃.value, qdr_nd.angle₂.value = qdr_nd.angle₄.value, and qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₁₂₃ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) : qdr_nd.IsParallelogram_nd := by +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₁₂₃ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ Collinear qdr_nd.point₁ qdr_nd.point₂ qdr_nd.point₃) : qdr_nd.IsParallelogram_nd := by apply qdr_nd_is_prg_nd_of_para_para_not_collinear₁₂₃ sorry sorry exact notcollinear /-- Given four points ABCD and Quadrilateral ABCD IsNd, ∠DAB = ∠BCD, ∠ABC = ∠CDA, and A B C is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₁₂₃_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ collinear A B C) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₁₂₃ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₁₂₃_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ Collinear A B C) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₁₂₃ (QDR_nd A B C D nd) h₁ h₂ notcollinear /-- Given Quadrilateral_nd qdr_nd, qdr_nd.angle₁.value = qdr_nd.angle₃.value, qdr_nd.angle₂.value = qdr_nd.angle₄.value, and qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₂₃₄ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) : qdr_nd.IsParallelogram_nd := by sorry +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₂₃₄ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ Collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄) : qdr_nd.IsParallelogram_nd := by sorry /-- Given four points ABCD and Quadrilateral ABCD IsNd, ∠DAB = ∠BCD, ∠ABC = ∠CDA, and B C D is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₂₃₄_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ collinear B C D) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₂₃₄ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₂₃₄_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ Collinear B C D) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₂₃₄ (QDR_nd A B C D nd) h₁ h₂ notcollinear /-- Given Quadrilateral_nd qdr_nd, qdr_nd.angle₁.value = qdr_nd.angle₃.value, qdr_nd.angle₂.value = qdr_nd.angle₄.value, and qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₃₄₁ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) : qdr_nd.IsParallelogram_nd := by sorry +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₃₄₁ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ Collinear qdr_nd.point₃ qdr_nd.point₄ qdr_nd.point₁) : qdr_nd.IsParallelogram_nd := by sorry /-- Given four points ABCD and Quadrilateral ABCD IsNd, ∠DAB = ∠BCD, ∠ABC = ∠CDA, and C D A is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₃₄₁_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ collinear C D A) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₃₄₁ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₃₄₁_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ Collinear C D A) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₃₄₁ (QDR_nd A B C D nd) h₁ h₂ notcollinear /-- Given Quadrilateral_nd qdr_nd, qdr_nd.angle₁.value = qdr_nd.angle₃.value, qdr_nd.angle₂.value = qdr_nd.angle₄.value, and qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ is not collinear, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₄₁₂ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) : qdr_nd.IsParallelogram_nd := by sorry +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₄₁₂ (h₁ : qdr_nd.angle₁.value = qdr_nd.angle₃.value) (h₂ : qdr_nd.angle₂.value = qdr_nd.angle₄.value) (notcollinear : ¬ Collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂) : qdr_nd.IsParallelogram_nd := by sorry /-- Given four points ABCD and Quadrilateral ABCD IsNd, ∠DAB = ∠BCD, ∠ABC = ∠CDA, and D A B is not collinear, then Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₄₁₂_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ collinear D A B) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₄₁₂ (QDR_nd A B C D nd) h₁ h₂ notcollinear +theorem qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₄₁₂_variant (h₁ : (ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value = (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value) (h₂ : (ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value = (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value) (notcollinear : ¬ Collinear D A B) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_angle_value_eq_angle_value_not_collinear₄₁₂ (QDR_nd A B C D nd) h₁ h₂ notcollinear -/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edge_nd₁₂.length = qdr_nd.edge_nd₃₄.length, qdr_nd.edge_nd₁₄.length = qdr_nd.edge_nd₂₃.length, the signs of qdr_nd.angle₁ and qdr_nd.angle₃ are equal, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign (h₁ : qdr_nd.edge_nd₁₂.length = qdr_nd.edge_nd₃₄.length) (h₂ : qdr_nd.edge_nd₁₄.length = qdr_nd.edge_nd₂₃.length) (h : (qdr_nd.angle₁.value.IsPos ∧ qdr_nd.angle₃.value.IsPos) ∨ (qdr_nd.angle₁.value.IsNeg ∧ qdr_nd.angle₃.value.IsNeg)) : qdr_nd.IsParallelogram_nd := by - have nontriv₄₁₂ : ¬ collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ := by sorry - have nontriv₂₃₄ : ¬ collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ := by sorry +/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edgeND₁₂.length = qdr_nd.edgeND₃₄.length, qdr_nd.edgeND₄₁.reverse.length = qdr_nd.edgeND₂₃.length, the signs of qdr_nd.angle₁ and qdr_nd.angle₃ are equal, then qdr_nd is a Parallelogram_nd. -/ +theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign (h₁ : qdr_nd.edgeND₁₂.length = qdr_nd.edgeND₃₄.length) (h₂ : qdr_nd.edgeND₄₁.reverse.length = qdr_nd.edgeND₂₃.length) (h : (qdr_nd.angle₁.value.IsPos ∧ qdr_nd.angle₃.value.IsPos) ∨ (qdr_nd.angle₁.value.IsNeg ∧ qdr_nd.angle₃.value.IsNeg)) : qdr_nd.IsParallelogram_nd := by + have nontriv₄₁₂ : ¬ Collinear qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ := by sorry + have nontriv₂₃₄ : ¬ Collinear qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ := by sorry have nd₂₄ : qdr_nd.point₄ ≠ qdr_nd.point₂ := by sorry have tr_nd₁ : TriangleND P := (TRI_nd qdr_nd.point₄ qdr_nd.point₁ qdr_nd.point₂ nontriv₄₁₂) have tr_nd₂ : TriangleND P := (TRI_nd qdr_nd.point₂ qdr_nd.point₃ qdr_nd.point₄ nontriv₂₃₄) @@ -596,8 +495,8 @@ theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign (h₁ : qdr_nd.edg /-- Given four points ABCD and Quadrilateral ABCD IsNd, AB = CD, AD = BC, the signs of ∠DAB and ∠BCD are equal, then Quadrilateral ABCD is a Parallelogram_nd. -/ theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign_variant (h₁ : (SEG A B).length = (SEG C D).length) (h₂ : (SEG A D).length = (SEG B C).length) (h : ((ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value.IsPos ∧ (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value.IsPos) ∨ ((ANG D A B (QDR_nd A B C D nd).nd₁₄.out (QDR_nd A B C D nd).nd₁₂.out).value.IsNeg ∧ (ANG B C D (QDR_nd A B C D nd).nd₂₃.out.symm (QDR_nd A B C D nd).nd₃₄.out).value.IsNeg)) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign (QDR_nd A B C D nd) h₁ h₂ h -/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edge_nd₁₂.length = qdr_nd.edge_nd₃₄.length, qdr_nd.edge_nd₁₄.length = qdr_nd.edge_nd₂₃.length, the signs of qdr_nd.angle₂ and qdr_nd.angle₄ are equal, then qdr_nd is a Parallelogram_nd. -/ -theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign' (h₁ : qdr_nd.edge_nd₁₂.length = qdr_nd.edge_nd₃₄.length) (h₂ : qdr_nd.edge_nd₁₄.length = qdr_nd.edge_nd₂₃.length) (h : (qdr_nd.angle₂.value.IsPos ∧ qdr_nd.angle₄.value.IsPos) ∨ (qdr_nd.angle₂.value.IsNeg ∧ qdr_nd.angle₄.value.IsNeg)) : qdr_nd.IsParallelogram_nd := by sorry +/-- Given Quadrilateral_nd qdr_nd, qdr_nd.edgeND₁₂.length = qdr_nd.edgeND₃₄.length, qdr_nd.edgeND₄₁.reverse.length = qdr_nd.edgeND₂₃.length, the signs of qdr_nd.angle₂ and qdr_nd.angle₄ are equal, then qdr_nd is a Parallelogram_nd. -/ +theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign' (h₁ : qdr_nd.edgeND₁₂.length = qdr_nd.edgeND₃₄.length) (h₂ : qdr_nd.edgeND₄₁.reverse.length = qdr_nd.edgeND₂₃.length) (h : (qdr_nd.angle₂.value.IsPos ∧ qdr_nd.angle₄.value.IsPos) ∨ (qdr_nd.angle₂.value.IsNeg ∧ qdr_nd.angle₄.value.IsNeg)) : qdr_nd.IsParallelogram_nd := by sorry /-- Given four points ABCD and Quadrilateral ABCD IsNd, AB = CD, AD = BC, the signs of ∠ABC and ∠CDA are equal, then Quadrilateral ABCD is a Parallelogram_nd. -/ theorem qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign'_variant (h₁ : (SEG A B).length = (SEG C D).length) (h₂ : (SEG A D).length = (SEG B C).length) (h : ((ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value.IsPos ∧ (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value.IsPos) ∨ ((ANG A B C (QDR_nd A B C D nd).nd₁₂.out.symm (QDR_nd A B C D nd).nd₂₃.out).value.IsNeg ∧ (ANG C D A (QDR_nd A B C D nd).nd₃₄.out.symm (QDR_nd A B C D nd).nd₁₄.out.symm).value.IsNeg)) : (QDR_nd A B C D nd).IsParallelogram_nd := qdr_nd_is_prg_nd_of_eq_length_eq_length_eq_angle_sign' (QDR_nd A B C D nd) h₁ h₂ h @@ -612,8 +511,8 @@ variable (cvx : (QDR A B C D).IsConvex) variable {P : Type _} [EuclideanPlane P] (qdr_nd : Quadrilateral_nd P) variable {P : Type _} [EuclideanPlane P] (qdr : Quadrilateral P) -/-- Given Quadrilateral_nd qdr_nd, and qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄ and (qdr_nd.edge_nd₁₂).length = (qdr_nd.edge_nd₃₄).length, and qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃ and (qdr_nd.edge_nd₁₄).length = (qdr_nd.edge_nd₂₃).length, qdr_nd is a Parallelogram. -/ -theorem qdr_nd_is_prg_of_para_eq_length_para_eq_length (h₁ : qdr_nd.edge_nd₁₂ ∥ qdr_nd.edge_nd₃₄) (h₂ : qdr_nd.edge_nd₁₂.length = qdr_nd.edge_nd₃₄.length) (H₁ : qdr_nd.edge_nd₁₄ ∥ qdr_nd.edge_nd₂₃) (h₂ : qdr_nd.edge_nd₁₄.length = qdr_nd.edge_nd₂₃.length): qdr_nd.IsParallelogram := by +/-- Given Quadrilateral_nd qdr_nd, and qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄ and (qdr_nd.edgeND₁₂).length = (qdr_nd.edgeND₃₄).length, and qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃ and (qdr_nd.edgeND₄₁.reverse).length = (qdr_nd.edgeND₂₃).length, qdr_nd is a Parallelogram. -/ +theorem qdr_nd_is_prg_of_para_eq_length_para_eq_length (h₁ : qdr_nd.edgeND₁₂ ∥ qdr_nd.edgeND₃₄) (h₂ : qdr_nd.edgeND₁₂.length = qdr_nd.edgeND₃₄.length) (H₁ : qdr_nd.edgeND₄₁.reverse ∥ qdr_nd.edgeND₂₃) (h₂ : qdr_nd.edgeND₄₁.reverse.length = qdr_nd.edgeND₂₃.length): qdr_nd.IsParallelogram := by sorry /-- Given four points ABCD and Quadrilateral ABCD IsConvex, and AB ∥ CD and AB = CD, Quadrilateral ABCD is a Parallelogram_nd. -/ @@ -638,8 +537,8 @@ variable (cvx : (QDR_nd A B C D nd).IsConvex) variable {P : Type _} [EuclideanPlane P] (qdr_cvx : Quadrilateral_cvx P) variable {P : Type _} [EuclideanPlane P] (qdr : Quadrilateral P) -/-- Given Quadrilateral_cvx qdr_cvx, qdr_cvx.edge_nd₁₂ ∥ qdr_cvx.edge_nd₃₄ and qdr_cvx.edge_nd₁₄ ∥ qdr_cvx.edge_nd₂₃, then qdr_cvx is a Parallelogram_nd. -/ -theorem qdr_cvx_is_prg_nd_of_para_para (h₁ : qdr_cvx.edge_nd₁₂ ∥ qdr_cvx.edge_nd₃₄) (h₂ : qdr_cvx.edge_nd₁₄ ∥ qdr_cvx.edge_nd₂₃) : qdr_cvx.IsParallelogram_nd := by +/-- Given Quadrilateral_cvx qdr_cvx, qdr_cvx.edgeND₁₂ ∥ qdr_cvx.edgeND₃₄ and qdr_cvx.edgeND₄₁.reverse ∥ qdr_cvx.edgeND₂₃, then qdr_cvx is a Parallelogram_nd. -/ +theorem qdr_cvx_is_prg_nd_of_para_para (h₁ : qdr_cvx.edgeND₁₂ ∥ qdr_cvx.edgeND₃₄) (h₂ : qdr_cvx.edgeND₄₁.reverse ∥ qdr_cvx.edgeND₂₃) : qdr_cvx.IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor constructor @@ -664,11 +563,11 @@ theorem qdr_cvx_is_prg_nd_of_para_para_variant (h₁ : (SEG_nd A B (QDR_cvx A B exact (QDR_cvx A B C D nd cvx).not_collinear₃₄₁ exact (QDR_cvx A B C D nd cvx).not_collinear₄₁₂ -/-- Given Quadrilateral_cvx qdr_cvx, and (qdr_cvx.edge_nd₁₂).length = (qdr_cvx.edge_nd₃₄).length and qdr_cvx.edge_nd₁₄.length = qdr_cvx.edge_nd₂₃.length, qdr_cvx is a Parallelogram_nd. -/ -theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length (h₁ : qdr_cvx.edge_nd₁₂.length = qdr_cvx.edge_nd₃₄.length) (h₂ : qdr_cvx.edge_nd₁₄.length = qdr_cvx.edge_nd₂₃.length) : qdr_cvx.IsParallelogram_nd := by +/-- Given Quadrilateral_cvx qdr_cvx, and (qdr_cvx.edgeND₁₂).length = (qdr_cvx.edgeND₃₄).length and qdr_cvx.edgeND₄₁.reverse.length = qdr_cvx.edgeND₂₃.length, qdr_cvx is a Parallelogram_nd. -/ +theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length (h₁ : qdr_cvx.edgeND₁₂.length = qdr_cvx.edgeND₃₄.length) (h₂ : qdr_cvx.edgeND₄₁.reverse.length = qdr_cvx.edgeND₂₃.length) : qdr_cvx.IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor - have heq₁: qdr_cvx.edge_nd₁₄.length = qdr_cvx.edge_nd₁₄.reverse.length := qdr_cvx.edge_nd₁₄.reverse.length_of_rev_eq_length + have heq₁: qdr_cvx.edgeND₄₁.reverse.length = qdr_cvx.edgeND₄₁.length := qdr_cvx.edgeND₄₁.length_of_rev_eq_length have eq₁: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.not_collinear₄₁₂).edge₁.length = (TRI_nd qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.not_collinear₂₃₄).edge₁.length := h₁ have eq₂: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.not_collinear₄₁₂).edge₂.length = (TRI_nd qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.not_collinear₂₃₄).edge₂.length := (TRI_nd qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.not_collinear₂₃₄).edge₂.length_of_rev_eq_length have eq₃: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.not_collinear₄₁₂).edge₃.length = (TRI_nd qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.not_collinear₂₃₄).edge₃.length := by @@ -709,24 +608,24 @@ theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length (h₁ : qdr_cvx.edge_nd₁₂.l right exact near₂ have very_close₂: qdr_cvx.triangle_nd₁.angle₃.end_ray ∥ qdr_cvx.triangle_nd₃.angle₃.end_ray := very_near₂ - have close₁: qdr_cvx.edge_nd₁₄.toProj = qdr_cvx.triangle_nd₁.angle₁.start_ray.toProj := by - have third: qdr_cvx.edge_nd₁₄.reverse.toProj = qdr_cvx.edge_nd₁₄.toProj := qdr_cvx.edge_nd₁₄.toProj_of_rev_eq_toProj + have close₁: qdr_cvx.edgeND₄₁.reverse.toProj = qdr_cvx.triangle_nd₁.angle₁.start_ray.toProj := by + have third: qdr_cvx.edgeND₄₁.toProj = qdr_cvx.edgeND₄₁.reverse.toProj := qdr_cvx.edgeND₄₁.reverse.toProj_of_rev_eq_toProj exact id third.symm - have close₂: qdr_cvx.edge_nd₂₃.toProj = qdr_cvx.triangle_nd₃.angle₁.start_ray.toProj := by rfl - have close₃: qdr_cvx.edge_nd₁₂.toProj = qdr_cvx.triangle_nd₁.angle₃.end_ray.toProj := by - have last: qdr_cvx.edge_nd₁₂.reverse.toRay = qdr_cvx.triangle_nd₁.angle₃.end_ray := by rfl - have second: qdr_cvx.edge_nd₁₂.reverse.toProj = qdr_cvx.triangle_nd₁.angle₃.end_ray.toProj := by rfl - have third: qdr_cvx.edge_nd₁₂.reverse.toProj = qdr_cvx.edge_nd₁₂.toProj := qdr_cvx.edge_nd₁₂.toProj_of_rev_eq_toProj + have close₂: qdr_cvx.edgeND₂₃.toProj = qdr_cvx.triangle_nd₃.angle₁.start_ray.toProj := by rfl + have close₃: qdr_cvx.edgeND₁₂.toProj = qdr_cvx.triangle_nd₁.angle₃.end_ray.toProj := by + have last: qdr_cvx.edgeND₁₂.reverse.toRay = qdr_cvx.triangle_nd₁.angle₃.end_ray := by rfl + have second: qdr_cvx.edgeND₁₂.reverse.toProj = qdr_cvx.triangle_nd₁.angle₃.end_ray.toProj := by rfl + have third: qdr_cvx.edgeND₁₂.reverse.toProj = qdr_cvx.edgeND₁₂.toProj := qdr_cvx.edgeND₁₂.toProj_of_rev_eq_toProj rw [third.symm, second, last.symm] - have close₄: qdr_cvx.edge_nd₃₄.toProj = qdr_cvx.triangle_nd₃.angle₃.end_ray.toProj := by - have last: qdr_cvx.edge_nd₃₄.reverse.toRay = qdr_cvx.triangle_nd₃.angle₃.end_ray := by rfl - have second: qdr_cvx.edge_nd₃₄.reverse.toProj = qdr_cvx.triangle_nd₃.angle₃.end_ray.toProj := by rfl - have third: qdr_cvx.edge_nd₃₄.reverse.toProj = qdr_cvx.edge_nd₃₄.toProj := qdr_cvx.edge_nd₃₄.toProj_of_rev_eq_toProj + have close₄: qdr_cvx.edgeND₃₄.toProj = qdr_cvx.triangle_nd₃.angle₃.end_ray.toProj := by + have last: qdr_cvx.edgeND₃₄.reverse.toRay = qdr_cvx.triangle_nd₃.angle₃.end_ray := by rfl + have second: qdr_cvx.edgeND₃₄.reverse.toProj = qdr_cvx.triangle_nd₃.angle₃.end_ray.toProj := by rfl + have third: qdr_cvx.edgeND₃₄.reverse.toProj = qdr_cvx.edgeND₃₄.toProj := qdr_cvx.edgeND₃₄.toProj_of_rev_eq_toProj rw [third.symm, second, last.symm] - have win₁: qdr_cvx.edge_nd₁₂.toProj = qdr_cvx.edge_nd₃₄.toProj := by + have win₁: qdr_cvx.edgeND₁₂.toProj = qdr_cvx.edgeND₃₄.toProj := by rw [close₃, close₄] exact very_close₂ - have win₂: qdr_cvx.edge_nd₁₄.toProj = qdr_cvx.edge_nd₂₃.toProj := by + have win₂: qdr_cvx.edgeND₄₁.reverse.toProj = qdr_cvx.edgeND₂₃.toProj := by rw [close₁, close₂] exact very_close₁ exact ⟨win₁, win₂⟩ @@ -740,7 +639,7 @@ theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length (h₁ : qdr_cvx.edge_nd₁₂.l theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length_variant (h₁ : (SEG A B).length = (SEG C D).length) (h₂ : (SEG A D).length = (SEG B C).length) : (Quadrilateral_nd.mk_is_nd nd) IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor - have heq₁: (SEG A D).length = (QDR_cvx A B C D nd cvx).edge_nd₁₄.reverse.length := (QDR_cvx A B C D nd cvx).edge_nd₁₄.reverse.length_of_rev_eq_length + have heq₁: (SEG A D).length = (QDR_cvx A B C D nd cvx).edgeND₄₁.length := (QDR_cvx A B C D nd cvx).edgeND₄₁.length_of_rev_eq_length have eq₁: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).not_collinear₄₁₂).edge₁.length = (TRI_nd (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₂₃₄).edge₁.length := h₁ have eq₂: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).not_collinear₄₁₂).edge₂.length = (TRI_nd (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₂₃₄).edge₂.length := (TRI_nd (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₂₃₄).edge₂.length_of_rev_eq_length have eq₃: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).not_collinear₄₁₂).edge₃.length = (TRI_nd (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₂₃₄).edge₃.length := by @@ -781,24 +680,24 @@ theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length_variant (h₁ : (SEG A B).lengt right exact near₂ have very_close₂: (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray ∥ (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray := very_near₂ - have close₁: (QDR_cvx A B C D nd cvx).edge_nd₁₄.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₁.start_ray.toProj := by - have third: (QDR_cvx A B C D nd cvx).edge_nd₁₄.reverse.toProj = (QDR_cvx A B C D nd cvx).edge_nd₁₄.toProj := (QDR_cvx A B C D nd cvx).edge_nd₁₄.toProj_of_rev_eq_toProj + have close₁: (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₁.start_ray.toProj := by + have third: (QDR_cvx A B C D nd cvx).edgeND₄₁.toProj = (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toProj := (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toProj_of_rev_eq_toProj exact id third.symm - have close₂: (QDR_cvx A B C D nd cvx).edge_nd₂₃.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₁.start_ray.toProj := by rfl - have close₃: (QDR_cvx A B C D nd cvx).edge_nd₁₂.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray.toProj := by - have last: (QDR_cvx A B C D nd cvx).edge_nd₁₂.reverse.toRay = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray := by rfl - have second: (QDR_cvx A B C D nd cvx).edge_nd₁₂.reverse.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray.toProj := by rfl - have third: (QDR_cvx A B C D nd cvx).edge_nd₁₂.reverse.toProj = (QDR_cvx A B C D nd cvx).edge_nd₁₂.toProj := (QDR_cvx A B C D nd cvx).edge_nd₁₂.toProj_of_rev_eq_toProj + have close₂: (QDR_cvx A B C D nd cvx).edgeND₂₃.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₁.start_ray.toProj := by rfl + have close₃: (QDR_cvx A B C D nd cvx).edgeND₁₂.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray.toProj := by + have last: (QDR_cvx A B C D nd cvx).edgeND₁₂.reverse.toRay = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray := by rfl + have second: (QDR_cvx A B C D nd cvx).edgeND₁₂.reverse.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₁.angle₃.end_ray.toProj := by rfl + have third: (QDR_cvx A B C D nd cvx).edgeND₁₂.reverse.toProj = (QDR_cvx A B C D nd cvx).edgeND₁₂.toProj := (QDR_cvx A B C D nd cvx).edgeND₁₂.toProj_of_rev_eq_toProj rw [third.symm, second, last.symm] - have close₄: (QDR_cvx A B C D nd cvx).edge_nd₃₄.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray.toProj := by - have last: (QDR_cvx A B C D nd cvx).edge_nd₃₄.reverse.toRay = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray := by rfl - have second: (QDR_cvx A B C D nd cvx).edge_nd₃₄.reverse.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray.toProj := by rfl - have third: (QDR_cvx A B C D nd cvx).edge_nd₃₄.reverse.toProj = (QDR_cvx A B C D nd cvx).edge_nd₃₄.toProj := (QDR_cvx A B C D nd cvx).edge_nd₃₄.toProj_of_rev_eq_toProj + have close₄: (QDR_cvx A B C D nd cvx).edgeND₃₄.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray.toProj := by + have last: (QDR_cvx A B C D nd cvx).edgeND₃₄.reverse.toRay = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray := by rfl + have second: (QDR_cvx A B C D nd cvx).edgeND₃₄.reverse.toProj = (QDR_cvx A B C D nd cvx).triangle_nd₃.angle₃.end_ray.toProj := by rfl + have third: (QDR_cvx A B C D nd cvx).edgeND₃₄.reverse.toProj = (QDR_cvx A B C D nd cvx).edgeND₃₄.toProj := (QDR_cvx A B C D nd cvx).edgeND₃₄.toProj_of_rev_eq_toProj rw [third.symm, second, last.symm] - have win₁: (QDR_cvx A B C D nd cvx).edge_nd₁₂.toProj = (QDR_cvx A B C D nd cvx).edge_nd₃₄.toProj := by + have win₁: (QDR_cvx A B C D nd cvx).edgeND₁₂.toProj = (QDR_cvx A B C D nd cvx).edgeND₃₄.toProj := by rw [close₃, close₄] exact very_close₂ - have win₂: (QDR_cvx A B C D nd cvx).edge_nd₁₄.toProj = (QDR_cvx A B C D nd cvx).edge_nd₂₃.toProj := by + have win₂: (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toProj = (QDR_cvx A B C D nd cvx).edgeND₂₃.toProj := by rw [close₁, close₂] exact very_close₁ exact ⟨win₁, win₂⟩ @@ -808,12 +707,12 @@ theorem qdr_cvx_is_prg_nd_of_eq_length_eq_length_variant (h₁ : (SEG A B).lengt exact (QDR_cvx A B C D nd cvx).not_collinear₃₄₁ exact (QDR_cvx A B C D nd cvx).not_collinear₄₁₂ -/-- Given Quadrilateral_cvx qdr_cvx, and qdr_cvx.edge_nd₁₂ ∥ qdr_cvx.edge_nd₃₄ and (qdr_cvx.edge_nd₁₂).length = (qdr_cvx.edge_nd₃₄).length, qdr_cvx is a Parallelogram_nd. -/ -theorem qdr_cvx_is_prg_nd_of_para_eq_length (h₁ : qdr_cvx.edge_nd₁₂ ∥ qdr_cvx.edge_nd₃₄) (h₂ : qdr_cvx.edge_nd₁₂.length = qdr_cvx.edge_nd₃₄.length) : qdr_cvx.IsParallelogram_nd := by +/-- Given Quadrilateral_cvx qdr_cvx, and qdr_cvx.edgeND₁₂ ∥ qdr_cvx.edgeND₃₄ and (qdr_cvx.edgeND₁₂).length = (qdr_cvx.edgeND₃₄).length, qdr_cvx is a Parallelogram_nd. -/ +theorem qdr_cvx_is_prg_nd_of_para_eq_length (h₁ : qdr_cvx.edgeND₁₂ ∥ qdr_cvx.edgeND₃₄) (h₂ : qdr_cvx.edgeND₁₂.length = qdr_cvx.edgeND₃₄.length) : qdr_cvx.IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor - unfold parallel at h₁ - have h: qdr_cvx.edge_nd₁₂.toDir = qdr_cvx.edge_nd₃₄.toDir ∨ qdr_cvx.edge_nd₁₂.toDir = - qdr_cvx.edge_nd₃₄.toDir := by + unfold Parallel at h₁ + have h: qdr_cvx.edgeND₁₂.toDir = qdr_cvx.edgeND₃₄.toDir ∨ qdr_cvx.edgeND₁₂.toDir = - qdr_cvx.edgeND₃₄.toDir := by apply Dir.toProj_eq_toProj_iff.1 exact h₁ have diag_ng_para: ¬ qdr_cvx.diag_nd₁₃.toProj = qdr_cvx.diag_nd₂₄.toProj := qdr_cvx.diag_not_para @@ -821,15 +720,15 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length (h₁ : qdr_cvx.edge_nd₁₂ ∥ qd -- Case that is not convex, goal is prove contra have angle₁_eq_angle₄: (ANG qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁).value = (ANG qdr_cvx.point₂ qdr_cvx.point₁ qdr_cvx.point₄).value := by apply ang_eq_ang_of_toDir_rev_toDir - have ray₁₂_toDir_eq_SegND₁₂_toDir: qdr_cvx.edge_nd₁₂.toDir = (ANG qdr_cvx.point₂ qdr_cvx.point₁ qdr_cvx.point₄).start_ray.toDir := by rfl - have ray₄₃_toDir_eq_SegND₃₄_rev_toDir: qdr_cvx.edge_nd₃₄.reverse.toDir = (ANG qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁).start_ray.toDir := by rfl - have SegND₄₃_toDir_neg_SegND₃₄_rev_toDir: qdr_cvx.edge_nd₃₄.reverse.toDir = - qdr_cvx.edge_nd₃₄.toDir := by apply SegND.toDir_of_rev_eq_neg_toDir + have ray₁₂_toDir_eq_SegND₁₂_toDir: qdr_cvx.edgeND₁₂.toDir = (ANG qdr_cvx.point₂ qdr_cvx.point₁ qdr_cvx.point₄).start_ray.toDir := by rfl + have ray₄₃_toDir_eq_SegND₃₄_rev_toDir: qdr_cvx.edgeND₃₄.reverse.toDir = (ANG qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁).start_ray.toDir := by rfl + have SegND₄₃_toDir_neg_SegND₃₄_rev_toDir: qdr_cvx.edgeND₃₄.reverse.toDir = - qdr_cvx.edgeND₃₄.toDir := by apply SegND.toDir_of_rev_eq_neg_toDir rw [ray₁₂_toDir_eq_SegND₁₂_toDir.symm, ray₄₃_toDir_eq_SegND₃₄_rev_toDir.symm, SegND₄₃_toDir_neg_SegND₃₄_rev_toDir, case_not_convex] - exact qdr_cvx.edge_nd₁₄.toDir_of_rev_eq_neg_toDir + exact qdr_cvx.edgeND₄₁.reverse.toDir_of_rev_eq_neg_toDir have IsCongrTo₁₄: TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁ IsCongrTo TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄ := by have edge₂_eq: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).1.edge₂.length = (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄).1.edge₂.length := by apply length_of_rev_eq_length' have edge₃_eq: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).1.edge₃.length = (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄).1.edge₃.length := by - have eq_length: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).1.edge₃.length = qdr_cvx.edge_nd₃₄.length := by apply length_of_rev_eq_length' + have eq_length: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).1.edge₃.length = qdr_cvx.edgeND₃₄.length := by apply length_of_rev_eq_length' rw [eq_length] exact h₂.symm apply TriangleND.congr_of_SAS edge₂_eq angle₁_eq_angle₄ edge₃_eq @@ -841,9 +740,9 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length (h₁ : qdr_cvx.edge_nd₁₂ ∥ qd -- Use angle_eq to prove two diag para. have prepa₂: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.start_ray.reverse.toDir = (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄).angle₃.start_ray.toDir := by have prepaA: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.start_ray.reverse.toDir = - (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.start_ray.toDir := (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.start_ray.toDir_of_rev_eq_neg_toDir - have prepaB: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.start_ray.toDir = qdr_cvx.edge_nd₁₄.toDir := by rfl - have prepaC: (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄).angle₃.start_ray.toDir = qdr_cvx.edge_nd₁₄.reverse.toDir := by rfl - have prepaD: qdr_cvx.edge_nd₁₄.reverse.toDir = - qdr_cvx.edge_nd₁₄.toDir := qdr_cvx.edge_nd₁₄.toDir_of_rev_eq_neg_toDir + have prepaB: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.start_ray.toDir = qdr_cvx.edgeND₄₁.reverse.toDir := by rfl + have prepaC: (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄).angle₃.start_ray.toDir = qdr_cvx.edgeND₄₁.toDir := by rfl + have prepaD: qdr_cvx.edgeND₄₁.toDir = - qdr_cvx.edgeND₄₁.reverse.toDir := qdr_cvx.edgeND₄₁.reverse.toDir_of_rev_eq_neg_toDir rw [prepaA, prepaB, prepaC, prepaD] have prepa₃: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.end_ray.reverse.toDir = (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ qdr_cvx.not_collinear₁₂₄).angle₃.end_ray.toDir := (end_ray_toDir_rev_toDir_of_ang_rev_ang prepa₂.symm prepa₁).symm have prepa₄: (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.end_ray.reverse.toDir = - (TRI_nd qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ qdr_cvx.not_collinear₄₃₁).angle₃.end_ray.toDir := by @@ -886,12 +785,12 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length (h₁ : qdr_cvx.edge_nd₁₂ ∥ qd exact K₆ have near: (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.not_collinear₁₂₃).angle₃.end_ray.toDir = (TRI_nd qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.not_collinear₃₄₁).angle₃.end_ray.reverse.toDir := end_ray_toDir_rev_toDir_of_ang_rev_ang pr₂ pr₁ have J₁: (TRI_nd qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.not_collinear₃₄₁).angle₃.end_ray.reverse.toDir = - (TRI_nd qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.not_collinear₃₄₁).angle₃.end_ray.toDir := (TRI_nd qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.not_collinear₃₄₁).angle₃.end_ray.toDir_of_rev_eq_neg_toDir - have J₂: (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.not_collinear₁₂₃).angle₃.end_ray.toDir = qdr_cvx.edge_nd₂₃.reverse.toDir := by rfl - have J₃: (TRI_nd qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.not_collinear₃₄₁).angle₃.end_ray.toDir = qdr_cvx.edge_nd₁₄.toDir := by rfl - have J₄: qdr_cvx.edge_nd₂₃.reverse.toDir = - qdr_cvx.edge_nd₂₃.toDir := qdr_cvx.edge_nd₂₃.toDir_of_rev_eq_neg_toDir + have J₂: (TRI_nd qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.not_collinear₁₂₃).angle₃.end_ray.toDir = qdr_cvx.edgeND₂₃.reverse.toDir := by rfl + have J₃: (TRI_nd qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.not_collinear₃₄₁).angle₃.end_ray.toDir = qdr_cvx.edgeND₄₁.reverse.toDir := by rfl + have J₄: qdr_cvx.edgeND₂₃.reverse.toDir = - qdr_cvx.edgeND₂₃.toDir := qdr_cvx.edgeND₂₃.toDir_of_rev_eq_neg_toDir rw [J₁, J₂, J₃, J₄] at near simp only [neg_inj] at near - have close: qdr_cvx.edge_nd₂₃.toProj = qdr_cvx.edge_nd₁₄.toProj := by + have close: qdr_cvx.edgeND₂₃.toProj = qdr_cvx.edgeND₄₁.reverse.toProj := by apply Dir.toProj_eq_toProj_iff.mpr left exact near @@ -909,8 +808,8 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length (h₁ : qdr_cvx.edge_nd₁₂ ∥ qd theorem qdr_cvx_is_prg_nd_of_para_eq_length_variant (h₁ : (SEG_nd A B (QDR_cvx A B C D nd cvx).nd₁₂.out) ∥ (SEG_nd C D (QDR_cvx A B C D nd cvx).nd₃₄.out)) (h₂ : (SEG_nd A B (QDR_cvx A B C D nd cvx).nd₁₂.out).length = (SEG_nd C D (QDR_cvx A B C D nd cvx).nd₃₄.out).length) : (Quadrilateral_nd.mk_is_nd nd) IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor - unfold parallel at h₁ - have h: (QDR_cvx A B C D nd cvx).edge_nd₁₂.toDir = (QDR_cvx A B C D nd cvx).edge_nd₃₄.toDir ∨ (QDR_cvx A B C D nd cvx).edge_nd₁₂.toDir = - (QDR_cvx A B C D nd cvx).edge_nd₃₄.toDir := by + unfold Parallel at h₁ + have h: (QDR_cvx A B C D nd cvx).edgeND₁₂.toDir = (QDR_cvx A B C D nd cvx).edgeND₃₄.toDir ∨ (QDR_cvx A B C D nd cvx).edgeND₁₂.toDir = - (QDR_cvx A B C D nd cvx).edgeND₃₄.toDir := by apply Dir.toProj_eq_toProj_iff.1 exact h₁ have diag_ng_para: ¬ (QDR_cvx A B C D nd cvx).diag_nd₁₃.toProj = (QDR_cvx A B C D nd cvx).diag_nd₂₄.toProj := (QDR_cvx A B C D nd cvx).diag_not_para @@ -918,15 +817,15 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length_variant (h₁ : (SEG_nd A B (QDR_cvx -- Case that is not convex, goal is prove contra have angle₁_eq_angle₄: (ANG (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).nd₃₄.out.symm (QDR_cvx A B C D nd cvx).nd₁₄.out.symm).value = (ANG (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).nd₁₂.out (QDR_cvx A B C D nd cvx).nd₁₄.out).value := by apply ang_eq_ang_of_toDir_rev_toDir - have ray₁₂_toDir_eq_Seg_nd₁₂_toDir: (QDR_cvx A B C D nd cvx).edge_nd₁₂.toDir = (ANG (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).nd₁₂.out (QDR_cvx A B C D nd cvx).nd₁₄.out).start_ray.toDir := by rfl - have ray₄₃_toDir_eq_Seg_nd₃₄_rev_toDir: (QDR_cvx A B C D nd cvx).edge_nd₃₄.reverse.toDir = (ANG (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).nd₃₄.out.symm (QDR_cvx A B C D nd cvx).nd₁₄.out.symm).start_ray.toDir := by rfl - have Seg_nd₄₃_toDir_neg_Seg_nd₃₄_rev_toDir: (QDR_cvx A B C D nd cvx).edge_nd₃₄.reverse.toDir = - (QDR_cvx A B C D nd cvx).edge_nd₃₄.toDir := by apply SegND.toDir_of_rev_eq_neg_toDir + have ray₁₂_toDir_eq_Seg_nd₁₂_toDir: (QDR_cvx A B C D nd cvx).edgeND₁₂.toDir = (ANG (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).nd₁₂.out (QDR_cvx A B C D nd cvx).nd₁₄.out).start_ray.toDir := by rfl + have ray₄₃_toDir_eq_Seg_nd₃₄_rev_toDir: (QDR_cvx A B C D nd cvx).edgeND₃₄.reverse.toDir = (ANG (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).nd₃₄.out.symm (QDR_cvx A B C D nd cvx).nd₁₄.out.symm).start_ray.toDir := by rfl + have Seg_nd₄₃_toDir_neg_Seg_nd₃₄_rev_toDir: (QDR_cvx A B C D nd cvx).edgeND₃₄.reverse.toDir = - (QDR_cvx A B C D nd cvx).edgeND₃₄.toDir := by apply SegND.toDir_of_rev_eq_neg_toDir rw [ray₁₂_toDir_eq_Seg_nd₁₂_toDir.symm, ray₄₃_toDir_eq_Seg_nd₃₄_rev_toDir.symm, Seg_nd₄₃_toDir_neg_Seg_nd₃₄_rev_toDir, case_not_convex] - exact (QDR_cvx A B C D nd cvx).edge_nd₁₄.toDir_of_rev_eq_neg_toDir + exact (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toDir_of_rev_eq_neg_toDir have IsCongrTo₁₄: TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁ IsCongrTo TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄ := by have edge₂_eq: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).1.edge₂.length = (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄).1.edge₂.length := by apply length_of_rev_eq_length' have edge₃_eq: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).1.edge₃.length = (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄).1.edge₃.length := by - have eq_length: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).1.edge₃.length = (QDR_cvx A B C D nd cvx).edge_nd₃₄.length := by apply length_of_rev_eq_length' + have eq_length: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).1.edge₃.length = (QDR_cvx A B C D nd cvx).edgeND₃₄.length := by apply length_of_rev_eq_length' rw [eq_length] exact h₂.symm apply TriangleND.congr_of_SAS edge₂_eq angle₁_eq_angle₄ edge₃_eq @@ -938,9 +837,9 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length_variant (h₁ : (SEG_nd A B (QDR_cvx -- Use angle_eq to prove two diag para. have prepa₂: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.start_ray.reverse.toDir = (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄).angle₃.start_ray.toDir := by have prepaA: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.start_ray.reverse.toDir = - (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.start_ray.toDir := (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.start_ray.toDir_of_rev_eq_neg_toDir - have prepaB: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.start_ray.toDir = (QDR_cvx A B C D nd cvx).edge_nd₁₄.toDir := by rfl - have prepaC: (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄).angle₃.start_ray.toDir = (QDR_cvx A B C D nd cvx).edge_nd₁₄.reverse.toDir := by rfl - have prepaD: (QDR_cvx A B C D nd cvx).edge_nd₁₄.reverse.toDir = - (QDR_cvx A B C D nd cvx).edge_nd₁₄.toDir := (QDR_cvx A B C D nd cvx).edge_nd₁₄.toDir_of_rev_eq_neg_toDir + have prepaB: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.start_ray.toDir = (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toDir := by rfl + have prepaC: (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄).angle₃.start_ray.toDir = (QDR_cvx A B C D nd cvx).edgeND₄₁.toDir := by rfl + have prepaD: (QDR_cvx A B C D nd cvx).edgeND₄₁.toDir = - (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toDir := (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toDir_of_rev_eq_neg_toDir rw [prepaA, prepaB, prepaC, prepaD] have prepa₃: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.end_ray.reverse.toDir = (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).not_collinear₁₂₄).angle₃.end_ray.toDir := (end_ray_toDir_rev_toDir_of_ang_rev_ang prepa₂.symm prepa₁).symm have prepa₄: (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.end_ray.reverse.toDir = - (TRI_nd (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₄₃₁).angle₃.end_ray.toDir := by @@ -983,12 +882,12 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length_variant (h₁ : (SEG_nd A B (QDR_cvx exact K₆ have near: (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂ (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).not_collinear₁₂₃).angle₃.end_ray.toDir = (TRI_nd (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₃₄₁).angle₃.end_ray.reverse.toDir := end_ray_toDir_rev_toDir_of_ang_rev_ang pr₂ pr₁ have J₁: (TRI_nd (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₃₄₁).angle₃.end_ray.reverse.toDir = - (TRI_nd (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₃₄₁).angle₃.end_ray.toDir := (TRI_nd (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₃₄₁).angle₃.end_ray.toDir_of_rev_eq_neg_toDir - have J₂: (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂(QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).not_collinear₁₂₃).angle₃.end_ray.toDir = (QDR_cvx A B C D nd cvx).edge_nd₂₃.reverse.toDir := by rfl - have J₃: (TRI_nd (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₃₄₁).angle₃.end_ray.toDir = (QDR_cvx A B C D nd cvx).edge_nd₁₄.toDir := by rfl - have J₄: (QDR_cvx A B C D nd cvx).edge_nd₂₃.reverse.toDir = - (QDR_cvx A B C D nd cvx).edge_nd₂₃.toDir := (QDR_cvx A B C D nd cvx).edge_nd₂₃.toDir_of_rev_eq_neg_toDir + have J₂: (TRI_nd (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).point₂(QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).not_collinear₁₂₃).angle₃.end_ray.toDir = (QDR_cvx A B C D nd cvx).edgeND₂₃.reverse.toDir := by rfl + have J₃: (TRI_nd (QDR_cvx A B C D nd cvx).point₃ (QDR_cvx A B C D nd cvx).point₄ (QDR_cvx A B C D nd cvx).point₁ (QDR_cvx A B C D nd cvx).not_collinear₃₄₁).angle₃.end_ray.toDir = (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toDir := by rfl + have J₄: (QDR_cvx A B C D nd cvx).edgeND₂₃.reverse.toDir = - (QDR_cvx A B C D nd cvx).edgeND₂₃.toDir := (QDR_cvx A B C D nd cvx).edgeND₂₃.toDir_of_rev_eq_neg_toDir rw [J₁, J₂, J₃, J₄] at near simp only [neg_inj] at near - have close: (QDR_cvx A B C D nd cvx).edge_nd₂₃.toProj = (QDR_cvx A B C D nd cvx).edge_nd₁₄.toProj := by + have close: (QDR_cvx A B C D nd cvx).edgeND₂₃.toProj = (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toProj := by apply Dir.toProj_eq_toProj_iff.mpr left exact near @@ -1003,25 +902,25 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length_variant (h₁ : (SEG_nd A B (QDR_cvx exact (QDR_cvx A B C D nd cvx).not_collinear₄₁₂ -/-- Given Quadrilateral_cvx qdr_cvx, and qdr_cvx.edge_nd₁₄ ∥ qdr_cvx.edge_nd₂₃ and (qdr_cvx.edge_nd₁₄).length = (qdr_cvx.edge_nd₂₃).length, qdr_cvx is a Parallelogram_nd. -/ -theorem qdr_cvx_is_prg_nd_of_para_eq_length' (h₁ : qdr_cvx.edge_nd₁₄ ∥ qdr_cvx.edge_nd₂₃) (h₂ : qdr_cvx.edge_nd₁₄.length = qdr_cvx.edge_nd₂₃.length) : qdr_cvx.IsParallelogram_nd := by +/-- Given Quadrilateral_cvx qdr_cvx, and qdr_cvx.edgeND₄₁.reverse ∥ qdr_cvx.edgeND₂₃ and (qdr_cvx.edgeND₄₁.reverse).length = (qdr_cvx.edgeND₂₃).length, qdr_cvx is a Parallelogram_nd. -/ +theorem qdr_cvx_is_prg_nd_of_para_eq_length' (h₁ : qdr_cvx.edgeND₄₁.reverse ∥ qdr_cvx.edgeND₂₃) (h₂ : qdr_cvx.edgeND₄₁.reverse.length = qdr_cvx.edgeND₂₃.length) : qdr_cvx.IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor let permute_convex := Quadrilateral_cvx.mk_is_convex qdr_cvx.permute_is_convex - have K₁: permute_convex.edge_nd₁₂.toProj = qdr_cvx.edge_nd₂₃.toProj := by rfl - have K₂: permute_convex.edge_nd₁₂.length = qdr_cvx.edge_nd₂₃.length := by rfl - have j₂: permute_convex.edge_nd₃₄ = qdr_cvx.edge_nd₁₄.reverse := by rfl - have K₃: permute_convex.edge_nd₃₄.toProj = qdr_cvx.edge_nd₁₄.toProj := by + have K₁: permute_convex.edgeND₁₂.toProj = qdr_cvx.edgeND₂₃.toProj := by rfl + have K₂: permute_convex.edgeND₁₂.length = qdr_cvx.edgeND₂₃.length := by rfl + have j₂: permute_convex.edgeND₃₄ = qdr_cvx.edgeND₄₁ := by rfl + have K₃: permute_convex.edgeND₃₄.toProj = qdr_cvx.edgeND₄₁.reverse.toProj := by rw [j₂] - apply SegND.toProj_of_rev_eq_toProj - have K₄: permute_convex.edge_nd₃₄.length = qdr_cvx.edge_nd₁₄.length := by + apply SegND.toProj_of_rev_eq_toProj.symm + have K₄: permute_convex.edgeND₃₄.length = qdr_cvx.edgeND₄₁.reverse.length := by rw [j₂] - apply SegND.length_of_rev_eq_length - have H₁: permute_convex.edge_nd₁₂.toProj = permute_convex.edge_nd₃₄.toProj := by + apply SegND.length_of_rev_eq_length.symm + have H₁: permute_convex.edgeND₁₂.toProj = permute_convex.edgeND₃₄.toProj := by rw [K₁, K₃] - unfold parallel at h₁ + unfold Parallel at h₁ exact h₁.symm - have H₂: permute_convex.edge_nd₁₂.length = permute_convex.edge_nd₃₄.length := by + have H₂: permute_convex.edgeND₁₂.length = permute_convex.edgeND₃₄.length := by rw [K₂, K₄] exact h₂.symm have H: permute_convex.IsParallelogram_nd := qdr_cvx_is_prg_nd_of_para_eq_length permute_convex H₁ H₂ @@ -1030,15 +929,15 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length' (h₁ : qdr_cvx.edge_nd₁₄ ∥ q unfold Quadrilateral_nd.IsParallelogram_para unfold Quadrilateral_nd.IsParallelogram_para at para rcases para with ⟨para₁, para₂⟩ - unfold parallel - have K₉: permute_convex.edge_nd₁₄.reverse.toProj = qdr_cvx.edge_nd₁₂.toProj := by rfl - have K₁₀: permute_convex.edge_nd₁₄.reverse.toProj = permute_convex.edge_nd₁₄.toProj := by apply SegND.toProj_of_rev_eq_toProj - have K₈: permute_convex.edge_nd₂₃.toProj = qdr_cvx.edge_nd₃₄.toProj := by rfl + unfold Parallel + have K₉: permute_convex.edgeND₄₁.toProj = qdr_cvx.edgeND₁₂.toProj := by rfl + have K₁₀: permute_convex.edgeND₄₁.toProj = permute_convex.edgeND₄₁.reverse.toProj := by apply SegND.toProj_of_rev_eq_toProj.symm + have K₈: permute_convex.edgeND₂₃.toProj = qdr_cvx.edgeND₃₄.toProj := by rfl rw [K₁₀] at K₉ - unfold parallel at para₁ - unfold parallel at para₂ + unfold Parallel at para₁ + unfold Parallel at para₂ constructor - have key: qdr_cvx.edge_nd₁₂.toProj = qdr_cvx.edge_nd₃₄.toProj := by + have key: qdr_cvx.edgeND₁₂.toProj = qdr_cvx.edgeND₃₄.toProj := by rw [K₉.symm, K₈.symm] exact para₂ exact key @@ -1050,24 +949,24 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length' (h₁ : qdr_cvx.edge_nd₁₄ ∥ q exact qdr_cvx.not_collinear₄₁₂ /-- Given four points ABCD and Quadrilateral ABCD IsConvex, and AD ∥ BC and AD = BC, Quadrilateral ABCD is a Parallelogram_nd. -/ -theorem qdr_cvx_is_prg_nd_of_para_eq_length'_variant (h₁ : (SEG_nd A D (QDR_cvx A B C D nd cvx).nd₁₄.out) ∥ (SEG_nd B C (QDR_cvx A B C D nd cvx).nd₂₃.out)) (h₂ : (QDR_cvx A B C D nd cvx).edge_nd₁₄.length = (QDR_cvx A B C D nd cvx).edge_nd₂₃.length) : (Quadrilateral_nd.mk_is_nd nd) IsParallelogram_nd := by +theorem qdr_cvx_is_prg_nd_of_para_eq_length'_variant (h₁ : (SEG_nd A D (QDR_cvx A B C D nd cvx).nd₁₄.out) ∥ (SEG_nd B C (QDR_cvx A B C D nd cvx).nd₂₃.out)) (h₂ : (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.length = (QDR_cvx A B C D nd cvx).edgeND₂₃.length) : (Quadrilateral_nd.mk_is_nd nd) IsParallelogram_nd := by unfold Quadrilateral_nd.IsParallelogram_nd constructor let permute_convex := Quadrilateral_cvx.mk_is_convex (QDR_cvx A B C D nd cvx).permute_is_convex - have K₁: permute_convex.edge_nd₁₂.toProj = (QDR_cvx A B C D nd cvx).edge_nd₂₃.toProj := by rfl - have K₂: permute_convex.edge_nd₁₂.1.length = (QDR_cvx A B C D nd cvx).edge_nd₂₃.1.length := by rfl - have j₂: permute_convex.edge_nd₃₄ = (QDR_cvx A B C D nd cvx).edge_nd₁₄.reverse := by rfl - have K₃: permute_convex.edge_nd₃₄.toProj = (QDR_cvx A B C D nd cvx).edge_nd₁₄.toProj := by + have K₁: permute_convex.edgeND₁₂.toProj = (QDR_cvx A B C D nd cvx).edgeND₂₃.toProj := by rfl + have K₂: permute_convex.edgeND₁₂.1.length = (QDR_cvx A B C D nd cvx).edgeND₂₃.1.length := by rfl + have j₂: permute_convex.edgeND₃₄ = (QDR_cvx A B C D nd cvx).edgeND₄₁ := by rfl + have K₃: permute_convex.edgeND₃₄.toProj = (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.toProj := by rw [j₂] - apply SegND.toProj_of_rev_eq_toProj - have K₄: permute_convex.edge_nd₃₄.1.length = (QDR_cvx A B C D nd cvx).edge_nd₁₄.1.length := by + apply SegND.toProj_of_rev_eq_toProj.symm + have K₄: permute_convex.edgeND₃₄.1.length = (QDR_cvx A B C D nd cvx).edgeND₄₁.reverse.1.length := by rw [j₂] - apply SegND.length_of_rev_eq_length - have H₁: permute_convex.edge_nd₁₂.toProj = permute_convex.edge_nd₃₄.toProj := by + apply SegND.length_of_rev_eq_length.symm + have H₁: permute_convex.edgeND₁₂.toProj = permute_convex.edgeND₃₄.toProj := by rw [K₁, K₃] - unfold parallel at h₁ + unfold Parallel at h₁ exact h₁.symm - have H₂: permute_convex.edge_nd₁₂.1.length = permute_convex.edge_nd₃₄.1.length := by + have H₂: permute_convex.edgeND₁₂.1.length = permute_convex.edgeND₃₄.1.length := by rw [K₂, K₄] exact h₂.symm have H: permute_convex.IsParallelogram_nd := qdr_cvx_is_prg_nd_of_para_eq_length permute_convex H₁ H₂ @@ -1076,15 +975,15 @@ theorem qdr_cvx_is_prg_nd_of_para_eq_length'_variant (h₁ : (SEG_nd A D (QDR_cv unfold Quadrilateral_nd.IsParallelogram_para unfold Quadrilateral_nd.IsParallelogram_para at para rcases para with ⟨para₁, para₂⟩ - unfold parallel - have K₉: permute_convex.edge_nd₁₄.reverse.toProj = (QDR_cvx A B C D nd cvx).edge_nd₁₂.toProj := by rfl - have K₁₀: permute_convex.edge_nd₁₄.reverse.toProj = permute_convex.edge_nd₁₄.toProj := by apply SegND.toProj_of_rev_eq_toProj - have K₈: permute_convex.edge_nd₂₃.toProj = (QDR_cvx A B C D nd cvx).edge_nd₃₄.toProj := by rfl + unfold Parallel + have K₉: permute_convex.edgeND₄₁.toProj = (QDR_cvx A B C D nd cvx).edgeND₁₂.toProj := by rfl + have K₁₀: permute_convex.edgeND₄₁.toProj = permute_convex.edgeND₄₁.reverse.toProj := by apply SegND.toProj_of_rev_eq_toProj.symm + have K₈: permute_convex.edgeND₂₃.toProj = (QDR_cvx A B C D nd cvx).edgeND₃₄.toProj := by rfl rw [K₁₀] at K₉ - unfold parallel at para₁ - unfold parallel at para₂ + unfold Parallel at para₁ + unfold Parallel at para₂ constructor - have key: (QDR_cvx A B C D nd cvx).edge_nd₁₂.toProj = (QDR_cvx A B C D nd cvx).edge_nd₃₄.toProj := by + have key: (QDR_cvx A B C D nd cvx).edgeND₁₂.toProj = (QDR_cvx A B C D nd cvx).edgeND₃₄.toProj := by rw [K₉.symm, K₈.symm] exact para₂ exact key @@ -1442,7 +1341,7 @@ theorem nd_eq_length_of_is_prg_nd (h : qdr.IsParallelogram_nd) : (SEG_nd qdr.poi rcases h with ⟨a,b⟩ unfold Quadrilateral_nd.IsParallelogram_para at a rcases a with ⟨p,q⟩ - unfold parallel at p q + unfold Parallel at p q rcases b with ⟨b₁,b₂,b₃,b₄⟩ sorry @@ -1460,7 +1359,7 @@ theorem nd_eq_length_of_is_prg_nd' (h : qdr.IsParallelogram_nd) : (SEG_nd qdr.p rcases h with ⟨a,b⟩ unfold Quadrilateral_nd.IsParallelogram_para at a rcases a with ⟨p,q⟩ - unfold parallel at p q + unfold Parallel at p q rcases b with ⟨b₁,b₂,b₃,b₄⟩ sorry simp only [j, dite_false] at h diff --git a/EuclideanGeometry/Foundation/Construction/Polygon/Quadrilateral.lean b/EuclideanGeometry/Foundation/Construction/Polygon/Quadrilateral.lean index a91c1a5e..59d29576 100644 --- a/EuclideanGeometry/Foundation/Construction/Polygon/Quadrilateral.lean +++ b/EuclideanGeometry/Foundation/Construction/Polygon/Quadrilateral.lean @@ -127,19 +127,43 @@ instance nd₁₄ : PtNe qdr_nd.1.4 qdr_nd.1.1 := Fact.mk qdr_nd.nd.nd₁₄ /-- The edge from the first point to the second point of a quadrilateral -/ @[pp_dot] -def edge_nd₁₂ : SegND P := SEG_nd qdr_nd.point₁ qdr_nd.point₂ +def edgeND₁₂ : SegND P := SEG_nd qdr_nd.point₁ qdr_nd.point₂ + +@[simp] +lemma edgeND₁₂_source : qdr_nd.edgeND₁₂.source = qdr_nd.point₁ := rfl + +@[simp] +lemma edgeND₁₂_target : qdr_nd.edgeND₁₂.target = qdr_nd.point₂ := rfl /-- The edge from the second point to the third point of a quadrilateral -/ @[pp_dot] -def edge_nd₂₃ : SegND P := SEG_nd qdr_nd.point₂ qdr_nd.point₃ +def edgeND₂₃ : SegND P := SEG_nd qdr_nd.point₂ qdr_nd.point₃ + +@[simp] +lemma edgeND₂₃_source : qdr_nd.edgeND₂₃.source = qdr_nd.point₂ := rfl + +@[simp] +lemma edgeND₂₃_target : qdr_nd.edgeND₂₃.target = qdr_nd.point₃ := rfl /-- The edge from the third point to the fourth point of a quadrilateral -/ @[pp_dot] -def edge_nd₃₄ : SegND P := SEG_nd qdr_nd.point₃ qdr_nd.point₄ +def edgeND₃₄ : SegND P := SEG_nd qdr_nd.point₃ qdr_nd.point₄ + +@[simp] +lemma edgeND₃₄_source : qdr_nd.edgeND₃₄.source = qdr_nd.point₃ := rfl + +@[simp] +lemma edgeND₃₄_target : qdr_nd.edgeND₃₄.target = qdr_nd.point₄ := rfl /-- The edge from the fourth point to the first point of a quadrilateral -/ @[pp_dot] -def edge_nd₁₄ : SegND P := SEG_nd qdr_nd.point₁ qdr_nd.point₄ +def edgeND₄₁ : SegND P := SEG_nd qdr_nd.point₄ qdr_nd.point₁ + +@[simp] +lemma edgeND₄₁_source : qdr_nd.edgeND₄₁.source = qdr_nd.point₄ := rfl + +@[simp] +lemma edgeND₄₁_target : qdr_nd.edgeND₄₁.target = qdr_nd.point₁ := rfl /--angle at point₁ of qdr_nd-/ @[pp_dot] @@ -253,15 +277,15 @@ variable {P : Type _} [EuclideanPlane P] {A B C D : P} structure is_convex_of_three_sides_of_same_side' where qdr_nd : Quadrilateral_nd P - same_side₁ : odist_sign qdr_nd.point₁ qdr_nd.edge_nd₃₄ = odist_sign qdr_nd.point₂ qdr_nd.edge_nd₃₄ - same_side₂ : odist_sign qdr_nd.point₂ qdr_nd.edge_nd₁₄.reverse = odist_sign qdr_nd.point₃ qdr_nd.edge_nd₁₄.reverse - same_side₃ : odist_sign qdr_nd.point₃ qdr_nd.edge_nd₁₂ = odist_sign qdr_nd.point₄ qdr_nd.edge_nd₁₂ + same_side₁ : odist_sign qdr_nd.point₁ qdr_nd.edgeND₃₄ = odist_sign qdr_nd.point₂ qdr_nd.edgeND₃₄ + same_side₂ : odist_sign qdr_nd.point₂ qdr_nd.edgeND₄₁ = odist_sign qdr_nd.point₃ qdr_nd.edgeND₄₁ + same_side₃ : odist_sign qdr_nd.point₃ qdr_nd.edgeND₁₂ = odist_sign qdr_nd.point₄ qdr_nd.edgeND₁₂ /- Given Quadrilateral_nd qdr_nd, if qdr_nd.point₁ and qdr_nd.point₂ are at the same side of qdr_nd.nd₃₄, and it also holds for nd₄₁ and nd₁₂, then it's convex. -/ theorem is_convex_of_three_sides_of_same_side (p : is_convex_of_three_sides_of_same_side' (P := P)) : p.qdr_nd IsConvex := by let qdr_nd := p.qdr_nd sorry - -- by_cases h : odist_sign qdr_nd.point₁ qdr_nd.edge_nd₃₄ = 1 + -- by_cases h : odist_sign qdr_nd.point₁ qdr_nd.edgeND₃₄ = 1 -- structure is_convex_of_diag_inx_lies_int' where @@ -466,50 +490,50 @@ instance nd₁₄ : PtNe qdr_cvx.point₄ qdr_cvx.point₁ := by infer_instance /-- The edge from the first point to the second point of a quadrilateral -/ @[pp_dot] -def edge_nd₁₂ : SegND P := SEG_nd qdr_cvx.point₁ qdr_cvx.point₂ +def edgeND₁₂ : SegND P := SEG_nd qdr_cvx.point₁ qdr_cvx.point₂ /-- The edge from the second point to the third point of a quadrilateral -/ @[pp_dot] -def edge_nd₂₃ : SegND P := SEG_nd qdr_cvx.point₂ qdr_cvx.point₃ +def edgeND₂₃ : SegND P := SEG_nd qdr_cvx.point₂ qdr_cvx.point₃ /-- The edge from the third point to the fourth point of a quadrilateral -/ @[pp_dot] -def edge_nd₃₄ : SegND P := SEG_nd qdr_cvx.point₃ qdr_cvx.point₄ +def edgeND₃₄ : SegND P := SEG_nd qdr_cvx.point₃ qdr_cvx.point₄ /-- The edge from the fourth point to the first point of a quadrilateral -/ @[pp_dot] -def edge_nd₁₄ : SegND P := SEG_nd qdr_cvx.point₁ qdr_cvx.point₄ +def edgeND₄₁.reverse : SegND P := SEG_nd qdr_cvx.point₁ qdr_cvx.point₄ -/ /-- Given a convex quadrilateral qdr_cvx, its 1st, 2nd and 3rd points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₁ point₂}$ is not the same as the projective direction of the vector $\overrightarrow{point₁ point₃}$. -/ -theorem not_collinear₁₂₃ : ¬ collinear qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₃ := sorry +theorem not_collinear₁₂₃ : ¬ Collinear qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₃ := sorry /-- Given a convex quadrilateral qdr_cvx, its 2nd, 3rd and 4th points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₂ point₃}$ is not the same as the projective direction of the vector $\overrightarrow{point₂ point₄}$. -/ -theorem not_collinear₂₃₄ : ¬ collinear qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.point₄ := sorry +theorem not_collinear₂₃₄ : ¬ Collinear qdr_cvx.point₂ qdr_cvx.point₃ qdr_cvx.point₄ := sorry /-- Given a convex quadrilateral qdr_cvx, its 3rd, 4th and 1st points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₃ point₄}$ is not the same as the projective direction of the vector $\overrightarrow{point₃ point₁}$. -/ -theorem not_collinear₃₄₁ : ¬ collinear qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ := sorry +theorem not_collinear₃₄₁ : ¬ Collinear qdr_cvx.point₃ qdr_cvx.point₄ qdr_cvx.point₁ := sorry /-- Given a convex quadrilateral qdr_cvx, its 4th, 1st and 3rd points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₃ point₄}$ is not the same as the projective direction of the vector $\overrightarrow{point₃ point₁}$. -/ -theorem not_collinear₄₁₃ : ¬ collinear qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₃ := sorry +theorem not_collinear₄₁₃ : ¬ Collinear qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₃ := sorry /-- Given a convex quadrilateral qdr_cvx, its 4th, 3rd and 1st points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₃ point₄}$ is not the same as the projective direction of the vector $\overrightarrow{point₃ point₁}$. -/ -theorem not_collinear₄₃₁ : ¬ collinear qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ := sorry +theorem not_collinear₄₃₁ : ¬ Collinear qdr_cvx.point₄ qdr_cvx.point₃ qdr_cvx.point₁ := sorry /-- Given a convex quadrilateral qdr_cvx, its 1st, 4th and 3rd points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₃ point₄}$ is not the same as the projective direction of the vector $\overrightarrow{point₃ point₁}$. -/ -theorem not_collinear₁₄₃ : ¬ collinear qdr_cvx.point₁ qdr_cvx.point₄ qdr_cvx.point₃ := sorry +theorem not_collinear₁₄₃ : ¬ Collinear qdr_cvx.point₁ qdr_cvx.point₄ qdr_cvx.point₃ := sorry /-- Given a convex quadrilateral qdr_cvx, its 4th, 1st and 2nd points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₄ point₁}$ is not the same as the projective direction of the vector $\overrightarrow{point₄ point₂}$. -/ -theorem not_collinear₄₁₂ : ¬ collinear qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₂ := sorry +theorem not_collinear₄₁₂ : ¬ Collinear qdr_cvx.point₄ qdr_cvx.point₁ qdr_cvx.point₂ := sorry /-- Given a convex quadrilateral qdr_cvx, its 2nd, 1st and 4th points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₄ point₁}$ is not the same as the projective direction of the vector $\overrightarrow{point₄ point₂}$. -/ -theorem not_collinear₂₁₄ : ¬ collinear qdr_cvx.point₂ qdr_cvx.point₁ qdr_cvx.point₄ := sorry +theorem not_collinear₂₁₄ : ¬ Collinear qdr_cvx.point₂ qdr_cvx.point₁ qdr_cvx.point₄ := sorry /-- Given a convex quadrilateral qdr_cvx, its 1st, 4th and 2nd points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₄ point₁}$ is not the same as the projective direction of the vector $\overrightarrow{point₄ point₂}$. -/ -theorem not_collinear₁₄₂ : ¬ collinear qdr_cvx.point₁ qdr_cvx.point₄ qdr_cvx.point₂ := sorry +theorem not_collinear₁₄₂ : ¬ Collinear qdr_cvx.point₁ qdr_cvx.point₄ qdr_cvx.point₂ := sorry /-- Given a convex quadrilateral qdr_cvx, its 1st, 2nd and 4th points are not collinear, i.e. the projective direction of the vector $\overrightarrow{point₄ point₁}$ is not the same as the projective direction of the vector $\overrightarrow{point₄ point₂}$. -/ -theorem not_collinear₁₂₄ : ¬ collinear qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ := sorry +theorem not_collinear₁₂₄ : ¬ Collinear qdr_cvx.point₁ qdr_cvx.point₂ qdr_cvx.point₄ := sorry -- We need to add a bunch of such theorems as they may be useful in discussing general quadrilaterals, i.e. not convex, even as contradictory in proofs. diff --git a/EuclideanGeometry/Foundation/Construction/Triangle/AngleBisector.lean b/EuclideanGeometry/Foundation/Construction/Triangle/AngleBisector.lean index 4e0ea66f..f4a6d9d1 100644 --- a/EuclideanGeometry/Foundation/Construction/Triangle/AngleBisector.lean +++ b/EuclideanGeometry/Foundation/Construction/Triangle/AngleBisector.lean @@ -177,12 +177,12 @@ theorem angbisline_of_angle₁_angle₂_not_parallel {tri_nd : TriangleND P} : rw [← h₂] at g sorry have er : A₁.end_ray.toDirLine = A₂.end_ray.toDirLine.reverse := by - have h₃ : A₁.end_ray = tri_nd.edge_nd₃.toRay := rfl - have h₄ : A₂.end_ray = tri_nd.edge_nd₃.reverse.toRay := rfl + have h₃ : A₁.end_ray = tri_nd.edgeND₃.toRay := rfl + have h₄ : A₂.end_ray = tri_nd.edgeND₃.reverse.toRay := rfl rw [h₃] rw [h₄] - have h₅ : tri_nd.edge_nd₃.reverse.toDirLine.reverse = tri_nd.edge_nd₃.reverse.reverse.toDirLine := by rw [SegND.toDirLine_rev_eq_rev_toDirLine] - have h₆ : tri_nd.edge_nd₃.reverse.reverse.toDirLine = tri_nd.edge_nd₃.toDirLine := rfl + have h₅ : tri_nd.edgeND₃.reverse.toDirLine.reverse = tri_nd.edgeND₃.reverse.reverse.toDirLine := by rw [SegND.toDirLine_rev_eq_rev_toDirLine] + have h₆ : tri_nd.edgeND₃.reverse.reverse.toDirLine = tri_nd.edgeND₃.toDirLine := rfl rw [h₆] at h₅ exact h₅.symm have g₁ : IsConsecutiveIntAng A₁ A₂ := ⟨sr, er⟩ diff --git a/EuclideanGeometry/Foundation/Tactic/Collinear/perm_collinear.lean b/EuclideanGeometry/Foundation/Tactic/Collinear/perm_collinear.lean index a8b5295e..4f2cedaa 100644 --- a/EuclideanGeometry/Foundation/Tactic/Collinear/perm_collinear.lean +++ b/EuclideanGeometry/Foundation/Tactic/Collinear/perm_collinear.lean @@ -8,7 +8,7 @@ variable {P : Type _} [EuclideanPlane P] def extractCollinear (expr : Q(Prop)) : MetaM (Option Expr) := match expr with - | ~q(@EuclidGeom.collinear _ (_) _ _ _) => + | ~q(@EuclidGeom.Collinear _ (_) _ _ _) => return .some expr | _ => return .none @@ -35,31 +35,31 @@ def evalPerm_collinear : Tactic := fun stx => catch _ => pure () try - let t <- `(tactic| refine flip_collinear_fst_snd $x0) + let t <- `(tactic| refine Collinear.perm₁₃₂ $x0) evalTactic t return catch _ => pure () try - let t <- `(tactic| refine flip_collinear_snd_trd $x0) + let t <- `(tactic| refine Collinear.perm₂₁₃ $x0) evalTactic t return catch _ => pure () try - let t <- `(tactic| refine flip_collinear_fst_snd (flip_collinear_snd_trd $x0)) + let t <- `(tactic| refine Collinear.perm₃₁₂ $x0) evalTactic t return catch _ => pure () try - let t <- `(tactic| refine flip_collinear_snd_trd (flip_collinear_fst_snd $x0)) + let t <- `(tactic| refine Collinear.perm₂₃₁ $x0) evalTactic t return catch _ => pure () try - let t <- `(tactic| refine flip_collinear_fst_snd (flip_collinear_snd_trd (flip_collinear_fst_snd $x0))) + let t <- `(tactic| refine Collinear.perm₃₂₁ $x0) evalTactic t return catch @@ -68,7 +68,7 @@ def evalPerm_collinear : Tactic := fun stx => | _ => throwUnsupportedSyntax -example {A B C : P} {h : collinear B C A} : collinear A B C := by +example {A B C : P} {h : Collinear B C A} : Collinear A B C := by perm_collinear end EuclidGeom diff --git a/EuclideanGeometry/Unused/Congruence.lean b/EuclideanGeometry/Unused/Congruence.lean index dc642119..af52f3ca 100644 --- a/EuclideanGeometry/Unused/Congruence.lean +++ b/EuclideanGeometry/Unused/Congruence.lean @@ -492,9 +492,9 @@ theorem cosine_eq_of_SSS (e₁ : tr_nd₁.1.edge₁.length = tr_nd₂.1.edge₁. rw [e₁,e₂,e₃,←cos₂] at cos₁ field_simp at cos₁ have u₁ : 0 < tr_nd₂.1.edge₃.length := by - exact length_pos_iff_nd.mpr tr_nd₂.edge_nd₃.2 + exact length_pos_iff_nd.mpr tr_nd₂.edgeND₃.2 have u₂ : 0 < tr_nd₂.1.edge₂.length := by - exact length_pos_iff_nd.mpr tr_nd₂.edge_nd₂.2 + exact length_pos_iff_nd.mpr tr_nd₂.edgeND₂.2 have h0 : (tr_nd₂.1.edge₃.length * tr_nd₂.1.edge₂.length) > 0 := by field_simp [u₁,u₂] rcases cos₁ with x | y diff --git a/EuclideanGeometry/Unused/Line.lean b/EuclideanGeometry/Unused/Line.lean index 6b1b7bf9..186216a7 100644 --- a/EuclideanGeometry/Unused/Line.lean +++ b/EuclideanGeometry/Unused/Line.lean @@ -4,17 +4,17 @@ noncomputable section namespace EuclidGeom @[ext] -class Line (P : Type _) [EuclideanPlane P] where +class Line (P : Type _) [EuclideanPlane P] where carrier : Set P - linear : ∀ (A B C : P), (A ∈ carrier) → (B ∈ carrier) → (C ∈ carrier) → collinear A B C - maximal : ∀ (A B : P), (A ∈ carrier) → (B ∈ carrier) → (B ≠ A) → (∀ (C : P), collinear A B C → (C ∈ carrier)) + linear : ∀ (A B C : P), (A ∈ carrier) → (B ∈ carrier) → (C ∈ carrier) → Collinear A B C + maximal : ∀ (A B : P), (A ∈ carrier) → (B ∈ carrier) → (B ≠ A) → (∀ (C : P), Collinear A B C → (C ∈ carrier)) nontriv : ∃ (A B : P), (A ∈ carrier) ∧ (B ∈ carrier) ∧ (B ≠ A) namespace Line -variable {P : Type _} [EuclideanPlane P] +variable {P : Type _} [EuclideanPlane P] --- define a line from two points +-- define a line from two points def mk_pt_pt (A B : P) (h : B ≠ A) : Line P where carrier := {C : P | ∃ t : ℝ, VEC A C = t • VEC A B} @@ -36,13 +36,13 @@ def mk_pt_pt (A B : P) (h : B ≠ A) : Line P where · have h' : (ty = tx) ∨ (tz = tx) ∨ (ty = tz) := by tauto by_cases ty = tx · rw [pt_eq_pt_of_eq_smul_smul h hy hx] - exact triv_collinear _ _ + exact triv_collinear₁₂ _ _ · by_cases tz = tx · rw [pt_eq_pt_of_eq_smul_smul h hz hx] - exact flip_collinear_snd_trd $ triv_collinear _ _ + exact Collinear.perm₁₃₂ $ triv_collinear₁₂ _ _ · have h : ty = tz := by tauto rw [pt_eq_pt_of_eq_smul_smul h hy hz] - exact flip_collinear_fst_snd $ flip_collinear_snd_trd $ triv_collinear _ _ + exact Collinear.perm₂₁₃ $ Collinear.perm₁₃₂ $ triv_collinear₁₂ _ _ maximal x y := by unfold Membership.mem Set.instMembershipSet Set.Mem setOf simp only [forall_exists_index] @@ -67,7 +67,7 @@ def mk_pt_pt (A B : P) (h : B ≠ A) : Line P where end Line -scoped notation "LIN" => Line.mk_pt_pt +scoped notation "LIN" => Line.mk_pt_pt namespace Line @@ -82,12 +82,12 @@ instance : Carrier P (Line P) where end Line --- Now we introduce useful theorems to avoid using more unfolds in further proofs. +-- Now we introduce useful theorems to avoid using more unfolds in further proofs. variable {P : Type _} [EuclideanPlane P] section Compaitiblity_of_coercions_of_mk_pt_pt --- The first point and the second point in Line.mk_pt_pt LiesOn the line it make. +-- The first point and the second point in Line.mk_pt_pt LiesOn the line it make. theorem fst_pt_lies_on_line_of_pt_pt {A B : P} (h : B ≠ A) : A LiesOn LIN A B h := by unfold lies_on Carrier.carrier Line.instCarrierLine @@ -110,7 +110,7 @@ theorem pt_lies_on_line_of_pt_pt_of_ne {A B : P} (h: B ≠ A) : A LiesOn LIN A B exact fst_pt_lies_on_line_of_pt_pt h exact snd_pt_lies_on_line_of_pt_pt h -theorem lies_on_line_of_pt_pt_iff_collinear {A B : P} (h : B ≠ A) : ∀ X : P, (X LiesOn (LIN A B h)) ↔ collinear A B X := by +theorem lies_on_line_of_pt_pt_iff_collinear {A B : P} (h : B ≠ A) : ∀ X : P, (X LiesOn (LIN A B h)) ↔ Collinear A B X := by intro X constructor intro hx @@ -164,7 +164,7 @@ def Line.toProj (l : Line P) : Proj := -- by choose pr _ using (exist_unique_proj_of_line l) -- exact pr --- If you don't want to use Classical.choose, please use this theorem to simplify your Line.toProj. +-- If you don't want to use Classical.choose, please use this theorem to simplify your Line.toProj. theorem line_toProj_eq_seg_nd_toProj_of_lies_on {A B : P} {l : Line P} (ha : A LiesOn l) (hb : B LiesOn l) (hab : B ≠ A) : SegND.toProj ⟨SEG A B, hab⟩ = l.toProj := (Classical.choose_spec (exist_unique_proj_of_line l)).1 A B ha hb hab @@ -180,7 +180,7 @@ section Compatibility_of_LiesOn -- This is also a typical proof that shows how to use the four conditions in the def of a line. Please write it shorter in future. -theorem lies_on_iff_collinear_of_ne_lies_on_lies_on {A B : P} {l : Line P} (h : B ≠ A) (ha : A LiesOn l) (hb : B LiesOn l) : ∀ C : P, (C LiesOn l) ↔ collinear A B C := by +theorem lies_on_iff_collinear_of_ne_lies_on_lies_on {A B : P} {l : Line P} (h : B ≠ A) (ha : A LiesOn l) (hb : B LiesOn l) : ∀ C : P, (C LiesOn l) ↔ Collinear A B C := by intro C constructor intro hc @@ -219,13 +219,13 @@ theorem eq_line_of_pt_pt_of_ne {A B : P} {l : Line P} (h : B ≠ A) (ha : A Lies theorem eq_of_pt_pt_lies_on_of_ne {A B : P} (h : B ≠ A) {l₁ l₂ : Line P}(hA₁ : A LiesOn l₁) (hB₁ : B LiesOn l₁) (hA₂ : A LiesOn l₂) (hB₂ : B LiesOn l₂) : l₁ = l₂ := sorry -theorem collinear_iff_exist_line_lies_on (A B C : P) : collinear A B C ↔ ∃ l : Line P, (A LiesOn l) ∧ (B LiesOn l) ∧ (C LiesOn l) := by +theorem collinear_iff_exist_line_lies_on (A B C : P) : Collinear A B C ↔ ∃ l : Line P, (A LiesOn l) ∧ (B LiesOn l) ∧ (C LiesOn l) := by sorry end Compatibility_of_LiesOn /- def coe from ray to line-/ -def Ray.toLine (r : Ray P) := LIN r.source (r.toDir.toVec +ᵥ r.source) (by +def Ray.toLine (r : Ray P) := LIN r.source (r.toDir.toVec +ᵥ r.source) (by simp only [ne_eq, vadd_eq_self_iff_vec_eq_zero] exact Dir.toVec_ne_zero r.toDir) @@ -284,12 +284,12 @@ theorem lies_on_of_SegND_toProj_eq_toProj {A B : P} {l : Line P} (ha : A LiesOn let g := line_toProj_eq_seg_nd_toProj_of_lies_on ha h.1 h.2 rw [← hp] at g unfold SegND.toProj SegND.toVecND at g - simp only [ne_eq] at g - have c : collinear A X B := by - rw [← iff_true (collinear A X B), ← eq_iff_iff] - unfold collinear collinear_of_nd + simp only [ne_eq] at g + have c : Collinear A X B := by + rw [← iff_true (Collinear A X B), ← eq_iff_iff] + unfold Collinear collinear_of_nd simp [g] - by_cases (B = X ∨ A = B ∨ X = A) + by_cases (B = X ∨ A = B ∨ X = A) · simp only [h, dite_eq_ite] · simp only [h, dite_eq_ite] exact (lies_on_iff_collinear_of_ne_lies_on_lies_on h.2 ha h.1 B).2 c @@ -307,8 +307,8 @@ end Archimedean_property section Line_passing_point_with_given_Proj theorem exist_line_of_pt_proj (A : P) (pr : Proj) : ∃ l : Line P, A LiesOn l ∧ l.toProj = pr := by - rcases Quot.exists_rep pr with ⟨dir, hd⟩ - let r : Ray P := ⟨A, dir⟩ + rcases Quot.exists_rep pr with ⟨dir, hd⟩ + let r : Ray P := ⟨A, dir⟩ use r.toLine constructor exact Ray.lies_on_toLine_of_lie_on (Ray.source_lies_on r) @@ -326,12 +326,12 @@ theorem exist_unique_line_of_pt_proj (A : P) (pr : Proj) : ∃! l : Line P, A Li simp only [ne_eq, vadd_eq_self_iff_vec_eq_zero, Dir.toVec_ne_zero dir, not_false_eq_true] apply (lies_on_iff_lies_on_iff_line_eq_line l₂ l₁).1 intro X - by_cases X = A + by_cases X = A · rw [h] tauto · rw [lies_on_iff_eq_toProj_of_lies_on hl₁.1 h, hl₁.2, lies_on_iff_eq_toProj_of_lies_on hl₂.1 h, hl₂.2] -def Line.mk_pt_proj (A : P) (pr : Proj) : Line P := +def Line.mk_pt_proj (A : P) (pr : Proj) : Line P := Classical.choose (exist_unique_line_of_pt_proj A pr) theorem pt_lies_on_and_proj_eq_of_line_mk_pt_proj (A : P) (pr : Proj) : A LiesOn (Line.mk_pt_proj A pr) ∧ (Line.mk_pt_proj A pr).toProj = pr := by @@ -339,4 +339,4 @@ theorem pt_lies_on_and_proj_eq_of_line_mk_pt_proj (A : P) (pr : Proj) : A LiesOn end Line_passing_point_with_given_Proj -end EuclidGeom \ No newline at end of file +end EuclidGeom diff --git a/EuclideanGeometry/Unused/Parallel.lean b/EuclideanGeometry/Unused/Parallel.lean index 9890eacd..70a11350 100644 --- a/EuclideanGeometry/Unused/Parallel.lean +++ b/EuclideanGeometry/Unused/Parallel.lean @@ -61,7 +61,7 @@ scoped infix : 50 " LiesOnarObj " => LinearObj.IsOnLinearObj -- Our definition of parallel for LinearObj is very general. Not only can it apply to different types of Objs, but also include degenerate cases, such as ⊆(inclusions), =(equal). -def parallel' {α β: Type _} (l₁ : α) (l₂ : β) [Coe α (LinearObj P)] [Coe β (LinearObj P)] : Prop := LinearObj.toProj (P := P) (Coe.coe l₁) = LinearObj.toProj (P := P) (Coe.coe l₂) +def Parallel' {α β: Type _} (l₁ : α) (l₂ : β) [Coe α (LinearObj P)] [Coe β (LinearObj P)] : Prop := LinearObj.toProj (P := P) (Coe.coe l₁) = LinearObj.toProj (P := P) (Coe.coe l₂) -- class PlaneFigure' (P : Type _) [EuclideanPlane P] {α : Type _} where @@ -69,22 +69,22 @@ def parallel' {α β: Type _} (l₁ : α) (l₂ : β) [Coe α (LinearObj P)] [Co -def parallel (l₁ l₂: LinearObj P) : Prop := l₁.toProj = l₂.toProj +def Parallel (l₁ l₂: LinearObj P) : Prop := l₁.toProj = l₂.toProj -instance : IsEquiv (LinearObj P) parallel where +instance : IsEquiv (LinearObj P) Parallel where refl _ := rfl symm _ _ := Eq.symm trans _ _ _ := Eq.trans -scoped infix : 50 " ParallelTo " => parallel +scoped infix : 50 " ParallelTo " => Parallel -scoped infix : 50 " ∥ " => parallel +scoped infix : 50 " ∥ " => Parallel /- lots of trivial parallel relation of vec of 2 pt lies on Line, coercions, ... -/ section parallel_theorem -theorem ray_parallel_toLine_assoc_ray (ray : Ray P) : parallel (LinearObj.ray ray) ray.toLine := sorry +theorem ray_parallel_toLine_assoc_ray (ray : Ray P) : Parallel (LinearObj.ray ray) ray.toLine := sorry theorem seg_parallel_toRay_assoc_seg_of_nontriv (seg_nd : SegND P) : LinearObj.seg_nd seg_nd ∥ seg_nd.toRay := sorry diff --git a/EuclideanGeometry/Unused/Parallelogram.lean b/EuclideanGeometry/Unused/Parallelogram.lean index cc685ba5..319900a3 100644 --- a/EuclideanGeometry/Unused/Parallelogram.lean +++ b/EuclideanGeometry/Unused/Parallelogram.lean @@ -7,8 +7,8 @@ noncomputable section namespace EuclidGeom class Parallelogram (P : Type _) [EuclideanPlane P] extends Quadrilateral_cvx P where - para : LinearObj.seg_nd toQuadrilateral_cvx.edge_nd₁₂ ∥ toQuadrilateral_cvx.edge_nd₃₄ - para' : LinearObj.seg_nd toQuadrilateral_cvx.edge_nd₂₃ ∥ toQuadrilateral_cvx.edge_nd₄₁ + para : LinearObj.seg_nd toQuadrilateral_cvx.edgeND₁₂ ∥ toQuadrilateral_cvx.edgeND₃₄ + para' : LinearObj.seg_nd toQuadrilateral_cvx.edgeND₂₃ ∥ toQuadrilateral_cvx.edgeND₄₁ /- section make @@ -23,7 +23,7 @@ end Parallelogram end make -/ -def Quadrilateral_cvx.is_parallelogram {P : Type _} [EuclideanPlane P] (qdr_cvx : Quadrilateral_cvx P) : Prop := (LinearObj.seg_nd qdr_cvx.edge_nd₁₂ ∥ qdr_cvx.edge_nd₃₄) ∧ (LinearObj.seg_nd qdr_cvx.edge_nd₂₃ ∥ qdr_cvx.edge_nd₄₁) +def Quadrilateral_cvx.is_parallelogram {P : Type _} [EuclideanPlane P] (qdr_cvx : Quadrilateral_cvx P) : Prop := (LinearObj.seg_nd qdr_cvx.edgeND₁₂ ∥ qdr_cvx.edgeND₃₄) ∧ (LinearObj.seg_nd qdr_cvx.edgeND₂₃ ∥ qdr_cvx.edgeND₄₁) def Quadrilateral.is_parallelogram {P : Type _} [EuclideanPlane P] (qdr : Quadrilateral P) : Prop := by by_cases qdr.IsConvex diff --git a/EuclideanGeometry/Unused/Unused.lean b/EuclideanGeometry/Unused/Unused.lean index b375008c..97a83b27 100644 --- a/EuclideanGeometry/Unused/Unused.lean +++ b/EuclideanGeometry/Unused/Unused.lean @@ -250,7 +250,7 @@ class Triangle' (P : Type _) [EuclideanPlane P] where point₁ : P point₂ : P point₃ : P - nontriv : ¬ collinear point₁ point₂ point₃ + nontriv : ¬ Collinear point₁ point₂ point₃ namespace Triangle @@ -286,20 +286,20 @@ scoped infix : 50 " IsInsideLTriangle " => Triangle.IsInside end nondeg_tri -section collinear +section Collinear variable {P : Type _} [EuclideanPlane P] -theorem collinear_ACB_of_collinear_ABC {A B C : P} (h : collinear A B C): collinear A C B := sorry +theorem collinear_ACB_of_collinear_ABC {A B C : P} (h : Collinear A B C): Collinear A C B := sorry -theorem collinear_BAC_of_collinear_ABC {A B C : P} (h : collinear A B C): collinear B A C := sorry +theorem collinear_BAC_of_collinear_ABC {A B C : P} (h : Collinear A B C): Collinear B A C := sorry -theorem collinear_BCA_of_collinear_ABC {A B C : P} (h : collinear A B C): collinear B C A := sorry +theorem collinear_BCA_of_collinear_ABC {A B C : P} (h : Collinear A B C): Collinear B C A := sorry -theorem collinear_CAB_of_collinear_ABC {A B C : P} (h : collinear A B C): collinear C A B := sorry +theorem collinear_CAB_of_collinear_ABC {A B C : P} (h : Collinear A B C): Collinear C A B := sorry -theorem collinear_CBA_of_collinear_ABC {A B C : P} (h : collinear A B C): collinear C B A := sorry -end collinear +theorem collinear_CBA_of_collinear_ABC {A B C : P} (h : Collinear A B C): Collinear C B A := sorry +end Collinear /-! section HasFallsOn @@ -355,12 +355,12 @@ scoped notation p "IsIntersectionOf" A B => IsIntersectionPoint p A B class HasProj (α : Type _) where toProj : (α → Proj) -def parallel {α β : Type _} (A : α) (B : β) [HasProj α] [HasProj β] : Prop := HasProj.toProj A = HasProj.toProj B +def Parallel {α β : Type _} (A : α) (B : β) [HasProj α] [HasProj β] : Prop := HasProj.toProj A = HasProj.toProj B -scoped notation A "IsParallelTo" B => parallel A B -scoped notation A "∥" B => parallel A B +scoped notation A "IsParallelTo" B => Parallel A B +scoped notation A "∥" B => Parallel A B -namespace parallel +namespace Parallel protected theorem refl {α : Type _} (A : α) [HasProj α] : A ∥ A := rfl @@ -368,20 +368,20 @@ protected theorem symm {α β : Type _} (A : α) (B : β) [HasProj α] [HasProj protected theorem trans {α β γ : Type _} (A : α) (B : β) (C : γ) [HasProj α] [HasProj β] [HasProj γ]: (A ∥ B) → (B ∥ C) → (A ∥ C) := Eq.trans -end parallel +end Parallel -def perpendicular {α β : Type _} (A : α) (B : β) [HasProj α] [HasProj β] : Prop := sorry +def Perpendicular {α β : Type _} (A : α) (B : β) [HasProj α] [HasProj β] : Prop := sorry -scoped notation A "IsPerpendicularTo" B => perpendicular A B -scoped notation A "⟂" B => perpendicular A B +scoped notation A "IsPerpendicularTo" B => Perpendicular A B +scoped notation A "⟂" B => Perpendicular A B -namespace perpendicular +namespace Perpendicular protected theorem irrefl {α : Type _} (A : α) [HasProj α] : ¬ (A ⟂ A) := by sorry protected theorem symm {α β : Type _} (A : α) (B : β) [HasProj α] [HasProj β] : (A ⟂ B) → (B ⟂ A) := sorry -end perpendicular +end Perpendicular theorem parallel_of_perp_perp {α β γ : Type _} (A : α) (B : β) (C : γ) [HasProj α] [HasProj β] [HasProj γ] : (A ⟂ B) → (B ⟂ C) → (A ∥ C) := sorry -/ -/ diff --git a/EuclideanGeometry/Unused/notes-2023-20-19.txt b/EuclideanGeometry/Unused/notes-2023-20-19.txt index c84d5332..41a44b34 100644 --- a/EuclideanGeometry/Unused/notes-2023-20-19.txt +++ b/EuclideanGeometry/Unused/notes-2023-20-19.txt @@ -7,7 +7,7 @@ Structure of Tactic: LinearOrder Input: ⬝ goal (check that it is of the form C LiesOn/LiesIn SEG_nd A B h, or extensions) - ⬝ get all known hypotheses including, LiesOn/LiesIn, extension, collinear, ¬ ▵.IsND, points being equal, and etc. (Each such statement may also provide certain information regarding point positions) + ⬝ get all known hypotheses including, LiesOn/LiesIn, extension, Collinear, ¬ ▵.IsND, points being equal, and etc. (Each such statement may also provide certain information regarding point positions) Additional concepts/theorems to be established: ⬝ Given RAY A B h, and two points C D such that C D LiesOn LIN A B h, whether C < D for the direction or now, and related compatibility theorems, and conversion theorems to LiesOn/LiesIn etc. diff --git a/Plan_files/DetailedPlan/Axiom-Linear.tex b/Plan_files/DetailedPlan/Axiom-Linear.tex index 569376ca..917d0d28 100644 --- a/Plan_files/DetailedPlan/Axiom-Linear.tex +++ b/Plan_files/DetailedPlan/Axiom-Linear.tex @@ -149,7 +149,7 @@ \section{Content in Colinarity.lean} Definitions : (defn) collinear_of_nd : Prop -- Given three distinct points (A B C : P), return whether the three points are collinear, i.e. whether (VEC A B).toProj = (VEC A C).toProj - (defn) collinear : Prop -- Given three points (A B C : P), return whether they are collinear; if at least two of them are equal, then they are considered automatically collinear. + (defn) Collinear : Prop -- Given three points (A B C : P), return whether they are collinear; if at least two of them are equal, then they are considered automatically collinear. Theorems : collinear_of_vec_eq_smul_vec -- Given three points (A B C : P), if VEC A C = t ⬝ VEC A B for some t ∈ ℝ, then A B C are collinear diff --git a/Plan_files/DetailedPlan/Axiom-Linear.txt b/Plan_files/DetailedPlan/Axiom-Linear.txt index 6a3481e7..c3c1e322 100644 --- a/Plan_files/DetailedPlan/Axiom-Linear.txt +++ b/Plan_files/DetailedPlan/Axiom-Linear.txt @@ -363,13 +363,13 @@ Theorem \verb|collinear_of_vec_eq_smul_vec'|: Given three points $A$, $B$, $C$, Theorem \verb|collinear_iff_eq_smul_vec_of_ne|: Given three points $A$, $B$, $C$ such that $B \neq A$, we have $A$, $B$, $C$ are collinear if and only if the vector $\overrightarrow{AC}$ is a scalar multiple of the vector $\overrightarrow{AB}$. \item -Theorem \verb|triv_collinear|: For any two points $A$ and $C$, the points $A$, $A$, $C$ are collinear. +Theorem \verb|triv_collinear₁₂|: For any two points $A$ and $C$, the points $A$, $A$, $C$ are collinear. \item -Theorem \verb|flip_collinear_snd_trd|: Given three points $A$, $B$, and $C$, if $A$, $B$, $C$ are collinear (in that order), then $A$, $C$, $B$ are collinear (in that order); in other words, swapping the last two of the three points does not change the definition of colinarity. +Theorem \verb|Collinear.perm₁₃₂|: Given three points $A$, $B$, and $C$, if $A$, $B$, $C$ are collinear (in that order), then $A$, $C$, $B$ are collinear (in that order); in other words, swapping the last two of the three points does not change the definition of colinarity. \item -Theorem \verb|flip_collinear_fst_snd|: Given three points $A$, $B$, and $C$, if $A$, $B$, $C$ are collinear (in that order), then $B$, $A$, $C$ are collinear (in that order); in other words, in the definition of colinarity, swapping the first two of the three points does not change property of the three points being collinear. +Theorem \verb|Collinear.perm₂₁₃|: Given three points $A$, $B$, and $C$, if $A$, $B$, $C$ are collinear (in that order), then $B$, $A$, $C$ are collinear (in that order); in other words, in the definition of colinarity, swapping the first two of the three points does not change property of the three points being collinear. \item Theorem \verb|collinear_of_collinear_collinear_ne|: Given four points $A$, $B$, $C$, $D$ with $B \neq A$, if $A$, $B$, $C$ are collinear, and if $A$, $B$, $D$ are collinear, then $A$, $C$, $D$ are collinear. diff --git a/Plan_files/DetailedPlan/Axiom-Linear_Object.lean b/Plan_files/DetailedPlan/Axiom-Linear_Object.lean index 059eb579..6a68c0af 100644 --- a/Plan_files/DetailedPlan/Axiom-Linear_Object.lean +++ b/Plan_files/DetailedPlan/Axiom-Linear_Object.lean @@ -14,7 +14,7 @@ Ray.lean -- Define (directed) segments and rays SEG_nd = SegND.mk -- Rewrite the standard function of making a nondegenerate segment; i.e. for (A B : P) and (nd : B ≠ A), SEG_nd A B nd gives the nondegenerate segment with source A and target B. Ray.mk_pt_pt -- Given two points (A B : P) and that they are not equal (nd : B ≠ A), Ray.mk_pt_pt A B nd returns the ray starting from A in the direction of B, i.e. (SEG_nd A B nd).toRay. RAY = Ray.mk_pt_pt -- Rewrite the making function of a ray from points (A B : P) and (nd : B ≠ A). - + Coersion : Ray.toProj -- Given a (ray : Ray P), ray.toProj returns the Proj of a ray (defined from Ray.toDir) Ray.IsOn -- Given (a : P) (ray : Ray P), IsOn a ray is the property that point lies on a ray, namely, ∃ (t : ℝ), 0 ≤ t ∧ VEC ray.source a = t • ray.toDir.toVec. @@ -98,7 +98,7 @@ Ray.lean -- Define (directed) segments and rays Seg.midpt_lies_on -- midpoint of a segment lies in its carrier SegND.midpt_lies_int -- if a segment is nondegenerate, the midpoint lies in its interior midpt_iff_same_toVec_source_and_target -- a point is the midpoint of a segment iff (SEG l.source p).toVec = (SEG p l.target).toVec - + dist_target_eq_dist_source_of_midpt -- the midpoint of a segment has equal distance to the source and the target is_midpoint_iff_in_seg_and_dist_target_eq_dist_source -- a point is the midpoint of a segment if and only if it lies on the segment and it has same distance to the source and target @@ -116,13 +116,13 @@ Colinarity.lean -- Define the relative positions of points on rays Definitions : (defn) collinear_of_nd : Prop -- Given three distinct points (A B C : P), return whether the three points are collinear, i.e. whether (VEC A B).toProj = (VEC A C).toProj - (defn) collinear : Prop -- Given three points (A B C : P), return whether they are collinear; if at least two of them are equal, then they are considered automatically collinear. - + (defn) Collinear : Prop -- Given three points (A B C : P), return whether they are collinear; if at least two of them are equal, then they are considered automatically collinear. + Theorems : collinear_of_vec_eq_smul_vec -- Given three points (A B C : P), if VEC A C = t ⬝ VEC A B for some t ∈ ℝ, then A B C are collinear collinear_of_vec_eq_smul_vec' -- same as collinear_of_vec_eq_smul_vec, excepted stated in the form of existence of t collinear_iff_eq_smul_vec_of_ne -- Given three points (A B C : P) with (B ≠ A), then A B C are collinear if and only if VEC A C = r ⬝ VEC A B for some r ∈ ℝ - + -/ @@ -130,14 +130,14 @@ Colinarity.lean -- Define the relative positions of points on rays /-! Line.lean -- Define lines - Setoid : + Setoid : same_extn_line -- the equivalent relation of admitting the same underlying line on rays - Classes : + Classes : class of Line -- define Line as the quotient of Ray with respect to relation same_extn_line Make : - LIN = Line.mk_pt_pt -- + LIN = Line.mk_pt_pt -- Line.mk_pt_proj -- Line.mk_pt_dir -- Line.mk_pt_vec_nd -- @@ -163,7 +163,7 @@ Line.lean -- Define lines snd_pt_lies_on_line_of_pt_pt -- eq_line_of_pt_pt_of_ne -- eq_of_pt_pt_lies_on_of_ne -- 2 ne pts lies on 2 lines implies 2 lines are the same - coercion : theorems related to coercions + coercion : theorems related to coercions SegND.toLine_eq_toRay_toLine -- line_of_pt_pt_eq_ray_toLine -- line_of_pt_pt_eq_seg_nd_toLine -- @@ -191,5 +191,5 @@ Line.lean -- Define lines lies_on_of_SegND_toProj_eq_toProj -- lies_on_iff_eq_toProj_of_lies_on -- Line.exist_pt_beyond_pt -- - --/ \ No newline at end of file + +-/