-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(Geometry/Euclidean/Angle/Incenter): unoriented angle bisection #32282
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
base: master
Are you sure you want to change the base?
Changes from all commits
42ebb9d
ae60332
3c482f7
1e8535a
0e742f5
c4f608e
e344de3
ed79cfd
ad91b16
a2bc964
3ee5e31
aa43543
f68bfb8
9ddca9d
ce50e9d
6fcc7d1
412b533
55466d1
7a7fca2
f84640a
c7a0173
65b1fc0
72272ce
5e7f9e2
fec0393
29f4f21
d061e26
099c741
8b909e8
5a133e9
baccce2
f96e601
2f73b91
179b3dd
365b6a2
c6357ff
01e9a53
b2c92ce
33cda7f
34f5939
f7eceab
c6330fc
0f49c42
92af71b
7a244c3
ebae599
5a84e03
4252162
6255125
df91235
36eaeef
dc45f56
36e5799
294ae56
4da2940
9382d88
7a47270
6492202
8f38952
0397472
650bfa5
f88c561
cceaa09
5924462
a9fda5b
3d3fc07
b9e2b62
cf003ae
4a57d97
b559f40
06b1417
40c4a3c
b9988f6
a0a6b24
8affa06
a37cbe3
102fc21
4342732
ff49abb
3977af8
6b9addb
1f450d9
a980bbd
4e07fcf
a690115
8eee484
b94af0d
c1f6a2e
564b695
c19cca1
c4cc319
5bea48d
9c09478
3d01642
e22b7a4
0e83977
89593bd
b9727e4
2f88422
5a883e4
8a48263
a5d7b68
44204ef
40bf451
3eaa98f
70e683e
3c99197
306b328
e05793b
2ae36bd
3550ab3
1f23463
f3333dc
4c34eb7
611cc02
0854a81
9334a8e
7e6a36b
8e8f2bc
300876b
a209b1a
d4bc229
e912fb5
8e978d9
b9f9d91
d2de8f6
3668129
1a80d30
06c0b00
9b4174b
34d8708
4b6e939
54e3871
103e79e
5ce1ea2
a04c126
7d53520
6f4e9f3
4db210a
ba62551
4c0fc41
22daa65
8ac3379
db19a3a
6130523
92300ab
5fd5ee5
15f9cdb
d803ab4
9057a4d
72ef689
0ac5abe
87f0399
8b21a77
829b69f
1378c03
66ab645
f5ef4a2
d878da7
ce341cd
c59fa28
87994d1
2f37e44
6c0e874
ca19317
b69ec1f
0e3d8f6
846064f
e726554
cf4b677
6aedf65
bcd0a83
3a0d81c
de3426a
0e46966
52fd73e
d7f6472
197daac
cbc88a3
0eb5e71
dd07182
0e75bb4
b487376
cdccffa
ff9288d
2e0b295
e7c5011
53a0f3c
e127b76
885dfc8
104f111
9b865b5
2538ede
29af0e7
481377c
cd574fb
e40fc6b
2c9f06b
05ac3b9
1f43d5d
204cbcc
a484edf
d8ad79a
1b56613
02ae6be
4743064
f8cf717
527f091
9ae492a
335651e
5ba9ffc
96624cd
f223bd7
1a84819
dd0ee97
dcf6e13
528ddee
184a919
3d94b46
9526d33
04ebe28
7673184
b1cd705
2aa92d8
9a1a207
14fc12b
92d2dc5
8ff6b2b
af66e9b
4328d75
8fdb5c2
6a75940
134a23b
fb6e7ac
be79eb3
dacabf0
3c97060
048423f
9069ddb
bcf2b9e
762a6d2
cc57dd0
c63ef8b
3eaffb6
7963a1e
38a4063
a3b17d5
2358ab5
084a1f2
81822da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,8 @@ namespace Triangle | |
|
|
||
| open Simplex | ||
|
|
||
| section Oriented | ||
|
|
||
| variable [hd2 : Fact (finrank ℝ V = 2)] [Module.Oriented ℝ V (Fin 2)] | ||
| variable (t : Triangle ℝ P) {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) | ||
| include h₁₂ h₁₃ h₂₃ | ||
|
|
@@ -265,6 +267,96 @@ lemma eq_excenter_singleton_of_oangle_eq_add_pi_of_oangle_eq_add_pi {p : P} | |
| exact t.excenter_singleton_injective.ne h₁₂ h₁' | ||
| · exact h₁' | ||
|
|
||
| end Oriented | ||
|
|
||
| section Unoriented | ||
|
|
||
| variable (t : Triangle ℝ P) | ||
|
|
||
| /-- The incenter of a triangle bisects the angle at a vertex. -/ | ||
| lemma angle_incenter_eq_angle_div_two {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) | ||
| (h₂₃ : i₂ ≠ i₃) : | ||
| ∠ (t.points i₂) (t.points i₁) t.incenter = ∠ (t.points i₂) (t.points i₁) (t.points i₃) / 2 := by | ||
| let S : AffineSubspace ℝ P := affineSpan ℝ (Set.range t.points) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Random idea and not in the scope of the PR: should we have a "planarize" tactic that handles restricting everything to the subspace?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something like that would be reasonable (once we have enough examples to show e.g. what's most convenient in terms of choosing the two-dimensional subspace / showing that all points lie in it / possibly dealing with any special cases where actually the ambient space is less than two-dimensional). Note that we don't yet have a full set of |
||
| let t' : Triangle ℝ S := t.restrict S le_rfl | ||
| have hf2 : Fact (finrank ℝ S.direction = 2) := ⟨by | ||
| simp_rw [S] | ||
| rw [direction_affineSpan, t.independent.finrank_vectorSpan] | ||
| simp⟩ | ||
| have : Module.Oriented ℝ S.direction (Fin 2) := | ||
| ⟨Basis.orientation (finBasisOfFinrankEq _ _ hf2.out)⟩ | ||
| suffices ∠ (t'.points i₂) (t'.points i₁) t'.incenter = | ||
| ∠ (t'.points i₂) (t'.points i₁) (t'.points i₃) / 2 by | ||
| simpa [t', ← S.angle_coe] using this | ||
| exact angle_eq_angle_div_two_of_oangle_eq_of_sSameSide (t'.independent.injective.ne h₁₂.symm) | ||
| (t'.oangle_incenter_eq h₁₂ h₁₃ h₂₃) | ||
| (t'.sSameSide_affineSpan_pair_incenter_point h₂₃.symm h₁₃.symm h₁₂.symm) | ||
|
|
||
| /-- The excenter of a triangle opposite a vertex bisects the angle at that vertex. -/ | ||
| lemma angle_excenter_singleton_eq_angle_div_two {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) | ||
| (h₂₃ : i₂ ≠ i₃) : | ||
| ∠ (t.points i₂) (t.points i₁) (t.excenter {i₁}) = | ||
| ∠ (t.points i₂) (t.points i₁) (t.points i₃) / 2 := by | ||
| let S : AffineSubspace ℝ P := affineSpan ℝ (Set.range t.points) | ||
| let t' : Triangle ℝ S := t.restrict S le_rfl | ||
| have hf2 : Fact (finrank ℝ S.direction = 2) := ⟨by | ||
| simp_rw [S] | ||
| rw [direction_affineSpan, t.independent.finrank_vectorSpan] | ||
| simp⟩ | ||
|
Comment on lines
+302
to
+305
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you repeat this code block four times. Can this be some lemma?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #39696 - rather than making other PRs depend on it, I was assuming that as a straightforward PR that had been requested on Zulip, it would be reviewed quickly and then I could merge master into existing PRs and update them accordingly. |
||
| have : Module.Oriented ℝ S.direction (Fin 2) := | ||
| ⟨Basis.orientation (finBasisOfFinrankEq _ _ hf2.out)⟩ | ||
| suffices ∠ (t'.points i₂) (t'.points i₁) (t'.excenter {i₁}) = | ||
| ∠ (t'.points i₂) (t'.points i₁) (t'.points i₃) / 2 by | ||
| simpa [t', ← S.angle_coe, t.excenterExists_singleton i₁] using this | ||
| refine angle_eq_angle_div_two_of_oangle_eq_of_sSameSide (t'.independent.injective.ne h₁₂.symm) | ||
| (t'.oangle_excenter_singleton_eq h₁₂ h₁₃ h₂₃) ?_ | ||
| rw [Set.pair_comm] | ||
| exact t'.sSameSide_affineSpan_pair_excenter_singleton_point h₁₃.symm h₂₃.symm h₁₂ | ||
|
|
||
| /-- The excenter of a triangle opposite a vertex bisects the angle at another vertex. -/ | ||
| lemma angle_excenter_singleton_eq_angle_add_pi_div_two {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) | ||
| (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) : | ||
| ∠ (t.points i₁) (t.points i₂) (t.excenter {i₁}) = | ||
| (∠ (t.points i₁) (t.points i₂) (t.points i₃) + π) / 2 := by | ||
| let S : AffineSubspace ℝ P := affineSpan ℝ (Set.range t.points) | ||
| let t' : Triangle ℝ S := t.restrict S le_rfl | ||
| have hf2 : Fact (finrank ℝ S.direction = 2) := ⟨by | ||
| simp_rw [S] | ||
| rw [direction_affineSpan, t.independent.finrank_vectorSpan] | ||
| simp⟩ | ||
| have : Module.Oriented ℝ S.direction (Fin 2) := | ||
| ⟨Basis.orientation (finBasisOfFinrankEq _ _ hf2.out)⟩ | ||
| suffices ∠ (t'.points i₁) (t'.points i₂) (t'.excenter {i₁}) = | ||
| (∠ (t'.points i₁) (t'.points i₂) (t'.points i₃) + π) / 2 by | ||
| simpa [t', ← S.angle_coe, t.excenterExists_singleton i₁] using this | ||
| exact angle_eq_angle_add_pi_div_two_of_oangle_eq_add_pi_of_sSameSide | ||
| (t'.independent.injective.ne h₁₂) (t'.oangle_excenter_singleton_eq_add_pi h₁₂ h₁₃ h₂₃) | ||
| (t'.sSameSide_affineSpan_pair_excenter_singleton_point h₁₃.symm h₂₃.symm h₁₂) | ||
|
|
||
| /-- The excenter of a triangle opposite a vertex bisects the angle at another vertex. -/ | ||
| lemma angle_excenter_singleton_eq_pi_sub_angle_div_two {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) | ||
| (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) : | ||
| ∠ (t.points i₃) (t.points i₂) (t.excenter {i₁}) = | ||
| (π - ∠ (t.points i₃) (t.points i₂) (t.points i₁)) / 2 := by | ||
| let S : AffineSubspace ℝ P := affineSpan ℝ (Set.range t.points) | ||
| let t' : Triangle ℝ S := t.restrict S le_rfl | ||
| have hf2 : Fact (finrank ℝ S.direction = 2) := ⟨by | ||
| simp_rw [S] | ||
| rw [direction_affineSpan, t.independent.finrank_vectorSpan] | ||
| simp⟩ | ||
| have : Module.Oriented ℝ S.direction (Fin 2) := | ||
| ⟨Basis.orientation (finBasisOfFinrankEq _ _ hf2.out)⟩ | ||
| suffices ∠ (t'.points i₃) (t'.points i₂) (t'.excenter {i₁}) = | ||
| (π - ∠ (t'.points i₃) (t'.points i₂) (t'.points i₁)) / 2 by | ||
| simpa [t', ← S.angle_coe, t.excenterExists_singleton i₁] using this | ||
| refine angle_eq_pi_sub_angle_div_two_of_oangle_eq_add_pi_of_sOppSide | ||
| (t'.independent.injective.ne h₂₃.symm) ?_ | ||
| (t'.sOppSide_affineSpan_pair_excenter_singleton_point h₁₃ h₁₂ h₂₃.symm) | ||
| simp_rw [← sub_eq_iff_eq_add, oangle_rev (excenter t' {i₁}), oangle_rev (t'.points i₁), | ||
| sub_eq_add_neg, ← neg_add, neg_inj, eq_comm, t'.oangle_excenter_singleton_eq_add_pi h₁₂ h₁₃ h₂₃] | ||
|
|
||
| end Unoriented | ||
|
|
||
| end Triangle | ||
|
|
||
| end Affine | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it may be useful/convenient to have copies of these lemmas stating "2 *∠ (t.points i₂) (t.points i₁) t.incenter = ∠ (t.points i₂) (t.points i₁) (t.points i₃)"? (not sure)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that's sufficiently useful to be worth duplicating all these lemmas, when you can always substitute this version in if you need the other one. (Most of the time the oriented versions are more useful anyway; it simply happened I needed angle inequalities to prove configuration information, which meant I wanted an explicit expression for the angle involving the incenter.)