Skip to content

Commit 229f9ed

Browse files
committed
chore: bump toolchain to v4.29.0-rc4 (leanprover-community#36122)
1 parent 7e398f1 commit 229f9ed

File tree

9 files changed

+25
-112
lines changed

9 files changed

+25
-112
lines changed

Mathlib/Algebra/Group/Ext.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ theorem DivInvMonoid.ext {M : Type*} ⦃m₁ m₂ : DivInvMonoid M⦄
131131
exact @MonoidHom.map_zpow' M M m₁ m₂ f (congr_fun h_inv) x m
132132
have : m₁.div = m₂.div := by
133133
ext a b
134-
exact @map_div' _ _
135-
(F := @MonoidHom _ _ (_) _) _ (id _) _ inferInstance f (congr_fun h_inv) a b
134+
exact (@div_eq_mul_inv _ m₁ a b).trans
135+
(((congr_fun (congr_fun h_mul a) _).trans
136+
(congr_arg _ (congr_fun h_inv b))).trans (@div_eq_mul_inv _ m₂ a b).symm)
136137
rcases m₁ with @⟨_, ⟨_⟩, ⟨_⟩⟩
137138
congr
138139

Mathlib/Algebra/Quaternion.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ def starAe : ℍ[R] ≃ₐ[R] ℍ[R]ᵐᵒᵖ :=
12281228
theorem coe_starAe : ⇑(starAe : ℍ[R] ≃ₐ[R] ℍ[R]ᵐᵒᵖ) = op ∘ star :=
12291229
rfl
12301230

1231+
set_option backward.isDefEq.respectTransparency false in
12311232
/-- Square of the norm. -/
12321233
def normSq : ℍ[R] →*₀ R where
12331234
toFun a := (a * star a).re

Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,15 @@ theorem coe_mem_iff_mem {x : (CliffordAlgebra Q)ˣ} :
150150

151151
end lipschitzGroup
152152

153+
set_option backward.isDefEq.respectTransparency false in
153154
/-- `pinGroup Q` is defined as the infimum of `lipschitzGroup Q` and `unitary (CliffordAlgebra Q)`.
154155
See `mem_iff`. -/
155156
def pinGroup (Q : QuadraticForm R M) : Submonoid (CliffordAlgebra Q) :=
156157
(lipschitzGroup Q).toSubmonoid.map (Units.coeHom <| CliffordAlgebra Q) ⊓ unitary _
157158

158159
namespace pinGroup
159160

161+
set_option backward.isDefEq.respectTransparency false in
160162
/-- An element is in `pinGroup Q` if and only if it is in `lipschitzGroup Q` and `unitary`. -/
161163
theorem mem_iff {x : CliffordAlgebra Q} :
162164
x ∈ pinGroup Q ↔
@@ -168,10 +170,12 @@ theorem mem_lipschitzGroup {x : CliffordAlgebra Q} (hx : x ∈ pinGroup Q) :
168170
x ∈ (lipschitzGroup Q).toSubmonoid.map (Units.coeHom <| CliffordAlgebra Q) :=
169171
hx.1
170172

173+
set_option backward.isDefEq.respectTransparency false in
171174
theorem mem_unitary {x : CliffordAlgebra Q} (hx : x ∈ pinGroup Q) :
172175
x ∈ unitary (CliffordAlgebra Q) :=
173176
hx.2
174177

178+
set_option backward.isDefEq.respectTransparency false in
175179
theorem units_mem_iff {x : (CliffordAlgebra Q)ˣ} :
176180
↑x ∈ pinGroup Q ↔ x ∈ lipschitzGroup Q ∧ ↑x ∈ unitary (CliffordAlgebra Q) := by
177181
rw [mem_iff, lipschitzGroup.coe_mem_iff_mem]
@@ -205,6 +209,7 @@ theorem star_mul_self_of_mem {x : CliffordAlgebra Q} (hx : x ∈ pinGroup Q) : s
205209
theorem mul_star_self_of_mem {x : CliffordAlgebra Q} (hx : x ∈ pinGroup Q) : x * star x = 1 :=
206210
hx.2.2
207211

212+
set_option backward.isDefEq.respectTransparency false in
208213
/-- See `star_mem_iff` for both directions. -/
209214
theorem star_mem {x : CliffordAlgebra Q} (hx : x ∈ pinGroup Q) : star x ∈ pinGroup Q := by
210215
rw [mem_iff] at hx ⊢
@@ -257,6 +262,7 @@ instance : Group (pinGroup Q) where
257262
inv := star
258263
inv_mul_cancel := star_mul_self
259264

265+
set_option backward.isDefEq.respectTransparency false in
260266
instance : StarMul (pinGroup Q) where
261267
star_involutive _ := Subtype.ext <| star_involutive _
262268
star_mul _ _ := Subtype.ext <| star_mul _ _
@@ -390,6 +396,7 @@ instance : Group (spinGroup Q) where
390396
inv := star
391397
inv_mul_cancel := star_mul_self
392398

399+
set_option backward.isDefEq.respectTransparency false in
393400
instance : StarMul (spinGroup Q) where
394401
star_involutive _ := Subtype.ext <| star_involutive _
395402
star_mul _ _ := Subtype.ext <| star_mul _ _

Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ lemma UniversalCoprimeFactorizationRing.exists_liesOver_residueFieldMap_bijectiv
694694
MonicDegreeEq.map, Polynomial.map_map]
695695
rfl
696696

697+
set_option maxHeartbeats 400000 in -- Needed after v4.29.0-rc4
697698
open UniversalCoprimeFactorizationRing in
698699
/-- If a monic polynomial `p : R[X]` factors into a product of coprime monic polynomials `p = f * g`
699700
in the residue field `κ(P)` of some `P : Spec R`,

MathlibTest/DefEqAbuse.lean

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -151,101 +151,3 @@ def testVirtualParentFixed {G : Type} [AddCommGroup G] (s : MySub₂ G) (x : s)
151151
myOp x
152152

153153
end VirtualParentAbuse
154-
155-
section ZeroInstanceAbuse
156-
/-! ### Zero instance mismatch during `rw`
157-
158-
In Mathlib, `rw [sub_nonneg]` on `ℤ` failed because the lemma (for generic
159-
`[OrderedAddCommGroup α]`) has `0` elaborated as `@Zero.zero α ...` while the
160-
goal's `0` is `@OfNat.ofNat ℤ 0 ...` (which reduces to `Int.ofNat 0`). These are
161-
definitionally equal, but not at instance transparency. Detecting it with `#defeq_abuse`
162-
looked like:
163-
164-
```lean
165-
example (a b : ℤ) : 0 ≤ a - b ↔ b ≤ a := by
166-
#defeq_abuse in rw [sub_nonneg]
167-
-- reported: ❌️ Zero.zero =?= Int.ofNat 0
168-
```
169-
170-
Matthew Jasper's Mathlib-free minimization
171-
(https://leanprover.zulipchat.com/#narrow/channel/113488-general/topic/backward.2EisDefEq.2ErespectTransparency/near/576388498)
172-
reproduces this pattern below. -/
173-
174-
class Zo' (α : Type _) where
175-
zo : α
176-
177-
class Num' (α : Type _) (n : Nat) where
178-
fromNat : α
179-
180-
class Gr' (α : Type _) extends Zo' α where
181-
add : α → α → α
182-
inv : α → α
183-
184-
class Sm' (α : Type _) extends Zo' α where
185-
inv : α → α
186-
187-
instance {α} [h : Gr' α] : Sm' α := { h with }
188-
189-
instance : Zo' Int where
190-
zo := 0
191-
192-
instance {n} : Num' Int n where
193-
fromNat := Int.ofNat n
194-
195-
instance {α} [Zo' α] : Num' α 0 where
196-
fromNat := Zo'.zo
197-
198-
instance : Gr' Int where
199-
add a b := a + b
200-
inv a := -a
201-
202-
theorem zo_eq_iff {α} [Gr' α] (a : α) : Num'.fromNat 0 = a ↔ a = Gr'.add a a := test_sorry
203-
204-
/--
205-
warning: #defeq_abuse: tactic fails with `backward.isDefEq.respectTransparency true` but succeeds with `false`.
206-
The following isDefEq checks are the root causes of the failure:
207-
❌️ Int.ofNat 0 =?= Zo'.zo
208-
-/
209-
#guard_msgs in
210-
example (a : Int) : Num'.fromNat 0 = a ↔ a = Gr'.add a a := by
211-
#defeq_abuse in rw [zo_eq_iff]
212-
213-
-- Command-level test: same abuse should be detected for a theorem with `by rw`.
214-
/--
215-
warning: #defeq_abuse: command fails with `backward.isDefEq.respectTransparency true` but succeeds with `false`.
216-
The following isDefEq checks are the root causes of the failure:
217-
❌️ Int.ofNat 0 =?= Zo'.zo
218-
-/
219-
#guard_msgs in
220-
#defeq_abuse in
221-
theorem test_zo_cmd_abuse (a : Int) : Num'.fromNat 0 = a ↔ a = Gr'.add a a := by
222-
rw [zo_eq_iff]
223-
224-
-- Verify: abuse is detected even when the outer scope has `respectTransparency false`.
225-
-- This simulates the Mathlib lakefile setting.
226-
-- (Must appear BEFORE the unif_hint below, which fixes the underlying issue.)
227-
section
228-
set_option backward.isDefEq.respectTransparency false
229-
/--
230-
warning: #defeq_abuse: tactic fails with `backward.isDefEq.respectTransparency true` but succeeds with `false`.
231-
The following isDefEq checks are the root causes of the failure:
232-
❌️ Int.ofNat 0 =?= Zo'.zo
233-
-/
234-
#guard_msgs in
235-
example (a : Int) : Num'.fromNat 0 = a ↔ a = Gr'.add a a := by
236-
#defeq_abuse in rw [zo_eq_iff]
237-
end
238-
239-
-- A potential fix: a unif_hint telling Lean that two different `Num'` instances applied to
240-
-- the same type at `0` should unify. This bridges the gap between `Int.ofNat 0`
241-
-- (from the specific `Num' Int n` instance) and `Zo'.zo` (from the generic
242-
-- `Num' α 0` instance via `Zo'`).
243-
unif_hint (α : Type _) (inst₁ : Num' α 0) (inst₂ : Num' α 0) where
244-
@Num'.fromNat α 0 inst₁ ≟ @Num'.fromNat α 0 inst₂
245-
246-
/-- info: #defeq_abuse: tactic succeeds with `backward.isDefEq.respectTransparency true`. No abuse detected. -/
247-
#guard_msgs in
248-
example (a : Int) : Num'.fromNat 0 = a ↔ a = Gr'.add a a := by
249-
#defeq_abuse in rw [zo_eq_iff]
250-
251-
end ZeroInstanceAbuse

MathlibTest/slow_instances.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Hint: Additional diagnostic information may be available using the `set_option d
2828
#synth NoZeroSMulDivisors ℕ K
2929

3030
variable {d : Type*} in
31-
set_option maxHeartbeats 3000 in -- uses about 2400 as of 2026-02-20
31+
set_option maxHeartbeats 3500 in -- uses about 2400 as of 2026-02-20,
32+
-- and then about 3200 as of 2026-03-04
3233
/--
3334
error: failed to synthesize
3435
Lean.Grind.OrderedAdd (Submodule ℂ (WithLp 2 (d → ℂ)))

lake-manifest.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "leanprover-community",
8-
"rev": "2b93f2523263a6df8a8fbbe3dd28b7f028087480",
8+
"rev": "8629a535d10cd7edfbf1a2c5cdfbaeee135a62cd",
99
"name": "plausible",
1010
"manifestFile": "lake-manifest.json",
1111
"inputRev": "main",
@@ -25,7 +25,7 @@
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "leanprover-community",
28-
"rev": "ea1e51a85f6bd53b6a84239b00593eebd03d522b",
28+
"rev": "f7f57d837a219a8e298798faba94bc7082111a7d",
2929
"name": "importGraph",
3030
"manifestFile": "lake-manifest.json",
3131
"inputRev": "main",
@@ -35,17 +35,17 @@
3535
"type": "git",
3636
"subDir": null,
3737
"scope": "leanprover-community",
38-
"rev": "212dc300449e436298804f09b264f624667106f8",
38+
"rev": "5a4234b81b903726764307df9cb23ec3cc3e5758",
3939
"name": "proofwidgets",
4040
"manifestFile": "lake-manifest.json",
41-
"inputRev": "v0.0.90",
41+
"inputRev": "v0.0.91",
4242
"inherited": false,
4343
"configFile": "lakefile.lean"},
4444
{"url": "https://github.com/leanprover-community/aesop",
4545
"type": "git",
4646
"subDir": null,
4747
"scope": "leanprover-community",
48-
"rev": "6f8999a4e31701d2c905262d3788a8c0d21b3f1f",
48+
"rev": "6d5ec850924e710ea67881e3ca9d1e920c929dbe",
4949
"name": "aesop",
5050
"manifestFile": "lake-manifest.json",
5151
"inputRev": "master",
@@ -55,7 +55,7 @@
5555
"type": "git",
5656
"subDir": null,
5757
"scope": "leanprover-community",
58-
"rev": "5bb0ac23f6e6c4c3ba1b084f2d65cb1bd2a9cf7a",
58+
"rev": "bc486babc10837d7f43351f12b53879581924163",
5959
"name": "Qq",
6060
"manifestFile": "lake-manifest.json",
6161
"inputRev": "master",
@@ -65,7 +65,7 @@
6565
"type": "git",
6666
"subDir": null,
6767
"scope": "leanprover-community",
68-
"rev": "8b4f32c03c788181a4ee3f00130c130e6317ccc9",
68+
"rev": "ac3fb7297326c5429ce2844712fb54ba9dd20198",
6969
"name": "batteries",
7070
"manifestFile": "lake-manifest.json",
7171
"inputRev": "main",
@@ -75,10 +75,10 @@
7575
"type": "git",
7676
"subDir": null,
7777
"scope": "leanprover",
78-
"rev": "0c688ceba0d380f6e56f977009fc2bb2322af5a3",
78+
"rev": "06c8b4d690d9b7ef98d594672bbdaa618156215a",
7979
"name": "Cli",
8080
"manifestFile": "lake-manifest.json",
81-
"inputRev": "v4.29.0-rc3",
81+
"inputRev": "v4.29.0-rc4",
8282
"inherited": true,
8383
"configFile": "lakefile.toml"}],
8484
"name": "mathlib",

lakefile.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ open Lake DSL
99
require "leanprover-community" / "batteries" @ git "main"
1010
require "leanprover-community" / "Qq" @ git "master"
1111
require "leanprover-community" / "aesop" @ git "master"
12-
require "leanprover-community" / "proofwidgets" @ git "v0.0.90" -- ProofWidgets should always be pinned to a specific version
12+
require "leanprover-community" / "proofwidgets" @ git "v0.0.91" -- ProofWidgets should always be pinned to a specific version
1313
with NameMap.empty.insert `errorOnBuild
1414
"ProofWidgets not up-to-date. \
1515
Please run `lake exe cache get` to fetch the latest ProofWidgets. \

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.29.0-rc3
1+
leanprover/lean4:v4.29.0-rc4

0 commit comments

Comments
 (0)