Skip to content

[Merged by Bors] - feat(Geometry/Polygon): nondegeneracy conditions and interconversion with Affine.Triangle#34598

Closed
A-M-Berns wants to merge 28 commits intoleanprover-community:masterfrom
A-M-Berns:affinetriangle
Closed

[Merged by Bors] - feat(Geometry/Polygon): nondegeneracy conditions and interconversion with Affine.Triangle#34598
A-M-Berns wants to merge 28 commits intoleanprover-community:masterfrom
A-M-Berns:affinetriangle

Conversation

@A-M-Berns
Copy link
Copy Markdown
Contributor

This PR implements suggestions provided in this comment by @jsm28: interconversion between Polygon P 3 and Affine.Triangle as well as the nondegeneracy conditions NondegenerateVertices and NondegenerateEdges. I tried to keep typeclass restrictions as minimal as possible.


…angles

This introduces basic polygon definitions:
- `Polygon P n`: vertices indexed by `Fin n` in any type
- `EuclideanPolygon n`: polygon in 2D Euclidean space with `n ≥ 3`
- `EuclideanTriangle`: non-degenerate triangle with `Affine.Triangle` compatibility

Provides edge representations in both affine (`edgePath`, `edgeSet`) and
module (`edgePathModule`, `side`) settings, with equivalence theorems.

With help from Claude Code (Opus 4.5).
@github-actions github-actions bot added new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Jan 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 30, 2026

✅ PR Title Formatted Correctly

The title of this PR has been updated to match our commit style conventions.
Thank you!

@A-M-Berns A-M-Berns changed the title feat(Geometry/Polygon): nondegeneracy conditions and interconversion with Affine.Triangle feat(Geometry/Polygon): nondegeneracy conditions and interconversion with Affine.Triangle Jan 30, 2026
@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 Jan 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 30, 2026

PR summary 0e4799ceff

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ HasNondegenerateEdges
+ HasNondegenerateEdges.two_le
+ HasNondegenerateVertices
+ HasNondegenerateVertices.hasNondegenerateEdges
+ HasNondegenerateVertices.three_le
+ toPolygon
+ toPolygon_hasNondegenerateVertices
+ toPolygon_toTriangle
+ toPolygon_vertices
+ toTriangle
+ toTriangle_points
+ toTriangle_toPolygon

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for scripts/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh 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).

Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
@jsm28
Copy link
Copy Markdown
Contributor

jsm28 commented Jan 30, 2026

Additional suggested lemmas: NondegenerateEdges implies n is at least 2, and NondegenerateVertices implies it's at least 3.

@A-M-Berns
Copy link
Copy Markdown
Contributor Author

I've edited the file based on the feedback. I changed the variable (R) to variable (R) in for relevant results, changed NondegenerateVertices to use AffineIndependent, and added the two suggested lemmas.

Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
@jcommelin jcommelin added the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 2, 2026
@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 3, 2026
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
@eric-wieser
Copy link
Copy Markdown
Member

Could you merge master and resolve the conflicts?

@eric-wieser eric-wieser added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 13, 2026
@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 Feb 13, 2026
@A-M-Berns A-M-Berns requested a review from jcommelin February 14, 2026 19:47
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
Comment thread Mathlib/Geometry/Polygon/Basic.lean
Comment thread Mathlib/Geometry/Polygon/Basic.lean
Comment thread Mathlib/Geometry/Polygon/Basic.lean Outdated
@jcommelin jcommelin added the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 18, 2026
A-M-Berns and others added 2 commits February 18, 2026 11:14
Co-authored-by: Johan Commelin <[email protected]>
Co-authored-by: Johan Commelin <[email protected]>
@A-M-Berns
Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 18, 2026
Copy link
Copy Markdown
Contributor

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

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

Thanks!

bors merge

@mathlib-triage mathlib-triage bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Feb 25, 2026
mathlib-bors bot pushed a commit that referenced this pull request Feb 25, 2026
…with Affine.Triangle (#34598)

This PR implements suggestions provided in [this comment](#34393 (comment)) by @jsm28: interconversion between `Polygon P 3` and `Affine.Triangle` as well as the nondegeneracy conditions `NondegenerateVertices` and `NondegenerateEdges`. I tried to keep typeclass restrictions as minimal as possible.

Co-authored-by: AnsonBerns <[email protected]>
Co-authored-by: A. M. Berns <[email protected]>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 25, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Geometry/Polygon): nondegeneracy conditions and interconversion with Affine.Triangle [Merged by Bors] - feat(Geometry/Polygon): nondegeneracy conditions and interconversion with Affine.Triangle Feb 25, 2026
@mathlib-bors mathlib-bors bot closed this Feb 25, 2026
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…with Affine.Triangle (leanprover-community#34598)

This PR implements suggestions provided in [this comment](leanprover-community#34393 (comment)) by @jsm28: interconversion between `Polygon P 3` and `Affine.Triangle` as well as the nondegeneracy conditions `NondegenerateVertices` and `NondegenerateEdges`. I tried to keep typeclass restrictions as minimal as possible.

Co-authored-by: AnsonBerns <[email protected]>
Co-authored-by: A. M. Berns <[email protected]>
pevogam pushed a commit to pevogam/mathlib4 that referenced this pull request Mar 19, 2026
…with Affine.Triangle (leanprover-community#34598)

This PR implements suggestions provided in [this comment](leanprover-community#34393 (comment)) by @jsm28: interconversion between `Polygon P 3` and `Affine.Triangle` as well as the nondegeneracy conditions `NondegenerateVertices` and `NondegenerateEdges`. I tried to keep typeclass restrictions as minimal as possible.

Co-authored-by: AnsonBerns <[email protected]>
Co-authored-by: A. M. Berns <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! 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.

6 participants