Skip to content

Commit

Permalink
formatting of Sum.lean
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeizer committed Dec 18, 2024
1 parent ea0cde1 commit 583858e
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions Qpf/PFunctor/Multivariate/Constructions/Sum.lean
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,25 @@ namespace Sum

universe u

def SumPFunctor : MvPFunctor.{u} 2
:= ⟨PFin2 2,
fun
| 0 => !![PFin2 1, PFin2 0] -- inl
| 1 => !![PFin2 0, PFin2 1] -- inr

def SumPFunctor : MvPFunctor.{u} 2 :=
⟨PFin2 2, fun
| 0 => !![PFin2 1, PFin2 0] -- inl
| 1 => !![PFin2 0, PFin2 1] -- inr

abbrev QpfSum' := SumPFunctor.Obj
abbrev QpfSum := TypeFun.curried QpfSum'

def inl {Γ : TypeVec 2} (a : Γ 1) : QpfSum' Γ
:= ⟨PFin2.ofNat' 0,
fun
| 1, _ => a

def inr {Γ : TypeVec 2} (b : Γ 0) : QpfSum' Γ
:= ⟨PFin2.ofNat' 1,
fun
| 0, _ => b
| 1, x => by cases x
def inl {Γ : TypeVec 2} (a : Γ 1) : QpfSum' Γ :=
⟨PFin2.ofNat' 0, fun
| 1, _ => a

def inr {Γ : TypeVec 2} (b : Γ 0) : QpfSum' Γ :=
⟨PFin2.ofNat' 1, fun
| 0, _ => b
| 1, (x : PFin2 _) => by cases x


def Sum' := @TypeFun.ofCurried 2 Sum
Expand Down

0 comments on commit 583858e

Please sign in to comment.