Use this theorem
Create a project
lake +leanprover/lean4:v4.35.0 new myproject std.toml cd myprojectStandard template, not
math: themathtemplate adds its own Mathlib requirement pinned to the Lean release tag, not to the Mathlib commit this package is built and tested with, so you would get a second, different Mathlib. Mathlib comes in through this package. Skip this step in an existing project with the same Lean and Mathlib.Add the dependency to
lakefile.toml[[require]] name = "formalizations" git = "https://github.com/karlesmarin/formalizations" rev = "v0.15.0"Import the minimal module
import Formalizations.Reusable.GeometryIn a file of the project, e.g.
Example.lean.Paste the example
open Formalizations.Reusable Matrix Real /-- Pappus over `ℚ`: the three meets are collinear. -/ example (A B C a b c : Fin 3 → ℚ) (h₁ : A ⬝ᵥ (B ⨯₃ C) = 0) (h₂ : a ⬝ᵥ (b ⨯₃ c) = 0) : ((A ⨯₃ b) ⨯₃ (a ⨯₃ B)) ⬝ᵥ (((A ⨯₃ c) ⨯₃ (a ⨯₃ C)) ⨯₃ ((B ⨯₃ c) ⨯₃ (b ⨯₃ C))) = 0 := pappus_hexagon A B C a b c h₁ h₂Steps 3 and 4 together are a complete Lean file:
FormalizationsTest/ReusableGeometryExample.leanat v0.15.0, compiled by the CI.Fetch and check
lake update lake lean Example.leanlake updatefetches this package and Mathlib, and Mathlib's update hook downloads the compiled Mathlib (lake exe cache get).lake lean Example.leanbuilds the imports of the file (steps 3 and 4) and checks it. If the file belongs to alean_libof your project,lake build <lib>does the same. Avoid a barelake buildin a project from the standard template: its default target is the executable, whose link compiles every imported Mathlib module to native code. Same versions required: Leanv4.35.0, Mathlibf0b4c81.
Alternative: import Formalizations.Reusable imports the whole layer (all areas).
Pappus's hexagon theorem in homogeneous coordinates over any commutative ring: if A, B, C are collinear and a, b, c are collinear, the meets Ab∩aB, Ac∩aC, Bc∩bC are collinear, with no non-degeneracy hypothesis.
Lean statement
theorem pappus_hexagon {R : Type*} [CommRing R] (A B C a b c : Fin 3 → R)
(h₁ : A ⬝ᵥ (B ⨯₃ C) = 0) (h₂ : a ⬝ᵥ (b ⨯₃ c) = 0) :
((A ⨯₃ b) ⨯₃ (a ⨯₃ B)) ⬝ᵥ (((A ⨯₃ c) ⨯₃ (a ⨯₃ C)) ⨯₃ ((B ⨯₃ c) ⨯₃ (b ⨯₃ C))) = 0Links
Lean docstring
Pappus's hexagon theorem (homogeneous coordinates, any commutative ring).
Points of the projective plane are vectors of R³; three points are collinear when their triple product A ⬝ᵥ (B ⨯₃ C) vanishes, and the meet of the lines PQ and RS is (P ⨯₃ Q) ⨯₃ (R ⨯₃ S). If A, B, C are collinear and a, b, c are collinear, then the three meets Ab ∩ aB, Ac ∩ aC, Bc ∩ bC are collinear. No non-degeneracy hypothesis is needed: the conclusion is an ideal-membership identity.
- Archive:
Pappus.pappus(Formalizations.Geometry.Projective.Pappus); no research paper. - Classical reference: Pappus of Alexandria, Collection, Book VII (c. 320 AD); R. Whitty, Theorem of the Day, «Pappus' Theorem».
- Example: over
ℤ, fromh₁ : A ⬝ᵥ (B ⨯₃ C) = 0andh₂ : a ⬝ᵥ (b ⨯₃ c) = 0,pappus_hexagon A B C a b c h₁ h₂gives the collinearity of the three meets.
Upstream
the proof is a degree-9 ideal-membership certificate of several hundred terms; Mathlib would want a synthetic or affine proof
Depends on, in this repository
None besides the archive module (repo_dependencies = []).