mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
progress on exponentials
This commit is contained in:
parent
85195b13d0
commit
d3b63f632d
1 changed files with 82 additions and 17 deletions
|
@ -313,24 +313,89 @@ module Category.Construction.ElgotAlgebras {o ℓ e} {C : Category o ℓ e} wher
|
|||
[ (id +₁ i₁) ∘ (eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ (f ⁂ id) , i₂ ∘ distributeʳ⁻¹ ∘ (h ⁂ id) ] ≈˘⟨ cancelʳ (IsIso.isoˡ isIsoʳ) ⟩
|
||||
([ (id +₁ i₁) ∘ (eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ (f ⁂ id) , i₂ ∘ distributeʳ⁻¹ ∘ (h ⁂ id) ] ∘ distributeʳ⁻¹) ∘ distributeʳ ∎)
|
||||
|
||||
<_> = Elgot-Algebra-Morphism.h
|
||||
|
||||
cccc : CanonicalCartesianClosed Elgot-Algebras
|
||||
cccc = record
|
||||
{ ⊤ = Terminal.⊤ Terminal-Elgot-Algebras
|
||||
; _×_ = λ X Y → A×B-Helper {X} {Y}
|
||||
; ! = Terminal.! Terminal-Elgot-Algebras
|
||||
; π₁ = λ {X} {Y} → Product.π₁ (Product-Elgot-Algebras X Y)
|
||||
; π₂ = λ {X} {Y} → Product.π₂ (Product-Elgot-Algebras X Y)
|
||||
; ⟨_,_⟩ = λ {X} {Y} {Z} f g → Product.⟨_,_⟩ (Product-Elgot-Algebras Y Z) f g
|
||||
; !-unique = Terminal.!-unique Terminal-Elgot-Algebras
|
||||
; π₁-comp = λ {X} {Y} {f} {Z} {g} → Product.project₁ (Product-Elgot-Algebras Y Z) {h = f} {i = g}
|
||||
; π₂-comp = λ {X} {Y} {f} {Z} {g} → Product.project₂ (Product-Elgot-Algebras Y Z) {h = f} {i = g}
|
||||
; ⟨,⟩-unique = {! !}
|
||||
; _^_ = {! !}
|
||||
; eval = {! !}
|
||||
; curry = {! !}
|
||||
; eval-comp = {! !}
|
||||
; curry-unique = {! !}
|
||||
}
|
||||
CanonicalCartesianClosed.⊤ cccc = Terminal.⊤ Terminal-Elgot-Algebras
|
||||
CanonicalCartesianClosed._×_ cccc X Y = A×B-Helper {X} {Y}
|
||||
CanonicalCartesianClosed.! cccc = Terminal.! Terminal-Elgot-Algebras
|
||||
CanonicalCartesianClosed.π₁ cccc {X} {Y} = Product.π₁ (Product-Elgot-Algebras X Y)
|
||||
CanonicalCartesianClosed.π₂ cccc {X} {Y} = Product.π₂ (Product-Elgot-Algebras X Y)
|
||||
CanonicalCartesianClosed.⟨_,_⟩ cccc {X} {Y} {Z} f g = Product.⟨_,_⟩ (Product-Elgot-Algebras Y Z) f g
|
||||
CanonicalCartesianClosed.!-unique cccc = Terminal.!-unique Terminal-Elgot-Algebras
|
||||
CanonicalCartesianClosed.π₁-comp cccc {X} {Y} {f} {Z} {g} = Product.project₁ (Product-Elgot-Algebras Y Z) {h = f} {i = g}
|
||||
CanonicalCartesianClosed.π₂-comp cccc {X} {Y} {f} {Z} {g} = Product.project₂ (Product-Elgot-Algebras Y Z) {h = f} {i = g}
|
||||
CanonicalCartesianClosed.⟨,⟩-unique cccc {C} {A} {B} {f} {g} {h} eq₁ eq₂ = Product.unique (Product-Elgot-Algebras A B) {h = h} {i = f} {j = g} eq₁ eq₂
|
||||
CanonicalCartesianClosed._^_ cccc A X = B^A-Helper {A} {Elgot-Algebra.A X}
|
||||
(Elgot-Algebra-Morphism.h) (CanonicalCartesianClosed.eval cccc {A} {B}) = eval′
|
||||
(Elgot-Algebra-Morphism.preserves) (CanonicalCartesianClosed.eval cccc {A} {B}) {X} {f} = begin
|
||||
eval′ ∘ ⟨ (λg ((Elgot-Algebra._# A) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id)))) , _ ⟩ ≈˘⟨ refl⟩∘⟨ (⁂∘⟨⟩ ○ ⟨⟩-cong₂ identityʳ identityˡ) ⟩
|
||||
eval′ ∘ ((λg ((Elgot-Algebra._# A) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id)))) ⁂ id) ∘ ⟨ id , _ ⟩ ≈⟨ pullˡ β′ ⟩
|
||||
((Elgot-Algebra._# A) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id))) ∘ ⟨ id , _ ⟩ ≈˘⟨ Elgot-Algebra.#-Uniformity A by-uni ⟩
|
||||
(Elgot-Algebra._# A) ((eval′ +₁ id) ∘ f) ∎ -- ⟨ ((π₁ +₁ id) ∘ h)#ᵃ , ((π₂ +₁ id) ∘ h)#ᵇ ⟩
|
||||
where
|
||||
by-uni : (id +₁ ⟨ id , _ ⟩) ∘ ((eval′ +₁ id) ∘ f) ≈ ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id)) ∘ ⟨ id , _ ⟩
|
||||
by-uni = begin
|
||||
(id +₁ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩) ∘ ((eval′ +₁ id) ∘ f) ≈⟨ pullˡ (+₁∘+₁ ○ +₁-cong₂ identityˡ identityʳ) ⟩
|
||||
(eval′ +₁ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩) ∘ f ≈˘⟨ sym-assoc ○ sym-assoc ○ (sym (+-unique by-inj₁ by-inj₂)) ⟩∘⟨refl ⟩
|
||||
(eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹) ∘ ⟨ id , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id) ⟩ ∘ f ≈⟨ refl⟩∘⟨ refl⟩∘⟨ (⟨⟩∘ ○ ⟨⟩-cong₂ refl assoc) ⟩
|
||||
(eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹) ∘ ⟨ id ∘ f , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id) ∘ f ⟩ ≈˘⟨ refl⟩∘⟨ (refl⟩∘⟨ (⟨⟩-cong₂ refl (Elgot-Algebra.#-Fixpoint B))) ⟩
|
||||
(eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹) ∘ ⟨ id ∘ f , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈˘⟨ pullʳ (pullʳ (⁂∘⟨⟩ ○ ⟨⟩-cong₂ id-comm identityˡ)) ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹) ∘ (f ⁂ id)) ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈˘⟨ (refl⟩∘⟨ (pullˡ (sym (distributeʳ⁻¹-natural id π₁ id)))) ⟩∘⟨refl ⟩
|
||||
((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ⁂ id) ∘ (f ⁂ id)) ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈⟨ (refl⟩∘⟨ refl⟩∘⟨ (⁂∘⁂ ○ ⁂-cong₂ refl identity²)) ⟩∘⟨refl ⟩
|
||||
((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id)) ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ∎
|
||||
where
|
||||
by-inj₁ : (((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ id , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id) ⟩) ∘ i₁ ≈ i₁ ∘ eval′
|
||||
by-inj₁ = begin
|
||||
(((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ id , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id) ⟩) ∘ i₁ ≈⟨ pullʳ ⟨⟩∘ ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ id ∘ i₁ , ([ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id)) ∘ i₁ ⟩ ≈⟨ refl⟩∘⟨ (⟨⟩-cong₂ id-comm-sym (pullʳ inject₁ ○ pullˡ inject₁ ○ identityˡ)) ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ i₁ ∘ id , π₂ ⟩ ≈˘⟨ refl⟩∘⟨ (⁂∘⟨⟩ ○ ⟨⟩-cong₂ refl identityˡ) ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ (i₁ ⁂ id) ∘ ⟨ id , π₂ ⟩ ≈⟨ pullʳ (pullʳ (pullˡ distributeʳ⁻¹-i₁)) ⟩
|
||||
(eval′ +₁ id) ∘ (π₁ ⁂ id +₁ id ⁂ id) ∘ i₁ ∘ ⟨ id , π₂ ⟩ ≈⟨ refl⟩∘⟨ (pullˡ +₁∘i₁) ⟩
|
||||
(eval′ +₁ id) ∘ (i₁ ∘ (π₁ ⁂ id)) ∘ ⟨ id , π₂ ⟩ ≈⟨ pullˡ (pullˡ +₁∘i₁) ⟩
|
||||
((i₁ ∘ eval′) ∘ (π₁ ⁂ id)) ∘ ⟨ id , π₂ ⟩ ≈⟨ cancelʳ (⁂∘⟨⟩ ○ (⟨⟩-cong₂ identityʳ identityˡ) ○ ⟨⟩-unique identityʳ identityʳ) ⟩
|
||||
i₁ ∘ eval′ ∎
|
||||
by-inj₂ : (((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ id , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id) ⟩) ∘ i₂ ≈ i₂ ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩
|
||||
by-inj₂ = begin
|
||||
(((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ id , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ (π₂ +₁ id) ⟩) ∘ i₂ ≈⟨ pullʳ (⟨⟩∘ ○ ⟨⟩-cong₂ id-comm-sym (pullʳ inject₂)) ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ i₂ ∘ id , [ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ] ∘ i₂ ∘ id ⟩ ≈⟨ refl⟩∘⟨ (⟨⟩-cong₂ refl (refl⟩∘⟨ identityʳ ○ inject₂)) ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ ⟨ i₂ ∘ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈˘⟨ refl⟩∘⟨ (⁂∘⟨⟩ ○ ⟨⟩-cong₂ refl identityˡ) ⟩
|
||||
((eval′ +₁ id) ∘ ((π₁ ⁂ id +₁ id ⁂ id) ∘ distributeʳ⁻¹)) ∘ (i₂ ⁂ id) ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈⟨ pullʳ (pullʳ (pullˡ distributeʳ⁻¹-i₂)) ⟩
|
||||
(eval′ +₁ id) ∘ (π₁ ⁂ id +₁ id ⁂ id) ∘ i₂ ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈⟨ refl⟩∘⟨ (pullˡ inject₂) ⟩
|
||||
(eval′ +₁ id) ∘ (i₂ ∘ (id ⁂ id)) ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈⟨ pullˡ (pullˡ inject₂) ⟩
|
||||
((i₂ ∘ id) ∘ (id ⁂ id)) ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ≈⟨ (cancelʳ (identityˡ ○ ⟨⟩-unique id-comm id-comm)) ⟩∘⟨refl ⟩
|
||||
i₂ ∘ ⟨ id , (Elgot-Algebra._# B) ((π₂ +₁ id) ∘ f) ⟩ ∎
|
||||
Elgot-Algebra-Morphism.h (CanonicalCartesianClosed.curry cccc {A} {B} {C} f) = λg < f >
|
||||
Elgot-Algebra-Morphism.preserves (CanonicalCartesianClosed.curry cccc {A} {B} {C} f) {X} {g} = begin
|
||||
λg < f > ∘ (Elgot-Algebra._# A) g ≈⟨ {! !} ⟩
|
||||
{! !} ≈⟨ {! !} ⟩
|
||||
{! !} ≈⟨ {! !} ⟩
|
||||
{! !} ≈⟨ {! !} ⟩
|
||||
{! !} ≈⟨ {! !} ⟩
|
||||
λg ((Elgot-Algebra._# C) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ (((λg < f > +₁ id) ∘ g) ⁂ id))) ∎
|
||||
CanonicalCartesianClosed.eval-comp cccc {A} {B} {C} {f} = {! !}
|
||||
CanonicalCartesianClosed.curry-unique cccc {A} {B} {C} {f} {g} eq = {! !}
|
||||
-- record
|
||||
-- { ⊤ = Terminal.⊤ Terminal-Elgot-Algebras
|
||||
-- ; _×_ = λ X Y → A×B-Helper {X} {Y}
|
||||
-- ; ! = Terminal.! Terminal-Elgot-Algebras
|
||||
-- ; π₁ = λ {X} {Y} → Product.π₁ (Product-Elgot-Algebras X Y)
|
||||
-- ; π₂ = λ {X} {Y} → Product.π₂ (Product-Elgot-Algebras X Y)
|
||||
-- ; ⟨_,_⟩ = λ {X} {Y} {Z} f g → Product.⟨_,_⟩ (Product-Elgot-Algebras Y Z) f g
|
||||
-- ; !-unique = Terminal.!-unique Terminal-Elgot-Algebras
|
||||
-- ; π₁-comp = λ {X} {Y} {f} {Z} {g} → Product.project₁ (Product-Elgot-Algebras Y Z) {h = f} {i = g}
|
||||
-- ; π₂-comp = λ {X} {Y} {f} {Z} {g} → Product.project₂ (Product-Elgot-Algebras Y Z) {h = f} {i = g}
|
||||
-- ; ⟨,⟩-unique = λ {C} {A} {B} {f} {g} {h} eq₁ eq₂ → Product.unique (Product-Elgot-Algebras A B) {h = h} {i = f} {j = g} eq₁ eq₂
|
||||
-- ; _^_ = λ A X → B^A-Helper {A} {Elgot-Algebra.A X}
|
||||
-- ; eval = λ {A} {B} → record { h = eval′ ; preserves = λ {X} {f} → begin
|
||||
-- eval′ ∘ ⟨ (λg ((Elgot-Algebra._# A) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id)))) , _ ⟩ ≈˘⟨ refl⟩∘⟨ (⁂∘⟨⟩ ○ ⟨⟩-cong₂ identityʳ identityˡ) ⟩
|
||||
-- eval′ ∘ ((λg ((Elgot-Algebra._# A) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id)))) ⁂ id) ∘ ⟨ id , _ ⟩ ≈⟨ pullˡ β′ ⟩
|
||||
-- ((Elgot-Algebra._# A) ((eval′ +₁ id) ∘ distributeʳ⁻¹ ∘ ((π₁ +₁ id) ∘ f ⁂ id))) ∘ ⟨ id , _ ⟩ ≈⟨ {! !} ⟩
|
||||
-- (Elgot-Algebra._# A) ((eval′ +₁ id) ∘ f) ∎ } -- ⟨ ((π₁ +₁ id) ∘ h)#ᵃ , ((π₂ +₁ id) ∘ h)#ᵇ ⟩
|
||||
-- ; curry = λ {C} {A} {B} f → record { h = λg (Elgot-Algebra-Morphism.h f) ; preserves = {! !} }
|
||||
-- ; eval-comp = λ {A} {B} {C} {f} → {! !}
|
||||
-- ; curry-unique = λ {A} {B} {C} {f} {g} eq → {! !}
|
||||
-- }
|
||||
|
||||
Exponential-Elgot-Algebras : ∀ (EA EB : Elgot-Algebra) → Exponential Elgot-Algebras EA EB
|
||||
Exponential-Elgot-Algebras EA EB = record
|
||||
|
|
Loading…
Reference in a new issue