# 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_iff {α : Type u_3} (x : ) (y : ) :
x = y x.fst = y.fst x.snd = y.snd
theorem TwoPointing.ext {α : Type u_3} (x : ) (y : ) (fst : x.fst = y.fst) (snd : x.snd = y.snd) :
x = y
structure TwoPointing (α : Type u_3) extends :
Type u_3

Two-pointing of a type. This is a Type-valued termed Nontrivial.

• fst : α
• snd : α
• fst_ne_snd : self.fst self.snd

fst and snd are distinct terms

Instances For
theorem TwoPointing.fst_ne_snd {α : Type u_3} (self : ) :
self.fst self.snd

fst and snd are distinct terms

instance instDecidableEqTwoPointing :
{α : Type u_3} → [inst : ] →
Equations
• instDecidableEqTwoPointing = decEqTwoPointing✝
theorem TwoPointing.snd_ne_fst {α : Type u_1} (p : ) :
p.snd p.fst
@[simp]
theorem TwoPointing.swap_toProd {α : Type u_1} (p : ) :
p.swap.toProd = (p.snd, p.fst)
def TwoPointing.swap {α : Type u_1} (p : ) :

Swaps the two pointed elements.

Equations
• p.swap = { toProd := (p.snd, p.fst), fst_ne_snd := }
Instances For
theorem TwoPointing.swap_fst {α : Type u_1} (p : ) :
p.swap.fst = p.snd
theorem TwoPointing.swap_snd {α : Type u_1} (p : ) :
p.swap.snd = p.fst
@[simp]
theorem TwoPointing.swap_swap {α : Type u_1} (p : ) :
p.swap.swap = p
theorem TwoPointing.to_nontrivial {α : Type u_1} (p : ) :
Equations
• =
def TwoPointing.pi (α : Type u_1) {β : Type u_2} (q : ) [] :
TwoPointing (αβ)

The two-pointing of constant functions.

Equations
• = { toProd := (fun (x : α) => q.fst, fun (x : α) => q.snd), fst_ne_snd := }
Instances For
@[simp]
theorem TwoPointing.pi_fst (α : Type u_1) {β : Type u_2} (q : ) [] :
().fst = Function.const α q.fst
@[simp]
theorem TwoPointing.pi_snd (α : Type u_1) {β : Type u_2} (q : ) [] :
().snd = Function.const α q.snd
def TwoPointing.prod {α : Type u_1} {β : Type u_2} (p : ) (q : ) :
TwoPointing (α × β)

The product of two two-pointings.

Equations
• p.prod q = { toProd := ((p.fst, q.fst), p.snd, q.snd), fst_ne_snd := }
Instances For
@[simp]
theorem TwoPointing.prod_fst {α : Type u_1} {β : Type u_2} (p : ) (q : ) :
(p.prod q).fst = (p.fst, q.fst)
@[simp]
theorem TwoPointing.prod_snd {α : Type u_1} {β : Type u_2} (p : ) (q : ) :
(p.prod q).snd = (p.snd, q.snd)
def TwoPointing.sum {α : Type u_1} {β : Type u_2} (p : ) (q : ) :

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 : ) (q : ) :
(p.sum q).fst = Sum.inl p.fst
@[simp]
theorem TwoPointing.sum_snd {α : Type u_1} {β : Type u_2} (p : ) (q : ) :
(p.sum q).snd = Sum.inr q.snd

The false, true two-pointing of Bool.

Equations
Instances For
@[simp]
@[simp]

The False, True two-pointing of Prop.

Equations
Instances For
@[simp]
@[simp]