Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d56a9bc

Browse files
committed
feat(set_theory/ordinal_arithmetic): add_eq_zero_iff, mul_eq_zero_iff (#12561)
1 parent 1e560a6 commit d56a9bc

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/set_theory/ordinal_arithmetic.lean

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ begin
194194
exacts [le_of_lt zero_lt_one, le_refl _], }
195195
end
196196

197+
theorem add_eq_zero_iff {a b : ordinal} : a + b = 0 ↔ (a = 0 ∧ b = 0) :=
198+
induction_on a $ λ α r _, induction_on b $ λ β s _, begin
199+
simp_rw [type_add, type_eq_zero_iff_is_empty],
200+
exact is_empty_sum
201+
end
202+
203+
theorem left_eq_zero_of_add_eq_zero {a b : ordinal} (h : a + b = 0) : a = 0 :=
204+
(add_eq_zero_iff.1 h).1
205+
206+
theorem right_eq_zero_of_add_eq_zero {a b : ordinal} (h : a + b = 0) : b = 0 :=
207+
(add_eq_zero_iff.1 h).2
208+
197209
/-! ### The predecessor of an ordinal -/
198210

199211
/-- The ordinal predecessor of `o` is `o'` if `o = succ o'`,
@@ -567,11 +579,18 @@ quotient.sound ⟨(rel_iso.preimage equiv.ulift _).trans
567579
quotient.induction_on₂ a b $ λ ⟨α, r, _⟩ ⟨β, s, _⟩,
568580
mul_comm (mk β) (mk α)
569581

582+
theorem mul_eq_zero_iff {a b : ordinal} : a * b = 0 ↔ (a = 0 ∨ b = 0) :=
583+
induction_on a $ λ α _ _, induction_on b $ λ β _ _, begin
584+
simp_rw [type_mul, type_eq_zero_iff_is_empty],
585+
rw or_comm,
586+
exact is_empty_prod
587+
end
588+
570589
@[simp] theorem mul_zero (a : ordinal) : a * 0 = 0 :=
571-
induction_on a $ λ α _ _, by exactI type_eq_zero_of_empty
590+
mul_eq_zero_iff.2 $ or.inr rfl
572591

573592
@[simp] theorem zero_mul (a : ordinal) : 0 * a = 0 :=
574-
induction_on a $ λ α _ _, by exactI type_eq_zero_of_empty
593+
mul_eq_zero_iff.2 $ or.inl rfl
575594

576595
theorem mul_add (a b c : ordinal) : a * (b + c) = a * b + a * c :=
577596
quotient.induction_on₃ a b c $ λ ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩,

0 commit comments

Comments
 (0)