Skip to content

Commit a97141c

Browse files
eupruninMaldooor
authored andcommitted
chore(Algebra/Module): golf proofs (leanprover-community#35192)
1 parent ef37b00 commit a97141c

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

Mathlib/Algebra/Module/FinitePresentation.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,7 @@ lemma Module.FinitePresentation.exists_lift_of_isLocalizedModule
402402
obtain ⟨x, rfl⟩ := hπ x
403403
rw [← LinearMap.comp_apply, ← LinearMap.comp_apply, mul_smul, LinearMap.smul_comp, ← hi,
404404
← LinearMap.comp_smul, LinearMap.comp_assoc, LinearMap.comp_assoc]
405-
congr 2
406-
convert Submodule.liftQ_mkQ _ _ this using 2
407-
ext x
408-
apply (LinearMap.quotKerEquivOfSurjective _ hπ).injective
409-
simp [LinearMap.quotKerEquivOfSurjective]
405+
simp
410406

411407
lemma Module.Finite.exists_smul_of_comp_eq_of_isLocalizedModule
412408
[hM : Module.Finite R M] (g₁ g₂ : M →ₗ[R] N) (h : f.comp g₁ = f.comp g₂) :

Mathlib/Algebra/Module/ZLattice/Summable.lean

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,11 @@ lemma sum_piFinset_Icc_rpow_le {ι : Type*} [Fintype ι] [DecidableEq ι]
110110
simp [hd, hr'.ne]
111111
replace hd : 1 ≤ d := by rwa [Nat.one_le_iff_ne_zero]
112112
have hs0 : s 0 = {0} := by ext; simp [s, funext_iff]
113-
have hs {a b : ℕ} (ha : a ≤ b) : s a ⊆ s b := by
114-
intros x hx
115-
simp only [Fintype.mem_piFinset, s] at hx ⊢
116-
exact fun i ↦ Icc_subset_Icc (by simpa) (by simpa) (hx i)
113+
have hs {a b : ℕ} (ha : a ≤ b) : s a ⊆ s b := by grind
117114
have (k : ℕ) : #(s (k + 1) \ s k) ≤ 2 * d * (2 * k + 3) ^ (d - 1) := by
118-
-- We do not yet replace `omega` with `lia` here, as it is measurably slower.
119-
trans (2 * k + 3) ^ d - (2 * k + 1) ^ d
120-
· simp only [le_add_iff_nonneg_right, zero_le, hs, card_sdiff_of_subset, s]
121-
simp only [Fintype.card_piFinset, Int.card_Icc, sub_neg_eq_add, prod_const, card_univ]
122-
gcongr <;> norm_cast <;> omega
123-
· have := abs_pow_sub_pow_le (α := ℤ) ↑(2 * k + 3) ↑(2 * k + 1) d
124-
norm_num at this
125-
zify
126-
convert this using 3
127-
· rw [abs_eq_self.mpr (sub_nonneg.mpr (by gcongr; lia)), Nat.cast_sub (by gcongr; lia)]
128-
simp
129-
· rw [max_eq_left (by gcongr; lia), abs_eq_self.mpr (by positivity)]
115+
simp only [le_add_iff_nonneg_right, zero_le, hs, card_sdiff_of_subset, s, Fintype.card_piFinset,
116+
Int.card_Icc, prod_const]
117+
grind [abs_pow_sub_pow_le (α := ℤ) (2 * k + 3) (2 * k + 1) d]
130118
let ε := normBound b
131119
have hε : 0 < ε := normBound_pos b
132120
calc ∑ p ∈ s n, ‖∑ i, p i • b i‖ ^ r

0 commit comments

Comments
 (0)