Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus.
On Mac, use
Cmd instead of
Ctrl .
/-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Floris van Doorn
! This file was ported from Lean 3 source module order.initial_seg
! leanprover-community/mathlib commit 730c6d4cab72b9d84fcfb9e95e8796e9cd8f40ba
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Order.RelIso.Set
import Mathlib.Order.WellFounded
/-!
# Initial and principal segments
This file defines initial and principal segments.
## Main definitions
* `InitialSeg r s`: type of order embeddings of `r` into `s` for which the range is an initial
segment (i.e., if `b` belongs to the range, then any `b' < b` also belongs to the range).
It is denoted by `r ≼i s`.
* `PrincipalSeg r s`: Type of order embeddings of `r` into `s` for which the range is a principal
segment, i.e., an interval of the form `(-∞, top)` for some element `top`. It is denoted by
`r ≺i s`.
## Notations
These notations belong to the `InitialSeg` locale.
* `r ≼i s`: the type of initial segment embeddings of `r` into `s`.
* `r ≺i s`: the type of principal segment embeddings of `r` into `s`.
-/
/-!
### Initial segments
Order embeddings whose range is an initial segment of `s` (i.e., if `b` belongs to the range, then
any `b' < b` also belongs to the range). The type of these embeddings from `r` to `s` is called
`InitialSeg r s`, and denoted by `r ≼i s`.
-/
variable { α : Type _ : Type (?u.25605+1) Type _} { β : Type _ } { γ : Type _ : Type (?u.66413+1) Type _} { r : α → α → Prop } { s : β → β → Prop }
{ t : γ → γ → Prop }
open Function
/-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order
embedding whose range is an initial segment. That is, whenever `b < f a` in `β` then `b` is in the
range of `f`. -/
structure InitialSeg { α β : Type _ } ( r : α → α → Prop ) ( s : β → β → Prop ) extends r ↪r s where
/-- The order embedding is an initial segment -/
init' : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (self : InitialSeg r s ) (a : α ) (b : β ),
s b (↑self .toRelEmbedding a ) → ∃ a' , ↑self .toRelEmbedding a' = b init' : ∀ a b , s b ( toRelEmbedding a ) → ∃ a' , toRelEmbedding a' = b
#align initial_seg InitialSeg
-- Porting notes: Deleted `scoped[InitialSeg]`
/-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≼i s` is an order
embedding whose range is an initial segment. That is, whenever `b < f a` in `β` then `b` is in the
range of `f`. -/
infixl :25 " ≼i " => InitialSeg
namespace InitialSeg
instance : Coe ( r ≼i s ) ( r ↪r s ) :=
⟨ InitialSeg.toRelEmbedding : {α : Type ?u.9161} → {β : Type ?u.9160} → {r : α → α → Prop } → {s : β → β → Prop } → r ≼i s → r ↪r s InitialSeg.toRelEmbedding⟩
instance : EmbeddingLike ( r ≼i s ) α β :=
{ coe := fun f => f . toFun : {α : Sort ?u.9560} → {β : Sort ?u.9559} → (α ↪ β ) → α → β toFun
coe_injective' := by
rintro ⟨ f , hf : ∀ (a : α ) (b : β ), s b (↑f a ) → ∃ a' , ↑f a' = b hf ⟩ ⟨ g , hg : ∀ (a : α ) (b : β ), s b (↑g a ) → ∃ a' , ↑g a' = b hg ⟩ h : (fun f => f .toFun ) { toRelEmbedding := f , init' := hf } = (fun f => f .toFun ) { toRelEmbedding := g , init' := hg } h α : Type ?u.9451β : Type ?u.9454γ : Type ?u.9457r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ↪r s hf : ∀ (a : α ) (b : β ), s b (↑f a ) → ∃ a' , ↑f a' = b g : r ↪r s hg : ∀ (a : α ) (b : β ), s b (↑g a ) → ∃ a' , ↑g a' = b h : (fun f => f .toFun ) { toRelEmbedding := f , init' := hf } = (fun f => f .toFun ) { toRelEmbedding := g , init' := hg } mk.mk { toRelEmbedding := f , init' := hf } = { toRelEmbedding := g , init' := hg }
congr with x α : Type ?u.9451β : Type ?u.9454γ : Type ?u.9457r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ↪r s hf : ∀ (a : α ) (b : β ), s b (↑f a ) → ∃ a' , ↑f a' = b g : r ↪r s hg : ∀ (a : α ) (b : β ), s b (↑g a ) → ∃ a' , ↑g a' = b h : (fun f => f .toFun ) { toRelEmbedding := f , init' := hf } = (fun f => f .toFun ) { toRelEmbedding := g , init' := hg } x : α mk.mk.e_toRelEmbedding.h
exact congr_fun : ∀ {α : Sort ?u.9928} {β : α → Sort ?u.9927 } {f g : (x : α ) → β x }, f = g → ∀ (a : α ), f a = g a congr_fun h : (fun f => f .toFun ) { toRelEmbedding := f , init' := hf } = (fun f => f .toFun ) { toRelEmbedding := g , init' := hg } h x ,
injective' := fun f => f . inj' }
@[ ext ] lemma ext : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } {f g : r ≼i s }, (∀ (x : α ), ↑f x = ↑g x ) → f = g ext { f g : r ≼i s } ( h : ∀ (x : α ), ↑f x = ↑g x h : ∀ x , f x = g x ) : f = g :=
FunLike.ext : ∀ {F : Sort ?u.10642} {α : Sort ?u.10643} {β : α → Sort ?u.10641 } [i : FunLike F α β ] (f g : F ),
(∀ (x : α ), ↑f x = ↑g x ) → f = g FunLike.ext f g h : ∀ (x : α ), ↑f x = ↑g x h
#align initial_seg.ext InitialSeg.ext : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } {f g : r ≼i s }, (∀ (x : α ), ↑f x = ↑g x ) → f = g InitialSeg.ext
@[ simp ]
theorem coe_coe_fn : ∀ (f : r ≼i s ), ↑f .toRelEmbedding = ↑f coe_coe_fn ( f : r ≼i s ) : (( f : r ↪r s ) : α → β ) = f :=
rfl : ∀ {α : Sort ?u.11440} {a : α }, a = a rfl
#align initial_seg.coe_coe_fn InitialSeg.coe_coe_fn : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ), ↑f .toRelEmbedding = ↑f InitialSeg.coe_coe_fn
theorem init : ∀ (f : r ≼i s ) {a : α } {b : β }, s b (↑f a ) → ∃ a' , ↑f a' = b init ( f : r ≼i s ) { a : α } { b : β } : s b ( f a ) → ∃ a' , f a' = b :=
f . init' : ∀ {α : Type ?u.11762} {β : Type ?u.11761} {r : α → α → Prop } {s : β → β → Prop } (self : r ≼i s ) (a : α ) (b : β ),
s b (↑self .toRelEmbedding a ) → ∃ a' , ↑self .toRelEmbedding a' = b init' _ _
#align initial_seg.init InitialSeg.init : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) → ∃ a' , ↑f a' = b InitialSeg.init
theorem map_rel_iff : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } {a b : α } (f : r ≼i s ), s (↑f a ) (↑f b ) ↔ r a b map_rel_iff ( f : r ≼i s ) : s ( f a ) ( f b ) ↔ r a b :=
f . map_rel_iff' : ∀ {α : Type ?u.12422} {β : Type ?u.12421} {r : α → α → Prop } {s : β → β → Prop } (self : r ↪r s ) {a b : α },
s (↑self .toEmbedding a ) (↑self .toEmbedding b ) ↔ r a b map_rel_iff'
#align initial_seg.map_rel_iff InitialSeg.map_rel_iff : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } {a b : α } (f : r ≼i s ), s (↑f a ) (↑f b ) ↔ r a b InitialSeg.map_rel_iff
theorem init_iff : ∀ (f : r ≼i s ) {a : α } {b : β }, s b (↑f a ) ↔ ∃ a' , ↑f a' = b ∧ r a' a init_iff ( f : r ≼i s ) { a : α } { b : β } : s b ( f a ) ↔ ∃ a' , f a' = b ∧ r a' a :=
⟨ fun h => by
rcases f . init : ∀ {α : Type ?u.13014} {β : Type ?u.13015} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) → ∃ a' , ↑f a' = b init h with ⟨a', rfl⟩ : ∃ a' , ↑f a' = b ⟨a' ⟨a', rfl⟩ : ∃ a' , ↑f a' = b , rfl ⟨a', rfl⟩ : ∃ a' , ↑f a' = b ⟩intro ∃ a'_1 , ↑f a'_1 = ↑f a' ∧ r a'_1 a
exact ⟨ a' , rfl : ∀ {α : Sort ?u.13130} {a : α }, a = a rfl, f . map_rel_iff : ∀ {α : Type ?u.13136} {β : Type ?u.13137} {r : α → α → Prop } {s : β → β → Prop } {a b : α } (f : r ≼i s ),
s (↑f a ) (↑f b ) ↔ r a b map_rel_iff. 1 : ∀ {a b : Prop }, (a ↔ b ) → a → b 1 h ⟩ ,
fun ⟨ a' , e , h ⟩ => e ▸ f . map_rel_iff : ∀ {α : Type ?u.12833} {β : Type ?u.12834} {r : α → α → Prop } {s : β → β → Prop } {a b : α } (f : r ≼i s ),
s (↑f a ) (↑f b ) ↔ r a b map_rel_iff. 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 h ⟩
#align initial_seg.init_iff InitialSeg.init_iff : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) ↔ ∃ a' , ↑f a' = b ∧ r a' a InitialSeg.init_iff
/-- An order isomorphism is an initial segment -/
def ofIso ( f : r ≃r s ) : r ≼i s :=
⟨ f , fun _ b _ => ⟨ f . symm : {α : Type ?u.13462} → {β : Type ?u.13461} → {r : α → α → Prop } → {s : β → β → Prop } → r ≃r s → s ≃r r symm b , RelIso.apply_symm_apply : ∀ {α : Type ?u.13536} {β : Type ?u.13537} {r : α → α → Prop } {s : β → β → Prop } (e : r ≃r s ) (x : β ),
↑e (↑(RelIso.symm e ) x ) = x RelIso.apply_symm_apply f _ ⟩⟩
#align initial_seg.of_iso InitialSeg.ofIso : {α : Type u_1} → {β : Type u_2} → {r : α → α → Prop } → {s : β → β → Prop } → r ≃r s → r ≼i s InitialSeg.ofIso
/-- The identity function shows that `≼i` is reflexive -/
@[refl]
protected def refl : {α : Type u_1} → (r : α → α → Prop ) → r ≼i r refl ( r : α → α → Prop ) : r ≼i r :=
⟨ RelEmbedding.refl : {α : Type ?u.13837} → (r : α → α → Prop ) → r ↪r r RelEmbedding.refl _ : ?m.13838 → ?m.13838 → Prop _, fun _ _ _ => ⟨ _ , rfl : ∀ {α : Sort ?u.13872} {a : α }, a = a rfl⟩⟩
#align initial_seg.refl InitialSeg.refl : {α : Type u_1} → (r : α → α → Prop ) → r ≼i r InitialSeg.refl
instance ( r : α → α → Prop ) : Inhabited : Sort ?u.14019 → Sort (max1?u.14019) Inhabited ( r ≼i r ) :=
⟨ InitialSeg.refl : {α : Type ?u.14043} → (r : α → α → Prop ) → r ≼i r InitialSeg.refl r ⟩
/-- Composition of functions shows that `≼i` is transitive -/
@[trans]
protected def trans ( f : r ≼i s ) ( g : s ≼i t ) : r ≼i t :=
⟨ f . 1 : {α : Type ?u.14276} → {β : Type ?u.14275} → {r : α → α → Prop } → {s : β → β → Prop } → r ≼i s → r ↪r s 1. trans : {α : Type ?u.14295} →
{β : Type ?u.14294} →
{γ : Type ?u.14293} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ↪r s → s ↪r t → r ↪r t trans g . 1 : {α : Type ?u.14333} → {β : Type ?u.14332} → {r : α → α → Prop } → {s : β → β → Prop } → r ≼i s → r ↪r s 1, fun a c h => by
simp at h ⊢
rcases g . 2 : ∀ {α : Type ?u.16161} {β : Type ?u.16160} {r : α → α → Prop } {s : β → β → Prop } (self : r ≼i s ) (a : α ) (b : β ),
s b (↑self .toRelEmbedding a ) → ∃ a' , ↑self .toRelEmbedding a' = b 2 _ _ h with ⟨b, rfl⟩ : ∃ a' , ↑g .toRelEmbedding a' = c ⟨b ⟨b, rfl⟩ : ∃ a' , ↑g .toRelEmbedding a' = c , rfl : ↑g .toRelEmbedding b = c rfl⟨b, rfl⟩ : ∃ a' , ↑g .toRelEmbedding a' = c ⟩α : Type ?u.14169β : Type ?u.14172γ : Type ?u.14175r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s g : s ≼i t a : α b : β h : t (↑g .toRelEmbedding b ) (↑g (↑f a ) )intro ∃ a' , ↑g (↑f a' ) = ↑g .toRelEmbedding b ; α : Type ?u.14169β : Type ?u.14172γ : Type ?u.14175r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s g : s ≼i t a : α b : β h : t (↑g .toRelEmbedding b ) (↑g (↑f a ) )intro ∃ a' , ↑g (↑f a' ) = ↑g .toRelEmbedding b have h := g . map_rel_iff : ∀ {α : Type ?u.16270} {β : Type ?u.16271} {r : α → α → Prop } {s : β → β → Prop } {a b : α } (f : r ≼i s ),
s (↑f a ) (↑f b ) ↔ r a b map_rel_iff. 1 : ∀ {a b : Prop }, (a ↔ b ) → a → b 1 h : t (↑g .toRelEmbedding b ) (↑g (↑f a ) )
h α : Type ?u.14169β : Type ?u.14172γ : Type ?u.14175r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s g : s ≼i t a : α b : β h✝ : t (↑g .toRelEmbedding b ) (↑g (↑f a ) )h : s b (↑f a )intro ∃ a' , ↑g (↑f a' ) = ↑g .toRelEmbedding b
rcases f . 2 : ∀ {α : Type ?u.16292} {β : Type ?u.16291} {r : α → α → Prop } {s : β → β → Prop } (self : r ≼i s ) (a : α ) (b : β ),
s b (↑self .toRelEmbedding a ) → ∃ a' , ↑self .toRelEmbedding a' = b 2 _ _ h with ⟨a', rfl⟩ : ∃ a' , ↑f .toRelEmbedding a' = b ⟨a' ⟨a', rfl⟩ : ∃ a' , ↑f .toRelEmbedding a' = b , rfl : ↑f .toRelEmbedding a' = b rfl⟨a', rfl⟩ : ∃ a' , ↑f .toRelEmbedding a' = b ⟩α : Type ?u.14169β : Type ?u.14172γ : Type ?u.14175r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s g : s ≼i t a, a' : α h✝ : t (↑g .toRelEmbedding (↑f .toRelEmbedding a' ) ) (↑g (↑f a ) )h : s (↑f .toRelEmbedding a' ) (↑f a )intro.intro ∃ a'_1 , ↑g (↑f a'_1 ) = ↑g .toRelEmbedding (↑f .toRelEmbedding a' ) ; α : Type ?u.14169β : Type ?u.14172γ : Type ?u.14175r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s g : s ≼i t a, a' : α h✝ : t (↑g .toRelEmbedding (↑f .toRelEmbedding a' ) ) (↑g (↑f a ) )h : s (↑f .toRelEmbedding a' ) (↑f a )intro.intro ∃ a'_1 , ↑g (↑f a'_1 ) = ↑g .toRelEmbedding (↑f .toRelEmbedding a' ) exact ⟨ a' , rfl : ∀ {α : Sort ?u.16405} {a : α }, a = a rfl⟩ ⟩
#align initial_seg.trans InitialSeg.trans : {α : Type u_1} →
{β : Type u_2} →
{γ : Type u_3} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≼i s → s ≼i t → r ≼i t InitialSeg.trans
@[ simp ]
theorem refl_apply ( x : α ) : InitialSeg.refl : {α : Type ?u.16763} → (r : α → α → Prop ) → r ≼i r InitialSeg.refl r x = x :=
rfl : ∀ {α : Sort ?u.16888} {a : α }, a = a rfl
#align initial_seg.refl_apply InitialSeg.refl_apply
@[ simp ]
theorem trans_apply ( f : r ≼i s ) ( g : s ≼i t ) ( a : α ) : ( f . trans : {α : Type ?u.16997} →
{β : Type ?u.16996} →
{γ : Type ?u.16995} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≼i s → s ≼i t → r ≼i t trans g ) a = g ( f a ) :=
rfl : ∀ {α : Sort ?u.17380} {a : α }, a = a rfl
#align initial_seg.trans_apply InitialSeg.trans_apply
instance subsingleton_of_trichotomous_of_irrefl [ IsTrichotomous β s ] [ IsIrrefl β s ]
[ IsWellFounded α r ] : Subsingleton ( r ≼i s ) :=
⟨ fun f g => by
ext a
refine' IsWellFounded.induction : ∀ {α : Type ?u.17594} (r : α → α → Prop ) [inst : IsWellFounded α r ] {C : α → Prop } (a : α ),
(∀ (x : α ), (∀ (y : α ), r y x → C y ) → C x ) → C a IsWellFounded.induction r a fun b IH =>
extensional_of_trichotomous_of_irrefl : ∀ {α : Type ?u.17618} (r : α → α → Prop ) [inst : IsTrichotomous α r ] [inst : IsIrrefl α r ] {a b : α },
(∀ (x : α ), r x a ↔ r x b ) → a = b extensional_of_trichotomous_of_irrefl s fun x => _ : s x ?m.17628 ↔ s x ?m.17629 _
rw [ f . init_iff : ∀ {α : Type ?u.17674} {β : Type ?u.17675} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) ↔ ∃ a' , ↑f a' = b ∧ r a' a init_iff, h (∃ a' , ↑f a' = x ∧ r a' b ) ↔ s x (↑g b ) g . init_iff : ∀ {α : Type ?u.17728} {β : Type ?u.17729} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) ↔ ∃ a' , ↑f a' = b ∧ r a' a init_iffh (∃ a' , ↑f a' = x ∧ r a' b ) ↔ ∃ a' , ↑g a' = x ∧ r a' b ] h (∃ a' , ↑f a' = x ∧ r a' b ) ↔ ∃ a' , ↑g a' = x ∧ r a' b
exact exists_congr : ∀ {α : Sort ?u.17783} {p q : α → Prop }, (∀ (a : α ), p a ↔ q a ) → ((∃ a , p a ) ↔ ∃ a , q a ) exists_congr fun x => and_congr_left : ∀ {c a b : Prop }, (c → (a ↔ b ) ) → (a ∧ c ↔ b ∧ c ) and_congr_left fun hx => IH _ hx ▸ Iff.rfl : ∀ {a : Prop }, a ↔ a Iff.rfl⟩
#align initial_seg.subsingleton_of_trichotomous_of_irrefl InitialSeg.subsingleton_of_trichotomous_of_irrefl
instance [ IsWellOrder β s ] : Subsingleton ( r ≼i s ) :=
⟨ fun a => by let _ := a . isWellFounded ; exact Subsingleton.elim a ⟩
protected theorem eq [ IsWellOrder β s ] ( f g : r ≼i s ) ( a ) : f a = g a := by
rw [ Subsingleton.elim f g ]
#align initial_seg.eq InitialSeg.eq
theorem Antisymm.aux [ IsWellOrder α r ] ( f : r ≼i s ) ( g : s ≼i r ) : LeftInverse : {α : Sort ?u.18633} → {β : Sort ?u.18632} → (β → α ) → (α → β ) → Prop LeftInverse g f :=
InitialSeg.eq : ∀ {α : Type ?u.18877} {β : Type ?u.18876} {r : α → α → Prop } {s : β → β → Prop } [inst : IsWellOrder β s ] (f g : r ≼i s )
(a : α ), ↑f a = ↑g a InitialSeg.eq ( f . trans : {α : Type ?u.18885} →
{β : Type ?u.18884} →
{γ : Type ?u.18883} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≼i s → s ≼i t → r ≼i t trans g ) ( InitialSeg.refl : {α : Type ?u.18950} → (r : α → α → Prop ) → r ≼i r InitialSeg.refl _ : ?m.18951 → ?m.18951 → Prop _)
#align initial_seg.antisymm.aux InitialSeg.Antisymm.aux
/-- If we have order embeddings between `α` and `β` whose images are initial segments, and `β`
is a well-order then `α` and `β` are order-isomorphic. -/
def antisymm [ IsWellOrder β s ] ( f : r ≼i s ) ( g : s ≼i r ) : r ≃r s :=
haveI := f . toRelEmbedding : {α : Type ?u.19071} → {β : Type ?u.19070} → {r : α → α → Prop } → {s : β → β → Prop } → r ≼i s → r ↪r s toRelEmbedding. isWellOrder
⟨⟨ f , g , Antisymm.aux f g , Antisymm.aux g f ⟩, f . map_rel_iff' : ∀ {α : Type ?u.19458} {β : Type ?u.19457} {r : α → α → Prop } {s : β → β → Prop } (self : r ↪r s ) {a b : α },
s (↑self .toEmbedding a ) (↑self .toEmbedding b ) ↔ r a b map_rel_iff'⟩
#align initial_seg.antisymm InitialSeg.antisymm
@[ simp ]
theorem antisymm_toFun [ IsWellOrder β s ] ( f : r ≼i s ) ( g : s ≼i r ) : ( antisymm f g : α → β ) = f :=
rfl : ∀ {α : Sort ?u.20160} {a : α }, a = a rfl
#align initial_seg.antisymm_to_fun InitialSeg.antisymm_toFun
@[ simp ]
theorem antisymm_symm [ IsWellOrder α r ] [ IsWellOrder β s ] ( f : r ≼i s ) ( g : s ≼i r ) :
( antisymm f g ). symm : {α : Type ?u.20344} → {β : Type ?u.20343} → {r : α → α → Prop } → {s : β → β → Prop } → r ≃r s → s ≃r r symm = antisymm g f :=
RelIso.coe_fn_injective : ∀ {α : Type ?u.20409} {β : Type ?u.20410} {r : α → α → Prop } {s : β → β → Prop }, Injective fun f => ↑f RelIso.coe_fn_injective rfl : ∀ {α : Sort ?u.20432} {a : α }, a = a rfl
#align initial_seg.antisymm_symm InitialSeg.antisymm_symm
theorem eq_or_principal [ IsWellOrder β s ] ( f : r ≼i s ) :
Surjective : {α : Sort ?u.20543} → {β : Sort ?u.20542} → (α → β ) → Prop Surjective f ∨ ∃ b , ∀ x , s x b ↔ ∃ y , f y = x :=
or_iff_not_imp_right : ∀ {a b : Prop }, a ∨ b ↔ ¬ b → a or_iff_not_imp_right. 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 fun h b =>
Acc.recOn : ∀ {α : Sort ?u.20799} {r : α → α → Prop } {motive : (a : α ) → Acc r a → Sort ?u.20800 } {a : α } (t : Acc r a ),
(∀ (x : α ) (h : ∀ (y : α ), r y x → Acc r y ),
(∀ (y : α ) (a : r y x ), motive y (_ : Acc r y ) ) → motive x (_ : Acc r x ) ) →
motive a t Acc.recOn ( IsWellFounded.wf . apply b : Acc s b ) fun x _ IH =>
not_forall_not : ∀ {α : Sort ?u.20943} {p : α → Prop }, (¬ ∀ (x : α ), ¬ p x ) ↔ ∃ x , p x not_forall_not. 1 : ∀ {a b : Prop }, (a ↔ b ) → a → b 1 fun hn =>
h
⟨ x , fun y =>
⟨ IH _ , fun ⟨ a , e ⟩ => by
α : Type u_2β : Type u_1γ : Type ?u.20498r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder β s f : r ≼i s h : ¬ ∃ b , ∀ (x : β ), s x b ↔ ∃ y , ↑f y = x b, x : β x✝¹ : ∀ (y : β ), s y x → Acc s y IH : ∀ (y : β ), s y x → ∃ a , ↑f a = y hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x y : β x✝ : ∃ y_1 , ↑f y_1 = y a : α e : ↑f a = y s y x
rw [ α : Type u_2β : Type u_1γ : Type ?u.20498r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder β s f : r ≼i s h : ¬ ∃ b , ∀ (x : β ), s x b ↔ ∃ y , ↑f y = x b, x : β x✝¹ : ∀ (y : β ), s y x → Acc s y IH : ∀ (y : β ), s y x → ∃ a , ↑f a = y hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x y : β x✝ : ∃ y_1 , ↑f y_1 = y a : α e : ↑f a = y s y x
← e α : Type u_2β : Type u_1γ : Type ?u.20498r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder β s f : r ≼i s h : ¬ ∃ b , ∀ (x : β ), s x b ↔ ∃ y , ↑f y = x b, x : β x✝¹ : ∀ (y : β ), s y x → Acc s y IH : ∀ (y : β ), s y x → ∃ a , ↑f a = y hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x y : β x✝ : ∃ y_1 , ↑f y_1 = y a : α e : ↑f a = y s (↑f a ) x
] α : Type u_2β : Type u_1γ : Type ?u.20498r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder β s f : r ≼i s h : ¬ ∃ b , ∀ (x : β ), s x b ↔ ∃ y , ↑f y = x b, x : β x✝¹ : ∀ (y : β ), s y x → Acc s y IH : ∀ (y : β ), s y x → ∃ a , ↑f a = y hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x y : β x✝ : ∃ y_1 , ↑f y_1 = y a : α e : ↑f a = y s (↑f a ) x
; α : Type u_2β : Type u_1γ : Type ?u.20498r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder β s f : r ≼i s h : ¬ ∃ b , ∀ (x : β ), s x b ↔ ∃ y , ↑f y = x b, x : β x✝¹ : ∀ (y : β ), s y x → Acc s y IH : ∀ (y : β ), s y x → ∃ a , ↑f a = y hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x y : β x✝ : ∃ y_1 , ↑f y_1 = y a : α e : ↑f a = y s (↑f a ) x
α : Type u_2β : Type u_1γ : Type ?u.20498r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder β s f : r ≼i s h : ¬ ∃ b , ∀ (x : β ), s x b ↔ ∃ y , ↑f y = x b, x : β x✝¹ : ∀ (y : β ), s y x → Acc s y IH : ∀ (y : β ), s y x → ∃ a , ↑f a = y hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x y : β x✝ : ∃ y_1 , ↑f y_1 = y a : α e : ↑f a = y s y x
exact
( trichotomous _ _ ). resolve_right : ∀ {a b : Prop }, a ∨ b → ¬ b → a resolve_right
( not_or_of_not : ∀ {a b : Prop }, ¬ a → ¬ b → ¬ (a ∨ b ) not_or_of_not ( hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x hn a ) fun hl => not_exists : ∀ {α : Sort ?u.21217} {p : α → Prop }, (¬ ∃ x , p x ) ↔ ∀ (x : α ), ¬ p x not_exists. 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 hn : ∀ (x_1 : α ), ¬ ↑f x_1 = x hn ( f . init : ∀ {α : Type ?u.21228} {β : Type ?u.21229} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) → ∃ a' , ↑f a' = b init hl )) ⟩⟩
#align initial_seg.eq_or_principal InitialSeg.eq_or_principal
/-- Restrict the codomain of an initial segment -/
def codRestrict : {α : Type u_1} →
{β : Type u_2} →
{r : α → α → Prop } → {s : β → β → Prop } → (p : Set β ) → (f : r ≼i s ) → (∀ (a : α ), ↑f a ∈ p ) → r ≼i Subrel s p codRestrict ( p : Set β ) ( f : r ≼i s ) ( H : ∀ a , f a ∈ p ) : r ≼i Subrel : {α : Type ?u.21554} → (α → α → Prop ) → (p : Set α ) → ↑p → ↑p → Prop Subrel s p :=
⟨ RelEmbedding.codRestrict : {α : Type ?u.21594} →
{β : Type ?u.21593} →
{r : α → α → Prop } → {s : β → β → Prop } → (p : Set β ) → (f : r ↪r s ) → (∀ (a : α ), ↑f a ∈ p ) → r ↪r Subrel s p RelEmbedding.codRestrict p f H , fun a ⟨ b , m ⟩ h =>
let ⟨ a' , e : ↑f a' = ↑{ val := b , property := m } e ⟩ := f . init : ∀ {α : Type ?u.21830} {β : Type ?u.21831} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) → ∃ a' , ↑f a' = b init h
⟨ a' , by subst e : ↑f a' = ↑{ val := b , property := m } e ; rfl ⟩⟩
#align initial_seg.cod_restrict InitialSeg.codRestrict : {α : Type u_1} →
{β : Type u_2} →
{r : α → α → Prop } → {s : β → β → Prop } → (p : Set β ) → (f : r ≼i s ) → (∀ (a : α ), ↑f a ∈ p ) → r ≼i Subrel s p InitialSeg.codRestrict
@[ simp ]
theorem codRestrict_apply : ∀ (p : Set β ) (f : r ≼i s ) (H : ∀ (a : α ), ↑f a ∈ p ) (a : α ),
↑(codRestrict p f H ) a = { val := ↑f a , property := (_ : ↑f a ∈ p ) } codRestrict_apply ( p ) ( f : r ≼i s ) ( H a ) : codRestrict : {α : Type ?u.22586} →
{β : Type ?u.22585} →
{r : α → α → Prop } → {s : β → β → Prop } → (p : Set β ) → (f : r ≼i s ) → (∀ (a : α ), ↑f a ∈ p ) → r ≼i Subrel s p codRestrict p f H a = ⟨ f a , H a ⟩ :=
rfl : ∀ {α : Sort ?u.22841} {a : α }, a = a rfl
#align initial_seg.cod_restrict_apply InitialSeg.codRestrict_apply : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } (p : Set β ) (f : r ≼i s ) (H : ∀ (a : α ), ↑f a ∈ p )
(a : α ), ↑(codRestrict p f H ) a = { val := ↑f a , property := (_ : ↑f a ∈ p ) } InitialSeg.codRestrict_apply
/-- Initial segment from an empty type. -/
def ofIsEmpty ( r : α → α → Prop ) ( s : β → β → Prop ) [ IsEmpty α ] : r ≼i s :=
⟨ RelEmbedding.ofIsEmpty : {α : Type ?u.23014} → {β : Type ?u.23013} → (r : α → α → Prop ) → (s : β → β → Prop ) → [inst : IsEmpty α ] → r ↪r s RelEmbedding.ofIsEmpty r s , isEmptyElim : ∀ {α : Sort ?u.23041} [inst : IsEmpty α ] {p : α → Sort ?u.23040 } (a : α ), p a isEmptyElim⟩
#align initial_seg.of_is_empty InitialSeg.ofIsEmpty : {α : Type u_1} → {β : Type u_2} → (r : α → α → Prop ) → (s : β → β → Prop ) → [inst : IsEmpty α ] → r ≼i s InitialSeg.ofIsEmpty
/-- Initial segment embedding of an order `r` into the disjoint union of `r` and `s`. -/
def leAdd ( r : α → α → Prop ) ( s : β → β → Prop ) : r ≼i Sum.Lex r s :=
⟨⟨⟨ Sum.inl : {α : Type ?u.23315} → {β : Type ?u.23314} → α → α ⊕ β Sum.inl, fun _ _ => Sum.inl.inj ⟩, Sum.lex_inl_inl ⟩, fun a b => by
cases b <;> [ exact fun _ => ⟨ _ , rfl : ∀ {α : Sort ?u.23486} {a : α }, a = a rfl⟩ ; exact False.elim ∘ Sum.lex_inr_inl ] ⟩
#align initial_seg.le_add InitialSeg.leAdd
@[ simp ]
theorem leAdd_apply ( r : α → α → Prop ) ( s : β → β → Prop ) ( a ) : leAdd r s a = Sum.inl : {α : Type ?u.23892} → {β : Type ?u.23891} → α → α ⊕ β Sum.inl a :=
rfl : ∀ {α : Sort ?u.23936} {a : α }, a = a rfl
#align initial_seg.le_add_apply InitialSeg.leAdd_apply
protected theorem acc ( f : r ≼i s ) ( a : α ) : Acc r a ↔ Acc s ( f a ) :=
⟨ by
refine' fun h => Acc.recOn : ∀ {α : Sort ?u.24250} {r : α → α → Prop } {motive : (a : α ) → Acc r a → Sort ?u.24251 } {a : α } (t : Acc r a ),
(∀ (x : α ) (h : ∀ (y : α ), r y x → Acc r y ),
(∀ (y : α ) (a : r y x ), motive y (_ : Acc r y ) ) → motive x (_ : Acc r x ) ) →
motive a t Acc.recOn h fun a _ ha => Acc.intro : ∀ {α : Sort ?u.24305} {r : α → α → Prop } (x : α ), (∀ (y : α ), r y x → Acc r y ) → Acc r x Acc.intro _ fun b hb => _ α : Type u_1β : Type u_2γ : Type ?u.24005r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s a✝ : α h : Acc r a✝ a : α x✝ : ∀ (y : α ), r y a → Acc r y ha : ∀ (y : α ), r y a → Acc s (↑f y ) b : β hb : s b (↑f a )
obtain ⟨a', rfl⟩ : ∃ a' , ↑f a' = b ⟨a' ⟨a', rfl⟩ : ∃ a' , ↑f a' = b , rfl ⟨a', rfl⟩ : ∃ a' , ↑f a' = b ⟩ := f . init : ∀ {α : Type ?u.24331} {β : Type ?u.24332} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) → ∃ a' , ↑f a' = b init hb α : Type u_1β : Type u_2γ : Type ?u.24005r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≼i s a✝ : α h : Acc r a✝ a : α x✝ : ∀ (y : α ), r y a → Acc r y ha : ∀ (y : α ), r y a → Acc s (↑f y ) a' : α hb : s (↑f a' ) (↑f a )intro
exact ha _ ( f . map_rel_iff : ∀ {α : Type ?u.24418} {β : Type ?u.24419} {r : α → α → Prop } {s : β → β → Prop } {a b : α } (f : r ≼i s ),
s (↑f a ) (↑f b ) ↔ r a b map_rel_iff. mp : ∀ {a b : Prop }, (a ↔ b ) → a → b mp hb ) , f . toRelEmbedding : {α : Type ?u.24191} → {β : Type ?u.24190} → {r : α → α → Prop } → {s : β → β → Prop } → r ≼i s → r ↪r s toRelEmbedding. acc : ∀ {α : Type ?u.24208} {β : Type ?u.24209} {r : α → α → Prop } {s : β → β → Prop } (f : r ↪r s ) (a : α ),
Acc s (↑f a ) → Acc r a acc a ⟩
#align initial_seg.acc InitialSeg.acc : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) (a : α ), Acc r a ↔ Acc s (↑f a ) InitialSeg.acc
end InitialSeg
/-!
### Principal segments
Order embeddings whose range is a principal segment of `s` (i.e., an interval of the form
`(-∞, top)` for some element `top` of `β`). The type of these embeddings from `r` to `s` is called
`PrincipalSeg r s`, and denoted by `r ≺i s`. Principal segments are in particular initial
segments.
-/
/-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
structure PrincipalSeg : {α : Type u_1} →
{β : Type u_2} →
{r : α → α → Prop } →
{s : β → β → Prop } →
(toRelEmbedding : r ↪r s ) → (top : β ) → (∀ (b : β ), s b top ↔ ∃ a , ↑toRelEmbedding a = b ) → PrincipalSeg r s PrincipalSeg { α β : Type _ : Type (?u.24493+1) Type _} ( r : α → α → Prop ) ( s : β → β → Prop ) extends r ↪r s where
/-- The supremum of the principal segment -/
top : β
/-- The image of the order embedding is the set of elements `b` such that `s b top` -/
down' : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (self : PrincipalSeg r s ) (b : β ),
s b self .top ↔ ∃ a , ↑self .toRelEmbedding a = b down' : ∀ b , s b top ↔ ∃ a , toRelEmbedding a = b
#align principal_seg PrincipalSeg
-- Porting notes: deleted `scoped[InitialSeg]`
/-- If `r` is a relation on `α` and `s` in a relation on `β`, then `f : r ≺i s` is an order
embedding whose range is an open interval `(-∞, top)` for some element `top` of `β`. Such order
embeddings are called principal segments -/
infixl :25 " ≺i " => PrincipalSeg
namespace PrincipalSeg
instance : CoeOut ( r ≺i s ) ( r ↪r s ) :=
⟨ PrincipalSeg.toRelEmbedding : {α : Type ?u.33484} → {β : Type ?u.33483} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → r ↪r s PrincipalSeg.toRelEmbedding⟩
instance : CoeFun ( r ≺i s ) fun _ => α → β :=
⟨ fun f => f ⟩
@[ simp ]
theorem coe_fn_mk : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ↪r s ) (t : β )
(o : ∀ (b : β ), s b t ↔ ∃ a , ↑f a = b ), ↑{ toRelEmbedding := f , top := t , down' := o } .toRelEmbedding = ↑f coe_fn_mk ( f : r ↪r s ) ( t o ) : (@ PrincipalSeg.mk : {α : Type ?u.34525} →
{β : Type ?u.34524} →
{r : α → α → Prop } →
{s : β → β → Prop } →
(toRelEmbedding : r ↪r s ) → (top : β ) → (∀ (b : β ), s b top ↔ ∃ a , ↑toRelEmbedding a = b ) → r ≺i s PrincipalSeg.mk _ _ r s f t o : α → β ) = f :=
rfl : ∀ {α : Sort ?u.35020} {a : α }, a = a rfl
#align principal_seg.coe_fn_mk PrincipalSeg.coe_fn_mk : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ↪r s ) (t : β )
(o : ∀ (b : β ), s b t ↔ ∃ a , ↑f a = b ), ↑{ toRelEmbedding := f , top := t , down' := o } .toRelEmbedding = ↑f PrincipalSeg.coe_fn_mk
theorem down : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) {b : β },
s b f .top ↔ ∃ a , ↑f .toRelEmbedding a = b down ( f : r ≺i s ) : ∀ { b : β }, s b f . top : {α : Type ?u.35137} → {β : Type ?u.35136} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top ↔ ∃ a , f a = b :=
f . down' : ∀ {α : Type ?u.35213} {β : Type ?u.35212} {r : α → α → Prop } {s : β → β → Prop } (self : r ≺i s ) (b : β ),
s b self .top ↔ ∃ a , ↑self .toRelEmbedding a = b down' _
#align principal_seg.down PrincipalSeg.down : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) {b : β },
s b f .top ↔ ∃ a , ↑f .toRelEmbedding a = b PrincipalSeg.down
theorem lt_top : ∀ (f : r ≺i s ) (a : α ), s (↑f .toRelEmbedding a ) f .top lt_top ( f : r ≺i s ) ( a : α ) : s ( f a ) f . top : {α : Type ?u.35352} → {β : Type ?u.35351} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top :=
f . down : ∀ {α : Type ?u.35364} {β : Type ?u.35365} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) {b : β },
s b f .top ↔ ∃ a , ↑f .toRelEmbedding a = b down. 2 : ∀ {a b : Prop }, (a ↔ b ) → b → a 2 ⟨ _ , rfl : ∀ {α : Sort ?u.35402} {a : α }, a = a rfl⟩
#align principal_seg.lt_top PrincipalSeg.lt_top : ∀ {α : Type u_1} {β : Type u_2} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) (a : α ),
s (↑f .toRelEmbedding a ) f .top PrincipalSeg.lt_top
theorem init : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s ) {a : α } {b : β },
s b (↑f .toRelEmbedding a ) → ∃ a' , ↑f .toRelEmbedding a' = b init [ IsTrans β s ] ( f : r ≺i s ) { a : α } { b : β } ( h : s b (↑f .toRelEmbedding a )
h : s b ( f a )) : ∃ a' , f a' = b :=
f . down : ∀ {α : Type ?u.35589} {β : Type ?u.35590} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) {b : β },
s b f .top ↔ ∃ a , ↑f .toRelEmbedding a = b down. 1 : ∀ {a b : Prop }, (a ↔ b ) → a → b 1 <| _root_.trans : ∀ {α : Type ?u.35619} {r : α → α → Prop } [inst : IsTrans α r ] {a b c : α }, r a b → r b c → r a c _root_.trans h : s b (↑f .toRelEmbedding a )
h <| f . lt_top : ∀ {α : Type ?u.35654} {β : Type ?u.35655} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) (a : α ),
s (↑f .toRelEmbedding a ) f .top lt_top _
#align principal_seg.init PrincipalSeg.init : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s ) {a : α } {b : β },
s b (↑f .toRelEmbedding a ) → ∃ a' , ↑f .toRelEmbedding a' = b PrincipalSeg.init
/-- A principal segment is in particular an initial segment. -/
instance hasCoeInitialSeg [ IsTrans β s ] : Coe ( r ≺i s ) ( r ≼i s ) :=
⟨ fun f => ⟨ f . toRelEmbedding : {α : Type ?u.35812} → {β : Type ?u.35811} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → r ↪r s toRelEmbedding, fun _ _ => f . init : ∀ {α : Type ?u.35844} {β : Type ?u.35843} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s )
{a : α } {b : β }, s b (↑f .toRelEmbedding a ) → ∃ a' , ↑f .toRelEmbedding a' = b init⟩⟩
#align principal_seg.has_coe_initial_seg PrincipalSeg.hasCoeInitialSeg : {α : Type u_1} → {β : Type u_2} → {r : α → α → Prop } → {s : β → β → Prop } → [inst : IsTrans β s ] → Coe (r ≺i s ) (r ≼i s ) PrincipalSeg.hasCoeInitialSeg
theorem coe_coe_fn' : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s ),
↑{ toRelEmbedding := f .toRelEmbedding ,
init' := (_ : ∀ (x : α ) (x_1 : β ), s x_1 (↑f .toRelEmbedding x ) → ∃ a' , ↑f .toRelEmbedding a' = x_1 ) } = ↑f .toRelEmbedding coe_coe_fn' [ IsTrans β s ] ( f : r ≺i s ) : (( f : r ≼i s ) : α → β ) = f :=
rfl : ∀ {α : Sort ?u.36735} {a : α }, a = a rfl
#align principal_seg.coe_coe_fn' PrincipalSeg.coe_coe_fn' : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s ),
↑{ toRelEmbedding := f .toRelEmbedding ,
init' := (_ : ∀ (x : α ) (x_1 : β ), s x_1 (↑f .toRelEmbedding x ) → ∃ a' , ↑f .toRelEmbedding a' = x_1 ) } = ↑f .toRelEmbedding PrincipalSeg.coe_coe_fn'
theorem init_iff : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s ) {a : α } {b : β },
s b (↑f .toRelEmbedding a ) ↔ ∃ a' , ↑f .toRelEmbedding a' = b ∧ r a' a init_iff [ IsTrans β s ] ( f : r ≺i s ) { a : α } { b : β } : s b ( f a ) ↔ ∃ a' , f a' = b ∧ r a' a :=
@ InitialSeg.init_iff : ∀ {α : Type ?u.36915} {β : Type ?u.36916} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) ↔ ∃ a' , ↑f a' = b ∧ r a' a InitialSeg.init_iff α β r s f a b
#align principal_seg.init_iff PrincipalSeg.init_iff : ∀ {α : Type u_2} {β : Type u_1} {r : α → α → Prop } {s : β → β → Prop } [inst : IsTrans β s ] (f : r ≺i s ) {a : α } {b : β },
s b (↑f .toRelEmbedding a ) ↔ ∃ a' , ↑f .toRelEmbedding a' = b ∧ r a' a PrincipalSeg.init_iff
theorem irrefl { r : α → α → Prop } [ IsWellOrder α r ] ( f : r ≺i r ) : False := by
have h := f . lt_top : ∀ {α : Type ?u.37145} {β : Type ?u.37146} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) (a : α ),
s (↑f .toRelEmbedding a ) f .top lt_top f . top : {α : Type ?u.37170} → {β : Type ?u.37169} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top
rw [ show f f . top : {α : Type ?u.37229} → {β : Type ?u.37228} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top = f . top : {α : Type ?u.37239} → {β : Type ?u.37238} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top from InitialSeg.eq : ∀ {α : Type ?u.37253} {β : Type ?u.37252} {r : α → α → Prop } {s : β → β → Prop } [inst : IsWellOrder β s ] (f g : r ≼i s )
(a : α ), ↑f a = ↑g a InitialSeg.eq (↑ f ) ( InitialSeg.refl : {α : Type ?u.37359} → (r : α → α → Prop ) → r ≼i r InitialSeg.refl r ) f . top : {α : Type ?u.37388} → {β : Type ?u.37387} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top] at h
exact _root_.irrefl : ∀ {α : Type ?u.37603} {r : α → α → Prop } [inst : IsIrrefl α r ] (a : α ), ¬ r a a _root_.irrefl _ h
#align principal_seg.irrefl PrincipalSeg.irrefl
instance ( r : α → α → Prop ) [ IsWellOrder α r ] : IsEmpty ( r ≺i r ) :=
⟨ fun f => f . irrefl ⟩
/-- Composition of a principal segment with an initial segment, as a principal segment -/
def ltLe : r ≺i s → s ≼i t → r ≺i t ltLe ( f : r ≺i s ) ( g : s ≼i t ) : r ≺i t :=
⟨@ RelEmbedding.trans : {α : Type ?u.37927} →
{β : Type ?u.37926} →
{γ : Type ?u.37925} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ↪r s → s ↪r t → r ↪r t RelEmbedding.trans _ _ _ r s t f g , g f . top : {α : Type ?u.38556} → {β : Type ?u.38555} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top, fun a => by
simp only [ g . init_iff : ∀ {α : Type ?u.38595} {β : Type ?u.38596} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ) {a : α } {b : β },
s b (↑f a ) ↔ ∃ a' , ↑f a' = b ∧ r a' a init_iff, PrincipalSeg.down : ∀ {α : Type ?u.38652} {β : Type ?u.38653} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) {b : β },
s b f .top ↔ ∃ a , ↑f .toRelEmbedding a = b PrincipalSeg.down, exists_and_left : ∀ {α : Sort ?u.38677} {p : α → Prop } {b : Prop }, (∃ x , b ∧ p x ) ↔ b ∧ ∃ x , p x exists_and_left. symm : ∀ {a b : Prop }, (a ↔ b ) → (b ↔ a ) symm, exists_swap : ∀ {α : Sort ?u.38713} {β : Sort ?u.38712} {p : α → β → Prop }, (∃ x y , p x y ) ↔ ∃ y x , p x y exists_swap,
RelEmbedding.trans_apply , exists_eq_right' : ∀ {α : Sort ?u.38781} {p : α → Prop } {a' : α }, (∃ a , p a ∧ a' = a ) ↔ p a' exists_eq_right', InitialSeg.coe_coe_fn : ∀ {α : Type ?u.38799} {β : Type ?u.38800} {r : α → α → Prop } {s : β → β → Prop } (f : r ≼i s ), ↑f .toRelEmbedding = ↑f InitialSeg.coe_coe_fn] ⟩
#align principal_seg.lt_le PrincipalSeg.ltLe : {α : Type u_1} →
{β : Type u_2} →
{γ : Type u_3} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≺i s → s ≼i t → r ≺i t PrincipalSeg.ltLe
@[ simp ]
theorem lt_le_apply : ∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → α → Prop } {s : β → β → Prop } {t : γ → γ → Prop } (f : r ≺i s )
(g : s ≼i t ) (a : α ), ↑(ltLe f g ).toRelEmbedding a = ↑g (↑f .toRelEmbedding a ) lt_le_apply ( f : r ≺i s ) ( g : s ≼i t ) ( a : α ) : ( f . ltLe : {α : Type ?u.42879} →
{β : Type ?u.42878} →
{γ : Type ?u.42877} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≺i s → s ≼i t → r ≺i t ltLe g ) a = g ( f a ) :=
RelEmbedding.trans_apply _ _ _
#align principal_seg.lt_le_apply PrincipalSeg.lt_le_apply : ∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → α → Prop } {s : β → β → Prop } {t : γ → γ → Prop } (f : r ≺i s )
(g : s ≼i t ) (a : α ), ↑(ltLe f g ).toRelEmbedding a = ↑g (↑f .toRelEmbedding a ) PrincipalSeg.lt_le_apply
@[ simp ]
theorem lt_le_top : ∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → α → Prop } {s : β → β → Prop } {t : γ → γ → Prop } (f : r ≺i s )
(g : s ≼i t ), (ltLe f g ).top = ↑g f .top lt_le_top ( f : r ≺i s ) ( g : s ≼i t ) : ( f . ltLe : {α : Type ?u.43369} →
{β : Type ?u.43368} →
{γ : Type ?u.43367} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≺i s → s ≼i t → r ≺i t ltLe g ). top : {α : Type ?u.43415} → {β : Type ?u.43414} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top = g f . top : {α : Type ?u.43541} → {β : Type ?u.43540} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top :=
rfl : ∀ {α : Sort ?u.43554} {a : α }, a = a rfl
#align principal_seg.lt_le_top PrincipalSeg.lt_le_top : ∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → α → Prop } {s : β → β → Prop } {t : γ → γ → Prop } (f : r ≺i s )
(g : s ≼i t ), (ltLe f g ).top = ↑g f .top PrincipalSeg.lt_le_top
/-- Composition of two principal segments as a principal segment -/
@[trans]
protected def trans [ IsTrans γ t ] ( f : r ≺i s ) ( g : s ≺i t ) : r ≺i t :=
ltLe : {α : Type ?u.43695} →
{β : Type ?u.43694} →
{γ : Type ?u.43693} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≺i s → s ≼i t → r ≺i t ltLe f g
#align principal_seg.trans PrincipalSeg.trans
@[ simp ]
theorem trans_apply : ∀ [inst : IsTrans γ t ] (f : r ≺i s ) (g : s ≺i t ) (a : α ),
↑(PrincipalSeg.trans f g ).toRelEmbedding a = ↑g .toRelEmbedding (↑f .toRelEmbedding a ) trans_apply [ IsTrans γ t ] ( f : r ≺i s ) ( g : s ≺i t ) ( a : α ) : ( f . trans g ) a = g ( f a ) :=
lt_le_apply : ∀ {α : Type ?u.44265} {β : Type ?u.44266} {γ : Type ?u.44267} {r : α → α → Prop } {s : β → β → Prop } {t : γ → γ → Prop }
(f : r ≺i s ) (g : s ≼i t ) (a : α ), ↑(ltLe f g ).toRelEmbedding a = ↑g (↑f .toRelEmbedding a ) lt_le_apply _ _ _
#align principal_seg.trans_apply PrincipalSeg.trans_apply : ∀ {α : Type u_2} {β : Type u_3} {γ : Type u_1} {r : α → α → Prop } {s : β → β → Prop } {t : γ → γ → Prop }
[inst : IsTrans γ t ] (f : r ≺i s ) (g : s ≺i t ) (a : α ),
↑(PrincipalSeg.trans f g ).toRelEmbedding a = ↑g .toRelEmbedding (↑f .toRelEmbedding a ) PrincipalSeg.trans_apply
@[ simp ]
theorem trans_top [ IsTrans γ t ] ( f : r ≺i s ) ( g : s ≺i t ) : ( f . trans g ). top : {α : Type ?u.44560} → {β : Type ?u.44559} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top = g f . top : {α : Type ?u.44623} → {β : Type ?u.44622} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top :=
rfl : ∀ {α : Sort ?u.44637} {a : α }, a = a rfl
#align principal_seg.trans_top PrincipalSeg.trans_top
/-- Composition of an order isomorphism with a principal segment, as a principal segment -/
def equivLT : r ≃r s → s ≺i t → r ≺i t equivLT ( f : r ≃r s ) ( g : s ≺i t ) : r ≺i t :=
⟨@ RelEmbedding.trans : {α : Type ?u.44803} →
{β : Type ?u.44802} →
{γ : Type ?u.44801} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ↪r s → s ↪r t → r ↪r t RelEmbedding.trans _ _ _ r s t f g , g . top : {α : Type ?u.45587} → {β : Type ?u.45586} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top, fun c =>
suffices (∃ a : β , g a = c ) ↔ ∃ a : α , g ( f a ) = c by simpa [ PrincipalSeg.down : ∀ {α : Type ?u.46713} {β : Type ?u.46714} {r : α → α → Prop } {s : β → β → Prop } (f : r ≺i s ) {b : β },
s b f .top ↔ ∃ a , ↑f .toRelEmbedding a = b PrincipalSeg.down]
⟨ fun ⟨ b , h : ↑g .toRelEmbedding b = c h ⟩ => ⟨ f . symm : {α : Type ?u.45847} → {β : Type ?u.45846} → {r : α → α → Prop } → {s : β → β → Prop } → r ≃r s → s ≃r r symm b , by α : Type ?u.44694β : Type ?u.44697γ : Type ?u.44700r : α → α → Prop s : β → β → Prop t : γ → γ → Prop f : r ≃r s g : s ≺i t c : γ x✝ : ∃ a , ↑g .toRelEmbedding a = c b : β h : ↑g .toRelEmbedding b = c simp only [ h : ↑g .toRelEmbedding b = c h , RelIso.apply_symm_apply : ∀ {α : Type ?u.46351} {β : Type ?u.46352} {r : α → α → Prop } {s : β → β → Prop } (e : r ≃r s ) (x : β ),
↑e (↑(RelIso.symm e ) x ) = x RelIso.apply_symm_apply] ⟩,
fun ⟨ a , h : ↑g .toRelEmbedding (↑f a ) = c h ⟩ => ⟨ f a , h : ↑g .toRelEmbedding (↑f a ) = c h ⟩⟩⟩
#align principal_seg.equiv_lt PrincipalSeg.equivLT : {α : Type u_1} →
{β : Type u_2} →
{γ : Type u_3} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≃r s → s ≺i t → r ≺i t PrincipalSeg.equivLT
/-- Composition of a principal segment with an order isomorphism, as a principal segment -/
def ltEquiv : {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ≺i s → s ≃r t → r ≺i t ltEquiv { r : α → α → Prop } { s : β → β → Prop } { t : γ → γ → Prop } ( f : PrincipalSeg : {α : Type ?u.54794} → {β : Type ?u.54793} → (α → α → Prop ) → (β → β → Prop ) → Type (max?u.54794?u.54793) PrincipalSeg r s )
( g : s ≃r t ) : PrincipalSeg : {α : Type ?u.54830} → {β : Type ?u.54829} → (α → α → Prop ) → (β → β → Prop ) → Type (max?u.54830?u.54829) PrincipalSeg r t :=
⟨@ RelEmbedding.trans : {α : Type ?u.54878} →
{β : Type ?u.54877} →
{γ : Type ?u.54876} → {r : α → α → Prop } → {s : β → β → Prop } → {t : γ → γ → Prop } → r ↪r s → s ↪r t → r ↪r t RelEmbedding.trans _ _ _ r s t f g , g f . top : {α : Type ?u.55698} → {β : Type ?u.55697} → {r : α → α → Prop } → {s : β → β → Prop } → r ≺i s → β top, by
intro x