-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - chore: Remove unnecessary "rw"s #10704
Changes from 2 commits
f636b35
5350bd2
0ec56ba
646dfd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -162,7 +162,7 @@ theorem fract_zspan_add (m : E) {v : E} (h : v ∈ span ℤ (Set.range b)) : | |||||
simp_rw [repr_fract_apply, Int.fract_eq_fract] | ||||||
use (b.restrictScalars ℤ).repr ⟨v, h⟩ i | ||||||
rw [map_add, Finsupp.coe_add, Pi.add_apply, add_tsub_cancel_right, | ||||||
← eq_intCast (algebraMap ℤ K) _, Basis.restrictScalars_repr_apply, coe_mk] | ||||||
← eq_intCast (algebraMap ℤ K) _, Basis.restrictScalars_repr_apply] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is another projection reduction that I would like to keep:
Suggested change
|
||||||
#align zspan.fract_zspan_add Zspan.fract_zspan_add | ||||||
|
||||||
@[simp] | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -183,7 +183,7 @@ instance gradeBy.gradedAlgebra : GradedAlgebra (gradeBy R f) := | |||||
ext : 2 | ||||||
simp only [MonoidHom.coe_comp, MonoidHom.coe_coe, AlgHom.coe_comp, Function.comp_apply, | ||||||
of_apply, AlgHom.coe_id, id_eq] | ||||||
rw [decomposeAux_single, DirectSum.coeAlgHom_of, Subtype.coe_mk]) | ||||||
rw [decomposeAux_single, DirectSum.coeAlgHom_of]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem:
Suggested change
|
||||||
fun i x => by rw [decomposeAux_coe f x] | ||||||
#align add_monoid_algebra.grade_by.graded_algebra AddMonoidAlgebra.gradeBy.gradedAlgebra | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -386,7 +386,7 @@ theorem const_ext {f₁ f₂ g₁ g₂ : R} {U hu₁ hu₂} (h : f₁ * g₂ = f | |||||
const R f₁ g₁ U hu₁ = const R f₂ g₂ U hu₂ := | ||||||
Subtype.eq <| | ||||||
funext fun x => | ||||||
IsLocalization.mk'_eq_of_eq (by rw [mul_comm, Subtype.coe_mk, ← h, mul_comm, Subtype.coe_mk]) | ||||||
IsLocalization.mk'_eq_of_eq (by rw [mul_comm, Subtype.coe_mk, ← h, mul_comm]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem:
Suggested change
|
||||||
#align algebraic_geometry.structure_sheaf.const_ext AlgebraicGeometry.StructureSheaf.const_ext | ||||||
|
||||||
theorem const_congr {f₁ f₂ g₁ g₂ : R} {U hu} (hf : f₁ = f₂) (hg : g₁ = g₂) : | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -115,7 +115,7 @@ theorem applyComposition_ones (p : FormalMultilinearSeries 𝕜 E F) (n : ℕ) : | |||||
intro j hjn hj1 | ||||||
obtain rfl : j = 0 := by linarith | ||||||
refine' congr_arg v _ | ||||||
rw [Fin.ext_iff, Fin.coe_castLE, Composition.ones_embedding, Fin.val_mk] | ||||||
rw [Fin.ext_iff, Fin.coe_castLE, Composition.ones_embedding] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem:
Suggested change
|
||||||
#align formal_multilinear_series.apply_composition_ones FormalMultilinearSeries.applyComposition_ones | ||||||
|
||||||
theorem applyComposition_single (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ} (hn : 0 < n) | ||||||
|
@@ -407,7 +407,7 @@ theorem comp_id (p : FormalMultilinearSeries 𝕜 E F) : p.comp (id 𝕜 E) = p | |||||
intros | ||||||
rw [applyComposition_ones] | ||||||
refine' congr_arg v _ | ||||||
rw [Fin.ext_iff, Fin.coe_castLE, Fin.val_mk] | ||||||
rw [Fin.ext_iff, Fin.coe_castLE] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (This projection reduction is legitimately unneeded!) |
||||||
show | ||||||
∀ b : Composition n, | ||||||
b ∈ Finset.univ → b ≠ Composition.ones n → compAlongComposition p (id 𝕜 E) b = 0 | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -165,7 +165,7 @@ theorem with_gaugeSeminormFamily : WithSeminorms (gaugeSeminormFamily 𝕜 E) := | |||||
refine' (nhds_basis_abs_convex_open 𝕜 E).to_hasBasis (fun s hs => _) fun s hs => _ | ||||||
· refine' ⟨s, ⟨_, rfl.subset⟩⟩ | ||||||
convert (gaugeSeminormFamily _ _).basisSets_singleton_mem ⟨s, hs⟩ one_pos | ||||||
rw [gaugeSeminormFamily_ball, Subtype.coe_mk] | ||||||
rw [gaugeSeminormFamily_ball] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
refine' ⟨s, ⟨_, rfl.subset⟩⟩ | ||||||
rw [SeminormFamily.basisSets_iff] at hs | ||||||
rcases hs with ⟨t, r, hr, rfl⟩ | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,7 +262,7 @@ def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V | |
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] | ||
rw [ContinuousAffineMap.coe_const] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fact we can do one better and solve the porting note here. GitHub unfortunately doesn't allow me to make a suggestion, so please replace line 263 (porting note)-265 (rw) with this one: simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply, coe_const] (The line could even be a |
||
right_inv := by rintro ⟨v, f⟩; ext <;> simp | ||
map_add' _ _ := rfl | ||
map_smul' _ _ := rfl | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -53,7 +53,7 @@ theorem log_of_pos (hx : 0 < x) : log x = expOrderIso.symm ⟨x, hx⟩ := by | |||||
#align real.log_of_pos Real.log_of_pos | ||||||
|
||||||
theorem exp_log_eq_abs (hx : x ≠ 0) : exp (log x) = |x| := by | ||||||
rw [log_of_ne_zero hx, ← coe_expOrderIso_apply, OrderIso.apply_symm_apply, Subtype.coe_mk] | ||||||
rw [log_of_ne_zero hx, ← coe_expOrderIso_apply, OrderIso.apply_symm_apply] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
#align real.exp_log_eq_abs Real.exp_log_eq_abs | ||||||
|
||||||
theorem exp_log (hx : 0 < x) : exp (log x) = x := by | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -224,7 +224,7 @@ theorem sin_pi_mul_eq (z : ℂ) (n : ℕ) : | |||||
set A := ∏ j in Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2) | ||||||
set B := ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n) | ||||||
set C := ∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n) | ||||||
have aux' : 2 * n.succ = 2 * n + 2 := by rw [Nat.succ_eq_add_one, mul_add, mul_one] | ||||||
have aux' : 2 * n.succ = 2 * n + 2 := by rw [Nat.succ_eq_add_one, mul_add] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is solved by reduction of natural number multiplication. I think we should not expect
Suggested change
|
||||||
have : (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n.succ)) = (2 * (n : ℝ) + 1) / (2 * n + 2) * C := by | ||||||
rw [integral_cos_pow_eq] | ||||||
dsimp only | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -360,7 +360,7 @@ theorem exists_mono_homothetic_copy {M κ : Type*} [AddCommMonoid M] (S : Finset | |||||
apply Finset.sum_congr rfl | ||||||
intro i hi | ||||||
rw [hs, Finset.mem_filter] at hi | ||||||
rw [l.apply_none _ _ hi.right, Subtype.coe_mk] | ||||||
rw [l.apply_none _ _ hi.right] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
· apply Finset.sum_congr rfl | ||||||
intro i hi | ||||||
rw [hs, Finset.compl_filter, Finset.mem_filter] at hi | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -658,7 +658,7 @@ theorem card_Ico_eq_card_Icc_sub_one (a b : α) : (Ico a b).card = (Icc a b).car | |||||
by_cases h : a ≤ b | ||||||
· rw [Icc_eq_cons_Ico h, card_cons] | ||||||
exact (Nat.add_sub_cancel _ _).symm | ||||||
· rw [Ico_eq_empty fun h' => h h'.le, Icc_eq_empty h, card_empty, zero_tsub] | ||||||
· rw [Ico_eq_empty fun h' => h h'.le, Icc_eq_empty h, card_empty] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Natural number reduction:
Suggested change
|
||||||
#align finset.card_Ico_eq_card_Icc_sub_one Finset.card_Ico_eq_card_Icc_sub_one | ||||||
|
||||||
theorem card_Ioc_eq_card_Icc_sub_one (a b : α) : (Ioc a b).card = (Icc a b).card - 1 := | ||||||
|
@@ -670,7 +670,7 @@ theorem card_Ioo_eq_card_Ico_sub_one (a b : α) : (Ioo a b).card = (Ico a b).car | |||||
by_cases h : a < b | ||||||
· rw [Ico_eq_cons_Ioo h, card_cons] | ||||||
exact (Nat.add_sub_cancel _ _).symm | ||||||
· rw [Ioo_eq_empty h, Ico_eq_empty h, card_empty, zero_tsub] | ||||||
· rw [Ioo_eq_empty h, Ico_eq_empty h, card_empty] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
#align finset.card_Ioo_eq_card_Ico_sub_one Finset.card_Ioo_eq_card_Ico_sub_one | ||||||
|
||||||
theorem card_Ioo_eq_card_Ioc_sub_one (a b : α) : (Ioo a b).card = (Ioc a b).card - 1 := | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -199,7 +199,7 @@ theorem zero_of_testBit_eq_false {n : ℕ} (h : ∀ i, testBit n i = false) : n | |||||
induction' n using Nat.binaryRec with b n hn | ||||||
· rfl | ||||||
· have : b = false := by simpa using h 0 | ||||||
rw [this, bit_false, bit0_val, hn fun i => by rw [← h (i + 1), testBit_bit_succ], mul_zero] | ||||||
rw [this, bit_false, bit0_val, hn fun i => by rw [← h (i + 1), testBit_bit_succ]] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Natural number reduction:
Suggested change
|
||||||
#align nat.zero_of_test_bit_eq_ff Nat.zero_of_testBit_eq_false | ||||||
|
||||||
theorem testBit_eq_false_of_lt {n i} (h : n < 2 ^ i) : n.testBit i = false := by | ||||||
|
@@ -453,8 +453,7 @@ theorem xor_trichotomy {a b c : ℕ} (h : a ≠ b ^^^ c) : | |||||
rfl | ||||||
) h fun j hj => by | ||||||
-- Porting note: this was originally `simp [hi' _ hj]` | ||||||
rw [Nat.testBit_xor, hi' _ hj, Bool.xor, Bool.xor_false, eq_self_iff_true] | ||||||
trivial | ||||||
rw [Nat.testBit_xor, hi' _ hj, Bool.xor, Bool.xor_false] | ||||||
#align nat.lxor_trichotomy Nat.xor_trichotomy | ||||||
|
||||||
theorem lt_xor_cases {a b c : ℕ} (h : a < b ^^^ c) : a ^^^ c < b ∨ a ^^^ b < c := | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -45,7 +45,7 @@ def hyperoperation : ℕ → ℕ → ℕ → ℕ | |||||
-- Basic hyperoperation lemmas | ||||||
@[simp] | ||||||
theorem hyperoperation_zero (m : ℕ) : hyperoperation 0 m = Nat.succ := | ||||||
funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] | ||||||
funext fun k => by rw [hyperoperation] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unfolding the definition of
Suggested change
|
||||||
#align hyperoperation_zero hyperoperation_zero | ||||||
|
||||||
theorem hyperoperation_ge_three_eq_one (n m : ℕ) : hyperoperation (n + 3) m 0 = 1 := by | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -206,7 +206,7 @@ theorem log_antitone_left {n : ℕ} : AntitoneOn (fun b => log b n) (Set.Ioi 1) | |||||
@[simp] | ||||||
theorem log_div_base (b n : ℕ) : log b (n / b) = log b n - 1 := by | ||||||
rcases le_or_lt b 1 with hb | hb | ||||||
· rw [log_of_left_le_one hb, log_of_left_le_one hb, Nat.zero_sub] | ||||||
· rw [log_of_left_le_one hb, log_of_left_le_one hb] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Natural number reduction:
Suggested change
|
||||||
cases' lt_or_le n b with h h | ||||||
· rw [div_eq_of_lt h, log_of_lt h, log_zero_right] | ||||||
rw [log_of_one_lt_of_le hb h, add_tsub_cancel_right] | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -173,14 +173,14 @@ variable [NoZeroDivisors R] | |||||
|
||||||
theorem natDegree_mul_mirror : (p * p.mirror).natDegree = 2 * p.natDegree := by | ||||||
by_cases hp : p = 0 | ||||||
· rw [hp, zero_mul, natDegree_zero, mul_zero] | ||||||
· rw [hp, zero_mul, natDegree_zero] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Natural number reduction:
Suggested change
|
||||||
rw [natDegree_mul hp (mt mirror_eq_zero.mp hp), mirror_natDegree, two_mul] | ||||||
#align polynomial.nat_degree_mul_mirror Polynomial.natDegree_mul_mirror | ||||||
|
||||||
theorem natTrailingDegree_mul_mirror : | ||||||
(p * p.mirror).natTrailingDegree = 2 * p.natTrailingDegree := by | ||||||
by_cases hp : p = 0 | ||||||
· rw [hp, zero_mul, natTrailingDegree_zero, mul_zero] | ||||||
· rw [hp, zero_mul, natTrailingDegree_zero] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Natural number reduction:
Suggested change
|
||||||
rw [natTrailingDegree_mul hp (mt mirror_eq_zero.mp hp), mirror_natTrailingDegree, two_mul] | ||||||
#align polynomial.nat_trailing_degree_mul_mirror Polynomial.natTrailingDegree_mul_mirror | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -804,7 +804,7 @@ theorem surjOn_iff_exists_map_subtype : | |||||
⟨_, (mapsTo_image f s).restrict f s _, h, surjective_mapsTo_image_restrict _ _, fun _ => rfl⟩, | ||||||
fun ⟨t', g, htt', hg, hfg⟩ y hy => | ||||||
let ⟨x, hx⟩ := hg ⟨y, htt' hy⟩ | ||||||
⟨x, x.2, by rw [hfg, hx, Subtype.coe_mk]⟩⟩ | ||||||
⟨x, x.2, by rw [hfg, hx]⟩⟩ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Structure projection:
Suggested change
|
||||||
#align set.surj_on_iff_exists_map_subtype Set.surjOn_iff_exists_map_subtype | ||||||
|
||||||
theorem surjOn_empty (f : α → β) (s : Set α) : SurjOn f s ∅ := | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -902,7 +902,7 @@ theorem exists_finset_of_mem_supr'' {ι : Type*} {f : ι → IntermediateField F | |||||
intro x1 hx1 | ||||||
refine' SetLike.le_def.mp (le_iSup_of_le ⟨i, x1, hx1⟩ _) | ||||||
(subset_adjoin F (rootSet (minpoly F x1) E) _) | ||||||
· rw [IntermediateField.minpoly_eq, Subtype.coe_mk] | ||||||
· rw [IntermediateField.minpoly_eq] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Structure projection:
Suggested change
|
||||||
· rw [mem_rootSet_of_ne, minpoly.aeval] | ||||||
exact minpoly.ne_zero (isIntegral_iff.mp (h i ⟨x1, hx1⟩).isIntegral) | ||||||
#align intermediate_field.exists_finset_of_mem_supr'' IntermediateField.exists_finset_of_mem_supr'' | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -614,7 +614,7 @@ lemma finEquivPowers_apply (x : G) (hx) {n : Fin (orderOf x)} : | |||||
@[to_additive (attr := simp, nolint simpNF) finEquivMultiples_symm_apply] | ||||||
lemma finEquivPowers_symm_apply (x : G) (hx) (n : ℕ) {hn : ∃ m : ℕ, x ^ m = x ^ n} : | ||||||
(finEquivPowers x hx).symm ⟨x ^ n, hn⟩ = ⟨n % orderOf x, Nat.mod_lt _ hx.orderOf_pos⟩ := by | ||||||
rw [Equiv.symm_apply_eq, finEquivPowers_apply, Subtype.mk_eq_mk, ← pow_mod_orderOf, Fin.val_mk] | ||||||
rw [Equiv.symm_apply_eq, finEquivPowers_apply, Subtype.mk_eq_mk, ← pow_mod_orderOf] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Structure projection:
Suggested change
|
||||||
#align fin_equiv_powers_symm_apply finEquivPowers_symm_apply | ||||||
#align fin_equiv_multiples_symm_apply finEquivMultiples_symm_apply | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing this goal requires reducing the same projection as
Subtype.coe_mk
does, so let's keep it: