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.IteratedCompatibility
- Substitution.MappingProofCalculus
- 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.
# Normalizing a nested application after restriction The following pasting is stated for arbitrary terms and endpoint comparisons. It uses the supplied restriction square for application of composition and the already proved naturality of that application. ```agda {-# OPTIONS --safe --without-K #-} open import Agda.Primitive using (Level) open import SCT.VolumeI.Chapter01.Theory using (Theory) import SCT.Calculus.Squares as Squares import SCT.VolumeI.Chapter01.Section04.Substitution.ProofCalculus as Setup import SCT.VolumeI.Chapter01.Section04.MappingAnimae as Mapping import SCT.VolumeI.Chapter01.Section04.Composition as MapComposition import SCT.VolumeI.Chapter01.Section04.Substitution.MappingProofCalculus as MappingProof import SCT.VolumeI.Chapter01.Section04.CompositionCalculus.CompositionRestrictionCalculus as Restriction module SCT.VolumeI.Chapter01.Section04.Substitution.NestedApplicationRestriction {c m a : Level} (π― : Theory c m a) (M : Mapping.MappingAnimae π―) where open Setup π― private module Paste (X Y : CAT) = Squares (comparisonAlgebra X Y) (comparisonLaws X Y) open Mapping.MappingAnimae M open MapComposition π― M open MappingProof π― M open Restriction π― M using (apply-compose-natural) module Assembly {Ξ R C D E : CAT} (gβ : MAP Ξ (Map D E)) (fβ : MAP Ξ (Map C D)) (xβ : MAP Ξ C) (s : MAP R Ξ) {gβ² : MAP R (Map D E)} {fβ² : MAP R (Map C D)} {xβ² : MAP R C} (ag : (gβ β s) =β gβ²) (af : (fβ β s) =β fβ²) (b : (xβ β s) =β xβ²) {K : MAP Ξ (Map C E)} (d : K =β (composeTerm gβ fβ)) {S : MAP Ξ E} {T : MAP R E} (Aβ : S =β (applyTerm K xβ)) (Bβ : T =β (S β s)) (Cβ : (applyTerm (composeTerm gβ fβ) xβ) =β (applyTerm gβ (applyTerm fβ xβ))) (Cβ : (applyTerm (composeTerm (gβ β s) (fβ β s)) (xβ β s)) =β (applyTerm (gβ β s) (applyTerm (fβ β s) (xβ β s)))) (Cβ : (applyTerm (composeTerm gβ² fβ²) xβ²) =β (applyTerm gβ² (applyTerm fβ² xβ²))) where source-coordinate = composeTerm-cong ag af β (composeTerm-pre gβ fβ s β (d β· s)) before = applyTerm-cong ag (applyTerm-cong af b β applyTerm-pre fβ xβ s) β (applyTerm-pre gβ (applyTerm fβ xβ) s β (((Cβ β (applyTerm-cong d (idIso xβ) β Aβ)) β· s) β Bβ)) after = Cβ β (applyTerm-cong source-coordinate b β (applyTerm-pre K xβ s β ((Aβ β· s) β Bβ))) module Calculation (restriction : (Cβ β (applyTerm-cong (composeTerm-pre gβ fβ s) (idIso (xβ β s)) β applyTerm-pre (composeTerm gβ fβ) xβ s)) =β ((applyTerm-cong (idIso (gβ β s)) (applyTerm-pre fβ xβ s) β applyTerm-pre gβ (applyTerm fβ xβ) s) β (Cβ β· s))) (naturality : (Cβ β applyTerm-cong (composeTerm-cong ag af) b) =β (applyTerm-cong ag (applyTerm-cong af b) β Cβ)) where Pf = applyTerm-pre fβ xβ s Pg = applyTerm-pre gβ (applyTerm fβ xβ) s N = applyTerm-cong ag (applyTerm-cong af b β Pf) changed = applyTerm-cong ag (applyTerm-cong af b) restricted = applyTerm-cong (idIso (gβ β s)) Pf Dβ = applyTerm-cong d (idIso xβ) tail = (Aβ β· s) β Bβ rest = (Dβ β· s) β tail e = composeTerm-pre gβ fβ s Ract = applyTerm-cong e (idIso (xβ β s)) Pmid = applyTerm-pre (composeTerm gβ fβ) xβ s middle-route = Ract β Pmid Qact = applyTerm-cong (composeTerm-cong ag af) b Psource = applyTerm-pre K xβ s Uact = applyTerm-cong (d β· s) (idIso (xβ β s)) base = Psource β tail private module Route = Paste.NestedRoute R E N Pg (((Cβ β (Dβ β Aβ)) β· s) β Bβ) changed restricted (Cβ β· s) rest Cβ middle-route Cβ Qact Ract Uact base (applyTerm-cong (e β (d β· s)) (idIso (xβ β s))) (applyTerm-cong source-coordinate b) opaque expandV : (((Cβ β (Dβ β Aβ)) β· s) β Bβ) =β ((Cβ β· s) β rest) expandV = isoComp-cong (idIso (Cβ β· s)) (isoComp-assoc-at (Dβ β· s) (Aβ β· s) Bβ) β (isoComp-assoc-at (Cβ β· s) ((Dβ β· s) β (Aβ β· s)) Bβ β isoComp-cong (isoComp-cong (idIso (Cβ β· s)) (preWhisker-isoComp-at Dβ Aβ s) β preWhisker-isoComp-at Cβ (Dβ β Aβ) s) (idIso Bβ)) opaque splitN : N =β (changed β restricted) splitN = apply-cong-comp ag (idIso (gβ β s)) (applyTerm-cong af b) Pf β (apply-cong-Isoβ (isoComp-unitΚ³-at ag) (idIso (applyTerm-cong af b β Pf))) β»ΒΉ opaque useRestriction : (restricted β (Pg β ((Cβ β· s) β rest))) =β (Cβ β (middle-route β rest)) useRestriction = Paste.composite-square-with-tail R E restricted Pg (Cβ β· s) Cβ middle-route rest (restriction β»ΒΉ) opaque useNaturality : (changed β (Cβ β (middle-route β rest))) =β (Cβ β (Qact β (middle-route β rest))) useNaturality = Paste.square-with-tail R E changed Cβ Cβ Qact (middle-route β rest) (naturality β»ΒΉ) opaque projectionNatural : (Pmid β (Dβ β· s)) =β (Uact β Psource) projectionNatural = isoComp-cong (apply-cong-Isoβ (idIso (d β· s)) (preWhisker-idIso xβ s)) (idIso Psource) β binary-pre-inputs mapEval d (idIso xβ) s opaque exchange : (Pmid β rest) =β (Uact β base) exchange = Paste.square-with-tail R E Pmid (Dβ β· s) Uact Psource tail projectionNatural opaque useProjection : (middle-route β rest) =β (Ract β (Uact β base)) useProjection = isoComp-cong (idIso Ract) exchange β isoComp-assoc-at Ract Pmid rest opaque combineInner : (Ract β (Uact β base)) =β (applyTerm-cong (e β (d β· s)) (idIso (xβ β s)) β base) combineInner = isoComp-cong (apply-cong-Isoβ (idIso (e β (d β· s))) (isoComp-unitΛ‘-at (idIso (xβ β s)))) (idIso base) β combine-apply e (idIso (xβ β s)) (d β· s) (idIso (xβ β s)) base opaque combineOuter : (Qact β (applyTerm-cong (e β (d β· s)) (idIso (xβ β s)) β base)) =β (applyTerm-cong source-coordinate b β base) combineOuter = isoComp-cong (apply-cong-Isoβ (idIso source-coordinate) (isoComp-unitΚ³-at b)) (idIso base) β combine-apply (composeTerm-cong ag af) b (e β (d β· s)) (idIso (xβ β s)) base opaque finish : (Cβ β (Qact β (middle-route β rest))) =β after finish = Route.finish useProjection combineInner combineOuter opaque begin : before =β (changed β (restricted β (Pg β ((Cβ β· s) β rest)))) begin = Route.begin splitN expandV opaque result : before =β after result = Route.result finish useNaturality useRestriction begin opaque comparison : (Cβ β (applyTerm-cong (composeTerm-pre gβ fβ s) (idIso (xβ β s)) β applyTerm-pre (composeTerm gβ fβ) xβ s)) =β ((applyTerm-cong (idIso (gβ β s)) (applyTerm-pre fβ xβ s) β applyTerm-pre gβ (applyTerm fβ xβ) s) β (Cβ β· s)) β (Cβ β applyTerm-cong (composeTerm-cong ag af) b) =β (applyTerm-cong ag (applyTerm-cong af b) β Cβ) β before =β after comparison = Calculation.result ```