Skip to content

Commit 9c01b6b

Browse files
DavidLedvinkaDavid Ledvinka
andcommitted
chore(Algebra/Order/GroupWithZero): generalize some hypotheses from pos to nonneg (leanprover-community#34992)
Co-authored-by: David Ledvinka <dledvinka.ledvinka@mail.utoronto.ca>
1 parent e011861 commit 9c01b6b

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

Mathlib/Algebra/MvPolynomial/SchwartzZippel.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ lemma schwartz_zippel_totalDegree {n} {p : MvPolynomial (Fin n) R} (hp : p ≠ 0
199199
· simp
200200
simp only [← _root_.bot_eq_zero, sup_bot]
201201
simp_rw [totalDegree, Nat.cast_finsetSup]
202-
rw [sup_div₀ (ha := show 0 < (#S : ℚ≥0) by positivity)]
202+
rw [sup_div₀ (by positivity)]
203203
simp [← sum_div, Finsupp.sum_fintype]
204204

205205
end MvPolynomial

Mathlib/Algebra/Order/GroupWithZero/Finset.lean

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,28 @@ end MonoidWithZero
4646
section GroupWithZero
4747
variable [GroupWithZero G₀] [SemilatticeSup G₀] {s : Finset ι} {a : G₀}
4848

49-
lemma sup'_mul₀ [MulPosReflectLT G₀] (ha : 0 < a) (f : ι → G₀) (s : Finset ι) (hs) :
50-
s.sup' hs f * a = s.sup' hs fun i ↦ f i * a := map_finset_sup' (OrderIso.mulRight₀ _ ha) hs f
49+
lemma sup'_mul₀ [MulPosReflectLT G₀] (ha : 0 ≤ a) (f : ι → G₀) (s : Finset ι) (hs) :
50+
s.sup' hs f * a = s.sup' hs fun i ↦ f i * a := by
51+
by_cases! h : 0 = a
52+
· simp [← h]
53+
exact map_finset_sup' (OrderIso.mulRight₀ _ (lt_of_le_of_ne ha h)) hs f
5154

5255
set_option linter.docPrime false in
53-
lemma mul₀_sup' [PosMulReflectLT G₀] (ha : 0 < a) (f : ι → G₀) (s : Finset ι) (hs) :
54-
a * s.sup' hs f = s.sup' hs fun i ↦ a * f i := map_finset_sup' (OrderIso.mulLeft₀ _ ha) hs f
55-
56-
lemma sup'_div₀ [MulPosReflectLT G₀] (ha : 0 < a) (f : ι → G₀) (s : Finset ι) (hs) :
57-
s.sup' hs f / a = s.sup' hs fun i ↦ f i / a :=
58-
map_finset_sup' (OrderIso.divRight₀ _ ha) hs f
56+
lemma mul₀_sup' [PosMulReflectLT G₀] (ha : 0 ≤ a) (f : ι → G₀) (s : Finset ι) (hs) :
57+
a * s.sup' hs f = s.sup' hs fun i ↦ a * f i := by
58+
by_cases! h : 0 = a
59+
· simp [← h]
60+
exact map_finset_sup' (OrderIso.mulLeft₀ _ (lt_of_le_of_ne ha h)) hs f
61+
62+
lemma sup'_div₀ [MulPosReflectLT G₀] (ha : 0 ≤ a) (f : ι → G₀) (s : Finset ι) (hs) :
63+
s.sup' hs f / a = s.sup' hs fun i ↦ f i / a := by
64+
by_cases! h : 0 = a
65+
· simp [← h]
66+
exact map_finset_sup' (OrderIso.divRight₀ _ (lt_of_le_of_ne ha h)) hs f
5967

6068
end GroupWithZero
6169

62-
lemma sup_div₀ [LinearOrderedCommGroupWithZero G₀] {a : G₀} (ha : 0 < a)
70+
lemma sup_div₀ [LinearOrderedCommGroupWithZero G₀] {a : G₀} (ha : 0 a)
6371
(s : Finset ι) (f : ι → G₀) : s.sup f / a = s.sup fun i ↦ f i / a := by
6472
obtain rfl | hs := s.eq_empty_or_nonempty
6573
· simp [← show (0 : G₀) = ⊥ from bot_unique zero_le']

0 commit comments

Comments
 (0)