module Cat.Instances.OFE.Product where
Products of OFEsð
The category of OFEs admits products: the relations are, levelwise, pairwise! That is, if and Distributing the axioms over products is enough to establish that this is actually an OFE.
open OFE-Notation module _ {âa âb âa' âb'} {A : Type âa} {B : Type âb} (O : OFE-on âa' A) (P : OFE-on âb' B) where private instance _ = O _ = P module O = OFE-on O module P = OFE-on P
Ã-OFE : OFE-on (âa' â âb') (A à B) Ã-OFE .within n (x , y) (x' , y') = (x â[ n ] x') à (y â[ n ] y') Ã-OFE .has-is-ofe .has-is-prop n x y = hlevel 1 Ã-OFE .has-is-ofe .â-refl n = O.â-refl n , P.â-refl n Ã-OFE .has-is-ofe .â-sym n (p , q) = O.â-sym n p , P.â-sym n q Ã-OFE .has-is-ofe .â-trans n (p , q) (p' , q') = O.â-trans n p p' , P.â-trans n q q' Ã-OFE .has-is-ofe .bounded (a , b) (a' , b') = O.bounded a a' , P.bounded b b' Ã-OFE .has-is-ofe .step n _ _ (p , p') = O.step n _ _ p , P.step n _ _ p' Ã-OFE .has-is-ofe .limit x y f = apâ _,_ (O.limit _ _ λ n â f n .fst) (P.limit _ _ λ n â f n .snd)
By construction, this OFE is actually the proper categorical product of the OFE structures we started with: since this is a very concrete category, most of the reasoning piggy-backs off of that for types, which is almost definitional. Other than the noise inherent to formalisation, the argument is immediate:
OFE-Product : â {â â'} A B â Product (OFEs â â') A B OFE-Product A B .apex = from-ofe-on (Ã-OFE (A .snd) (B .snd)) OFE-Product A B .Ïâ .hom = fst OFE-Product A B .Ïâ .preserves .pres-â = fst OFE-Product A B .Ïâ .hom = snd OFE-Product A B .Ïâ .preserves .pres-â = snd OFE-Product A B .has-is-product .âš_,_â© f g .hom x = f # x , g # x OFE-Product A B .has-is-product .âš_,_â© f g .preserves .pres-â p = f .preserves .pres-â p , g .preserves .pres-â p OFE-Product A B .has-is-product .Ïâââšâ© = trivial! OFE-Product A B .has-is-product .Ïâââšâ© = trivial! OFE-Product A B .has-is-product .unique p q = ext λ x â p #â x , q #â x
module _ {âi âf âr} {I : Type âi} (F : I â Type âf) (P : â i â OFE-on âr (F i)) where private instance P-ofe : â {i} â OFE-on âr (F i) P-ofe {i} = P i module P {i} = OFE-on (P i)
Indexed productsð
We now turn to a slightly more complicated case: indexed products of OFEs: because Agda is, by default, a predicative theory, we run into some issues with universe levels when defining the indexed product. Letâs see them:
Suppose we have an index type in the universe, and a family valued now in the universe. Moreover, the family should be pointwise an OFE, with nearness relation living in, letâs say, the universe. We will define the relation on to be
but this type is too large: Since we quantify over and return one of the approximate equalities, it must live in the universe; but if we want indexed products to be in the same category we started with, it should live in the
Fortunately, to us, this is an annoyance, not an impediment: here in the 1Lab, we assume propositional resizing throughout. Since the product type is a proposition, it is equivalent to a small type, so we can put it in any universe, including the
The construction is essentially the same as for binary products: however, since resizing is explicit, we have to do a bit more faffing about to get the actual inhabitant of that weâre interested in.
Î -OFE : OFE-on âr (â i â F i) Î -OFE .within n f g = Lift âr (â¡ (â i â f i â[ n ] g i)) Î -OFE .has-is-ofe .has-is-prop n x y = Lift-is-hlevel 1 squash Î -OFE .has-is-ofe .â-refl n = lift (inc λ i â P.â-refl n) Î -OFE .has-is-ofe .â-sym n (lift x) = lift do x â x pure λ i â P.â-sym n (x i) Î -OFE .has-is-ofe .â-trans n (lift p) (lift q) = lift do p â p q â q pure λ i â P.â-trans n (p i) (q i) Î -OFE .has-is-ofe .bounded x y = lift (inc λ i â P.bounded (x i) (y i)) Î -OFE .has-is-ofe .step n x y (lift p) = lift do p â p pure λ i â P.step n (x i) (y i) (p i) Î -OFE .has-is-ofe .limit x y wit i j = P.limit (x j) (y j) (λ n â wit' n j) i where wit' : â n i â within (P i) n (x i) (y i) wit' n i = â¡-out! (wit n .lower) i
And, again, by essentially the same argument, we can establish that this is the categorical indexed product of in the category of OFEs, as long as all the sizes match up.
OFE-Indexed-product : â {âo âr} {I : Type âo} (F : I â OFE âo âr) â Indexed-product (OFEs âo âr) F OFE-Indexed-product F .Î F = from-ofe-on $ Î -OFE (λ i â ⣠F i .fst â£) (λ i â F i .snd) OFE-Indexed-product F .Ï i .hom f = f i OFE-Indexed-product F .Ï i .preserves .pres-â α = â¡-out! ((_$ i) <$> α .lower) OFE-Indexed-product F .has-is-ip .tuple f .hom x i = f i # x OFE-Indexed-product F .has-is-ip .tuple f .preserves .pres-â wit = lift $ inc λ i â f i .preserves .pres-â wit OFE-Indexed-product F .has-is-ip .commute = trivial! OFE-Indexed-product F .has-is-ip .unique f prf = ext λ x y â prf y #â x