Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Counting transfer definition Erdos9796Counting_IsoscelesCount

Definition
Erdos9796Counting_IsoscelesCount

by mysticflounder · Sep 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

erdos-97-96-counting

Supporting definition bundle Erdos9796Proof.P97.IsoscelesCount for the Erdős counting formalization.

Definition code
/- Generated by exact skeleton subtraction from Erdos9796Proof.P97.IsoscelesCount; source SHA-256 207564b11a38e9270192c8e5de3202b113b7f89c7ece5af3bc12954928d3013c -/
import Definitions.Def_Erdos9796Counting_Adapter
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Finset.Powerset


/-!
# Isosceles count for Erdős Problem 97 (Dumitrescu lower bound, Milestone 3)

Defines the per-vertex and total isosceles count of a finite point set,
in the Dumitrescu 2006 / Nivasch–Pach–Pinchasi–Zerbib 2013 convention
(equilaterals counted three times), and proves the easy lower bound:

  Per-vertex `K4` ⇒ each vertex contributes `≥ C(4,2) = 6` isosceles pairs.
  Summing: `6 · |A| ≤ I(A)`.

The matching upper bound `I(A) ≤ (11·|A|²−18·|A|)/12` for convex point
sets is Dumitrescu 2006 eq. (5), still open
(`p97-isosceles-count-upper-bound`).

References: doc slug `p97-isosceles-obstruction`.
-/

set_option linter.style.openClassical false

open scoped EuclideanGeometry
open Finset Classical

namespace Problem97

/-- Unordered pairs of points in `A.erase p` at common distance from `p`.
Each such pair witnesses one isosceles triangle with apex `p`. -/
noncomputable def IsoscelesPairsAt (A : Finset ℝ²) (p : ℝ²) : Finset (Finset ℝ²) :=
  ((A.erase p).powersetCard 2).filter (fun s => ∃ r : ℝ, ∀ q ∈ s, dist p q = r)

/-- The number of isosceles triangles with apex `p`. -/
noncomputable def iCountAt (A : Finset ℝ²) (p : ℝ²) : ℕ := (IsoscelesPairsAt A p).card

/-- Total isosceles count of `A`, equilaterals counted 3× (Dumitrescu 2006). -/
noncomputable def iCount (A : Finset ℝ²) : ℕ := ∑ p ∈ A, iCountAt A p





















end Problem97
Source
https://github.com/mysticflounder/erdos-97-96-formalization/blob/88d43fbd49e26dd52753787835044facf1ed91e5/prove2me/submissions/counting-transfer/platform/Definitions/Def_Erdos9796Counting_IsoscelesCount.lean#L1-L63

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me