Skip to content

[Merged by Bors] - feat(Geometry/Euclidean/Angle/Incenter): angle bisection and the incenter#30982

Closed
jsm28 wants to merge 110 commits intoleanprover-community:masterfrom
jsm28:angle_incenter
Closed

[Merged by Bors] - feat(Geometry/Euclidean/Angle/Incenter): angle bisection and the incenter#30982
jsm28 wants to merge 110 commits intoleanprover-community:masterfrom
jsm28:angle_incenter

Conversation

@jsm28
Copy link
Copy Markdown
Contributor

@jsm28 jsm28 commented Oct 27, 2025

Add lemmas relating the incenter and excenters of a simplex to angle bisection, both generally for a simplex and more specifically with oriented angles for a triangle.

More specific lemmas for a simplex (identifying exactly which excenter corresponds to which bisectors) will require various additional API for bisectors of angles betweeen oriented affine subspaces (but for the most common applications to typical plane geometry problems, I expect the triangle lemmas with oriented angles to be more useful).


Open in Gitpod

jsm28 and others added 30 commits October 12, 2025 19:56
…Projection_of_le`

Add a lemma that `orthogonalProjection s₁ (orthogonalProjection s₂ p)
= orthogonalProjection s₁ p` for `s₁ ≤ s₂`. (A similar lemma for
projection onto submodules rather than affine subspaces already
exists.)
… and bisection lemmas

Add lemmas

```lean
lemma oangle_eq_neg_of_angle_eq_of_sign_eq_neg {w x y z : V}
    (h : InnerProductGeometry.angle w x = InnerProductGeometry.angle y z)
    (hs : (o.oangle w x).sign = -(o.oangle y z).sign) : o.oangle w x = -o.oangle y z := by
```

and

```lean
lemma angle_eq_iff_oangle_eq_neg_of_sign_eq_neg {w x y z : V} (hw : w ≠ 0) (hx : x ≠ 0)
    (hy : y ≠ 0) (hz : z ≠ 0) (hs : (o.oangle w x).sign = -(o.oangle y z).sign) :
    InnerProductGeometry.angle w x = InnerProductGeometry.angle y z ↔
      o.oangle w x = -o.oangle y z := by
```

and similar affine versions, corresponding to such lemmas that already
exist when the signs are equal rather than negations of each other.
Deduce lemmas relating oriented and unoriented versions of angle
bisection:

```lean
lemma angle_eq_iff_oangle_eq_or_sameRay {x y z : V} (hx : x ≠ 0) (hz : z ≠ 0) :
    InnerProductGeometry.angle x y = InnerProductGeometry.angle y z ↔
      o.oangle x y = o.oangle y z ∨ SameRay ℝ x z := by
```

and

```lean
lemma angle_eq_iff_oangle_eq_or_wbtw {p₁ p₂ p₃ p₄ : P} (hp₁ : p₁ ≠ p₂) (hp₄ : p₄ ≠ p₂) :
    ∠ p₁ p₂ p₃ = ∠ p₃ p₂ p₄ ↔ ∡ p₁ p₂ p₃ = ∡ p₃ p₂ p₄ ∨ Wbtw ℝ p₂ p₁ p₄ ∨ Wbtw ℝ p₂ p₄ p₁ := by
```
… equal distance

Add a lemma

```lean
lemma dist_orthogonalProjection_eq_iff_oangle_eq {p p' : P} {s₁ s₂ : AffineSubspace ℝ P}
    [s₁.direction.HasOrthogonalProjection] [s₂.direction.HasOrthogonalProjection]
    (hp' : p' ∈ s₁ ⊓ s₂)
    (hne : haveI : Nonempty s₁ := ⟨p', hp'.1⟩; haveI : Nonempty s₂ := ⟨p', hp'.2⟩;
      (orthogonalProjection s₁ p : P) ≠ orthogonalProjection s₂ p)
    (hp₁ : haveI : Nonempty s₁ := ⟨p', hp'.1⟩; orthogonalProjection s₁ p ≠ p')
    (hp₂ : haveI : Nonempty s₂ := ⟨p', hp'.2⟩; orthogonalProjection s₂ p ≠ p') :
    haveI : Nonempty s₁ := ⟨p', hp'.1⟩
    haveI : Nonempty s₂ := ⟨p', hp'.2⟩
    dist p (orthogonalProjection s₁ p) = dist p (orthogonalProjection s₂ p) ↔
      ∡ (orthogonalProjection s₁ p : P) p' p = ∡ p p' (orthogonalProjection s₂ p) :=
```

that is an oriented angle analogue of the existing
`dist_orthogonalProjection_eq_iff_angle_eq`.  Because the minimal
nondegeneracy conditions required for the two directions of this lemma
are different (whereas the unoriented version doesn't need any
nondegeneracy conditions), those two directions are added as separate
lemmas, each with minimal nondegeneracy conditions, from which the
`iff` version is then deduced.
…ality of twice angles

Add lemmas that two angles less than `π / 2` are equal if and only if
twice those angles are equal, along with a separate lemma

```lean
lemma toReal_neg_eq_neg_toReal_iff {θ : Angle} : (-θ).toReal = -(θ.toReal) ↔ θ ≠ π := by
```

which isn't directly connected but turns out to be useful in the same
application (dealing with angles in right-angled triangles that are
less then `π / 2`, when you have two such triangles that are
oppositely-oriented).
…`π / 2`

Add a lemma that an oriented angle in a right-angled triangle is less
than `π / 2`, even in degenerate cases (there's already a
corresponding lemma for unoriented angles, but that one needs to
exclude some degenerate cases because of the different default values
for oriented and unoriented angles involving zero vectors).  Deduce
lemmas that, for such angles involved in right-angled triangles,
equality of the angles (i.e. equality mod 2π) follows from equality of
twice the angles (i.e. equality of the angles mod π).
Add a lemma

```lean
lemma orthogonalProjection_eq_iff_mem {s : AffineSubspace ℝ P} [Nonempty s]
    [s.direction.HasOrthogonalProjection] {p q : P} :
    orthogonalProjection s p = q ↔ q ∈ s ∧ p -ᵥ q ∈ s.directionᗮ := by
```

that gives the characteristic property of the orthogonal projection in
a more convenient form to use than the existing
`inter_eq_singleton_orthogonalProjection` (from which it is derived).
Add instances that the supremum of two affine subspaces, either one
nonempty, is nonempty.  These are useful when working with orthogonal projections onto such a supremum.
Add a lemma that, if the orthogonal projections of a point onto two
subspaces are equal, so is the projection onto their supremum.
@mathlib-dependent-issues mathlib-dependent-issues bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Feb 10, 2026

end Simplex

namespace Triangle
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all lemmas in this section you have the hypotheses

{p : P} {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃)

It would be better to factor these out, using include as needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p is only used by some of the lemmas, not all. I've factored out the rest as requested.

@ocfnash
Copy link
Copy Markdown
Contributor

ocfnash commented Mar 27, 2026

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 27, 2026

✌️ jsm28 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ocfnash
Copy link
Copy Markdown
Contributor

ocfnash commented Mar 27, 2026

bors merge

@mathlib-triage mathlib-triage bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. labels Mar 27, 2026
mathlib-bors bot pushed a commit that referenced this pull request Mar 27, 2026
…nter (#30982)

Add lemmas relating the incenter and excenters of a simplex to angle bisection, both generally for a simplex and more specifically with oriented angles for a triangle.

More specific lemmas for a simplex (identifying exactly which excenter corresponds to which bisectors) will require various additional API for bisectors of angles betweeen oriented affine subspaces (but for the most common applications to typical plane geometry problems, I expect the triangle lemmas with oriented angles to be more useful).
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 27, 2026

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Mar 27, 2026
…nter (#30982)

Add lemmas relating the incenter and excenters of a simplex to angle bisection, both generally for a simplex and more specifically with oriented angles for a triangle.

More specific lemmas for a simplex (identifying exactly which excenter corresponds to which bisectors) will require various additional API for bisectors of angles betweeen oriented affine subspaces (but for the most common applications to typical plane geometry problems, I expect the triangle lemmas with oriented angles to be more useful).
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 27, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Geometry/Euclidean/Angle/Incenter): angle bisection and the incenter [Merged by Bors] - feat(Geometry/Euclidean/Angle/Incenter): angle bisection and the incenter Mar 27, 2026
@mathlib-bors mathlib-bors bot closed this Mar 27, 2026
@jsm28 jsm28 deleted the angle_incenter branch March 27, 2026 17:55
justus-springer pushed a commit to justus-springer/mathlib4 that referenced this pull request Mar 28, 2026
…nter (leanprover-community#30982)

Add lemmas relating the incenter and excenters of a simplex to angle bisection, both generally for a simplex and more specifically with oriented angles for a triangle.

More specific lemmas for a simplex (identifying exactly which excenter corresponds to which bisectors) will require various additional API for bisectors of angles betweeen oriented affine subspaces (but for the most common applications to typical plane geometry problems, I expect the triangle lemmas with oriented angles to be more useful).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-euclidean-geometry Affine and axiomatic geometry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants