From 6add58340d6eef998d5cd332055e14f445552717 Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Mon, 24 Jul 2023 12:50:20 +0200 Subject: [PATCH] Worked on products of elgot algebras --- ElgotAlgebra.agda | 67 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/ElgotAlgebra.agda b/ElgotAlgebra.agda index 7b43509..d57c496 100644 --- a/ElgotAlgebra.agda +++ b/ElgotAlgebra.agda @@ -173,21 +173,74 @@ module _ {Cπ’ž : CocartesianCategory o β„“ e} where -- product elgot-algebras Product-Elgot-Algebra : βˆ€ {EA EB : Elgot-Algebra} β†’ Product π’ž (Elgot-Algebra.A EA) (Elgot-Algebra.A EB) β†’ Elgot-Algebra - Product-Elgot-Algebra {EA} {EB} p = record + Product-Elgot-Algebra {EA} {EB} p = record { A = AΓ—B - ; _# = Ξ» {X : Obj} (h : X β‡’ AΓ—B + X) β†’ ⟨ ((π₁ +₁ idC) ∘ h)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ h)#ᡇ ⟩ + ; _# = Ξ» {X : Obj} (h : X β‡’ AΓ—B + X) β†’ ⟨ ((π₁ +₁ idC) ∘ h)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ h)#ᡇ ⟩ ; #-Fixpoint = Ξ» {X} {f} β†’ begin - ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ β‰ˆβŸ¨ {! !} ⟩ -- maybe use fixpoint on each side of pair.. - ([ idC , ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ ] ∘ f) ∎ -- TODO - ; #-Uniformity = _ -- TODO + ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ β‰ˆβŸ¨ ⟨⟩-congβ‚‚ #ᡃ-Fixpoint #ᡇ-Fixpoint ⟩ + ⟨ [ idC , ((π₁ +₁ idC) ∘ f)#ᡃ ] ∘ ((π₁ +₁ idC) ∘ f) , [ idC , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ] ∘ ((Ο€β‚‚ +₁ idC) ∘ f) ⟩ β‰ˆβŸ¨ ⟨⟩-congβ‚‚ sym-assoc sym-assoc ⟩ + ⟨ ([ idC , ((π₁ +₁ idC) ∘ f)#ᡃ ] ∘ (π₁ +₁ idC)) ∘ f , ([ idC , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ] ∘ (Ο€β‚‚ +₁ idC)) ∘ f ⟩ β‰ˆβŸ¨ ⟨⟩-congβ‚‚ (∘-resp-β‰ˆΛ‘ []∘+₁) (∘-resp-β‰ˆΛ‘ []∘+₁) ⟩ + ⟨ [ idC ∘ π₁ , ((π₁ +₁ idC) ∘ f)#ᡃ ∘ idC ] ∘ f , [ idC ∘ Ο€β‚‚ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ∘ idC ] ∘ f ⟩ β‰ˆβŸ¨ sym ∘-distribΚ³-⟨⟩ ⟩ + (⟨ [ idC ∘ π₁ , ((π₁ +₁ idC) ∘ f)#ᡃ ∘ idC ] , [ idC ∘ Ο€β‚‚ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ∘ idC ] ⟩ ∘ f) β‰ˆβŸ¨ ∘-resp-β‰ˆΛ‘ (uniqueβ€² + (begin + π₁ ∘ ⟨ [ idC ∘ π₁ , ((π₁ +₁ idC) ∘ f)#ᡃ ∘ idC ] , [ idC ∘ Ο€β‚‚ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ∘ idC ] ⟩ β‰ˆβŸ¨ project₁ ⟩ + [ idC ∘ π₁ , ((π₁ +₁ idC) ∘ f)#ᡃ ∘ idC ] β‰ˆβŸ¨ []-congβ‚‚ identityΛ‘ identityΚ³ ⟩ + [ π₁ , ((π₁ +₁ idC) ∘ f)#ᡃ ] β‰ˆβŸ¨ sym ([]-congβ‚‚ identityΚ³ project₁) ⟩ + [ π₁ ∘ idC , π₁ ∘ ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ ] β‰ˆβŸ¨ sym ∘[] ⟩ + π₁ ∘ [ idC , ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ ] ∎) + (begin + Ο€β‚‚ ∘ ⟨ [ idC ∘ π₁ , ((π₁ +₁ idC) ∘ f)#ᡃ ∘ idC ] , [ idC ∘ Ο€β‚‚ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ∘ idC ] ⟩ β‰ˆβŸ¨ projectβ‚‚ ⟩ + [ idC ∘ Ο€β‚‚ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ∘ idC ] β‰ˆβŸ¨ []-congβ‚‚ identityΛ‘ identityΚ³ ⟩ + [ Ο€β‚‚ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ] β‰ˆβŸ¨ sym ([]-congβ‚‚ identityΚ³ projectβ‚‚) ⟩ + [ Ο€β‚‚ ∘ idC , Ο€β‚‚ ∘ ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ ] β‰ˆβŸ¨ sym ∘[] ⟩ + Ο€β‚‚ ∘ [ idC , ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ ] ∎) )⟩ + ([ idC , ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ ] ∘ f) ∎ + ; #-Uniformity = Ξ» {X Y f g h} uni β†’ uniqueβ€² ( + begin + π₁ ∘ ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ β‰ˆβŸ¨ project₁ ⟩ + (((π₁ +₁ idC) ∘ f)#ᡃ) β‰ˆβŸ¨ #ᡃ-Uniformity ( + begin + (idC +₁ h) ∘ (π₁ +₁ idC) ∘ f β‰ˆβŸ¨ sym-assoc ⟩ + ((idC +₁ h) ∘ (π₁ +₁ idC)) ∘ f β‰ˆβŸ¨ ∘-resp-β‰ˆΛ‘ +β‚βˆ˜+₁ ⟩ + (idC ∘ π₁ +₁ h ∘ idC) ∘ f β‰ˆβŸ¨ ∘-resp-β‰ˆΛ‘ (+₁-congβ‚‚ identityΛ‘ identityΚ³) ⟩ + ((π₁ +₁ h) ∘ f) β‰ˆβŸ¨ sym (∘-resp-β‰ˆΛ‘ (+₁-congβ‚‚ identityΚ³ identityΛ‘)) ⟩ + (((π₁ ∘ idC +₁ idC ∘ h)) ∘ f) β‰ˆβŸ¨ sym (∘-resp-β‰ˆΛ‘ +β‚βˆ˜+₁) ⟩ + ((π₁ +₁ idC) ∘ (idC +₁ h)) ∘ f β‰ˆβŸ¨ assoc ⟩ + (π₁ +₁ idC) ∘ ((idC +₁ h) ∘ f) β‰ˆβŸ¨ ∘-resp-β‰ˆΚ³ uni ⟩ + (π₁ +₁ idC) ∘ g ∘ h β‰ˆβŸ¨ sym-assoc ⟩ + ((π₁ +₁ idC) ∘ g) ∘ h ∎ + )⟩ + (((π₁ +₁ idC) ∘ g)#ᡃ ∘ h) β‰ˆβŸ¨ sym (∘-resp-β‰ˆΛ‘ project₁) ⟩ + ((π₁ ∘ ⟨ ((π₁ +₁ idC) ∘ g)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ g)#ᡇ ⟩) ∘ h) β‰ˆβŸ¨ assoc ⟩ + π₁ ∘ ⟨ ((π₁ +₁ idC) ∘ g)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ g)#ᡇ ⟩ ∘ h ∎ + ) ( + begin + Ο€β‚‚ ∘ ⟨ ((π₁ +₁ idC) ∘ f)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ ⟩ β‰ˆβŸ¨ projectβ‚‚ ⟩ + ((Ο€β‚‚ +₁ idC) ∘ f)#ᡇ β‰ˆβŸ¨ #ᡇ-Uniformity ( + begin + (idC +₁ h) ∘ (Ο€β‚‚ +₁ idC) ∘ f β‰ˆβŸ¨ sym-assoc ⟩ + (((idC +₁ h) ∘ (Ο€β‚‚ +₁ idC)) ∘ f) β‰ˆβŸ¨ ∘-resp-β‰ˆΛ‘ +β‚βˆ˜+₁ ⟩ + ((idC ∘ Ο€β‚‚ +₁ h ∘ idC) ∘ f) β‰ˆβŸ¨ ∘-resp-β‰ˆΛ‘ (+₁-congβ‚‚ identityΛ‘ identityΚ³) ⟩ + ((Ο€β‚‚ +₁ h) ∘ f) β‰ˆβŸ¨ sym (∘-resp-β‰ˆΛ‘ (+₁-congβ‚‚ identityΚ³ identityΛ‘)) ⟩ + ((((Ο€β‚‚ ∘ idC +₁ idC ∘ h)) ∘ f)) β‰ˆβŸ¨ sym (∘-resp-β‰ˆΛ‘ +β‚βˆ˜+₁) ⟩ + ((Ο€β‚‚ +₁ idC) ∘ ((idC +₁ h))) ∘ f β‰ˆβŸ¨ assoc ⟩ + (Ο€β‚‚ +₁ idC) ∘ ((idC +₁ h)) ∘ f β‰ˆβŸ¨ ∘-resp-β‰ˆΚ³ uni ⟩ + (Ο€β‚‚ +₁ idC) ∘ g ∘ h β‰ˆβŸ¨ sym-assoc ⟩ + ((Ο€β‚‚ +₁ idC) ∘ g) ∘ h ∎ + )⟩ + ((Ο€β‚‚ +₁ idC) ∘ g)#ᡇ ∘ h β‰ˆβŸ¨ sym (∘-resp-β‰ˆΛ‘ projectβ‚‚) ⟩ + ((Ο€β‚‚ ∘ ⟨ ((π₁ +₁ idC) ∘ g)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ g)#ᡇ ⟩) ∘ h) β‰ˆβŸ¨ assoc ⟩ + Ο€β‚‚ ∘ ⟨ ((π₁ +₁ idC) ∘ g)#ᡃ , ((Ο€β‚‚ +₁ idC) ∘ g)#ᡇ ⟩ ∘ h ∎ + ) ; #-Folding = _ -- TODO ; #-resp-β‰ˆ = _ -- TODO } where - open Elgot-Algebra EA using (A) renaming (_# to _#ᡃ) - open Elgot-Algebra EB using () renaming (A to B; _# to _#ᡇ) + open Elgot-Algebra EA using (A) renaming (_# to _#ᡃ; #-Fixpoint to #ᡃ-Fixpoint; #-Uniformity to #ᡃ-Uniformity) + open Elgot-Algebra EB using () renaming (A to B; _# to _#ᡇ; #-Fixpoint to #ᡇ-Fixpoint; #-Uniformity to #ᡇ-Uniformity) open Product π’ž p open HomReasoning + open Equiv --* -- Here follows the proof of equivalence for unguarded and Id-guarded Elgot-Algebras