prod
Prod.assocFwd
Section titled “Prod.assocFwd”def assocFwd {A B C : Type} (p : A × (B × C)) : (A × B) × CReassociates a right-nested triple A × (B × C) into the left-nested (A × B) × C.
Prod.assocBwd
Section titled “Prod.assocBwd”def assocBwd {A B C : Type} (p : (A × B) × C) : A × (B × C)Reassociates a left-nested triple (A × B) × C into the right-nested A × (B × C).
Prod.swap
Section titled “Prod.swap”def swap {A B : Type} (p : A × B) : B × ASwaps the two components of a pair.
Prod.mapFst
Section titled “Prod.mapFst”def mapFst {A B C : Type} (f : A -> C) (p : A × B) : C × BApplies a function to the first component of a pair, keeping the second.
Prod.mapSnd
Section titled “Prod.mapSnd”def mapSnd {A B D : Type} (g : B -> D) (p : A × B) : A × DApplies a function to the second component of a pair, keeping the first.
Prod.prodSwapSwap
Section titled “Prod.prodSwapSwap”theorem prodSwapSwap {A B : Type} (p : A × B) : Prod.swap (Prod.swap p) = pSwapping a pair twice gives back the original pair.
Prod.prodAssocFwdBwd
Section titled “Prod.prodAssocFwdBwd”theorem prodAssocFwdBwd {A B C : Type} (p : A × (B × C)) : Prod.assocBwd (Prod.assocFwd p) = pReassociating right-to-left and back is the identity on right-nested triples.
Prod.prodAssocBwdFwd
Section titled “Prod.prodAssocBwdFwd”theorem prodAssocBwdFwd {A B C : Type} (p : (A × B) × C) : Prod.assocFwd (Prod.assocBwd p) = pReassociating left-to-right and back is the identity on left-nested triples.
Prod.prodMapFstId
Section titled “Prod.prodMapFstId”theorem prodMapFstId {A B : Type} (p : A × B) : Prod.mapFst (fun (a : A) => a) p = pMapping the identity over the first component leaves a pair unchanged.
Prod.prodMapSndId
Section titled “Prod.prodMapSndId”theorem prodMapSndId {A B : Type} (p : A × B) : Prod.mapSnd (fun (b : B) => b) p = pMapping the identity over the second component leaves a pair unchanged.
Prod.prodMapCompose
Section titled “Prod.prodMapCompose”theorem prodMapCompose {A B C D E F : Type} (f1 : A -> C) (f2 : C -> E) (g1 : B -> D) (g2 : D -> F) (p : A × B) : prodMap f2 g2 (prodMap f1 g1 p) = prodMap (fun (a : A) => f2 (f1 a)) (fun (b : B) => g2 (g1 b)) pMapping over a pair twice equals mapping once with the composed functions.
Prod.pairEta
Section titled “Prod.pairEta”theorem pairEta {A B : Type} (p : A × B) : (fst p, snd p) = pEta for pairs: rebuilding a pair from its projections gives the same pair.
Prod.curry
Section titled “Prod.curry”def curry {A B C : Type} (f : A × B -> C) (a : A) (b : B) : CCurries a function on pairs into a two-argument function.
Prod.uncurry
Section titled “Prod.uncurry”def uncurry {A B C : Type} (f : A -> B -> C) (p : A × B) : CUncurries a two-argument function into a function on pairs.
Prod.diag
Section titled “Prod.diag”def diag {A : Type} (a : A) : A × ADiagonal map: duplicates a value into a pair.
Prod.constFst
Section titled “Prod.constFst”def constFst {A B : Type} (p : A × B) : AFirst projection of a pair, as a named function.
Prod.constSnd
Section titled “Prod.constSnd”def constSnd {A B : Type} (p : A × B) : BSecond projection of a pair, as a named function.
Prod.bimap
Section titled “Prod.bimap”def bimap {A B C D : Type} (f : A -> C) (g : B -> D) (p : A × B) : C × DApplies one function to each component of a pair (same as prodMap).
Prod.apply
Section titled “Prod.apply”def apply {A B C D : Type} (fg : (A -> C) × (B -> D)) (p : A × B) : C × DApplies a pair of functions componentwise to a pair of arguments.
Prod.fanout
Section titled “Prod.fanout”def fanout {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : B × CApplies two functions to the same input and pairs the results.
Prod.dup
Section titled “Prod.dup”def dup {A B : Type} (f : A -> B) (p : A × A) : B × BApplies one function to both components of a homogeneous pair.
Prod.flip
Section titled “Prod.flip”def flip {A B C : Type} (f : A × B -> C) (p : B × A) : CTurns a function on A × B into a function on B × A by swapping the input.
Prod.id
Section titled “Prod.id”def id {A B : Type} (p : A × B) : A × BIdentity function on pairs.
Prod.composeFst
Section titled “Prod.composeFst”def composeFst {A B C : Type} (f : B -> C) (p : A × B) : A × CApplies a function to the second component of a pair, keeping the first.
Prod.composeSnd
Section titled “Prod.composeSnd”def composeSnd {A B C : Type} (f : A -> C) (p : A × B) : C × BApplies a function to the first component of a pair, keeping the second.
Prod.nestRight
Section titled “Prod.nestRight”def nestRight {A B C : Type} (a : A) (b : B) (c : C) : A × (B × C)Builds a right-nested triple A × (B × C) from three values.
Prod.nestLeft
Section titled “Prod.nestLeft”def nestLeft {A B C : Type} (a : A) (b : B) (c : C) : (A × B) × CBuilds a left-nested triple (A × B) × C from three values.
Prod.strengthL
Section titled “Prod.strengthL”def strengthL {A B : Type} (a : A) (b : B) : A × BPairs a value with a fixed first component (the plain pair constructor).
Prod.strengthR
Section titled “Prod.strengthR”def strengthR {A B : Type} (a : A) (b : B) : A × BPairs a value with a fixed second component (the plain pair constructor).
Prod.distribFst
Section titled “Prod.distribFst”def distribFst {A B C : Type} (f : A -> B -> C) (p : A × B) : CApplies a two-argument function to the components of a pair.
Prod.prodCurryCompute
Section titled “Prod.prodCurryCompute”theorem prodCurryCompute {A B C : Type} (f : A × B -> C) (a : A) (b : B) : Prod.curry f a b = f (a, b)Prod.curry f a b computes to f (a, b).
Prod.prodUncurryCompute
Section titled “Prod.prodUncurryCompute”theorem prodUncurryCompute {A B C : Type} (f : A -> B -> C) (a : A) (b : B) : Prod.uncurry f (a, b) = f a bProd.uncurry f (a, b) computes to f a b.
Prod.prodCurryUncurry
Section titled “Prod.prodCurryUncurry”theorem prodCurryUncurry {A B C : Type} (f : A -> B -> C) (a : A) (b : B) : Prod.curry (Prod.uncurry f) a b = f a bCurrying an uncurried function gives back the original function pointwise.
Prod.prodUncurryCurry
Section titled “Prod.prodUncurryCurry”theorem prodUncurryCurry {A B C : Type} (f : A × B -> C) (a : A) (b : B) : Prod.uncurry (Prod.curry f) (a, b) = f (a, b)Uncurrying a curried function gives back the original function on every pair.
Prod.prodDiagFst
Section titled “Prod.prodDiagFst”theorem prodDiagFst {A : Type} (a : A) : fst (Prod.diag a) = aThe first component of the diagonal pair is the original value.
Prod.prodDiagSnd
Section titled “Prod.prodDiagSnd”theorem prodDiagSnd {A : Type} (a : A) : snd (Prod.diag a) = aThe second component of the diagonal pair is the original value.
Prod.prodDiagCompute
Section titled “Prod.prodDiagCompute”theorem prodDiagCompute {A : Type} (a : A) : Prod.diag a = (a, a)Prod.diag a computes to (a, a).
Prod.prodSwapDiag
Section titled “Prod.prodSwapDiag”theorem prodSwapDiag {A : Type} (a : A) : Prod.swap (Prod.diag a) = Prod.diag aSwapping a diagonal pair leaves it unchanged.
Prod.prodBimapCompute
Section titled “Prod.prodBimapCompute”theorem prodBimapCompute {A B C D : Type} (f : A -> C) (g : B -> D) (a : A) (b : B) : Prod.bimap f g (a, b) = (f a, g b)Prod.bimap f g (a, b) computes to (f a, g b).
Prod.prodBimapId
Section titled “Prod.prodBimapId”theorem prodBimapId {A B : Type} (p : A × B) : Prod.bimap (fun (a : A) => a) (fun (b : B) => b) p = pProd.bimap with identity functions leaves a pair unchanged.
Prod.prodBimapCompose
Section titled “Prod.prodBimapCompose”theorem prodBimapCompose {A B C D E F : Type} (f1 : A -> C) (f2 : C -> E) (g1 : B -> D) (g2 : D -> F) (p : A × B) : Prod.bimap f2 g2 (Prod.bimap f1 g1 p) = Prod.bimap (fun (a : A) => f2 (f1 a)) (fun (b : B) => g2 (g1 b)) pApplying Prod.bimap twice equals applying it once with the composed functions.
Prod.prodBimapEqProdMap
Section titled “Prod.prodBimapEqProdMap”theorem prodBimapEqProdMap {A B C D : Type} (f : A -> C) (g : B -> D) (p : A × B) : Prod.bimap f g p = prodMap f g pProd.bimap agrees with prodMap.
Prod.prodFanoutCompute
Section titled “Prod.prodFanoutCompute”theorem prodFanoutCompute {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : Prod.fanout f g a = (f a, g a)Prod.fanout f g a computes to (f a, g a).
Prod.prodFanoutFst
Section titled “Prod.prodFanoutFst”theorem prodFanoutFst {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : fst (Prod.fanout f g a) = f aThe first component of Prod.fanout f g a is f a.
Prod.prodFanoutSnd
Section titled “Prod.prodFanoutSnd”theorem prodFanoutSnd {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : snd (Prod.fanout f g a) = g aThe second component of Prod.fanout f g a is g a.
Prod.prodApplyCompute
Section titled “Prod.prodApplyCompute”theorem prodApplyCompute {A B C D : Type} (f : A -> C) (g : B -> D) (a : A) (b : B) : Prod.apply (f, g) (a, b) = (f a, g b)Prod.apply (f, g) (a, b) computes to (f a, g b).
Prod.prodDupCompute
Section titled “Prod.prodDupCompute”theorem prodDupCompute {A B : Type} (f : A -> B) (a1 : A) (a2 : A) : Prod.dup f (a1, a2) = (f a1, f a2)Prod.dup f (a1, a2) computes to (f a1, f a2).
Prod.prodDupId
Section titled “Prod.prodDupId”theorem prodDupId {A : Type} (p : A × A) : Prod.dup (fun (a : A) => a) p = pProd.dup with the identity leaves a pair unchanged.
Prod.prodFlipCompute
Section titled “Prod.prodFlipCompute”theorem prodFlipCompute {A B C : Type} (f : A × B -> C) (a : A) (b : B) : Prod.flip f (b, a) = f (a, b)Prod.flip f on a swapped pair (b, a) computes to f (a, b).
Prod.prodIdCompute
Section titled “Prod.prodIdCompute”theorem prodIdCompute {A B : Type} (p : A × B) : Prod.id p = pProd.id returns its argument.
Prod.prodNestRightCompute
Section titled “Prod.prodNestRightCompute”theorem prodNestRightCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.nestRight a b c = (a, (b, c))Prod.nestRight a b c computes to (a, (b, c)).
Prod.prodNestLeftCompute
Section titled “Prod.prodNestLeftCompute”theorem prodNestLeftCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.nestLeft a b c = ((a, b), c)Prod.nestLeft a b c computes to ((a, b), c).
Prod.prodNestRightFst
Section titled “Prod.prodNestRightFst”theorem prodNestRightFst {A B C : Type} (a : A) (b : B) (c : C) : fst (Prod.nestRight a b c) = aThe first component of a right-nested triple is its first value.
Prod.prodNestLeftSnd
Section titled “Prod.prodNestLeftSnd”theorem prodNestLeftSnd {A B C : Type} (a : A) (b : B) (c : C) : snd (Prod.nestLeft a b c) = cThe second component of a left-nested triple is its last value.
Prod.prodDistribFstCompute
Section titled “Prod.prodDistribFstCompute”theorem prodDistribFstCompute {A B C : Type} (f : A -> B -> C) (a : A) (b : B) : Prod.distribFst f (a, b) = f a bProd.distribFst f (a, b) computes to f a b.
Prod.prodComposeFstCompute
Section titled “Prod.prodComposeFstCompute”theorem prodComposeFstCompute {A B C : Type} (f : B -> C) (a : A) (b : B) : Prod.composeFst f (a, b) = (a, f b)Prod.composeFst f (a, b) computes to (a, f b).
Prod.prodComposeSndCompute
Section titled “Prod.prodComposeSndCompute”theorem prodComposeSndCompute {A B C : Type} (f : A -> C) (a : A) (b : B) : Prod.composeSnd f (a, b) = (f a, b)Prod.composeSnd f (a, b) computes to (f a, b).
Prod.prodSwapMap
Section titled “Prod.prodSwapMap”theorem prodSwapMap {A B C D : Type} (f : A -> C) (g : B -> D) (p : A × B) : Prod.swap (prodMap f g p) = prodMap g f (Prod.swap p)Swapping after mapping equals mapping with the functions exchanged after swapping.
Prod.fstProdSwap
Section titled “Prod.fstProdSwap”theorem fstProdSwap {A B : Type} (p : A × B) : fst (Prod.swap p) = snd pThe first component of a swapped pair is the original second component.
Prod.sndProdSwap
Section titled “Prod.sndProdSwap”theorem sndProdSwap {A B : Type} (p : A × B) : snd (Prod.swap p) = fst pThe second component of a swapped pair is the original first component.
Prod.prodSwapPair
Section titled “Prod.prodSwapPair”theorem prodSwapPair {A B : Type} (a : A) (b : B) : Prod.swap (a, b) = (b, a)Prod.swap (a, b) computes to (b, a).
Prod.prodAssocFwdPair
Section titled “Prod.prodAssocFwdPair”theorem prodAssocFwdPair {A B C : Type} (a : A) (b : B) (c : C) : Prod.assocFwd (a, (b, c)) = ((a, b), c)Prod.assocFwd (a, (b, c)) computes to ((a, b), c).
Prod.prodAssocBwdPair
Section titled “Prod.prodAssocBwdPair”theorem prodAssocBwdPair {A B C : Type} (a : A) (b : B) (c : C) : Prod.assocBwd ((a, b), c) = (a, (b, c))Prod.assocBwd ((a, b), c) computes to (a, (b, c)).
Prod.prodMapFstCompose
Section titled “Prod.prodMapFstCompose”theorem prodMapFstCompose {A B C D : Type} (f : A -> C) (g : C -> D) (p : A × B) : Prod.mapFst g (Prod.mapFst f p) = Prod.mapFst (fun (a : A) => g (f a)) pMapping the first component twice equals mapping it once with the composed function.
Prod.prodMapSndCompose
Section titled “Prod.prodMapSndCompose”theorem prodMapSndCompose {A B C D : Type} (f : B -> C) (g : C -> D) (p : A × B) : Prod.mapSnd g (Prod.mapSnd f p) = Prod.mapSnd (fun (b : B) => g (f b)) pMapping the second component twice equals mapping it once with the composed function.
Prod.prodMapFstPair
Section titled “Prod.prodMapFstPair”theorem prodMapFstPair {A B C : Type} (f : A -> C) (a : A) (b : B) : Prod.mapFst f (a, b) = (f a, b)Prod.mapFst f (a, b) computes to (f a, b).
Prod.prodMapSndPair
Section titled “Prod.prodMapSndPair”theorem prodMapSndPair {A B D : Type} (g : B -> D) (a : A) (b : B) : Prod.mapSnd g (a, b) = (a, g b)Prod.mapSnd g (a, b) computes to (a, g b).
Prod.first
Section titled “Prod.first”def first {A B C : Type} (p : A × (B × C)) : AFirst component of a right-nested triple.
Prod.second
Section titled “Prod.second”def second {A B C : Type} (p : A × (B × C)) : BSecond component of a right-nested triple.
Prod.third
Section titled “Prod.third”def third {A B C : Type} (p : A × (B × C)) : CThird component of a right-nested triple.
Prod.mkTriple
Section titled “Prod.mkTriple”def mkTriple {A B C : Type} (a : A) (b : B) (c : C) : A × (B × C)Builds a right-nested triple from three values.
Prod.mapTriple
Section titled “Prod.mapTriple”def mapTriple {A B C D E F : Type} (f : A -> D) (g : B -> E) (h : C -> F) (p : A × (B × C)) : D × (E × F)Applies three functions componentwise to a right-nested triple.
Prod.swapTriple12
Section titled “Prod.swapTriple12”def swapTriple12 {A B C : Type} (p : A × (B × C)) : B × (A × C)Swaps the first and second components of a right-nested triple.
Prod.swapTriple13
Section titled “Prod.swapTriple13”def swapTriple13 {A B C : Type} (p : A × (B × C)) : C × (B × A)Swaps the first and third components of a right-nested triple.
Prod.swapTriple23
Section titled “Prod.swapTriple23”def swapTriple23 {A B C : Type} (p : A × (B × C)) : A × (C × B)Swaps the second and third components of a right-nested triple.
Prod.replFst
Section titled “Prod.replFst”def replFst {A B C : Type} (c : C) (p : A × B) : C × BReplaces the first component of a pair with a given value.
Prod.replSnd
Section titled “Prod.replSnd”def replSnd {A B C : Type} (c : C) (p : A × B) : A × CReplaces the second component of a pair with a given value.
Prod.zipWith
Section titled “Prod.zipWith”def zipWith {A B C D E F : Type} (f : A -> C -> E) (g : B -> D -> F) (p1 : A × B) (p2 : C × D) : E × FCombines two pairs componentwise using one binary function per component.
Prod.const2
Section titled “Prod.const2”def const2 {A B : Type} (a : A) (b : B) : A × BPairs two given values (the plain pair constructor).
Prod.prodFirstCompute
Section titled “Prod.prodFirstCompute”theorem prodFirstCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.first (a, (b, c)) = aProd.first (a, (b, c)) computes to a.
Prod.prodSecondCompute
Section titled “Prod.prodSecondCompute”theorem prodSecondCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.second (a, (b, c)) = bProd.second (a, (b, c)) computes to b.
Prod.prodThirdCompute
Section titled “Prod.prodThirdCompute”theorem prodThirdCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.third (a, (b, c)) = cProd.third (a, (b, c)) computes to c.
Prod.prodMkTripleCompute
Section titled “Prod.prodMkTripleCompute”theorem prodMkTripleCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.mkTriple a b c = (a, (b, c))Prod.mkTriple a b c computes to (a, (b, c)).
Prod.prodFirstMkTriple
Section titled “Prod.prodFirstMkTriple”theorem prodFirstMkTriple {A B C : Type} (a : A) (b : B) (c : C) : Prod.first (Prod.mkTriple a b c) = aProd.first of a triple built by Prod.mkTriple is its first value.
Prod.prodSecondMkTriple
Section titled “Prod.prodSecondMkTriple”theorem prodSecondMkTriple {A B C : Type} (a : A) (b : B) (c : C) : Prod.second (Prod.mkTriple a b c) = bProd.second of a triple built by Prod.mkTriple is its second value.
Prod.prodThirdMkTriple
Section titled “Prod.prodThirdMkTriple”theorem prodThirdMkTriple {A B C : Type} (a : A) (b : B) (c : C) : Prod.third (Prod.mkTriple a b c) = cProd.third of a triple built by Prod.mkTriple is its third value.
Prod.prodMapTripleCompute
Section titled “Prod.prodMapTripleCompute”theorem prodMapTripleCompute {A B C D E F : Type} (f : A -> D) (g : B -> E) (h : C -> F) (a : A) (b : B) (c : C) : Prod.mapTriple f g h (a, (b, c)) = (f a, (g b, h c))Prod.mapTriple f g h applies each function to the matching component.
Prod.prodMapTripleId
Section titled “Prod.prodMapTripleId”theorem prodMapTripleId {A B C : Type} (p : A × (B × C)) : Prod.mapTriple (fun (a : A) => a) (fun (b : B) => b) (fun (c : C) => c) p = pProd.mapTriple with identity functions leaves a triple unchanged.
Prod.prodSwapTriple12Compute
Section titled “Prod.prodSwapTriple12Compute”theorem prodSwapTriple12Compute {A B C : Type} (a : A) (b : B) (c : C) : Prod.swapTriple12 (a, (b, c)) = (b, (a, c))Prod.swapTriple12 (a, (b, c)) computes to (b, (a, c)).
Prod.prodSwapTriple13Compute
Section titled “Prod.prodSwapTriple13Compute”theorem prodSwapTriple13Compute {A B C : Type} (a : A) (b : B) (c : C) : Prod.swapTriple13 (a, (b, c)) = (c, (b, a))Prod.swapTriple13 (a, (b, c)) computes to (c, (b, a)).
Prod.prodSwapTriple23Compute
Section titled “Prod.prodSwapTriple23Compute”theorem prodSwapTriple23Compute {A B C : Type} (a : A) (b : B) (c : C) : Prod.swapTriple23 (a, (b, c)) = (a, (c, b))Prod.swapTriple23 (a, (b, c)) computes to (a, (c, b)).
Prod.prodReplFstCompute
Section titled “Prod.prodReplFstCompute”theorem prodReplFstCompute {A B C : Type} (c : C) (a : A) (b : B) : Prod.replFst c (a, b) = (c, b)Prod.replFst c (a, b) computes to (c, b).
Prod.prodReplSndCompute
Section titled “Prod.prodReplSndCompute”theorem prodReplSndCompute {A B C : Type} (c : C) (a : A) (b : B) : Prod.replSnd c (a, b) = (a, c)Prod.replSnd c (a, b) computes to (a, c).
Prod.fstReplFst
Section titled “Prod.fstReplFst”theorem fstReplFst {A B C : Type} (c : C) (p : A × B) : fst (Prod.replFst c p) = cAfter replacing the first component, the first projection is the new value.
Prod.sndReplFst
Section titled “Prod.sndReplFst”theorem sndReplFst {A B C : Type} (c : C) (p : A × B) : snd (Prod.replFst c p) = snd pReplacing the first component leaves the second component unchanged.
Prod.fstReplSnd
Section titled “Prod.fstReplSnd”theorem fstReplSnd {A B C : Type} (c : C) (p : A × B) : fst (Prod.replSnd c p) = fst pReplacing the second component leaves the first component unchanged.
Prod.sndReplSnd
Section titled “Prod.sndReplSnd”theorem sndReplSnd {A B C : Type} (c : C) (p : A × B) : snd (Prod.replSnd c p) = cAfter replacing the second component, the second projection is the new value.
Prod.prodZipWithCompute
Section titled “Prod.prodZipWithCompute”theorem prodZipWithCompute {A B C D E F : Type} (f : A -> C -> E) (g : B -> D -> F) (a : A) (b : B) (c : C) (d : D) : Prod.zipWith f g (a, b) (c, d) = (f a c, g b d)Prod.zipWith f g (a, b) (c, d) computes to (f a c, g b d).
Prod.fst3L
Section titled “Prod.fst3L”def fst3L {A B C : Type} (p : (A × B) × C) : AFirst component of a left-nested triple.
Prod.snd3L
Section titled “Prod.snd3L”def snd3L {A B C : Type} (p : (A × B) × C) : BSecond component of a left-nested triple.
Prod.thd3L
Section titled “Prod.thd3L”def thd3L {A B C : Type} (p : (A × B) × C) : CThird component of a left-nested triple.
Prod.mapAll
Section titled “Prod.mapAll”def mapAll {A B : Type} (f : A -> B) (p : A × A) : B × BApplies one function to both components of a homogeneous pair.
Prod.fold
Section titled “Prod.fold”def fold {A B : Type} (f : A -> A -> B) (p : A × A) : BCombines the two components of a homogeneous pair with a binary function.
Prod.rotateL
Section titled “Prod.rotateL”def rotateL {A B C : Type} (p : A × (B × C)) : B × (C × A)Rotates a right-nested triple left: (a, (b, c)) becomes (b, (c, a)).
Prod.rotateR
Section titled “Prod.rotateR”def rotateR {A B C : Type} (p : A × (B × C)) : C × (A × B)Rotates a right-nested triple right: (a, (b, c)) becomes (c, (a, b)).
Prod.prodFst3LCompute
Section titled “Prod.prodFst3LCompute”theorem prodFst3LCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.fst3L ((a, b), c) = aProd.fst3L ((a, b), c) computes to a.
Prod.prodSnd3LCompute
Section titled “Prod.prodSnd3LCompute”theorem prodSnd3LCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.snd3L ((a, b), c) = bProd.snd3L ((a, b), c) computes to b.
Prod.prodThd3LCompute
Section titled “Prod.prodThd3LCompute”theorem prodThd3LCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.thd3L ((a, b), c) = cProd.thd3L ((a, b), c) computes to c.
Prod.prodMapAllCompute
Section titled “Prod.prodMapAllCompute”theorem prodMapAllCompute {A B : Type} (f : A -> B) (a1 : A) (a2 : A) : Prod.mapAll f (a1, a2) = (f a1, f a2)Prod.mapAll f (a1, a2) computes to (f a1, f a2).
Prod.prodMapAllId
Section titled “Prod.prodMapAllId”theorem prodMapAllId {A : Type} (p : A × A) : Prod.mapAll (fun (a : A) => a) p = pProd.mapAll with the identity leaves a pair unchanged.
Prod.prodFoldCompute
Section titled “Prod.prodFoldCompute”theorem prodFoldCompute {A B : Type} (f : A -> A -> B) (a1 : A) (a2 : A) : Prod.fold f (a1, a2) = f a1 a2Prod.fold f (a1, a2) computes to f a1 a2.
Prod.prodRotateLCompute
Section titled “Prod.prodRotateLCompute”theorem prodRotateLCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.rotateL (a, (b, c)) = (b, (c, a))Prod.rotateL (a, (b, c)) computes to (b, (c, a)).
Prod.prodRotateRCompute
Section titled “Prod.prodRotateRCompute”theorem prodRotateRCompute {A B C : Type} (a : A) (b : B) (c : C) : Prod.rotateR (a, (b, c)) = (c, (a, b))Prod.rotateR (a, (b, c)) computes to (c, (a, b)).
Prod.prodRotateL3
Section titled “Prod.prodRotateL3”theorem prodRotateL3 {A B C : Type} (a : A) (b : B) (c : C) : Prod.rotateL (Prod.rotateL (Prod.rotateL (a, (b, c)))) = (a, (b, c))Rotating a triple left three times gives back the original triple.
Prod.prodRotateR3
Section titled “Prod.prodRotateR3”theorem prodRotateR3 {A B C : Type} (a : A) (b : B) (c : C) : Prod.rotateR (Prod.rotateR (Prod.rotateR (a, (b, c)))) = (a, (b, c))Rotating a triple right three times gives back the original triple.
Prod.unitLFwd
Section titled “Prod.unitLFwd”def unitLFwd {A : Type} (p : A × Unit) : AForward map of A × Unit ≅ A: drops the unit component.
Prod.unitLBwd
Section titled “Prod.unitLBwd”def unitLBwd {A : Type} (a : A) : A × UnitBackward map of A × Unit ≅ A: pairs a value with unit.
Prod.unitRFwd
Section titled “Prod.unitRFwd”def unitRFwd {A : Type} (p : Unit × A) : AForward map of Unit × A ≅ A: drops the unit component.
Prod.unitRBwd
Section titled “Prod.unitRBwd”def unitRBwd {A : Type} (a : A) : Unit × ABackward map of Unit × A ≅ A: pairs unit with a value.
Prod.prodUnitLRoundTrip
Section titled “Prod.prodUnitLRoundTrip”theorem prodUnitLRoundTrip {A : Type} (a : A) : Prod.unitLFwd (Prod.unitLBwd a) = aPairing with unit on the right and then dropping it gives back the value.
Prod.prodUnitRRoundTrip
Section titled “Prod.prodUnitRRoundTrip”theorem prodUnitRRoundTrip {A : Type} (a : A) : Prod.unitRFwd (Prod.unitRBwd a) = aPairing with unit on the left and then dropping it gives back the value.
Prod.flatten4RtoL
Section titled “Prod.flatten4RtoL”def flatten4RtoL {A B C D : Type} (p : A × (B × (C × D))) : ((A × B) × C) × DReassociates a right-nested quadruple into a left-nested one.
Prod.flatten4LtoR
Section titled “Prod.flatten4LtoR”def flatten4LtoR {A B C D : Type} (p : ((A × B) × C) × D) : A × (B × (C × D))Reassociates a left-nested quadruple into a right-nested one.
Prod.prodFlatten4RoundTrip1
Section titled “Prod.prodFlatten4RoundTrip1”theorem prodFlatten4RoundTrip1 {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.flatten4LtoR (Prod.flatten4RtoL (a, (b, (c, d)))) = (a, (b, (c, d)))Reassociating a right-nested quadruple to the left and back gives it back.
Prod.prodFlatten4RoundTrip2
Section titled “Prod.prodFlatten4RoundTrip2”theorem prodFlatten4RoundTrip2 {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.flatten4RtoL (Prod.flatten4LtoR (((a, b), c), d)) = (((a, b), c), d)Reassociating a left-nested quadruple to the right and back gives it back.
Prod.prodMapIdId
Section titled “Prod.prodMapIdId”theorem prodMapIdId {A B : Type} (p : A × B) : prodMap (fun (a : A) => a) (fun (b : B) => b) p = pFunctor identity law: prodMap with identity functions leaves a pair unchanged.
Prod.prodMapPair
Section titled “Prod.prodMapPair”theorem prodMapPair {A B C D : Type} (f : A -> C) (g : B -> D) (a : A) (b : B) : prodMap f g (a, b) = (f a, g b)prodMap f g (a, b) computes to (f a, g b).
Prod.pairCongFst
Section titled “Prod.pairCongFst”def pairCongFst {A B : Type} (a1 : A) (a2 : A) (b : B) (h : a1 = a2) : (a1, b) = (a2, b)Equal first components give equal pairs with the same second component.
Prod.pairCongSnd
Section titled “Prod.pairCongSnd”def pairCongSnd {A B : Type} (a : A) (b1 : B) (b2 : B) (h : b1 = b2) : (a, b1) = (a, b2)Equal second components give equal pairs with the same first component.
Prod.prodCurryApp
Section titled “Prod.prodCurryApp”theorem prodCurryApp {A B C : Type} (f : A × B -> C) (p : A × B) : Prod.curry f (fst p) (snd p) = f pCurrying a function and applying it to a pair’s components equals applying the function to the pair.
Prod.prodUncurrySwapNat
Section titled “Prod.prodUncurrySwapNat”theorem prodUncurrySwapNat (a : Nat) (b : Nat) : Prod.uncurry (fun (x : Nat) => fun (y : Nat) => add y x) (a, b) = add b aExample: uncurrying addition with swapped arguments on (a, b) gives add b a.
Prod.prodSwapAssocFwd
Section titled “Prod.prodSwapAssocFwd”theorem prodSwapAssocFwd {A B C : Type} (a : A) (b : B) (c : C) : Prod.swap (Prod.assocFwd (a, (b, c))) = (c, (a, b))Swapping after reassociating (a, (b, c)) to the left gives (c, (a, b)).
Prod.prodSwapAssocBwd
Section titled “Prod.prodSwapAssocBwd”theorem prodSwapAssocBwd {A B C : Type} (a : A) (b : B) (c : C) : Prod.swap (Prod.assocBwd ((a, b), c)) = ((b, c), a)Swapping after reassociating ((a, b), c) to the right gives ((b, c), a).
Prod.both
Section titled “Prod.both”def both {A B : Type} (f : A -> B) (p : A × A) : B × BApplies one function to both components of a homogeneous pair (same as Prod.mapAll).
Prod.unpair
Section titled “Prod.unpair”def unpair {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : B × CSplits a value into a pair using two functions (same as Prod.fanout).
Prod.elim
Section titled “Prod.elim”def elim {A B C : Type} (f : A -> B -> C) (p : A × B) : CCombines the components of a pair with a two-argument function (same as Prod.uncurry).
Prod.const
Section titled “Prod.const”def const {A : Type} (a : A) : A × ADuplicates a value into a pair (same as Prod.diag).
Prod.arrowPair
Section titled “Prod.arrowPair”def arrowPair {A B C : Type} (f : A -> B -> C) (p : A × B) (q : A × B) : C × CApplies a two-argument function to the components of each of two pairs and pairs the results.
Prod.prodBothCompute
Section titled “Prod.prodBothCompute”theorem prodBothCompute {A B : Type} (f : A -> B) (a1 : A) (a2 : A) : Prod.both f (a1, a2) = (f a1, f a2)Prod.both f (a1, a2) computes to (f a1, f a2).
Prod.prodBothId
Section titled “Prod.prodBothId”theorem prodBothId {A : Type} (p : A × A) : Prod.both (fun (a : A) => a) p = pProd.both with the identity leaves a pair unchanged.
Prod.prodUnpairCompute
Section titled “Prod.prodUnpairCompute”theorem prodUnpairCompute {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : Prod.unpair f g a = (f a, g a)Prod.unpair f g a computes to (f a, g a).
Prod.prodWithCompute
Section titled “Prod.prodWithCompute”theorem prodWithCompute {A B C : Type} (f : A -> B -> C) (a : A) (b : B) : Prod.elim f (a, b) = f a bProd.elim f (a, b) computes to f a b.
Prod.prodConstCompute
Section titled “Prod.prodConstCompute”theorem prodConstCompute {A : Type} (a : A) : Prod.const a = (a, a)Prod.const a computes to (a, a).
Prod.prodArrowPairCompute
Section titled “Prod.prodArrowPairCompute”theorem prodArrowPairCompute {A B C : Type} (f : A -> B -> C) (a1 : A) (b1 : B) (a2 : A) (b2 : B) : Prod.arrowPair f (a1, b1) (a2, b2) = (f a1 b1, f a2 b2)Prod.arrowPair f (a1, b1) (a2, b2) computes to (f a1 b1, f a2 b2).
Prod.mkQuad
Section titled “Prod.mkQuad”def mkQuad {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : A × (B × (C × D))Builds a right-nested quadruple from four values.
Prod.quadFst
Section titled “Prod.quadFst”def quadFst {A B C D : Type} (p : A × (B × (C × D))) : AFirst component of a right-nested quadruple.
Prod.quadSnd
Section titled “Prod.quadSnd”def quadSnd {A B C D : Type} (p : A × (B × (C × D))) : BSecond component of a right-nested quadruple.
Prod.quadThd
Section titled “Prod.quadThd”def quadThd {A B C D : Type} (p : A × (B × (C × D))) : CThird component of a right-nested quadruple.
Prod.quadFth
Section titled “Prod.quadFth”def quadFth {A B C D : Type} (p : A × (B × (C × D))) : DFourth component of a right-nested quadruple.
Prod.mapQuad
Section titled “Prod.mapQuad”def mapQuad {A B C D E F G H : Type} (f : A -> E) (g : B -> F) (h : C -> G) (k : D -> H) (p : A × (B × (C × D))) : E × (F × (G × H))Applies four functions componentwise to a right-nested quadruple.
Prod.prodMkQuadCompute
Section titled “Prod.prodMkQuadCompute”theorem prodMkQuadCompute {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.mkQuad a b c d = (a, (b, (c, d)))Prod.mkQuad a b c d computes to (a, (b, (c, d))).
Prod.prodQuadFstCompute
Section titled “Prod.prodQuadFstCompute”theorem prodQuadFstCompute {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.quadFst (Prod.mkQuad a b c d) = aProd.quadFst of a quadruple built by Prod.mkQuad is its first value.
Prod.prodQuadSndCompute
Section titled “Prod.prodQuadSndCompute”theorem prodQuadSndCompute {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.quadSnd (Prod.mkQuad a b c d) = bProd.quadSnd of a quadruple built by Prod.mkQuad is its second value.
Prod.prodQuadThdCompute
Section titled “Prod.prodQuadThdCompute”theorem prodQuadThdCompute {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.quadThd (Prod.mkQuad a b c d) = cProd.quadThd of a quadruple built by Prod.mkQuad is its third value.
Prod.prodQuadFthCompute
Section titled “Prod.prodQuadFthCompute”theorem prodQuadFthCompute {A B C D : Type} (a : A) (b : B) (c : C) (d : D) : Prod.quadFth (Prod.mkQuad a b c d) = dProd.quadFth of a quadruple built by Prod.mkQuad is its fourth value.
Prod.prodMapQuadCompute
Section titled “Prod.prodMapQuadCompute”theorem prodMapQuadCompute {A B C D E F G H : Type} (f : A -> E) (g : B -> F) (h : C -> G) (k : D -> H) (a : A) (b : B) (c : C) (d : D) : Prod.mapQuad f g h k (a, (b, (c, d))) = (f a, (g b, (h c, k d)))Prod.mapQuad f g h k applies each function to the matching component.
Prod.prodMapQuadId
Section titled “Prod.prodMapQuadId”theorem prodMapQuadId {A B C D : Type} (p : A × (B × (C × D))) : Prod.mapQuad (fun (a : A) => a) (fun (b : B) => b) (fun (c : C) => c) (fun (d : D) => d) p = pProd.mapQuad with identity functions leaves a quadruple unchanged.
Prod.prodBothCompose
Section titled “Prod.prodBothCompose”theorem prodBothCompose {A B C : Type} (f : A -> B) (g : B -> C) (p : A × A) : Prod.both g (Prod.both f p) = Prod.both (fun (a : A) => g (f a)) pApplying Prod.both twice equals applying it once with the composed function.
Prod.prodWithEqUncurry
Section titled “Prod.prodWithEqUncurry”theorem prodWithEqUncurry {A B C : Type} (f : A -> B -> C) (p : A × B) : Prod.elim f p = Prod.uncurry f pProd.elim agrees with Prod.uncurry.
Prod.prodUnpairEqFanout
Section titled “Prod.prodUnpairEqFanout”theorem prodUnpairEqFanout {A B C : Type} (f : A -> B) (g : A -> C) (a : A) : Prod.unpair f g a = Prod.fanout f g aProd.unpair agrees with Prod.fanout.
Prod.prodConstEqDiag
Section titled “Prod.prodConstEqDiag”theorem prodConstEqDiag {A : Type} (a : A) : Prod.const a = Prod.diag aProd.const agrees with Prod.diag.
Prod.prodBothEqDup
Section titled “Prod.prodBothEqDup”theorem prodBothEqDup {A B : Type} (f : A -> B) (p : A × A) : Prod.both f p = Prod.dup f pProd.both agrees with Prod.dup.