Skip to content

[Merged by Bors] - feat(Geometry/Euclidean/Incenter): tangentSet and tangentsFrom lemmas - #31981

Closed
jsm28 wants to merge 128 commits into
leanprover-community:masterfrom
jsm28:tangentsFrom_exsphere
Closed

jsm28 wants to merge 128 commits into
leanprover-community:masterfrom
jsm28:tangentsFrom_exsphere

Conversation

jsm28 and others added 28 commits November 16, 2025 23:53
Add a lemma about the interaction of `map` and `mk'` for affine subspaces:

```lean
lemma map_mk' (p : P₁) (direction : Submodule k V₁) :
    (mk' p direction).map f = mk' (f p) (direction.map f.linear) := by
```
Add a lemma about mapping orthogonal complements under a `LinearIsometryEquiv`:

```lean
lemma map_orthogonal (f : E ≃ₗᵢ[𝕜] F) : Kᗮ.map f = (K.map f)ᗮ := by
```
Add further lemmas about tangency, the common theme of which is that
they relate in some way to `orthRadius` (the full tangent space rather
than only a subspace thereof). In particular, give its `finrank` in a
finite-dimensional space and describe tangent spaces that have that
`finrank`, and, not limited to a finite-dimensional space, the two
tangent spaces that are parallel to a given `orthRadius` space.
Add lemmas, in the case where the dimensions are such that the simplex
spans the whole space, exspheres are not merely tangent to the faces
but the faces are the full tangent spaces (`orthRadius`).
… using polars

Add further lemmas about `orthRadius` that are of use in setting up
and using poles and polars.  In particular,
`ncard_inter_orthRadius_eq_two_of_dist_lt_radius` is the key part of
showing that, in two dimensions, there are exactly two tangents to a
circle from a point outside that circle (where the points of tangency
lie on the polar of the point from which the two tangents are drawn).

---

I think the extra imports are reasonable for this file, but if
`Mathlib.Analysis.InnerProductSpace.TwoDim` turns out to be too heavy,
it's only used for `FiniteDimensional.of_fact_finrank_eq_two` which
could be moved to somewhere much more basic in mathlib.
Define poles and polars for spheres in Euclidean affine spaces, and set up some basic API, including in particular La Hire's theorem (`p₁` lies on the polar of `p₂` if and only if `p₂` lies on the polar of `p₁`).

Poles and polars are actually meaningful for any quadric in a projective space over any field, but I think it's reasonable to set up this theory for spheres in the Euclidean context and potentially link it in future to more general projective geometry.
Add lemmas relating tangency to polars, and thereby characterizing
`tangentsFrom`: empty for a point inside the sphere, a singleton for a
point on the sphere and, in two dimensions, of cardinality two for a
point outside the circle.
…subsingleton sets

Add two lemmas about `vectorSpan` of subsingleton sets:

```lean
lemma vectorSpan_of_subsingleton {s : Set P} (h : s.Subsingleton) : vectorSpan k s = ⊥ := by
  rcases h.eq_empty_or_singleton with rfl | ⟨p, rfl⟩ <;> simp
```

```lean
lemma vectorSpan_eq_bot_iff_subsingleton {s : Set P} : vectorSpan k s = ⊥ ↔ s.Subsingleton := by
```
…images

Add the lemma

```lean
lemma AffineIndependent.injective_affineSpan_image [Nontrivial k] {p : ι → P}
    (ha : AffineIndependent k p) : Injective fun (s : Set ι) ↦ affineSpan k (p '' s) := by
```

which is straightforward given existing lemmas, and the corresponding
`vectorSpan` lemma

```lean
lemma AffineIndependent.vectorSpan_image_eq_iff [Nontrivial k] {p : ι → P}
    (ha : AffineIndependent k p) {s₁ s₂ : Set ι} :
    vectorSpan k (p '' s₁) = vectorSpan k (p '' s₂) ↔
      s₁ = s₂ ∨ s₁.Subsingleton ∧ s₂.Subsingleton := by
```

(feel free to golf).
Add a lemma that a point in a tangent space that's not the point of
tangency lies outside the sphere:

```lean
lemma IsTangentAt.radius_lt_dist_center {s : Sphere P} {as : AffineSubspace ℝ P} {p q : P}
    (h : s.IsTangentAt p as) (hq : q ∈ as) (hqp : q ≠ p) : s.radius < dist q s.center := by
```
…mmas

Add lemmas relating the faces of a simplex to `tangentSet` and
`tangentsFrom` for an exsphere, in particular for a triangle that any
two side lines are the `tangentsFrom` their shared vertex to the
insphere or any exsphere.
@jsm28 jsm28 added the t-euclidean-geometry Affine and axiomatic geometry label Nov 23, 2025
@github-actions

github-actions Bot commented Nov 23, 2025 •

Copy link
Copy Markdown

PR summary 54e06b62e5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ ExcenterExists.affineSpan_faceOpposite_mem_tangentSet
+ ExcenterExists.affineSpan_faceOpposite_mem_tangentsFrom
+ ExcenterExists.exradius_lt_dist_point_excenter
+ affineSpan_faceOpposite_mem_tangentSet_insphere
+ affineSpan_faceOpposite_mem_tangentsFrom_insphere
+ affineSpan_pair_mem_tangentSet
+ affineSpan_pair_mem_tangentSet_insphere
+ affineSpan_pair_mem_tangentsFrom
+ affineSpan_pair_mem_tangentsFrom_insphere
+ inradius_lt_dist_point_incenter
+ ncard_tangentsFrom
+ ncard_tangentsFrom_insphere
+ tangentsFrom_eq_pair_affineSpan_pair
+ tangentsFrom_insphere_eq_pair_affineSpan_pair

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 54e06b6).

  • +14 new declarations
  • −0 removed declarations
+Affine.Simplex.ExcenterExists.affineSpan_faceOpposite_mem_tangentSet
+Affine.Simplex.ExcenterExists.affineSpan_faceOpposite_mem_tangentsFrom
+Affine.Simplex.ExcenterExists.exradius_lt_dist_point_excenter
+Affine.Simplex.affineSpan_faceOpposite_mem_tangentSet_insphere
+Affine.Simplex.affineSpan_faceOpposite_mem_tangentsFrom_insphere
+Affine.Simplex.inradius_lt_dist_point_incenter
+Affine.Triangle.affineSpan_pair_mem_tangentSet
+Affine.Triangle.affineSpan_pair_mem_tangentSet_insphere
+Affine.Triangle.affineSpan_pair_mem_tangentsFrom
+Affine.Triangle.affineSpan_pair_mem_tangentsFrom_insphere
+Affine.Triangle.ncard_tangentsFrom
+Affine.Triangle.ncard_tangentsFrom_insphere
+Affine.Triangle.tangentsFrom_eq_pair_affineSpan_pair
+Affine.Triangle.tangentsFrom_insphere_eq_pair_affineSpan_pair

No changes to strong technical debt.
No changes to weak technical debt.

Current commit 54e06b62e5
Reference commit 02a839bc62

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 12, 2026

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is taking me a while to parse these statements. Could they maybe have docstrings?

@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 28, 2026
@jsm28

jsm28 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

I've added docstrings for the new tangentSet and tangentsFrom lemmas. (The file is still under 1500 lines, though it's getting close. I still intend to split it up once this PR is in.)

@jsm28 jsm28 removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 28, 2026
s.excenterExists_empty.affineSpan_faceOpposite_eq_orthRadius i

variable {s} in
/-- The affine span of a face lies in the tangent set of an exsphere. -/

@YaelDillies YaelDillies Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But what's the "tangent set"? Don't you simply mean

Suggested change
/-- The affine span of a face lies in the tangent set of an exsphere. -/
/-- The affine span of a face is tangent to all the exspheres. -/

?

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.

It's the set of maximal tangent spaces (for these lemmas, the simplex spans the whole space; we have other existing lemmas about faces being tangent when the simplex might only span a subspace; the point of these lemmas is to give the extra information available when the simplex spans the whole space, leading to describing the two tangents from a vertex as two side lines of a triangle in the two-dimensional case). I'm not sure replicating the content of the docstring of tangentSet is helpful here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I see. The name tangentSet doesn't communicate this at all

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! 🚀

maintainer merge

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 28, 2026
@YaelDillies YaelDillies removed their assignment Nov 28, 2026
@kbuzzard

Copy link
Copy Markdown
Member

Thanks for the review Yael! LGTM.

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Nov 29, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 29, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Nov 29, 2026
…mmas (#31981)

Add lemmas relating the faces of a simplex to `tangentSet` and `tangentsFrom` for an exsphere, in particular for a triangle that any two side lines are the `tangentsFrom` their shared vertex to the insphere or any exsphere.

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Nov 29, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Geometry/Euclidean/Incenter): tangentSet and tangentsFrom lemmas [Merged by Bors] - feat(Geometry/Euclidean/Incenter): tangentSet and tangentsFrom lemmas Nov 29, 2026
@mathlib-bors mathlib-bors Bot closed this Nov 29, 2026
@jsm28
jsm28 deleted the tangentsFrom_exsphere branch November 29, 2026 16:01
TJHeeringa pushed a commit to TJHeeringa/mathlib4 that referenced this pull request Dec 2, 2026
…mmas (leanprover-community#31981)

Add lemmas relating the faces of a simplex to `tangentSet` and `tangentsFrom` for an exsphere, in particular for a triangle that any two side lines are the `tangentsFrom` their shared vertex to the insphere or any exsphere.

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. 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.

8 participants