Skip to content

Commit a6e1045

Browse files
gebnerScott Morrisonkim-emmattrobball
committed
chore: reenable eta, bump to nightly 2023-05-16 (#3414)
Now that leanprover/lean4#2210 has been merged, this PR: * removes all the `set_option synthInstance.etaExperiment true` commands (and some `etaExperiment%` term elaborators) * removes many but not quite all `set_option maxHeartbeats` commands * makes various other changes required to cope with leanprover/lean4#2210. Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>
1 parent c853142 commit a6e1045

File tree

185 files changed

+169
-1127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+169
-1127
lines changed

Mathlib/Algebra/Algebra/Subalgebra/Basic.lean

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ protected theorem prod_mem {R : Type u} {A : Type v} [CommSemiring R] [CommSemir
181181
prod_mem h
182182
#align subalgebra.prod_mem Subalgebra.prod_mem
183183

184-
-- instance : Module R A := Algebra.toModule -- Porting note: doesn't help
185-
set_option synthInstance.etaExperiment true in
186184
instance {R A : Type _} [CommRing R] [Ring A] [Algebra R A] : SubringClass (Subalgebra R A) A :=
187185
{ Subalgebra.SubsemiringClass with
188186
neg_mem := fun {S x} hx => neg_one_smul R x ▸ S.smul_mem hx _ }
@@ -1417,9 +1415,6 @@ theorem centralizer_univ : centralizer R Set.univ = center R A :=
14171415

14181416
end Centralizer
14191417

1420-
-- Porting note: in the following proof, we manually add the instances `_i₁` and `_i₂`
1421-
-- Removing those lines and enabling `etaExperiment` on the next line gives a *broken* proof
1422-
-- set_option synthInstance.etaExperiment true in
14231418
/-- Suppose we are given `∑ i, lᵢ * sᵢ = 1` in `S`, and `S'` a subalgebra of `S` that contains
14241419
`lᵢ` and `sᵢ`. To check that an `x : S` falls in `S'`, we only need to show that
14251420
`sᵢ ^ n • x ∈ S'` for some `n` for each `sᵢ`. -/
@@ -1428,7 +1423,7 @@ theorem mem_of_finset_sum_eq_one_of_pow_smul_mem {S : Type _} [CommRing S] [Alge
14281423
(e : (∑ i in ι', l i * s i) = 1) (hs : ∀ i, s i ∈ S') (hl : ∀ i, l i ∈ S') (x : S)
14291424
(H : ∀ i, ∃ n : ℕ, (s i ^ n : S) • x ∈ S') : x ∈ S' := by
14301425
-- Porting note: needed to add this instance
1431-
let _i : Algebra { x // x ∈ S' } { x // x ∈ S' } := Algebra.id _
1426+
let _i : Algebra { x // x ∈ S' } { x // x ∈ S' } := Algebra.id _
14321427
suffices x ∈ Subalgebra.toSubmodule (Algebra.ofId S' S).range by
14331428
obtain ⟨x, rfl⟩ := this
14341429
exact x.2
@@ -1450,13 +1445,10 @@ theorem mem_of_finset_sum_eq_one_of_pow_smul_mem {S : Type _} [CommRing S] [Alge
14501445
rintro ⟨_, _, ⟨i, hi, rfl⟩, rfl⟩
14511446
change s' i ^ N • x ∈ _
14521447
rw [← tsub_add_cancel_of_le (show n i ≤ N from Finset.le_sup hi), pow_add, mul_smul]
1453-
-- Porting note: needed to add this instance
1454-
let _i₂ : SubmonoidClass (Subalgebra R S) S := Subalgebra.SubsemiringClass.toSubmonoidClass
14551448
refine' Submodule.smul_mem _ (⟨_, pow_mem (hs i) _⟩ : S') _
14561449
exact ⟨⟨_, hn i⟩, rfl⟩
14571450
#align subalgebra.mem_of_finset_sum_eq_one_of_pow_smul_mem Subalgebra.mem_of_finset_sum_eq_one_of_pow_smul_mem
14581451

1459-
set_option synthInstance.etaExperiment true in
14601452
theorem mem_of_span_eq_top_of_smul_pow_mem {S : Type _} [CommRing S] [Algebra R S]
14611453
(S' : Subalgebra R S) (s : Set S) (l : s →₀ S) (hs : Finsupp.total s S S (↑) l = 1)
14621454
(hs' : s ⊆ S') (hl : ∀ i, l i ∈ S') (x : S) (H : ∀ r : s, ∃ n : ℕ, (r : S) ^ n • x ∈ S') :

Mathlib/Algebra/BigOperators/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
12471247
(∏ x in range (n + m), f x) = (∏ x in range n, f x) * ∏ x in range m, f (n + x) := by
12481248
induction' m with m hm
12491249
· simp
1250-
· erw [Nat.add_succ, prod_range_succ, prod_range_succ, hm, mul_assoc]; rfl
1250+
· erw [Nat.add_succ, prod_range_succ, prod_range_succ, hm, mul_assoc]
12511251
#align finset.prod_range_add Finset.prod_range_add
12521252
#align finset.sum_range_add Finset.sum_range_add
12531253

Mathlib/Algebra/Category/ModuleCat/Tannaka.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ universe u
2323

2424
open CategoryTheory
2525

26-
set_option synthInstance.etaExperiment true in
2726
/-- An ingredient of Tannaka duality for rings:
2827
A ring `R` is equivalent to
2928
the endomorphisms of the additive forgetful functor `Module R ⥤ AddCommGroup`.

Mathlib/Algebra/CharP/Quotient.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ theorem quotient' {R : Type _} [CommRing R] (p : ℕ) [CharP R p] (I : Ideal R)
4747

4848
end CharP
4949

50-
set_option synthInstance.etaExperiment true in
5150
theorem Ideal.Quotient.index_eq_zero {R : Type _} [CommRing R] (I : Ideal R) :
5251
(↑I.toAddSubgroup.index : R ⧸ I) = 0 := by
5352
rw [AddSubgroup.index, Nat.card_eq]

Mathlib/Algebra/CharP/Two.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ section Ring
6363

6464
variable [Ring R] [CharP R 2]
6565

66-
set_option synthInstance.etaExperiment true in
6766
@[simp]
6867
theorem neg_eq (x : R) : -x = x := by
6968
rw [neg_eq_iff_add_eq_zero, ← two_smul R x, two_eq_zero, zero_smul]

Mathlib/Algebra/CubicDiscriminant.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,6 @@ theorem eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z})
531531
rw [prod_cons, prod_cons, prod_singleton, mul_assoc, mul_assoc]
532532
#align cubic.eq_prod_three_roots Cubic.eq_prod_three_roots
533533

534-
-- Porting note: Increased heartbeat limit for `C_mul_prod_X_sub_C_eq`
535-
set_option maxHeartbeats 500000 in
536534
theorem eq_sum_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
537535
map φ P =
538536
⟨φ P.a, φ P.a * -(x + y + z), φ P.a * (x * y + x * z + y * z), φ P.a * -(x * y * z)⟩ := by

Mathlib/Algebra/DirectSum/Basic.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@ def IsInternal {M S : Type _} [DecidableEq ι] [AddCommMonoid M] [SetLike S M]
389389
Function.Bijective (DirectSum.coeAddMonoidHom A)
390390
#align direct_sum.is_internal DirectSum.IsInternal
391391

392-
-- Porting note: This times out; lean4#2003 may fix this?
393-
set_option maxHeartbeats 0
394392
theorem IsInternal.addSubmonoid_iSup_eq_top {M : Type _} [DecidableEq ι] [AddCommMonoid M]
395393
(A : ι → AddSubmonoid M) (h : IsInternal A) : iSup A = ⊤ := by
396394
rw [AddSubmonoid.iSup_eq_mrange_dfinsupp_sumAddHom, AddMonoidHom.mrange_top_iff_surjective]

Mathlib/Algebra/Group/Ext.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ theorem DivInvMonoid.ext {M : Type _} ⦃m₁ m₂ : DivInvMonoid M⦄ (h_mul :
136136
have : m₁.div = m₂.div := by
137137
ext (a b)
138138
exact @map_div' _ _
139-
(@MonoidHom _ _ (_) _) (_) _
139+
(@MonoidHom _ _ (_) _) (id _) _
140140
(@MonoidHom.monoidHomClass _ _ (_) _) f (congr_fun h_inv) a b
141141
rcases m₁ with @⟨_, ⟨_⟩, ⟨_⟩⟩
142142
rcases m₂ with @⟨_, ⟨_⟩, ⟨_⟩⟩

Mathlib/Algebra/Hom/Centroid.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ theorem toEnd_int_cast (z : ℤ) : (z : CentroidHom α).toEnd = ↑z :=
498498
rfl
499499
#align centroid_hom.to_End_int_cast CentroidHom.toEnd_int_cast
500500

501-
set_option maxHeartbeats 1000000 in
502501
instance : Ring (CentroidHom α) :=
503502
toEnd_injective.ring _ toEnd_zero toEnd_one toEnd_add toEnd_mul toEnd_neg toEnd_sub
504503
toEnd_nsmul toEnd_zsmul toEnd_pow toEnd_nat_cast toEnd_int_cast

Mathlib/Algebra/Hom/Equiv/Basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ instance [Mul M] [Mul N] : MulEquivClass (M ≃* N) M N where
192192
apply Equiv.coe_fn_injective h₁
193193
map_mul := map_mul'
194194

195+
@[to_additive] -- shortcut instance that doesn't generate any subgoals
196+
instance [Mul M] [Mul N] : CoeFun (M ≃* N) fun _ => M → N where
197+
coe f := f
198+
195199
variable [Mul M] [Mul N] [Mul P] [Mul Q]
196200

197201
@[to_additive (attr := simp)]

0 commit comments

Comments
 (0)