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.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.
# Application and uncurrying comparisons The lemmas below describe how application and uncurrying interact with composition, identifications, and restriction of parameters. They collect the statements needed in later mapping-anima calculations; the imported modules contain their proofs. The aliases are `abstract` to avoid repeatedly expanding those proofs during checking. This changes neither the chosen comparisons nor the axiom interface. ```agda {-# OPTIONS --safe --without-K #-} open import Agda.Primitive using (Level) open import SCT.VolumeI.Chapter01.Theory using (Theory) import SCT.VolumeI.Chapter01.Section04.Substitution.ProofCalculus as ProofCalculus import SCT.VolumeI.Chapter01.Section04.MappingAnimae as Mapping import SCT.VolumeI.Chapter01.Section04.Composition as MapComposition import SCT.VolumeI.Chapter01.Section04.CompositionCalculus.CompositionNaturality as Naturality import SCT.VolumeI.Chapter01.Section04.Substitution.ApplicationRestriction as Application import SCT.VolumeI.Chapter01.Section04.Substitution.EvaluationParameterChange as Evaluation import SCT.VolumeI.Chapter01.Section04.Currying as Currying module SCT.VolumeI.Chapter01.Section04.Substitution.MappingProofCalculus {c m a : Level} (π― : Theory c m a) (M : Mapping.MappingAnimae π―) where open ProofCalculus π― open Mapping.MappingAnimae M open MapComposition π― M open Currying π― M using (mapUncurryIso; mapUncurry-cong; mapUncurry-restrict) abstract apply-cong-Isoβ : {X C D : CAT} {f fβ² : MAP X (Map C D)} {x xβ² : MAP X C} {Ξ± Ξ±β² : f =β fβ²} {Ξ² Ξ²β² : x =β xβ²} β Ξ± =β Ξ±β² β Ξ² =β Ξ²β² β (applyTerm-cong Ξ± Ξ²) =β (applyTerm-cong Ξ±β² Ξ²β²) apply-cong-Isoβ = Naturality.apply-cong-Isoβ π― M apply-cong-comp : {X C D : CAT} {fβ fβ fβ : MAP X (Map C D)} {xβ xβ xβ : MAP X C} (Ξ±β : fβ =β fβ) (Ξ±β : fβ =β fβ) (Ξ²β : xβ =β xβ) (Ξ²β : xβ =β xβ) β (applyTerm-cong (Ξ±β β Ξ±β) (Ξ²β β Ξ²β)) =β (applyTerm-cong Ξ±β Ξ²β β applyTerm-cong Ξ±β Ξ²β) apply-cong-comp = Naturality.apply-cong-comp π― M mapUncurry-at-inner : {Ξ X C D : CAT} (f : MAP X (Map C D)) {p pβ² : MAP Ξ X} {x xβ² : MAP Ξ C} (Ο : p =β pβ²) (Ο : x =β xβ²) β (mapUncurry-at f pβ² xβ² β (mapUncurry f β pair-cong Ο Ο)) =β (applyTerm-cong (f β Ο) Ο β mapUncurry-at f p x) mapUncurry-at-inner = Naturality.mapUncurry-at-inner π― M mapUncurry-as-apply-natural : {X C D : CAT} {f g : MAP X (Map C D)} (Ξ± : f =β g) β (mapUncurry-as-apply g β mapUncurry-cong Ξ±) =β (applyTerm-cong (Ξ± β· prβ) (idIso prβ) β mapUncurry-as-apply f) mapUncurry-as-apply-natural = Naturality.mapUncurry-as-apply-natural π― M binary-pre-inputs : {X Y A B C : CAT} (F : MAP (A Γ B) C) {f fβ² : MAP X A} {g gβ² : MAP X B} (Ξ± : f =β fβ²) (Ξ² : g =β gβ²) (r : MAP Y X) β let before = (F β pair-pre f g r) β comp-assoc r (pair f g) F after = (F β pair-pre fβ² gβ² r) β comp-assoc r (pair fβ² gβ²) F in (after β ((F β pair-cong Ξ± Ξ²) β· r)) =β ((F β pair-cong (Ξ± β· r) (Ξ² β· r)) β before) binary-pre-inputs = Naturality.binary-pre-inputs π― M combine-apply : {X C D : CAT} {fβ fβ fβ : MAP X (Map C D)} {xβ xβ xβ : MAP X C} {source : MAP X D} (Ξ± : fβ =β fβ) (Ξ² : xβ =β xβ) (Ξ³ : fβ =β fβ) (Ξ΄ : xβ =β xβ) (base : source =β (applyTerm fβ xβ)) β (applyTerm-cong Ξ± Ξ² β (applyTerm-cong Ξ³ Ξ΄ β base)) =β (applyTerm-cong (Ξ± β Ξ³) (Ξ² β Ξ΄) β base) combine-apply = Application.combine-apply π― M post-iterated-comparison : {Q R X A B : CAT} (F : MAP A B) (H : MAP X A) (r : MAP R X) (s : MAP Q R) {Hβ : MAP R A} {Hβ Hβ : MAP Q A} (u : (H β r) =β Hβ) (v : (Hβ β s) =β Hβ) (w : (H β (r β s)) =β Hβ) (z : Hβ =β Hβ) β (w β comp-assoc s r H) =β (z β (v β (u β· s))) β (((F β w) β comp-assoc (r β s) H F) β comp-assoc s r (F β H)) =β ((F β z) β (((F β v) β comp-assoc s Hβ F) β (((F β u) β comp-assoc r H F) β· s))) post-iterated-comparison = Application.post-iterated-comparison π― M mapUncurry-at-restriction : {R Ξ X C D : CAT} (f : MAP X (Map C D)) (p : MAP Ξ X) (x : MAP Ξ C) (r : MAP R Ξ) β (applyTerm-cong (comp-assoc r p f) (idIso (x β r)) β (applyTerm-pre (f β p) x r β (mapUncurry-at f p x β· r))) =β (mapUncurry-at f (p β r) (x β r) β ((mapUncurry f β pair-pre p x r) β comp-assoc r (pair p x) (mapUncurry f))) mapUncurry-at-restriction = Evaluation.mapUncurry-at-restriction π― M mapUncurry-as-apply-parameter-change : {P Q C D : CAT} (f : MAP P (Map C D)) (Ο : MAP Q P) β let s = productMap Ο (id C) a = (f β pair-Ξ²β (Ο β prβ) (id C β prβ)) β comp-assoc s prβ f b = comp-unitΛ‘ prβ β pair-Ξ²β (Ο β prβ) (id C β prβ) in (applyTerm-cong (comp-assoc prβ Ο f) (idIso prβ) β mapUncurry-as-apply (f β Ο)) =β (applyTerm-cong a b β (applyTerm-pre (f β prβ) prβ s β ((mapUncurry-as-apply f β· s) β mapUncurry-restrict f Ο))) mapUncurry-as-apply-parameter-change = Evaluation.mapUncurry-as-apply-parameter-change π― M mapUncurry-actions-agree : {X C D : CAT} {f g : MAP X (Map C D)} (Ξ± : f =β g) β (mapUncurryIso Ξ±) =β (mapUncurry-cong Ξ±) mapUncurry-actions-agree = Currying.mapUncurry-actions-agree π― M ```