Skip to content

Commit

Permalink
chore: Remove unnecessary "rw"s (#10704)
Browse files Browse the repository at this point in the history
Remove unnecessary "rw"s.
  • Loading branch information
darabos committed Feb 20, 2024
1 parent c76aa9d commit db5a937
Show file tree
Hide file tree
Showing 41 changed files with 46 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Algebra/Operations.lean
Expand Up @@ -596,7 +596,7 @@ def span.ringHom : SetSemiring A →+* Submodule R A where
map_add' := span_union
map_mul' s t := by
dsimp only -- porting note: new, needed due to new-style structures
rw [SetSemiring.down_mul, span_mul_span, ← image_mul_prod]
rw [SetSemiring.down_mul, span_mul_span]
#align submodule.span.ring_hom Submodule.span.ringHom

section
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/BigOperators/Basic.lean
Expand Up @@ -2174,7 +2174,7 @@ theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
induction' s using Finset.induction_on with a s ha ih
· exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => by simp at H⟩
· rw [prod_insert ha, mul_eq_zero, exists_mem_insert, ih, ← bex_def]
· rw [prod_insert ha, mul_eq_zero, exists_mem_insert, ih]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff

theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/DirectSum/Algebra.lean
Expand Up @@ -68,7 +68,7 @@ instance _root_.GradedMonoid.isScalarTower_right :
IsScalarTower R (GradedMonoid A) (GradedMonoid A) where
smul_assoc s x y := by
dsimp
rw [GAlgebra.smul_def, GAlgebra.smul_def, ← mul_assoc, GAlgebra.commutes, mul_assoc]
rw [GAlgebra.smul_def, GAlgebra.smul_def, ← mul_assoc]

instance : Algebra R (⨁ i, A i) where
toFun := (DirectSum.of A 0).comp GAlgebra.toFun
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/GCDMonoid/Basic.lean
Expand Up @@ -1145,7 +1145,7 @@ noncomputable def gcdMonoidOfLCM [DecidableEq α] (lcm : α → α → α)
dsimp only
split_ifs with h h_1
· rw [h, eq_zero_of_zero_dvd (dvd_lcm_left _ _), mul_zero, zero_mul]
· rw [h_1, eq_zero_of_zero_dvd (dvd_lcm_right _ _), mul_zero]
· rw [h_1, eq_zero_of_zero_dvd (dvd_lcm_right _ _)]
rw [mul_comm, ← Classical.choose_spec (exists_gcd a b)]
lcm_zero_left := fun a => eq_zero_of_zero_dvd (dvd_lcm_left _ _)
lcm_zero_right := fun a => eq_zero_of_zero_dvd (dvd_lcm_right _ _)
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Quandle.lean
Expand Up @@ -163,7 +163,7 @@ lemma act_act_self_eq (x y : S) : (x ◃ y) ◃ x = x ◃ y := by
rw [h, ← Shelf.self_distrib, act_one]
#align unital_shelf.act_act_self_eq UnitalShelf.act_act_self_eq

lemma act_idem (x : S) : (x ◃ x) = x := by rw [← act_one x, ← Shelf.self_distrib, act_one, act_one]
lemma act_idem (x : S) : (x ◃ x) = x := by rw [← act_one x, ← Shelf.self_distrib, act_one]
#align unital_shelf.act_idem UnitalShelf.act_idem

lemma act_self_act_eq (x y : S) : x ◃ (x ◃ y) = x ◃ y := by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Regular/Basic.lean
Expand Up @@ -280,11 +280,11 @@ theorem not_isRegular_zero [Nontrivial R] : ¬IsRegular (0 : R) := fun h => IsRe

@[simp] lemma IsLeftRegular.mul_left_eq_zero_iff (hb : IsLeftRegular b) : b * a = 0 ↔ a = 0 := by
nth_rw 1 [← mul_zero b]
exact ⟨fun h ↦ hb h, fun ha ↦ by rw [ha, mul_zero]⟩
exact ⟨fun h ↦ hb h, fun ha ↦ by rw [ha]⟩

@[simp] lemma IsRightRegular.mul_right_eq_zero_iff (hb : IsRightRegular b) : a * b = 0 ↔ a = 0 := by
nth_rw 1 [← zero_mul b]
exact ⟨fun h ↦ hb h, fun ha ↦ by rw [ha, zero_mul]⟩
exact ⟨fun h ↦ hb h, fun ha ↦ by rw [ha]⟩

end MulZeroClass

Expand Down
3 changes: 1 addition & 2 deletions Mathlib/AlgebraicGeometry/OpenImmersion.lean
Expand Up @@ -594,8 +594,7 @@ theorem range_pullback_to_base_of_left :
Set.range f.1.base ∩ Set.range g.1.base := by
rw [pullback.condition, Scheme.comp_val_base, coe_comp, Set.range_comp,
range_pullback_snd_of_left, Opens.carrier_eq_coe,
Opens.map_obj, Opens.coe_mk, Set.image_preimage_eq_inter_range,
Set.inter_comm]
Opens.map_obj, Opens.coe_mk, Set.image_preimage_eq_inter_range]
#align algebraic_geometry.IsOpenImmersion.range_pullback_to_base_of_left AlgebraicGeometry.IsOpenImmersion.range_pullback_to_base_of_left

theorem range_pullback_to_base_of_right :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/BoxIntegral/Partition/Split.lean
Expand Up @@ -66,7 +66,7 @@ theorem coe_splitLower : (splitLower I i x : Set (ι → ℝ)) = ↑I ∩ { y |
ext y
simp only [mem_univ_pi, mem_Ioc, mem_inter_iff, mem_coe, mem_setOf_eq, forall_and, ← Pi.le_def,
le_update_iff, le_min_iff, and_assoc, and_forall_ne (p := fun j => y j ≤ upper I j) i, mem_def]
rw [and_comm (a := y i ≤ x), Pi.le_def]
rw [and_comm (a := y i ≤ x)]
#align box_integral.box.coe_split_lower BoxIntegral.Box.coe_splitLower

theorem splitLower_le : I.splitLower i x ≤ I :=
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Analysis/Fourier/RiemannLebesgueLemma.lean
Expand Up @@ -268,8 +268,7 @@ theorem tendsto_integral_exp_smul_cocompact_of_inner_product (μ : Measure V) [
have : (fun w : V →L[ℝ] ℝ => ∫ v, e[-w v] • f v) = (fun w : V => ∫ v, e[-⟪v, w⟫] • f v) ∘ A := by
ext1 w
congr 1 with v : 1
rw [← inner_conj_symm, IsROrC.conj_to_real, InnerProductSpace.toDual_symm_apply,
Real.fourierChar_apply]
rw [← inner_conj_symm, IsROrC.conj_to_real, InnerProductSpace.toDual_symm_apply]
rw [this]
exact
(tendsto_integral_exp_inner_smul_cocompact f).comp
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean
Expand Up @@ -260,9 +260,7 @@ def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V
left_inv f := by
ext
rw [f.decomp]
-- Porting note: previously `simp` closed the goal, but now we need to rewrite:
simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
rw [ContinuousAffineMap.coe_const, Function.const_apply]
simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply, coe_const]
right_inv := by rintro ⟨v, f⟩; ext <;> simp
map_add' _ _ := rfl
map_smul' _ _ := rfl
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
Expand Up @@ -91,7 +91,7 @@ theorem log_ofReal_mul {r : ℝ} (hr : 0 < r) {x : ℂ} (hx : x ≠ 0) :
#align complex.log_of_real_mul Complex.log_ofReal_mul

theorem log_mul_ofReal (r : ℝ) (hr : 0 < r) (x : ℂ) (hx : x ≠ 0) :
log (x * r) = Real.log r + log x := by rw [mul_comm, log_ofReal_mul hr hx, add_comm]
log (x * r) = Real.log r + log x := by rw [mul_comm, log_ofReal_mul hr hx]
#align complex.log_mul_of_real Complex.log_mul_ofReal

lemma log_mul_eq_add_log_iff {x y : ℂ} (hx₀ : x ≠ 0) (hy₀ : y ≠ 0) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Localization/Composition.lean
Expand Up @@ -113,7 +113,7 @@ lemma of_comp (W₃ : MorphismProperty C₁)
have : (L₁ ⋙ W₂.Q).IsLocalization W₃ :=
comp L₁ W₂.Q W₁ W₂ W₃ (fun X Y f hf => Localization.inverts W₂.Q W₂ _
(by simpa only [hW₂₃] using W₃.map_mem_map _ _ hf)) hW₁₃
(by rw [hW₂₃, MorphismProperty.subset_iff_le])
(by rw [hW₂₃])
exact IsLocalization.of_equivalence_target W₂.Q W₂ L₂
(Localization.uniq (L₁ ⋙ W₂.Q) (L₁ ⋙ L₂) W₃)
(liftNatIso L₁ W₁ _ _ _ _
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Data/Int/Cast/Basic.lean
Expand Up @@ -141,15 +141,15 @@ theorem cast_bit1 (n : ℤ) : ((bit1 n : ℤ) : R) = bit1 (n : R) :=
end deprecated

theorem cast_two : ((2 : ℤ) : R) = 2 :=
show (((2 : ℕ) : ℤ) : R) = ((2 : ℕ) : R) by rw [cast_ofNat, Nat.cast_ofNat]
show (((2 : ℕ) : ℤ) : R) = ((2 : ℕ) : R) by rw [cast_ofNat]
#align int.cast_two Int.cast_two

theorem cast_three : ((3 : ℤ) : R) = 3 :=
show (((3 : ℕ) : ℤ) : R) = ((3 : ℕ) : R) by rw [cast_ofNat, Nat.cast_ofNat]
show (((3 : ℕ) : ℤ) : R) = ((3 : ℕ) : R) by rw [cast_ofNat]
#align int.cast_three Int.cast_three

theorem cast_four : ((4 : ℤ) : R) = 4 :=
show (((4 : ℕ) : ℤ) : R) = ((4 : ℕ) : R) by rw [cast_ofNat, Nat.cast_ofNat]
show (((4 : ℕ) : ℤ) : R) = ((4 : ℕ) : R) by rw [cast_ofNat]
#align int.cast_four Int.cast_four

end Int
2 changes: 1 addition & 1 deletion Mathlib/Data/List/Rotate.lean
Expand Up @@ -337,7 +337,7 @@ theorem rotate_eq_iff {l l' : List α} {n : ℕ} :
l.rotate n = l' ↔ l = l'.rotate (l'.length - n % l'.length) := by
rw [← @rotate_eq_rotate _ l _ n, rotate_rotate, ← rotate_mod l', add_mod]
rcases l'.length.zero_le.eq_or_lt with hl | hl
· rw [eq_nil_of_length_eq_zero hl.symm, rotate_nil, rotate_eq_nil_iff]
· rw [eq_nil_of_length_eq_zero hl.symm, rotate_nil]
· rcases (Nat.zero_le (n % l'.length)).eq_or_lt with hn | hn
· simp [← hn]
· rw [mod_eq_of_lt (tsub_lt_self hl hn), tsub_add_cancel_of_le (α := ℕ), mod_self, rotate_zero]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Num/Lemmas.lean
Expand Up @@ -1492,7 +1492,7 @@ theorem cast_sub [Ring α] (m n) : ((m - n : ZNum) : α) = m - n := by simp [sub
@[norm_cast] -- @[simp] -- Porting note: simp can prove this
theorem neg_of_int : ∀ n, ((-n : ℤ) : ZNum) = -n
| (n + 1 : ℕ) => rfl
| 0 => by rw [Int.cast_neg, Int.cast_zero]
| 0 => by rw [Int.cast_neg]
| -[n+1] => (zneg_zneg _).symm
#align znum.neg_of_int ZNum.neg_of_int

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/PNat/Factors.lean
Expand Up @@ -225,7 +225,7 @@ theorem prod_add (u v : PrimeMultiset) : (u + v).prod = u.prod * v.prod := by
theorem prod_smul (d : ℕ) (u : PrimeMultiset) : (d • u).prod = u.prod ^ d := by
induction d with
| zero => simp only [Nat.zero_eq, zero_nsmul, pow_zero, prod_zero]
| succ n ih => rw [succ_nsmul, prod_add, ih, pow_succ, mul_comm]
| succ n ih => rw [succ_nsmul, prod_add, ih, pow_succ]
#align prime_multiset.prod_smul PrimeMultiset.prod_smul

end PrimeMultiset
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Polynomial/Eval.lean
Expand Up @@ -637,7 +637,7 @@ theorem C_mul_comp : (C a * p).comp r = C a * p.comp r := by

@[simp]
theorem nat_cast_mul_comp {n : ℕ} : ((n : R[X]) * p).comp r = n * p.comp r := by
rw [← C_eq_nat_cast, C_mul_comp, C_eq_nat_cast]
rw [← C_eq_nat_cast, C_mul_comp]
#align polynomial.nat_cast_mul_comp Polynomial.nat_cast_mul_comp

theorem mul_X_add_nat_cast_comp {n : ℕ} :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Polynomial/Monic.lean
Expand Up @@ -189,7 +189,7 @@ theorem degree_mul_comm (hp : p.Monic) (q : R[X]) : (p * q).degree = (q * p).deg

nonrec theorem natDegree_mul' (hp : p.Monic) (hq : q ≠ 0) :
(p * q).natDegree = p.natDegree + q.natDegree := by
rw [natDegree_mul', add_comm]
rw [natDegree_mul']
simpa [hp.leadingCoeff, leadingCoeff_ne_zero]
#align polynomial.monic.nat_degree_mul' Polynomial.Monic.natDegree_mul'

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Card.lean
Expand Up @@ -79,7 +79,7 @@ theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinse

theorem encard_eq_coe_toFinset_card (s : Set α) [Fintype s] : encard s = s.toFinset.card := by
have h := toFinite s
rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset, toFinset_card]
rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset]

theorem encard_coe_eq_coe_finsetCard (s : Finset α) : encard (s : Set α) = s.card := by
rw [Finite.encard_eq_coe_toFinset_card (Finset.finite_toSet s)]; simp
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Init/Data/Nat/Bitwise.lean
Expand Up @@ -126,8 +126,8 @@ theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.add_comm 1, Nat.add_succ]
· rw [Nat.add_comm]
· rw [succ_mul, Nat.add_comm 1]
#align nat.bodd_add_div2 Nat.bodd_add_div2

theorem div2_val (n) : div2 n = n / 2 := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/AffineSpace/AffineSubspace.lean
Expand Up @@ -1508,7 +1508,7 @@ theorem mem_affineSpan_insert_iff {s : AffineSubspace k P} {p1 : P} (hp1 : p1
· rintro ⟨r, p3, hp3, rfl⟩
use r • (p2 -ᵥ p1), Submodule.mem_span_singleton.2 ⟨r, rfl⟩, p3 -ᵥ p1,
vsub_mem_direction hp3 hp1
rw [vadd_vsub_assoc, add_comm]
rw [vadd_vsub_assoc]
#align affine_subspace.mem_affine_span_insert_iff AffineSubspace.mem_affineSpan_insert_iff

end AffineSubspace
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/Basis.lean
Expand Up @@ -848,7 +848,7 @@ theorem basis_singleton_iff {R M : Type*} [Ring R] [Nontrivial R] [AddCommGroup
map_smul' := fun c y => ?_ }⟩
· simp [Finsupp.add_apply, add_smul]
· simp only [Finsupp.coe_smul, Pi.smul_apply, RingHom.id_apply]
rw [← smul_assoc, smul_eq_mul]
rw [← smul_assoc]
· refine' smul_left_injective _ nz _
simp only [Finsupp.single_eq_same]
exact (w (f default • x)).choose_spec
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/Dimension/Constructions.lean
Expand Up @@ -304,7 +304,7 @@ theorem rank_fun_eq_lift_mul : Module.rank R (η → M) =
#align rank_fun_eq_lift_mul rank_fun_eq_lift_mul

theorem rank_fun' : Module.rank R (η → R) = Fintype.card η := by
rw [rank_fun_eq_lift_mul, rank_self, Cardinal.lift_one, mul_one, Cardinal.natCast_inj]
rw [rank_fun_eq_lift_mul, rank_self, Cardinal.lift_one, mul_one]
#align rank_fun' rank_fun'

theorem rank_fin_fun (n : ℕ) : Module.rank R (Fin n → R) = n := by simp [rank_fun']
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Logic/Equiv/List.lean
Expand Up @@ -276,8 +276,7 @@ theorem list_ofNat_succ (v : ℕ) :
show decodeList (succ v) = _ by
cases' e : unpair v with v₁ v₂
simp [decodeList, e]
rw [show decodeList v₂ = decode (α := List α) v₂ from rfl, decode_eq_ofNat, Option.seq_some,
Option.some.injEq]
rw [show decodeList v₂ = decode (α := List α) v₂ from rfl, decode_eq_ofNat, Option.seq_some]
#align denumerable.list_of_nat_succ Denumerable.list_ofNat_succ

end List
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Logic/Function/Basic.lean
Expand Up @@ -681,8 +681,8 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort*} {a b : α} (h : a
· rw [dif_pos h₁, dif_pos h₂]
cases h (h₂.symm.trans h₁)
· rw [dif_pos h₁, dif_pos h₁, dif_neg h₂]
· rw [dif_neg h₁, dif_neg h₁, dif_pos h₂]
· rw [dif_neg h₁, dif_neg h₁, dif_neg h₂]
· rw [dif_neg h₁, dif_neg h₁]
· rw [dif_neg h₁, dif_neg h₁]
#align function.update_comm Function.update_comm

@[simp]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/MeasureTheory/Group/AddCircle.lean
Expand Up @@ -101,7 +101,7 @@ theorem volume_of_add_preimage_eq (s I : Set <| AddCircle T) (u x : AddCircle T)
have hsG : ∀ g : G, (g +ᵥ s : Set <| AddCircle T) =ᵐ[volume] s := by
rintro ⟨y, hy⟩; exact (vadd_ae_eq_self_of_mem_zmultiples hs hy : _)
rw [(isAddFundamentalDomain_of_ae_ball I u x hu hI).measure_eq_card_smul_of_vadd_ae_eq_self s hsG,
← Nat.card_zmultiples u, Nat.card_eq_fintype_card]
← Nat.card_zmultiples u]
#align add_circle.volume_of_add_preimage_eq AddCircle.volume_of_add_preimage_eq

end AddCircle
2 changes: 1 addition & 1 deletion Mathlib/MeasureTheory/Measure/OuterMeasure.lean
Expand Up @@ -404,7 +404,7 @@ theorem sSup_apply (ms : Set (OuterMeasure α)) (s : Set α) :

@[simp]
theorem iSup_apply {ι} (f : ι → OuterMeasure α) (s : Set α) : (⨆ i : ι, f i) s = ⨆ i, f i s := by
rw [iSup, sSup_apply, iSup_range, iSup]
rw [iSup, sSup_apply, iSup_range]
#align measure_theory.outer_measure.supr_apply MeasureTheory.OuterMeasure.iSup_apply

@[norm_cast]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/MeasureTheory/Measure/VectorMeasure.lean
Expand Up @@ -500,7 +500,7 @@ theorem toSignedMeasure_sub_apply {μ ν : Measure α} [IsFiniteMeasure μ] [IsF
{i : Set α} (hi : MeasurableSet i) :
(μ.toSignedMeasure - ν.toSignedMeasure) i = (μ i).toReal - (ν i).toReal := by
rw [VectorMeasure.sub_apply, toSignedMeasure_apply_measurable hi,
Measure.toSignedMeasure_apply_measurable hi, sub_eq_add_neg]
Measure.toSignedMeasure_apply_measurable hi]
#align measure_theory.measure.to_signed_measure_sub_apply MeasureTheory.Measure.toSignedMeasure_sub_apply

end Measure
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/BernoulliPolynomials.lean
Expand Up @@ -108,7 +108,7 @@ theorem derivative_bernoulli_add_one (k : ℕ) :
conv_rhs => rw [← Nat.cast_one, ← Nat.cast_add, ← C_eq_nat_cast, C_mul_monomial, mul_comm]
rw [mul_assoc, mul_assoc, ← Nat.cast_mul, ← Nat.cast_mul]
congr 3
rw [(choose_mul_succ_eq k m).symm, mul_comm]
rw [(choose_mul_succ_eq k m).symm]
#align polynomial.derivative_bernoulli_add_one Polynomial.derivative_bernoulli_add_one

theorem derivative_bernoulli (k : ℕ) :
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/DiophantineApproximation.lean
Expand Up @@ -503,7 +503,7 @@ private theorem aux₃ :
calc
|(fract ξ)⁻¹ - v / u'| = |(fract ξ - u' / v) * (v / u' / fract ξ)| :=
help₁ hξ₀.ne' Hv.ne' Hu.ne'
_ = |fract ξ - u' / v| * (v / u' / fract ξ) := by rw [abs_mul, abs_of_pos H₁, abs_sub_comm]
_ = |fract ξ - u' / v| * (v / u' / fract ξ) := by rw [abs_mul, abs_of_pos H₁]
_ < ((v : ℝ) * (2 * v - 1))⁻¹ * (v / u' / fract ξ) := ((mul_lt_mul_right H₁).mpr h')
_ = (u' * (2 * v - 1) * fract ξ)⁻¹ := (help₂ hξ₀.ne' Hv.ne' Hv'.ne' Hu.ne')
_ ≤ ((u' : ℝ) * (2 * u' - 1))⁻¹ := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/NumberField/Embeddings.lean
Expand Up @@ -111,7 +111,7 @@ theorem finite_of_norm_le (B : ℝ) : {x : K | IsIntegral ℤ x ∧ ∀ φ : K
exact minpoly.natDegree_le x
rw [mem_Icc, ← abs_le, ← @Int.cast_le ℝ]
refine (Eq.trans_le ?_ <| coeff_bdd_of_norm_le hx.2 i).trans (Nat.le_ceil _)
rw [h_map_ℚ_minpoly, coeff_map, eq_intCast, Int.norm_cast_rat, Int.norm_eq_abs, Int.cast_abs]
rw [h_map_ℚ_minpoly, coeff_map, eq_intCast, Int.norm_cast_rat, Int.norm_eq_abs]
#align number_field.embeddings.finite_of_norm_le NumberField.Embeddings.finite_of_norm_le

/-- An algebraic integer whose conjugates are all of norm one is a root of unity. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/RamificationInertia.lean
Expand Up @@ -370,7 +370,7 @@ theorem FinrankQuotientMap.span_eq_top [IsDomain R] [IsDomain S] [Algebra K L] [
haveI := Ideal.Quotient.nontrivial hp
calc
Ideal.Quotient.mk p A.det = Matrix.det ((Ideal.Quotient.mk p).mapMatrix A) := by
rw [RingHom.map_det, RingHom.mapMatrix_apply]
rw [RingHom.map_det]
_ = Matrix.det ((Ideal.Quotient.mk p).mapMatrix (Matrix.of A' - 1)) := rfl
_ = Matrix.det fun i j =>
(Ideal.Quotient.mk p) (A' i j) - (1 : Matrix (Fin n) (Fin n) (R ⧸ p)) i j := ?_
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Order/OmegaCompletePartialOrder.lean
Expand Up @@ -399,7 +399,7 @@ noncomputable instance omegaCompletePartialOrder :
le_ωSup c i := by
intro x hx
rw [← eq_some_iff] at hx ⊢
rw [ωSup_eq_some, ← hx]
rw [ωSup_eq_some]
rw [← hx]
exact ⟨i, rfl⟩
ωSup_le := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Order/SymmDiff.lean
Expand Up @@ -413,7 +413,7 @@ theorem sdiff_symmDiff : c \ a ∆ b = c ⊓ a ⊓ b ⊔ c \ a ⊓ c \ b := by
#align sdiff_symm_diff sdiff_symmDiff

theorem sdiff_symmDiff' : c \ a ∆ b = c ⊓ a ⊓ b ⊔ c \ (a ⊔ b) := by
rw [sdiff_symmDiff, sdiff_sup, sup_comm]
rw [sdiff_symmDiff, sdiff_sup]
#align sdiff_symm_diff' sdiff_symmDiff'

@[simp]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/DedekindDomain/Ideal.lean
Expand Up @@ -1532,7 +1532,7 @@ theorem multiplicity_normalizedFactorsEquivSpanNormalizedFactors_symm_eq_multipl
obtain ⟨x, hx⟩ := (normalizedFactorsEquivSpanNormalizedFactors hr).surjective I
obtain ⟨a, ha⟩ := x
rw [hx.symm, Equiv.symm_apply_apply, Subtype.coe_mk,
multiplicity_normalizedFactorsEquivSpanNormalizedFactors_eq_multiplicity hr ha, hx]
multiplicity_normalizedFactorsEquivSpanNormalizedFactors_eq_multiplicity hr ha]
#align multiplicity_normalized_factors_equiv_span_normalized_factors_symm_eq_multiplicity multiplicity_normalizedFactorsEquivSpanNormalizedFactors_symm_eq_multiplicity

end PID
3 changes: 1 addition & 2 deletions Mathlib/RingTheory/IsTensorProduct.lean
Expand Up @@ -313,8 +313,7 @@ theorem IsBaseChange.ofEquiv (e : M ≃ₗ[R] N) : IsBaseChange R e.toLinearMap
ext r q
show (by let _ := I₂; exact r • q) = (by let _ := I₃; exact r • q)
dsimp
rw [← one_smul R q, smul_smul, ← @smul_assoc _ _ _ (id _) (id _) (id _) I₄, smul_eq_mul,
mul_one]
rw [← one_smul R q, smul_smul, ← @smul_assoc _ _ _ (id _) (id _) (id _) I₄, smul_eq_mul]
cases this
refine'
⟨g.comp e.symm.toLinearMap, by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Norm.lean
Expand Up @@ -99,7 +99,7 @@ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) :
haveI := Classical.decEq ι
rw [norm_apply, ← det_toMatrix b, lmul_algebraMap]
convert @det_diagonal _ _ _ _ _ fun _ : ι => x
· ext (i j); rw [toMatrix_lsmul, Matrix.diagonal]
· ext (i j); rw [toMatrix_lsmul]
· rw [Finset.prod_const, Finset.card_univ]
#align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean
Expand Up @@ -143,7 +143,7 @@ theorem cyclotomic_mul_prime_dvd_eq_pow (R : Type*) {p n : ℕ} [hp : Fact (Nat.
rw [← map_cyclotomic _ (algebraMap (ZMod p) R), ← map_cyclotomic _ (algebraMap (ZMod p) R),
this, Polynomial.map_pow]
rw [← ZMod.expand_card, ← map_cyclotomic_int n, ← map_expand,
cyclotomic_expand_eq_cyclotomic hp.out hn, map_cyclotomic, mul_comm]
cyclotomic_expand_eq_cyclotomic hp.out hn, map_cyclotomic]
#align polynomial.cyclotomic_mul_prime_dvd_eq_pow Polynomial.cyclotomic_mul_prime_dvd_eq_pow

/-- If `R` is of characteristic `p` and `¬p ∣ m`, then
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Polynomial/Pochhammer.lean
Expand Up @@ -104,7 +104,7 @@ end
theorem ascPochhammer_eval_cast (n k : ℕ) :
(((ascPochhammer ℕ n).eval k : ℕ) : S) = ((ascPochhammer S n).eval k : S) := by
rw [← ascPochhammer_map (algebraMap ℕ S), eval_map, ← eq_natCast (algebraMap ℕ S),
eval₂_at_nat_cast,Nat.cast_id, eq_natCast]
eval₂_at_nat_cast,Nat.cast_id]
#align pochhammer_eval_cast ascPochhammer_eval_cast

theorem ascPochhammer_eval_zero {n : ℕ} : (ascPochhammer S n).eval 0 = if n = 0 then 1 else 0 := by
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/RingTheory/Trace.lean
Expand Up @@ -502,8 +502,7 @@ theorem traceMatrix_of_matrix_mulVec [Fintype κ] (b : κ → B) (P : Matrix κ
traceMatrix A (P.map (algebraMap A B) *ᵥ b) = P * traceMatrix A b * Pᵀ := by
refine' AddEquiv.injective (transposeAddEquiv κ κ A) _
rw [transposeAddEquiv_apply, transposeAddEquiv_apply, ← vecMul_transpose, ← transpose_map,
traceMatrix_of_matrix_vecMul, transpose_transpose, transpose_mul, transpose_transpose,
transpose_mul]
traceMatrix_of_matrix_vecMul, transpose_transpose]
#align algebra.trace_matrix_of_matrix_mul_vec Algebra.traceMatrix_of_matrix_mulVec

theorem traceMatrix_of_basis [Fintype κ] [DecidableEq κ] (b : Basis κ A B) :
Expand Down

0 comments on commit db5a937

Please sign in to comment.