Skip to content

Commit

Permalink
chore(set_theory/*): use is_empty α instead of ¬nonempty α (#8276)
Browse files Browse the repository at this point in the history
Split from #7826
  • Loading branch information
eric-wieser committed Jul 16, 2021
1 parent 9a801ef commit 162221f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
9 changes: 6 additions & 3 deletions src/set_theory/cardinal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ sup_le.2 $ le_sum _
theorem sum_le_sup {ι : Type u} (f : ι → cardinal.{u}) : sum f ≤ mk ι * sup.{u u} f :=
by rw ← sum_const; exact sum_le_sum _ _ (le_sup _)

theorem sup_eq_zero {ι} {f : ι → cardinal} (h : ι → false) : sup f = 0 :=
by { rw [← nonpos_iff_eq_zero, sup_le], intro x, exfalso, exact h x }
theorem sup_eq_zero {ι} {f : ι → cardinal} [is_empty ι] : sup f = 0 :=
by { rw [← nonpos_iff_eq_zero, sup_le], exact is_empty_elim }

/-- The indexed product of cardinals is the cardinality of the Pi type
(dependent product). -/
Expand Down Expand Up @@ -1241,7 +1241,10 @@ begin
end

lemma powerlt_zero {a : cardinal} : a ^< 0 = 0 :=
by { apply sup_eq_zero, rintro ⟨x, hx⟩, rw [←not_le] at hx, apply hx, apply zero_le }
begin
convert sup_eq_zero,
exact subtype.is_empty_of_false (λ x, (zero_le _).not_lt),
end

end cardinal

Expand Down
6 changes: 3 additions & 3 deletions src/set_theory/cofinality.lean
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ le_antisymm (by simpa using cof_le_card 0) (cardinal.zero_le _)

@[simp] theorem cof_eq_zero {o} : cof o = 0 ↔ o = 0 :=
⟨induction_on o $ λ α r _ z, by exactI
let ⟨S, hl, e⟩ := cof_eq r in type_eq_zero_iff_empty.2 $
λ ⟨a⟩, let ⟨b, h, _⟩ := hl a in
ne_zero_iff_nonempty.2 (by exact ⟨⟨_, h⟩⟩) (e.trans z),
let ⟨S, hl, e⟩ := cof_eq r in type_eq_zero_iff_is_empty.2 $
⟨λ a, let ⟨b, h, _⟩ := hl a in
(eq_zero_iff_is_empty.1 (e.trans z)).elim' ⟨_, h⟩⟩,
λ e, by simp [e]⟩

@[simp] theorem cof_succ (o) : cof (succ o) = 1 :=
Expand Down
15 changes: 8 additions & 7 deletions src/set_theory/ordinal_arithmetic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,15 @@ by simp only [le_antisymm_iff, add_le_add_iff_right]
exact ⟨f punit.star⟩
end, λ e, by simp only [e, card_zero]⟩

@[simp] theorem type_eq_zero_of_empty [is_well_order α r] [is_empty α] : type r = 0 :=
card_eq_zero.symm.mpr eq_zero_of_is_empty

@[simp] theorem type_eq_zero_iff_is_empty [is_well_order α r] : type r = 0 ↔ is_empty α :=
(@card_eq_zero (type r)).symm.trans eq_zero_iff_is_empty

theorem type_ne_zero_iff_nonempty [is_well_order α r] : type r ≠ 0 ↔ nonempty α :=
(not_congr (@card_eq_zero (type r))).symm.trans ne_zero_iff_nonempty

@[simp] theorem type_eq_zero_iff_empty [is_well_order α r] : type r = 0 ↔ ¬ nonempty α :=
(not_iff_comm.1 type_ne_zero_iff_nonempty).symm

protected lemma one_ne_zero : (1 : ordinal) ≠ 0 :=
type_ne_zero_iff_nonempty.2 ⟨punit.star⟩

Expand Down Expand Up @@ -547,12 +550,10 @@ quotient.induction_on₂ a b $ λ ⟨α, r, _⟩ ⟨β, s, _⟩,
mul_comm (mk β) (mk α)

@[simp] theorem mul_zero (a : ordinal) : a * 0 = 0 :=
induction_on a $ λ α _ _, by exactI
type_eq_zero_iff_empty.2 (λ ⟨⟨e, _⟩⟩, e.elim)
induction_on a $ λ α _ _, by exactI type_eq_zero_of_empty

@[simp] theorem zero_mul (a : ordinal) : 0 * a = 0 :=
induction_on a $ λ α _ _, by exactI
type_eq_zero_iff_empty.2 (λ ⟨⟨_, e⟩⟩, e.elim)
induction_on a $ λ α _ _, by exactI type_eq_zero_of_empty

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

0 comments on commit 162221f

Please sign in to comment.