Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the silly theorem of cclock and angle pos #278

Merged
merged 8 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion EuclideanGeometry/Foundation/Axiom/Basic/Angle.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EuclideanGeometry.Foundation.Axiom.Basic.Angle.AddToMathlib

import Mathlib.Data.Int.Parity
/-!
# Angle Conversions

Expand All @@ -16,6 +16,8 @@ In this file, we define suitable coversion function between `ℝ⧸2π`,`ℝ⧸

noncomputable section

attribute [ext] Complex.ext

namespace EuclidGeom

open AngValue Classical Real
Expand Down
1 change: 1 addition & 0 deletions EuclideanGeometry/Foundation/Axiom/Basic/Plane.lean
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ theorem vadd_eq_self_iff_vec_eq_zero {A : P} {v : Vec} : v +ᵥ A = A ↔ v = 0
theorem vec_same_eq_zero (A : P) : VEC A A = 0 := by
rw [Vec.mkPtPt, vsub_self]

@[simp]
theorem neg_vec (A B : P) : - VEC A B = VEC B A := by
rw [Vec.mkPtPt, Vec.mkPtPt, neg_vsub_eq_vsub_rev]

Expand Down
5 changes: 1 addition & 4 deletions EuclideanGeometry/Foundation/Axiom/Basic/Vector.lean
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +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
simp only [zero_mul, sub_zero, add_zero, conj_trivial]
ring
smul_left v₁ v₂ z := by dsimp; simp only [zero_mul, sub_zero, add_zero, conj_trivial]; ring

lemma real_inner_apply (v₁ v₂ : Vec) :
⟪v₁, v₂⟫_ℝ = v₁.fst * v₂.fst + v₁.snd * v₂.snd :=
Expand Down
2 changes: 1 addition & 1 deletion EuclideanGeometry/Foundation/Axiom/Circle/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def antipode (A : P) (ω : Circle P) : P := VEC A ω.center +ᵥ ω.center
theorem antipode_lieson_circle {A : P} {ω : Circle P} {ha : A LiesOn ω} : (antipode A ω) LiesOn ω := by
show dist ω.center (antipode A ω) = ω.radius
rw [NormedAddTorsor.dist_eq_norm', antipode, vsub_vadd_eq_vsub_sub]
simp
simp only [vsub_self, zero_sub, norm_neg]
show ‖ω.center -ᵥ A‖ = ω.radius
rw [← NormedAddTorsor.dist_eq_norm', ha]

Expand Down
13 changes: 11 additions & 2 deletions EuclideanGeometry/Foundation/Axiom/Circle/CCPosition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,21 @@ theorem CC_inx_pts_distinct {ω₁ : Circle P} {ω₂ : Circle P} (h : ω₁ Int
simp only [add_sub_add_right_eq_sub, sub_neg_eq_add, smul_eq_zero, add_self_eq_zero, mul_eq_zero,
Complex.ofReal_eq_zero, Complex.I_ne_zero, or_false, VecND.ne_zero]
push_neg
apply Real.sqrt_ne_zero'.mpr
· 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) ⟩
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
--linarith
sorry --fix this

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⟩
Expand Down
8 changes: 6 additions & 2 deletions EuclideanGeometry/Foundation/Axiom/Circle/IncribedAngle.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import EuclideanGeometry.Foundation.Axiom.Position.Angle_ex2
import EuclideanGeometry.Foundation.Axiom.Position.Orientation_trash
import EuclideanGeometry.Foundation.Axiom.Triangle.IsocelesTriangle_trash
import EuclideanGeometry.Foundation.Axiom.Basic.Angle_trash
import EuclideanGeometry.Foundation.Axiom.Triangle.Basic
import EuclideanGeometry.Foundation.Axiom.Triangle.Basic_ex

noncomputable section
namespace EuclidGeom
Expand Down Expand Up @@ -176,11 +178,13 @@ end angle

theorem inscribed_angle_is_positive {p : P} {β : Arc P} (h : p LiesInt β.complement) : (Arc.angle_mk_pt_arc p β h.2.symm).value.IsPos := by
unfold Arc.angle_mk_pt_arc
apply liesonleft_angle_ispos (Arc.liesint_complementary_arc_liesonleft_dlin h)
apply TriangleND.liesonleft_angle_ispos
exact (Arc.liesint_complementary_arc_liesonleft_dlin h)

theorem inscribed_angle_of_complementary_arc_is_negative {p : P} {β : Arc P} (h : p LiesInt β) : (Arc.angle_mk_pt_arc p β h.2).value.IsNeg := by
unfold Arc.angle_mk_pt_arc
apply liesonright_angle_isneg (Arc.liesint_arc_liesonright_dlin h)
apply TriangleND.liesonright_angle_isneg
exact (Arc.liesint_arc_liesonright_dlin h)

theorem cangle_eq_two_times_inscribed_angle {p : P} {β : Arc P} (h₁ : p LiesOn β.circle) (h₂ : Arc.Isnot_arc_endpts p β) : β.cangle.value = 2 • (Arc.angle_mk_pt_arc p β h₂).value := by
haveI : PtNe p β.source := ⟨h₂.1⟩
Expand Down
14 changes: 14 additions & 0 deletions EuclideanGeometry/Foundation/Axiom/Position/Orientation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,20 @@ theorem not_colinear_of_IsOnOppositeSide (A B C D : P) [bnea : PtNe B A] (h : Is

end relative_side

scoped notation A:max "and" B:max " LiesOnSameSide " C:max => IsOnSameSide A B C

variable (A B : P) [EuclideanPlane P] (l : Line P)

#check A and B LiesOnSameSide l

scoped notation:5 A:max "and" B:max " LiesOnOppositeSide " C:max => IsOnOppositeSide A B C


-- @[inherit_doc IsOnSameSide]
-- scoped syntax term:max ws term:max ws " LiesOnSameSide " ws term:max : term



/- Position of two lines; need a function to take the intersection of two lines (when they intersect). -/


Expand Down
Loading