{"id":"zenodo:23813098","source":"zenodo","external_id":"10.5281/zenodo.23813098","doi":"10.5281/zenodo.23813098","title":"Classical triangle inequalities and the Fermat–Napoleon configuration in Lean 4","abstract":"We give machine-checked proofs, in Lean 4 with Mathlib, of a body of classical inequalities and extremal theorems for the triangle, together with the Fermat–Napoleon configuration. For an arbitrary Affine.Triangle in a real inner product space of any dimension, using Mathlib’s own circumcentre, circumradius, incentre, inradius, excentres, exradii, centroid and orthocentre, we prove Euler’s relation OI2 = R2 − 2Rr, Euler’s inequality R ≥ 2r with its equality case (equality exactly for equilateral triangles) and the excircle relation OI2 a = R2 + 2Rra; the formulas OG2 = R2−(a2+b2+c2)/9, OH2 = 9R2−(a2+b2+c2) and IG2 = (s2+5r2−16Rr)/9; Gerretsen’s inequalities 16Rr − 5r2 ≤ s2 ≤ 4R2 + 4Rr + 3r2 and Kooi’s sharper upper bound; the Weitzenböck, Hadwiger–Finsler and triangle isoperimetric inequalities with their equality cases; the Leibniz relation and the minimality of |XAi|2 at the centroid; and the Neuberg Pedoe inequality for two triangles with equality exactly for similar triangles. We characterise the equality case of Ptolemy’s inequality in any real inner product space (concyclic points in separated order, or collinear points in one of eight orders). For a point X of the closed triangle we prove the Erdős–Mordell inequality, its key lemma and its equality case (equilateral triangle, X the centre), and, for interior points, Barrow’s inequality. If every angle is less than 2π/3, the Fermat–Torricelli point exists and minimises XA+XB +XC over the whole space. In the oriented plane we prove that the segments AA′, BB′, CC′ to the apexes of the outer equilateral triangles have equal lengths and lie on concurrent lines meeting pairwise at angle π/3, that if every angle is less than 2π/3 the common point is the Fermat point F and AA′ = FA+FB+FC, and Napoleon’s theorem with the centroid statement. All proofs use only Lean’s three standard axioms. Several of these results were formalised before us, and we reprove them independently: Euler’s relation, Euler’s inequality and the excircle relation (two Lean developments, one of them an open Mathlib pull request), Ptolemy’s inequality (in Mathlib since 2022), the Erdős Mordell inequality and its key lemma (two Lean developments, for interior points in the plane), algebraic forms of Weitzenböck and Hadwiger–Finsler, and Napoleon’s theorem (Isabelle and several Lean developments, including our own earlier one). For the remaining statements we found no earlier formal proof in the sources we searched, subject to stated gaps.","primary_category":"math.LO","domain":"math","license_url":"https://creativecommons.org/licenses/by/4.0/","license_short":"CC BY 4.0","can_host_fulltext":true,"pdf_url":"/pdf/zenodo:23813098.pdf","canonical_url":"https://zenodo.org/records/23813098","source_repo_url":"https://github.com/jpbald93/paperh_fermat","proof_system":"Lean 4","tcb_grade":"TCB-2","track":"verified","tcb_notes":"Seeded with linked Lean 4 artifact (https://github.com/jpbald93/paperh_fermat); eligible for sandboxed TCB-0/TCB-1 promotion.","merkle_root":"2f616910d6c45344b3891f2f922d673b57e656c7cc117b9baec8841309a52023","published_at":"2026-10-30","ingested_at":"2026-11-30T13:55:10+00:00","version":1,"doi_url":"https://doi.org/10.5281/zenodo.23813098","authors":["Bald, Joshua"],"categories":["math.LO"],"ai_provenance":{"disclosed":false,"models":["Indexed from Zenodo Open Preprints"],"human_role":"Bald, Joshua","verification_notes":"Passed certXiv prompt-artifact hygiene scan on ingestion."},"audit_report":{"passed":true,"source":"zenodo-open-preprint","findings":[]},"tcb_meta":{"code":"TCB-2","label":"Reproducible Compute","track":"verified","rank":2,"icon":"●","summary":"Backed by executable verification code, simulation scripts, or hybrid formal+tested artifacts with SHA-256 integrity hash."},"claims":[],"citations":[],"upgrades":[],"verification_jobs":[],"versions":[],"reviews":[],"latest_review":null}