Skip to content

feat(LinearAlgebra/AffineSpace): add Desargues's theorem#37456

Open
Robertboy18 wants to merge 6 commits intoleanprover-community:masterfrom
Robertboy18:desargues-87
Open

feat(LinearAlgebra/AffineSpace): add Desargues's theorem#37456
Robertboy18 wants to merge 6 commits intoleanprover-community:masterfrom
Robertboy18:desargues-87

Conversation

@Robertboy18
Copy link
Copy Markdown

This PR adds an affine (parallel) version of Desargues's theorem!

Main changes

  • New file Mathlib/LinearAlgebra/AffineSpace/Desargues.lean with
    parallel_third_side_of_perspective: if two triangles are in perspective from a point S and
    two pairs of corresponding sides are parallel, then the third pair of sides is parallel.
  • Add the corresponding public import to Mathlib.lean.
  • Update docs/100.yaml (entry [Merged by Bors] - fix: add precedence for guardExpr #87) to point to the new declaration.

High level Proof idea is from the rocq repository!
Compare side vectors via exists_eq_smul_of_parallel for the two given pairs of parallel sides; the
shared comparison along SA forces the same scalar, yielding parallelism of the third sides.

Tests: lake build Mathlib.LinearAlgebra.AffineSpace.Desargues!

Copilot AI review requested due to automatic review settings March 31, 2026 18:25
@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Mar 31, 2026
@github-actions
Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

PR summary 9243d59d8c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.LinearAlgebra.AffineSpace.Desargues (new file) 1452

Declarations diff

+ exists_eq_smul_of_parallel
+ parallel_third_side_of_perspective

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@github-actions github-actions bot added the t-algebra Algebra (groups, rings, fields, etc) label Mar 31, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an affine/parallel version of Desargues’s theorem to the affine-geometry portion of Mathlib, and wires it into the umbrella import and the “100 theorems” index.

Changes:

  • Introduce parallel_third_side_of_perspective proving the “two pairs of corresponding sides parallel ⇒ third pair parallel” statement under perspective and noncollinearity hypotheses.
  • Add a public import of the new module in Mathlib.lean.
  • Point 100-theorems entry #87 to the new declaration in docs/100.yaml.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Mathlib/LinearAlgebra/AffineSpace/Desargues.lean New file containing the affine Desargues theorem and proof via exists_eq_smul_of_parallel.
Mathlib.lean Exposes the new Desargues module via public import.
docs/100.yaml Updates theorem #87 to reference the new declaration and author.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +16
If two triangles are in perspective from a point, and two pairs of corresponding sides are
parallel, then the third pair of corresponding sides are also parallel.
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.

This is not the full Desargues's theorem, right? The full version also allows non-parallel case (and the conclusion is the 3 intersections are collinear)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

It looks weird to me... The statement posted for HOL Light (https://www.cs.ru.nl/~freek/100/hol.html#87) looks closer to what I had in mind

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh I see, i actually followed the Frédérique Guilhot statement (in coq-community/HighSchoolGeometry):

@SnirBroshi
Copy link
Copy Markdown
Collaborator

Hey, can you please disclose any AI usage? (per the guidelines linked above)

Also your PR description currently mentions Mathlib's 87th PR, and you deleted both the separator and button from the PR template. Can you fix these issues?

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! t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants