TypeTopology
Vectors
Initializing search
    pdmosses/TypeTopology
    • An Alternative Website
    • Modules
    pdmosses/TypeTopology
    • An Alternative Website
      • index
        • Primitive
      • AllModulesIndex
        • index
        • Definition
        • Morphisms
        • Negation
        • Properties
        • TightReflection
        • index
        • InitialBinarySystem
        • InitialBinarySystem2
        • index
        • Coverage
            • Functions
          • DoubleNegation
          • FunExt
            • Order
          • NotNotFunExt
          • Sequence
          • HAOmega
          • SystemT
          • SystemTWithFan
        • UniformContinuity
          • index
          • CartesianClosedness
          • ComputationExperiments
          • Coproduct
          • DiscreteSpace
          • Fan
          • Hierarchy
          • IndiscreteSpace
          • LocalCartesianClosedness
          • Space
          • TdefinableFunctionsAreUC
          • UCinHAOmega
          • UCinT
          • ValidatingUCviaLCCC
          • YonedaLemma
          • index
          • CartesianClosedness
          • ComputationExperiments
          • DiscreteSpace
          • Fan
          • Space
          • UCinT
          • YonedaLemma
        • index
        • CSB
        • CSB-TheoryLabLunch
        • CSB-WLPO
        • PerfectImages
        • index
        • Preorder
        • Successor
        • Type
        • index
        • Adjoint
        • AW-MSciProject
          • index
            • index
            • Magma
          • Functor
            • index
            • Pre
            • Univalent
          • Pre
          • Total
          • Univalent
          • index
          • Magma
          • Set
        • Functor
        • Functor-Composition
        • NaturalTransformation
          • index
          • Functor
          • NaturalTransformation
          • Pre
          • Univalent
          • Wild
        • Pre
        • Univalent
        • Wild
        • index
        • Arithmetic
        • BothTypes
        • Equivalence
        • Exercise
        • GenericConvergentSequence
        • GenericConvergentSequence2
        • Sharp
        • Type
        • Type2
        • Type2Properties
        • UniversalProperty
        • index
        • ExitingTruncations
        • False
        • FalseWithoutIdentityTypes
        • Preliminaries
        • UniformContinuity
        • index
        • Hom
        • Type
        • index
        • CrossedModules
        • index
        • Addition
        • Extension
        • Functions
        • Multiplication
        • Order
        • Properties
        • Type
        • index
        • AffineMonad
        • Free
        • ListsWithoutRepetitions
        • ListsWithoutRepetitionsMore
        • LWRDGM
        • Monad
        • Type
        • index
          • Bases
          • CompactBasis
          • Continuity
          • ContinuityDiscussion
          • ContinuityImpredicative
          • IndCompletion
          • ScottDomain
          • StepFunctions
          • Curry
          • Dcpo
          • Exponential
          • FunctionComposition
          • LeastFixedPoint
          • Miscelanea
          • Pointed
          • Products
          • ProductsContinuity
          • SupComplete
          • WayBelow
          • Dinfinity
          • Directed
          • Sequential
        • Continuous-and-algebraic-domains
          • ExtendedPartialDedekindReals
          • IdlDyadics
          • LiftingLargeProposition
          • Omega
          • Ordinals
          • Powerset
          • IdealCompletion
          • Properties
          • Retracts
          • LiftingDcpo
          • LiftingSet
          • LiftingSetAlgebraic
        • Part-I
        • Part-II
          • PCF
          • PCFCombinators
          • ScottModelOfPCF
          • ClassicalLiftingOfNaturalNumbers
          • ScottTopology
          • ScottTopologyProperties
        • index
        • Decidable
        • Definition
        • Initial
        • Lifting
        • index
        • DeductiveSystem
        • Depolarization
        • Duploid
        • Preduploid
        • index
        • Addition
        • Multiplication
        • Negation
        • Order
        • Type
        • index
        • DyadicOrder
        • DyadicOrder-PropTrunc
        • Dyadics
        • index
          • index
          • Adjunction
          • Category
          • Functor
          • NaturalTransformation
        • StructureIdentityPrinciple
        • index
          • index
          • Correctness
          • Degrees
          • ExtensionalEquality
          • External
          • FurtherThoughts
          • Internal
          • InternalModCont
          • InternalModUniCont
          • PaperIndex
          • Subst
          • SystemT
          • index
          • Church
          • Combinators
          • CombinatoryT
          • Continuity
          • ContinuityProperties
          • Dialogue
          • Dialogue-to-Brouwer
          • Internal
          • LambdaCalculusVersionOfMFPS
          • MFPS-XXIX
          • SystemT
          • WithoutOracle
        • index
        • Law
        • PlusOneLC
        • Swap
        • index
        • Axioms
        • DedekindReals
        • Rationals
        • index
        • ArithmeticViaEquivalence
        • Bishop
        • Choice
        • Dedekind
        • Embeddings
        • Kuratowski
        • Omega
        • Order
        • Pigeonhole
        • Properties
        • Topology
        • Type
        • UniverseInvariance
        • Variation
        • index
        • Alternative
        • ArgMinMax
        • alpha-beta
        • Constructor
        • Discussion
        • Examples
        • FiniteHistoryDependent
        • FiniteHistoryDependentMonadic
        • FiniteHistoryDependentRelativeMonadic
        • Main
        • OptimalPlays
        • TicTacToe0
        • TicTacToe1
        • TicTacToe2
        • TypeTrees
        • index
        • Aut
        • Cokernel
        • Free
        • GroupActions
        • Homomorphisms
        • Image
        • Kernel
        • Large
        • Opposite
        • Quotient
        • Subgroups
        • Symmetric
        • Torsors
        • Triv
        • Type
        • Type-Supplement
        • index
        • 2-injective-types
        • Ackermann
        • CommutativeLoopSpaces
        • DependentlyTypedTensors
        • Hydra
        • InjectivesVersusAlgebras
        • IntervalObject
        • MajoritiesOnlyActOnSets
        • MajoritiesOnlyActOnSets2
        • multiset-addendum-question
        • not-an-apartness
        • remove-swap
        • ThereAreNoHigherSemilattices
        • ThereAreNoHigherSemilattices2
        • transport-discussion
        • wrong-proofs
        • index
        • AtMostTwoAutomorphismsOfOmega
        • AutomorphismsOfOmega
        • AutomorphismsOfOmegaWEM
        • GroupStructureOnOmega
        • InvolutionTheorem
        • Rigidity
        • UntruncatedAtMostTwo
        • index
        • Addition
        • Cantor
        • Choice
        • DataStructures
        • Equality
        • Examples
        • Finite
        • Finite-JK-Shifts
        • FinitePigeon
        • InfinitePigeon
        • InfinitePigeon2011-05-12
        • InfinitePigeonLessEfficient
        • InfinitePigeonOriginal
        • J-AC-N
        • J-DC
        • J-Examples
        • J-FinitePigeon
        • J-InfinitePigeon
        • J-PigeonProgram
        • J-Shift
        • J-Shift-BBC
        • J-Shift-Selection
        • JK-LogicalFacts
        • JK-Monads
        • K-AC-N
        • K-DC
        • K-Shift
        • K-Shift-BBC
        • K-Shift-from-J-Shift
        • K-Shift-MBR
        • K-Shift-Selection
        • Logic
        • LogicalFacts
        • Naturals
        • Order
        • PigeonProgram
        • ProgramsWithoutSpecification
        • ProgramsWithoutSpecificationBis
        • Two
        • index
        • Algebra
        • AlternativeFlabbiness
        • Article
        • Blackboard
        • CharacterizationViaLifting
        • CounterExamples
        • ExamplesCounterExamplesArticle
        • InhabitedTypesTaboo
        • MathematicalStructures
        • MathematicalStructuresMoreGeneral
        • NonEmptyTypes
        • OverSmallMaps
        • PointedDcpos
        • Resizing
        • Sigma
        • Structure
        • Subtypes
        • WeakFactorizationSystem
        • index
        • Abs
        • Addition
        • Division
        • Exponentiation
        • HCF
        • Multiplication
        • Negation
        • Order
        • Parity
        • Type
        • index
        • Finite
        • Multisets
        • Multisets-Addendum
        • Multisets-HFLO
        • Multisets-IdentificationExample
        • Ordinals
        • Ordinals-Addendum
        • Sets
        • Sets-Addendum
        • index
        • Algebras
        • AnAlgebraWhichIsNotAlwaysFree
        • AnAlgebraWhichIsNotAlwaysFree-blackboard
        • Construction
        • EmbeddingDirectly
        • EmbeddingViaSIP
        • Identity
        • IdentityViaSIP
        • Miscelanea
        • Miscelanea-PropExt-FunExt
        • Monad
        • MonadVariation
        • PowersOfOmegaAreFreeAlgebras
        • ProductsOfFreeAlgebrasAreFree
        • Set
        • Size
        • TwoAlgebrasOnOmega
        • UnivalentWildCategory
        • index
        • AdjointFunctorTheoremForFrames
          • Properties
          • Properties-DistributiveLattice
        • BooleanAlgebra
        • CharacterisationOfContinuity
        • ClassificationOfScottOpens
        • Clopen
          • CharacterizationOfCompactLocales
          • Definition
          • Properties
        • CompactRegular
        • Complements
          • Definition
          • FrameHomomorphism-Definition
          • FrameHomomorphism-Properties
          • FrameIsomorphism-Definition
          • Homeomorphism-Definition
          • Homeomorphism-Properties
          • Properties
        • DirectedFamily
        • DirectedFamily-Poset
          • Basis
          • Definition
          • Two
          • Two-Properties
          • Definition
          • Definition-SigmaBased
          • Homomorphism
          • Ideal
          • Ideal-Properties
          • Isomorphism
          • Isomorphism-Properties
          • Properties
          • Resizing
          • Spectrum
          • Spectrum-Properties
        • Frame
        • HeytingComplementation
        • HeytingImplication
        • InitialFrame
          • CompactElementsOfPoint
          • PointsOfPatch
          • SharpElementsCoincideWithSpectralPoints
        • NotationalConventions
        • PatchLocale
        • PatchOfOmega
        • PatchProperties
        • PerfectMaps
          • Definition
          • Properties
          • SpectralPoint-Definition
        • PosetalAdjunction
        • Regular
        • ScottContinuity
          • Definition
          • Properties
          • ScottLocalesOfAlgebraicDcpos
          • ScottLocalesOfScottDomains
          • DistributiveLatticeSIP
          • FrameSIP
          • Definition
          • Patch
          • Properties
          • UniversalProperty
        • SmallBasis
          • BasisDirectification
          • LatticeOfCompactOpens
          • LatticeOfCompactOpens-Duality
          • Properties
          • SpectralityOfOmega
          • SpectralLocale
          • SpectralMap
          • SpectralMapToLatticeHomomorphism
        • Stone
          • ForSpectralLocales
        • StoneImpliesSpectral
          • Nucleus
          • NucleusImage
          • Properties
        • UniversalPropertyOfPatch
          • Definition
          • Properties
        • WellInside
        • ZeroDimensionality
        • index
        • DedekindReals
        • Rationals
        • StandardDefinition
        • Type
        • index
        • Basic-UF
        • Choice
        • Classifiers
        • Embeddings
        • Equivalence-Constructions
        • Equivalence-Induction
        • Equivalences
        • Function-Graphs
        • FunExt-from-Univalence
        • HAE
        • hlevels
        • Map-Classifiers
        • MLTT
        • More-Exercise-Solutions
        • More-FunExt-Consequences
        • Partial-Functions
        • Powerset
        • Quotient
        • Retracts
        • SIP
        • Size
        • Solved-Exercises
        • Subsingleton-Theorems
        • Subsingleton-Truncation
        • TypeTopology-Interface
        • Unique-Existence
        • Univalence
        • Universe-Lifting
        • Yoneda
        • index
        • AlternativePlus
        • Athenian
        • Bool
        • Empty
        • Empty-Type
        • Fin
        • Id
        • Identity-Type
        • List
        • List-Properties
        • Maybe
        • Natural-Numbers-Type
        • NaturalNumbers
        • Negation
        • Pi
        • Plus
        • Plus-Properties
        • Plus-Type
        • Sigma
        • Sigma-Type
        • Spartan
        • SpartanList
        • Two
        • Two-Properties
        • Unit
        • Unit-Properties
        • Unit-Type
        • Universes
        • Vector
        • index
        • Homotopy
        • Open
        • ReflectiveSubuniverse
        • SigmaClosedReflectiveSubuniverse
        • Subuniverse
        • index
        • Definition
        • J
        • J-transf
        • J-transf-variation
        • JK
        • K
        • List
        • NonEmptyList
        • Reader
        • index
        • AbsoluteDifference
        • Addition
        • Binary
        • Division
        • ExitTruncation
        • Exponentiation
        • HCF
        • Multiplication
        • Order
        • Parity
        • Properties
        • RootsTruncation
        • Sequence
        • UniversalProperty
        • index
        • CanonicalMap
        • Decimal
        • General
        • Order
        • UnderlyingType
        • index
        • Complemented
        • Decidable
        • DecidableClassifier
        • Digression
        • QuasiDecidable
        • SemiDecidable
        • index
        • DeltaCompletePoset
        • Frame
        • FreeJoinSemiLattice
        • FreeSupLattice
        • JoinSemiLattices
        • Poset
        • PosetReflection
        • PredicativeLFP
        • SupLattice
        • SupLattice-SmallBasis
        • sigma-frame
        • sigma-sup-lattice
        • TwoElementPoset
        • ZornsLemma
        • index
        • AdditionProperties
        • Arithmetic
        • ArithmeticReflection
        • BoundedOperations
        • Brouwer
        • BuraliForti
        • Closure
        • Codes
        • ConvergentSequence
        • CumulativeHierarchy
        • CumulativeHierarchy-Addendum
        • Equivalence
          • index
          • DecreasingList
          • DecreasingListProperties-Concrete
          • Grayson
          • Miscellaneous
          • Paper
          • PaperJournal
          • PropertiesViaTransport
          • RelatingConstructions
          • Specification
          • Supremum
          • Taboos
          • TrichotomousLeastElement
        • Fin
        • IdentifyingEquivalentOrdinals
        • Indecomposable
        • InfProperty
        • Injectivity
        • LexicographicCompactness
        • LexicographicOrder
        • Limit
        • Maps
        • MultiplicationProperties
        • NotationInterpretation
        • NotationInterpretation0
        • NotationInterpretation1
        • NotationInterpretation2
        • Notions
        • Omega
        • OrdinalOfOrdinals
        • OrdinalOfOrdinalsSuprema
        • OrdinalOfTruthValues
        • Propositions
        • ShulmanTaboo
        • SupSum
        • Taboos
        • ToppedArithmetic
        • ToppedType
        • TrichotomousArithmetic
        • TrichotomousType
        • Type
        • Underlying
        • WellOrderArithmetic
        • WellOrderingPrinciple
        • WellOrderingTaboo
        • WellOrderTransport
        • index
        • Ap
        • Cancel
        • Concat
        • Inversion
        • Reasoning
        • Rotations
        • Split
        • Type
        • index
          • index
          • PCF
          • PCFCombinators
          • ScottModelOfPCF
          • index
          • AbstractSyntax
          • Adequacy
          • ApplicativeApproximation
          • BigStep
          • Correctness
          • ScottModelOfContexts
          • ScottModelOfIfZero
          • ScottModelOfTerms
          • ScottModelOfTypes
          • Substitution
          • SubstitutionDenotational
        • index
        • Effectivity
        • FromSetReplacement
        • GivesPropTrunc
        • GivesSetReplacement
        • Large
        • Large-Variation
        • Type
        • index
        • Abs
        • Addition
        • Extension
        • Fractions
        • FractionsOperations
        • FractionsOrder
        • Limits
        • MinMax
        • Multiplication
        • Negation
        • Order
        • Positive
        • Type
        • index
        • Constructions
        • Displayed
        • DisplayedUnivalent
        • Type
        • Univalent
        • index
        • ChurchRosser
        • SRTclosure
        • index
        • Definition
        • J-transf
        • NELWR
        • OneSigmaStructure
        • index
        • Algebras
        • Construction
        • Embedding
        • Family
        • IdentityViaSIP
        • Monad
        • index
          • index
          • Construction
          • Induction
          • Integers
          • Integers-Properties
          • Integers-SymmetricInduction
        • RP-infinity
        • index
        • BasicDiscontinuity
        • Decomposability
        • DrinkerParadox
        • FiniteSubsetTaboo
        • LLPO
        • LPO
        • MarkovsPrinciple
        • P2
        • WLPO
        • index
        • BanachFixedPointTheorem
        • Closeness
        • Escardo-Simpson-LICS2001
        • SIP-IntervalObject
          • index
            • DyadicRationals
            • DyadicReals
            • Finite
            • Sequences
            • Vectors
            • ClosenessSpaces
            • ClosenessSpaces-Examples
            • PredicateEquality
            • SearchableTypes
            • SearchableTypes-Examples
            • ApproxOrder
            • ApproxOrder-Examples
            • GlobalOptimisation
            • ParametricRegression
            • BoehmStructure
            • BoehmVerification
            • Integers
            • IntervalObject
            • IntervalObjectApproximation
            • SignedDigit
            • SignedDigitIntervalObject
            • SequenceContinuity
            • SignedDigitContinuity
            • SignedDigitExamples
            • SignedDigitOrder
            • SignedDigitSearch
        • index
        • AbsolutenessOfCompactness
        • AbsolutenessOfCompactnessExample
        • ADecidableQuantificationOverTheNaturals
        • Cantor
        • CantorMinusPoint
        • CantorSearch
        • CompactTypes
        • ConvergentSequenceHasInf
        • DecidabilityOfNonContinuity
        • DenseMapsProperties
        • Density
        • DisconnectedTypes
        • ExtendedSumCompact
        • FailureOfTotalSeparatedness
        • GenericConvergentSequenceCompactness
        • LimitPoints
        • PropInfTychonoff
        • PropTychonoff
        • RicesTheoremForTheUniverse
        • SequentiallyHausdorff
        • SigmaDiscreteAndTotallySeparated
        • SimpleTypes
        • SquashedCantor
        • SquashedSum
        • TheTopologyOfTheUniverse
        • TotallySeparated
        • UniformSearch
        • WeaklyCompactTypes
        • index
        • Base
        • Choice
        • ClassicalLogic
        • Classifiers
        • Classifiers-Old
        • CoconesofSpans
        • Connected
        • ConnectedTypes
        • CumulativeHierarchy
        • CumulativeHierarchy-LocallySmall
        • DependentEquality
        • DiscreteAndSeparated
        • Embeddings
        • Equiv
        • Equiv-FunExt
        • EquivalenceExamples
        • ExitPropTrunc
        • FundamentalLemmaOfTransportAlongEquivalences
        • FunExt
        • FunExt-from-Naive-FunExt
        • FunExt-Properties
        • Groupoids
        • Hedberg
        • HedbergApplications
        • HiddenSwap
        • HLevels
        • IdEmbedding
        • IdentitySystems
        • ImageAndSurjection
        • ImageAndSurjection-Variation
        • Knapp-UA
        • KrausLemma
        • LeftCancellable
        • Logic
        • Lower-FunExt
        • NotNotStablePropositions
        • PairFun
        • Powerset
        • Powerset-Fin
        • Powerset-MultiUniverse
        • Powerset-Resizing
        • PreSIP
        • PreSIP-Examples
        • PreUnivalence
        • PropIndexedPiSigma
        • PropTrunc
        • PropTrunc-Variation
        • Pullback
        • Pushouts
        • Replacement
        • Retracts
        • Retracts-FunExt
        • Section-Embedding
        • SemistrictIdentity
        • SequentialColimits
        • Sets
        • Sets-Properties
        • SetTrunc
        • SIP
        • SIP-Examples
        • SigmaIdentity
        • Singleton-Properties
        • Size
        • Size-TruncatedConnected
        • SmallnessProperties
        • Subsingletons
        • Subsingletons-FunExt
        • Subsingletons-Properties
        • SubtypeClassifier
        • SubtypeClassifier-Properties
        • TruncatedTypes
        • TruncationLevels
        • Truncations
        • UA-FunExt
        • Univalence
        • UniverseEmbedding
        • Universes
        • Yoneda
        • index
        • CantorCompact
        • CoNat-Equiv
        • CountableTychonoff
        • Haskell
        • Type-in-Type-False
        • index
        • CantorTheoremForEmbeddings
        • Dedekind
        • DedekindNonAxiomatic
        • DummettDisjunction
        • LawvereFPT
        • Lumsdaine
        • NatIsSetWithoutUniverse
        • NonCollapsibleFamily
        • Pataraia
        • Pataraia-Taylor
        • RootsOfBooleanFunctions
        • Types2019
        • UnivalenceFromScratch
        • index
        • Numbers
        • Paths
        • Properties
        • Type
        • index
        • Base
        • Cones
        • Idempotents
    1. Modules
    2. TWA
    3. Thesis
    4. Chapter2

    Vectors

    Todd Waugh Ambridge, January 2024
    
    # Vectors
    
    {-# OPTIONS --without-K --safe #-}
    
    open import MLTT.Spartan
    open import MLTT.SpartanList hiding ([_])
    open import Fin.Embeddings
    
    open import TWA.Thesis.Chapter2.Sequences
     hiding (head)
    
    module TWA.Thesis.Chapter2.Vectors where
    
    vec-map : {A : 𝓤 ̇ } {B : 𝓥 ̇ } {n : ℕ}
            → (A → B) → Vec A n → Vec B n
    vec-map {𝓤} {𝓥} {A} {B} {0} f ⟨⟩ = ⟨⟩
    vec-map {𝓤} {𝓥} {A} {B} {succ n} f (x :: v) = f x :: vec-map f v
    
    pattern [_] x = x :: ⟨⟩
    
    Vec-to-Seq : (n : ℕ) {X : ℕ → 𝓤 ̇ }
               → Π (X ∘ succ ^ n)
               → vec n (X ∘ ⟦_⟧)
               → Π X
    Vec-to-Seq 0 α ⟨⟩ = α
    Vec-to-Seq (succ n) α (x :: xs) 0 = x
    Vec-to-Seq (succ n) α (x :: xs) (succ i) = Vec-to-Seq n α xs i
    
    Seq-to-Vec : (n : ℕ) {X : ℕ → 𝓤 ̇ }
               → Π X
               → vec n (X ∘ ⟦_⟧)
    Seq-to-Vec 0 α = ⟨⟩
    Seq-to-Vec (succ n) α = α 0 :: Seq-to-Vec n (α ∘ succ)
    
    Seq-to-Vec-∼ : (n : ℕ) {X : ℕ → 𝓤 ̇ }
                 → (α : Π (X ∘ succ ^ n))
                 → (β : Π X)
                 → (β ∼ⁿ Vec-to-Seq n α (Seq-to-Vec n β)) n
    Seq-to-Vec-∼ (succ n) α β 0 i<n = refl
    Seq-to-Vec-∼ (succ n) α β (succ i) i<n
     = Seq-to-Vec-∼ n α (β ∘ succ) i i<n
    
    Made with Material for MkDocs