Skip to content

fix(ForMathlib): exclude the base point in distinctDistancesFrom - #5065

Open
theebayuser wants to merge 1 commit into
google-deepmind:mainfrom
theebayuser:fix/distinct-distances-from-self
Open

fix(ForMathlib): exclude the base point in distinctDistancesFrom#5065
theebayuser wants to merge 1 commit into
google-deepmind:mainfrom
theebayuser:fix/distinct-distances-from-self

Conversation

@theebayuser

@theebayuser theebayuser commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Closes #5064. Stacked on #5063 (the diff shows both commits until that one merges; only the last commit is this PR).

  • distinctDistancesFrom now erases pt before taking the image, matching its docstring and the $j\neq i$ in the docstrings of both consumers.

  • erdos_1082.parts.ii drops its compensating - 1: since dist x pt = 0 ↔ x = pt, the old count is exactly the new count plus one, so the statement is propositionally equal and the linked formal_proof permalink (0aca4d7) still establishes it. The docstring's "each point only determines 3 distances" now also matches the definition's value.

  • maximalDistinctDistancesFrom / erdos_653 are value-invariant: every $R(x_i)$ shifts by exactly 1, which preserves the number of distinct values.

  • lake --wfail build FormalConjecturesForMathlib FormalConjectures.ErdosProblems.«1082» FormalConjectures.ErdosProblems.«653»

  • python3 scripts/check_category_warnings.py on the elaborated 1082: clean

@github-actions github-actions Bot added erdos-problems Erdős Problems for-mathlib touching our `FormalConjecturesForMathlib` dir labels Aug 19, 2026
The docstring says "distances between a given point and all other points",
and both consumers state R(x_i) = #{|x_j - x_i| : j ≠ i}, but the definition
took the image over all of `points`, so whenever `pt ∈ points` the self-distance
0 was counted too. Erase `pt` first.

Both consuming statements are unchanged as propositions:
- `erdos_1082.parts.ii` compensated with a `- 1`; since `dist x pt = 0` iff
  `x = pt`, the old count is exactly the new count plus one, so dropping the
  `- 1` yields a propositionally equal statement and the linked `formal_proof`
  permalink still establishes it.
- `maximalDistinctDistancesFrom` (and hence `erdos_653`) is value-invariant:
  every R(x_i) shifts by exactly 1, and the number of distinct values of a
  (+1)-shifted family is unchanged.
@theebayuser
theebayuser force-pushed the fix/distinct-distances-from-self branch from 749b9dc to 27a7a71 Compare August 20, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

erdos-problems Erdős Problems for-mathlib touching our `FormalConjecturesForMathlib` dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

distinctDistancesFrom counts the self-distance 0

1 participant