Open github-actions[bot] opened 1 year ago
lemma : (f : MonSym) (x : π .carrier) (xs : List (π .carrier)) (a : Arity (length xs))
-> lookup (x β· xs) (fsuc a) β‘ sharp MonSig π {!!} (lookup {!!} a)
lemma f \= {!!}
https://api.github.com/pufferffish/agda-symmetries/blob/0ff92bdb19aba58e89e9690583a23f811cdcca95/Cubical/Structures/Set/Mon/Desc.agda#L147
MonSig : Sig β-zero β-zero MonSig = finSig MonFinSig MonStruct : β {n} -> Type (β-suc n) MonStruct {n} = struct n MonSig module MonStruct {β} (π : MonStruct {β}) where e : π .carrier e = π .algebra (`e , lookup []) e-eta : {i j : Arity 0 -> π .carrier} -> π .algebra (`e , i) β‘ π .algebra (`e , j) e-eta {i} = cong (\j -> π .algebra (`e , j)) (funExt Ξ» z -> lookup [] z) infixr 40 _β_ _β_ : π .carrier -> π .carrier -> π .carrier _β_ x y = π .algebra (`β , lookup (x β· y β· [])) β-eta : β {β} {A : Type β} (i : Arity 2 -> A) (_β― : A -> π .carrier) -> π .algebra (`β , (Ξ» w -> i w β―)) β‘ (i fzero β―) β (i fone β―) β-eta i _β― = cong (Ξ» z -> π .algebra (`β , z)) (funExt lemma) where lemma : (x : Arity 2) -> (i x β―) β‘ lookup ((i fzero β―) β· (i fone β―) β· []) x lemma (zero , p) = cong (_β― β i) (Ξ£β‘Prop (Ξ» _ -> isPropβ€) refl) lemma (suc zero , p) = cong (_β― β i) (Ξ£β‘Prop (Ξ» _ -> isPropβ€) refl) lemma (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) data MonEq : Type where `unitl `unitr `assocr : MonEq MonEqFree : MonEq -> β MonEqFree `unitl = 1 MonEqFree `unitr = 1 MonEqFree `assocr = 3 MonEqSig : EqSig β-zero β-zero MonEqSig = finEqSig (MonEq , MonEqFree) monEqLhs : (eq : MonEq) -> FinTree MonFinSig (MonEqFree eq) monEqLhs `unitl = node (`β , lookup (node (`e , lookup []) β· leaf fzero β· [])) monEqLhs `unitr = node (`β , lookup (leaf fzero β· node (`e , lookup []) β· [])) monEqLhs `assocr = node (`β , lookup (node (`β , lookup (leaf fzero β· leaf fone β· [])) β· leaf ftwo β· [])) monEqRhs : (eq : MonEq) -> FinTree MonFinSig (MonEqFree eq) monEqRhs `unitl = leaf fzero monEqRhs `unitr = leaf fzero monEqRhs `assocr = node (`β , lookup (leaf fzero β· node (`β , lookup (leaf fone β· leaf ftwo β· [])) β· [])) MonSEq : seq MonSig MonEqSig MonSEq n = monEqLhs n , monEqRhs n module MonSEq {β} (π : MonStruct {β}) (Ο : π β¨ MonSEq) where open MonStruct π public unitl : β m -> e β m β‘ m unitl m = e β m β‘β¨β© π .algebra (`β , lookup (π .algebra (`e , _) β· m β· [])) β‘β¨ cong (\w -> π .algebra (`β , w)) (funExt lemma) β© π .algebra (`β , (Ξ» x -> sharp (finSig (MonSym , MonAr)) π (lookup (m β· [])) (lookup (node (`e , _) β· leaf fzero β· []) x))) β‘β¨ Ο `unitl (lookup [ m ]) β© m β where lemma : (w : MonSig .arity `β) -> lookup (π .algebra (`e , (Ξ» num β β₯.rec (Β¬Fin0 num))) β· m β· []) w β‘ sharp (finSig (MonSym , MonAr)) π (lookup (m β· [])) (lookup (node (`e , (Ξ» num β β₯.rec (Β¬Fin0 num))) β· leaf fzero β· []) w) lemma (zero , p) = sym e-eta lemma (suc zero , p) = refl lemma (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) unitr : β m -> m β e β‘ m unitr m = m β e β‘β¨β© π .algebra (`β , lookup (m β· π .algebra (`e , _) β· [])) β‘β¨ cong (\w -> π .algebra (`β , w)) (funExt lemma) β© π .algebra (`β , (Ξ» x -> sharp MonSig π (lookup [ m ]) (lookup (leaf fzero β· node (`e , (Ξ» num β β₯.rec (Β¬Fin0 num))) β· []) x))) β‘β¨ Ο `unitr (lookup [ m ]) β© m β where lemma : (x : MonSig .arity `β) -> lookup (m β· π .algebra (`e , (Ξ» num β β₯.rec (Β¬Fin0 num))) β· []) x β‘ sharp MonSig π (lookup [ m ]) (lookup (leaf fzero β· node (`e , (Ξ» num β β₯.rec (Β¬Fin0 num))) β· []) x) lemma (zero , p) = refl lemma (suc zero , p) = sym e-eta lemma (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) assocr : β m n o -> (m β n) β o β‘ m β (n β o) assocr m n o = (m β n) β o β‘β¨β© π .algebra (`β , lookup (π .algebra (`β , lookup (m β· n β· [])) β· o β· [])) β‘β¨ cong (\w -> π .algebra (`β , w)) (funExt lemma1) β© π .algebra (`β , (\w -> sharp MonSig π (lookup (m β· n β· o β· [])) (lookup (node (`β , lookup (leaf fzero β· leaf fone β· [])) β· leaf ftwo β· []) w))) β‘β¨ Ο `assocr (lookup (m β· n β· o β· [])) β© π .algebra (`β , (Ξ» w -> sharp MonSig π (lookup (m β· n β· o β· [])) (lookup (leaf fzero β· node (`β , lookup (leaf fone β· leaf ftwo β· [])) β· []) w))) β‘β¨ cong (\w -> π .algebra (`β , w)) (sym (funExt lemma3)) β© π .algebra (`β , lookup (m β· π .algebra (`β , lookup (n β· o β· [])) β· [])) β‘β¨β© m β (n β o) β where lemma1 : (w : MonSig .arity `β) -> lookup (π .algebra (`β , lookup (m β· n β· [])) β· o β· []) w β‘ sharp MonSig π (lookup (m β· n β· o β· [])) (lookup (node (`β , lookup (leaf fzero β· leaf fone β· [])) β· leaf ftwo β· []) w) lemma2 : (w : MonSig .arity `β) -> lookup (m β· n β· []) w β‘ sharp MonSig π (lookup (m β· n β· o β· [])) (lookup (leaf fzero β· leaf fone β· []) w) lemma1 (zero , p) = cong (Ξ» o β π .algebra (`β , o)) (funExt lemma2) lemma1 (suc zero , p) = refl lemma1 (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) lemma2 (zero , p) = refl lemma2 (suc zero , p) = refl lemma2 (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) lemma3 : (w : MonSig .arity `β) -> lookup (m β· π .algebra (`β , lookup (n β· o β· [])) β· []) w β‘ sharp MonSig π (lookup (m β· n β· o β· [])) (lookup (leaf fzero β· node (`β , lookup (leaf fone β· leaf ftwo β· [])) β· []) w) lemma4 : (w : MonSig .arity `β) -> lookup (n β· o β· []) w β‘ sharp MonSig π (lookup (m β· n β· o β· [])) (lookup (leaf fone β· leaf ftwo β· []) w) lemma3 (zero , p) = refl lemma3 (suc zero , p) = cong (Ξ» w β π .algebra (`β , w)) (funExt lemma4) lemma3 (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) lemma4 (zero , p) = refl lemma4 (suc zero , p) = refl lemma4 (suc (suc n) , p) = β₯.rec (Β¬m+n<m {m = 2} p) -- TODO: Write generic lemma about compatibility between lookup and sharp -- lemma : (f : MonSym) (x : π .carrier) (xs : List (π .carrier)) (a : Arity (length xs)) -- -> lookup (x β· xs) (fsuc a) β‘ sharp MonSig π {!!} (lookup {!!} a) -- lemma f = {!!} module Examples where β-MonStr : MonStruct carrier β-MonStr = β algebra β-MonStr (`e , _) = 0 algebra β-MonStr (`β , i) = i fzero + i fone β-MonStr-MonSEq : β-MonStr β¨ MonSEq β-MonStr-MonSEq `unitl Ο = refl β-MonStr-MonSEq `unitr Ο = +-zero (Ο fzero) β-MonStr-MonSEq `assocr Ο = sym (+-assoc (Ο fzero) (Ο fone) (Ο ftwo))
lemma : (f : MonSym) (x : π .carrier) (xs : List (π .carrier)) (a : Arity (length xs))
-> lookup (x β· xs) (fsuc a) β‘ sharp MonSig π {!!} (lookup {!!} a)
lemma f \= {!!}
https://api.github.com/pufferffish/agda-symmetries/blob/0ff92bdb19aba58e89e9690583a23f811cdcca95/Cubical/Structures/Set/Mon/Desc.agda#L147