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
- 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.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.
Corresponding book passages
# Checking equivalences on mapping animae The recognition argument uses only the two test categories appearing in the proof: the source and the target of the functor. This also makes the anima-only variant immediate when both categories are animae. ```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 Mapping import SCT.VolumeI.Chapter01.Section04.Currying as Currying import SCT.VolumeI.Chapter01.Section04.Points as Points import SCT.VolumeI.Chapter01.Section04.Functoriality as Functoriality module SCT.VolumeI.Chapter01.Section04.EquivalenceDetection {c m a : Level} (π― : Theory c m a) (M : Mapping.MappingAnimae π―) where open Setup π― open Mapping.MappingAnimae M open Currying π― M open Points π― M open Functoriality π― M unnamedIso : {C D : CAT} {f g : MAP C D} β (nameMap f) =β (nameMap g) β f =β g unnamedIso {f = f} {g} Ξ± = decode-name g β (decodeMapIso Ξ± β (decode-name f) β»ΒΉ) mapPost-name : {B C D : CAT} (f : MAP C D) (g : MAP B C) β (mapPost f β nameMap g) =β (nameMap (f β g)) mapPost-name f g = mapReflect one-isAn _ _ ((mapCurry-Ξ² one-isAn ((f β g) β prβ)) β»ΒΉ β ((comp-assoc prβ g f) β»ΒΉ β ((f β mapCurry-Ξ² one-isAn (g β prβ)) β mapPost-uncurry f (nameMap g)))) mapPre-name : {B C D : CAT} (f : MAP B C) (g : MAP C D) β (mapPre f β nameMap g) =β (nameMap (g β f)) mapPre-name f g = mapReflect one-isAn _ _ ((mapCurry-Ξ² one-isAn ((g β f) β prβ)) β»ΒΉ β ((comp-assoc prβ f g) β»ΒΉ β ((g β pair-Ξ²β (id One β prβ) (f β prβ)) β (comp-assoc (productMap (id One) f) prβ g β ((mapCurry-Ξ² one-isAn (g β prβ) β· productMap (id One) f) β mapPre-uncurry f (nameMap g)))))) ``` An equivalence on a mapping anima reflects the isomorphisms between named functors. The named comparisons above transport the endpoints; no strict identification of a functor with its representing point is used. ```agda mapPost-reflect : {B C D : CAT} (f : MAP C D) β IsEquiv (mapPost {C = B} f) β (g h : MAP B C) β (f β g) =β (f β h) β g =β h mapPost-reflect f e g h Ξ± = unnamedIso (equiv-reflect e (nameMap g) (nameMap h) ((mapPost-name f h) β»ΒΉ β (nameMapIso Ξ± β mapPost-name f g))) mapPre-reflect : {B C D : CAT} (f : MAP B C) β IsEquiv (mapPre {D = D} f) β (g h : MAP C D) β (g β f) =β (h β f) β g =β h mapPre-reflect f e g h Ξ± = unnamedIso (equiv-reflect e (nameMap g) (nameMap h) ((mapPre-name f h) β»ΒΉ β (nameMapIso Ξ± β mapPre-name f g))) mapPost-section : {C D : CAT} (f : MAP C D) β IsEquiv (mapPost {C = D} f) β Section f mapPost-section {D = D} f e = record { section = decodeMap point ; comparison = unnamedIso (FunctorLift.comparison chosen β ((mapPost f β name-decode point) β (mapPost-name f (decodeMap point)) β»ΒΉ)) } where chosen : FunctorLift (mapPost f) (nameMap (id D)) chosen = equiv-lift e (nameMap (id D)) point = FunctorLift.lift chosen mapPre-retraction : {C D : CAT} (f : MAP C D) β IsEquiv (mapPre {D = C} f) β Retraction f mapPre-retraction {C} f e = record { retraction = decodeMap point ; comparison = (unnamedIso (FunctorLift.comparison chosen β ((mapPre f β name-decode point) β (mapPre-name f (decodeMap point)) β»ΒΉ))) β»ΒΉ } where chosen : FunctorLift (mapPre f) (nameMap (id C)) chosen = equiv-lift e (nameMap (id C)) point = FunctorLift.lift chosen ``` For postcomposition, first lift the identity of the target to obtain a section, then reflect the other inverse comparison using the source test. For precomposition the dual argument first obtains a retraction. ```agda post-tests-isEquiv : {C D : CAT} (f : MAP C D) β IsEquiv (mapPost {C = C} f) β IsEquiv (mapPost {C = D} f) β IsEquiv f post-tests-isEquiv {C} {D} f sourceTest targetTest = record { inverse = g ; sectionIso = (mapPost-reflect f sourceTest (g β f) (id C) ((comp-unitΚ³ f) β»ΒΉ β (comp-unitΛ‘ f β ((Section.comparison s β· f) β (comp-assoc f g f) β»ΒΉ)))) β»ΒΉ ; retractionIso = (Section.comparison s) β»ΒΉ } where s = mapPost-section f targetTest g = Section.section s pre-tests-isEquiv : {C D : CAT} (f : MAP C D) β IsEquiv (mapPre {D = C} f) β IsEquiv (mapPre {D = D} f) β IsEquiv f pre-tests-isEquiv {C} {D} f sourceTest targetTest = record { inverse = g ; sectionIso = Retraction.comparison r ; retractionIso = (mapPre-reflect f targetTest (f β g) (id D) ((comp-unitΛ‘ f) β»ΒΉ β (comp-unitΚ³ f β ((f β (Retraction.comparison r) β»ΒΉ) β comp-assoc f g f)))) β»ΒΉ } where r = mapPre-retraction f sourceTest g = Retraction.retraction r post-tests-all : {C D : CAT} (f : MAP C D) β ((E : CAT) β IsEquiv (mapPost {C = E} f)) β IsEquiv f post-tests-all {C} {D} f tests = post-tests-isEquiv f (tests C) (tests D) pre-tests-all : {C D : CAT} (f : MAP C D) β ((E : CAT) β IsEquiv (mapPre {D = E} f)) β IsEquiv f pre-tests-all {C} {D} f tests = pre-tests-isEquiv f (tests C) (tests D) post-tests-animae : {C D : CAT} β isAn C β isAn D β (f : MAP C D) β ((E : CAT) β isAn E β IsEquiv (mapPost {C = E} f)) β IsEquiv f post-tests-animae {C} {D} cAn dAn f tests = post-tests-isEquiv f (tests C cAn) (tests D dAn) pre-tests-animae : {C D : CAT} β isAn C β isAn D β (f : MAP C D) β ((E : CAT) β isAn E β IsEquiv (mapPre {D = E} f)) β IsEquiv f pre-tests-animae {C} {D} cAn dAn f tests = pre-tests-isEquiv f (tests C cAn) (tests D dAn) ``` Together with `mapPost-isEquiv` and `mapPre-isEquiv`, these give all directions of the equivalence-detection proposition.