diff --git a/EuclideanGeometry/Foundation/Axiom/Basic/Angle/AddToMathlib.lean b/EuclideanGeometry/Foundation/Axiom/Basic/Angle/AddToMathlib.lean index 001f0314..cf1e229c 100644 --- a/EuclideanGeometry/Foundation/Axiom/Basic/Angle/AddToMathlib.lean +++ b/EuclideanGeometry/Foundation/Axiom/Basic/Angle/AddToMathlib.lean @@ -1,4 +1,5 @@ import EuclideanGeometry.Foundation.Axiom.Basic.Angle.FromMathlib +import Mathlib.Data.Int.Parity /-! # Theorems that should exist in Mathlib @@ -7,6 +8,7 @@ Maybe we can create some PRs to mathlib in the future. -/ open Real +attribute [ext] Complex.ext /-! ## More theorems about trigonometric functions in Mathlib diff --git a/EuclideanGeometry/Foundation/Axiom/Basic/Vector.lean b/EuclideanGeometry/Foundation/Axiom/Basic/Vector.lean index b281f8c4..4463af3f 100644 --- a/EuclideanGeometry/Foundation/Axiom/Basic/Vector.lean +++ b/EuclideanGeometry/Foundation/Axiom/Basic/Vector.lean @@ -184,7 +184,7 @@ lemma toComplex_inv (z : ๐•œ) : โ†‘(zโปยน) = (z : โ„‚)โปยน := by ext <;> simp @[simp, norm_cast] lemma abs_toComplex (z : ๐•œ) : Complex.abs (z : โ„‚) = โ€–zโ€– := by - rw [โ† pow_left_inj (map_nonneg _ _) (norm_nonneg _) zero_lt_two, + rw [โ† pow_left_inj (map_nonneg _ _) (norm_nonneg _) two_ne_zero, Complex.sq_abs, Complex.normSq_apply, norm_sq_eq_def] rfl @@ -400,7 +400,7 @@ instance innerProductSpace' : InnerProductSpace โ„ Vec where norm_sq_eq_inner v := by simp [norm_sq] conj_symm vโ‚ vโ‚‚ := by simp [Complex.conj_ofReal, mul_comm] add_left vโ‚ vโ‚‚ vโ‚ƒ := by dsimp; ring - smul_left vโ‚ vโ‚‚ z := by dsimp; ring + smul_left vโ‚ vโ‚‚ z := by dsimp; simp; ring lemma real_inner_apply (vโ‚ vโ‚‚ : Vec) : โŸชvโ‚, vโ‚‚โŸซ_โ„ = vโ‚.fst * vโ‚‚.fst + vโ‚.snd * vโ‚‚.snd := @@ -694,7 +694,7 @@ lemma cdiv_eq_cdiv_iff_cdiv_eq_cdiv {vโ‚ vโ‚‚ vโ‚ƒ vโ‚„ : Vec} (hvโ‚‚ : vโ‚‚ @[simp] lemma abs_inner (vโ‚ vโ‚‚ : Vec) : Complex.abs โŸชvโ‚, vโ‚‚โŸซ_โ„‚ = โ€–vโ‚โ€– * โ€–vโ‚‚โ€– := by - rw [โ† pow_left_inj (by simp) (by positivity) zero_lt_two] + rw [โ† pow_left_inj (by simp) (by positivity) two_ne_zero] rw [Complex.abs_apply, sq_sqrt (Complex.normSq_nonneg _)] dsimp [inner, det] rw [mul_pow, norm_sq, norm_sq] @@ -1582,7 +1582,7 @@ theorem map_trans (f g : Dir โ‰ƒ Dir) {_ : Dir.NegCommute f} {_ : Dir.NegCommute Proj.map (f.trans g) = (Proj.map f).trans (Proj.map g) := by ext p induction p using Proj.ind - + simp instance : Nonempty Proj := (nonempty_quotient_iff _).mpr <| inferInstanceAs (Nonempty Dir) diff --git a/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean b/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean index 3edcd92f..f2831ebf 100644 --- a/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean +++ b/EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean @@ -170,7 +170,7 @@ theorem CC_inscribe_point_centers_colinear {ฯ‰โ‚ : Circle P} {ฯ‰โ‚‚ : Circle P} apply colinear_of_vec_eq_smul_vec this -theorem CC_included_pt_isint_second_circle {ฯ‰โ‚ : Circle P} {ฯ‰โ‚‚ : Circle P} {A : P} (hโ‚ : ฯ‰โ‚ IncludeIn ฯ‰โ‚‚) (hโ‚‚ : A LiesOn ฯ‰โ‚) : Circle.IsInt A ฯ‰โ‚‚ := by +theorem CC_included_pt_isint_second_circle {ฯ‰โ‚ : Circle P} {ฯ‰โ‚‚ : Circle P} {A : P} (hโ‚ : ฯ‰โ‚ IncludeIn ฯ‰โ‚‚) (hโ‚‚ : A LiesOn ฯ‰โ‚) : A LiesInt ฯ‰โ‚‚ := by have : dist ฯ‰โ‚‚.center A < ฯ‰โ‚‚.radius := by calc _ โ‰ค dist ฯ‰โ‚.center ฯ‰โ‚‚.center + dist ฯ‰โ‚.center A := by apply dist_triangle_left @@ -253,14 +253,12 @@ theorem CC_inx_pts_distinct {ฯ‰โ‚ : Circle P} {ฯ‰โ‚‚ : Circle P} (h : ฯ‰โ‚ Int rw [โ† sub_smul] simp push_neg - constructor - ยท apply Real.sqrt_ne_zero'.mpr - have hlt : (radical_axis_dist_to_the_first ฯ‰โ‚ ฯ‰โ‚‚) ^ 2 < ฯ‰โ‚.radius ^ 2 := by - apply sq_lt_sq.mpr - rw [abs_of_pos ฯ‰โ‚.rad_pos] - exact radical_axis_dist_lt_radius h - linarith - exact Complex.I_ne_zero + apply Real.sqrt_ne_zero'.mpr + have hlt : (radical_axis_dist_to_the_first ฯ‰โ‚ ฯ‰โ‚‚) ^ 2 < ฯ‰โ‚.radius ^ 2 := by + apply sq_lt_sq.mpr + rw [abs_of_pos ฯ‰โ‚.rad_pos] + exact radical_axis_dist_lt_radius h + linarith theorem CC_inx_pts_lieson_circles {ฯ‰โ‚ : Circle P} {ฯ‰โ‚‚ : Circle P} (h : ฯ‰โ‚ Intersect ฯ‰โ‚‚) : ((CC_Intersected_pts h).left LiesOn ฯ‰โ‚) โˆง ((CC_Intersected_pts h).left LiesOn ฯ‰โ‚‚) โˆง ((CC_Intersected_pts h).right LiesOn ฯ‰โ‚) โˆง ((CC_Intersected_pts h).right LiesOn ฯ‰โ‚‚) := by haveI : PtNe ฯ‰โ‚.center ฯ‰โ‚‚.center := โŸจCC_intersected_centers_distinct hโŸฉ