Skip to content

feat(ForMathlib): single-chart boundary-cell count (3/4) - #15

Merged
riccardobrasca merged 5 commits into
masterfrom
idx-3
Jul 9, 2026
Merged

feat(ForMathlib): single-chart boundary-cell count (3/4)#15
riccardobrasca merged 5 commits into
masterfrom
idx-3

Conversation

@CBirkbeck

@CBirkbeck CBirkbeck commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Adds the 1/n-closeness helper abs_sub_le_one_div_of_ceil_natCast_mul_eq (introduced here, next to its first use per @xroblot's review) and ncard_index_image_chart_le: a single M-Lipschitz chart of [0,1]ᵈ⁻¹ meets O(nᵈ⁻¹) grid cells.

Builds green on the v4.31.0-rc1 / mathlib-master pin.

🤖 Generated with Claude Code


Stacked on 2/4. Adds the `1/n`-closeness helper `abs_sub_le_one_div_of_ceil_natCast_mul_eq`
(introduced here, next to its first use) and `ncard_index_image_chart_le`: one `M`-Lipschitz
chart of `[0,1]ᵈ⁻¹` meets `O(nᵈ⁻¹)` grid cells.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread CebotarevDensity/ForMathlib/IndexImageCount.lean Outdated
Comment thread CebotarevDensity/ForMathlib/IndexImageCount.lean Outdated
…iew)

Per riccardobrasca's review on PR #15:
- `abs_sub_le_one_div_of_ceil_natCast_mul_eq` now takes the natural
  `(hn : 0 < n)` (ℕ) rather than `0 < (n : ℝ)`, casting once internally.
- `ncard_index_image_chart_le` is shortened by extracting two reusable
  sub-results: `diam_Icc_inter_ceil_preimage_le` (the grid-fibre diameter
  bound) and `ncard_index_image_le_of_diam_le_lipschitz` (the per-cell
  count for a Lipschitz image of a small-diameter set).

No statement content changes to the public chart bound.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xroblot xroblot assigned xroblot and unassigned xroblot Jun 29, 2026
CBirkbeck added a commit that referenced this pull request Jul 9, 2026
…o [Finite ι]

Per @xroblot's review (PR #13): put each private helper next to its first use, and
weaken `setFinite`'s hypothesis.

- `setFinite_index_image_of_isBounded` now takes `[Finite ι]`, recovering `Fintype`
  via `Fintype.ofFinite` inside the proof — dropping the
  `set_option linter.unusedFintypeInType false` workaround (the conclusion never
  mentions `Fintype.card`).
- `ceil_natCast_mul_le_ceil_natCast_mul_add` moved next to its only consumer
  `ncard_index_image_le_of_diam_le`; `abs_sub_le_one_div_of_ceil_natCast_mul_eq`
  next to `ncard_index_image_chart_le`. This re-slices the stack so each helper lands
  in the PR that first uses it (#14, #15) instead of #13.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@riccardobrasca

Copy link
Copy Markdown
Collaborator

This now needs a merge master.

CBirkbeck and others added 2 commits July 9, 2026 11:38
…nature

- ncard_index_image_le_of_diam_le_lipschitz and ncard_index_image_chart_le
  take an explicit [Fintype i] (master merge generalised the section
  variable to {i : Type*})
- the _lipschitz helper drops the 0 <= r argument removed from
  ncard_index_image_le_of_diam_le in 14

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@CBirkbeck
CBirkbeck changed the base branch from idx-2 to master July 9, 2026 10:44
@CBirkbeck

Copy link
Copy Markdown
Owner Author

Done — merged master in and retargeted the base:

  • Base idx-2master (idx-2 merged in feat(ForMathlib): index-image diameter bound (2/4) #14; its branch wasn't deleted, so GitHub didn't auto-retarget this one).
  • Merged master — picks up the v4.32.0-rc1 pin and the ncard_index_image_le_of_diam_le signature from feat(ForMathlib): index-image diameter bound (2/4) #14 (the NeZero n / 0 ≤ r drop).
  • Fixed this slice for that signature change: ncard_index_image_le_of_diam_le_lipschitz and ncard_index_image_chart_le now take an explicit [Fintype ι] (master generalised the section variable to {ι : Type*}), and the _lipschitz helper no longer passes the removed 0 ≤ r argument.

lake build CebotarevDensity is green locally on the merge. The diff is back to just this slice on top of master (abs_sub_le_one_div_of_ceil_natCast_mul_eq, diam_Icc_inter_ceil_preimage_le, the single-chart count).

Comment thread CebotarevDensity/ForMathlib/IndexImageCount.lean Outdated
…omain

- ncard_index_image_chart_le now takes phi : (kappa -> R) -> (iota -> R)
  for any [Fintype kappa], with the boundary factor (n+1) ^ Fintype.card
  kappa in place of the hardcoded Fin (Fintype.card iota - 1); the proof
  only ever used finiteness of the domain (riccardobrasca review)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@riccardobrasca
riccardobrasca merged commit 0cdd4b4 into master Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants