mathlib4 Euclidean geometry¶
L5 Foundational · Archetype: analytic-formal · upstream · dossier
Believe it because geometry is defined from real inner-product spaces and every theorem is a kernel-checked consequence of Lean’s logic alone.
Trust chain¶
Ontology |
Real inner-product space V acting on a metric space P (NormedAddTorsor); AffineSubspace, Sphere, Affine.Simplex. (What exists?) |
Language |
Lean 4 propositions over P: dist p₁ p₂ = dist p₁ p₃ → ∠ p₁ p₂ p₃ = ∠ p₁ p₃ p₂. (How is a statement written?) |
Assumptions |
None geometric: only Lean’s logical axioms (propext, choice, Quot.sound); ℝ is constructed. (What is taken as given?) |
Engine |
Tactics (simp, linarith, nlinarith, field_simp, linear_combination) producing kernel terms. (How are new truths derived?) |
Certificate |
Lean proof term. (What evidence is left behind?) |
Checker |
Lean 4 kernel only. (What must be trusted?) |
Semantics |
By construction: any real inner-product affine space, including ℝⁿ. (What model makes it sound?) |
At a glance¶
- Logic / calculus:
Dependent type theory
- Exact vs numeric:
Exact (real analysis)
- Decision procedure:
Tactic search; kernel checks result
- Role of the diagram:
None
- Degeneracy handling:
Junk values or explicit hypotheses
- Trusted base (size):
~8k lines (kernel)
- Trusts:
Lean 4 kernel (~8k lines C++ (estimate))
A statement in its own language¶
/-- **Isosceles Triangle Theorem**: Pons asinorum, angle-at-point form. -/
theorem angle_eq_angle_of_dist_eq {p₁ p₂ p₃ : P} (h : dist p₁ p₂ = dist p₁ p₃) :
∠ p₁ p₂ p₃ = ∠ p₁ p₃ p₂ := by
Source: Triangle.lean#L280-L282
Findings¶
Zero `axiom`, `sorry`, or `native_decide` in Geometry/Euclidean and LinearAlgebra/AffineSpace.
Junk values make statements total: angle 0 x = π/2, so pons asinorum needs no distinctness hypothesis.
Dimension-polymorphic results (Monge point, sphere power, inversion) but no radical axis, cross ratio, Menelaus, Pappus, or Desargues.
In the showcase¶
I.5 Pons asinorum — theorem
EuclideanGeometry.angle_eq_angle_of_dist_eqI.47 Pythagorean theorem — theorem
EuclideanGeometry.dist_sq_eq_dist_sq_add_dist_sq_iff_angle_eq_pi_div_twoIII.31 Angle in a semicircle — theorem
EuclideanGeometry.Sphere.angle_eq_pi_div_two_iff_mem_sphere_of_isDiameterSimson line — absent
—