Skip to content

Commit 47ca285

Browse files
committed
feat: c • x = 0 ↔ c = 0 and similar lemmas (#9390)
and rename and generalise `smul_eq_zero_iff_eq'`/`smul_ne_zero_iff_ne'` From LeanAPAP
1 parent 66b9ecc commit 47ca285

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

Mathlib/Algebra/Module/Basic.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,13 @@ theorem smul_eq_zero : c • x = 0 ↔ c = 0 ∨ x = 0 :=
586586
theorem smul_ne_zero_iff : c • x ≠ 0 ↔ c ≠ 0 ∧ x ≠ 0 := by rw [Ne.def, smul_eq_zero, not_or]
587587
#align smul_ne_zero_iff smul_ne_zero_iff
588588

589+
lemma smul_eq_zero_iff_left (hx : x ≠ 0) : c • x = 0 ↔ c = 0 := by simp [hx]
590+
lemma smul_eq_zero_iff_right (hc : c ≠ 0) : c • x = 0 ↔ x = 0 := by simp [hc]
591+
#align smul_eq_zero_iff_eq' smul_eq_zero_iff_right
592+
lemma smul_ne_zero_iff_left (hx : x ≠ 0) : c • x ≠ 0 ↔ c ≠ 0 := by simp [hx]
593+
lemma smul_ne_zero_iff_right (hc : c ≠ 0) : c • x ≠ 0 ↔ x ≠ 0 := by simp [hc]
594+
#align smul_ne_zero_iff_ne' smul_ne_zero_iff_right
595+
589596
end SMulWithZero
590597

591598
section Module
@@ -720,7 +727,7 @@ variable [GroupWithZero R] [AddMonoid M] [DistribMulAction R M]
720727
-- see note [lower instance priority]
721728
/-- This instance applies to `DivisionSemiring`s, in particular `NNReal` and `NNRat`. -/
722729
instance (priority := 100) GroupWithZero.toNoZeroSMulDivisors : NoZeroSMulDivisors R M :=
723-
fun {_ _} h => or_iff_not_imp_left.2 fun hc => (smul_eq_zero_iff_eq' hc).1 h⟩
730+
fun {a _} h or_iff_not_imp_left.2 fun ha ↦ (smul_eq_zero_iff_eq $ Units.mk0 a ha).1 h⟩
724731
#align group_with_zero.to_no_zero_smul_divisors GroupWithZero.toNoZeroSMulDivisors
725732

726733
end GroupWithZero

Mathlib/GroupTheory/GroupAction/Group.lean

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -294,20 +294,6 @@ theorem smul_ne_zero_iff_ne (a : α) {x : β} : a • x ≠ 0 ↔ x ≠ 0 :=
294294

295295
end Group
296296

297-
section Gwz
298-
299-
variable [GroupWithZero α] [AddMonoid β] [DistribMulAction α β]
300-
301-
theorem smul_eq_zero_iff_eq' {a : α} (ha : a ≠ 0) {x : β} : a • x = 0 ↔ x = 0 :=
302-
show Units.mk0 a ha • x = 0 ↔ x = 0 from smul_eq_zero_iff_eq _
303-
#align smul_eq_zero_iff_eq' smul_eq_zero_iff_eq'
304-
305-
theorem smul_ne_zero_iff_ne' {a : α} (ha : a ≠ 0) {x : β} : a • x ≠ 0 ↔ x ≠ 0 :=
306-
show Units.mk0 a ha • x ≠ 0 ↔ x ≠ 0 from smul_ne_zero_iff_ne _
307-
#align smul_ne_zero_iff_ne' smul_ne_zero_iff_ne'
308-
309-
end Gwz
310-
311297
end DistribMulAction
312298

313299
section MulDistribMulAction

Mathlib/NumberTheory/NumberField/CanonicalEmbedding.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ theorem convexBodySumFun_eq_zero_iff (x : E K) :
576576
Finset.sum_eq_zero_iff_of_nonneg (fun _ _ => norm_nonneg _)] at h
577577
ext : 2
578578
· exact norm_eq_zero.mp (h.1 _ (Finset.mem_univ _))
579-
· exact norm_eq_zero.mp ((smul_eq_zero_iff_eq' two_ne_zero (α := ℝ)).mp
580-
(h.2 _ (Finset.mem_univ _)))
579+
· exact norm_eq_zero.1 $ eq_zero_of_ne_zero_of_mul_left_eq_zero two_ne_zero $ h.2 _ $
580+
Finset.mem_univ _
581581
· simp only [convexBodySumFun, h, Prod.fst_zero, Pi.zero_apply, norm_zero, Finset.sum_const_zero,
582582
Prod.snd_zero, mul_zero, add_zero]
583583

0 commit comments

Comments
 (0)