Two-pointings #
This file defines TwoPointing α
, the type of two pointings of α
. A two-pointing is the data of
two distinct terms.
This is morally a Type-valued Nontrivial
. Another type which is quite close in essence is Sym2
.
Categorically speaking, prod
is a cospan in the category of types. This forms the category of
bipointed types. Two-pointed types form a full subcategory of those.
References #
- [nLab, Coalgebra of the real interval] (https://ncatlab.org/nlab/show/coalgebra+of+the+real+interval)
theorem
TwoPointing.ext
{α : Type u_3}
(x : TwoPointing α)
(y : TwoPointing α)
(fst : x.fst = y.fst)
(snd : x.snd = y.snd)
:
x = y
Two-pointing of a type. This is a Type-valued termed Nontrivial
.
- fst : α
- snd : α
- fst_ne_snd : self.fst ≠ self.snd
fst
andsnd
are distinct terms
Instances For
instance
instDecidableEqTwoPointing :
{α : Type u_3} → [inst : DecidableEq α] → DecidableEq (TwoPointing α)
Equations
- instDecidableEqTwoPointing = decEqTwoPointing✝
@[simp]
theorem
TwoPointing.swap_toProd
{α : Type u_1}
(p : TwoPointing α)
:
(TwoPointing.swap p).toProd = (p.snd, p.fst)
Swaps the two pointed elements.
Equations
- TwoPointing.swap p = { toProd := (p.snd, p.fst), fst_ne_snd := (_ : p.snd ≠ p.fst) }
Instances For
theorem
TwoPointing.swap_fst
{α : Type u_1}
(p : TwoPointing α)
:
(TwoPointing.swap p).toProd.fst = p.snd
theorem
TwoPointing.swap_snd
{α : Type u_1}
(p : TwoPointing α)
:
(TwoPointing.swap p).toProd.snd = p.fst
@[simp]
@[reducible]
instance
TwoPointing.instNonemptyTwoPointing
{α : Type u_1}
[Nontrivial α]
:
Nonempty (TwoPointing α)
Equations
- (_ : Nonempty (TwoPointing α)) = (_ : Nonempty (TwoPointing α))
@[simp]
theorem
TwoPointing.nonempty_two_pointing_iff
{α : Type u_1}
:
Nonempty (TwoPointing α) ↔ Nontrivial α
def
TwoPointing.pi
(α : Type u_1)
{β : Type u_2}
(q : TwoPointing β)
[Nonempty α]
:
TwoPointing (α → β)
The two-pointing of constant functions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
TwoPointing.pi_fst
(α : Type u_1)
{β : Type u_2}
(q : TwoPointing β)
[Nonempty α]
:
(TwoPointing.pi α q).toProd.fst = Function.const α q.fst
@[simp]
theorem
TwoPointing.pi_snd
(α : Type u_1)
{β : Type u_2}
(q : TwoPointing β)
[Nonempty α]
:
(TwoPointing.pi α q).toProd.snd = Function.const α q.snd
def
TwoPointing.prod
{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)
:
TwoPointing (α × β)
The product of two two-pointings.
Equations
- TwoPointing.prod p q = { toProd := ((p.fst, q.fst), p.snd, q.snd), fst_ne_snd := (_ : ((p.fst, q.fst), p.snd, q.snd).fst = ((p.fst, q.fst), p.snd, q.snd).snd → False) }
Instances For
@[simp]
theorem
TwoPointing.prod_fst
{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)
:
(TwoPointing.prod p q).toProd.fst = (p.fst, q.fst)
@[simp]
theorem
TwoPointing.prod_snd
{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)
:
(TwoPointing.prod p q).toProd.snd = (p.snd, q.snd)
def
TwoPointing.sum
{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)
:
TwoPointing (α ⊕ β)
The sum of two pointings. Keeps the first point from the left and the second point from the right.
Equations
Instances For
@[simp]
theorem
TwoPointing.sum_fst
{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)
:
(TwoPointing.sum p q).toProd.fst = Sum.inl p.fst
@[simp]
theorem
TwoPointing.sum_snd
{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)
:
(TwoPointing.sum p q).toProd.snd = Sum.inr q.snd
The false
, true
two-pointing of Bool
.
Equations
- TwoPointing.bool = { toProd := (false, true), fst_ne_snd := Bool.false_ne_true }
Instances For
Equations
- TwoPointing.instInhabitedTwoPointingBool = { default := TwoPointing.bool }
The False
, True
two-pointing of Prop
.
Equations
- TwoPointing.prop = { toProd := (False, True), fst_ne_snd := false_ne_true }