Skip to content

chore: safe-subset golfing batch from #16 (fun_prop + named lemmas) (−62 lines)#30

Merged
cameronfreer merged 1 commit into
mainfrom
cleanup-safe-golfing-batch
May 18, 2026
Merged

chore: safe-subset golfing batch from #16 (fun_prop + named lemmas) (−62 lines)#30
cameronfreer merged 1 commit into
mainfrom
cleanup-safe-golfing-batch

Conversation

@cameronfreer

Copy link
Copy Markdown
Owner

Summary

Mines safe-subset replacements from the PR #16 autoGolf draft and applies them to current main, skipping the suspicious category (lia / bare assumption / Real.ext_cauchy / grind only on non-arithmetic goals).

Net diff: 10 files, +22 / −84 (−62 lines).

What changed

fun_prop adoption — replaces hand-built Measurable.const_mul + Finset.measurable_sum + .comp chains

File Sites Notes
DeFinetti/ViaKoopman/BlockAverage.lean 1 inside blockAvg_tendsto_condExp
DeFinetti/ViaL2/BlockAvgDef.lean 1 blockAvg_measurable
DeFinetti/ViaL2/AlphaConvergence.lean 2 hA_meas_nm, the AEStronglyMeasurable wrap
DeFinetti/ViaL2/CesaroConvergence.lean 3 h_meas_n, h_meas_n', the memLp_two_of_bounded measurability obligation
DeFinetti/ViaL2/DirectingMeasureIntegral.lean 4 three hg_avg_meas/hA_meas sites + one Integrable derivation (was 3 lines via .sub+.norm)
DeFinetti/ViaL2/MainConvergence.lean 1 hA_meas
DeFinetti/ViaMartingale/PairLawEquality.lean 1 h_consSeq_meas (was a simpa [consSeq] using measurable_consRV …)
Ergodic/ShiftInvariantRepresentatives.lean 1 hstep (was measurable_coe_real_ereal.comp hreal)
Core.lean:683 1 collapse simpa using (show … from by fun_prop) to bare fun_prop

Named-lemma replacements

  • DeFinetti/ViaL2/DirectingMeasureIntegral.lean: 2 hand-built proofs that Set.range Iic is a π-system (obtain ⟨s, rfl⟩; obtain ⟨t, rfl⟩; use min s t; exact Set.Iic_inter_Iic.symm) → one-call isPiSystem_Iic from mathlib.
  • Contractability.lean:perm_range_eq — 4-line ext + simp only + use σ.symm x + simpFinset.image_univ_equiv σ.

Minor

  • BlockAvgDef.lean: two := by exact …:= … (style).

Out of scope (deliberately not applied from #16)

  • BlockAverage.lean:82 congr 1; ringlia swap — opaque substitution on a non-arithmetic context; in the suspicious category per the audit.
  • The proof-golfing-branch reversion of refactor: thin exists_perm_extending_strictMono via mathlib API (−46 lines) #18's exists_perm_extending_strictMono refactor (already superseded).
  • Core.lean other minor non-fun_prop golfing (cylinder_subset_prefixCylinders := by rfl, pathLaw_map_prefix_perm by exact removal) — low-yield style polish; left for a later pass.

Verification

Check Baseline (main = 5c5ae81) This branch
lake build clean (3527 jobs) clean (3527 jobs)
Axioms (11 theorem decls) standard only standard only
Sorries (Exchangeability) 0 0

No statement or signature changes.

Mines safe-subset replacements from the PR #16 autoGolf draft and applies
them to current main, skipping the suspicious subset (lia / bare
assumption / Real.ext_cauchy / grind only on non-arithmetic goals).

`fun_prop` adoptions (replace hand-built `Measurable.const_mul +
Finset.measurable_sum + .comp` chains):

- `DeFinetti/ViaKoopman/BlockAverage.lean`     (1 site)
- `DeFinetti/ViaL2/BlockAvgDef.lean`           (1 site)
- `DeFinetti/ViaL2/AlphaConvergence.lean`      (2 sites)
- `DeFinetti/ViaL2/CesaroConvergence.lean`     (3 sites)
- `DeFinetti/ViaL2/DirectingMeasureIntegral.lean` (4 sites, incl. one
  Integrable wrap via `fun_prop`)
- `DeFinetti/ViaL2/MainConvergence.lean`       (1 site)
- `DeFinetti/ViaMartingale/PairLawEquality.lean` (1 site,
  `measurable_consRV` → fun_prop)
- `Ergodic/ShiftInvariantRepresentatives.lean` (1 site,
  `measurable_coe_real_ereal.comp …` → fun_prop)
- `Core.lean:683` — collapse `simpa using (show … from by fun_prop)` to
  bare `fun_prop`.

Named-lemma replacements:

- `DeFinetti/ViaL2/DirectingMeasureIntegral.lean` 2× hand-built
  `IsPiSystem` proof for `Set.range Iic` → `isPiSystem_Iic`.
- `Contractability.lean:perm_range_eq` — 4-line `ext`+`use`+`simp` →
  `Finset.image_univ_equiv σ`.

Minor `by exact` removals in `BlockAvgDef.lean`.

Out of scope (per the audit, suspicious-category from #16):
- `BlockAverage.lean:82` `congr 1; ring` → `lia` swap (opaque substitution
  on non-arithmetic context).
- The proof-golfing-branch reversion of #18's
  `exists_perm_extending_strictMono` refactor.

Net -62 lines across 10 files. Build clean (3527 jobs), axioms standard,
0 sorries. No statement or signature changes.
@cameronfreer cameronfreer merged commit 68f2c62 into main May 18, 2026
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.

1 participant