FormalConjecturesForMathlib/Geometry/Metric.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

9 declarations, 0 contain sorry, 0 declared as axioms

Imports (8)
Imported by 2 files
  1. def unitDistNum The number of pairs of points of a finite set s in a metric space that are distance 1 apart line 35 source

    Source documentation

    The number of pairs of points of a finite set s in a metric space that are distance 1 apart.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Nat

    Proof uses: Finset.card, Sym2, Finset.filter, Eq, Real, Dist.dist, Prod.fst, Quot.out, Prod, Sym2.Rel, Prod.snd, OfNat.ofNat, Finset.sym2

    5 instances, coercions and auxiliary constants left out.

    noncomputable def unitDistNum (s : Finset X) : ℕ := #{p ∈ s.sym2 | dist p.out.1 p.out.2 = 1}
  2. def distanceSet The set of distances determined by a finite set of points in a metric space line 38 source

    Source documentation

    The set of distances determined by a finite set of points in a metric space.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Real

    Proof uses: Finset.image, Prod, Dist.dist, Prod.fst, Prod.snd, Finset.offDiag

    3 instances, coercions and auxiliary constants left out.

    noncomputable def distanceSet (points : Finset X) : Finset ℝ :=
    …
  3. def distinctDistances Given a finite set of points in a metric space, we define the number of distinct distances between pairs of points line 45 source

    Source documentation

    Given a finite set of points in a metric space, we define the number of distinct distances between pairs of points.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Nat

    Proof uses: Finset.card, Real, distanceSet

    noncomputable def distinctDistances (points : Finset X) : ℕ :=
    …
  4. def minimalDistinctDistances The minimum number of distinct distances determined by a set of n points in X line 50 source

    Source documentation

    The minimum number of distinct distances determined by a set of n points in X.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Nat

    Proof uses: InfSet.sInf, Set.ofPred, Exists, Finset, And, Eq, Finset.card, distinctDistances

    1 instances, coercions and auxiliary constants left out.

    noncomputable def minimalDistinctDistances (n : ℕ) : ℕ :=
    …
  5. def distanceMultiplicity The multiplicity of the distance d determined by points, that is, the number of unordered pairs of distinct points at distance d apart line 55 source

    Source documentation

    The multiplicity of the distance d determined by points, that is, the number of unordered pairs of distinct points at distance d apart.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Real, Nat

    Proof uses: HDiv.hDiv, Finset.card, Prod, Finset.filter, Eq, Dist.dist, Prod.fst, Prod.snd, Finset.offDiag, OfNat.ofNat

    6 instances, coercions and auxiliary constants left out.

    noncomputable def distanceMultiplicity (points : Finset X) (d : ℝ) : ℕ :=
    …
  6. def distinctDistancesFrom Given a finite set of points in a metric space, we define the number of distinct distances between a given point and all other points line 61 source

    Source documentation

    Given a finite set of points in a metric space, we define the number of distinct distances between a given point and all other points.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Nat

    Proof uses: Finset.card, Real, Finset.image, Dist.dist, Finset.erase, Classical.propDecidable, Eq

    3 instances, coercions and auxiliary constants left out.

    noncomputable def distinctDistancesFrom (points : Finset X) (pt : X) : ℕ :=
    …
  7. theorem unitDistNum_le_choose_two The number of unit-distance pairs of a finite set of n points is at most $\binom{n}{2}$, the total number of unordered pairs of distinct points line 67 source

    Source documentation

    The number of unit-distance pairs of a finite set of n points is at most $\binom{n}{2}$, the total number of unordered pairs of distinct points.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, LE.le, Nat, unitDistNum, Nat.choose, Finset.card, OfNat.ofNat

    Proof uses: Eq.mpr, Sym2, Finset.filter, Eq, Real, Dist.dist, Prod.fst, Quot.out, Prod, Sym2.Rel, Prod.snd, Finset.sym2, id, congrArg, unitDistNum.eq_1, Finset.image, Classical.propDecidable, Function.uncurry, Sym2.mk, Finset.offDiag and 26 more

    31 instances, coercions and auxiliary constants left out.

    Tactic trace: 11 steps

    Open to load the checked before-and-after goal states.

    theorem unitDistNum_le_choose_two (s : Finset X) : unitDistNum s ≤ (#s).choose 2 := by
    …

    Mentions: unitDistNum

  8. theorem even_card_offDiag_filter_dist_eq The ordered pairs of distinct points of points at distance d come in swapped pairs, so there are evenly many of them line 80 source

    Source documentation

    The ordered pairs of distinct points of points at distance d come in swapped pairs, so there are evenly many of them.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Real, Even, Nat, Finset.card, Prod, Finset.filter, Eq, Dist.dist, Prod.fst, Prod.snd, Finset.offDiag

    Proof uses: Eq.mpr, id, congrArg, rfl, ZMod, OfNat.ofNat, Eq.symm, propext, ZMod.natCast_eq_zero_iff_even, Finset.sum, Finset.sum_involution, Membership.mem, Prod.swap, of_decide_eq_true, HAdd.hAdd, Bool, Decidable.decide, Bool.true, Eq.refl, Ne and 20 more

    46 instances, coercions and auxiliary constants left out.

    Tactic trace: 16 steps

    Open to load the checked before-and-after goal states.

    theorem even_card_offDiag_filter_dist_eq (points : Finset X) (d : ℝ) :
        Even #(points.offDiag.filter fun (pair : X × X) => dist pair.1 pair.2 = d) := by
    …
  9. theorem sum_distanceMultiplicity The multiplicities of the distances determined by points add up to the number of unordered pairs of distinct points line 99 source

    Source documentation

    The multiplicities of the distances determined by points add up to the number of unordered pairs of distinct points.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: MetricSpace, Finset, Eq, Nat, Finset.sum, Real, distanceSet, distanceMultiplicity, Nat.choose, Finset.card, OfNat.ofNat

    Proof uses: id, Finset.image, Prod, Dist.dist, Prod.fst, Prod.snd, Finset.offDiag, Eq.mpr, HDiv.hDiv, Finset.filter, congrArg, Eq.symm, Nat.sum_div, Membership.mem, Iff.mp, Even, Dvd.dvd, even_iff_two_dvd, even_card_offDiag_filter_dist_eq, Finset.card_eq_sum_card_image and 19 more

    41 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

    Open to load the checked before-and-after goal states.

    theorem sum_distanceMultiplicity (points : Finset X) :
        ∑ d ∈ distanceSet points, distanceMultiplicity points d = (#points).choose 2 := by
    …

    Mentions: distanceSet, distanceMultiplicity