DDavid I. Spivak and Jamie Vicary (Eds.):Applied Category Theory 2020 (ACT2020)EPTCS 333, 2021, pp. 79–91, doi:10.4204/EPTCS.333.6 © Bryce ClarkeThis work is licensed under theCreative Commons Attribution License.
A diagrammatic approach to symmetric lenses
Bryce Clarke *Centre of Australian Category TheoryMacquarie University, Australia [email protected]
Lenses are a mathematical structure for maintaining consistency between a pair of systems. In theirongoing research program, Johnson and Rosebrugh have sought to unify the treatment of symmetriclenses with spans of asymmetric lenses. This paper presents a diagrammatic approach to symmetriclenses between categories, through representing the propagation operations with Mealy morphisms.The central result of this paper is to demonstrate that the bicategory of symmetric lenses is locallyadjoint to the bicategory of spans of asymmetric lenses, through constructing an explicit adjoint triplebetween the hom-categories.
Lenses are a mathematical structure which model sychronisation between a pair of systems. Lenses havebeen actively studied in both computer science and category theory since the seminal paper [7], andnow play an important role in a diverse range of applications including bidirectional transformations,model-driven engineering, database view-updating, systems interoperations, data sharing, and functionalprogramming.While typically lenses are used to describe asymmetric relationships between systems, many of theseexamples are better understood as special cases of symmetric lenses . Since the introduction of symmetriclenses in the paper [9], there has been a significant research program lead by Johnson and Rosebrugh(see [12, 13, 14, 15, 16]) to unify their treatment with spans of asymmetric lenses. However, despite thisresearch revealing numerous important aspects of symmetric lenses, many constructions appear ad hoc byrelying upon justification from applications, and remain without a robust category-theoretic foundation.This paper develops a diagrammatic approach to symmetric lenses in category theory, which clarifiesand generalises the previous results by Johnson and Rosebrugh. Symmetric lenses are characterisedas a pair of
Mealy morphisms , and may be represented as certain diagrams in C at. The main resultdemonstrates, for a pair of systems A and B , an adjoint triple between the category of symmetric lensesand the category of spans of asymmetric lenses. S ym L ens ( A , B ) S pn L ens ( A , B ) ⊥⊥ (1.1)Furthermore, these adjunctions characterise S ym L ens ( A , B ) as both a reflective and coreflective subcate-gory of S pn L ens ( A , B ) , and underlie local adjunctions between the corresponding bicategories S ym L ensand S pn L ens.This paper treats a system as a category, whose objects are the states of the system, and whosemorphisms are the updates (or transitions) between states of the system. In the paper [5], asymmetric * The author is supported by the Australian Government Research Training Program Scholarship. delta lenses were introduced as the maps between systems, which propagate updates in one system toupdates in another. A close category-theoretic study of delta lenses appeared in [11], and in [2] it wasdiscovered that they may be understood in terms of functors and cofunctors. In the ACT2019 paper [3],delta lenses were generalised to internal category theory, and more importantly, it was shown that anasymmetric delta lens may be represented as a certain commutative diagram in C at.The focus of this paper is symmetric delta lenses , introduced in [6], and their relationship with spansof asymmetric delta lenses. While the key results are concentrated on the theoretical foundation of thesestructures, this work also contains important benefits towards applications, from simplifying the use, andfurther study, of lenses. Overview of the paper
Section 2 reviews the different kinds of morphisms between categories which are later used to definelenses. The definitions of discrete opfibration, bijective-on-objects functor, and fully faithful functor arerecalled, as well as the less familiar definitions of cofunctor (see [8, 1]) and Mealy morphism (see [18];also known as a two-dimensional partial map in [17, 19]). In Lemma 2.6 and Lemma 2.11, cofunctorsand Mealy morphisms are faithfully represented as spans in C at. Note that Mealy morphisms in this paperare slightly different from [18, Example 3], as there is no requirement for the functor component to be“objectwise constant on the fibres”. The bicategory M eal of small categories and Mealy morphisms isequivalent to the bicategory Mnd ( S pan ) of monads and lax monad morphisms in the bicategory of spans.In Section 3, the definition of an asymmetric lens is recalled from [5, 11], and their characterisationfrom [3] as diagrams in C at is stated in Lemma 3.2. While the category L ens of small categories andlenses does not admit all pullbacks, it is proved in Proposition 3.4 that the category L ens ( B ) , of lensesover a base category B , has products. Using this proposition, the bicategory S pn L ens of small categoriesand spans of asymmetric lenses is constructed. From the perspective of applications, the bicategory S pn L ens allows the modelling of updates between systems which cannot synchronise directly, but insteaddepend on some intermediary system.Section 4 presents a concise construction of the bicategory S ym L ens of small categories and sym-metric lenses, using the bicategory M eal. A symmetric lens between a pair of systems may be understoodas a set of correspondences between the states of the systems, together with a pair of Mealy morphismswhich propagate the system updates in each direction. Informally, the “symmetric” aspect of symmetriclenses may be understood in the context of dagger categories, through a canonical family of functors† : S ym L ens ( A , B ) → S ym L ens ( B , A ) which take the opposite of a symmetric lens.In Section 5, the precise categorical relationship between S pn L ens and S ym L ens is presented by theadjoint triple in Theorem 5.1. The proof relies on the diagrammatic approach to symmetric lenses in anessential way, and reveals several aspects of [15, Theorem 40] which were hidden by an unnecessaryequivalence relation. Let C at denote the category of small categories and functors. There are three classes of functors that willbe of particular interest in this paper. Definition 2.1.
A functor f : A → B is a discrete opfibration if for all objects a ∈ A and morphisms u : f a → b ∈ B , there exists a unique morphism ϕ ( a , u ) : a → p ( a , u ) in A such that f ϕ ( a , u ) = u . Thenotation p ( a , u ) is used to denote the object cod ( ϕ ( a , u )) . Let D denote the class of discrete opfibrations.ryce Clarke 81 Definition 2.2.
A functor is bijective-on-objects if its object assignment is a bijection. Let E denote theclass of bijective-on-objects functors. Definition 2.3.
A functor f : A → B is fully faithful if for all objects a , a ′ ∈ A and morphisms u : f a → f a ′ ∈ B , there exists a unique morphism w : a → a ′ in A such that f w = u . Let M denote the class offully faithful functors.There is a well-known orthogonal factorisation system ( E , M ) on C at, called the bo-ff factorisationsystem , in which every functor factorises into a bijective-on-objects functor followed by a fully faithfulfunctor. The image of a functor f : A → B is a category I f whose objects are those of A , and whosemorphisms are triples ( a , u , a ′ ) : a → a ′ where a , a ′ ∈ A and u : f a → f a ′ ∈ B . The functor f : A → B factorises through the image as follows: A I f Ba a f aa ′ a ′ f a ′ w · · · · · · ( a , f w , a ′ ) f w · · · · · · (2.1)The universal property of the bo-ff factorisation system may be stated as follows. Given a commuta-tive square of functors, A BC D e f mgh (2.2)where e is bijective-on-objects and m is fully faithful, there exists a unique functor h : C → B such that h ◦ e = f and m ◦ h = g . In particular, note that this universal property defines the image I f uniquely upto isomorphism. Definition 2.4 (See [1]) . Let A and B be categories. A cofunctor ϕ : B A consists of an assignmenton objects ϕ : ob ( A ) → ob ( B ) together with an operation assigning each pair ( a , u ) , where a ∈ A and u : ϕ a → b ∈ B , to a morphism ϕ ( a , u ) : a → p ( a , u ) in A , satisfying the axioms:(1) ϕ p ( a , u ) = b (2) ϕ ( a , ϕ a ) = a (3) ϕ ( a , v ◦ u ) = ϕ ( p ( a , u ) , v ) ◦ ϕ ( a , u ) The notation p ( a , u ) is used to denote the object cod ( ϕ ( a , u )) . Example 2.5.
Every discrete opfibration A → B yields a cofunctor B A , and every bijective-on-objectsfunctor A → B yields a cofunctor A B .Let C of denote the category of small categories and cofunctors. Given cofunctors γ : C B and ϕ : B A , their composite ϕ ◦ γ : C A may be understood from the following diagram: C B A γϕ a ϕ a ac q ( ϕ a , u ) p ( a , γ ( ϕ a , u )) / / u · · · · · · γ ( ϕ a , u ) ϕ ( a , γ ( ϕ a , u )) · · · · · · (2.3)2 Adiagrammatic approach tosymmetric lensesThere is an orthogonal factorisation system ( D op , E ) on C of, in which every cofunctor factorises intoa discrete opfibration (taken in the opposite direction) followed by a bijective-on-objects functor. The image of a cofunctor ϕ : B A is a category Λ whose objects are those of A , and whose morphisms arepairs ( a , u ) : a → p ( a , u ) , where a ∈ A and u : ϕ a → b ∈ B . The cofunctor ϕ : B A factorises throughthe image as follows: B Λ A ϕ a a ab p ( a , u ) p ( a , u ) / / u · · · · · · ( a , u ) ϕ ( a , u ) · · · · · · (2.4)Notice that the cofunctor B Λ describes a discrete opfibration Λ → B , and the cofunctor Λ A describes an identity-on-objects functor Λ → A . Lemma 2.6.
Given a cofunctor ϕ : B A there is a span of functors, Λ B A ϕ ϕ (2.5) where ϕ is a discrete opfibration and ϕ is identity-on-objects. If C of is understood as a locally-discrete 2-category, Lemma 2.6 provides a way of constructing alocally fully faithful, identity-on-objects pseudofunctor C of → S pan ( C at ) . From now on cofunctors willalways be given by their span representation (2.5). Definition 2.7 (See [18]) . Let A and B be categories. A Mealy morphism A B consists of a discretecategory X together with a span of functors ( g , X , f ) : A B and operations assigning each pair ( x , u ) ,where x ∈ X and u : g x → a ∈ A , to an object q ( x , u ) in X and a morphism f ( x , u ) : f x → f q ( x , u ) in B , satisfying the axioms:(1) g q ( x , u ) = a (2) q ( x , gx ) = x and f ( x , g x ) = f x (3) q ( x , v ◦ u ) = q ( q ( x , u ) , v ) and f ( x , v ◦ u ) = f ( q ( x , u ) , v ) ◦ f ( x , u ) Example 2.8.
Every functor A → B yields a Mealy morphism A B , and every cofunctor B → A yieldsa Mealy morphism B A . Example 2.9 (Example 4 in [18]) . Given a pair of sets A and B , a Mealy morphism between free monoids A ∗ and B ∗ is exactly a Mealy machine with input alphabet A and output alphabet B .Let M eal denote the bicategory of small categories and Mealy morphisms. Unlike the special casesfunctors and cofunctors, composition of Mealy morphisms is not strictly associative, since the structureinvolves a span of functions. There are two possible notions of 2-cell between Mealy morphisms; thispaper uses the stricter notion as given below. Definition 2.10.
Let ( X , g , f , q , f ) and ( Y , k , h , p , h ) be Mealy morphisms A B . A map of Mealymorphisms consists of a morphism of spans, X A BY g f mk h (2.6)ryce Clarke 83such that mq ( x , u ) = p ( mx , u ) and f ( x , u ) = h ( mx , u ) for each pair ( x , u ) , where x ∈ X and u : g x → a ∈ A .Analogous to the orthogonal factorisation system on C of, every Mealy morphism factorises into adiscrete opfibration followed by a functor. Using the notation of Definition 2.10, the image of a Mealymorphism A B is a category X , whose set of objects is X and whose morphisms are pairs ( x , u ) : x → q ( x , u ) , where x ∈ X and u : g x → a . The factorisation of a Mealy morphism may then be described bythe following diagram: A X Bg x x f xa q ( x , u ) f q ( x , u ) / / u · · · · · · ( x , u ) f ( x , u ) · · · · · · (2.7)Notice that the Mealy morphism A X describes a discrete opfibration X → A , and the Mealy morphism X B describes a functor X → B . Lemma 2.11.
Given a Mealy morphism A B there is a span of functors,XA B g f (2.8) where g is a discrete opfibration.
Lemma 2.11 provides a way of constructing a locally fully faithful, identity-on-objects pseudofunctor M eal → S pan ( C at ) . From now on Mealy morphisms will always be understood by their span represen-tation (2.8). It is also worth noting that every Mealy morphism may also be factorised into a cofunctorfollowed by a fully faithful functor. These two possible factorisations would amount to a kind of ternaryfactorisation system ( D op , E , M ) on M eal, however this observation won’t be pursued in this paper. The goal of this section is to introduce the following three structures: ⋄ The category L ens of small categories and (asymmetric) lenses; ⋄ The category L ens ( B ) of lenses over a base category B ; ⋄ The bicategory S pn L ens of small categories and spans of lenses.It is well-known that L ens does not have all pullbacks, which complicates the usual construction of thebicategory of spans. The main obstruction is that while every cospan in L ens admits a canonical cone, theuniversal property of the pullback does not hold. However, for any small category B , there is a suitablydefined category L ens ( B ) which does admit cartesian products. Together these categories allow for theconstruction of a suitable bicategory S pn L ens, whose morphisms are spans in L ens but whose 2-cellsare defined by morphisms in L ens ( B ) . Definition 3.1. An (asymmetric) lens ( f , ϕ ) : A ⇋ B consists of a functor f : A → B together with afunction, ( a ∈ A , u : f a → b ) ϕ ( a , u ) : a → p ( a , u ) satisfying the axioms:4 Adiagrammatic approach tosymmetric lenses(1) f ϕ ( a , u ) = u (2) ϕ ( a , f a ) = a (3) ϕ ( a , v ◦ u ) = ϕ ( p ( a , u ) , v ) ◦ ϕ ( a , u ) Equivalently, an asymmetric lens consists of a functor f : A → B together with a cofunctor ϕ : B A such that f a = ϕ a and f ϕ ( a , u ) = u .The functor and cofunctor components of asymmetric lens are usually known as the G ET and theP UT , respectively. The three axioms above also correspond to the P UT G ET , G ET P UT , and P UT P UT laws, respectively. Lemma 3.2.
Given a lens ( f , ϕ ) : A ⇋ B there is a commutative diagram of functors, Λ A B ϕ ϕ f (3.1) where ϕ is an identity-on-objects functor and ϕ is a discrete opfibration. Like cofunctors and Mealy morphisms, a lens will always be understood by its diagrammatic repre-sentation (3.1) in C at. Let L ens be the category of small categories and lenses. Composition of lensesis given by composing the respective functor and cofunctor components, and the representation (3.1) ofthe composite may be understood by the following diagram: Λ × B ΩΛ Ω
A B C y ϕ ϕ γ γ f g (3.2)Given a pair of lenses ( f , ϕ ) : A ⇋ B and ( g , γ ) : C ⇋ B forming a cospan in L ens, Λ Ω
A B C ϕ ϕ γ γ f g (3.3)there is a canonical cone, or “fake pullback”, given by the span in L ens: A × B Ω Λ × B CA A × B C C π × γ ϕ × π π π (3.4)Note that this “fake pullback” diagram is sent to a genuine pullback via the forgetful functor L ens → C at. The category L ens also has the same terminal object as C at, and fake pullbacks over the terminalyields a semi-cartesian monoidal structure on L ens.The reason (3.4) fails, in general, to be a genuine pullback in L ens is that the corresponding universalproperty is not satisfied. However, recall that pullbacks in C at are the same as products in a slice category C at / B for some small category B . While the slice category L ens / B is not useful, there is a suitablecategory L ens ( B ) with cartesian products, together with a product-preserving functor L ens ( B ) → C at / B ,that provides the “fake pullbacks” in L ens with a universal property.ryce Clarke 85 Definition 3.3.
The category L ens ( B ) of lenses over a base category B has objects given by lenses withcodomain B , and morphisms ( f , ϕ ) → ( g , γ ) given by commutative diagrams of the form: Λ Ω
A CB ϕ h γ hf g ϕ γ (3.5)Note that only the functor h : A → C above need be specified; the functor h : Λ → Ω will alwaysbe uniquely induced from h , however may not (in general) make the back square in (3.5) commute.The above definition of L ens ( B ) is motivated as a generalisation of the category of SO pf ( B ) of splitopfibrations and cleavage-preserving functors, which is obtained as a full subcategory. An variant of L ens ( B ) has also been considered in [11] as the category of algebras for a semi-monad on C at / B . Proposition 3.4.
The category L ens ( B ) has products, for all small categories B.Proof. Consider a pair of lenses in L ens ( B ) as depicted in (3.3). Their product is given by the lens, Λ × B Ω A × B C B ϕπ = γπ ϕ × γ f π = g π (3.6)which is equal the composite of the appropriate lenses in (3.3) and (3.4). The product projections aregiven by the following diagrams: Λ Λ × B Ω A A × B CB ϕ π ϕ × γπ f f π ϕ ϕπ Λ × B Ω Ω A × B C CB ϕ × γ π γπ g π g γπ γ (3.7)It is not difficult to show that the lens (3.6) also satisfies the universal property of the product in thecategory L ens ( B ) .Proposition 3.4 shows that the fake pullbacks constructed in L ens actually have a universal propertywith respect to the morphisms in L ens ( B ) , for the appropriate small category B . Now consider the familyof functors L ens ( B ) → C at which assign each lens to its domain category, and each morphism (3.5) tothe corresponding functor between domains. Definition 3.5.
Let S pn L ens be the bicategory of spans of asymmetric lenses , whose objects are smallcategories, and whose hom-categories S pn L ens ( A , B ) are constructed by the pullback: S pn L ens ( A , B ) L ens ( A ) L ens ( B ) C at y (3.8)6 Adiagrammatic approach tosymmetric lensesAn object in S pn L ens ( A , B ) is a span of asymmetric lenses from A to B , and a morphism is given by afunctor X → X ′ , together with induced functors Ω → Ω ′ and Λ → Λ ′ , such that each face (including thetwo outer squares) in the following diagram commute: Ω X Λ A B Ω ′ X ′ Λ ′ (3.9)Horizontal composition is given by fake pullback of lenses, followed by lens composition of the projec-tions with the appropriate legs of the span. Horizontal composition is associative up to natural isomor-phism with respect to the morphisms (3.9) above.There is an identity-on-objects pseudofunctor L ens → S pn L ens which takes a lens A ⇋ B to the rightleg of a span of lenses from A to B , with left leg given by the identity lens.The construction of the bicategory S pn L ens is a generalisation of a category previously defined in[13, 15]. This category has objects given by small categories, and certain equivalence classes of spansof asymmetric lenses as morphisms. Removing the equivalence relation and considering the appropriate2-cells naturally gives rise to the bicategory S pn L ens considered here. The goal of this section is to introduce the bicategory S ym L ens of small categories and symmetric lenses.Consider the family of functors U A , B : M eal ( A , B ) → S pan ( C at )( A , B ) with the assignment on Mealymorphisms (Definition 2.10) stated for the span representation (2.8) as follows: XA B g f X A B g f (4.1)This functor is given by pre-composing the legs of the span with the canonical identity-on-objects functorfrom the discrete category X → X . Furthermore, consider the family of functors † A , B : S pan ( C at )( B , A ) → S pan ( C at )( A , B ) which send each span ( f , X , g ) : B A to its reverse span ( g , X , f ) : A B . Definition 4.1.
Let S ym L ens be the bicategory of symmetric lenses , whose objects are small categories,and whose hom-categories S ym L ens ( A , B ) are constructed by the pullback: S ym L ens ( A , B ) M eal ( A , B ) M eal ( B , A ) S pan ( C at )( A , B ) U A , B † A , B ◦ U B , A y (4.2)ryce Clarke 87An object in S ym L ens ( A , B ) is a symmetric lens, and may be depicted by a pair of spans: X + A BX − g fg f (4.3)The 2-cells are given by the corresponding maps of Mealy morphisms, and horizontal composition isalso inherited from M eal. Notation . In the diagram (4.3), the upper span is a Mealy morphism A B , while the lower spanis a Mealy morphism B A . As the notation suggests, both X + and X − are categories with the samediscrete category of objects X . Moreover, the following diagrams commute: X X + A × B h g , f ih g , f i X X − A × B h g , f ih g , f i (4.4)Taking these diagrams together with (4.3), a symmetric lens may be completely described by the follow-ing commutative diagram of functors, X + A X BX − g fg f (4.5)where g and f are discrete opfibrations. However, for the remainder of the paper a symmetric lens willbe depicted by a diagram of the form (4.3) for simplicity.There is an identity-on-objects pseudofunctor L ens → S ym L ens with the following assignment onmorphisms: Λ A B ϕ ϕ f AA B Λ f ϕ ϕ (4.6)Note that the discrete opfibration ϕ above would usually be denoted by f with the notational conventionfor symmetric lenses. From this pseudofunctor, symmetric lenses may be seen as a generalisation ofasymmetric lenses. In S ym L ens morphisms are pairs of suitable Mealy morphisms, while in L ens thismust be a functor/cofunctor pair. However there is also a loss of information in (4.6), as a symmetriclens no longer encodes the commutativity condition of the corresponding asymmetric lens.The construction of the bicategory S ym L ens is a generalisation of a category previously definedin [13, 15]. This category has objects given by small categories, and certain equivalence classes ofsymmetric lenses (called fb-lenses ) as morphisms. Removing the equivalence relation and consideringthe appropriate 2-cells yields the bicategory S pn L ens considered here.8 Adiagrammatic approach tosymmetric lenses This section presents the main theorem of the paper.
Theorem 5.1.
Let A and B be small categories. Then there exists adjoint triple L ⊣ M ⊣ R between thecategory of symmetric lenses and the category of spans of asymmetric lenses, S ym L ens ( A , B ) S pn L ens ( A , B ) RL ⊥⊥ (5.1) such that R is reflective and L is coreflective (that is, ML = MR = ). The functor M : S pn L ens ( A , B ) → S ym L ens ( A , B ) is defined on objects as follows: Ω X Λ A B γ γ g f ϕ ϕ Ω A B Λ γ f γ g ϕ ϕ (5.2)Recall that γ and ϕ are identity-on-objects functors, so Ω and Λ have the same objects, and the resultingsymmetric lens is well-defined.To construct the right adjoint R , consider a symmetric lens given by (4.3). Applying the bo-ff fac-torisation (2.1) to the functor h g , f i : X → A × B yields a diagram: e XX A × B me h g , f i (5.3)This factorisation is chosen such that image e X has the same objects as the discrete category X . Using theuniversal property (2.2) of the bo-ff factorisation, together with the commutative diagrams (4.4), thereexists unique, identity-on-objects functors: X e XX + A × B e m h g , f i σ X e XX − A × B e m h g , f i τ (5.4)The functor R : S ym L ens ( A , B ) → S pn L ens ( A , B ) is defined on objects as follows: X + A BX − g fg f X + e X X − A B g σ π m π m τ f (5.5)ryce Clarke 89One may notice immediately that the composite MR : S ym L ens ( A , B ) → S ym L ens ( A , B ) is equal tothe identity functor. The unit for the adjunction M ⊣ R is constructed using the universal property of thebo-ff factorisation, and is given as follows: Ω X Λ A B Ω e X Λ Ω γ γ g f ϕ Λ ϕγ σ π m π m τ ϕ (5.6)To construct the left adjoint L , again consider a symmetric lens given by (4.3). Since X + and X − have the same discrete category of objects X , there is pushout along the identity-on-objects functorsgiven by: X X − X + X + ⊔ X X − ι ι p (5.7)For brevity, let b X : = X + ⊔ X X − . Note that identity-on-objects functors are stable under pushout, soboth ι and ι are also identity-on-objects functors. The functor R : S ym L ens ( A , B ) → S pn L ens ( A , B ) isdefined on objects as follows: X + A BX − g fg f X + b X X − A B g ι [ g , g ] [ f , f ] ι f (5.8)One may notice immediately that the composite ML : S ym L ens ( A , B ) → S ym L ens ( A , B ) is equal tothe identity functor. The counit for the adjunction L ⊣ M is constructed using the universal property ofthe pushout, and is given as follows: Ω b X Λ A B Ω X Λ γ ι Ω [ γ , ϕ ][ γ , g ϕ ] [ f γ , ϕ ] ι ϕ Λ γ γ g f ϕ ϕ (5.9) Corollary 5.2.
There exist identity-on-objects pseudofunctors between the bicategory of symmetric lensesand the bicategory of spans of asymmetric lenses, S ym L ens S pn L ens RML (5.10) such that L and R are locally fully faithful and are locally adjoint to M.
This paper has established a new category-theoretic foundation for symmetric delta lenses. In contrast tothe algebraic approach of Johnson and Rosebrugh, this paper develops a natural diagrammatic approachto symmetric lenses and spans of asymmetric lenses, by using the properties of certain classes of func-tors. This framework yields significantly simpler definitions (for example, compare the characterisationof a symmetric lens via Mealy morphisms in (4.3) to [15, Definition 7]), and allows for a clearer under-standing of the composition of symmetric lenses, which is important for their application in fields suchas database view-updating and model-driven engineering.While symmetric lenses and spans of asymmetric lenses were previously understood in [15] as mor-phisms in an isomorphic pair of categories, the bicategories S ym L ens and S pn L ens constructed in thispaper share a more interesting relationship. The main theorem shows that S ym L ens ( A , B ) is both a re-flective and coreflective subcategory of S pn L ens ( A , B ) , which suggests that symmetric lenses are lessexpressive than spans of asymmetric lenses when modelling update propagation between systems. Thesubcategory inclusions also provide a way of characterising which spans of asymmetric lenses arise fromsymmetric lenses: either the functor components of the span are jointly fully faithful (via the right ad-joint) or the identity-on-objects functors in the cofunctor components are pushout injections (via the leftadjoint). A detailed study of the mathematical implications of the local adjunction between S ym L ensand S pn L ens is left for future research.The notion of universal symmetric lenses, as considered in [16, 10], will also be the focus of futurework. In the paper [4], explicit conditions for universal asymmetric lenses were established, and it ishoped that these results may be extended to the symmetric setting.Although this paper has established explicit technical advances towards the understanding of sym-metric delta lenses, it also suggests broader goals for the understanding of lenses in applied categorytheory. Analogous to the transition from functions to relations, this paper further develops the transitionfrom asymmetric lenses to the general setting of symmetric lenses, as pioneered by Johnson and Rose-brugh. Realising this framework with other kinds of lenses in the literature has the potential to capture awider range of applications and deliver mathematically interesting results. Acknowledgements
The author is grateful to Michael Johnson and the anonymous reviewers for providing helpful feedbackon this work. The author would also like to thank the organisers of the ACT2020 conference.
References [1] Marcelo Aguiar (1997):
Internal Categories and Quantum Groups . Ph.D. thesis, Cornell University. Avail-able at http://pi.math.cornell.edu/~maguiar/thesis2.pdf .[2] Danel Ahman & Tarmo Uustalu (2017):
Taking Updates Seriously . In: ProceedingsoftheSixthInternationalWorkshop on Bidirectional Transformations. Available at http://ceur-ws.org/Vol-1827/paper11.pdf .[3] Bryce Clarke (2020):
Internal lenses as functors and cofunctors . In: Applied Category Theory2019, Elec-tronic Proceedings in Theoretical Computer Science. (to appear).[4] Bryce Clarke (2020):
Internal split opfibrations and cofunctors . Available at https://arxiv.org/abs/2004.00187 . ryce Clarke 91 [5] Zinovy Diskin, Yingfei Xiong & Krzysztof Czarnecki (2011): From State- to Delta-Based BidirectionalModel Transformations: The Asymmetric Case . Journal of Object Technology, doi: .[6] Zinovy Diskin, Yingfei Xiong, Krzysztof Czarnecki, Hartmut Ehrig, Frank Hermann & Fernando Orejas(2011):
From State- to Delta-Based Bidirectional Model Transformations: The Symmetric Case . In: ModelDrivenEngineeringLanguagesandSystems, doi: .[7] J. Nathan Foster, Michael B. Greenwald, Jonathan T. Moore, Benjamin C. Pierce & Alan Schmitt (2007):
Combinators for Bidirectional Tree Transformations: A Linguistic Approach to the View-Update Problem .ACMTransactionsonProgrammingLanguagesandSystems, doi: .[8] Philip J. Higgins & Kirill C. H. Mackenzie (1993):
Duality for base-changing morphisms of vector bundles,modules, Lie algebroids and Poisson structures . MathematicalProceedingsoftheCambridgePhilosophicalSociety, doi: .[9] Martin Hofmann, Benjamin Pierce & Daniel Wagner (2011):
Symmetric Lenses . ACM SIGPLAN Notices,doi: .[10] Michael Johnson & Franc¸ois Renaud (2019):
Symmetric c-Lenses and Symmetric d-Lenses are Not Coex-tensive . In: Proceedings of the 8th InternationalWorkshop on Bidirectional Transformations. Available at http://ceur-ws.org/Vol-2355/paper7.pdf .[11] Michael Johnson & Robert Rosebrugh (2013):
Delta Lenses and Opfibrations . In: ProceedingsoftheSecondInternationalWorkshoponBidirectionalTransformations, doi: .[12] Michael Johnson & Robert Rosebrugh (2014):
Spans of lenses . In: Proceedings of the Workshops of theEDBT/ICDT2014JointConference. Available at http://ceur-ws.org/Vol-1133/paper-18.pdf .[13] Michael Johnson & Robert Rosebrugh (2015):
Spans of Delta Lenses . In: Proceedings of the Fourth In-ternational Workshop on Bidirectional Transformations. Available at http://ceur-ws.org/Vol-1396/p1-johnson.pdf .[14] Michael Johnson & Robert Rosebrugh (2016):
Unifying Set-Based, Delta-Based and Edit-Based Lenses . In:Proceedings of the Fifth International Workshop on Bidirectional Transformations. Available at http://ceur-ws.org/Vol-1571/paper_13.pdf .[15] Michael Johnson & Robert Rosebrugh (2017):
Symmetric delta lenses and spans of asymmetric delta lenses .JournalofObjectTechnology, doi: .[16] Michael Johnson & Robert Rosebrugh (2017):
Universal Updates for Symmetric Lenses . In: Proceedingsofthe Sixth International Workshop on Bidirectional Transformations. Available at http://ceur-ws.org/Vol-1827/paper8.pdf .[17] Stephen Lack & Ross Street (2002):
The formal theory of monads II . Journalof Pureand AppliedAlgebra,doi: .[18] Robert Par´e (2012):
Mealy Morphisms of Enriched Categories . Applied Categorical Structures, doi: .[19] Ross Street (2020):