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): dot notation lemmas + golf #15348

Closed
wants to merge 4 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/set_theory/cardinal/cofinality.lean
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ begin
{ refine ⟨T, this,
le_antisymm _ (cardinal.ord_le.2 $ cof_type_le this)⟩,
rw [← e, e'],
refine type_le'.2 ⟨rel_embedding.of_monotone
(λ a, ⟨a, let ⟨aS, _⟩ := a.2 in aS⟩) (λ a b h, _)⟩,
refine (rel_embedding.of_monotone (λ a : T, (⟨a, let ⟨aS, _⟩ := a.2 in aS⟩ : S)) (λ a b h, _))
.ordinal_type_le,
rcases a with ⟨a, aS, ha⟩, rcases b with ⟨b, bS, hb⟩,
change s ⟨a, _⟩ ⟨b, _⟩,
refine ((trichotomous_of s _ _).resolve_left (λ hn, _)).resolve_left _,
Expand Down Expand Up @@ -507,7 +507,7 @@ begin
let r' := subrel r {i | ∀ j, r j i → f j < f i},
let hrr' : r' ↪r r := subrel.rel_embedding _ _,
haveI := hrr'.is_well_order,
refine ⟨_, _, (type_le'.2 ⟨hrr'⟩).trans _, λ i j _ h _, (enum r' j h).prop _ _,
refine ⟨_, _, hrr'.ordinal_type_le.trans _, λ i j _ h _, (enum r' j h).prop _ _,
le_antisymm (blsub_le (λ i hi, lsub_le_iff.1 hf.le _)) _⟩,
{ rw [←hι, hr] },
{ change r (hrr'.1 _ ) (hrr'.1 _ ),
Expand Down
15 changes: 5 additions & 10 deletions src/set_theory/ordinal/arithmetic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ induction_on a (λ α r _, induction_on b $ λ β s _ h H l, begin
rw [←typein_lt_typein (sum.lex r s), typein_enum],
have := H _ (h.2 _ (typein_lt_type s x)),
rw [add_succ, succ_le_iff] at this,
refine (type_le'.2 ⟨rel_embedding.of_monotone (λ a, _) (λ a b, _)⟩).trans_lt this,
refine (rel_embedding.of_monotone (λ a, _) (λ a b, _)).ordinal_type_le.trans_lt this,
{ rcases a with ⟨a | b, h⟩,
{ exact sum.inl a },
{ exact sum.inr ⟨b, by cases h; assumption⟩ } },
Expand Down Expand Up @@ -630,9 +630,8 @@ theorem mul_succ (a b : ordinal) : a * succ b = a * b + a := mul_add_one a b
instance mul_covariant_class_le : covariant_class ordinal.{u} ordinal.{u} (*) (≤) :=
⟨λ c a b, quotient.induction_on₃ a b c $ λ ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ ⟨f⟩, begin
resetI,
refine type_le'.2 ⟨rel_embedding.of_monotone
(λ a, (f a.1, a.2))
(λ a b h, _)⟩, clear_,
refine (rel_embedding.of_monotone (λ a : α × γ, (f a.1, a.2)) (λ a b h, _)).ordinal_type_le,
clear_,
cases h with a₁ b₁ a₂ b₂ h' a b₁ b₂ h',
{ exact prod.lex.left _ _ (f.to_rel_embedding.map_rel_iff.2 h') },
{ exact prod.lex.right _ h' }
Expand All @@ -641,9 +640,7 @@ end⟩
instance mul_swap_covariant_class_le : covariant_class ordinal.{u} ordinal.{u} (swap (*)) (≤) :=
⟨λ c a b, quotient.induction_on₃ a b c $ λ ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ ⟨f⟩, begin
resetI,
refine type_le'.2 ⟨rel_embedding.of_monotone
(λ a, (a.1, f a.2))
(λ a b h, _)⟩,
refine (rel_embedding.of_monotone (λ a : γ × α, (a.1, f a.2)) (λ a b h, _)).ordinal_type_le,
cases h with a₁ b₁ a₂ b₂ h' a b₁ b₂ h',
{ exact prod.lex.left _ _ h' },
{ exact prod.lex.right _ (f.to_rel_embedding.map_rel_iff.2 h') }
Expand All @@ -666,9 +663,7 @@ begin
have := H _ (h.2 _ (typein_lt_type s b)),
rw mul_succ at this,
have := ((add_lt_add_iff_left _).2 (typein_lt_type _ a)).trans_le this,
refine (type_le'.2 _).trans_lt this,
constructor,
refine rel_embedding.of_monotone (λ a, _) (λ a b, _),
refine (rel_embedding.of_monotone (λ a, _) (λ a b, _)).ordinal_type_le.trans_lt this,
{ rcases a with ⟨⟨b', a'⟩, h⟩,
by_cases e : b = b',
{ refine sum.inr ⟨a', _⟩,
Expand Down
24 changes: 16 additions & 8 deletions src/set_theory/ordinal/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -558,18 +558,27 @@ add_decl_doc ordinal.partial_order.le
a function embedding `r` as a principal segment of `s`. -/
add_decl_doc ordinal.partial_order.lt

theorem type_le {α β} {r : α → α → Prop} {s : β → β → Prop}
theorem type_le_iff {α β} {r : α → α → Prop} {s : β → β → Prop}
[is_well_order α r] [is_well_order β s] :
type r ≤ type s ↔ nonempty (r ≼i s) := iff.rfl

theorem type_le' {α β} {r : α → α → Prop} {s : β → β → Prop}
theorem type_le_iff' {α β} {r : α → α → Prop} {s : β → β → Prop}
[is_well_order α r] [is_well_order β s] : type r ≤ type s ↔ nonempty (r ↪r s) :=
⟨λ ⟨f⟩, ⟨f⟩, λ ⟨f⟩, ⟨f.collapse⟩⟩

theorem _root_.initial_seg.ordinal_type_le {α β} {r : α → α → Prop} {s : β → β → Prop}
[is_well_order α r] [is_well_order β s] (h : r ≼i s) : type r ≤ type s := ⟨h⟩

theorem _root_.rel_embedding.ordinal_type_le {α β} {r : α → α → Prop} {s : β → β → Prop}
[is_well_order α r] [is_well_order β s] (h : r ↪r s) : type r ≤ type s := ⟨h.collapse⟩

@[simp] theorem type_lt_iff {α β} {r : α → α → Prop} {s : β → β → Prop}
[is_well_order α r] [is_well_order β s] :
type r < type s ↔ nonempty (r ≺i s) := iff.rfl

theorem _root_.principal_seg.ordinal_type_lt {α β} {r : α → α → Prop} {s : β → β → Prop}
[is_well_order α r] [is_well_order β s] (h : r ≺i s) : type r < type s := ⟨h⟩

/-- Given two ordinals `α ≤ β`, then `initial_seg_out α β` is the initial segment embedding
of `α` to `β`, as map from a model type for `α` to a model type for `β`. -/
def initial_seg_out {α β : ordinal} (h : α ≤ β) :
Expand Down Expand Up @@ -998,14 +1007,13 @@ instance add_swap_covariant_class_le : covariant_class ordinal.{u} ordinal.{u} (
⟨λ c a b h, begin
revert h c, exact (
induction_on a $ λ α₁ r₁ hr₁, induction_on b $ λ α₂ r₂ hr₂ ⟨⟨⟨f, fo⟩, fi⟩⟩ c,
induction_on c $ λ β s hs, (@type_le' _ _ _ _
(@sum.lex.is_well_order _ _ _ _ hr₁ hs)
(@sum.lex.is_well_order _ _ _ _ hr₂ hs)).2
⟨⟨f.sum_map (embedding.refl _), λ a b, begin
induction_on c $ λ β s hs, by exactI
@rel_embedding.ordinal_type_le _ _ (sum.lex r₁ s) (sum.lex r₂ s) _ _
⟨f.sum_map (embedding.refl _), λ a b, begin
split; intro H,
{ cases a with a a; cases b with b b; cases H; constructor; [rwa ← fo, assumption] },
{ cases H; constructor; [rwa fo, assumption] }
end⟩)
end⟩)
end⟩

theorem le_add_right (a b : ordinal) : a ≤ a + b :=
Expand Down Expand Up @@ -1260,7 +1268,7 @@ let ⟨r, _, e⟩ := ord_eq α in begin
{ cases h with f,
have g := rel_embedding.preimage f s,
haveI := rel_embedding.is_well_order g,
exact le_trans (ord_le_type _) (type_le'.2 ⟨g⟩) }
exact le_trans (ord_le_type _) g.ordinal_type_le }
end

theorem lt_ord {c o} : o < ord c ↔ o.card < c :=
Expand Down