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

Commit ed2cfce

Browse files
committed
feat(set_theory/ordinal/basic): tweak theorems on order type of empty relation (#14650)
We move the theorems on the order type of an empty relation much earlier, and golf them. We also remove other redundant theorems. `zero_eq_type_empty` is made redundant by `type_eq_zero_of_empty`, while `zero_eq_lift_type_empty` is made redundant by the former lemma and `lift_zero`.
1 parent 2cf4746 commit ed2cfce

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/order/rel_iso.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,10 @@ lemma mul_apply (e₁ e₂ : r ≃r r) (x : α) : (e₁ * e₂) x = e₁ (e₂ x
486486

487487
@[simp] lemma apply_inv_self (e : r ≃r r) (x) : e (e⁻¹ x) = x := e.apply_symm_apply x
488488

489+
/-- Two relations on empty types are isomorphic. -/
490+
def rel_iso_of_is_empty (r : α → α → Prop) (s : β → β → Prop) [is_empty α] [is_empty β] : r ≃r s :=
491+
⟨equiv.equiv_of_is_empty α β, is_empty_elim⟩
492+
489493
end rel_iso
490494

491495
/-- `subrel r p` is the inherited relation on a subset. -/

src/set_theory/ordinal/arithmetic.lean

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,8 @@ by simp only [le_antisymm_iff, add_le_add_iff_right]
153153
exact ⟨f punit.star⟩
154154
end, λ e, by simp only [e, card_zero]⟩
155155

156-
@[simp] theorem type_eq_zero_of_empty [is_well_order α r] [is_empty α] : type r = 0 :=
157-
card_eq_zero.symm.mpr (mk_eq_zero _)
158-
159-
@[simp] theorem type_eq_zero_iff_is_empty [is_well_order α r] : type r = 0 ↔ is_empty α :=
160-
(@card_eq_zero (type r)).symm.trans mk_eq_zero_iff
161-
162-
theorem type_ne_zero_iff_nonempty [is_well_order α r] : type r ≠ 0 ↔ nonempty α :=
163-
(not_congr (@card_eq_zero (type r))).symm.trans mk_ne_zero_iff
164-
165156
protected lemma one_ne_zero : (1 : ordinal) ≠ 0 :=
166-
type_ne_zero_iff_nonempty.2 ⟨punit.star⟩
157+
type_ne_zero_of_nonempty _
167158

168159
instance : nontrivial ordinal.{u} :=
169160
⟨⟨1, 0, ordinal.one_ne_zero⟩⟩

src/set_theory/ordinal/basic.lean

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,17 @@ instance : has_zero ordinal :=
746746

747747
instance : inhabited ordinal := ⟨0
748748

749-
theorem zero_eq_type_empty : 0 = @type empty empty_relation _ :=
750-
quotient.sound ⟨⟨equiv_of_is_empty _ _, λ _ _, iff.rfl⟩⟩
749+
@[simp] theorem type_eq_zero_of_empty (r) [is_well_order α r] [is_empty α] : type r = 0 :=
750+
(rel_iso.rel_iso_of_is_empty r _).ordinal_type_eq
751+
752+
@[simp] theorem type_eq_zero_iff_is_empty [is_well_order α r] : type r = 0 ↔ is_empty α :=
753+
⟨λ h, let ⟨s⟩ := type_eq.1 h in s.to_equiv.is_empty, @type_eq_zero_of_empty α r _⟩
754+
755+
theorem type_ne_zero_iff_nonempty [is_well_order α r] : type r ≠ 0 ↔ nonempty α :=
756+
by simp
757+
758+
theorem type_ne_zero_of_nonempty (r) [is_well_order α r] [h : nonempty α] : type r ≠ 0 :=
759+
type_ne_zero_iff_nonempty.2 h
751760

752761
@[simp] theorem card_zero : card 0 = 0 := rfl
753762

@@ -863,9 +872,6 @@ by simp only [lt_iff_le_not_le, lift_le]
863872
quotient.sound ⟨(rel_iso.preimage equiv.ulift _).trans
864873
⟨equiv_of_is_empty _ _, λ a b, iff.rfl⟩⟩
865874

866-
theorem zero_eq_lift_type_empty : 0 = lift.{u} (@type empty empty_relation _) :=
867-
by rw [← zero_eq_type_empty, lift_zero]
868-
869875
@[simp] theorem lift_one : lift 1 = 1 :=
870876
quotient.sound ⟨(rel_iso.preimage equiv.ulift _).trans
871877
⟨punit_equiv_punit, λ a b, iff.rfl⟩⟩

0 commit comments

Comments
 (0)