Skip to content

[Merged by Bors] - feat(Geometry/Euclidean): two formula for area of a triangle - #41220

Closed
wwylele wants to merge 10 commits into
leanprover-community:masterfrom
wwylele:triangle-area
Closed

wwylele wants to merge 10 commits into
leanprover-community:masterfrom
wwylele:triangle-area

Conversation

@wwylele

@wwylele wwylele commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator

This PR proves two basic formulas for triangle area: s = 1/2 * h * b = 1/2 * a * b * sin C


Open in Gitpod

@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

PR summary e9c0e4a341

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection 2370 2392 +22 (+0.93%)
Mathlib.Geometry.Euclidean.Triangle 2444 2453 +9 (+0.37%)
Import changes for all files
Files Import difference
3 files Mathlib.Geometry.Euclidean.Angle.Oriented.Projection Mathlib.Geometry.Euclidean.Sphere.Power Mathlib.Geometry.Euclidean.Sphere.Ptolemy
3
Mathlib.Geometry.Euclidean.Similarity 6
3 files Mathlib.Geometry.Euclidean.Angle.Unoriented.TriangleInequality Mathlib.Geometry.Euclidean.Congruence Mathlib.Geometry.Euclidean.Triangle
9
Mathlib.Geometry.Euclidean.Angle.Unoriented.Projection 22
Mathlib.Geometry.Euclidean.Volume.Triangle (new file) 2819

Declarations diff (regex)

+ _root_.Collinear.sin_angle_eq_left
+ _root_.Collinear.sin_angle_eq_right
+ dist_orthogonalProjection_eq_sin_mul_dist
+ dist_orthogonalProjection_eq_sin_mul_dist_of_collinear
+ height_eq_sin_mul_dist
+ volume_eq_height_mul
+ volume_eq_mul_sin

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 e9c0e4a).

  • +7 new declarations
  • −0 removed declarations
+Affine.Triangle.height_eq_sin_mul_dist
+Affine.Triangle.volume_eq_height_mul
+Affine.Triangle.volume_eq_mul_sin
+Collinear.sin_angle_eq_left
+Collinear.sin_angle_eq_right
+EuclideanGeometry.dist_orthogonalProjection_eq_sin_mul_dist
+EuclideanGeometry.dist_orthogonalProjection_eq_sin_mul_dist_of_collinear

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

Current commit e9c0e4a341
Reference commit 0740637818

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).

@github-actions github-actions Bot added the t-euclidean-geometry Affine and axiomatic geometry label Jul 1, 2026
@wwylele
wwylele force-pushed the triangle-area branch 2 times, most recently from fea7611 to c1ff4ef Compare July 1, 2026 03:42
@wwylele
wwylele marked this pull request as draft July 1, 2026 04:08
@mathlib-bors

mathlib-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in draft mode. No active bors state needed cleanup.

While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like bors r+ or bors try.

@wwylele
wwylele force-pushed the triangle-area branch 2 times, most recently from 6b2f7fa to 1a7cfdf Compare September 15, 2026 02:30
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 21, 2026
@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 Sep 21, 2026
@wwylele
wwylele requested a balanced review from Copilot September 21, 2026 21:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Proof-only dependencies should not be publicly re-exported, and one documentation typo remains.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 Low severity

Open (3)
What changed in this PR

Adds triangle area formulas based on height and sine.

Changes:

  • Adds projection-distance and triangle-height lemmas.
  • Proves base-height and side-angle area formulas.
  • Exposes the new volume module through Mathlib.lean.
File Description
Projection.lean Adds projection-distance sine identities.
Triangle.lean Relates triangle height to side length and angle.
Volume/​Triangle.lean Adds two triangle area formulas.
Mathlib.lean Imports the new module.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wwylele
wwylele marked this pull request as ready for review September 21, 2026 21:22
@wwylele
wwylele requested a balanced review from Copilot September 21, 2026 21:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The formulas, hypotheses, proofs, and module integration are consistent with the existing geometry APIs.

Review effort: Balanced
Findings: None

Resolved since last review (3)

@SnirBroshi SnirBroshi added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 23, 2026
@wwylele

wwylele commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks!
-awaiting-author

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 23, 2026
@jsm28

jsm28 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

maintainer merge

@github-actions

Copy link
Copy Markdown

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

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 27, 2026
@wwylele

wwylele commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

Merged from master to resolve the conflict on the import list

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 5, 2026
@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 5, 2026

@j-loreaux j-loreaux 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.

bors merge


theorem dist_orthogonalProjection_eq_sin_mul_dist (p : P) {q : P} {s : AffineSubspace ℝ P}
[s.direction.HasOrthogonalProjection] (h : q ∈ s) :
haveI : Nonempty s := ⟨q, h⟩

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.

I have to say, this pattern is quite unpleasant, but I'm not seeing an obvious way around it.

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Oct 27, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Oct 27, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Oct 27, 2026
This PR proves two basic formulas for triangle area: `s = 1/2 * h * b = 1/2 * a * b * sin C`

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 Oct 27, 2026
@mathlib-bors

mathlib-bors Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(Geometry/Euclidean): two formula for area of a triangle [Merged by Bors] - feat(Geometry/Euclidean): two formula for area of a triangle Oct 27, 2026
@mathlib-bors mathlib-bors Bot closed this Oct 27, 2026
@wwylele
wwylele deleted the triangle-area branch November 8, 2026 13:54
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.

5 participants