Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(set_theory/ordinal/basic): tweak theorems on order type of empty relation #14650

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/order/rel_iso.lean
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ lemma mul_apply (e₁ e₂ : r ≃r r) (x : α) : (e₁ * e₂) x = e₁ (e₂ x

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

/-- Two relations on empty types are isomorphic. -/
def rel_iso_of_is_empty (r : α → α → Prop) (s : β → β → Prop) [is_empty α] [is_empty β] : r ≃r s :=
⟨equiv.equiv_of_is_empty α β, is_empty_elim⟩

end rel_iso

/-- `subrel r p` is the inherited relation on a subset. -/
Expand Down
11 changes: 1 addition & 10 deletions src/set_theory/ordinal/arithmetic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,8 @@ 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 (mk_eq_zero _)

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

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

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

instance : nontrivial ordinal.{u} :=
⟨⟨1, 0, ordinal.one_ne_zero⟩⟩
Expand Down
16 changes: 11 additions & 5 deletions src/set_theory/ordinal/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,17 @@ instance : has_zero ordinal :=

instance : inhabited ordinal := ⟨0⟩

theorem zero_eq_type_empty : 0 = @type empty empty_relation _ :=
vihdzp marked this conversation as resolved.
Show resolved Hide resolved
quotient.sound ⟨⟨equiv_of_is_empty _ _, λ _ _, iff.rfl⟩⟩
@[simp] theorem type_eq_zero_of_empty (r) [is_well_order α r] [is_empty α] : type r = 0 :=
(rel_iso.rel_iso_of_is_empty r _).ordinal_type_eq

@[simp] theorem type_eq_zero_iff_is_empty [is_well_order α r] : type r = 0 ↔ is_empty α :=
⟨λ h, let ⟨s⟩ := type_eq.1 h in s.to_equiv.is_empty, @type_eq_zero_of_empty α r _⟩

theorem type_ne_zero_iff_nonempty [is_well_order α r] : type r ≠ 0 ↔ nonempty α :=
by simp

theorem type_ne_zero_of_nonempty (r) [is_well_order α r] [h : nonempty α] : type r ≠ 0 :=
type_ne_zero_iff_nonempty.2 h

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

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

theorem zero_eq_lift_type_empty : 0 = lift.{u} (@type empty empty_relation _) :=
by rw [← zero_eq_type_empty, lift_zero]

vihdzp marked this conversation as resolved.
Show resolved Hide resolved
@[simp] theorem lift_one : lift 1 = 1 :=
quotient.sound ⟨(rel_iso.preimage equiv.ulift _).trans
⟨punit_equiv_punit, λ a b, iff.rfl⟩⟩
Expand Down