Other Agda modules in this section (76)
- AbsoluteObjects
- Coherence
- Composition
- CompositionCalculus.CompositionInputBaseCalculus
- CompositionCalculus.CompositionInputCalculus
- CompositionCalculus.CompositionInputParameterChange
- CompositionCalculus.CompositionNaturality
- CompositionCalculus.CompositionParameterChange
- CompositionCalculus.CompositionRestrictionCalculus
- CompositionCalculus.InternalCoherence
- CompositionCalculus.InternalPentagon
- CompositionCalculus.RetainedComparisonLaws
- CompositionCalculus.RetainedCompositionBaseChange
- CompositionCalculus.RetainedCompositionParameterChange
- CompositionCalculus.RetainedCompositionRoutes
- CompositionCalculus.UniversalAssociatorRestriction
- CompositionCalculus.UniversalCoherence
- CompositionCalculus.UniversalCoherenceCalculus
- CompositionCalculus.UniversalUnitCalculus
- CompositionCalculus.UniversalUnitChange
- Core
- Currying
- EquivalenceDetection
- Everything
- Functoriality
- MappingAnimae
- MappingProducts
- Points
- ProductCalculus.PairSectionEvaluation
- ProductCalculus.ProductAssociativity
- ProductCalculus.ProductPairingComparisons
- ProductCalculus.ProductSecondCoordinate
- ProductCalculus.ProductSubstitution
- ProductCalculus.ProductSubstitutionPairing
- ProductCalculus.ProductSubstitutionUnits
- ProductCalculus.TerminalInsertion
- Setup
- SquareCalculus.EquivalenceSectionFrames
- SquareCalculus.FramedCornerCalculus
- SquareCalculus.ParameterSquareNaturality
- SquareCalculus.ParameterSquarePasting
- SquareCalculus.ParameterSquareUnits
- SquareCalculus.ProjectionSquares
- SquareCalculus.RetainedParameterChangeProjections
- SquareCalculus.SectionFrames
- SquareCalculus.SplitProjectionCalculus
- SquareCalculus.SplitProjectionNaturality
- SquareCalculus.SquareEvaluation
- SquareCalculus.SquareEvaluationPostcomposition
- SquareCalculus.SquareEvaluationVerticalPasting
- SquareCalculus.TriangleEvaluation
- Substitution.ApplicationRestriction
- Substitution.ApplicationRouteNormalization
- Substitution.CoherenceTransport
- Substitution.ComparisonCancellation
- Substitution.Compatibility
- Substitution.ConstantPointRestriction
- Substitution.ConstantSubstitution
- Substitution.DecodingNaturality
- Substitution.EvaluationInputChange
- Substitution.EvaluationParameterChange
- Substitution.IdentityParameterChange
- Substitution.IsomorphismReasoning
- Substitution.MappingProofCalculus
- Substitution.NestedApplicationRestriction
- Substitution.ParameterChange
- Substitution.ParameterChangeNaturality
- Substitution.PrecompositionNaturality
- Substitution.ProofCalculus
- Substitution.RetainedIdentityParameterChange
- Substitution.SectionComparisonEvaluation
- Substitution.SectionComparisonRestriction
- Substitution.Specialization
- Substitution.SubstitutionCoherence
- Substitution.UncurriedIdentityParameterChange
- Uncurrying
Complete compiler-highlighted source. Follow a symbol to its declaration.
# Transferring iterated substitution through evaluation The calculation in this module isolates the exact product associativity comparison needed for iterated uncurrying. Its final transfer theorem is conditional on that explicitly displayed comparison; the condition is not an added axiom of the theory. ```agda {-# OPTIONS --safe --without-K #-} open import Agda.Primitive using (Level) open import SCT.VolumeI.Chapter01.Theory using (Theory) import SCT.VolumeI.Chapter01.Section04.Setup as Setup import SCT.VolumeI.Chapter01.Section04.MappingAnimae as MappingAnimae import SCT.VolumeI.Chapter01.Section04.Currying as Currying import SCT.VolumeI.Chapter01.Section04.Substitution.Compatibility as Compatibility import SCT.VolumeI.Chapter01.Section03.ProductCalculus.IteratedPairing as IteratedPairing import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PairingNaturality import SCT.VolumeI.Chapter01.Section02.Isomorphisms as Isomorphisms module SCT.VolumeI.Chapter01.Section04.Substitution.IteratedCompatibility {c m a : Level} (šÆ : Theory c m a) (M : MappingAnimae.MappingAnimae šÆ) where open Setup šÆ open MappingAnimae.MappingAnimae M open Currying šÆ M open Compatibility šÆ M open IteratedPairing vocabulary terminal products productLaws composition vertical whiskering pentagonTriangle using (pentagon-whiskered; pre-inverse-at; solve-pentagon; mixed-at) open PairingNaturality vocabulary terminal products productLaws composition vertical whiskering using (move-square) import SCT.VolumeI.Chapter01.Section03.IdentificationCalculus.Parameterized as Parameterized open Parameterized.WhiskeringLaws vocabulary terminal products productLaws composition vertical whiskering using (postWhisker-comp-at) open Isomorphisms vocabulary terminal products productLaws composition vertical whiskering using (reassociateFour) exchange-middle : {X Y : CAT} {a b c d e cā² : MAP X Y} (Ī“ : d =ā e) (γ : c =ā d) (β : b =ā c) (α : a =ā b) (γⲠ: cā² =ā d) (βⲠ: b =ā cā²) ā (γ ā β) =ā (γⲠā βā²) ā ((Ī“ ā γ) ā (β ā α)) =ā ((Ī“ ā γā²) ā (βⲠā α)) exchange-middle Ī“ γ β α γⲠβⲠp = (reassociateFour Ī“ γⲠβⲠα) ā»Ā¹ ā (isoComp-cong (idIso Ī“) (isoComp-cong p (idIso α)) ā reassociateFour Ī“ γ β α) evaluation-step : {R X Z D : CAT} (e : MAP Z D) (p : MAP X Z) (s : MAP R X) {q : MAP R Z} ā q =ā (p ā s) ā (e ā q) =ā ((e ā p) ā s) evaluation-step e p s a = (comp-assoc s p e) ā»Ā¹ ā (e ā a) evaluation-step-iterated : {Q R X Z D : CAT} (e : MAP Z D) (p : MAP X Z) (s : MAP R X) (t : MAP Q R) {q : MAP R Z} {r : MAP Q Z} (a : q =ā (p ā s)) (b : r =ā (q ā t)) ā (comp-assoc t s (e ā p) ā ((evaluation-step e p s a ā· t) ā evaluation-step e q t b)) =ā ((comp-assoc (s ā t) p e) ā»Ā¹ ā (e ā (comp-assoc t s p ā ((a ā· t) ā b)))) evaluation-step-iterated e p s t {q} {r} a b = let A = comp-assoc t s (e ā p) B = (comp-assoc s p e) ā»Ā¹ ā· t C = (e ā a) ā· t D = (comp-assoc t q e) ā»Ā¹ E = e ā b Dā² = (comp-assoc t (p ā s) e) ā»Ā¹ Cā² = e ā (a ā· t) total = (comp-assoc (s ā t) p e) ā»Ā¹ inner = comp-assoc t s p exchange = (move-square (comp-assoc t (p ā s) e) C Cā² (comp-assoc t q e) (mixed-at e a t)) ā»Ā¹ pentagon = solve-pentagon (comp-assoc (s ā t) p e) A (e ā inner) (comp-assoc t (p ā s) e) (comp-assoc s p e ā· t) (pentagon-whiskered t s p e) ā isoComp-cong (idIso A) (isoComp-cong (pre-inverse-at (comp-assoc s p e) t) (idIso Dā²)) in isoComp-cong (idIso total) ((postWhisker-isoComp-at e inner ((a ā· t) ā b)) ā»Ā¹ ā isoComp-cong (idIso (e ā inner)) ((postWhisker-isoComp-at e (a ā· t) b) ā»Ā¹)) ā (isoComp-assoc-at total (e ā inner) (Cā² ā E) ā (isoComp-cong pentagon (idIso (Cā² ā E)) ā ((isoComp-assoc-at A (B ā Dā²) (Cā² ā E)) ā»Ā¹ ā (isoComp-cong (idIso A) (exchange-middle B C D E Dā² Cā² exchange) ā isoComp-cong (idIso A) (isoComp-cong (preWhisker-isoComp-at ((comp-assoc s p e) ā»Ā¹) (e ā a) t) (idIso (D ā E))))))) module Iteration {W Y X C D : CAT} (f : MAP X (Map C D)) (Ļ : MAP Y X) (Ļ : MAP W Y) where F : {A B : CAT} ā MAP A B ā MAP (A Ć C) (B Ć C) F h = productMap h (id C) Īŗ : {A B Z : CAT} (h : MAP B Z) (r : MAP A B) ā (F h ā F r) =ā (F (h ā r)) Īŗ = slice-comparison ProductAssociativity : Set m ProductAssociativity = (Īŗ f (Ļ ā Ļ) ā ((F f ā Īŗ Ļ Ļ) ā comp-assoc (F Ļ) (F Ļ) (F f))) =ā (productMap-cong (comp-assoc Ļ Ļ f) (idIso (id C)) ā (Īŗ (f ā Ļ) Ļ ā (Īŗ f Ļ ā· F Ļ))) together : (mapUncurry ((f ā Ļ) ā Ļ)) =ā (mapUncurry f ā F (Ļ ā Ļ)) together = mapUncurry-restrict f (Ļ ā Ļ) ā mapUncurryIso (comp-assoc Ļ Ļ f) successively : (mapUncurry ((f ā Ļ) ā Ļ)) =ā (mapUncurry f ā F (Ļ ā Ļ)) successively = (mapUncurry f ā Īŗ Ļ Ļ) ā (comp-assoc (F Ļ) (F Ļ) (mapUncurry f) ā ((mapUncurry-restrict f Ļ ā· F Ļ) ā mapUncurry-restrict (f ā Ļ) Ļ)) transfer : ProductAssociativity ā together =ā successively transfer product-assoc = (isoComp-cong (idIso (mapUncurry-restrict f (Ļ ā Ļ))) ((mapUncurry-actions-agree (comp-assoc Ļ Ļ f)) ā»Ā¹) ā let p = F f s = F Ļ t = F Ļ e = mapEval k = Īŗ Ļ Ļ a = (Īŗ f Ļ) ā»Ā¹ b = (Īŗ (f ā Ļ) Ļ) ā»Ā¹ inner = comp-assoc t s p ā ((a ā· t) ā b) outside = (comp-assoc (F (Ļ ā Ļ)) p e) ā»Ā¹ middle = (comp-assoc (s ā t) p e) ā»Ā¹ whiskered-k = p ā k associator = productMap-cong (comp-assoc Ļ Ļ f) (idIso (id C)) commute = (move-square (comp-assoc (F (Ļ ā Ļ)) p e) (mapUncurry f ā k) (e ā whiskered-k) (comp-assoc (s ā t) p e) (postWhisker-comp-at k p e)) ā»Ā¹ solve = solve-pentagon (Īŗ f (Ļ ā Ļ)) (whiskered-k ā comp-assoc t s p) associator (Īŗ (f ā Ļ) Ļ) (Īŗ f Ļ ā· t) product-assoc ā ((isoComp-assoc-at whiskered-k (comp-assoc t s p) ((Īŗ f Ļ ā· t) ā»Ā¹ ā b)) ā»Ā¹ ā isoComp-cong (idIso whiskered-k) (isoComp-cong (idIso (comp-assoc t s p)) (isoComp-cong (pre-inverse-at (Īŗ f Ļ) t) (idIso b)))) in (isoComp-assoc-at outside (e ā (Īŗ f (Ļ ā Ļ)) ā»Ā¹) (e ā associator)) ā»Ā¹ ā (isoComp-cong (idIso outside) (postWhisker-isoComp-at e ((Īŗ f (Ļ ā Ļ)) ā»Ā¹) associator) ā (isoComp-cong (idIso outside) (postWhisker e ā solve) ā (isoComp-cong (idIso outside) ((postWhisker-isoComp-at e whiskered-k inner) ā»Ā¹) ā (isoComp-assoc-at outside (e ā whiskered-k) (e ā inner) ā (isoComp-cong commute (idIso (e ā inner)) ā ((isoComp-assoc-at (mapUncurry f ā k) middle (e ā inner)) ā»Ā¹ ā isoComp-cong (idIso (mapUncurry f ā k)) (evaluation-step-iterated e p s t a b)))))))) ā»Ā¹ ```