Skip to content

[#15090] feat: erased declarations in do notation - #64

Open
downstream-lean4[bot] wants to merge 6 commits into
masterfrom
adaptation-15090
Open

[#15090] feat: erased declarations in do notation#64
downstream-lean4[bot] wants to merge 6 commits into
masterfrom
adaptation-15090

Conversation

@downstream-lean4

Copy link
Copy Markdown
Contributor

This is the adaptation PR for leanprover/lean4#15090.

@downstream-lean4 downstream-lean4 Bot added adaptation This is an adaptation PR for a PR in the lean4 repository. toolchain-available labels Sep 10, 2026
@downstream-lean4 downstream-lean4 Bot changed the title [#15090] feat: ghost declarations in do notation [#15090] feat: erased declarations in do notation Sep 10, 2026
The fieldRange Algebra instance synthesizes within 18000 heartbeats locally and exceeds the 20000 default on CI.
@downstream-lean4

Copy link
Copy Markdown
Contributor Author

Build report for fix: justify the maxHeartbeats bump for the style linter

Turned red:

Repo Critical Build Test Lint
mathlib4 🟥 in 184s ⏭️ ⏭️
cslib ⏭️ ⏭️ ⏭️
Stayed green
Repo Critical Build Test Lint
aesop ✅ in 7s ✅ in 4s ⏭️
batteries ✅ in 4s ✅ in 4s ✅ in 2s
import-graph ✅ in 2s ✅ in 4s ⏭️
lean4-cli ✅ in 1s ✅ in 0s ⏭️
plausible ✅ in 1s ✅ in 2s ⏭️
ProofWidgets4 ✅ in 3s ✅ in 1s ⏭️
quote4 ✅ in 2s ✅ in 1s ⏭️
reference-manual ✅ in 15s ⏭️ ⏭️
BibtexQuery ✅ in 1s ⏭️ ⏭️
comparator ✅ in 2s ⏭️ ⏭️
doc-gen4 ✅ in 3s ⏭️ ⏭️
illuminate ✅ in 3s ✅ in 11s ⏭️
lean4-unicode-basic ✅ in 2s ⏭️ ⏭️
lean4export ✅ in 0s ✅ in 7s ⏭️
LeanSearchClient ✅ in 1s ✅ in 0s ⏭️
leansqlite ✅ in 4s ✅ in 19s ⏭️
nerodia ✅ in 2s ✅ in 21s ⏭️
repl ✅ in 1s ✅ in 59s ⏭️
verso ✅ in 35s ✅ in 87s ⏭️
verso-slides ✅ in 49s ✅ in 6s ⏭️
verso-web-components ✅ in 30s ⏭️ ⏭️

View run

Kha added a commit that referenced this pull request Sep 11, 2026
Fixes the red `master` after the bump to `nightly-2026-09-11` ([run
34590361152](https://github.com/leanprover/downstream-lean4/actions/runs/34590361152)).
One commit, `mathlib4` only.

## mathlib4

**Cause.** The bump commit changes only `lean-toolchain`, yet
`Mathlib.FieldTheory.Galois.IsGaloisGroup` stops compiling:

```
error: Mathlib/FieldTheory/Galois/IsGaloisGroup.lean:225:6: failed to synthesize
    Algebra K ↥(IsScalarTower.toAlgHom K F L).fieldRange
  (deterministic) timeout at `typeclass`, maximum number of heartbeats (20000) has been reached
```

It is a small drift. With Mathlib's `leanOptions` (`maxSynthPendingDepth
:= 3`), `synthInstance.maxHeartbeats 21000` is already enough on
`nightly-2026-09-11`. The adaptation branches for lean4#15090 (#64) and
lean4#15066 (#59) hit the same error once their pr-releases were based
on lean4 master past `nightly-2026-09-10`; `pr-release-15090-0d7390f`
(based on the `nightly-2026-09-10` commit) was fine and
`pr-release-15090-61a42c0` (based on lean4#15098) was not. That puts the
cause among lean4#15001, #15093, #15060, #15048, #15107 and #15098. None
of these obviously changes allocation counts inside instance synthesis,
so I have not pinned it to one PR.

**Fix.** `set_option synthInstance.maxHeartbeats 80000 in` on
`IsGaloisGroup.of_isScalarTower`, with the justifying comment the style
linter asks for. This copies #64's hunk verbatim (the resulting blob is
identical to the one on `adaptation-15090`), so merging #64 later stays
clean. #59 raises the same limit to 40000 and will conflict on this line
either way.

**Verified locally** on `nightly-2026-09-11`: `lake build Mathlib
Archive Counterexamples Wanted --wfail`, `lake test --iofail` and `lake
lint` all pass.

## cslib

CI skipped it behind mathlib4, so it has not been built on this nightly.
**Verified locally**, no change needed: `lake build --wfail --iofail`,
`lake test --wfail --iofail` and `lake lint` all pass.

## repl

Its `lake test` failed only as a knock-on: `test.sh` builds real Mathlib
in `test/Mathlib`, which stopped at the same `IsGaloisGroup` error, and
`H20231110` then failed because `Real` was unavailable. No change
needed. **Verified locally**: `lake build` and `lake test` pass with
this fix.

## Unfinished

Nothing.

<!-- downstream-watch: unattended -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adaptation This is an adaptation PR for a PR in the lean4 repository. cache-available toolchain-available

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant