Skip to content

Commit 2d00c92

Browse files
committed
chore: fix some ENat-related instances of backward.isDefEq.respectTransparency (#41515)
1 parent 2a52b15 commit 2d00c92

7 files changed

Lines changed: 9 additions & 14 deletions

File tree

Mathlib/Algebra/Polynomial/Div.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ theorem rootMultiplicity_eq_natFind_of_ne_zero {p : R[X]} (p0 : p ≠ 0) {a : R}
525525
@[deprecated (since := "2026-02-12")]
526526
alias rootMultiplicity_eq_nat_find_of_nonzero := rootMultiplicity_eq_natFind_of_ne_zero
527527

528-
set_option backward.isDefEq.respectTransparency false in
529528
theorem rootMultiplicity_eq_multiplicity [DecidableEq R]
530529
(p : R[X]) (a : R) :
531530
rootMultiplicity a p =
@@ -535,7 +534,7 @@ theorem rootMultiplicity_eq_multiplicity [DecidableEq R]
535534
· rfl
536535
rename_i h
537536
simp only [finiteMultiplicity_X_sub_C a h, ↓reduceDIte]
538-
rw [← ENat.some_eq_coe, WithTop.untopD_coe]
537+
rw [untopD_coe_enat]
539538
congr
540539

541540
@[simp]

Mathlib/Data/ENat/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def lift (x : ℕ∞) (h : x < ⊤) : ℕ := WithTop.untop x (WithTop.lt_top_iff
118118
lift ofNat(n) (WithTop.coe_lt_top n) = OfNat.ofNat n := rfl
119119

120120
@[simp] theorem add_lt_top {a b : ℕ∞} : a + b < ⊤ ↔ a < ⊤ ∧ b < ⊤ := WithTop.add_lt_top
121+
@[simp] theorem add_eq_top {a b : ℕ∞} : a + b = ⊤ ↔ a = ⊤ ∨ b = ⊤ := WithTop.add_eq_top
121122

122123
@[simp] theorem lift_add (a b : ℕ∞) (h : a + b < ⊤) :
123124
lift (a + b) h = lift a (add_lt_top.1 h).1 + lift b (add_lt_top.1 h).2 := by

Mathlib/Dynamics/TopologicalEntropy/NetEntropy.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ lemma netMaxcard_univ (T : X → X) (h : F.Nonempty) (n : ℕ) : netMaxcard T F
188188
refine Finset.card_le_one.2 fun x x_s y y_s ↦ ?_
189189
exact PairwiseDisjoint.elim_set s_net x_s y_s x (mem_univ x) (mem_univ x)
190190

191-
set_option backward.isDefEq.respectTransparency false in
192191
lemma netMaxcard_infinite_iff (T : X → X) (F : Set X) (U : SetRel X X) (n : ℕ) :
193192
netMaxcard T F U n = ⊤ ↔ ∀ k : ℕ, ∃ s : Finset X, IsDynNetIn T F U n s ∧ k ≤ s.card := by
194193
apply Iff.intro <;> intro h
@@ -198,11 +197,11 @@ lemma netMaxcard_infinite_iff (T : X → X) (F : Set X) (U : SetRel X X) (n :
198197
simp only [Nat.cast_lt, Subtype.exists, exists_prop] at h
199198
obtain ⟨s, s_net, s_k⟩ := h
200199
exact ⟨s, s_net, s_k.le⟩
201-
· refine WithTop.eq_top_iff_forall_gt.2 fun k ↦ ?_
200+
· refine ENat.eq_top_iff_forall_gt.mpr fun k ↦ ?_
202201
specialize h (k + 1)
203202
obtain ⟨s, s_net, s_card⟩ := h
204203
apply s_net.card_le_netMaxcard.trans_lt'
205-
rw [ENat.some_eq_coe, Nat.cast_lt]
204+
rw [ENat.coe_lt_coe]
206205
exact (lt_add_one k).trans_le s_card
207206

208207
lemma netMaxcard_le_coverMincard (T : X → X) (F : Set X) (n : ℕ) :

Mathlib/RingTheory/DiscreteValuationRing/Basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,14 +558,13 @@ theorem length_quotient_pow_maximalIdeal (n : ℕ) :
558558

559559
end
560560

561-
set_option backward.isDefEq.respectTransparency false in
562561
instance (R : Type*) [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] :
563562
IsHausdorff (maximalIdeal R) R where
564563
haus' x hx := by
565564
obtain ⟨ϖ, hϖ⟩ := exists_irreducible R
566565
simp only [← Ideal.one_eq_top, smul_eq_mul, mul_one, SModEq.zero, hϖ.maximalIdeal_eq,
567566
Ideal.span_singleton_pow, Ideal.mem_span_singleton, ← addVal_le_iff_dvd, hϖ.addVal_pow] at hx
568-
rwa [← addVal_eq_top_iff, WithTop.eq_top_iff_forall_ge]
567+
rwa [← addVal_eq_top_iff, ENat.eq_top_iff_forall_ge]
569568

570569
noncomputable section toEuclideanDomain
571570
variable {R : Type*} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]

Mathlib/RingTheory/Multiplicity.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,15 +689,14 @@ theorem multiplicity_mul {p a b : α} (hp : Prime p) (hfin : FiniteMultiplicity
689689
rw [hfin.multiplicity_eq_iff]
690690
exact ⟨hdiv, hsucc⟩
691691

692-
set_option backward.isDefEq.respectTransparency false in
693692
theorem emultiplicity_mul {p a b : α} (hp : Prime p) :
694693
emultiplicity p (a * b) = emultiplicity p a + emultiplicity p b := by
695694
by_cases hfin : FiniteMultiplicity p (a * b)
696695
· rw [hfin.emultiplicity_eq_multiplicity, hfin.mul_left.emultiplicity_eq_multiplicity,
697696
hfin.mul_right.emultiplicity_eq_multiplicity]
698697
norm_cast
699698
exact multiplicity_mul hp hfin
700-
· rw [emultiplicity_eq_top.2 hfin, eq_comm, WithTop.add_eq_top, emultiplicity_eq_top,
699+
· rw [emultiplicity_eq_top.mpr hfin, eq_comm, ENat.add_eq_top, emultiplicity_eq_top,
701700
emultiplicity_eq_top]
702701
simpa only [FiniteMultiplicity.mul_iff hp, not_and_or] using hfin
703702

Mathlib/RingTheory/OrderOfVanishing/Basic.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ If `x` is not a non zero divisor, `ordMonoidWithZeroHom` is equal to `0`.
284284
theorem ordMonoidWithZeroHom_eq_zero [Nontrivial R] {x : R} (h : x ∉ nonZeroDivisors R) :
285285
ordMonoidWithZeroHom R x = 0 := dif_neg h
286286

287-
set_option backward.isDefEq.respectTransparency false in
288287
/--
289288
The quotient of a Noetherian ring of krull dimension less than or equal to `1` by a principal ideal
290289
is of finite length.
@@ -297,8 +296,7 @@ theorem _root_.isFiniteLength_quotient_span_singleton [IsNoetherianRing R]
297296
⟨isNoetherian_quotient (Ideal.span {x}),
298297
isArtinian_of_surjective_algebraMap (Ideal.Quotient.mk_surjective (I := .span {x}))⟩
299298
rw [isArtinianRing_iff_krullDimLE_zero, Ring.KrullDimLE, Order.krullDimLE_iff,
300-
← WithBot.add_le_add_iff_right' (c := 1) (by simp) (WithBot.coe_eq_coe.not.mpr (by simp)),
301-
Nat.cast_zero, zero_add]
299+
← ENat.WithBot.add_le_add_one_right_iff, Nat.cast_zero, zero_add]
302300
exact (ringKrullDim_quotient_succ_le_of_nonZeroDivisor hx).trans (Order.KrullDimLE.krullDim_le)
303301

304302
variable [IsNoetherianRing R] [Ring.KrullDimLE 1 R]

Mathlib/Topology/Instances/ENat.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ theorem tendsto_natCast_nhds_top : Tendsto Nat.cast atTop (𝓝 (⊤ : ℕ∞))
6969
filter_upwards [eventually_ge_atTop (n + 1)] with a ha using by simpa
7070

7171
instance : ContinuousAdd ℕ∞ := by
72-
refine ⟨continuous_iff_continuousAt.2 fun (a, b) ↦ ?_⟩
72+
refine ⟨continuous_iff_continuousAt.mpr fun (a, b) ↦ ?_⟩
7373
match a, b with
7474
| ⊤, _ => exact tendsto_nhds_top_mono' continuousAt_fst fun p ↦ le_add_right le_rfl
7575
| (a : ℕ), ⊤ => exact tendsto_nhds_top_mono' continuousAt_snd fun p ↦ le_add_left le_rfl
76-
| (a : ℕ), (b : ℕ) => simp [ContinuousAt, nhds_prod_eq, tendsto_pure_nhds]
76+
| (a : ℕ), (b : ℕ) => simp [ContinuousAt, nhds_prod_eq]
7777

7878
instance : ContinuousMul ℕ∞ where
7979
continuous_mul :=

0 commit comments

Comments
 (0)