File: Mathlib/Order/CountableDenseLinearOrder.lean

full_name: Order.exists_between_finsets
code: /-- Suppose `α` is a nonempty dense linear order without endpoints, and
    suppose `lo`, `hi`, are finite subsets with all of `lo` strictly
    before `hi`. Then there is an element of `α` strictly between `lo`
    and `hi`. -/
theorem exists_between_finsets {α : Type*} [LinearOrder α] [DenselyOrdered α] [NoMinOrder α]
    [NoMaxOrder α] [nonem : Nonempty α] (lo hi : Finset α) (lo_lt_hi : ∀ x ∈ lo, ∀ y ∈ hi, x < y) :
    ∃ m : α, (∀ x ∈ lo, x < m) ∧ ∀ y ∈ hi, m < y 
goal: ∃ m, (∀ x ∈ lo, x < m) ∧ ∀ y ∈ hi, m < y

full_name: Order.PartialIso
code: /-- The type of partial order isomorphisms between `α` and `β` defined on finite subsets.
    A partial order isomorphism is encoded as a finite subset of `α × β`, consisting
    of pairs which should be identified. -/
def PartialIso : Type _ 
goal: Type (max u_1 u_2)

full_name: Order.PartialIso.instInhabited
code: instance : Inhabited (PartialIso α β) 
goal: Inhabited (Order.PartialIso α β)

full_name: Order.PartialIso.instPreorder
code: instance : Preorder (PartialIso α β) 
goal: Preorder (Order.PartialIso α β)

full_name: Order.PartialIso.exists_across
code: /-- For each `a`, we can find a `b` in the codomain, such that `a`'s relation to
the domain of `f` is `b`'s relation to the image of `f`.

Thus, if `a` is not already in `f`, then we can extend `f` by sending `a` to `b`.
-/
theorem exists_across [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β]
    (f : PartialIso α β) (a : α) :
    ∃ b : β, ∀ p ∈ f.val, cmp (Prod.fst p) a = cmp (Prod.snd p) b 
goal: ∃ b, ∀ p ∈ ↑f, cmp p.1 a = cmp p.2 b

full_name: Order.PartialIso.comm
code: /-- A partial isomorphism between `α` and `β` is also a partial isomorphism between `β` and `α`. -/
protected def comm : PartialIso α β → PartialIso β α 
goal: Order.PartialIso α β → Order.PartialIso β α

full_name: Order.PartialIso.definedAtLeft
code: /-- The set of partial isomorphisms defined at `a : α`, together with a proof that any
    partial isomorphism can be extended to one defined at `a`. -/
def definedAtLeft [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] (a : α) :
    Cofinal (PartialIso α β) 
goal: Order.Cofinal (Order.PartialIso α β)

full_name: Order.PartialIso.definedAtRight
code: /-- The set of partial isomorphisms defined at `b : β`, together with a proof that any
    partial isomorphism can be extended to include `b`. We prove this by symmetry. -/
def definedAtRight [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [Nonempty α] (b : β) :
    Cofinal (PartialIso α β) 
goal: Order.Cofinal (Order.PartialIso α β)

full_name: Order.PartialIso.funOfIdeal
code: /-- Given an ideal which intersects `definedAtLeft β a`, pick `b : β` such that
    some partial function in the ideal maps `a` to `b`. -/
def funOfIdeal [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] (a : α)
    (I : Ideal (PartialIso α β)) :
    (∃ f, f ∈ definedAtLeft β a ∧ f ∈ I) → { b // ∃ f ∈ I, (a, b) ∈ Subtype.val f } 
goal: (∃ f ∈ Order.PartialIso.definedAtLeft β a, f ∈ I) → { b // ∃ f ∈ I, (a, b) ∈ ↑f }

full_name: Order.PartialIso.invOfIdeal
code: /-- Given an ideal which intersects `definedAtRight α b`, pick `a : α` such that
    some partial function in the ideal maps `a` to `b`. -/
def invOfIdeal [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [Nonempty α] (b : β)
    (I : Ideal (PartialIso α β)) :
    (∃ f, f ∈ definedAtRight α b ∧ f ∈ I) → { a // ∃ f ∈ I, (a, b) ∈ Subtype.val f } 
goal: (∃ f ∈ Order.PartialIso.definedAtRight α b, f ∈ I) → { a // ∃ f ∈ I, (a, b) ∈ ↑f }

full_name: Order.embedding_from_countable_to_dense
code: /-- Any countable linear order embeds in any nontrivial dense linear order. -/
theorem embedding_from_countable_to_dense [Countable α] [DenselyOrdered β] [Nontrivial β] :
    Nonempty (α ↪o β) 
goal: Nonempty (α ↪o β)

full_name: Order.iso_of_countable_dense
code: /-- Any two countable dense, nonempty linear orders without endpoints are order isomorphic. -/
theorem iso_of_countable_dense [Countable α] [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α]
    [Nonempty α] [Countable β] [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] :
    Nonempty (α ≃o β) 
goal: Nonempty (α ≃o β)