diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzznnek" "b/data_all_eng_slimpj/shuffled/split2/finalzznnek" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzznnek" @@ -0,0 +1,5 @@ +{"text":"\\section{introduction}\n\nThe measurement of bottom ($B$) mesons in $p$+$p$ and $p$+$\\bar{p}$ \ncollisions is of interest to constrain the total bottom cross section \nas well as test our understanding of bottom quark production mechanisms \nand hadronization. There are extensive direct measurements of various \n$B$ mesons, as well as measurements of $B \\rightarrow J\/\\psi$ \ncontributions over a broad range in \\mbox{$J\/\\psi~$} transverse momentum and \nrapidity from the Tevatron in $p$+$\\bar{p}$ at $\\sqrt{s}$ = 1.8, 1.96 \nTeV~\\cite{Abe:1993hr, Abachi:1996jq, Acosta:2004yw} and the Large \nHadron Collider (LHC) in $p$+$p$ at $\\sqrt{s}=7$--13 \nTeV~\\cite{Abelev:2012gx,Khachatryan:2010yr,lhcb8TeV,Aaij:2015rla,Aad2016}. \nIn contrast, measurements from UA1 in $p$$+$$\\bar{p}$ at \n$\\sqrt{s}=630$~GeV~\\cite{UA1} are statistically limited and only for \n$p_T(J\/\\psi) >$ 5 GeV$\/c$. Adding new measurements at lower energies \nand covering different kinematic regions is valuable for testing \nperturbative quantum chromodynamics (pQCD) calculations and \nconstraining production mechanisms.\n \nThe Relativistic Heavy Ion Collider (RHIC) provides $p$$+$$p$ collisions \nat $\\sqrt{s}$ = 200, 500 and 510 GeV, which extends the kinematic reach \nfor bottom measurements. At these smaller energies, bottom production is \ndominated by gluon-gluon fusion, while higher energy bottom production \ncontains a larger fraction of flavor excitation and gluon splitting \nprocesses~\\cite{Norrbin:2000zc}. The STAR experiment measured $B \n\\rightarrow J\/\\psi$ at midrapidity for \\mbox{$J\/\\psi~$} $p_{T} > $ 5 GeV\/$c$ in \n$p$+$p$ at $\\sqrt{s}$ = 200 GeV~\\cite{Adamczyk:2012ey}. Our measurement \nat forward rapidity and $p_{T}$ within 0--5 GeV$\/c$ in $\\sqrt{s}=510$ \nGeV $p$+$p$ collisions at PHENIX can provide the validation of parton \ndistribution functions (PDF) in a different gluon fractional momentum \nrange $5 \\times 10^{-4}4$ GeV\/$c$) is required. \nAfter the misalignment corrections described above are applied, the \n\\mbox{$\\textrm{DCA}_{\\rm R}$}~ is then extracted for these tracks and checked for any indications \nof residual misalignments. The mean of these distributions is found to \nbe flat along the $\\varphi$ direction (within the measurement precision) \nand the overall offsets of the distributions are within 30 $\\mu$m in \nboth arms. These offset values are much smaller than the detector \nposition resolution. Variations of the \\mbox{$\\textrm{DCA}_{\\rm R}$}~ mean and spread which could \noccur if there were beam instability, detector, trigger or \nacceptance$\\times$efficiency changes, are checked by examining the \\mbox{$\\textrm{DCA}_{\\rm R}$}~ \ndistributions as a function of run and BBC instantaneous rate. The mean \nvalues of the \\mbox{$\\textrm{DCA}_{\\rm R}$}~ distributions across all runs are found to be within \none standard deviation (of the intrinsic \\mbox{$\\textrm{DCA}_{\\rm R}$}~ distribution width) after \nquality assurance checks.\n\n\\begin{table*}\n\\caption{ Quality cuts for \\mbox{$J\/\\psi~$} candidates in \\mbox{$p$+$p$~} collisions.}\n\\begin{ruledtabular} \n\\begin{tabular}{ccl}\nVariable (Meaning) & $1.2<|y|<2.2$ \\\\ \n\\hline\n$|z_{\\rm VTX}|$ (collision vertex measured by the FVTX\/VTX) & $<10$ cm \\\\ \n$|z_{\\rm VTX} \\ \\rm{uncertainty}|$ (collision vertex uncertainty measured by the FVTX\/VTX) & $<400$ $\\mu$m \\\\ \n$p \\cdot DG0$ (Track momentum times the spatial difference between & $<80$ GeV\/$c$ $\\cdot$ cm \\\\\nthe MuTr track and MuID track at the first MuID layer) & \\\\ \n$p \\cdot DDG0$ (Track momentum times the slope difference between & $<40$ GeV\/$c$ $\\cdot$ $^{\\circ}$ \\\\\nthe MuTr track and MuID track at the first MuID layer) & \\\\ \n$\\chi^{2}_{\\rm MuTr}$ ($\\chi^{2}\/\\rm{NDF}$ of the MuTr track) & $<10$ \\\\\n$\\chi^{2}_{\\rm MuID}$ ($\\chi^{2}\/\\rm{NDF}$ of the MuID road) & $<3$ \\\\\nTrack $\\chi^2_{\\rm{FVTX-MuTr}}$ ($\\chi^{2}\/\\rm{NDF}$ of the FVTX-MuTr matching $\\mu$ track) & $<5$ \\\\ \nRadial residual between FVTX and MuTr projection at FVTX station 4 & $< 3 \\sigma$ \\\\\nAzimuthal residual between FVTX and MuTr projection at FVTX station 4 & $< 3 \\sigma$ \\\\\nLast gap (Last MuID plane that the $\\mu$ track penetrated) & = 4 \\\\\nnidhits (Number of hits in the MuID, out of the maximum 10 ) & $>6$ \\\\ \nntrhits (Number of hits in the MuTr, out of the maximum 16 ) & $>11$ \\\\ \nnfvtxhits (Number of hits in the FVTX+VTX, out of the maximum 6 ) & $>2$ \\\\ \n$|p_{z}| (\\rm{GeV}\/c)$ (Momentum of the $\\mu$ along the beam axis) & $>3$ \\\\ \ndimuon pair vertex $\\chi^{2}\/\\rm{NDF}$ & $ < 3$ \n\\label{tab:quality_cut}\n\\end{tabular} \n\\end{ruledtabular}\n\\end{table*}\n\n\\subsection{ \\mbox{$J\/\\psi~$} Reconstruction}\n\\label{sec: jpsi Reconstruction}\n\nTracks formed in the MuTr are required to contain at least 12 (out of \n16) hits in the various cathode strip planes. We start with a loose \nquality cut $\\chi^{2}\/\\rm{NDF}<10$ on the MuTr tracks to make sure all \npotentially good tracks are included in the analysis. The MuTr tracks \nwhich reach the last gap of the MuID and have longitudinal momentum \n$>3$ GeV\/$c$ are treated as muon track candidates. Muon candidates in \nthis analysis need to have good associations between the MuTr track and \nthe MuID road in both position and angle. The momentum-dependent \nposition and angle differences between the MuTr track and the MuID road \nare required to be within three standard deviations as calculated using \nthe Kalman Filter track fitting and error propagation method. In \naddition, the associated MuID road should contain at least 6 (out of \n10) hits in different MuID planes. Because the MuID road is not \nincluded in the fully reconstructed tracks, we apply a tighter quality \ncut which is $\\chi^{2}\/\\rm{NDF}<3$.\n\nGood matching between the FVTX tracks and the MuTr+MuID tracks is also \nrequired. This requirement helps remove mis-reconstructed and bad \nquality tracks as well as some hadronic background. The matched FVTX \ntracks should contain at least 3 (out of 6) FVTX+VTX hits. The \ndifferences in azimuthal angle, polar angle and radial distance between \nmatched FVTX and MuTr+MuID combined tracks are required to be within \nthree standard deviations as determined by the Kalman Filter fits and \nerror propagation. Fits on the combined FVTX+MuTr tracks should satisfy \n$\\chi^{2}\/\\rm{NDF}<5$. Dimuon pairs are created from muons passing all \nthe quality cuts. A slightly different selection which requires at \nleast one muon of the dimuon pair passing through the quality cuts is \ntested. No bias is found as consistent results are achieved between the \ntwo selections. The fit of the vertex point plus the two muon tracks \nwith opposite charges must satisfy $\\chi^{2}\/\\rm{NDF}<3$ to ensure the \ntwo muon tracks are not separated by more than 1 mm. The complete set \nof quality cuts is listed in Table~\\ref{tab:quality_cut}.\n\n\\begin{figure}[!htb]\n\t\\includegraphics[width=1.0\\linewidth]{Divided_JPsi_mass.eps}\n\\caption{\\label{fig:jpsi_mass} The invariant mass of dimuons in the \n(a,c) $1.2-\\alpha \\\\\n(\\frac{n}{|\\alpha|})^{n}\\textrm{exp}(-\\frac{|\\alpha|^{2}}{2})(\\frac{n}{|\\alpha|}-|\\alpha|-\\frac{\\textrm{DCA}_{\\rm R}-\\mu_{2}}{\\sigma_{2}})^{-n}, \n\\frac{\\textrm{DCA}_{\\rm R} - \\mu_{2}}{\\sigma_{2}} \\le -\\alpha \\\\\n\t\\end{array}\\right.\n\t\\end{equation}\n\n\\noindent where $\\mu_2$, $\\sigma_2$, $n$ and $\\alpha$ are parameters \ndetermined from the fit to the \n$B\\rightarrow J\/\\psi \\rightarrow \\mu^+\\mu^-$ simulation. The average \nvalue of the muon \\mbox{$\\textrm{DCA}_{\\rm R}$}~ from $B\\rightarrow J\/\\psi$ decay is determined \nby $\\mu_2$. Parameters $\\sigma_2$, $n$ and $\\alpha$ determine the \nasymmetric shape of this \\mbox{$\\textrm{DCA}_{\\rm R}$}~ distribution. The determined values of \nthese parameters defined in this section and used in \nEq.~(\\ref{eq:bjpsi_fun}) and Eq.~(\\ref{eq:decay_B}) are then fixed in the \nfit to the measured \\mbox{$\\textrm{DCA}_{\\rm R}$}~ distributions.\n\nFits of the simulated muon \\mbox{$\\textrm{DCA}_{\\rm R}$}~ distributions for prompt $J\/\\psi$ (blue \nopen circle) and $B$ to $J\/\\psi$ (green circle) are shown in \nFig.~\\ref{fig:mc_fit}. The \\mbox{$\\textrm{DCA}_{\\rm R}$}~ spectra can be modeled by the two functions \ndefined in Eq. (\\ref{eq:jpsi_fun}) and Eq. (\\ref{eq:bjpsi_fun}). \n\n\\begin{figure}[!htb]\n\t\\includegraphics[width=0.96\\linewidth]{North_bkg_dis.eps}\n\t\\includegraphics[width=0.96\\linewidth]{South_bkg_dis.eps}\n\\caption{\\label{fig:bkg_dis} The raw yields of data ([black] closed \ncircles) and estimated background \\mbox{$\\textrm{DCA}_{\\rm R}$}~ distributions within the \\mbox{$J\/\\psi~$} \nmass window (2.7--3.5 GeV\/$c^{2}$ are shown for (a) rapidity $1.24$ \nGeV$\/c^{2}$, the heavy flavor continuum background also contains \nDrell-Yan. Because the fraction of Drell-Yan events within the \\mbox{$J\/\\psi~$} mass \nregion (2.7--3.5 GeV$\/c^{2}$) is negligible, the fit in this mass \nregion does not include a Drell-Yan component.\n\nFigure~\\ref{fig:dimu_mass_fit} shows the fit of the dimuon mass \ndistribution to determine the heavy flavor continuum background. The \ntotal background (yellow) determined by the fit to the invariant mass \nspectrum, which comprises the combinatorial (red) and the heavy flavor \nbackground (blue), follows the mass distribution outside the \\mbox{$J\/\\psi~$} mass \nwindow well. The fraction of the heavy flavor background within the \n$J\/\\psi$ mass window is found to be 7.1\\% $\\pm$ 1.1 \\% (5.5\\% $\\pm$ 0.8\\%) in the $1.2 8$ GeV$\/c$ to $p_{T} > 0$ range~\\cite{ALBAJAR1991121,Albajar1994} \nand unscaled with energy. The uncertainty of the \nextrapolated value at PHENIX (UA1) combines the statistical and \nsystematic uncertainty from experiment with the {\\sc cem} uncertainty. \nThe uncertainty of the {\\sc fonll} calculations contains both $b$ quark mass and scaling uncertainties.}\n \\end{figure} \n\nComparisons to global measurements within the same inclusive \\mbox{$J\/\\psi~$} \n$p_{T}$ region from CDF~\\cite{Acosta:2004yw}, ALICE \n\\cite{Abelev:2012gx}, CMS~\\cite{Khachatryan:2010yr} and LHCb \n\\cite{lhcb8TeV, Aaij:2015rla} experiments are shown in \nFig.~\\ref{fig:global_data}(a). The result from PHENIX is also compared with \nthe $p_T$-dependent fraction from other experiments using the average \n$p_T=$ 2.2 \\mbox{GeV\/$c$}~ of our inclusive \\mbox{$J\/\\psi~$} sample as shown in \nFig.~\\ref{fig:global_data}(b). The LHCb experiment has measurements over a \nwide rapidity range, $2.00$ and $y>0$ as a function of energy. \nThe $J\/\\psi$ distributions were calculated with the same mass and scale \nparameters but to include the $p_{T}$ dependence instead of \n$\\mu_{F,R}\/m$, $\\mu_{F,R}\/m_{T}$ was used, where $m_T = \n\\sqrt{(p_{T_c}^2 + p_{T_{\\overline c}}^2)\/2 + m_c^2}$. The shape of \nthe $p_T$ distribution at low $p_T$ is determined by a $k_T$ kick of \n1.29 GeV$\/c$ at $\\sqrt{s} = 500$ GeV. The energy difference between 500 \nGeV and 510 GeV is small, so the difference in the $B \\rightarrow \nJ\/\\psi$ fraction is negligible. The measured fraction at PHENIX is \nconsistent with the {\\sc fonll+cem} model prediction within \nuncertainties. The CMS nonprompt and prompt \\mbox{$J\/\\psi~$} cross section \nmeasurements at 7 TeV $p$+$p$ collisions~\\cite{Khachatryan:2010yr} have \nbeen compared to the {\\sc fonll+cem} calculations as well. The old {\\sc \ncem} model underestimated the prompt \\mbox{$J\/\\psi~$} cross section within \n$1.6<|y|<2.4$ and \\mbox{$J\/\\psi~$} $p_{T}<5$ GeV$\/c$ region measured by the CMS \nexperiment in 7 TeV $p$+$p$ collisions, while the nonprompt \\mbox{$J\/\\psi~$} cross \nsection measured in the same kinematic region and experiment is \nconsistent with the {\\sc fonll} calculations. Calculations with the CEM \nparameters from~\\cite{vogt_dis} give a better agreement between the \n{\\sc fonll+cem} prediction and the $B \\rightarrow J\/\\psi$ fraction \nmeasured by CMS~\\cite{Khachatryan:2010yr}. The {\\sc fonll} calculations \ncan reasonably describe the nonprompt \\mbox{$J\/\\psi~$} cross section results at \nLHCb for $p_{T}>0$ ~\\cite{lhcb8TeV, Aaij:2015rla}.\n\nThe $B \\rightarrow J\/\\psi$ fraction \\mbox{$F_{B{\\rightarrow}J\/\\psi}~$} is also related to the \ninclusive \\mbox{$J\/\\psi~$} cross section per unit rapidity \n$d\\sigma\/dy(pp{\\rightarrow}J\/\\psi)$ and the $b\\bar{b}$ cross section per unit rapidity \n$d\\sigma\/dy(pp{\\rightarrow}b\\bar{b})$, \n\\begin{equation}\n\\label{eq:b_xsec}\nF_{B \\rightarrow J\/\\psi} = \\frac{2 \\times d\\sigma\/dy(pp{\\rightarrow}b\\bar{b}) \n\\times {\\rm{Br}}(B{\\rightarrow}J\/\\psi+X)}{d\\sigma\/dy(pp{\\rightarrow}J\/\\psi)},\n\\end{equation}\nwhere ${\\rm{Br}}(B{\\rightarrow}J\/\\psi+X)$ is the branching ratio of $B$ \nhadron decays to $J\/\\psi$ and the $b$ ($\\bar{b}$) quark to \n$B$-hadron fragmentation is assumed to be 1. The factor of two in \nEq. (\\ref{eq:b_xsec}) accounts for the fact that both \n$B{\\rightarrow}J\/\\psi$ and $\\overline{B}{\\rightarrow}J\/\\psi$ contribute to \nthe $B{\\rightarrow}J\/\\psi$ fraction $F_{B{\\rightarrow}J\/\\psi}$.\nEq.(\\ref{eq:b_xsec}) can be rewritten as:\n\n\\begin{equation}\n\\label{eq:b_xsec2}\nd\\sigma\/dy(pp{\\rightarrow}b\\bar{b}) \n= \\frac{\\frac{1}{2} \\times d\\sigma\/dy(pp{\\rightarrow}J\/\\psi) \n\\times F_{B{\\rightarrow}J\/\\psi}}{{\\rm{Br}}(B{\\rightarrow}J\/\\psi + X)}.\n\\end{equation}\nTherefore, $d\\sigma\/dy(pp{\\rightarrow}b\\bar{b})$ can be derived from \nEq. (\\ref{eq:b_xsec2}). To do this, we use \n$d\\sigma\/dy(pp{\\rightarrow}J\/\\psi) = 1.00 \\pm 0.11$ $\\mu$b ($0.97 \\pm 0.11$ $\\mu$b) \nat mean rapidity $y = 1.7$ ($-1.7$) in 510 GeV $p$+$p$ collisions, and \n${\\rm{Br}}(B{\\rightarrow}J\/\\psi + X) = 1.094 \\pm 0.032 \n\\%$~\\cite{pdg2016}. Here, $d\\sigma\/dy(pp{\\rightarrow}J\/\\psi, 510$ GeV$)$ \nis extrapolated as $d\\sigma\/dy(pp{\\rightarrow}J\/\\psi, 200$ GeV$) \\times \nR(510\/200)$, where the scaling factor $R(510\/200)$ is \n$2.08^{+0.75}_{-0.55}$ according to the {\\sc cem}~\\cite{vogt_dis}, and \n$d\\sigma\/dy(pp{\\rightarrow}J\/\\psi, 200$ GeV)$=0.48{\\pm}0.05\\ {\\mu}$b \n($0.47{\\pm}0.05\\ {\\mu}$b) at mean rapidity $y=1.7$ ($-1.7$)~\\cite{Adare:2011vq}. \n\nThe extracted $d\\sigma\/dy(pp{\\rightarrow}b\\bar{b})$ is \n$3.57^{+2.38}_{-2.22}$ ($3.68^{+2.08}_{-1.88}$) $\\mu$b at $B$ hadron \nmean rapidity = 1.7 ($-1.7$) in 510 GeV $p$+$p$ collisions. The \nweighted average of the two measurements is \n$d\\sigma\/dy(pp{\\rightarrow}b\\bar{b})=3.63^{+1.92}_{-1.70}$ ${\\mu}$b at \n$B$-hadron rapidity$={\\pm}1.7$. As shown in Fig.~\\ref{fig:fonll_xsec}, \nthese values are comparable with the {\\sc fonll}-calculated \nrapidity-dependent $B$ cross section within large \nuncertainties~\\cite{FONLL,Cacciari:2001td,Cacciari:2012ny}. The PHENIX \nextracted values are also comparable to the UA1 $\\sqrt{s}=630$ GeV \n$p$+$\\bar{p}$ average $b\\bar{b}$ cross section per unit rapidity \n($d\\sigma\/dy(p\\bar{p}{\\rightarrow}b\\bar{b}, 630$ GeV$) = \n4.3^{+2.51}_{-2.10}$ $\\mu$b) within $|y|<1.5$ \n\\cite{ALBAJAR1991121,Albajar1994} which is extrapolated from $p_{T}>8$ \nGeV$\/c$ to the $p_{T}>0$ range. The {\\sc fonll} calculation assumes \n$m_{b} = 4.75 \\pm 0.25$ GeV$\/c^{2}$ while the renormalization and \nfactorization scales are varied by a factor of two around the central \nvalue, $\\mu_{R,F} = \n\\sqrt{p_{T}^{2}+m_{b}^{2}}$~\\cite{PhysRevLett.95.122001,Cacciari:2012ny}.\n\n\\section{Summary}\n\\label{sec: Summary}\n\nWe have presented a new measurement of the nonprompt over inclusive \n\\mbox{$J\/\\psi~$} production ratio \\mbox{$F_{B{\\rightarrow}J\/\\psi}~$} in \\mbox{$p$+$p$~} collisions at $\\sqrt{s}$ = 510 \nGeV, integrated over the \\mbox{$J\/\\psi~$} kinematical domain, $p_{T}<5$ GeV\/$c$ \nand rapidity $1.2<|y|<2.2$. The result is \\mbox{$F_{B{\\rightarrow}J\/\\psi}~$} = $8.1\\% \\pm 2.3\\% \\ \\rm \n(stat) \\pm 1.9\\% \\ \\rm (syst)$. This measurement extends the previously \nmeasured \\mbox{$F_{B{\\rightarrow}J\/\\psi}~$} values at CDF and LHC to lower energy, and is comparable \nto measurements at higher energies; it is also \nwithin 1.0 standard deviation of the {\\sc fonll+cem} calculation which has \na nonnegligible dependence on $\\sqrt{s}$, $p_{T}$ and $y$. \nThe extrapolated $d\\sigma\/dy(pp{\\rightarrow}b\\bar{b})$ is \n$3.63^{+1.92}_{-1.70}$ ${\\mu}$b at $B$ hadron mean rapidity, \n${\\pm}1.7$, in 510 GeV $p$+$p$ collisions,\nwhich is comparable with the \n{\\sc fonll} calculations in 500 GeV $p$$+$$p$ collisions.\n\nThe weak dependence on the center of mass energy in \nFig.~\\ref{fig:global_data}(a) for the \\mbox{$F_{B{\\rightarrow}J\/\\psi}~$} fraction could indicate that the \nvariation of the bottom yield with energy is compensated by a similar \nvariation of the prompt \\mbox{$J\/\\psi~$} yield. It is also noteworthy that only a \nfactor of two decrease of the $b$ over the $c$ yield is expected going \nfrom LHC energies to $\\sqrt{s}$ = 510 GeV, as calculated with {\\sc fonll} \n~\\cite{FONLL,Cacciari:2001td}. However, modeling the \nhadronization of the bound \\mbox{$c\\bar{c}~$} at low $p_T$ is still a challenge to QCD \ncalculations. The present results provide complementary information to \nthe surprisingly weak evolution of \\mbox{$F_{B{\\rightarrow}J\/\\psi}~$} in $0.51 \\le \\sqrt{s} \\le 13$ \nTeV domain, for central or near central rapidity and low $p_{T}$ \nproduction.\n\nThe analysis procedure developed in this study will be applied to other \ndata sets recorded by PHENIX at different center of mass energies. A \nsimilar method can also be applied to the study of $B$- and $D$-meson \nsemileptonic decays to muons, which will help to understand the \nproduction mechanism of charm and bottom, and provide a complementary \nmeasurement to the one presented in this paper.\n\n\n\\section*{ACKNOWLEDGMENTS}\n\n\nWe thank the staff of the Collider-Accelerator and Physics\nDepartments at Brookhaven National Laboratory and the staff of\nthe other PHENIX participating institutions for their vital\ncontributions. We acknowledge support from the \nOffice of Nuclear Physics in the\nOffice of Science of the Department of Energy,\nthe National Science Foundation, \nAbilene Christian University Research Council, \nResearch Foundation of SUNY, and\nDean of the College of Arts and Sciences, Vanderbilt University \n(U.S.A),\nMinistry of Education, Culture, Sports, Science, and Technology\nand the Japan Society for the Promotion of Science (Japan),\nConselho Nacional de Desenvolvimento Cient\\'{\\i}fico e\nTecnol{\\'o}gico and Funda\\c c{\\~a}o de Amparo {\\`a} Pesquisa do\nEstado de S{\\~a}o Paulo (Brazil),\nNatural Science Foundation of China (People's Republic of China),\nCroatian Science Foundation and\nMinistry of Science, Education, and Sports (Croatia),\nMinistry of Education, Youth and Sports (Czech Republic),\nCentre National de la Recherche Scientifique, Commissariat\n{\\`a} l'{\\'E}nergie Atomique, and Institut National de Physique\nNucl{\\'e}aire et de Physique des Particules (France),\nBundesministerium f\\\"ur Bildung und Forschung, Deutscher\nAkademischer Austausch Dienst, and Alexander von Humboldt Stiftung (Germany),\nNational Science Fund, OTKA, K\\'aroly R\\'obert University College, \nand the Ch. Simonyi Fund (Hungary),\nDepartment of Atomic Energy and Department of Science and Technology (India), \nIsrael Science Foundation (Israel), \nBasic Science Research Program through NRF of the Ministry of Education (Korea),\nPhysics Department, Lahore University of Management Sciences (Pakistan),\nMinistry of Education and Science, Russian Academy of Sciences,\nFederal Agency of Atomic Energy (Russia),\nVR and Wallenberg Foundation (Sweden), \nthe U.S. Civilian Research and Development Foundation for the\nIndependent States of the Former Soviet Union, \nthe Hungarian American Enterprise Scholarship Fund,\nand the US-Israel Binational Science Foundation.\n\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Branching random walks}\n\nThe study of extremal positions of branching random\nwalk and branching Brownian motion is by now considered as a classical problem\nwith first deep results obtained as early as in Hammersley's work \n\\cite{Ha}. During last decade it regained a considerable popularity. New substantial \nadvances were obtained but many questions remain open.\n\nLet us shortly recall the notion of branching random walk, a very special case of which \nwill be considered in this article. At initial (zero) time \nthere is one particle located at zero. At time 1 the particle \ndies but gives birth to a point process (configuration) of progeny that\nconsists of a random number of particles (points on the real line)\nwhose positions are, generally speaking, mutually dependent. \nEvery new born particle also lives one unit of time and dies \ngiving birth to a point process of progeny independent of all other analogous \nprocesses. The distribution of progeny process for every particle (ancestor)\ndiffers from the progeny process of initial particle by translation\nto the position of the ancestor.\n \n Therefore, the branching random walk is a genealogical Galton--Watson tree $\\T$, \n where every element $\\x\\in \\T$ is additionally characterized by its position on the line \n $V(\\x)$. Clearly, $V(\\x)$ is a sum (over the set of ancestors of $\\x$),\n of independent random variables, each term of the sum being the displacement of a\n particle with respect to the location of its parent particle. \n\nWe shall not consider variations of this basic model, e.g. those with random life \ntime of each particle.\n\nEvery particle $\\x$ belongs to a certain generation $|\\x|$, i.e. to \na level of the tree $\\T$. For the initial particle, we let the generation number \nbe zero.\n\nThe extremal positions in generations describing the generations' range \nare of special interest. They are defined by formulas\n\\[\n M_n:= \\max\\{V(\\x), |\\x|=n \\} ,\\qquad m_n:= \\min\\{V(\\x), |\\x|=n \\}. \n\\]\nThe limit theorems for the distributions of these variables are obtained in\n\\cite{ABR, Ai,Ba, BK, Br1, Br2, LS1, LS2,HuShi}. They essentially assert that \n \\be \\label{limMn}\n M_n= cn+ b_n +\\widetilde M_n,\n\\ee\nwhere $c$ is a non-negative constant, $b_n$ is a deterministic sequence \nvarying slower than a linear function (most commonly, $b_n$ behaves \nlogarithmically), and a sequence $\\widetilde M_n$ converges in distribution to some limit\nor is just bounded in probability. We stress that no multiplicative\nnorming is needed, i.e. the family of distributions of the variables \n$(M_n)_{n\\ge 0}$ is shift-compact.\n \n Obviously, the linear term in the asymptotics of $M_n$ can be trivially \neliminated by a constant shift of the progeny point process in the definition \nof the walk. \n \n The following recent theorem due to E. A\\\"{\\i}d\\'ekon \\cite{Ai} is one of the most \n repre\\-sent\\-ative and powerful results on the extremal positions.\n\n\\begin{thm} \\label{t:ai} Assume that the distribution of the progeny process \nin a branching random walk is non-lattice and that the following assumptions are \nsatisfied,\n\\be \\label{ai1a}\n \\E\\left(\\sum_{|\\x|=1} 1\\right)>1, \n\\ee\n\\be \\label{ai1bc}\n \\E\\left(\\sum_{|\\x|=1} e^{V(\\x)} \\right) =1, \\qquad \n \\E\\left(\\sum_{|\\x|=1} V(\\x) e^{V(\\x)} \\right)=0, \n\\ee\nas well as the moment restrictions\n\\bea \\label{ai2}\n && \\E\\left(\\sum_{|\\x|=1} V(\\x)^2 e^{V(\\x)} \\right)<\\infty, \\qquad\n \\\\\n && \\E\\left( X(\\ln_+ X)^2\\right)<\\infty, \\qquad\n \\E\\left( \\widetilde X(\\ln_+ \\widetilde X)\\right)<\\infty,\n\\eea\nwhere $X:=\\sum_{|\\x|=1} e^{V(\\x)}$, $\\widetilde X:=\\sum_{|\\x|=1} V(\\x)_- e^{V(\\x)}$.\n\nThen there exists an a.s. positive random variable $D$ such that for any $r\\in \\R$\nit is true that\n\\[\n \\lim_{n\\to\\infty} \\P\\left(M_n\\le - \\frac 32 \\ln n +r\\right) = \\E\\, e^{-De^{-r}}.\n\\]\n\\end{thm}\n\nTheorem \\ref{t:ai} means that in \\eqref{limMn} we have $c=0$, \n$b_n= -\\frac 32 \\ln n$, and the distributions of $\\widetilde M_n$ converge to a mixture\nof shifted double exponential distributions (Gumbel laws).\n\nAssumption \\eqref{ai1a} is natural: it means that the branching process is supercritical.\nThis condition provides sufficient number of particles in the walk. \nAssumptions \\eqref{ai1bc} mean that a linear scaling of the walk steps \n\"killing\" a linear term in \\eqref{limMn} is performed.\n\nThese assumptions are not too restrictive in the following sense.\nConsider a branching random walk satisfying condition\n\\eqref{ai1a} but not necessarily satisfying conditions\n\\eqref{ai1bc}. Let\n\\[\n \\Phi(\\ga):= \\E\\left(\\sum_{|\\x|=1} e^{\\ga V(\\x)} \\right),\n \\quad\n \\Psi(\\ga ):=\\ln \\Phi(\\ga ), \\qquad \\ga >0.\n\\]\nMaking a linear shift in one generation\n\\[\n \\tv(\\x):=\\ga V(\\x)-\\Psi(\\ga ), \\qquad |\\x|=1,\n\\]\ncorresponds to the shift of all particles\n\\be \\label{varch}\n \\tv(\\x):=\\ga V(\\x)-|\\x|\\Psi(\\ga ), \\qquad \\x\\in \\T.\n\\ee\nLet us search for $\\ga >0$ such that the analogues of \\eqref{ai1bc} \nfor the new walk\n\\[\n \\E\\left(\\sum_{|\\x|=1} e^{\\tv(\\x)} \\right) =1, \\qquad \n \\E\\left(\\sum_{|\\x|=1} \\tv(\\x) e^{\\tv(\\x)} \\right)=0. \n\\]\nwould be valid. Note that the first equality holds automatically,\nsince\n\\[\n \\E\\left(\\sum_{|\\x|=1} e^{\\tv(\\x)} \\right) \n =e^{-\\Psi(\\ga )} \\E\\left(\\sum_{|\\x|=1} e^{\\ga V(\\x)} \\right) \n =e^{-\\Psi(\\ga )}\\Phi(\\ga )=1.\n\\]\nWe may rewrite the second condition as\n\\begin{eqnarray*}\n 0 &=& \\E\\left(\\sum_{|\\x|=1} (\\ga V(\\x)-\\Psi(\\ga )) e^{\\ga V(\\x)} \\right)\n \\\\\n &=& \\ga \\, \\E\\left(\\sum_{|\\x|=1} V(\\x) e^{\\ga V(\\x)} \\right)\n -\\Psi(\\ga ) \\E\\left(\\sum_{|\\x|=1} e^{\\ga V(\\x)} \\right)\n \\\\\n &=& \\ga \\Phi'(\\ga )-\\Psi(\\ga )\\Phi(\\ga ),\n\\end{eqnarray*}\nwhich is equivalent to\n\\be \\label{R0}\n R(\\ga ):= \\ga \\Psi'(\\ga )-\\Psi(\\ga ) =0.\n\\ee\n\nIt follows easily from H\\\"older inequality that the function $\\Psi(\\cdot)$ \nis convex. Therefore, $R'(\\ga )=\\ga \\Psi''(\\ga )\\ge 0$ , i.e. $R(\\cdot)$ \nis an increasing function. We have $R(0)=-\\Psi(0)=-\\ln\\Phi(0)<0$ by \\eqref{ai1a}. \nHence, if\n\\[\n \\Phi(\\ga )<\\infty, \\qquad \\qquad 0\\le \\ga <\\infty,\n\\]\nand\n\\be \\label{rinfty}\n \\lim_{\\ga \\to\\infty} R(\\ga ) \n = \\lim_{\\ga \\to\\infty} \\left[ \\ga \\Psi'(\\ga )-\\Psi(\\ga )\\right] >0, \n\\ee\nthen equation \\eqref{R0} has a solution $\\ga >0$, and a liner change \n\\eqref{varch} reduces the study of the initial walk to the study of a walk\nsatisfying assumptions \\eqref{ai1bc}.\n\nIn the example we focus on below, no shift can render the distributions of\n$M_n$ convergent to a non-degenerate limit distribution. Instead,\nthey approach some helix of distributions, or, if the shifts are allowed, \nthey circulate along some closed curve in the space of distributions. \nThere are {\\it two} reasons preventing application of Theorem \\ref{t:ai} \nin that case: first, the distributions of the progeny process is a lattice \none; second, the reduction condition \\eqref{rinfty} fails.\n\n\n\\section{Hierarchical summation scheme}\n\nIn the following we consider the simplest model of a branching random\nwalk: every particle produces {\\it two} particles whose translations are\nindependent Bernoulli random variables taking value $1$ with probability\n$p$ and $-1$ with probability $1-p$. Therefore, the genealogic tree\n$\\T$ is just a simplest binary tree and the particles' locations are described\nby the sums of independent Bernoulli random variables along the branches of\nthis tree. It is amazing that such a simple model demonstrates an interesting\nlimit behavior.\n\nWe may redescribe the object under consideration as follows.\n\nConsider $n$-level binary tree and associate to its edges i.i.d. Bernoulli \nrandom variables $(B_i)$. The tree has $2^n$ leafs. To each leaf we associate \nthe sum of random variables picked up along the path connecting the leaf with \nthe tree root. Let $M_n$ be the maximum of the sums along all leafs. We shall \ninvestigate the asymptotic behavior of the distribution of $M_n$, as $n$\ngoes to infinity. Clearly, we have, $M_0=0$, $M_n\\in[-n,n]$, and $\nM_n=n\\ (\\textrm{mod}\\ 2)$. Moreover, there is a recurrency equation \n \\be \n M_{n+1}= \\max\\left\\{ M_n^{(1)}+B^{(1)}; M_n^{(2)}+B^{(2)}\\right\\},\n \\ee \n where $M_n^{(j)}$ and $B^{(j)}$ are independent copies of $M_n$, resp.\n of the Bernoulli variable. \n\nIt is worthwhile to notice that hierarchical summation schemes appear not only \nin connection to the branching walks. They emerge, for example, in physical models \nsuch as Derrida generalized random energy studied by Bovier and Kurkova \\cite{BK}. \nIn their setting, the summands situated on the same level of the tree have the\nsame distribution but this distribution is allowed to vary reasonably from one \nlevel to another. \n\n\\subsection{Symmetric case}\n\nIn this subsection we consider the most interesting symmetric case\n \\[\n \\P(B_i=1)=\\P(B_i=-1)= \\frac 12\\ .\n \\]\n \n We start with the study of the behavior of $\\E M_n$. Subsequent \n delicate considerations are entirely based on the following modest fact.\n \n\\begin{prop} \\label{prop1} \nLet \n\\[\n K_n:=\\{u: |u|=n, V(u)=M_n\\}\n\\]\nbe the number of vertices of level $n$ where the maximum $M_n$ is attained.\nThen $K_n\\to\\infty$ in probability and\n\\[\n \\lim_{n\\to \\infty} \\E(M_{n+1}-M_n) =1.\n\\]\n\\end{prop}\n\n{\\bf Proof.}\\ Notice that $K_n$ is bounded from below by a critical\nGalton--Watson process $Z_n$ with the progeny number $N$ defined by the law\n\\[ \n \\P(N=k)=\\begin{cases} \\tfrac 14, &k=0, \\\\\n \\tfrac 12,&k=1, \\\\\n \\tfrac 14,&k=2,\n \\end{cases} \n\\]\nand restarting from 1 at extinction time. To observe $Z_n$ on the tree, it is \nenough to keep track of the paths along which we have only $B_i=+1$; at each \nlevel, where we have extinction (the values $-1$ occupy all continuations of \nthe paths we observe), we keep a single path and consider only its continuations -- \naccording to the previous rule. Remark that all chosen paths provide maximal \nvalues of sums on each level, hence $Z_n\\le K_n$. \n\nLook at $Z_n$ from the point of view of Markov chain theory. All states are\nrecurrent and null, since the expectation of extinction time for our \nGalton--Watson process is infinite. Hence, for any fixed $\\ell\\in\\N$\n\\[\n \\lim_{n\\to\\infty} \\P(Z_n=\\ell)=0,\n\\]\ne.g. see Theorem 3 in \\cite[Section XIII.3]{Fel}. Hence, for any $m\\in \\N$\n\\[\n \\lim_{n\\to \\infty} \\P(K_n\\le m) \\le \\lim_{n\\to \\infty} \\P(Z_n\\le m)\n = \\sum_{\\ell=1}^m \\lim_{n\\to \\infty} \\P(Z_n =\\ell) =0, \n\\]\nas claimed.\n\nPassing to the expectations, let us notice that\n$M_{n+1}-M_n\\in\\{-1,+1\\}$; moreover,\n\\begin{eqnarray*}\n \\P(M_{n+1}-M_n=+1|\\, \\AA_n) &=& 1-2^{-K_n},\n \\\\\n \\P(M_{n+1}-M_n=-1|\\, \\AA_n) &=& 2^{-K_n},\n\\end{eqnarray*}\nwhere $\\AA_n$ stands for the sigma-field generated by the variables situated on\nfirst $n$ levels of the tree. It follows that\n\\[\n \\E(M_{n+1}-M_n)= 1- 2\\, \\E\\, 2^{-K_n},\n\\]\nand the second claim of the proposition follows from the first one.\n$\\Box$\n\\medskip \n\nProposition \\ref{prop1} shows that $\\E M_n\\sim n$, as $n$ grows to infinity. \nHence, it suggests that $M_n$ is relatively close to its\nupper border $n$. Therefore, it is more convenient to consider\nthe variables $M_n'=\\frac{n-M_n}2$. Then $M_n'$ is a non-negative \ninteger random variable and satisfies the relations $M_0'=0$, \n$M_n'\\in[0,n]$ and the equation\n \\be \n M_{n+1}'= \\min\n \\left\\{ M_n'^{(1)}+\\tilde B^{(1)}; M_n'^{(2)}+\\tilde B^{(2)}\\right\\}\n \\ee \nwhere $M_n'^{(j)}$ and $\\tilde B^{(j)}$ are independent copies of $M_n'$, \nresp. of a variable $\\tilde B$ having the distribution\n\\[\n \\P(\\tilde B=1)=\\P(\\tilde B=0)= \\frac 12\\ .\n \\]\nIt is more convenient to express the recurrency equation in terms of the \ntails of random variables. Let $F_n(x):=\\P(M_n'\\ge x)$. Then\n\\[ \n F_0(x)=\\begin{cases} 1,& x\\le 0,\n \\\\ 0,& x>0,\n \\end{cases}\n\\]\nand\n\\be \\label{itera}\n F_{n+1}(x)=\\left[\\frac{F_n(x)+F_{n}(x-1)} 2 \\right]^2.\n\\ee\nThis equation has {\\it many} invariant solutions. Indeed, \nan invariant solution should satisfy equations\n\\be \\label{invar}\n 4 F(x)=\\left[F(x)+F(x-1) \\right]^2.\n\\ee\nHence, $F(x-1)= G(F(x))$ and $F(x)=g(F(x-1))$, where \n$G(y):= 2\\sqrt{y}-y$ and $g(y):=2-y-2\\sqrt{1-y}$ are mutually inverse\nfunctions.\nIt follows that all values of $F$ can be expressed via $F(0)$ \nas iterations of functions $g$ and $G$.\nThe family of invariant distribution may be written in a parametric \nform $\\{\\F^a, {0 < a < 1}\\}$, where\n\\[\n \\F^a(n)= \\begin{cases}\n g^n(a), & n>0,\\\\\n a, & n=0,\\\\\n G^{|n|}(a),& n<0.\n \\end{cases} \n\\]\nand $g^n, G^n$ denote the $n$-th iteration of $g$, resp. $G$. It\nis clear that the family of invariant distributions form a\ncontinuous one-parametric curve (it is natural to call it a \"helix\") \nin the space of distributions $\\M(\\R^1)$; moreover, using the appropriate\nshifts we can transform this curve into a closed cycle, i.e. \n$\\F^{g(a)}(\\cdot-1)=\\F^a(\\cdot)$ for any $00$, take a positive integer $D$ such that $g^D(\\frac 12)\\le \\eps$. \nThen for any $d\\ge D$, by using monotonicity of $g(\\cdot)$ \nand inequality $g(y)\\le y$, we infer\n\\[\n \\max\\{ F_n(k_n+d); \\F^{a_n}(k_n+d)\\}\n \\le g^d(F_n(k_n)) \\le g^d(\\tfrac 12) \\le g^D(\\tfrac 12)\\le \\eps. \n\\]\nHence,\n\\be \\label {dD1}\n \\max_{d\\ge D} | F_n(k_n+d)- \\F^{a_n}(k_n+d)| \\le \\eps. \n\\ee\nNow we show by induction that for every $d=0,1,\\dots, D$\nit is true that\n\\be \\label {dD2}\n \\lim_{n\\to \\infty} | F_n(k_n+d)- \\F^{a_n}(k_n+d)| =0.\n\\ee\nWe have chosen parameters $a_n$ so that \n\\[\n \\F^{a_n}(k_n) = g^{k_n}(\\F^{a_n}(0)) = g^{k_n}(a_n)\n = g^{k_n}G^{k_n} (F_n(k_n))= F_n(k_n). \n\\] \nTherefore, for $d=0$ the left hand side of \\eqref{dD2} vanishes, thus\nproviding the induction base. Assume that for $d-1$ assertion \\eqref{dD2} \nis proved, then by \\eqref{itera} for $d$ we have\n\\[\n | F_n(k_n+d)- \\F^{a_n}(k_n+d)| \n = | g(F_n(k_n+d-1)-\\delta) - g(\\F^{a_n}(k_n+d-1))| +\\delta, \n\\]\nwhere $\\delta:= F_{n+1}(k_n+d)- F_{n}(k_n+d)\\in [0,\\Delta_n]$.\nIt follows that\n\\begin{eqnarray*}\n &&| F_n(k_n+d)- \\F^{a_n}(k_n+d)| \n \\\\\n &\\le& \\left[ | F_n(k_n+d-1) - \\F^{a_n}(k_n+d-1)|+\\Delta_n\\right] \n \\max_{0\\le y\\le \\frac 12}|g'(y)| +\\Delta_n,\n\\end{eqnarray*}\nSince $\\Delta_n \\to 0$ by \\eqref{Delta}, and since the function $g'$ \nis bounded on $[0,\\frac 12]$, we obtain that\n\\begin{eqnarray*}\n && \\limsup_{n\\to \\infty} | F_n(k_n+d)- \\F^{a_n}(k_n+d)|\n \\\\\n &\\le&\n \\lim_{n\\to \\infty} | F_n(k_n+d-1)- \\F^{a_n}(k_n+d-1)|\\cdot \n \\max_{0\\le y\\le \\frac 12}|g'(y)| \n =0.\n\\end{eqnarray*}\nTherefore, \\eqref{dD2} is proved. By combining \\eqref{dD1} with \\eqref{dD2},\nwe obtain\n\\[\n \\lim_{n\\to \\infty} \\max_{d\\ge 0} | F_n(k_n+d)- \\F^{a_n}(k_n+d)| =0.\n\\]\nNegative $d$'s are handled in the same way by using function $G$ instead \nof $g$. $\\Box$\n\\medskip\n\n{\\bf Proof of Theorem \\ref{limpoint}.} \\ \nWithout loss of generality we may assume that \n$\\tfrac{1}{2}\\not\\in \\left\\{\\F^a(x),x\\in\\Z\\right\\}$. Then there exists\n$z\\in \\Z$ such that\n\\[ \n \\F^a(z-1)>\\frac 12 >\\F^a(z).\n\\]\nFix an $\\eps>0$ and choose $\\delta\\in (0,\\min\\{a,1-a\\})$ so small that\n$b\\in (a-\\delta,a+\\delta)$ implies\n\\[\n \\max_{x\\in \\Z} |\\F^b(x)-\\F^a(x)|<\\eps.\n\\]\nWe may also require the inequalities \n\\be \\label{alsomed}\n \\F^{a-\\delta}(z-1)> \\frac 12 > \\F^{a+\\delta}(z).\n\\ee \nto hold. Take a positive integer $n_0$ such that for all $n\\ge n_0$ it is\ntrue that\n$\\Delta_n < \\F^{a+\\delta}(z)- \\F^{a-\\delta}(z)$.\nLet now $k$ be so large that $F_{n_0}(k)< \\F^{a-\\delta}(z)$.\nConsider the sequence $f_n:= F_n(k), n\\ge n_0,$ for fixed $k$.\nBy Proposition \\ref{prop2} it grows to one. Since \n$f_{n_0}< \\F^{a-\\delta}(z)$ and for all $n\\ge n_0$ it is true that \n\\[ \n f_{n+1}-f_n= F_{n+1}(k)-F_n(k)\\le \\Delta_n\n \\le \\F^{a+\\delta}(z)- \\F^{a-\\delta}(z),\n\\]\nthere exists $n:=n_k$ satisfying\n\\[\n F_n(k)=f_n\\in (\\F^{a-\\delta}(z), \\F^{a+\\delta}(z)).\n\\]\nNotice that $k$ is the median for $F_n$, since by \\eqref{alsomed}, \\eqref{FngG}\n\\[\n F_n(k)\\le \\F^{a+\\delta}(z)<\\frac 12\\,\n ;\n F_n(k-1)\\ge G(F_n(k))\\ge G(\\F^{a-\\delta}(z)) =\\F^{a-\\delta}(z-1)> \\frac 12.\n\\]\nTherefore, the approximating distribution $\\F^{a_n}$ from Theorem \\ref{limsim}\nsatisfies the equalities\n\\[\n \\F^{a_n}(k)=F_n(k)=\\F^b(z)\n\\]\nfor some $b\\in (a-\\delta,a+\\delta)$. Finally, we use the following\nfact: if $\\F^a(u)=\\F^b(v)$ for some\n$a,b\\in (0,1)$ and some $x,y\\in \\Z$, then for all $x\\in \\Z$ we have\n\\[\n \\F^a(x+u-v)= \\F^b(x).\n\\]\nIn our case $\\F^{a_n}(x+k-z)= \\F^b(x)$ holds. Therefore,\n\\begin{eqnarray*}\n&& \\max_{x\\in \\Z} |\\F^a(x)- F_n(x+k-z)|\n\\\\\n&\\le& \n\\max_{x\\in \\Z} |\\F^a(x)- \\F^b(x)| + \\max_{x\\in \\Z} |\\F^b(x)- F_n(x+k-z)| \n\\\\\n&\\le&\n\\eps + \\max_{x\\in \\Z} |\\F^{a_n}(x+k-z)- F_n(x+k-z)|.\n\\end{eqnarray*}\nSince $\\eps$ was chosen arbitrarily and the second term tends to zero by \nTheorem \\ref{limsim}, we obtain the assertion of Theorem \\ref{limpoint}.\\\n$\\Box$\n\\medskip\n\nOne of the reasons for non-existence of the unique limit distribution\nis the discrete type of Bernoulli distribution, as is clearly seen\nfrom Theorem \\ref{t:ai}. Another, less obvious and may be a deeper,\nreason is the failure of \\eqref{rinfty}. \nIndeed, in the hierarchical summation scheme for $p$-Bernoulli variables \nwe have\n\\begin{eqnarray*}\n \\ga\\ \\Psi'(\\ga)-\\Psi(\\ga) \n &=& \\ga\\ \\frac{pe^\\ga-(1-p)e^{-\\ga}}{pe^\\ga+(1-p)e^{-\\ga}} \n -\\ln 2-\\ln\\left(pe^\\ga+(1-p)e^{-\\ga}\\right)\n \\\\ \n &=& -\\ln (2p)- \\frac{2(1-p)\\ga}{pe^{2\\ga}}(1+o(1))\n\\end{eqnarray*}\nand\n\\[\n \\lim_{\\ga\\to\\infty} \\left[ \\ga\\Psi'(\\ga)-\\Psi(\\ga) \\right] =-\\ln (2p). \n\\]\nTherefore, condition \\eqref{rinfty} is satisfied iff $p<\\tfrac 12$.\n\nThe tree structure of the hierarchical summation scheme is not related to\nthe helix-type behavior of the maxima distributions: one can obtain a\nsimilar result for conventional summation (see Section \\ref{s:notree} \nbelow).\n\\medskip\n\n{\\bf Remark.} One can also derive Theorem \\ref{limsim} from Theorem 1 in\nBramson's work \\cite{Br1}. The additional advantages of his result are the more\ngeneral branching rule and approximation in the sense of almost sure convergence. \nHowever, Theorem \\ref{limsim} provides more transparent geometric picture of \nthe phenomenon.\n\n\n\\subsection{A limit theorem for the case $p>1\/2$} \\label{s:Blimit}\n\nWe maintain the notation of the previous subsection but assume now that \n \\[\n \\P(B_i=1)=1-\\P(B_i=-1)= p >1\/2 \\ .\n \\]\n Let $q:=1-p$. The recurrency equation now takes the form\n \\be \n M_{n+1}'= \\min\\left\\{ M_n'^{(1)}+\\tilde B^{(1)}; M_n'^{(2)}+\\tilde B^{(2)}\\right\\}\n \\ee \nwhere $M_n'^{(j)}$ and $\\tilde B^{(j)}$ stand for independent copies of $M_n'$ and of\na variable $\\tilde B$ that satisfies \n\\[\n \\P(\\tilde B=1)=1-\\P(\\tilde B=0)= q.\n\\]\nIn terms of the distribution tails $F_n(x):=\\P(M_n'\\ge x)$, we obtain an equation \nanalogous to (\\ref{itera}), namely,\n\\be \\label{itera2}\n F_{n+1}(x)=\\left[ F_n(x)p+F_{n}(x-1)q \\right]^2.\n\\ee\nThere is a big difference with respect to the previous case: now there exists \na {\\it unique} invariant non-degenerate solution satisfying the equation\n\\be \\label{invar2}\n F(x)=\\left[F(x)p+F(x-1)q \\right]^2\n\\ee\nand the initial condition $F(x)=1, x\\le 0$. Namely, \n\\[\nF(x)= (2p^2)^{-1} \\left[ \n1-2F(x-1)pq - \\sqrt{1-4F(x-1)pq}\\right],\n\\qquad x>0.\n\\]\nTherefore, it is not surprising that a limit theorem holds in this case.\n\n\\begin{thm} Uniformly over $x\\in \\Z$, the monotone convergence \n$F_n(x)\\nearrow F(x)$ holds.\n\\end{thm}\n\n{\\bf Proof.}\\ First, by induction in $x$ we derive from \\eqref{itera2} that \nthe sequence $F_n(x)$ is non-decreasing in $n$ for each fixed $x$. \nTherefore, the limit $F(x):=\\lim_n F_n(x)$ exists and satisfies equation \n\\eqref{invar2}. It remains to prove that it is non-degenerate, i.e. it is\ndifferent from identical unit. For this purpose, it is enough to notice that\n\\[\n F_n(1)=\\P(M_n'\\ge 1)=\\P(n-M_n\\ge 2)=\\P(M_n\\le n-2)\n\\]\ncoincides with extinction probability of the {\\it supercritical} \nGalton-Watson process with the progeny number $N$ defined by the law\n\\[ \n \\P(N=k)=\\begin{cases} q^2, &k=0, \\\\\n 2pq,&k=1, \\\\\n p^2,&k=2.\n \\end{cases} \n\\]\nTherefore, $1-F(1)$ is the survival probability of the process, which is \nstrictly positive, as $p>\\frac{1}{2}$.\n\\ $\\Box$\n\n\\subsection{Some results for the case $p< 1\/2$} \\label{s:Bdrift}\n\nIn what concerns limit theorems, not more is known for this case than for the\nhierarchical summation scheme with general independent random variables \nhaving finite exponential moments.\nFor $p=P(B=1)<1\/2$ the equation (\\ref{invar2}) has no non-trivial solutions, \ntherefore, the behavior of maxima is completely different than in the previous cases\n-- a drift with constant speed appears. Once we eliminate this linear drift, the \ndistributions of $M_n$ form a dense set with exponentially decreasing tails.\n\nRecall that a family of random variables $(X_n)$ is called\n{\\it shift-compact}, if there exists a real sequence $(a_n)$ such that the \ndistributions of random variables $X_n-a_n$ form a tight family on the real line, \ni.e.\n\\[ \n \\lim_{K\\to\\infty} \\sup_n \\P\\{|X_n-a_n|>K \\}=0.\n\\]\n\\medskip\n\n\\begin{prop} \\label{prop3} \nLet $p<1\/2$. Then the sequence of random variables $M_n$ is shift-compact, \nwhile\n\\[ \n \\E M_n \\sim \\rho \\, n, \\qquad n \\to\\infty,\n\\] \nwhere the shift coefficient $\\rho$ is defined from equation\n\\be \\label{Bdrift}\n 2p^\\rho q^{1-\\rho}= \\rho^\\rho(1-\\rho)^{1-\\rho}.\n\\ee \n\\end{prop}\n\n{\\bf Proof.}\\ The result follows, e.g., from Theorem 1.1 in \\cite{BZ}. \nIt is worthwhile to notice that the equation for the drift \\eqref{Bdrift} \nis essentially the special case of equation \\eqref{R0} providing reduction \nto the critical case. \n$\\Box$\n\\bigskip\n\n\n\\section{Cyclic theorems for maxima of independent sums}\n\\label{s:notree}\n\n\nLet $(\\xi_i)_{i\\in \\N}$ be {\\it integer}\\ i.i.d. random variables. \nConsider the sum $S_n:=\\sum_{i=1}^n \\xi_i$, and let\n$S_n^{(j)}$, $1\\le j\\le 2^n$, be independent copies of $S_n$. \nWe are interested in the behavior of $M_n:=\\max_{j\\le 2^n} S_n^{(j)}$. \n\nWe will assume that our random variables satisfy\n\\be \\label{moments}\n \\E|\\xi_1|<\\infty\\quad \\textrm{and}\\quad \\E\\exp\\{\\ga \\xi_1\\}<\\infty,\\ \\forall \\ga>0.\n\\ee\n\nLet $\\omega$ be the upper bound of the distribution,\n\\[ \n \\omega:= \\sup \\{m\\in \\N: \\P(\\xi_1=m)>0 \\}. \n\\]\nAssume that one of the two following assumptions is satisfied: either\n\n$(i)$ \\qquad $\\omega=\\infty$,\n\n\\noindent or\n\n$(ii)$ \\qquad $\\omega<\\infty$\\ and\\ $\\P\\left(\\xi_1=\\omega\\right)<1\/2$. \n\\medskip\n\nSince the cumulant\n\\[\n L(\\ga):=\\ln \\E \\exp\\{\\ga \\xi_1\\}\n\\] \nis a convex function of $\\ga$, the function $L(\\ga)-\\ga L'(\\ga)$ \nis non-increasing. It is continuous and vanishes at $\\gamma=0$.\nMoreover, if \\eqref{moments} holds, and any \nof assumptions $(i)$ or $(ii)$ is satisfied, it is easy to show that \n\\[ \n \\lim_{\\ga\\to +\\infty} [ L(\\ga)-\\ga L'(\\ga)] < \\ln (1\/2).\n\\]\nTherefore, a solution of equation\n\\be \\label{gammastar}\n L(\\ga)-\\ga L'(\\ga) = \\ln (1\/2)\n\\ee \nexists on $(0,+\\infty)$. Let denote it $\\ga_*$ and let\n$\\rho_*:= L'(\\ga_*)$. Notice also that under either $(i)$ or \n$(ii)$ the distribution of $\\xi_i$ is non-degenerated (not concentrated at a\nsingle point), therefore the solution of \\eqref{gammastar} is unique.\n\n\\begin{thm} \\label{cycle_notree} Let \\eqref{moments} and either \n$(i)$ or $(ii)$ holds. Let \n$\\rho_*,\\gamma_*$ be defined by equation $(\\ref{gammastar})$. Then \n\\be \\label{bound_gen}\n \\P\\left\\{ M_n < \\rho_* n - \\frac{\\ln n}{2 \\gamma_*} +z \\right\\}\n =\\exp\\left\\{ - \\, \\frac{\\exp\\{-\\gamma_* z\\} (1+o(1))}\n {\\sqrt{2\\pi}\\sigma(\\ga_*)(1-e^{-\\ga_*})} \\right\\},\n\\ee\nwhere $\\sigma(\\cdot)^2=L''(\\cdot)$, uniformly\nover\\footnote{In other words,\n we consider $z$ such that the expression in the left hand side is an \n integer number.} \n\\[\n z\\in I\\bigcap \\left[\\Z - \\rho_* n + \\frac{\\ln n}{2 \\gamma_*} \\right]\n\\] \n for any bounded interval $I$. \n\\end{thm}\n\nWe can rewrite formula \\eqref{bound_gen} as\n\\be \\label{bound_geni}\n \\P\\left\\{ M_n < m \\right\\}\n =\\exp\\left\\{ - \\exp\\{-\\gamma_* (m-a_n)\\} (1+o(1)) \\right\\},\n \\qquad m\\in \\Z,\n\\ee\nwhere\n\\[\n a_n:= \\rho_* n \n -\\frac{\\ln[\\sqrt{2\\pi n}\\sigma(\\ga_*)(1-e^{-\\ga_*})]}{\\ga_*}\\ .\n\\]\n\nFor each $a\\in\\R$ let $\\F^a$ denote the distribution on integers\ngiven by\n\\[\n \\F^a((m,+\\infty))\n = \\exp\\left\\{ - \\exp\\{-\\gamma_* (m-a)\\}\\right\\}, \\qquad m\\in\\Z.\n\\]\nThen $(\\F^a)_{a\\in\\R}$ is a curve in the space of distributions. It is natural\nto perceive it as a helix, in view of 1-periodicity up to a shift: \n$\\F^{a+1}\\{m+1\\}=\\F^{a}\\{m\\}$. Relation \\eqref{bound_geni} shows that the \ndistribution of r.v. $M_n$ admits the uniform approximation by the helix\nelement $\\F^{a_n}$, while after appropriate centering it admits an approximation\nby the element $\\F^{[a_n]}$ of the helix turn $(\\F^a)_{0\\le a < 1}$.\nMoreover any distribution $(\\F^a)_{0\\le a < 1}$ is a limit of some subsequence\nof centered distributions of $M_n$.\n\nThe proof of Theorem \\ref{cycle_notree}, which is supposed to be published separately,\nis based on a large deviation theorem due to V.V. Petrov \\cite[Complement 2 in \\S4 \nChapter VIII]{Petr}.\n\nLet us consider Bernoulli case as an example.\nLet $\\xi_i=B_i$ be independent random variables having non-symmetric \nBernoulli distribution, i.e.\n\\[\n \\P(B_i=1)=1-\\P(B_i=-1)= p < 1\/2 \\ .\n \\]\nLet the drift coefficient $\\rho_*$ be again defined by equation (\\ref{Bdrift}). \n We also need two auxiliary constants \n$\\kappa:=\\frac{p(1-\\rho_*)}{q\\rho_*}\\in (0,1)$ and $\\beta:=2\\pi\\rho_*(1-\\rho_*)$.\n Then the result of Theorem \\ref{cycle_notree} takes the following form.\n\n \\begin{thm} \\label{cycle_notree_b} \n We have\n \\be \\label{bound_ber}\n \\P\\left\\{ M_n< \\rho_* n -\\frac{\\ln(\\beta n)}{2|\\ln\\kappa|} +z \\right\\}\n =\\exp\\left\\{ - \\frac{\\kappa^{z}}{1-\\kappa}\\, (1+o(1))\\right\\},\n \\ee\n uniformly over\n \\[\n z\\in I\\bigcap \\left[\\Z - \\rho_* n +\\frac{\\ln(\\beta n)}{2|\\ln\\kappa|}\\right]\n \\] \n for any bounded interval $I$.\n \\end{thm}\n\n{\\bf Remark.} For $p \\ge \\tfrac 12$ neither of conditions $(i), (ii)$ holds.\nEquation \\eqref{gammastar} has no solutions, thus Theorem \\ref{cycle_notree} \ndoes not apply. \n\\bigskip\n\nThe author is deeply indebted to Irina Kurkova and to Zhan Shi for interesting discussions,\nfor providing important references, and, most of all, for motivation to write this article. \n\n\n\n\n\n\n\n\n\\bibliographystyle{amsplain}\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\nThere are at least three main parts in a theory of Deep Neural Networks. The\nfirst part is about approximation -- how and when can deep neural networks\navoid the curse of dimensionality' \\cite{poggio2016and}? The second part is about the\nlandscape of the minima of the empirical risk: what can we say in\ngeneral about\nglobal and local minima? The third part is about generalization: why can SGD\n(Stochastic Gradient Descent) generalize so well despite standard\noverparametrization of the deep neural networks \\cite{zhang2017theory}? \nIn this paper we focus on the second part: the landscape of the\nempirical risk. \n \nOur \\textbf{main results}: we characterize the \\textbf{landscape of the empirical risk} from three perspectives: \n\n\\begin{itemize}[leftmargin=*] \n\\item \\textbf{Theoretical Analyses (Section \\ref{sec:theoretical}):} We\n study the nonlinear system of equations corresponding to critical\n points of the gradient of the loss (for the $L_2$ loss function) and\n to zero minimizers, corresponding to interpolating solutions. In the\n equations the functions representing the network's output contain\n the RELU nonlinearity. We consider an $\\epsilon$- approximation of\n it in the sup norm using a polynomial approximation or the\n corresponding Legendre expansion. We can then invoke Bezout theorem\n to conclude that there are a {\\it very large number of zero-error\n minima}, and that {\\it the zero-error minima are highly\n degenerate}, whereas the local non-zero minima, if they exist, may\n not be degenerate. In the case of classification, zero error implies\n the existence of a margin, that is a flat region in all dimensions around\n zero error.\n \\item \\textbf{Visualizations and Experimental Explorations (Section \\ref{sec:vis}):} The \n theoretical results indicate that there are degenerate global\n minima in the loss surface of DCNN. However, it is unclear how the\n rest of the landscape look like. To gain more knowledge about\n this, we visualize the landscape of the entire training process\n using \\textbf{Multidimensional Scaling}. We also probe locally the\n landscape at different locations by perturbation and interpolation\n experiments. \n \\item \\textbf{A simple model of the landscape (Section\n \\ref{sec:intuitive}). } Summarizing our theoretical and\n experimental results, we propose a simple baseline model for the\n landscape of empirical risk, as shown in Figure\n \\ref{fig:landscape_model}. We conjecture that the loss surface of\n DCNN is not as complicated as commonly believed. At least in the\n case of overparametrized DCNNs, the loss surface might be simply a\n collection of (high-dimensional) basins, which have some of the\n following interesting properties: 1. Every basin reaches a flat\n global minima. 2. The basins may be rugged such that any\n perturbation or noise leads to a slightly different convergence\n path. 3. Despite being perhaps locally rugged, the basin has a\n relatively regular overall landscape such that the average of two\n model within a basin gives a model whose error is roughly the\n average of (or even lower than) the errors of original two models.\n 4. Interpolation between basins, on the other hand, may\n significantly raise the error. 5. There might be some good\n properties in each basin such that there is no local minima --- we\n do not encounter any local minima in CIFAR, even when training\n with batch gradient descent without noise.\n\\end{itemize}\n\n \n\n\n\\begin{figure}\\centering \n \\includegraphics[width=\\textwidth]{svg\/model3_more.pdf} \n\\caption{The Landscape of empirical risk of overparametrized DCNN may\n be simply a collection of (perhaps slightly rugged) basins. (A) the\n profile view of a basin (B) the top-down view of a basin (C) example\n landscape of empirical risk (D) example perturbation: a small\n perturbation does not move the model out of its current basin, so\n re-training converges back to the bottom of the same basin. If the\n perturbation is large, re-training converges to another basin. (E)\n Example Interpolation: averaging two models within a basin tend to\n give a error that is the average of the two models (or less). \n Averaging two models between basins tend to give an error that is\n higher than both models. (F) Example optimization trajectories that \n correspond to Figure \\ref{fig:branch_layer_2_all_perturb_0.25} (G), (H) see Section \\ref{sec:intuitive}. } \n\\label{fig:landscape_model}\n\\end{figure}\n\n\n\n\n\n\\section{Framework}\n\n \nWe assume a deep network of the convolutional type and\n overparametrization, that is more weights than data points,\nsince this is how successful deep networks have been used. \nUnder these conditions, we will show that imposing zero empirical\nerror provides a system of equations (at the zeros) that have a large\nnumber of degenerate solutions in the weights. The equations are\npolynomial in the weights, with coefficients reflecting components of\nthe data vectors (one vector per data point). The system of equations\nis underdetermined (more unknowns than equations, e.g. data points)\nbecause of the assumed overparametrization. Because the global minima\nare degenerate, that is flat in many of the dimensions, they are more\nlikely to be found by SGD than local minima which are less degenerate.\nAlthough generalization is not the focus of this work, such flat minima\nare likely to generalize better than sharp minima, which might be the\nreason why overparametrized deep networks do not seem to overfit.\n\n\n\\section{Landscape of the Empirical Risk: Theoretical Analyses}\n\\label{landscape}\n\\label{sec:theoretical}\n\n\nThe following theoretical analysis of the landscape of the empirical risk is based\non a few assumptions: (1) We assume that the network is overparametrized, typically using several\n times more parameters (the weights of the network) than data points.\n In practice, even with data augmentation (in most of the experiments\n in this paper we do not use data augmentation), one can always make the\n model larger to achieve overparametrization without sacrificing\n either the training or generalization performance. \n(2) This section assumes a regression framework. We study how many\n solutions in weights lead to perfect prediction of training labels.\n In classification settings, such solutions is a subset of all solutions. \n\n\nAmong the critical points of the gradient of the empirical loss, we\nconsider first the zeros of loss function given by the set of\nequations where $N$ is the number of training examples $f(x_i) - y_i= 0\\,\\,\\,\\,for\\,\\,i=1,\\cdots,N$\n\n\nThe function $f$ realized by a deep neural network is polynomial if\neach of RELU units is replaced by a univariate polynomial. Of course\neach RELU can be approximated within any desired $\\epsilon$ in the sup\nnorm by a polynomial. In the well-determined case (as many unknown\nweights as equations, that is data points), Bezout theorem provides an\nupper bound on the number of solutions. {\\it The number of distinct\n zeros} (counting points at infinity, using projective space,\nassigning an appropriate multiplicity to each intersection point, and\nexcluding degenerate cases) would be {\\it equal to $Z$ - the product\n of the degrees of each of the equations}. Since the system of\nequations is usually underdetermined -- as many equations as data\npoints but more unknowns (the weights) -- we expect an infinite number\nof global minima, under the form of $Z$ {\\it regions} of zero\nempirical error. If the equations are inconsistent there are still\nmany global minima of the squared error that are solutions of systems\nof equations with a similar form.\n\nWe assume for simplicity that the equations have a particular compositional form (see\n\\cite{Mhaskaretal2016}). The degree of each approximating equation\n$\\ell^d(\\epsilon)$ is determined by the desired accuracy $\\epsilon$\nfor approximating the ReLU activation by a univariate polynomial $P$\nof degree $\\ell(\\epsilon)$ and by the number of layers $d$.\n\nThe argument based on RELUs approximation for estimating the number of\nzeros is a qualitative one since good approximation of the $f(x_i)$\ndoes not imply by itself good approximation -- via Bezout theorem -- of the number of its\nzeros. Notice, however, that we could abandon completely the approximation\napproach and just consider the number of zeros when the RELUs are\nreplaced by a low order univariate polynomial. The argument then would not\nstrctly apply to RELU networks but would still carry weight because the two\ntypes of networks -- with polynomial activation and with RELUs --\nbehave empirically (see Figure \\ref{fig:relu_vs_polynomial}) in a similar way. \n \nIn the Supporting Material we provide a simple example of a network\nwith associated equations for the exact zeros. They are a system of underconstrained polynomial\nequations of degree $l^d$. In general, there are as many constraints\nas data points $i=1,\\cdots,N$ for a much larger number $K$ of unknown\nweights $W, w, \\cdots$. There are no solutions if the system is\ninconsistent -- which happens if and only if $0 = 1$ is a linear\ncombination (with polynomial coefficients) of the equations (this is\nHilbert's Nullstellensatz). Otherwise, it has infinitely many complex\nsolutions: the set of all solutions is an algebraic set of dimension\nat least $K-N$. If the underdetermined system is chosen at random the\ndimension is equal to $K-N$ with probability one.\n\n \n\nEven in the non-degenerate case (as many data as parameters), Bezout\ntheorem suggests that there are many solutions. With $d$ layers the\ndegree of the polynomial equations is $\\ell^d$. With $N$ datapoints\nthe Bezout upper bound in the zeros of the weights is\n$\\ell^{Nd}$. Even if the number of real zero -- corresponding to zero\nempirical error -- is much smaller (Smale and Shub estimate\n\\cite{ShubSmale94} $l^{\\frac{Nd}{2}}$), the number is still enormous:\nfor a CiFAR situation this may be as high as $2^{10^5}$.\n\nAs mentioned, in several cases we expect absolute zeros to exist with\nzero empirical error. If the equations are inconsistent it seems\nlikely that global minima with similar properties exist.\n\n\nIt is interesting now to consider the critical points of the gradient.\nThe critical points of the gradient are\n$\\nabla_w\\sum_{i=1}^NV(f(x_i), y_i)=0$, \\noindent which gives $K$\nequations: $\\sum_{i=1}^N \\nabla_wV(f(x_i), y_i) \\nabla_w f(x_i)=0$,\nwhere $V(. , .)$ is the loss function. \n\n\n\n\n\n\nApproximating within $\\epsilon$ in the sup norm each ReLU in $f(x_i)$\nwith a fixed polynomial $P(z)$ yields again a system of $K$ polynomial\nequations in the weights of higher order than in the case of\nzero-minimizers. They are of course satisfied by the degenerate zeros\nof the empirical error but also by additional non-degenerate (in the\ngeneral case) solutions.\n\nThus, we have \\textbf{Proposition 1:} \\textit{There are a very large number of zero-error minima which are highly degenerate unlike the local non-zero minima.} \n\n\n\n\n\n\n\\section{The Landscape of the Empirical Risk: Visualizing and Analysing the Loss Surface During the Entire Training Process (on CIFAR-10)}\n\\label{sec:vis}\n\n\\subsection{Experimental Settings}\nIn the empirical work described below we analyze a classification\nproblem with cross entropy loss. Our theoretical analyses with the\nregression framework provide a \\textit{lower bound} of the number of\nsolutions of the classification problem.\n\nUnless mentioned otherwise, we trained a 6-layer (with the 1st layer\nbeing the input) Deep Convolutional Neural Network (DCNN) on\nCIFAR-10. All the layers are 3x3 convolutional layers with stride\n2. No pooling is performed. Batch Normalizations (BNs) \\cite{ioffe2015batch} are used\nbetween hidden layers. The shifting and scaling parameters in BNs are\nnot used. No data augmentation is performed, so that the training set\nis fixed (size = 50,000). There are 188,810 parameters in the DCNN.\n\n\\textbf{Multidimensional Scaling} The core of our visualization\napproach is Multidimensional Scaling (MDS) \\cite{borg2005modern}. We\nrecord a large number of intermediate models during the process of\nseveral training schemes. Each model is a high dimensional point with\nthe number of dimensions being the number of parameters. The\nstrain-based MDS algorithm is applied to such points and a\ncorresponding set of 2D points are found such that the dissimilarity\nmatrix between the 2D points are as similar to those of the\nhigh-dimensional points as possible. One minus cosine distance is used\nas the dissimilarity metric. This is more robust to scaling of the\nweights, which is usually normalized out by BNs. Euclidean distance\ngives qualitatively similar results though.\n\n\n\n\n\\begin{figure}\\centering \n \n \\centering \n\\makebox[0pt]{ \\includegraphics[width=1.2\\textwidth]{polynomial_nonlinearity_2.jpg} }\n\\caption{One can convert a deep network into a polynomial function by\n using polynomial nonlinearity. As long as the nonlinearity\n approximates ReLU well (especially near 0), the ``polynomial net''\n performs similarly to a ReLU net. Our theory applies rigorously to a ``polynomial net''. }\n\\label{fig:relu_vs_polynomial} \n\\end{figure} \n\n\\subsection{Global Visualization of SGD Training Trajectories}\n\nWe show in Figure \\ref{fig:global_vis_layer2_stage_0} the optimization\ntrajectories of Stochastic Gradient Descent (SGD) throughout the\nentire optimization process of training a DCNN on CIFAR-10. The SGD\ntrajectories follow the mini-batch approximations of the training loss\nsurface. Although the trajectories are noisy due to SGD, the collected\npoints along the trajectories provide a good visualization of the\nlandscape of empirical risk. We show the visualization based on the\nweights of layer 2. The results from other layers (e.g., layer 5) are\nqualitatively similar and are shown in the Appendix.\n \n \n\n\n\\begin{figure*}\\centering\n \n \\centering\n\\makebox[0pt]{\\includegraphics[width=1.05\\textwidth]{svg\/exp1.pdf}} \n\\caption{We train a 6-layer (with the 1st layer being the input) convolutional\nnetwork on CIFAR-10 with stochastic gradient descent (batch size =\n100). We divide the training process\n into 12 stages. In each stage, we perform \\textbf{8 parallel} SGDs\n with learning rate 0.01 for 10 epochs, resulting in 8 parallel\n trajectories denoted by different colors. Trajectories 1 to 4 in\n each stage start from the final model (denoted by $P$) of trajectory\n 1 of the previous stage. Trajectories 5 to 8 in each stage start\n from a perturbed version of $P$. The perturbation is performed by\n adding a gaussian noise to the weights of each layer with the\n standard deviation being 0.01 times layer's standard deviation. In\n general, we observe that running any trajectory with SGD again\n almost always leads to a slightly different convergence path. We\n plot the MDS results of all the layer 2 weights collected throughout\n all the training epochs from stage 1 to 12.\n Each number in the figure represents a\n model we collected during the above procedures. The points are in a\n 2D space generated by the MDS algorithm such that their pairwise distances\n are optimized to try to reflect those distances in the original high-dimensional space. \n The results of stages more than 5 are quite cluttered. So we applied a\n separate MDS to the stages 5 to 12. We also plot stage 1 and 5 separately for example.\n The trajectories of more stages are plotted in the Appendix. \n}\n\\label{fig:global_vis_layer2_stage_0}\n\\end{figure*}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\subsection{Global Visualization of Training Loss Surface with Batch Gradient Descent}\n \nNext, we visualize in Figure \\ref{fig:branch_layer_2_all_perturb_0.25}\nthe exact training loss surface by training the models using Batch\nGradient Descent (BGD). In addition to training, we also performed\nperterbation and interpolation experiments as described in Figure\n\\ref{fig:branch_layer_2_all_perturb_0.25}. The main trajectory,\nbranches and the interpolated models together provides a good\nvisualization of the landscape of the empirical risk. \n\n\n\n\n\\begin{figure*}\\centering\n \\centering \n\\makebox[0pt]{\\includegraphics[width=1.05\\textwidth]{svg\/exp2.pdf}} \n\\caption{ Visualizing the exact training loss surface using Batch\n Gradient Descent (BGD). A DCNN is trained on CIFAR-10 from scratch\n using Batch Gradient Descent (BGD). The numbers are training errors.\n ``NaN'' corresponds to randomly initialized models (we did not\n evaluate them and assume they perform at chance). At epoch 0, 10, 50\n and 200, we create a branch by perturbing the model by adding a\n Gaussian noise to all layers. The standard deviation of the Gaussian\n is 0.25*S, where S denotes the standard deviation of the weights in\n each layer, respectively. We also interpolate (by averaging) the\n models between the branches and the main trajectory, epoch by epoch.\n The interpolated models are evaluated on the entire training set to\n get a performance. First, surprisingly, BGD does not get stuck in\n any local minima, indicating some good properties of the landscape.\n The test error of solutions found by BGD is somewhat worse than\n those found by SGD, but not too much worse (BGD ~ 40\\%, SGD ~ 32\\%)\n . Another interesting observation is that as training proceeds, the\n same amount of perturbation are less able to lead to a drastically\n different trajectory. Nevertheless, a perturbation almost always\n leads to at least a slightly different model. The local neighborhood\n of the main trajectory seems to be relatively flat and contain many\n good solutions, supporting our theoretical predictions. It is also\n intriguing to see interpolated models to have very reasonable\n performance. The results here are based on weights from layer 2. The\n results of other layers are similar and are shown in the Appendix. } \n\\label{fig:branch_layer_2_all_perturb_0.25}\n\\end{figure*}\n\n \n\n\n\n\n\n\n \n\\subsection{More Detailed Analyses of Several Local Landscapes (especially the flat global minima)} \n\\label{vis:sec3} \n\nWe perform some more detailed analyses at several locations of the\nlandscape. Especially, we would like to check if the global minima is\nflat. We train a 6-layer (with the 1st layer being the input) DCNN on\nCIFAR-10 with 60 epochs of SGD (batch size = 100) and 400 epochs of\nBatch Gradient Descent (BGD). BGD is performed to get to as close to\nthe global minima as possible. Next we select three models from this\nlearning trajectory (1) $M_5$: the model at SGD epoch 5. (2) $M_{30}$:\nthe model at SGD epoch 30. (3) $M_{final}$: the final model after 60\nepochs of SGD and 400 epochs of BGD. The results of (3) are shown in \nFigure \\ref{fig:perturb_err_loss_from_epoch_sgd60_plus_gd400} while\nthose of (1) and (2) are shown in the the Appendix. \n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n \n\n\n\n\n\n\n\n\n\n\\begin{figure*}[!h]\n\\centering\n\\includegraphics[width=\\textwidth]{svg\/exp3.pdf} \n\\caption{Verifying the flatness of global minima: We layerwise perturb the weights of model $M_{final}$ (which is at a global minimum) by adding a gaussian noise with standard deviation = 0.1 * S, where S is the standard deviation of the weights. After perturbation, we continue training the model with 200 epochs of gradient descent (i.e., batch size = training set size). The same procedure was performed 4 times, resulting in 4 curves shown in the figures. The training and test classification errors and losses are shown in A1, A2, B1 and B2. The MDS visualization of 4 trajectories (denoted by 4 colors) is shown in C1 --- the 4 trajectories converge to different solutions. The MDS visualization of one trajectory is in C2. In addition, we show the confusion matrices of converged models in the Appendix to verify that they are indeed different models. More similar experiments can be found in the Appendix. } \n\\label{fig:perturb_err_loss_from_epoch_sgd60_plus_gd400}\n\\end{figure*}\n\n\n\n \n\n\n\n\n\n\n\n\n \n\n\\section{The Landscape of the Empirical Risk: Towards an Intuitive Baseline Model} \n\\label{sec:intuitive}\n\nIn this section, we propose a simple baseline model for the landscape of empirical risk that is consistent with all of our theoretical and experimental findings.\nIn the case of overparametrized DCNNs, here is a recapitulation of our main observations: \\\\\n$\\bullet$ Theoretically, we show that there are a large number of global minimizers with zero (or small) empirical error. The same minimizers are degenerate. \\\\\n$\\bullet$ Regardless of Stochastic Gradient Descent (SGD) or Batch Gradient Descent (BGD), a small perturbation of the model almost always leads to a slightly different convergence path. The earlier the perturbation is in the training process the more different the final model would be. \\\\\n$\\bullet$ Interpolating two ``nearby'' convergence paths lead to another convergence path with similar errors every epoch. Interpolating two ``distant'' models lead to raised errors. \\\\\n$\\bullet$ We do not observe local minima, even when training with BGD. \\\\ \n \n\n \n\n \nThere is a simple model that is consistent with above observations. As \na first-order characterization, we believe that the landscape of\nempirical risk is simply \\textbf{a collection of (hyper) basins that each has\n a flat global minima}. Illustrations are provided in Figure\n\\ref{fig:landscape_model}. \n \nAs shown in Figure \\ref{fig:landscape_model}, the building block of the landscape is a \nbasin. \\textbf{How does a basin look like in high dimension? Is there any evidence for this model?} One definition of a hyper-basin \nwould be that as loss decreases, the hypervolume of the parameter\nspace decreases (see Figure \\ref{fig:landscape_model} (H) for example). As we\ncan see, with the same amount of scaling in each dimension, the volume \nshrinks much faster as the number of dimension increases --- with a\nlinear decrease in each dimension, the hypervolume decreases as a\nexponential function of the number of dimensions. With the number of\ndimensions being the number of parameters, the volume shrinks\nincredibly fast. This leads to a phenomenon that we all observe\nexperimentally: whenever one perturb a model by adding some\nsignificant noise, the loss almost always never go down. The larger\nthe perturbation is, the more the error increases. The reasons are\nsimple if the local landscape is a hyper-basin: the volume of a lower\nloss area is so small that by randomly perturbing the point, there is\nalmost no chance getting there. The larger the perturbation is, the\nmore likely it will get to a much higher loss area.\n\n\nThere are, nevertheless, other plausible variants of this model that\ncan explain our experimental findings. In Figure\n\\ref{fig:landscape_model} (G), we show one alternative model we call\n``basin-fractal''. This model is more elegant while being also\nconsistent with most of the above observations. The key difference\nbetween simple basins and ``basin-fractal'' is that in\n``basin-fractal'', one should be able to find ``walls'' (raised\nerrors) between two models within the same basin. Since it is a\nfractal, these ``walls'' should be present at all levels of errors.\nFor the moment, we only discovered ``walls'' between two models the\ntrajectories lead to which are very different (obtained either by\nsplitting very early in training, as shown in Figure\n\\ref{fig:branch_layer_2_all_perturb_0.25} branch 1 or by a very significant\nperturbation, as shown in the Appendix). We have not found other \nsignificant ``walls'' in all other perturbation and interpolation\nexperiments. So a first order model of the landscape would be just a\ncollection of simple basins. Nevertheless, we do find\n``basin-fractal'' elegant, and perhaps the ``walls'' in the low loss\nareas are just too flat to be noticed.\n \nAnother surprising finding about the basins is that, they seem to be\nso ``smooth'' such that there is no local minima. Even when training\nwith batch gradient descent, we do not encounter any local minima.\nWhen trained long enough with small enough learning rates, one always\ngets to 0 classification error and negligible cross entropy loss.\n \n \n\n\n\n\n\\section{Previous theoretical work} \n\n\nDeep Learning references start with Hinton's backpropagation and with\nLeCun's convolutional networks (see for a nice review\n\\cite{LeCunBengioHinton2015}). Of course, multilayer convolutional\nnetworks have been around at least as far back as the optical\nprocessing era of the 70s. The Neocognitron\\cite{fukushima:1980} was a\nconvolutional neural network that was trained to recognize characters.\nThe property of {\\it compositionality} was a main motivation for\nhierarchical models of visual cortex such as HMAX which can be\nregarded as a pyramid of AND and OR layers\\cite{Riesenhuber1999}, that\nis a sequence of conjunctions and disjunctions. \\cite{poggio2016and} provided formal conditions under which deep\nnetworks can avoid the curse of dimensionality. More specifically,\nseveral papers have appeared on the landscape of the training error\nfor deep networks. Techniques borrowed from the physics of spin\nglasses (which in turn were based on old work by Marc Kac on the zeros\nof algebraic equations) were used \\cite{landscape2015} to suggest the\nexistence of a band of local minima of high quality as measured by the\ntest error. The argument however depends on a number of assumptions\nwhich are rather implausible (see \\cite{SoudryCarmon2016} and\n\\cite{kawaguchi2016deep} for comments and further work on the\nproblem). Soudry and Carmon \\cite{SoudryCarmon2016} show that with\nmild over-parameterization and dropout-like noise, training error for\na neural network with one hidden layer and piece-wise linear\nactivation is zero at every local minimum. All these results suggest\nthat the energy landscape of deep neural networks should be easy to\noptimize. They more or less hold in practice \u2014it is easy to\noptimize a prototypical deep network to near-zero loss on the training\nset.\n \n \n\n\\section{Discussion and Conclusions}\n\\textbf{Are the results shown in this work data dependent?} We visualized the SGD trajectories in the case of fitting random labels. There is no qualitative difference between the results from those of normal labels. So it is safe to say the results are at least not label dependent. We will further check if fitting random input data to random labels will give similar results. \\\\\n\\textbf{What about Generalization?} It is experimentally observed that (see Figure \\ref{appendix:fig:generalization} in the Appendix), at least in all our experiments, overparametrization (e.g., 60x more parameters than data) does not hurt generalization at all. \\\\ \n\\textbf{Conclusions:} Overall, we characterize the landscape of empirical risk of overparametrized DCNNs with a mix of theoretical analyses and experimental explorations. We provide a simple baseline model of the landscape that can account for all of our theoretical and experimental results. Nevertheless, as the final model is so simple, it is hard to believe that it would completely characterize the true loss surface of DCNN. Further research is warranted. \n\n \n\n\n\n\n\n\n\n\n\n\n\n \n\n\\bibliographystyle{ieeetr} \n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction and statement of results}\\label{sec:intro}\n\nIn this paper, we study the following graph process, which was recently introduced by Benjamini, Shinkar, and Tsur~\\cite{bst}. Let $G=(V,E)$ be a finite connected graph. We start the process by placing exactly one \\emph{agent} on each vertex of $G$. Every pair of agents on adjacent vertices is declared to be \\emph{acquainted}, and remains so throughout the process. In each round of the process, we choose some matching $M$ in $G$. ($M$ need not be maximal; perhaps it is a single edge.) For each edge of $M$, we swap the agents occupying its endpoints, which may cause more agents to become acquainted. The \\emph{acquaintance time} of $G$, denoted by $\\mathcal A \\mathcal C(G)$, is the minimum number of rounds required for all agents to become acquainted with one another.\n\nIt is clear that \n\\begin{equation}\\label{eq:trivial_lower}\n\\mathcal A \\mathcal C(G) \\ge \\frac {{|V| \\choose 2}}{|E|} - 1, \n\\end{equation}\nsince $|E|$ pairs are acquainted initially, and at most $|E|$ new pairs become acquainted in each round. In~\\cite{bst}, it was shown that always $\\mathcal A \\mathcal C(G) = O(\\frac{n^2}{\\ln n \/ \\ln \\ln n})$, where $n = |V|$, which was slightly sharpened in~\\cite{KMP} to $\\mathcal A \\mathcal C(G) = O(\\frac{n^2}{\\ln n})$. This general upper bound was recently improved and now we know that $\\mathcal A \\mathcal C(G) = O(n^{3\/2})$ for every graph $G$, which was conjectured in~\\cite{bst}\nand is tight up to a multiplicative constant~\\cite{AngelShinkar}. \nIn~\\cite{KMP}, another conjecture from~\\cite{bst} on the acquaintance time of the random graph ${\\mathcal{G}}(n,p)$ was proved. \nIt was shown that asymptotically almost surely $\\mathcal A \\mathcal C(G(n,p)) = O(\\ln n \/ p)$, provided that $pn - \\ln n - \\ln \\ln n \\to \\infty$ as $n \\to \\infty$ (that is, above the threshold for Hamiltonicity). Moreover, a matching lower bound for dense random graphs was provided, which also implies that asymptotically almost surely $K_n$ cannot be covered with $o(\\ln n \/ p)$ copies of a random graph ${\\mathcal{G}}(n,p)$, provided that $pn > n^{1\/2+\\varepsilon}$ and $p < 1-\\varepsilon$ for some $\\varepsilon>0$. The problem is similar in flavour to the problems of Routing Permutations on Graphs via Matchings~\\cite{ACG94}, Gossiping and Broadcasting~\\cite{HHL88}, and Target Set Selection~\\cite{KKT03, Che09, Rei12}.\n\n\\bigskip\n\nIn the present paper, we consider the acquaintance time of (percolated) random geometric graphs. If $V \\subseteq \\eR^2$ is a set of points and $r>0$ then the {\\em geometric graph} ${\\mathcal{G}}(V,r)$ is the graph with vertex set $V$ and an edge between two points if and only if their distance is at most $r$. Such a graph is also called a {\\em unit disk graph} since it is the intersection graph of disks of the same radius (namely disks of radius $r\/2$ centered on the points of $V$). Throughout this paper, we let $X_1,X_2,\\ldots \\in \\eR^d$ be an infinite supply of random points, i.i.d.~on the unit square. For notational convenience (and following Penrose~\\cite{PenroseBoek}) we set:\n\\begin{equation}\\label{eq:Xdef}\n\\Xcal_n := \\{ X_1,X_2, \\dots, X_n \\}.\n\\end{equation}\n\n\\noindent\nThe {\\em random geometric graph} ${\\mathcal{G}}(n, r)$ is the random graph obtained by taking $\\Xcal_n$ as the vertex set, i.e.~${\\mathcal{G}}(n,r) := {\\mathcal{G}}(\\Xcal_n, r)$. To prevent dealing with annoying trivial cases we shall always assume that $r < \\sqrt{2}$ throughout this paper (otherwise $G \\in {\\mathcal{G}}(n,r)$ is a clique and $\\mathcal A \\mathcal C(G) = 0$).\n\nThe study of random geometric graphs essentially goes back to Gilbert~\\cite{Gilbert61} who defined a very similar model in 1961. For this reason it is often also called the {\\em Gilbert model}. Random geometric graphs have been the subject of a considerable research effort in the last two decades. As a result, detailed information is now known on various aspects such as ($k$-)connectivity~\\cite{PenroseMST1, Penrosekconn}, the largest component~\\cite{PenroseBoek}, the chromatic number and clique number~\\cite{twopoint, McDiarmidMuller11}, the (non-)existence of Hamilton cycles~\\cite{BBKMW, MullerPerezWormald} and the simple random walk on the graph~\\cite{CooperFriezeCoverRgg}. A good overview of the results prior to 2003 can be found in the monograph~\\cite{PenroseBoek}.\n\nThe {\\em percolated random geometric graph} ${\\mathcal{G}}(n,r,p)$ is obtained by retaining each edge of ${\\mathcal{G}}(n,r)$ with probability $p$ (and discarding it with probability $1-p$). To be more precise, for each edge of ${\\mathcal{G}}(n,r)$ we flip a biased coin which is independent of $\\Xcal_n$ and the other coin tosses for the other edges, and keep the edge if the coin comes up heads. In particular, ${\\mathcal{G}}(n,r) = {\\mathcal{G}}(n,r,1)$.\nThis model has not received the same amount of attention as the unpercolated random geometric graph, but very recently \nPenrose~\\cite{PenroseArxiv} gave a very precise result on the threshold for connectivity.\n\n\n\\bigskip\n\nAs typical in random graph theory, we shall consider only asymptotic properties of ${\\mathcal{G}}(n,r)$ and ${\\mathcal{G}}(n,r,p)$ as $n\\rightarrow \\infty$, where both $r$ and $p$ may and usually do depend on $n$. \nThroughout this paper, we will say that a sequence of events $E_1, E_2, \\dots$ holds {\\em with high probability} (abbreviated w.h.p.) if $\\Pee(E_n) \\to 1$ as $n\\to\\infty$. \n\n\\bigskip\n\nIt follows from a very precise result of Penrose~\\cite{PenroseMST1} that the (classical) random geometric graph ${\\mathcal{G}}(n,r_n)$ is w.h.p.~connected if and only if the sequence $(r_n)_n$ is such that $\\pi n r_n^2 - \\ln n \\to \\infty$ as $n\\to\\infty$. We are able to obtain the following result, which tells us the likely value of the acquaintance time up to a constant factor, whenever the acquaintance time is (w.h.p.) well defined.\n\n\\begin{theorem}\\label{thm:gnr}\nIf $(r_n)_n$ is such that $\\pi n r_n^2 - \\ln n \\to \\infty$, then $\\mathcal A \\mathcal C( G(n,r_n) ) = \\Theta(r_n^{-2} )$ w.h.p.\n\\end{theorem}\n\n\\bigskip\nFor the percolated random geometric graph ${\\mathcal{G}}(n,r_n,p_n)$ we are slightly less successful. \nFor dense graphs we determine the likely value of the acquaintance time up to a multiplicative constant, but the behaviour for sparser graphs remains undetermined.\n\n\\begin{theorem}\\label{thm:gnrp}\nLet $\\varepsilon > 0$ be arbitrary. If $(r_n)_n$ and $(p_n)_n$ are such that $p_n < 1-\\varepsilon$ and $p_n n r_n^2\\geq n^{1\/2+\\varepsilon}$, then $\\mathcal A \\mathcal C({\\mathcal{G}}(n,r_n, p_n) ) = \\Theta (r_n^{-2} p_n^{-1} \\ln n)$ w.h.p.\n\\end{theorem}\n\nIn the course of the proof we will in fact prove slightly more. Namely, we will derive an upper bound of $\\mathcal A \\mathcal C(G) = O( r_n^{-2} p_n^{-1} \\ln n)$ that works whenever $p_n n r_n^2 \\geq K \\ln n$ for some large constant $K$.\n\n\n\n\\section{Preliminaries}\n\nThroughout this paper $B(x,r) \\subseteq \\eR^2$ will denote the points at distance $0$.\nWe can then make use of the ``concentration phenomenon\" to give a relatively easy proof of \nan upper bound of the right order of magnitude.\nThe second, and more involved, case is when $(r_n)_n$ is such that $\\pi n r_n^2$ is somewhere between\n$\\ln n + \\omega(1)$ and $K \\ln n$.\nHere, we need to make use the detailed information on the structure of $G(n,r_n)$ close\nto the ``connectivity threshold\". Luckily, a lot of this structural information has previously been \nobtained in, for instance,~\\cite{BDFMS}, and we can obtain the statement we need for our proofs\nby adapting some previous results to suit our needs.\nWe shall refer to the first case as the ``dense\" case, and to the second as the ``sparse\" case.\n\n\\subsection{The upper bound for $G(n,r_n)$ in the dense case} \\label{sec:classic_dense}\n\nFor $(r_n)_n$, an arbitrary sequence of numbers with $0 < r_n < \\sqrt{2}$, \nlet us define $m_n := \\lceil 1000\/r_n \\rceil$.\nThen we have $1\/m_n \\leq r_n\/1000$ and $1\/m_n = \\Omega(r_n)$.\n(Moreover $1\/m_n \\sim r_n\/1000$ if $r_n \\to 0$.)\nLet $\\Dcal_n$ denote the dissection of the unit square into $m_n^2$ equal squares of dimensions\n$(1\/m_n)\\times(1\/m_n)$. We will call the squares of this dissections {\\em cells}, and for a\ngiven cell $c \\in \\Dcal_n$, we will denote by $V(c)$ the set of points \nof $\\Xcal_n$ that fall in $c$.\nLet $\\mu_n := n \/ m_n^2$ denote the expectation $\\Ee |V(c)|$.\n\n\\begin{lemma}\\label{lem:wassenneus}\nThere is a constant $K > 0$ such that if $(r_n)_n$ is such that $\\pi n r_n^2 \\geq K \\ln n$ then\n$0.9 \\cdot \\mu_n \\leq |V(c)| \\leq 1.1 \\cdot \\mu_n$ for all $c \\in \\Dcal_n$, w.h.p.\n\\end{lemma}\n\n\\begin{proof} \nFix a cell $c\\in\\Dcal_n$. By Lemma~\\ref{lem:chernoff} the probability \nthat $|V(c)| > 1.1 \\cdot \\mu_n$ satisfies\n\n\\[ \\Pee( |V(c)| > 1.1 \\cdot \\mu_n ) \\leq e^{ -\\mu_n\\cdot H(1.1) }, \\]\n\n\\noindent\nwhere $H(x) = x\\ln x-x+1$ is as in Lemma~\\ref{lem:chernoff}.\nNow notice that $m_n$ is non-decreasing in $r_n$, so that $\\mu_n = n \/ m_n^2$ \nis non-increasing in $r_n$.\nIt follows that whenever $\\pi n r_n^2 \\geq K \\ln n$ for some constant $K > 0$ then\n\n\\[ \\Pee( |V(c)| > 1.1 \\cdot \\mu_n ) \\leq \\exp{\\Big[} - (1+o(1)) \\cdot \\frac {H(1.1) K}{\\pi 10^6} \\cdot \\ln n {\\Big ]}. \\]\n\n\\noindent\n(Here we have used that if $\\pi n r_n^2 = K \\ln n$ then $1\/m_n \\sim r_n\/1000$.)\nHence, by the union bound,\n\n\\[ \\begin{array}{rcl}\n\\Pee( \\text{There exists a $c\\in\\Gamma_n$ with $|V(c)|> 1.1\\cdot \\mu_n$} )\n& \\leq & \nm_n^2 \\cdot \\exp{\\Big[} - (1+o(1)) \\cdot \\frac {H(1.1)K}{\\pi 10^6} \\cdot \\ln n {\\Big ]} \\\\\n& \\leq & \nn^2 \\cdot n^{ - (1+o(1)) H(1.1) K \\pi^{-1} 10^{-6}} \\\\\n& = & o(1), \n\\end{array} \\]\n\n\\noindent\nprovided $K$ is chosen sufficiently large.\nCompletely analogously, we can show that, w.h.p., no cell will have\nless than $0.9 \\cdot \\mu_n$ points, provided we chose $K$ sufficiently large.\n\\end{proof}\n\nFor the remainder of the proof, let $V \\subseteq [0,1]^2, 0 < r < \\sqrt{2}$ be such that \nthe conclusion of this last lemma holds, but otherwise arbitrary.\nIt suffices to show that $G:=G(V,r)$ satisfies $\\mathcal A \\mathcal C( G ) = O( r^{-2} )$.\n\nFor each $c\\in\\Dcal_n$ we partition $V(c)$ into three parts\n$V_1(c), V_2(c), V_3(c)$, each of cardinality at most\n$0.4 \\cdot \\mu_n$.\nFor each pair $1 \\leq i < j \\leq 3$ and each cell $c\\in\\Gamma_n$, let $W_{ij}(c) \\subseteq V(c)$ be a set of cardinality exactly\n$t := \\lfloor 0.9 \\mu_n\\rfloor$ such that $V_i(c) \\cup V_j(c) \\subseteq W_{ij}(c)$; and set $W_{ij} := \\bigcup_{c\\in\\Gamma_n} W_{ij}(c)$.\nLet $G_{ij} = G[W_{ij}]$ denote the subgraph induced by $W_{ij}$.\nWe now observe that, since points in touching cells of the dissection $\\Dcal_n$ have distance at most $r$, the graph $G_{ij}$ has \na spanning subgraph that is isomorphic to $H[ K_t ]$ where $H$ denotes the\n$m_n\\times m_n$-grid.\nIt follows from Theorem~\\ref{thm:angel} and Lemmas~\\ref{lem:boxtimes} and~\\ref{lem:return}\nthat we can acquaint all agents on vertices of $W_{ij}$ with each other, and\nreturn them to their starting positions in $O( m_n^2 ) = O( r_n^{-2} )$ rounds.\n\nBy repeating this procedure for each of $W_{12}, W_{13}, W_{23}$, we acquaint all agents\nwith each other in $O(r_n^{-2})$ rounds, as required.\n\n\n\n\n\n\\subsection{Structural definitions and lemmas needed for the sparse case}\n\n\n\nBefore we can start the last part of the proof of Theorem~\\ref{thm:gnr}, we need to recall some definitions and\n(slightly adapted versions of) results from~\\cite{BDFMS}.\nLet us consider any geometric graph $G=(V,r)$, where $V = \\{ x_1, x_2, \\ldots , x_n \\} \\subset [0,1]^2$. \n\nLet $m \\in \\eN$ be such that $s(m) := 1\/m \\leq r\/1000$. Let $\\Dcal = \\Dcal(m)$ denote the \\emph{dissection} of $[0,1]^2$ into\nsquares of side length $s(m)$.\nWe will call these squares {\\em cells}.\nGiven $T > 0$ and $V \\subseteq [0,1]^2$, we call a cell $c\\in\\Dcal$\n{\\em good} with respect to\n$T, V$ if $|c\\cap V| \\geq T$ and {\\em bad} otherwise.\nWhen the choice of $T$ and $V$ is clear from the context we will just speak of good and bad.\nLet $\\Gamma = \\Gamma(V, m, T, r)$ denote the graph whose\nvertices are the good cells of $\\Dcal(m)$, with an\nedge $cc' \\in E(\\Gamma)$ if and only if the lower left\ncorners of $c,c'$ have distance at most $r - s\\sqrt{2}$.\n(Note that this way, any $x\\in c$ and $y\\in c'$ have distance $\\norm{x-y} \\leq r$.)\nWe will usually just write $\\Gamma$ when the choice of $V, m, T, r$ is clear from the\ncontext.\nLet us denote the components of $\\Gamma$ by $\\Gamma_1, \\Gamma_2, \\dots$ where\n$\\Gamma_i$ has at least as many cells as $\\Gamma_{i+1}$ (ties are broken arbitrarily).\nFor convenience we will also write $\\Gamma_{\\max} = \\Gamma_1$.\nWe will often be a bit sloppy and identify $\\Gamma_i$ with the union of its cells, and\nspeak of $\\diam(\\Gamma_i)$ and the distance between $\\Gamma_i$ and $\\Gamma_j$ and so forth.\n\n\nLet us call a point $v\\in V$ {\\em safe} if there is a good cell $c\\in\\Gamma_{\\max}$ such\nthat $| B(v;r) \\cap V \\cap c | \\geq T$. (That is, in the geometric graph $G(V;r)$, the point $v$ has at least $T$ neighbours inside $c$.)\nOtherwise, if there is a good cell $c \\in \\Gamma_i$, $i \\geq 2$, such that $| B(v;r) \\cap V \\cap c | \\geq T$, we say that $v$ is {\\em risky}.\nOtherwise we call $v$ {\\em dangerous}.\n\n\nFor $i \\geq 2$ we let $\\Gamma_i^+$ denote the set of all points of $V$ in cells of\n$\\Gamma_i$, together with all risky points $v$ that satisfy $| B(v;r) \\cap V \\cap c |\n\\geq T$\nfor at least one $c\\in\\Gamma_i$.\nThe following is a list of desirable properties that we would like $V$ and\n$\\Gamma(V,m,T,r)$ to have:\n\n\\begin{enumerate}\n\\item[\\str{1}] $\\Gamma_{\\max}$ contains more than $0.99 \\cdot |\\Dcal|$ cells;\n\\item[\\str{2}] $\\diam(\\Gamma_i^+) r\\cdot 10^{10}$;\n\\item[\\str{4}] For all $i > j\\geq 2$ the distance between $\\Gamma_i^+$ and\n$\\Gamma_j^+$ is at least $r\\cdot 10^{10}$;\n\\item[\\str{5}] If $v\\in V$ is dangerous and $i \\geq 2$ then\nthe distance between $v$ and $\\Gamma_i^+$ is at least $r \\cdot 10^{10}$.\n\\end{enumerate}\n\n Finally, we introduce some terminology for sets of dangerous and risky points.\nSuppose that $V \\subseteq [0,1]^2$ and $m, T, r$ are such that~\\str{1}-\\str{5}\nabove hold.\nDangerous points come in groups of points of diameter\n$< r\/100$ that are far apart.\nWe formally define a {\\em dangerous cluster} (with respect to $V,m,T,r$)\nto be an inclusion-wise maximal subset of\n$V$ with the property that $\\diam(A) < r \\cdot 10^{10}$ and all elements of\n$A$ are dangerous.\n\nA set $A \\subseteq V$ is an {\\em obstruction} (with respect to $V,m,T,r$)\nif it is either a dangerous cluster or $\\Gamma_i^+$ for some $i\\geq 2$. We call $A$ an {\\em $s$-obstruction} if $|A| = s$.\nBy \\str{3}-\\str{5}, obstructions are pairwise separated by distance $r \\cdot 10^{10}$. \n(One consequence: a vertex in a good cell is adjacent in $G$ to at most one obstruction.)\nA point $v\\in V$ is {\\em crucial} for $A$ if\n\\begin{enumerate}\n\\item[\\cruc{1}] $A \\subseteq N(v)$, and;\n\\item[\\cruc{2}] $v$ is safe.\n\\end{enumerate}\n\n\n\n\n\nWe are interested in the following choice of $m$ for our dissection.\nFor $n \\in \\eN$ and $\\eta > 0$ a constant, let us define\n\n\\begin{equation}\\label{eq:mdef}\n m_n := \\left\\lceil\\sqrt{\\frac{n}{\\eta^2\\ln n}}\\right\\rceil.\n\\end{equation}\n\n\nThe following lemma is almost identical to a lemma in~\\cite{BDFMS}.\nFor completeness we spell out the adaptations that need to be made to its proof in Appendix~\\ref{sec:structure}.\n\n\\begin{lemma}\\label{lem:structure}\nFor every sufficiently small $\\eta > 0$, there exists a $\\delta = \\delta(\\eta) > 0$ such that \nthe following holds.\nLet $m_n$ be given by~\\eqref{eq:mdef}, let $\\Xcal_n$ be as in~\\eqref{eq:Xdef},\nlet $T_n \\leq \\delta\\ln n$ and let $r_n$ be such that $\\pi n r_n^2 = \\ln n + o(\\ln n)$.\nThen~\\str{1}-\\str{5}\nhold for $\\Gamma(\\Xcal_n,m_n,T_n,r_n)$ w.h.p.\n\\end{lemma}\n\nThe following lemma is also a slightly adapted version of a result in~\\cite{BDFMS}. Its proof can be \nfound in Appendix~\\ref{sec:crucial}.\n\n\\begin{lemma}\\label{lem:crucial}\nFor every sufficiently small $\\eta > 0$, there exists a $\\delta = \\delta(\\eta) > 0$ such that \nthe following holds.\nLet $(m_n)_n$ be given by~\\eqref{eq:mdef}, let $T_n \\leq \\delta \\ln n$ and let $V_n := \\Xcal_n$\nwith $\\Xcal_n$ as in~\\eqref{eq:Xdef},\nlet $(r_n)_n$ be a sequence of positive numbers\nsuch that $\\pi r_n^2 - \\ln n \\to \\infty$. \\\\\nThen, w.h.p., it holds that for every $s \\geq 2$, every $s$-obstruction has at least\n$s - 100$ crucial vertices.\n\\end{lemma}\n\n\nThe proof of the following lemma is analogous to that of Lemma~\\ref{lem:wassenneus} and is left to the reader.\n\n\\begin{lemma}\\label{lem:maxcell}\nIf $\\eta > 0$ is fixed, $(m_n)_n$ is as given by~\\eqref{eq:mdef} and $V_n := \\Xcal_n$\nthen there is a constant $C$ such that, w.h.p., every cell contains at most\n$C \\ln n$ points.\n\\end{lemma}\n\n\n\n\n\\subsection{The proof of the upper bound in Theorem~\\ref{thm:gnr} in the sparse case}\n\n\nIt remains to prove the upper bound of Theorem~\\ref{thm:gnr} for a sequence $r_n$ such that $\\pi n r_n^2 = \\ln n + \\omega(1)$ and \n$\\pi n r_n^2 \\leq K \\ln n$ for a large constant $K$.\nFor this range it suffices to consider the case when $1 \\ll \\pi n r_n^2 - \\ln n \\ll \\ln n$ and prove that in that case \nw.h.p.~$\\mathcal A \\mathcal C({\\mathcal{G}}(n,r_n)) = O( n \/ \\ln n )$.\n(By~\\eqref{eq:LBRGG} we already have the asymptotically almost sure lower bound $\\mathcal A \\mathcal C( {\\mathcal{G}}(n,r_n) ) = \\Omega( r_n^{-2} ) = \\Omega( n \/ \\ln n )$ for all\nsequences $(r_n)_n$ satisfying $\\pi n r_n^2 \\leq K\\ln n$.) \nLet us thus pick such a sequence $r_n$ and assume $\\eta, \\delta$ etc.~have been chosen in such a\nway that the conclusions of Lemma~\\ref{lem:structure} and~\\ref{lem:crucial} hold w.h.p.\nWe also know from~\\cite{PenroseMST1} that in this range ${\\mathcal{G}}(n,r_n)$ is connected w.h.p.\n\nIn the sequel of the proof we let $V \\subseteq [0,1]^2$ be an arbitrary set of points, and $r, m, \\eta, \\delta > 0$ \nbe arbitrary numbers such that $G(V,r)$ is connected and the conclusions\nof Lemma's~\\ref{lem:structure}, \\ref{lem:crucial} and~\\ref{lem:maxcell} are satisfied. \nIt suffices to show that every such graph $G = G(V,r)$ has acquaintance time $O( n \/ \\ln n )$, as we will now show.\n\n\\begin{claim}\\label{clm:aap}\nThere is a constant $c_1$ such that every obstruction consists of at most $c_1 \\ln n$ points.\n\\end{claim}\n\\begin{proof}\nEvery obstruction $O$ has diameter $r\/100$ and hence \nthere are only $O(1)$ cells that contain points of $O$.\nSince each cell contains $O(\\ln n)$ points, we are done.\n\\end{proof}\n\n\nEach point $v$ that is safe, but not in a cell of $\\Gamma_{\\max}$ has at least \n$T$ neighbours in some cell $c\\in\\Gamma_{\\max}$.\nWe arbitrarily ``assign\" $v$ to such a cell.\n\n\n\\begin{claim}\\label{clm:noot}\nThere is a constant $c_2 > 1$ such that the following holds.\nFor every obstruction $O$ there is a cell $c \\in \\Gamma_{\\max}$ such that \nat least $|O|\/c_2$ vertices that are crucial for $O$ have been assigned to\n$c$.\n\\end{claim}\n\\begin{proof}\nSince $G$ is connected, every obstruction \nhas at least one crucial vertex. (It is adjacent to at least one \nvertex $v \\in V\\setminus O$ and this $v$ cannot be dangerous or risky.)\nThis shows that, by choosing $c_2$ sufficiently large, the claim holds\nwhenever $|O| < 1000$.\nLet us thus assume $|O| \\geq 1000$.\nSince $O$ has diameter $< r\/100$, there is a constant $D$ \nsuch that the crucial vertices are all assigned to all one of the $D$\ncells within range $2r$ of $O$.\nSince $|O| > 1000$ there are at least $|O|-100 > |O|\/2$ crucial vertices for $O$, and\nhence at least $|O|\/2D$ of these crucial vertices are assigned to the same cell.\n\\end{proof}\n\n\nFor each obstruction $O$, we now assign all its vertices to a\ncell $c\\in\\Gamma_{\\max}$ such that at least $|O|\/c_2$ vertices that are crucial for $O$ have been \nassigned to $c$.\nFor a cell $c \\in \\Gamma$ let $V(c)$ denote the set of points that fell in $c$.\nFor each $c \\in\\Gamma_{\\max}$, let $A(c)$ denote the union of $V(c)$ with \nall vertices that have been assigned to $c$.\nLet us remark that:\n\n\\begin{claim}\\label{clm:mies}\nThere exists a constant $c_3$ such that \n$|A(c)| \\leq c_3 \\ln n$ for all $c\\in\\Gamma_{\\max}$.\n\\end{claim}\n\\begin{proof}\nNote that if a vertex $v$ has been assigned to $c$, it must lie within\ndistance $2r$ of $c$.\nHence there are only $O(1)$ cells in which $A(c)$ is contained, and\nsince every cell contains $O(\\ln n)$ points, we are done.\n\\end{proof}\n\nLet us now partition $A(c)$ into sets $A_1(c), A_2(c), \\dots, A_L(c)$ each of size\nat most $T\/100$, with $L = \\lceil c_3\/(100\\delta)\\rceil$.\nThe following observation will be key to our strategy.\n\n\\begin{claim}\\label{clm:duif}\nThere is a constant $c_4$ such that the following holds.\nFor every $c \\in \\Gamma_{\\max}$ and every $A' \\subseteq A(c)$ with $|A'| \\leq T\/50$ there\nis a sequence of at most $c_4$ moves that results in the agents on vertices on $A'$ being\nplaced on vertices of $V(c)$ (and uses only edges of $G[A(c)]$).\n\\end{claim}\n\\begin{proof}\nWe first move all agents on vertices of $A' \\setminus V(c)$ on safe vertices \nnot in $V(c)$ onto vertices of $V(c) \\setminus A'$ in one round.\n(To see that this can be done, note that $|A'| < T\/50$ and each safe vertex of $A'$ has\nat least $T$ neighbours in $V(c)$.)\nLet $W \\subseteq V(c)$ be the set of vertices now occupied by agents that were originally on $A'$.\n\nIf $A'$ also contains (part of) some obstruction $O$, then we \npartition $O \\cap A'$ into $O(1)$ sets $O_1, O_2, \\dots, O_K$ of\ncardinality at most $|O|\/c_2$ where $K \\leq \\lceil 1\/c_2\\rceil$ (and hence is\na constant).\nWe first move the agents on vertices $O_1$ onto crucial vertices assigned to $c$, and\nthen on vertices of $V(c) \\setminus W$, in two rounds.\n(Note this is possible since $|A'| \\leq T\/50$ and each crucial vertex is\nadjacent to at least $T$ vertices of $V(c)$.)\nSimilarly, supposing that the agents on $O_1, O_2, \\dots, O_{i-1}$ have already been moved\nonto vertices of $V(c)$, we can move the \nagents on vertices of $O_i$ onto vertices of $V(c) \\setminus W$ not occupied by \nagents from $O_1, O_2, \\dots, O_{i-1}$ in two rounds.\n\nWe thus have moved all agents on vertices of $A'$ onto vertices of $V(c)$ in constant many rounds, as required.\n\\end{proof}\n\nWe are now ready to describe the overall strategy.\nLet us write $A_i := \\bigcup_{c\\in\\Gamma_{\\max}} A_i(c)$.\nFor each pair of indices $1 \\leq i < j \\leq L$ we do the following.\n\nFirst we move all agents of $A_i(c) \\cup A_j(c)$ onto vertices of\n$V(c)$ (in constantly many moves, simultaneously for all cells $c\\in\\Gamma_{\\max}$).\nNext, we select a set $B(c) \\subseteq V(c)$ for each $c\\in\\Gamma_{\\max}$ with $|B(c)| = T$ and\nall agents that were on $A_i(c) \\cup A_j(c)$ originally are now on vertices of $B(c)$.\nBy Lemma~\\ref{lem:span}, the largest component $\\Gamma_{\\max}$ of the cells-graph has\na spanning tree $H$ of maximum degree at most five.\nThus, by Theorem~\\ref{thm:angel}, we have $\\mathcal A \\mathcal C(\\Gamma_{\\max}) \\leq O( \\Delta(H) \\cdot |V(H)| ) = O( |\\Gamma| ) = O( n\/\\ln n )$.\nNow note that the graph spanned by $\\bigcup_{c \\in\\Gamma_{\\max}} B(c)$ contains a spanning\nsubgraph isomorphic to $\\Gamma_{\\max}[K_T]$.\nUsing Lemma~\\ref{lem:boxtimes} and~\\ref{lem:return}, we can thus acquaint all vertices of $\\bigcup_{c\\in\\Gamma_{\\max}} B(c)$\nwith each other and return them to their starting vertices in $O(n\/\\ln n)$ rounds.\nSo, in particular, we have acquainted the agents of $A_i \\cup A_j$ and returned them\nto their starting positions, in $O( n \/ \\ln n )$ moves.\n\nOnce we have repeated this procedure for each of the ${L \\choose 2} = O(1)$ pairs of indices all agents will\nbe acquainted, still in $O( n \/ \\ln n )$ rounds. This concludes the (last part of the) proof of Theorem~\\ref{thm:gnr}.\n\n\n\n\n\\section{The proof of the lower bound in Theorem~\\ref{thm:gnrp}}\n\n\n\nIn hopes of doing better than the trivial lower bound~\\eqref{eq:trivial_lower} on the acquaintance time of ${\\mathcal{G}}(n,r_n,p)$, we consider a variant of the original process. This approach was used for binomial random graphs~\\cite{KMP} and, after some adjustments combined with some additional averaging type argument, can be used here as well. Suppose that each agent has a helicopter and can, on each round, move to any vertex she wants. (We retain the requirement that no two agents can occupy a single vertex simultaneously.) In other words, in every step of the process, the agents choose some permutation $\\pi$ of the vertices, and the agent occupying vertex $v$ flies directly to vertex $\\pi(v)$, regardless of whether there is an edge or even a path between $v$ and $\\pi(v)$. (In fact, it is no longer necessary that the graph be connected.) Let the {\\em helicopter acquaintance time} $\\overline{\\AC}(G)$ be the counterpart of $\\mathcal A \\mathcal C(G)$ under this new model, that is, the minimum number of rounds required for all agents to become acquainted with one another. Since helicopters make it easier for agents to get acquainted, we immediately get that for every graph $G$, \n\\begin{equation}\\label{eq:bACvsAC}\n\\overline{\\AC}(G) \\le \\mathcal A \\mathcal C(G).\n\\end{equation}\nOn the other hand, $\\overline{\\AC}(G)$ also represents the minimum number of copies of a graph $G$ needed to cover all edges of a complete graph of the same order. Thus inequality~(\\ref{eq:trivial_lower}) can be strengthened to $\\overline{\\AC}(G) \\ge {|V| \\choose 2}\/|E| - 1$.\n\nIn order to prove the lower bound in part (ii) of Theorem~\\ref{thm:gnrp}, we prove the following general result.\nIf $G$ is a graph then we denote by $G^p$ the random subgraph of $G$ in which every edge is kept with probability $p$ \nand discarded with probability $1-p$ (independently of all other edges). So, in particular, $K_n^p$ is the familiar binomial\nrandom graph $G(n,p)$ and ${\\mathcal{G}}(n,r_n, p)$ is the same as ${\\mathcal{G}}^p(n,r_n)$.\n\n\\begin{theorem}\\label{thm:lower_gnp}\nLet $\\varepsilon > 0$ be arbitrary. If $(G_n)_n$ is a sequence of graphs with $v(G_n)=n$, \nand $(p_n)_n$ is a sequence of edge-probabilities satisfying $p_n \\le 1-\\varepsilon$, \nand $p_n e(G_n) \\geq n^{3\/2 + \\varepsilon}$ for all $n$, then\n$$\n\\overline{\\AC}(G_n^{p_n})\n= \\Omega \\left( \\frac{n^2\\ln n}{p_n \\cdot e(G_n)} \\right) \\quad \\text{ w.h.p. }\n$$\n\\end{theorem}\n\\begin{proof}\nLet $a_1, a_2, \\ldots, a_n$ denote the $n$ agents, and let $A = \\{a_1, a_2, \\ldots, a_n\\}$. Take \n$$\nk = \\frac {\\varepsilon}{20} \\left(n^2\/e(G_n)\\right)\\cdot \\log_{1\/(1-p_n)} n = \\Theta\\left( \\frac{n^2\\ln n}{p_n \\cdot e(G_n)} \\right)\n$$ \nand fix $k$ bijections $\\pi_i : A \\to V(G_n)$, for $i \\in \\{0, 1, \\ldots k-1\\}$. \nThis corresponds to fixing a $(k-1)$-round strategy for the agents; in particular, agent $a_j$ occupies vertex $\\pi_i(a_j)$ in round $i$. We aim to show that at the end of the process (that is, after $k-1$ rounds) the probability that all agents are acquainted is only $o((1\/n!)^k)$. This will complete the proof. Indeed, the number of choices for $\\pi_0, \\pi_1, \\ldots, \\pi_{k-1}$ is $(n!)^k$, so by the union bound, w.h.p.\\ no strategy makes all pairs of agents acquainted.\n\nWe say that a pair of vertices (or agents) is \\emph{reachable} in a particular round if they are on vertices that are adjacent\nin the non-percolated graph $G_n$. (So a pair of agents can be reachable during one round but not reachable during another one.) \nLet $b$ be the number of pairs of agents that are reachable during more than $10 k n^{-2} e(G_n)$ rounds (with respect to the given agents' strategy, that is, the $k$ bijections that are fixed). \nIn each round, at most $e(G_n)$ pairs are reachable.\nIt follows that $b \\cdot 10 k n^{-2} e(G_n)\\le e(G_n) k$, so that \n\n\\[ b \\le n^2 \/ 10 \\le {n \\choose 2}\/2. \\] \n\n\\noindent\nHence, at least half of all pairs of agents are reachable during at most $10 k e(G_n) \/ n^2$ rounds. \nWe call these pairs of agents \\emph{important}.\n\nTo estimate the probability that a given agents' strategy makes all pairs of important agents acquainted, we consider the following analysis, which iteratively exposes edges of a percolated random graph $G_n^{p_n}$. \nFor any pair $q = \\{a_x, a_y\\}$ of important agents, we consider all reachable pairs of vertices visited by this pair of agents throughout the process:\n$$\nS(q) = \\{ e \\in E(G_n) : e = \\pi_i(a_x)\\pi_i(a_y) \\text{ for some } i \\in \\{0, 1, \\ldots k-1\\} \\}.\n$$\nSince $q$ is important, $1 \\le |S(q)| \\le 10 k e(G_n) \/ n^2$. \nLet us now fix an arbitrary ordering $q_1, q_2, \\dots, q_m$ of our important pairs and consider the following process.\nWe take the first pair $q_1$ of important agents and expose the edges of $G_n^{p_n}$ in $S(q_1)$, one by one until\nwe either find an edge that is present in $G_n^{p_n}$ or we have exposed all of $S(q_1)$. \nIf we expose all of $S(q_1)$ without discovering an edge, then the pair $q_1$ never gets acquainted and we halt our procedure. \nIf instead we do discover some edge $e$ of $G_n^{p_n}$, then we discard all pairs of important agents that ever occupy this edge (that is, we discard all pairs $q$ such that $e \\in S(q)$). We now shift our attention to the next pair $q_i$ of important agents that we did not yet discard and repeat the procedure of exposing edges $S(q_i)$ until we find one that acquaints $q_i$ or we run out of edges. \nIt may happen that some of the pairs of vertices in $S(q_i)$ have already been exposed, but the analysis guarantees that no edge has yet been discovered. \n\nWe continue this process until either we have found an important pair that never gets acquainted or all available pairs of important agents have been investigated. Considering one pair of important agents can force us to discard at most $k$ important pairs (including the original pair) \nsince in each round the edge acquaints at most one pair.\nHence, the process investigates at least $\\frac 12 {n \\choose 2} \/ k$ pairs of important agents. \nMoreover, writing $E_t := \\{\\text{$q_1, q_2, \\dots,q_{t-1}$ get acquainted and $q_t$ did not get discarded}\\}$, we have\n\\[ \\begin{array}{rcl}\n\\mathbb{P}( \\text{$q_t$ gets acquainted} | E_t ) \n& \\le & \n1-(1-p)^{|S(q_t)|} \\\\\n& \\le & \n1-(1-p)^{10 k n^{-2} e(G_n)}.\n\\end{array} \\]\n\n\\noindent\nHence, we find\n\\begin{eqnarray*}\n\\mathbb{P}(\\text{all pairs acquainted}) \n& \\leq & \n\\mathbb{P}(\\text{all important pairs acquainted} ) \\\\\n&\\le& \\left( 1-(1-p)^{10 k n^{-2} e(G_n)} \\right)^{\\frac 12 {n \\choose 2} \/ k} \\\\\n& \\le& \\exp \\left[ - (1-p)^{10 k n^{-2} e(G_n)} \\cdot \\frac 12 {n \\choose 2} \/ k \\right] \\\\\n&\\le& \\exp \\left[ -n^{-\\varepsilon\/2} \\cdot \\frac12 {n \\choose 2} \/k \\right] \\\\\n& = & \\exp \\left[ - \\Omega( n^{-\\varepsilon\/2} p_n e(G_n) \/ \\ln n ) \\right], \n\\end{eqnarray*}\nusing that $k = \\frac {\\varepsilon}{20} \\left(n^2\/e(G_n)\\right)\\cdot \\log_{1\/(1-p_n)} n$ for the third line and that \n$k = \\Theta( n^2\\ln n \/ (p_n e(G_n))$ for the last line.\nNow note that \n\\begin{eqnarray*}\n(n!)^k \n& \\leq & n^{k \\cdot n} \\\\\n& = & \\exp\\left[ k \\cdot n \\ln n \\right] \\\\\n& = & \\exp\\left[ O\\left( n^3 \\ln^2 n \/ (p_n e(G_n)) \\right) \\right].\n\\end{eqnarray*}\n\n\\noindent\nSince $p_n e(G_n) \\geq n^{1\/2+\\varepsilon}$ we also have that\n$n^{-\\varepsilon\/2} p_n e(G_n) \/ \\ln n \\gg n^3 \\ln^2 n \/ (p_n e(G_n))$, \nand hence \n\n\\[ \\mathbb{P}( \\text{all pairs acquainted} ) = o( (1\/n!)^k), \\]\n\n\\noindent\nwhich concludes the proof by a previous remark.\n\\end{proof}\n\n\n\\noindent\nCombining the last theorem with Lemma~\\ref{lem:edges}, we immediately get:\n\n\\begin{corollary}\\label{cor:lower_gnp}\nLet $\\varepsilon > 0$ be arbitrary. If the sequences $(r_n)_n$ and $(p_n)_n$ are such that $p_n < 1-\\varepsilon$ for all $n$ \nand $p_n^2 n r_n^2 \\ge n^{1\/2+\\varepsilon}$, then \n$$\n\\mathcal A \\mathcal C({\\mathcal{G}}(n,r_n,p_n)) \\ge \n\\overline{\\AC}({\\mathcal{G}}(n,r_n,p_n)) = \\Omega \\left( r_n^{-2} p^{-1} \\ln n \\right) \\quad \\text{ w.h.p. }\n$$\n\\end{corollary}\n\n\n\n\n\\section{The proof of the upper bound in Theorem~\\ref{thm:gnrp}}\n\nLet us start with the following useful observation. Let $p=p(n)$ and $t=t(n)$, and let ${\\mathcal{B}}(t,p)$ be the ``standard\" \nrandom bipartite graph with bipartite sets $X$ and $Y$ such that $|X|=|Y|=t$. \nFor each pair of vertices $x \\in X$ and $y \\in Y$, we introduce an edge $xy$ with probability $p$, independently of all other edges. \nWe will consider the probability that ${\\mathcal{B}}(t,p)$ has a perfect matching. Very precise information is\nalready known about perfect matchings in this random graph model (see for instance~\\cite{Bollobas2ndEd}, Section 7.3). \nWe however need precise quantitative bounds on the probability of existence of a perfect matching, which do not appear \nto exist in the literature as far as we are aware of.\n\n\n\\begin{lemma}\\label{lem:perfect_matching}\nWith ${\\mathcal{B}}(t,p)$ the random bipartite graph as above, we have\n\\[ \\Pee( {\\mathcal{B}}(t,p) \\text{ has a perfect matching }) = 1 - O\\left( t \\cdot e^{ - \\gamma t p} \\right), \\]\n\n\\noindent\nfor some universal constant $\\gamma > 0$.\n\\end{lemma}\n\n\\begin{proof}\nLet us first observe that if $tp \\leq K \\ln t$ for some constant $K$ then there is nothing to prove since we may assume, without loss on generality, that\n$\\gamma > 0$ is sufficiently small for $t \\cdot e^{ - \\gamma t p} \\to \\infty$ to hold in this case.\nLet us thus assume that $tp > K \\ln t$ in the sequel, where $K > 0$ is a constant to be chosen more precisely later on in the proof.\n\n Set $s_0 = \\max\\{ s \\in {\\mathbb N}: ps \\le 1\\}$. Let $S \\subseteq X$ with $|S|=s \\le s_0$. \nThe number of vertices of $Y$ adjacent to at least one vertex from $S$ is the binomial random variable $Z \\isd \\Bi( t, 1-(1-p)^s )$, whose \nexpected value is\n$$\n( 1-(1-p)^s )t \\ge (1-e^{-ps})t \\ge (1-e^{-1}) pst.\n$$\nHence, applying the Chernoff bound (Lemma~\\ref{lem:chernoff}), the set $S$ fails the Hall condition with probability at most\n$$\n\\mathbb{P}( Z < s ) = \\mathbb{P}\\left[Z < \\frac{\\mathbb E[Z]}{(1-e^{-1})pt} \\right] \\le \n\\exp\\left[ - \\mathbb E Z \\cdot H\\left( \\frac{1}{(1-e^{-1})pt} \\right) \\right]\n\\leq e^{- s tp \/ 100},\n$$\nwhere $H(x) = x\\ln x -x + 1$ and we have used that $\\lim_{x\\downarrow 0} H(x) = 1$ and the last inequality holds\nfor $t$ sufficiently large.\nHence, the probability that the necessary condition in the statement of Hall's theorem fails for at least one set $S$ with $|S| \\le s_0$ is at most\n$$\n\\sum_{s=1}^{s_0} {t \\choose s} e^{-stp\/100} \\le \\sum_{s=1}^{s_0} t^s e^{-stp\/100} = \n\\sum_{s=1}^{s_0} \\left( t e^{-tp\/100} \\right)^s = \nO( t e^{-tp\/100} ),\n$$\nusing that $t e^{-tp\/100} = o(1)$.\nNow, let $0 < \\varepsilon < (1-e^{-1})\/2$ be a constant so that $\\sum_{s \\le \\varepsilon t} {t \\choose s} \\le \\exp( 0.08 t)$. Consider any set $S \\subseteq X$ with $s_0 < |S| = s \\le \\varepsilon t$. The expected size of $N[S]$ is at least $(1-e^{-1})t$. It follows from Chernoff bound (see Lemma~\\ref{lem:chernoff}) that \n$$\n\\mathbb{P} \\Big( |N[S]| \\le (1-e^{-1})t\/2 \\Big) \\le \\exp \\big[- H(1\/2) \\cdot (1-e^{-1})t \\big] \\le e^{ - 0.09 t},\n$$\nwhere $H(x) = x\\ln x-x+1$ is again as in Lemma~\\ref{lem:chernoff}. The probability that the necessary condition fails for at least one set $S$ with $s_0 < |S| \\le \\varepsilon t$ is therefore at most\n$$\n\\sum_{s=s_0+1}^{\\varepsilon t} {t \\choose s} e^{- 0.09 t} \\le e^{-0.01 t} = e^{-\\Omega( tp )}.\n$$\n\nFinally, let $S \\subseteq X$ with $\\varepsilon t < |S| = s \\le t$. If $S$ fails the test, then there exists $T \\subseteq Y$ of cardinality $t-s+1$ such that there is no edge between $S$ and $T$. Hence, the probability that the condition fails for at least one set $S$ with $\\varepsilon t < |S| \\le t$ is at most\n\\begin{eqnarray*}\n\\sum_{\\varepsilon t < s \\le t} {t \\choose s} {t \\choose t-s+1} (1-p)^{s(t-s+1)} \n&\\le& \n\\sum_{\\varepsilon t < s \\le t} t^{t-s} \\cdot t^{t-s+1} \\cdot \\exp\\big[ -ps(t-s+1) \\big] \\\\\n& \\le & \n\\sum_{\\varepsilon t < s \\le t} \\exp\\big[ (t-s+1)2\\ln t - \\varepsilon p t (t-s+1) \\big] \\\\\n& = & \n\\sum_{\\varepsilon t < s \\le t} \\exp\\big[ (t-s+1)(2\\ln t - \\varepsilon p t) \\big] \\\\\n&\\le& \\sum_{\\varepsilon t < s \\le t} \\exp \\big[ - (t-s+1) \\varepsilon p t \/ 2 \\big] \\\\\n& = & O\\big( e^{-\\varepsilon p t\/2} \\big),\n\\end{eqnarray*}\nwhere we have used that we can choose $K$ large enough for $2\\ln t < \\varepsilon K \\ln t \/ 2$ to hold in the penultimate line.\nWe conclude that, using Hall's theorem:\n\\[ \\begin{array}{rcl}\n\\Pee(\\text{${\\mathcal{B}}(t,p)$ has a perfect matching}) \n& = & \n1 - O( t e^{-tp\/100} ) - e^{-0.09 tp } - O( e^{-\\varepsilon pt \/ 2 } ) \\\\\n& = & \n1 - O( t e^{-\\Omega(tp)} ),\n\\end{array} \\]\n\n\\noindent\nas required.\n\\end{proof}\n\nBefore we can proceed with our upper bound on the acquaintance time of the \npercolated random geometric graph we need some more preparations.\nA quite precise result on the acquaintance time of the binomial random graph ${\\mathcal{G}}(n,p)$ was already given in~\\cite{KMP}, but\nwe again require a version with precise quantitative bounds on the error-probabilities.\nThe following result will serve our purposes.\n\n\n\\begin{theorem}\\label{lem:ER}\nThere exists a constant $\\gamma > 0$ such that for all $k \\leq t\/1000$:\n\n\\[ \\Pee\\Big[ \\mathcal A \\mathcal C( {\\mathcal{G}}(t,p) ) \\leq k \\Big] \\geq 1 - t^2 e^{-\\gamma pk }, \\]\n\n\\noindent\nfor all $t\\in\\eN$ and $0 < p < 1$.\n\\end{theorem}\n\n\n\\begin{proof}\nIn order to avoid technical problems with events not being independent, we use a classic technique known as \\emph{multi-round exposure}. (In fact, we will use a three-round exposure here.) \nThe observation is that a random graph $G \\in {\\mathcal{G}}(t,p)$ can be viewed as a union of three independently generated random \ngraphs $G_1, G_2, G_3 \\in G(t,{\\bar{p}})$, with ${\\bar{p}}$ defined by: \n$$\np=1-(1-{\\bar{p}})^3.\n$$\n(See, for example,~\\cite{Bollobas2ndEd, randomgraphs} for more information).\nLet us observe that $p \\geq {\\bar{p}} \\geq p\/3$.\n\nFirstly, let us focus on $G_1=(V,E) \\in {\\mathcal{G}}(t,{\\bar{p}})$. Our goal is to show that, with probability at least \n$1 - O\\left(t e^{-\\Omega(tp)} \\right)$, $G_1$ contains a path $P$ of length $0.9 t$. \nWe consider the following process. Select any vertex $v_1 \\in V$ and expose all edges in $G_1$ from $v_1$ to other vertices of $V$. If at least one edge is found, select any neighbour $v_2$ of $v_1$ and expose all edges from $v_2$ to $V \\setminus \\{v_1,v_2 \\}$ with a hope that at least one edge is discovered and the process can be continued. The only reason for the process to terminate at a given round is when no edge is found. The probability that the process does \\emph{not} stop before discovering a path $P$ of length $0.9 t$ is equal to\n$$\n\\begin{array}{rcl}\n\\Pee( \\text{$G_1$ contains a path of length $\\geq 0.9 t$} ) \n& \\geq &\n(1-(1-{\\bar{p}})^{t-1})\n\\cdots (1-(1-{\\bar{p}})^{0.1t+1}) \\\\\n& \\ge & \n(1-e^{-0.1{\\bar{p}} t})^{0.9 t} \\\\\n& \\ge &\n1 - 0.9 t e^{-0.1{\\bar{p}} t}.\n\\end{array} \n$$\n\n\\noindent\nNow let $k \\leq t\/1000$ be arbitrary.\nConditioning on the event that $G_1$ has at least one path of length $0.9 t$, \nlet us fix a path $P \\subseteq G_1$ of length $V(P) \\geq 0.8 t$ such that $V(P)$ is a multiple of $k$.\nWe now consider $G_2=(V,E) \\in {\\mathcal{G}}(t,{\\bar{p}})$. It follows from Lemma~\\ref{lem:perfect_matching} that, with probability at least $1-O( t e^{\\Omega(tp)} )$, there is a matching $M \\subseteq G_2$ between $V(P)$ and $V \\setminus V(P)$ that saturates $V \\setminus V(P)$. \nWe call agents occupying $V(P)$ \\emph{active} and agents occupying $V \\setminus V(P)$ \\emph{inactive}. \n\n We split the path $P$ into many paths, each on exactly $k$ vertices. \n This partition also divides the active agents into $O( t\/k )$ teams, each team consisting of $k$ agents. \n Every team performs (independently and simultaneously) the strategy from Lemma~\\ref{lem:hamilton}. \n This certainly results in every pair of active vertices on the same team getting acquainted.\n\nNext, we will consider the probability that an active agent $x$ gets acquainted to an agent $y$ that is either on a different team or inactive.\nIt follows from Lemma~\\ref{lem:hamilton} that agent $x$ visits $k$ distinct vertices. \nSince $y$ either belongs to a different team or is inactive, the pair $x,y$ occupy at least $k$ distinct pairs of vertices during the process. \nConsidering only those edges in $G_3 \\in {\\mathcal{G}}(t,p)$, the probability that the two agents never got acquainted is at most\n$$\n\\Pee( \\text{$x,y$ do not get acquainted } ) \\leq (1-{\\bar{p}})^{k} \\leq e^{-{\\bar{p}} k}.\n$$\nSince there are at most $t \\choose 2$ pairs of agents, the union bound shows:\n\\[ \\Pee( \\text{ all active vertices get acquainted to each other and all inactive vertices} ) \n\\geq 1 - O( t^2 e^{-{\\bar{p}} k} ). \\]\n\nFinally, to also acquaint the inactive vertices with each other, we simply use the matching $M$ to place them\non $P$, and repeat the ``teams\" strategy. This way they all pairs will indeed get acquainted.\nSummarizing, we have\n\\begin{eqnarray*} \n\\Pee(\\text{all pairs get acquainted}) &\\geq& 1 - 0.9 t e^{-0.1{\\bar{p}} t} -O( t e^{-\\Omega(tp)} ) - O( t^2 e^{-k{\\bar{p}}} ) \\\\\n&=& 1 - O\\left( t^2 e^{-\\Omega( k{\\bar{p}} )} \\right), \n\\end{eqnarray*}\n\n\\noindent\nwhich concludes the proof.\n\\end{proof}\n\n\n\n\nNow, we are ready to come back to the upper bound for the acquaintance time of percolated random geometric graphs. \nWe will prove the following upper bound\n\n\\begin{lemma}\\label{lem:gnrub}\nLet $\\varepsilon > 0$ be arbitrary.\nThere is a constant $K > 0$ such that if the sequences $(r_n)_n$ and $(p_n)_n$ are such that \n$p_n < 1-\\varepsilon$ and $p_n n r_n^2 \\geq K \\ln n$ for all $n$ then for $G \\in {\\mathcal{G}}(n,r_n,p_n)$ we have\n\n\\[ \\mathcal A \\mathcal C(G) = O\\left( \\frac{\\ln n}{r_n^2 \\cdot p_n} \\right) \\quad \\text{ w.h.p. }\n\\]\n\\end{lemma}\n\n\n\\begin{proof}\nWe want to mimic the strategy introduced for dense (classic) random geometric graph ${\\mathcal{G}}(n,r_n)$---see subsection~\\ref{sec:classic_dense}. \nLet us recall the setting briefly. $\\Dcal_n$ denotes the dissection of the unit square into $m_n^2$ ($m_n := \\lceil 1000\/r_n \\rceil$) equal squares called cells.\nFor a given cell $c \\in \\Gamma_n$, $V(c)$ denotes the set of points of $\\Xcal_n$ that fall in $c$; $\\mu_n := n \/ m_n^2$ is the expectation \n$\\Ee |V(c)|$ and by Lemma~\\ref{lem:wassenneus}, w.h.p, $0.9 \\cdot \\mu_n \\leq |V(c) \\leq 1.1 \\cdot \\mu_n$ for every cell.\nAgain each $c\\in\\Gamma_n$, $V(c)$ is partitioned into three parts\n$V_1(c), V_2(c), V_3(c)$, each of cardinality at most $0.4 \\cdot \\mu_n$.\nFor each pair $1 \\leq i < j \\leq 3$ and each cell $c\\in\\Gamma_n$, $W_{ij}(c) \\subseteq V(c)$ is a set of cardinality exactly\n$$\nt := \\lfloor 0.9 \\mu_n \\rfloor,\n$$\nsuch that $V_i(c) \\cup V_j(c) \\subseteq W_{ij}(c)$; and set $W_{ij} := \\bigcup_{c\\in\\Gamma_n} W_{ij}(c)$.\n$G_{ij} = G[W_{ij}]$ denotes the subgraph induced by $W_{ij}$.\n\nLet $E_{ij}$ denote the event that for each adjacent pair of cells $c, d \\in \\Dcal_n$ there is a\nperfect matching between $W_{ij}(c)$ and $W_{ij}(d)$.\nIt follows from Lemma~\\ref{lem:perfect_matching} that\n\n\\[ \\Pee( E_{ij} ) \\geq 1 - 4 m_n^2 t e^{-\\Omega( t p_n ) }\n\\geq 1 - 4 n^4 e^{ - \\Omega( p_n n r_n^2 ) }\n= 1 - o(1), \\]\n\n\\noindent\nwhere the last inequality holds since $p_n n r_n^2 \\geq K \\ln n$ with $K$ a sufficiently large constant.\n\nNow let us set \n$$\nk := \\min\\left( \\frac{C \\cdot \\ln n}{p_n}, \\frac{t}{1000} \\right).\n$$\nwith $C>0$ a constant to be chosen more precisely later, and let $F_{ij}$ denote the event that for every \nadjacent pair of cells $c, d \\in \\Dcal_n$ we have that \n$\\mathcal A \\mathcal C( G[W_{ij}(c) \\cup W_{ij}(d)] ) \\leq k$.\nIt follows from Lemma~\\ref{lem:ER} that\n\\[ \\Pee( F_{ij} ) \n\\geq \n1 - m_n^2 \\cdot O\\left( t^2 e^{-\\Omega( k p_n )} \\right)\n= \n1 - O\\left( n^4 e^{-\\Omega( \\min( C \\ln n, p_n n r_n^2 )) } \\right)\n= \n1 - o(1),\n\\]\n\n\\noindent\nusing that $p_n n r_n^2 \\geq K \\ln n$ and that we can assume $C, K > 0$ are sufficiently large for\nthe last equality to hold.\n\nWe have seen that, w.h.p., $E_{ij}$ and $F_{ij}$ hold for each $1\\leq i < j \\leq 3$.\nIf $E_{ij}, F_{ij}$ both hold, we have the following strategy to acquaint all agents on $W_{ij}$.\nAgain we treat the set of agents initially on a cell $c \\in\\Dcal_n$ as a group.\nWe move these groups from cell to cell following the strategy of Theorem~\\ref{thm:angel}, where \nfor each move of the original strategy for the $m\\times m$ grid, we use the perfect matchings\n(that exist because $E_{ij}$ holds)\nbetween adjacent cells to transfer entire groups.\nAfter each move of the grid strategy, we do the following. Observe that the grid can be covered by four\nmatchings $M_1, \\dots, M_4$ (take for instance horizontal\/vertical edges with odd\/even $x$\/$y$-coordinates of the leftmost\/top point).\nFor each such matching $M_i$ we do the following simultaneously for each of its edges $cd \\in M_i$. \nWe acquaint the groups of agents currently on $W_{ij}(c) \\cup W_{ij}(d)$ and return them\nto their starting points in $2 k$ moves (this can be done since $F_{ij}$ holds, and using Lemma~\\ref{lem:return}).\nRepeating this procedure for each of $W_{12}, W_{13}, W_{23}$, it is clear that this way we do acquaint all agents \nwith each other in at most\n\\[ O\\left( m_n^2 \\cdot k \\right) = O\\left( \\frac{\\ln n}{r_n^2 \\cdot p_n} \\right), \\]\n\n\\noindent\nmoves, as required.\n\\end{proof}\n\n\n\n\\section{Conclusion and further work}\n\nIn this article, we have determined the likely value of the acquaintance time of random geometric graphs up to the leading constant, whenever\nthe graph is w.h.p.~connected. \nA very natural question is thus to also find the leading constant (if it even exists).\n\n\\begin{problem}\nFind a more detailed asymptotic description of the acquaintance time of random geometric graphs.\n\\end{problem}\n\nFor percolated random geometric graphs we have also found the likely value of the acquaintance time, but\nwe needed a slightly stronger assumption on the sequences $r_n, p_n$. Namely, these parameters needed to be chosen in such a \nway that all degrees are already slightly larger than $\\sqrt{n}$. On the other hand we were able to provide an upper bound\nthat already works close to the connectivity threshold for percolated graphs.\n\n\\begin{problem}\nDetermine the likely value of the acquaintance time of percolated random geometric graphs\nwhen $p_n n r_n^2 = \\Omega( \\ln n )$ and $p_n n r_n^2 = O( n^{1\/2+o(1)} )$.\n\\end{problem}\n\n\\noindent\nAnd, of course it would again be nice to have more detailed asymptotics.\n\n\n\\begin{problem}\nFind a more detailed asymptotic description of the acquaintance time of percolated random geometric graphs.\n\\end{problem}\n\n\n\n\\bibliographystyle{plain}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\n\\section{Introduction}\n\nIn \\cite{Measuringcomonoid}, an enrichment of the category of monoids in comonoids is established in a braided monoidal closed category\n$\\mathcal{V}$ which is moreover locally presentable, induced by a generalization of Sweedler's \\emph{universal measuring coalgebra}\n$P(A,B)$ for algebras $A$, $B$ \\cite{Sweedler}. This constitutes an abstract framework for the so-called \\emph{Sweedler theory} of algebras\nand coalgebras \\cite{AnelJoyal} in differential graded vector spaces, leading to an efficient formalism for the bar-cobar\nadjunction in a broader effort to conceptually clarify the Koszul duality for (co)algebras \\cite{AlgebraicOperads}.\n\nThe present work generalizes this result to its many-object setting; introducing the notion of a $\\mathcal{V}$-\\emph{enriched cocategory}\nwhich reduces to a comonoid in $\\mathcal{V}$ when its set of objects is singleton, we establish an enrichment of the category of $\\mathcal{V}$-categories\nin $\\mathcal{V}$-cocategories. This enrichment can be realized under the same assumptions on $\\mathcal{V}$, and shares all fundamental\ncharacteristics with Sweedler theory for (co)monoids. In particular, the braided monoidal closed $\\ca{V}\\textrm{-}\\B{Cocat}$ acts on\nthe monoidal $\\ca{V}\\textrm{-}\\B{Cat}$ via a convolution-like functor which exhibits its adjoint,\nthe \\emph{generalized Sweedler hom} $T\\colon\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}\\times\\ca{V}\\textrm{-}\\B{Cat}\\to\\ca{V}\\textrm{-}\\B{Cocat}$ as the enriched hom-functor. Moreover,\nthe enrichment in question is tensored and cotensored, via the \\emph{generalized Sweedler product}\n$\\triangleright\\colon\\ca{V}\\textrm{-}\\B{Cocat}\\times\\ca{V}\\textrm{-}\\B{Cat}\\to\\ca{V}\\textrm{-}\\B{Cat}$ and the action respectively.\n\nThe framework that brings all these structures together is that of a double category of $\\mathcal{V}$-matrices, $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$. Its horizontal bicategory\n$\\mathcal{V}\\textrm{-}\\mathbf{Mat}$ is well-studied even in the more abstract case of matrices enriched in bicategories \\cite{VarThrEnr}, and our approach follows\nits one-object case as well as \\cite{KellyLack} in viewing $\\mathcal{V}$-categories as monads therein and establishing important\ncategorical properties. It turns out that working on the double categorical context offers a much clearer perspective\nfor the categories of interest and their interrelations; for example, $\\mathcal{V}$-functors are precisely \\emph{monad morphisms}\n(vertical monad maps in \\cite{Monadsindoublecats}) in $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ whereas only a special case of monad maps in $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$.\n\nFor that purpose, we present a detailed framework for monads and comonads in arbitrary double categories, explore their (op)fibrational\nstructure in the fibrant case \\cite{Framedbicats} and push the enrichment objective as far as possible. This way,\ndemanding calculations involving enriched graphs, categories and cocategories (some of them found in \\cite[\\S 7]{PhDChristina}) are deduced\nfrom natural properties of monads and comonads in monoidal fibrant double categories, which are furthermore\n\\emph{locally closed monoidal}. By introducing this concept which endows the vertical and horizontal categories with a\nmonoidal closed structure, we obtain an action of the category of monads on comonads which under certain assumptions induces\nthe desired enrichment.\n\nFinally, we are also interested in combining such an enrichment with the natural (op)fibred structure of monads and comonads. As a result,\nwe first recall some general fibred adjunction results as well as some basic \\emph{enriched fibration} machinery from \\cite{Enrichedfibration}\nand subsequently apply it to the double categorical setting for the monoidal (op)fibrations of (co)monads, leading to respective results\nfor $\\mathcal{V}$-categories and $\\mathcal{V}$-cocategories in $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$. It is expected that this abstract picture\nshall also allow for applications for other (co)monads in double categories of similar flavor,\nindicatively for colored operads and cooperads.\n\nA next step to this development will be to consider categories of \\emph{modules} and \\emph{comodules} for monads\nand comonads in double categories and look for similar enrichments, this time for the fibration $\\ca{V}\\textrm{-}\\B{Mod}\\to\\ca{V}\\textrm{-}\\B{Cat}$\nover an appropriately defined $\\ca{V}\\textrm{-}\\B{Comod}\\to\\ca{V}\\textrm{-}\\B{Cocat}$ in $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$. This would again provide a many-object generalization of the enrichment\nof $\\ensuremath{\\mathbf{Mod}}$ in $\\ensuremath{\\mathbf{Comod}}$, i.e. global categories of (co)modules for (co)monoids, established in \\cite{Measuringcomodule}.\n\nA brief outline of the paper is as follows. \\cref{sec:Background} assembles all the necessary background material in order to make\nthis paper as self-contained as possible. This includes selected facts about bicategories, (co)monoids in monoidal categories\nand local presentability aspects, the theory of actions inducing enrichments, the universal measuring comonoid\nand the theory of fibrations and enriched fibrations. In \\cref{doublecats}, after giving some basic double\ncategorical definitions, we explore the framework for monads and comonads.\nConsidering monoidal and fibrant double categories also with a locally closed monoidal structure, we furthermore combine it\nwith the enriched fibration theory. Finally, \\cref{sec:Enrichedmatrices} applies all the previous results to the double category\n$\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ of $\\mathcal{V}$-matrices. By establishing necessary properties of monads ($\\mathcal{V}$-categories) and comonads ($\\mathcal{V}$-cocategories)\ntherein, an enrichment between them is exhibited also on the (op)fibration level as the ultimum result. In the process, a detailed\nexposition of the structures involved and their dual relations gathers known along with newly established facts about these fundamental categories,\nalso generalizing classical properties for (co)monoids in monoidal categories.\n\n\n\\section{Preliminaries}\\label{sec:Background}\n\nIn this section, we gather all the necessary material for what follows. This includes some basic\nbicategorical notions, elements of the theory of monoidal categories with focus on the categories of monoids and comonoids\nand local presentability aspects, as well as parts of the theory of actions of monoidal categories inducing enrichment relations.\nFinally, we recall some results from related work concerning an enrichment of monoids in comonoids, as well as the recently introduced\nenriched fibration structure; the goal is to later fit those in a double categorical context which serves as the common framework\nfor our objects of interest.\n\nIn order to restrain the length of the paper, we provide appropriate references\nwhenever definitions and constructions are only sketched. \nThe choice of how detailed certain material review is, solely relies on what is specifically used later in the paper,\nwith the purpose of making this work as self-sufficient as possible. This is why, for example, bicategories and functors between\nthem are spelled out, as opposed to monoidal categories and functors.\n\n\\subsection{Bicategories}\\label{sec:bicategories}\n\nThe original definition of a bicategory and a lax functor between bicategories can be found in B{\\'e}nabou's \n\\cite{Benabou}. Other references, including the definitions of transformations and modifications are \n\\cite{Categoricalstructures,Handbook1}.\nCategories of (co)monads in bicategories are carefully recalled;\nregarding 2-category theory, indicative references are \\cite{Review,2-catcompanion},\nwhereas \\cite{FormalTheoryMonadsI} presents the formal theory of monads in 2-categories.\nDue to coherence for bicategories, we are often able to use 2-categori\\-cal machinery like pasting and mates \ncorrespondence directly in the weaker context. \n\n\\begin{defi}\\label{def:bicategory}\nA \\emph{bicategory} $\\mathcal{K}$ is specified by objects $A,B,...$ called \\emph{0-cells},\nand for each pair of objects a category $\\mathcal{K}(A,B)$, whose objects are called \\emph{1-cells} and whose arrows\nare called \\emph{2-cells}; vertical composition of $2$-cells is denoted\n\\begin{displaymath}\n\\xymatrix @C=.8in\n{A\\ar @\/^4ex\/[r]^-f \\ar[r]|-g \\ar @\/_4ex\/[r]_-h \\rtwocell<\\omit>{<-2>\\alpha} \\rtwocell<\\omit>{<2>\\;\\alpha'} &\nB}=\\xymatrix @!=.5in {A\\rtwocell^f_h{\\;\\;\\;\\alpha'\\cdot\\alpha} & B.}\n\\end{displaymath}\nand the identity 2-cell is $1_f\\colon f\\Rightarrow f\\colon A\\to B$.\nMoreover, for each triple of objects there is the \\emph{horizontal composition} functor $\\circ:\\mathcal{K}(B,C)\\times\\mathcal{K}(A,B)\\to\\mathcal{K}(A,C)$\nwhich maps a pair of 1-cells $(g,f)$ to $g\\circ f=gf$ and a pair of 2-cells\n\\begin{displaymath}\n\\xymatrix @!=.5in {A\\rtwocell^f_u{\\alpha} & \nB\\rtwocell^g_v{\\beta} & C}=\n\\xymatrix @!=.5in {A\\rtwocell<\\omit>{\\;\\;\\;\\beta*\\alpha}\n\\ar @\/^3ex\/[r]^-{gf}\n\\ar @\/_3ex\/[r]_{vu} & C.}\n\\end{displaymath}\nFinally, for each object we have the \\emph{identity 1-cell} $1$-cell $1_A:A\\to A$.\n\nThe associativity and identity constraints are expressed via the \\emph{associator} with components invertible 2-cells\n$\\alpha_{h,g,f}:(h\\circ g)\\circ f\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} h\\circ(g\\circ f)$ and the \\emph{unitors} by $\\lambda_f:1_B\\circ f\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} f,$\n$\\rho_f:f\\circ 1_A\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} f.$\nThe above are subject to coherence conditions: for\n$\\SelectTips{10}{eu}\\xymatrix@C=.3in{A\\ar[r]|-{\\;f\\;} & B\\ar[r]|-{\\;g\\;} & C\\ar[r]|-{\\;h\\;} & D\\ar[r]|-{\\;k\\;} & E}$, the following commute\n\\begin{equation}\\label{bicataxiom1}\n\\xymatrix @R=.2in@C=.01in\n{((k{\\circ} h){\\circ} g){\\circ} f\\ar[d]_-{\\alpha_{kh,g,f}}\\ar[rr]^-{\\alpha_{k,h,g}*1_f} && (k{\\circ}(h{\\circ} g)){\\circ} f,\\ar[d]^-{\\alpha_{k,hg,f}} \\\\\n(k{\\circ} h){\\circ}(g{\\circ} f)\\ar[dr]_-{\\alpha_{k,h,gf}} && k{\\circ}((h{\\circ} g){\\circ} f) \\ar[dl]^-{1_k*\\alpha_{h,g,f}}\\\\\n& k{\\circ}(h{\\circ}(g{\\circ} f)) &}\\quad\n\\xymatrix@R=.6in@C=.2in\n{(g{\\circ} 1_B){\\circ} f\\ar[rr]^-{\\alpha_{g,1_B,f}}\\ar[dr]_-{\\rho_g*1_f} && g{\\circ}(1_B{\\circ} f)\\ar[dl]^-{1_g*\\lambda_f} \\\\\n& g{\\circ} f &}\n\\end{equation}\n\\end{defi}\n\nBy functoriality of the horizontal composition we have $1_g\\circ 1_f=1_{g\\circ f}$ and\n$(\\beta'\\cdot\\beta)*(\\alpha'\\cdot\\alpha)=(\\beta'*\\alpha')\\cdot(\\beta*\\alpha)$, the latter known as the \\emph{interchange law}. \n\nGiven a bicategory $\\mathcal{K}$, we may reverse only the $1$-cells and form the bicategory $\\mathcal{K}^\\mathrm{op}$,\nwith $\\mathcal{K}^\\mathrm{op}(A,B)=\\mathcal{K}(B,A)$. We may also reverse only the $2$-cells and form the bicategory $\\mathcal{K}^\\mathrm{co}$\nwith $\\mathcal{K}^\\mathrm{co}(A,B)=\\mathcal{K}(A,B)^\\mathrm{op}$. Reversing both $1$-cells and $2$-cells yields \na bicategory $(\\mathcal{K}^\\mathrm{co})^\\mathrm{op}=(\\mathcal{K}^\\mathrm{op})^\\mathrm{co}$.\n\nThere are numerous examples of well-known bicategories. Indicatively,\n\\begin{itemize}\n \\item $\\mathbf{Span}(\\mathcal{C})$ for any category $\\mathcal{C}$ with pullbacks has objects the ones in $\\mathcal{C}$, 1-cells spans $A\\leftarrow M\\rightarrow B$\n and 2-cells span morphisms;\n \\item $\\mathbf{Rel}(\\mathcal{C})$ for any regular category $\\mathcal{C}$ is defined as $\\mathbf{Span}(\\mathcal{C})$ but with 1-cells relations\n $R\\rightarrowtail X\\times Y$, and composition is given by first taking the pullback and then performing epi-mono factorization\n \\item $\\mathbf{BMod}$ has objects rings, 1-cells bimodules and 2-cells bimodule maps;\n \\item $\\mathcal{V}$-$\\mathbf{Prof}$ has objects $\\mathcal{V}$-categories, 1-cells $\\mathcal{V}$-profunctors ($\\mathcal{V}$-bimodules)\n $F\\colon\\mathcal{B}^\\mathrm{op}\\times\\mathcal{A}\\to\\mathcal{V}$ and 2-cells appropriate $\\mathcal{V}$-natural transformations.\n\\end{itemize}\n\n\\begin{defi}\\label{laxfunctor}\nGiven bicategories $\\mathcal{K}$ and $\\mathcal{L}$, a \\emph{lax functor} $\\mathscr{F}:\\mathcal{K}\\to\\mathcal{L}$ consists of a mapping\non objects $A\\mapsto\\mathscr{F}A$, a functor $\\mathscr{F}_{A,B}:\\mathcal{K}(A,B)\\to\\mathcal{L}(\\mathscr{F}A,\\mathscr{F}B)$\nfor every $A,B\\in\\mathcal{K}$, a natural transformation with components $\\delta_{g,f}:(\\mathscr{F}g)\\circ(\\mathscr{F}f)\\to\n\\mathscr{F}(g\\circ f)$ for any composable 1-cells, and a natural transformation with components\n$\\gamma_A:1_{\\mathscr{F}A}\\to\\mathscr{F}(1_A)$ for every $A\\in\\mathcal{K}$.\n\nThe natural transformations $\\gamma$ and $\\delta$ have to satisfy the following coherence axioms: for 1-cells\n$\\SelectTips{10}{eu}\\xymatrix@C=.3in{A\\ar[r]|-{\\;f\\;} & B\\ar[r]|-{\\;g\\;} & C\\ar[r]|-{\\;h\\;} & D}$, the following diagrams commute:\n\\begin{equation}\\label{laxcond1}\n\\xymatrix @C=.6in @R=.25in\n{(\\mathscr{F}h\\circ\\mathscr{F}g)\\circ\\mathscr{F}f\\ar[r]^-{\\delta_{h,g}*1}\\ar[d]_-{\\alpha} & \\mathscr{F}(h\\circ g)\\circ\\mathscr{F}f\\ar[d]^-{\\delta_{hg,f}} \\\\\n\\mathscr{F}h\\circ(\\mathscr{F}g\\circ\\mathscr{F}f) \\ar[d]_-{1*\\delta_{g,f}} & \\mathscr{F}((h\\circ g)\\circ f)\\ar[d]^-{\\mathscr{F}\\alpha} \\\\\n\\mathscr{F}h\\circ\\mathscr{F}(g\\circ f)\\ar[r]_-{\\delta_{h,gf}} & \\mathscr{F}(h\\circ(g\\circ f))}\n\\end{equation}\n\n\\begin{equation}\\label{laxcond2}\n\\xymatrix @C=.5in @R=.25in\n{1_{\\mathscr{F}B}\\circ\\mathscr{F}f\\ar[r]^-{\\gamma_B*1} \\ar[d]_-\\lambda & \\mathscr{F}(1_B)\\circ\\mathscr{F}f \\ar[d]^-{\\delta_{1_B,f}} \\\\\n\\mathscr{F}f & \\mathscr{F}(1_B\\circ f)\\ar[l]^-{\\mathscr{F}\\lambda}}\\quad\n\\xymatrix @C=.5in @R=.25in\n{\\mathscr{F}f\\circ 1_{\\mathscr{F}A}\\ar[r]^-{1*\\gamma_A}\\ar[d]_-\\rho & \\mathscr{F}f\\circ\\mathscr{F}(1_A)\\ar[d]^-{\\delta_{f,1_A}} \\\\\n\\mathscr{F}f & \\mathscr{F}(f\\circ 1_A)\\ar[l]^-{\\mathscr{F}\\rho}}\n\\end{equation}\n\\end{defi}\n\nIf $\\gamma$ and $\\delta$ are natural isomorphisms (respectively identities), then $\\mathscr{F}$ is called a \\emph{pseudofunctor}\nor \\emph{homomorphism} (respectively \\emph{strict functor}) of bicategories. Similarly, we can define a \\emph{colax \nfunctor} of bicategories by reversing the direction of $\\gamma$ and $\\delta$, sometimes also called \\emph{oplax}.\nWe obtain categories $\\mathbf{Bicat}_l$, $\\mathbf{Bicat}_c$, $\\mathbf{Bicat}_{ps}$, $\\mathbf{Bicat}_s$ with objects bicategories\nand arrows lax, colax, pseudo and strict functors respectively.\n\nA \\emph{monoidal bicategory} $\\mathcal{K}$ is a bicategory equipped with a pseudofunctor $\\otimes\\colon\\mathcal{K}\\times\\mathcal{K}\\to\\mathcal{K}$\nwhich is coherently associative and has an identity object $I$. The explicit definition with all\nappropriate diagrams can be found in any of the standard references, e.g. \\cite[\\S 2.1]{Carmody}. In our examples,\nwe will choose to establish monoidal structure of bicategories via the more general structure of a monoidal double category,\nas explained in \\cref{doublecats}; arguably, that technique is easier to apply given certain assumptions.\n\n\\begin{defi}\\label{laxnattrans}\nIf $\\mathscr{F},\\mathscr{G}:\\mathcal{K}\\to\\mathcal{L}$ are two lax functors, a \\emph{lax natural transformation} $\\tau:\\mathscr{F}\\Rightarrow\\mathscr{G}$ consists of\nmorphisms $\\tau_A:\\mathscr{F}A\\to\\mathscr{G}A$ in $\\mathcal{L}$, along with natural transformations\n\\begin{equation}\\label{nattranslax}\n\\xymatrix @C=.4in @R=.4in\n{\\mathcal{K}(A,B)\\ar[r]^-{\\mathscr{F}_{A,B}}\\ar[d]_-{\\mathscr{G}_{A,B}} &\n\\mathcal{L}(\\mathscr{F}A,\\mathscr{F}B)\\ar[d]^-{\\mathcal{L}(1,\\tau_B)} \\\\\n\\mathcal{L}(\\mathscr{G}A,\\mathscr{G}B)\\ar[r]_-{\\mathcal{L}(\\tau_A,1)} &\n\\mathcal{L}(\\mathscr{F}A,\\mathscr{G}B)\\ultwocell<\\omit>{\\tau}}\n\\end{equation}\nwith components 2-cells $\\tau_f\\colon\\tau_B\\circ\\mathscr{F}f\\Rightarrow \\mathscr{G}f\\circ\\tau_A$.\nThis data is subject to standard axioms expressing the compatibility of $\\tau$ with composition and units, using\n$\\delta$ and $\\gamma$ of the lax functors.\n\\end{defi}\n\nA transformation $\\tau$ is \\emph{pseudonatural} (respectively\n\\emph{strict}) when all the components $\\tau_f$ of \\cref{nattranslax} are isomorphisms (respectively identities).\nAlso, an \\emph{oplax} natural transformation is equipped with a natural transformation in the opposite direction\nof \\cref{nattranslax}. Note that between either lax or oplax functors of bicategories,\nwe can consider both lax and oplax natural transformations.\n\nAlong with \\emph{modifications} between transformations (see \\cite{Handbook1}) we can form four different functor bicategories of\ncombinations of (op)lax functors, (op)lax natural transformations and modifications, e.g. $\\mathbf{Bicat}_{l,l}(\\mathcal{K},\\mathcal{L})$, which contain\n$\\mathbf{Bicat}_{ps,l}(\\mathcal{K},\\mathcal{L})$, $\\mathbf{Bicat}_{ps,opl}(\\mathcal{K},\\mathcal{L})$ \nand $\\mathbf{Hom}(\\mathcal{K},\\mathcal{L})$ of pseudofunctors and lax\/oplax\/pseudo natural transformations as sub-bicategories.\n\nNow a (strict) \\emph{2-category} is a bicategory in which all constraints are identities, \\emph{i.e.} $\\alpha,\\rho,\\lambda=1$.\nIn this case, the horizontal composition is strictly associative and unitary and the axioms \\cref{bicataxiom1} hold automatically. Consequently, \nthe collection of 0-cells and 1-cells form a category on its own. Note that\nwhen $\\mathcal{L}$ is a 2-category, all the above functor bicategories are also 2-categories.\n\n\\begin{examples*}\\hfill\n\\begin{enumerate}\n \\item $\\mathbf{Cat}$ of (small) categories, functors and natural transformations;\n\\item $\\ensuremath{\\mathbf{Mon}}\\mathbf{Cat}$ of monoidal categories, (strong) monoidal functors and mo\\-noi\\-dal natural transformations;\n\\item $\\mathcal{V}$-$\\mathbf{Cat}$ of $\\mathcal{V}$-enriched categories, $\\mathcal{V}$-functors and $\\mathcal{V}$-na\\-tu\\-ral tra\\-nsfo\\-rma\\-tions\nfor a monoidal category $\\mathcal{V}$;\n\\item $\\mathbf{Fib}(\\caa{X})$ and $\\mathbf{OpFib}(\\caa{X})$ of fibrations and opfibrations over $\\caa{X}$, \n(op)fibred functors and (op)fibred natural transformations (see \\cref{fibrations});\n\\item $\\mathbf{Cat}(\\caa{E})$ of categories internal to $\\caa{E}$, for a finitely complete category. Instances of this are ordinary categories\n($\\caa{E}=\\mathbf{Set}$), double categories ($\\caa{E}=\\mathbf{Cat}$) and crossed modules ($\\caa{E}=\\mathbf{Grp}$).\n\\end{enumerate}\n\\end{examples*}\n\n\n\nWe now turn to notions of monads and comonads in bicategories.\n\\begin{defi}\\label{monadbicat}\nA \\emph{monad} in a bicategory $\\mathcal{K}$ consists of an object $B$ together with an endomorphism\n$t:B\\to B$ and 2-cells $\\eta:1_B\\Rightarrow t$, $m:t\\circ t\\Rightarrow t$ called the \\emph{unit} and \\emph{multiplication},\nsuch that the following diagrams commute:\n\\begin{displaymath}\n\\xymatrix @R=.25in\n{(t\\circ t)\\circ t\\ar[rr]^-{\\alpha_{t,t,t}}\n\\ar[d]_-{m\\circ1} && t\\circ(t\\circ t)\\ar[d]^-{1\\circ m} \\\\\nt\\circ t\\ar[dr]_-m && t\\circ t\\ar[ld]^-m \\\\\n& t &}\\qquad\\mathrm{and}\\qquad\n\\xymatrix @R=.65in @C=.5in\n{1_B\\circ t\\ar[r]^-{\\eta\\circ 1}\n\\ar[dr]_-{\\lambda_t} & t\\circ t\n\\ar[d]^-{m} & t\\circ1_B \\ar[l]_-{1\\circ\\eta}\n\\ar[ld]^-{\\rho_t} \\\\\n& t &}\n\\end{displaymath}\n\\end{defi}\n\nEquivalently, a monad in a bicategory $\\mathcal{K}$ is a lax functor $\\mathscr{F}:\\mathbf{1}\\to\\mathcal{K}$, where $\\mathbf{1}$ is the terminal bicategory with \na unique 0-cell $\\star$. This amounts to an object $\\mathscr{F}(\\star)=B\\in\\mathcal{K}$ and a functor $\\mathscr{F}_{\\star,\\star}:\\mathbf{1}(\\star,\\star)\\to\\mathcal{K}(B,B)$\nwhich picks up an endoarrow $t:B\\to B$. The natural transformations $\\delta$ and $\\gamma$ of the lax functor give\nthe multiplication and the unit of $t$\n\\begin{displaymath}\nm\\equiv\\delta_{1_\\star,1_\\star}:t\\circ t\\to t\n\\quad\\textrm{and}\\quad\n\\eta\\equiv\\gamma_{\\star}:1_B\\to t\n\\end{displaymath}\nand the axioms for $\\mathscr{F}$ give the monad axioms for $(t,m,\\eta)$.\n\n\\begin{rmk}\\label{laxfunctorspreservemonads}\nIf $\\mathscr{G}:\\mathcal{K}\\to\\mathcal{L}$ is a lax functor between bicategories, the composite\n\\begin{displaymath}\n\\mathbf{1}\\xrightarrow{\\;\\mathscr{F}\\;}\\mathcal{K}\\xrightarrow{\\;\\mathscr{G}\\;}\\mathcal{L}\n\\end{displaymath}\nis itself a lax functor from $\\mathbf{1}$ to $\\mathcal{L}$, hence defines a monad. In other words, if $t:B\\to B$ is a monad in the bicategory\n$\\mathcal{K}$, then $\\mathscr{G}t:\\mathscr{G}B\\to\\mathscr{G}B$ is a monad in the bicategory $\\mathcal{L}$, \\emph{i.e.} lax functors preserve monads.\n\\end{rmk}\n\n\\begin{defi}\\label{monadfunctor}\nA \\emph{(lax) monad functor} between two monads $t:B\\to B$ and $s:C\\to C$ in a bicategory\nconsists of an 1-cell $f:B\\to C$ between the 0-cells of the monads together with a 2-cell\n\\begin{displaymath}\n \\xymatrix\n{B\\ar[r]^-f \\ar[d]_-t \\drtwocell<\\omit>{\\psi} & C\\ar[d]^-s \\\\\nB\\ar[r]_-f & C}\n\\end{displaymath}\nsatisfying compatibility conditions with multiplications and units.\n\\end{defi}\nIf the 2-cell $\\psi$ is in the opposite direction, and the diagrams are accordingly modified, we have a \\emph{colax} monad functor\n(or monad \\emph{opfunctor}) between two monads. Along with appropriate notions of monad natural transformations (see \\cite{FormalTheoryMonadsI}),\nwe obtain a bicategory $\\mathbf{Mnd}(\\mathcal{K})\\equiv[\\mathbf{1},\\mathcal{K}]_l$.\n\nDually to the above, and for future reference, we have the following.\n\\begin{defi}\\label{comonadbicat}\nA \\emph{comonad} in a bicategory $\\mathcal{K}$ consists of an object $A$ together with an endoarrow $u:A\\to A$ and 2-cells\n$\\Delta:u\\Rightarrow u\\circ u$, $\\varepsilon:u\\Rightarrow 1_A$ called the \\emph{comultiplication} and \\emph{counit} respectively,\nsuch that the following commute \n\\begin{displaymath}\n\\xymatrix @R=.25in\n{& u\\ar[dr]^-\\Delta \\ar[dl]_-\\Delta & \\\\\nu\\circ u \\ar[d]_-{\\Delta\\circ1} && u\\circ u\\ar[d]^-{1\\circ\\Delta} \\\\\n(u\\circ u)\\circ u\\ar[rr]_-{\\alpha_{u,u,u}} && u\\circ(u\\circ u)}\\qquad\n\\xymatrix @R=.65in @C=.5in\n{1_A\\circ u \\ar[dr]_-{\\lambda_u} & u\\circ u \\ar[l]_-{\\varepsilon\\circ 1}\\ar[r]^-{1\\circ\\varepsilon} & u\\circ1_A\\ar[ld]^-{\\rho_u} \\\\\n& u\\ar[u]_-{\\Delta} &}\n\\end{displaymath}\n\\end{defi}\nNotice that a comonad in the bicategory $\\mathcal{K}$ is precisely a monad in the bicategory $\\mathcal{K}^\\mathrm{co}$;\nalong with colax comonad functors and comonad natural transformation, we have the bicategory $\\mathbf{Cmd}(\\mathcal{K})=[\\mathbf{1},\\mathcal{K}]_c$.\n\n\n\\subsection{Monoids and comonoids in monoidal categories}\\label{Monoidalcats}\n\nStandard references for the theory of monoidal categories, as well as monoids and comonoids, are for example \\cite{BraidedTensorCats,Quantum};\nhere we recall only a few things necessary for later constructions. In any case, monoidal categories and \n(co)lax\/strong\/strict functors between them are just the one-object cases of Definitions \\ref{def:bicategory} and \\ref{laxfunctor}.\n\nSuppose $(\\mathcal{V},\\otimes,I)$ is a monoidal category. A \\emph{monoid} is an object $A$ equipped with\na multiplication and unit $m:A\\otimes A\\rightarrow A\\leftarrow I:\\eta$ that satisfy usual associativity\nand unit laws; along with monoid morphisms that preserve the structure in that $f\\circ(m\\otimes m)=m'\\circ f$\nand $f\\circ\\eta=\\eta'$, they form a category $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$.\nDually, we have \\emph{comonoids} $(C,\\Delta\\colon C\\to C\\otimes C,\\epsilon\\colon C\\to I)$ whose category\nis denoted by $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$. Both these categories are monoidal\nonly if $\\mathcal{V}$ is braided, and they also inherit the braiding or symmetry from $\\mathcal{V}$.\n\n\\begin{rmk}\\label{monadsaremonoids}\nFor any object $B$ in a bicategory $\\mathcal{K}$, the hom-category $\\mathcal{K}(B,B)$ is equipped with a monoidal structure\ninduced by the horizontal composition of the bicategory, namely $f\\otimes g=g\\circ f$ and $I=1_B$.\nThen, a monoid in $(\\mathcal{K}(B,B),\\circ,1_B)$ is precisely a monad in $\\mathcal{K}$ (\\cref{monadbicat}) and dually, a comonad\n$u:A\\to A$ in a bicategory $\\mathcal{K}$ is a comonoid in the monoidal $\\mathcal{K}(A,A)$. \n\\end{rmk}\n\nIt is well-known that lax monoidal functors between monoidal categories induce functors between their category of monoids,\nas below.\n\n\\begin{prop}\\label{monf}\nIf $F\\colon\\mathcal{V}\\to\\mathcal{W}$ is a lax monoidal functor, with structure maps $\\phi_{A,B}\\colon FA\\otimes FB\\to F(A\\otimes B)$\nand $\\phi_0\\colon I\\to F(I)$, it induces a map between their categories of monoids\n$$\\ensuremath{\\mathbf{Mon}} F\\colon\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Mon}}(\\mathcal{W})$$\nby $(A,m,\\eta)\\mapsto(FA,Fm\\circ\\phi_{A,A},F\\eta\\circ\\phi_0)$. Dually, colax functors induce maps between the categories of comonoids.\n\\end{prop}\n\nIt is also well-known that (due to the \\emph{doctrinal adjunction}) colax monoidal structures on left adjoints correspond bijectively to lax\nmonoidal structures on right adjoints between monoidal categories; this generalizes to parametrized adjunctions, e.g.\n\\cite[3.2.3]{PhDChristina} or for higher dimension in \\cite[Prop.~2]{Monoidalbicatshopfalgebroids}.\n\nWhen $\\mathcal{V}$ is braided monoidal closed, the tensor product functor has\na strong monoidal structure via $A\\otimes B\\otimes A'\\otimes B'\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} A\\otimes A'\\otimes B\\otimes B'$,\n$I\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} I\\otimes I$. Therefore the internal hom functor $[-,-]\\colon\\mathcal{V}^\\mathrm{op}\\times\\mathcal{V}\\to\\mathcal{V}$\nobtains a lax monoidal structure as its parametrized adjoint. The induced functor between the monoids is denoted\n\\begin{equation}\\label{defMon[]}\n\\ensuremath{\\mathbf{Mon}}[-,-]\\colon\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})^\\mathrm{op}\\times\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}); \n\\end{equation}\nfor $C$ a comonoid and $A$ a monoid, $[C,A]$ has the \\emph{convolution} monoid structure.\n\nTurning to other properties of the categories of monoids and comonoids, for any $\\mathcal{V}$\nthere exist forgetful $S\\colon\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\mathcal{V}$, $U\\colon\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})\\to\\mathcal{V}$;\nwhen these have a left or right adjoint respectively, they are called \\emph{free monoid} and \\emph{cofree comonoid}\nfunctors. Evidently, the free monoid one is quite frequent.\n\n\\begin{prop}\\label{freemonoidprop}\nSuppose that $\\mathcal{V}$ is a monoidal category with countable coproducts which are preserved by $\\otimes$ on either side.\nThe forgetful $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\mathcal{V}$ has a left adjoint $L$, and the free monoid on an object $X$ is given b\n\\begin{displaymath}\nLX=\\coprod_{n\\in\\mathbb{N}}{X^{\\otimes n}}.\n\\end{displaymath}\n\\end{prop}\n\nOn the other hand, the existence of the cofree comonoid is more problematic, and has been studied from various authors\nmainly in the context of vector spaces or modules over a commutative ring. We are interested in Porst's approach\n\\cite{FundConstrCoalgCorComod,MonComonBimon} which in particular focuses on local presentability properties\ninherited from $\\mathcal{V}$.\n\nRecall that an \\emph{accessible} category $\\mathcal{C}$ is one with a small set\nof $\\kappa$-presentable objects $C$ (i.e. $\\mathcal{C}(C,-)$ preserves $\\kappa$-filtered colimits) such that every object\nin $\\mathcal{C}$ is the $\\kappa$-filtered colimit of presentable objects, for some regular cardinal $\\kappa$. A functor\nbetween accessible functors is \\emph{accessible} if it preserves $\\kappa$-filtered colimits.\nA \\emph{locally presentable} category is an accessible category which is cocomplete. \nMore on the theory of locally presentable categories can be found in the standard \\cite{LocallyPresentable}.\nAn important fact is that any cocontinuous functor from a locally presentable category has a right adjoint;\nthis can be seen as a corollary to the following adjoint functor theorem, since presentable objects\nform a small dense subcategory of $\\mathcal{C}$.\n\n\\begin{thm}\\cite[5.33]{Kelly}\\label{Kellyadj}\nIf the cocomplete $\\mathcal{C}$ has a small dense subcategory, every\ncocontinuous $S:\\mathcal{C}\\to\\mathcal{B}$ has a right adjoint.\n\\end{thm}\n\nGoing back to monoids and comonoids, the following result establishes their local presentability under certain assumptions.\nWe then briefly sketch parts of the proof because it will be later generalized, \\cref{VCocatlocpresent}.\n\n\\begin{prop}~\\cite[2.6-2.7]{MonComonBimon}\\label{moncomonadm}\nSuppose $\\mathcal{V}$ is a locally presentable mo\\-noi\\-dal category, such that $\\otimes$ preserves filtered colimits\nin both variables.\n\n$(1)$ $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$ is finitary monadic over $\\mathcal{V}$ and locally presentable.\n\n$(2)$ $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ is a locally presentable category and comonadic over $\\mathcal{V}$.\n\\end{prop}\n\nThe proof uses categories of \\emph{functor algebras} and \\emph{coalgebras} $\\ensuremath{\\mathbf{Alg}} F$ and $\\ensuremath{\\mathbf{Coalg}} F$ for any endofunctor\n$F\\colon\\mathcal{C}\\to\\mathcal{C}$, namely objects $A$ equipped with plain arrows $FA\\to A$ or $A\\to FA$ in $\\mathcal{C}$\nand morphisms that commute with them. Their most important properties are the following.\n\n\\begin{lem}\\label{functoralgebrasprops}\nFor any endofunctor $F\\colon\\mathcal{C}\\to\\mathcal{C}$,\n\\begin{enumerate}\n \\item\\label{one} $\\ensuremath{\\mathbf{Alg}} F\\to\\mathcal{C}$ creates all limits and those colimits preserved by $F$;\n \\item\\label{two} $\\ensuremath{\\mathbf{Coalg}} F\\to\\mathcal{C}$ creates all colimits and those limits preserved by $F$;\n \\item\\label{three} if $\\mathcal{C}$ is locally presentable and $F$ preserves filtered colimits, $\\ensuremath{\\mathbf{Alg}} F$ and $\\ensuremath{\\mathbf{Coalg}} F$ are locally presentable.\n\\end{enumerate}\n\\end{lem}\nNotably, these categories can be expressed as specific \\emph{inserters} $\\ensuremath{\\mathbf{Alg}} F=\\mathbf{Ins}(F,\\mathrm{id}_\\mathcal{C})$ and $\\ensuremath{\\mathbf{Coalg}} F=\\mathbf{Ins}(\\mathrm{id}_\\mathcal{C},F)$\nand \\cref{three} then follows from the more general `Limit Theorem' \\cite[5.1.6]{MakkaiPare}.\n\nFor the endofunctors with mappings $T_+(C)=(C\\otimes C)+I$ and $T_\\times(C)=(C\\otimes C)\\times I$,\n$\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$ is a complete full subcategory of the locally presentable and finitary monadic over $\\mathcal{V}$ category $\\ensuremath{\\mathbf{Alg}} T_+$,\nand $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ is a cocomplete full subcategory of the locally presentable and comonadic over $\\mathcal{V}$ $\\ensuremath{\\mathbf{Coalg}} T_\\times$.\n\nSpecifically for comonoids, local presentability is deduced by expressing it as an \\emph{equifier} of a triple of natural transformations\nbetween accessible functors. Then comonadicity follows: in the commutative triangle\n\\begin{equation}\\label{diagforComoncomonadicity}\n\\xymatrix @C=.5in @R=.2in\n{\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})\\ar@{-->}[dr]_U\\ar@{^(->}[r] & \\ensuremath{\\mathbf{Coalg}} T_\\times \\ar[d] \\\\ & \\mathcal{V}}\n\\end{equation}\nwhere all categories are locally presentable, both forgetful functors to $\\mathcal{V}$ have a right adjoint \nby Theorem \\ref{Kellyadj}, since they are cocontinuous. Moreover, the right leg is comonadic by \\cref{two},\nand the inclusion preserves and reflects all limits. Therefore it creates equalizers of split pairs and so does $U$,\nwhich then satisfies the conditions of Precise Monadicity Theorem.\nIn particular, the existence of the \\emph{cofree comonoid functor} $R:\\mathcal{V}\\to\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ is established.\n\nAnother piece of structure inherited from $\\mathcal{V}$ to $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ in the locally presentable context is monoidal closedness,\nagain obtained from \\cref{Kellyadj} for an adjoint of $-\\otimes C\\colon\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$.\n\n\\begin{prop}\\cite[3.2]{MonComonBimon}\\label{Comonmonclosed}\nIf $\\mathcal{V}$ is a locally presentable braided monoidal closed category, $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ is also monoidal closed.\n\\end{prop}\n\n\n\\subsection{Universal measuring comonoid}\\label{sec:actionenrich}\n\nOne of the basic goals of \\cite{Measuringcomonoid} was to estabilsh an enrichment\nof the category of monoids in the category of comonoids, under certain assumptions on $\\mathcal{V}$.\nBelow we summarize certain results; details can be found in Sections 4 and 5 therein.\n\nRecall \\cite{AnoteonActions} that an \\emph{action} of a monoidal category on an ordinary one is given by a functor\n$*\\colon\\mathcal{V}\\times\\mathcal{D}\\to\\mathcal{D}$ expressing that $\\mathcal{D}$ is a pseudomodule for the pseudomonoid $\\mathcal{V}$ in\nthe monoidal 2-category $(\\mathbf{Cat},\\times,\\mathbf{1})$. In more detail, we have natural isomorphisms with components\n\\begin{equation}\\label{actionmaps}\n\\chi_{X,Y,D}\\colon(X\\otimes Y)*D\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} X*(Y*D)\\;\\textrm{ and }\\;\\nu_{D}\\colon I*D\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} D\n\\end{equation}\nsatisfying compatibility conditions. If $*$ is an action, then $*^\\mathrm{op}$ is an action too.\n\nAs a central example for our purposes, we have the action of the opposite monoidal category on itself via the internal hom,\nsee \\cite[3.7\\&5.1]{Measuringcomonoid}.\n\n\\begin{lem}\\label{inthomaction}\nSuppose $\\mathcal{V}$ is a braided monoidal closed category. The internal hom $[-,-]:\\mathcal{V}^\\mathrm{op}\\times\\mathcal{V}\\to\\mathcal{V}$\nconstitutes an action of $\\mathcal{V}^\\mathrm{op}$ on $\\mathcal{V}$. Moreover, the induced $\\ensuremath{\\mathbf{Mon}}[-,-]:\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})^\\mathrm{op}\\times\n\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$ \\cref{defMon[]} is an action of the monoidal $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})^\\mathrm{op}$\non $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$. Similarly for their opposite functors.\n\\end{lem}\n\nA very important fact is that given a category $\\mathcal{D}$ with an action from a monoidal category $\\mathcal{V}$ with a parametrized\nadjoint, we obtain a $\\mathcal{V}$-enriched category. This follows from a much stronger result of \\cite{enrthrvar}\nfor categories enriched in bicategories; details can be found in \\cite{AnoteonActions} and \\cite[\\S 4.3]{PhDChristina}.\nFor the explicit definitions of (co)tensored enriched categories, see \\cite[3.7]{Kelly}.\n\n\\begin{thm}\\label{actionenrich}\nSuppose that $\\mathcal{V}$ is a monoidal category which acts on a category $\\mathcal{D}$ via a functor \n$*:\\mathcal{V}\\times\\mathcal{D}\\to\\mathcal{D}$, such that $-*D$ has a right adjoint $F(D,-)$ for every $D\\in\\mathcal{D}$ with a natural isomorphism\n\\begin{displaymath}\n\\mathcal{D}(X*D,E)\\cong\\mathcal{V}(X,F(D,E)).\n\\end{displaymath}\nThen we can enrich $\\mathcal{D}$ in $\\mathcal{V}$, in the sense that there is a $\\mathcal{V}$-category $\\underline{\\mathcal{D}}$\nwith hom-objects $\\underline{\\mathcal{D}}(A,B)=F(A,B)$ and underlying category $\\mathcal{D}$.\n\nMoreover, if $\\mathcal{V}$ is monoidal closed, the enrichment is \\emph{tensored}, with $X*D$ the tensor of $X{\\in}\\mathcal{V}$ and $D{\\in}\\mathcal{D}$.\nIf $\\mathcal{V}$ is moreover braided, the enrichment is \\emph{cotensored} if $X*-$ has a right adjoint;\nfinally, we can also enrich $\\mathcal{D}^\\mathrm{op}$ in $\\mathcal{V}$.\n\\end{thm}\n\nBy \\cref{inthomaction}, the internal hom induces specific actions; their parametri\\-zed adjoints\nwill induce the desired enrichment of monoids in comonoids. The following follows from \\cref{Kellyadj}\napplied to the locally presentable $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ by \\cref{moncomonadm}.\n\n\\begin{thm}\\cite[Thm~4.1]{Measuringcomonoid}\\label{measuringcomonoidprop}\nIf $\\mathcal{V}$ is a locally presentable braided monoidal closed category, the functor\n$\\ensuremath{\\mathbf{Mon}}[-,B]^\\mathrm{op}\\colon\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})^\\mathrm{op}$ has a right adjoint $P(-,B)$, i.e. there is a natural isomorphism\n\\begin{displaymath}\n\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})(A,[C,B])\\cong\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})(C,P(A,B)).\n\\end{displaymath}\n\\end{thm}\n\nThe parametrized adjoint of the functor $\\ensuremath{\\mathbf{Mon}}[-,-]^\\mathrm{op}$, namely\n\\begin{equation}\\label{Sweedlerhom}\nP\\colon\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})^\\mathrm{op}\\times\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})\n\\end{equation}\nis called the \\emph{Sweedler hom}, and $P(A,B)$ is called the \\emph{universal measuring comonoid},\ngeneralizing Sweedler's measuring coalgebras of \\cite[\\S VII]{Sweedler} as well as the \\emph{finite\ndual} $P(A,I)=A^o$ of an algebra $A$.\n\nMoreover, each $\\ensuremath{\\mathbf{Mon}}[C,-]^\\mathrm{op}$ turns out to also have a right adjoint $(C\\triangleright-)^\\mathrm{op}$\n\\cite[\\S 6.2]{PhDChristina}, and the induced functor of two variables\n\\begin{equation}\\label{Sweedlerprod}\n\\triangleright\\colon\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})\\times\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\\to\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})\n\\end{equation}\nis called the \\emph{Sweedler product} in \\cite{AnelJoyal}.\n\nApplying \\cref{actionenrich} to the braided monoidal closed\n$\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ (\\cref{Comonmonclosed})\nand $\\mathcal{D}=\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})^\\mathrm{op}$, we obtain the following \\cite[Thm.~5.2]{Measuringcomonoid}.\n\n\\begin{thm}\\label{monoidenrichment}\nSuppose $\\mathcal{V}$ is locally presentable and braided monoidal closed.\n\\begin{enumerate}\n \\item The category $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})^\\mathrm{op}$ is a monoidal $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$-category, tensored and cotensored, with hom-objects\n $\\underline{\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})^\\mathrm{op}}(A,B)=P(B,A)$.\n \\item The category $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$ is a monoidal $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$-category, tensored and cotensored,\n with $\\underline{\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})}(A,B)=P(A,B)$, cotensor $[C,B]$ and tensor $C\\triangleright B$ for any comonoid $C$ and monoid $B$.\n\\end{enumerate}\n\\end{thm}\n\n\n\\subsection{Fibrations}\\label{fibrations}\n\nWe recall some basic facts and constructions from the theory of fibrations and opfibrations.\nA few indicative references for the general theory are \\cite{FibredAdjunctions,Handbook2,Jacobs},\nand for our specific context \\cite[\\S 5]{PhDChristina}.\n\nA functor $P\\colon\\mathcal{A}\\to\\caa{X}$ is a \\emph{fibration} when for every arrow $f\\colon X\\to Y$\nin the \\emph{base} category $\\caa{X}$ and every object $B$ in the \\emph{total}\ncategory $\\mathcal{A}$ above $Y$, i.e. $P(B)=Y$, there exists a \\emph{cartesian\nmorphism} with codomain $B$ above $f$. If we denote it $\\phi\\colon A\\to B$, this means that for any\n$g\\colon X\\to X'$ and $A'\\to B$ as in the diagram below, there exists a unique factorization through the domain of the cartesian morphism\nover $g$:\n\\begin{displaymath}\n\\xymatrix @R=.1in @C=.6in\n{A'\\ar [drr]^-{\\theta}\\ar @{-->}[dr]_-{\\exists!\\psi} \n\\ar @{.>}@\/_\/[dd] &&& \\\\\n& A\\ar[r]_-{\\phi} \\ar @{.>}@\/_\/[dd] & \nB \\ar @{.>}@\/_\/[dd] & \\textrm{in }\\mathcal{A}\\\\\nX'\\ar [drr]^-{f\\circ g=P\\theta}\\ar[dr]_-g &&&\\\\\n& X\\ar[r]_-{f=P\\phi} & Y & \\textrm{in }\\caa{X}}\n\\end{displaymath}\nFor each $X$ in the base, its \\emph{fibre} category $\\mathcal{A}_X\\subset\\mathcal{A}$ consists of objects above $X$\nand morphisms above the identity $\\mathrm{id}_X$, called $P$-\\emph{vertical}. We call $\\phi$ a \\emph{cartesian lifting} of $B$ along $f$.\nAssuming the axiom of choice, cartesian liftings can be selected (up to vertical isomorphism) for each morphism\n$f$ in the base and object $B\\in\\mathcal{A}_{\\mathrm{cod} f}$, henceforth denoted $\\ensuremath{\\mathrm{Cart}}(f,B)\\colon f^*B\\to B$.\n\nDually, a functor $U\\colon\\mathcal{C}\\to\\caa{X}$ is an \\emph{opfibration} when its opposite functor $U^\\mathrm{op}$ is a fibration:\nfor every $g\\colon X\\to Y$ in the base and $C\\in\\mathcal{C}_X$ above the domain, there is a cocartesian morphism\nfrom $C$ above $g$, the \\emph{cocartesian lifting} of $C$ along $g$ denoted $\\ensuremath{\\mathrm{Cocart}}(g,C)\\colon C\\to g_!C$.\n\nAny arrow in the total category of an (op)fibration factorizes uniquely into\na vertical morphism followed by a (co)cartesian one:\n\\begin{equation}\\label{factor}\n\\xymatrix @C=.4in @R=.2in\n{A\\ar[rr]^\\theta\\ar @{-->}[d]_-{\\psi} && B \\ar @{.>}[dd] &\\\\\nf^*B\\ar[urr]_-{\\;\\ensuremath{\\mathrm{Cart}}(f,B)} \\ar @{.>}[d] &&& \\textrm{in }\\mathcal{A} \\\\\nX\\ar[rr]_-{f} && Y & \\textrm{in }\\caa{X},}\\qquad\n\\xymatrix @C=.4in @R=.2in\n{C \\ar @{.>}[dd]\\ar[rr]^\\gamma \\ar[drr]_-{\\ensuremath{\\mathrm{Cocart}}(g,C)} && D &\\\\\n&& f_!C \\ar @{-->}[u]_-{\\delta} \\ar @{.>}[d] & \\textrm{in }\\mathcal{C} \\\\\nX\\ar[rr]_-{g} && Y & \\textrm{in }\\caa{X}.}\n\\end{equation}\nThe choice of (co)cartesian liftings in an (op)fibration induces\na so-called \\emph{reindexing functor} between the fibre categories\n\\begin{displaymath}\nf^*:\\mathcal{A}_Y\\to\\mathcal{A}_X\\quad\\textrm{ and }\\quad g_!\\colon\\mathcal{C}_X\\to\\mathcal{C}_Y\n\\end{displaymath}\nrespectively, for each morphism $f$ or $g\\colon X\\to Y$ in the base category, mapping each object to the (co)domain of its lifting.\n\n\\begin{rmk}\\label{rmkforadjointintexingbifr}\nDue to the unique factorization of arrows in a (op)fibration through (co)cartesian liftings, we can deduce that a fibration\n$P:\\mathcal{A}\\to\\caa{X}$ is also an opfibration (consequently a \\emph{bifibration}) if and only if, for every $f:X\\to Y$ the reindexing\n$f^*:\\mathcal{A}_Y\\to\\mathcal{A}_X$ has a left adjoint, namely $f_!:\\mathcal{A}_X\\to\\mathcal{A}_Y$ (e.g. \\cite[Proposition 1.2.7]{hermidaphd}). \n\\end{rmk}\n\nAn \\emph{oplax fibred 1-cell} $(S,F)$ between $P:\\mathcal{A}\\to\\caa{X}$ and $Q:\\mathcal{B}\\to\\caa{Y}$ is given by a commutative square of\ncategories and functors\n\\begin{displaymath}\n\\xymatrix @C=.4in @R=.4in\n{\\mathcal{A}\\ar[r]^-S \\ar[d]_-P & \\mathcal{B}\\ar[d]^-Q \\\\\n\\caa{X}\\ar[r]_-F & \\caa{Y}}\n\\end{displaymath}\ncalled an \\emph{oplax morphism of fibrations} in \\cite[Def.~3.5]{Framedbicats}; this name is justified by the correspondence\nof \\cref{Grothendieckcorrespondence}.\nBy \\cref{factor}, we always have a comparison vertical morphism\n\\begin{displaymath}\n\\xymatrix @C=.6in @R=.2in\n{Sf^*B\\ar[rr]^-{S\\ensuremath{\\mathrm{Cart}}(f,B)}\\ar @{-->}[d]_-{\\psi} && SB \\ar @{.>}[dd] &\\\\\n(Ff)^*SB\\ar[urr]_-{\\;\\ensuremath{\\mathrm{Cart}}(Ff,SB)} \\ar @{.>}[d] &&& \\textrm{in }\\mathcal{B} \\\\\nFX\\ar[rr]_-{Ff} && FY & \\textrm{in }\\caa{Y},}\n\\end{displaymath}\nto the chosen $Q$-cartesian lifting of $SB$ along $Ff$.\nIf moreover $S$ preserves cartesian arrows, meaning that if $\\phi$ is $P$-cartesian then $S\\phi$ is $Q$-cartesian\nor equivalently the above comparison map is an isomorphism, the pair $(S,F)$ is called a \\emph{fibred 1-cell} or\n\\emph{strong morphism of fibrations}.\n\nIn particular, when $P$ and $Q$ are fibrations over the same base $\\caa{X}$, we may consider\noplax morphisms or fibred 1-cells of the form $(S,1_{\\caa{X}})$ displayed as\n\\begin{displaymath}\n\\xymatrix @C=.2in\n{\\mathcal{A}\\ar[rr]^-S \\ar[dr]_-P\n && \\mathcal{B}\\ar[dl]^-Q\\\\\n & \\caa{X} &}\n\\end{displaymath}\nwhen $S$ is called \\emph{(oplax) fibred functor}.\nDually, we have the notion of an \\emph{lax opfibred 1-cell} $(K,F)$, \\emph{opfibred 1-cell} when $K$ is cocartesian,\nand \\emph{(lax) opfibred functor} $(K,1_\\caa{X})$.\nNotice that any oplax fibred 1-cell $(S,F)$ determines a collection of functors\n\\begin{displaymath}\nS_X\\colon\\mathcal{A}_X\\longrightarrow\\mathcal{B}_{FX}\n\\end{displaymath}\nbetween the fibres, as the restriction of $S$ to the corresponding subcategories.\n\nA \\emph{fibred 2-cell} between oplax fibred 1-cells $(S,F)$ and $(T,G)$ is a pair of natural transformations \n($\\alpha:S\\Rightarrow T,\\beta:F\\Rightarrow G$) with $\\alpha$ above $\\beta$, \\emph{i.e.} $Q(\\alpha_A)\n=\\beta_{PA}$ for all $A\\in\\mathcal{A}$, displayed\n\\begin{displaymath}\n\\xymatrix @C=.8in @R=.5in\n{\\mathcal{A}\\rtwocell^S_T{\\alpha}\\ar[d]_-P\n& \\mathcal{B}\\ar[d]^-Q \\\\\n\\caa{X}\\rtwocell^F_G{\\beta} & \\caa{Y}.}\n\\end{displaymath}\nA \\emph{fibred natural transformation} is of the form $(\\alpha,1_{1_{\\caa{X}}}):(S,1_{\\caa{X}})\\Rightarrow(T,1_\\caa{X})$\nwhich ends up having vertical components, $Q(\\alpha_A)=1_{PA}$.\nNotice that if the 1-cells are strong, the definition of a 2-cell between them remains the same.\nDually, we have the notion of an \\emph{opfibred 2-cell} and \\emph{opfibred natural transformation} between\nlax opfibred 1-cells and functors respectively.\n\nWe obtain 2-categories $\\mathbf{Fib}_\\mathrm{opl}$ and $\\mathbf{Fib}$ of fibrations over arbitrary base categories, (oplax) fibred 1-cells and\nfibred 2-cells. In particular, there are 2-categories $\\mathbf{Fib}_\\mathrm{opl}(\\caa{X})$ and $\\mathbf{Fib}(\\caa{X})$\nof fibrations over a fixed base category $\\caa{X}$, (oplax) fibred functors and fibred natural transformations.\nDually, we have the 2-categories $\\mathbf{OpFib}_{(\\mathrm{lax})}$ and $\\mathbf{OpFib}_{(\\mathrm{lax})}(\\caa{X})$.\n\nThe fundamental \\emph{Grothendieck construction} \\cite{Grothendieckcategoriesfibrees} establishes a standard\nequivalence between fibrations and pseudofunctors, \\cref{laxfunctor}.\nStarting with a pseudofunctor $\\mathscr{M}\\colon\\caa{X}^\\mathrm{op}\\to\\mathbf{Cat}$, we can form the Grothendieck category\n$\\int\\mathscr{M}$ with objects pairs $(A,X)\\in\\mathscr{M}X\\times\\caa{X}$ and morphisms\n$(A,X)\\to(B,Y)$ pairs $(\\phi\\colon A\\to(\\mathscr{M}f)B,f\\colon X\\to Y)\\in\\mathscr{M}X\\times\\caa{X}$. This is fibred\nover $\\caa{X}$, with fibres $(\\int\\mathscr{M})_X=\\mathscr{M}X$, reindexing functors $\\mathscr{M}f$ and chosen cartesian liftings\n\\begin{equation}\\label{canonicalcartesianlift}\n\\xymatrix@C=.3in @R=.3in\n{((\\mathscr{M}f)B,X)\\ar[rr]^-{(1_{(\\mathscr{M}f)B},f)}\\ar@{.>}[d] && (B,Y)\\ar@{.>}[d] & \\textrm{in }\\int\\mathscr{M} \\\\\nX\\ar[rr]^-f && Y & \\textrm{in }\\caa{X}.}\n\\end{equation}\nUsing similar machinery \\cite[Prop. 3.6]{Framedbicats}, we obtain respective correspondences for oplax fibred 1-cells and oplax natural\ntransformations.\n\n\\begin{thm}\\label{Grothendieckcorrespondence}\nThere are equivalences of 2-categories\n\\begin{gather*}\n\\mathbf{Fib}_\\mathrm{opl}(\\caa{X})\\simeq[\\caa{X}^\\mathrm{op},\\mathbf{Cat}]_\\mathrm{opl} \\\\\n\\mathbf{Fib}(\\caa{X})\\simeq[\\caa{X}^\\mathrm{op},\\mathbf{Cat}]\n\\end{gather*}\nbetween the 2-categories of fibrations with fixed base and pseudofunctors with oplax or pseudonatural transformations and modifications.\n\\end{thm}\nThere is also a 2-equivalence $\\mathbf{ICat}\\simeq\\mathbf{Fib}$ between fibrations over arbitrary bases and an appropriately defined 2-category of\npseudofunctors with arbitrary domain; for more details, see \\cite{hermidaphd}. Along with the dual versions for opfibrations,\nnamely $\\mathbf{OpFib}(\\caa{X})\\simeq[\\caa{X},\\mathbf{Cat}]$,\nthese equivalences allow us to freely change our perspective between (op)fibrations and pseudofunctors.\n\nMoving on to notions of adjunctions between fibrations, we obtain the following definitions as adjunctions\nin the respective 2-categories of (op)fibrations.\n\n\\begin{defi}\\label{generalfibredadjunction}\nGiven fibrations $P:\\mathcal{A}\\to\\caa{X}$ and $Q:\\mathcal{B}\\to\\caa{Y}$,\na \\emph{general (oplax) fibred adjunction} is given by a pair of (oplax) fibred 1-cells $(L,F):P\\to Q$ and \n$(R,G):Q\\to P$ together with fibred 2-cells $(\\zeta,\\eta):(1_\\mathcal{A},1_\\caa{X})\\Rightarrow\n(RL,GF)$ and $(\\xi,\\varepsilon):(LR,FG)\\Rightarrow(1_\\mathcal{B},1_\\caa{Y})$\nsuch that $L\\dashv R$ via $\\zeta,\\xi$ and $F\\dashv G$ via $\\eta,\\varepsilon$. This\nis displayed as\n\\begin{displaymath}\n\\xymatrix @C=.7in @R=.4in\n{\\mathcal{A} \\ar[d]_-P \n\\ar @<+.8ex>[r]^-L\\ar@{}[r]|-\\bot\n& \\mathcal{B} \\ar @<+.8ex>[l]^-{R} \\ar[d]^-Q \\\\\n\\caa{X} \\ar @<+.8ex>[r]^-F\\ar@{}[r]|-\\bot\n& \\caa{Y} \\ar @<+.8ex>[l]^-G}\n\\end{displaymath} \nand we write $(L,F)\\dashv(R,G):Q\\to P$.\n\\end{defi}\n\nNotice that by definition, $\\zeta$ is above $\\eta$ and $\\xi$ is above $\\varepsilon$,\nhence $(P,Q)$ is in particular an ordinary map between adjunctions. Dually, we have the notions of \\emph{general (lax) opfibred \nadjunction} and \\emph{opfibred adjunction} in $\\mathbf{OpFib}_\\mathrm{lax}$.\n\nIn \\cite[\\S 3.2]{Measuringcomodule}, conditions under which a fibred 1-cell has an adjoint are investigated in detail.\nBelow we only recall the case of general lax opfibred adjunction, due to the applications that follow.\n\n\\begin{thm}\\label{totaladjointthm}\nSuppose $(K,F):U\\to V$ is an opfibred 1-cell and $F\\dashv G$ is an adjunction with counit $\\varepsilon$ between \nthe bases of the opfibrations, as in\n\\begin{displaymath}\n\\xymatrix @C=.6in\n{\\mathcal{C}\\ar[r]^-K\\ar[d]_-U & \\mathcal{D}\\ar[d]^-V \\\\\n\\caa{X}\\ar @<+.8ex>[r]^-F\n\\ar@{}[r]|-\\bot\n& \\caa{Y}. \\ar @<+.8ex>[l]^-G}\n\\end{displaymath}\nIf, for each $Y\\in\\caa{Y}$, the composite functor between the fibres\n\\begin{equation}\\label{specialfunctor}\n\\mathcal{C}_{GY}\\xrightarrow{K_{GY}}\\mathcal{D}_{FGY}\n\\xrightarrow{(\\varepsilon_Y)_!}\\mathcal{D}_Y\n\\end{equation}\nhas a right adjoint for each $Y\\in\\caa{Y}$, then $K$ has a right adjoint $R$ between the total categories\nand $(K,F)\\dashv(R,G)$ is a general lax opfibred adjunction.\n\\end{thm}\n\nFinally, in \\cite{Enrichedfibration} the notion of an enriched fibration is discussed in length;\nwe gather the basic definitions in order to employ them in the setting\nof double categories later.\nThe following generalizes the notion of a (right) parametrized adjunction from $\\mathbf{Cat}$ to $\\mathbf{Fib}_{\\mathrm{opl}}$\nor $\\mathbf{OpFib}_\\mathrm{lax}$.\n\n\\begin{defi}\\label{generaloplaxparametrized}\nFor fibrations $H,K$, a \\emph{fibred parametrized adjunction} consists of\n\\begin{displaymath}\n\\xymatrix @C=.6in @R=.3in\n{\\mathcal{A}\\times\\mathcal{B}\\ar[r]^-F\\ar[d]_-{H\\times J} & \\mathcal{C}\\ar[d]^-K \\\\ \\caa{X}\\times\\caa{Y}\\ar[r]_-G & \\caa{Z},}\\qquad\n\\xymatrix @C=.6in @R=.3in\n{\\mathcal{B}^\\mathrm{op}\\times\\mathcal{C}\\ar[r]^-R\\ar[d]_-{J^\\mathrm{op}\\times K} & \\mathcal{A}\\ar[d]^-H \\\\\n\\caa{Y}^\\mathrm{op}\\times\\caa{Z}\\ar[r]_-S & \\caa{X}}\n\\end{displaymath}\nsuch the following is a general oplax fibred adjunction\n\\begin{displaymath}\n \\xymatrix @C=.9in @R=.5in\n{\\mathcal{A}\\ar[d]_-H\\ar@<+.8ex>[r]^-{F(-,B)}\\ar@{}[r]|-{\\bot} & \\mathcal{C}\\ar[d]^-K\\ar@<+.8ex>[l]^-{R(B,-)} \\\\\n\\caa{X}\\ar@<+.8ex>[r]^-{G(-,JB)}\\ar@{}[r]|-{\\bot} & \\caa{Z}.\\ar@<+.8ex>[l]^-{S(JB,-)}}\n\\end{displaymath}\nDually, an \\emph{opfibred parametrized adjunction} consists of 1-cells as above, inducing a general lax opfibred\nadjunction. \n\\end{defi}\n\nNote that by general arguments, $R(B,-)$ automatically preserves cartesian morphisms and dually,\n$F(-,B)$ preserves cocartesian morphisms.\n\nIdentifying the pseudomonoids in the cartesian monoidal 2-category $\\mathbf{Fib}$, we obtain the following definition,\nalso \\cite[12.1]{Framedbicats}.\n\n\\begin{defi}\\label{monoidalfibration}\nA fibration $T\\colon\\mathcal{V}\\to\\caa{W}$ is \\emph{monoidal} when $\\mathcal{V}$, $\\caa{W}$ are monoidal categories,\n$T$ is a strict monoidal functor and the tensor product $\\otimes_\\mathcal{V}$ preserves cartesian arrows.\n\\end{defi}\n\nA fibration is \\emph{symmetric monoidal} when it is a strict braided monoidal functor\nbetween symmetric monoidal categories. Next, expressing a pseudomodule in $(\\mathbf{Fib},\\times,1_\\mathcal{I})$ gives the following,\n\\cite[Def.~3.3]{Enrichedfibration}.\n\n\\begin{defi}\\label{Trepresentation}\nA monoidal fibration $T:\\mathcal{V}\\to\\caa{W}$ \\emph{acts} on the fibration\n$P:\\mathcal{A}\\to\\caa{X}$ when there exists a fibred 1-cell\n\\begin{equation}\\label{eq:fibred1cellaction}\n \\xymatrix @C=.6in@R=.3in\n{\\mathcal{V}\\times\\mathcal{A}\\ar[r]^-{*}\\ar[d]_-{T\\times P} & \n\\mathcal{A}\\ar[d]^-P \\\\\n\\caa{W}\\times\\caa{X}\\ar[r]_-{\\diamond} & \\caa{X}.}\n\\end{equation}\nwhere the functors $*\\colon\\mathcal{V}\\times\\mathcal{A}\\to\\mathcal{A}$ and $\\diamond\\colon\\caa{W}\\times\\caa{X}\\to\\caa{X}$\nare ordinary actions of the monoidal $\\mathcal{V}$, $\\caa{W}$ on $\\mathcal{A}$ and $\\caa{X}$ respectively,\nsuch that the action constraints are compatible\nin the sense that\n\\begin{equation}\\label{actionsabove}\nP\\chi^\\mathcal{A}_{XYA}=\\chi^\\caa{X}_{(TX)(TY)(PA)},\\quad P\\nu^\\mathcal{A}_A=\\nu^\\caa{X}_{PA}\n\\end{equation}\nfor all $X,Y\\in\\mathcal{V}$ and $A\\in\\mathcal{A}$, following the notation from \\cref{actionmaps}.\n\\end{defi}\n\nWith the purpose of generalizing the action-induced enrichment from $\\mathbf{Cat}$ in \\cref{actionenrich}\nto $\\mathbf{Fib}_\\mathrm{opl}$, we conclude to \\cite[Def.~3.8]{Enrichedfibration}.\n\n\\begin{defi}\\label{enrichedfibration}\nIf $T\\colon\\mathcal{V}\\to\\caa{W}$ is a monoidal fibration, we say an ordinary fibration $P\\colon\\mathcal{A}\\to\\caa{X}$ is \\emph{enriched} in $T$ when\n\\begin{itemize}\n \\item $\\mathcal{A}$ is enriched in $\\mathcal{V}$, $\\caa{X}$ is enriched in $\\caa{W}$ and the following commutes:\n \\begin{displaymath}\n\\xymatrix @C=.8in @R=.3in\n{\\mathcal{A}^\\mathrm{op}\\times\\mathcal{A}\\ar[r]^-{\\mathcal{A}(-,-)}\n\\ar[d]_-{P^\\mathrm{op}\\times P} & \\mathcal{V}\\ar[d]^-T \\\\\n\\caa{X}^\\mathrm{op}\\times\\caa{X}\\ar[r]_-{\\caa{X}(-,-)} &\n\\caa{W}}\n\\end{displaymath}\n\\item composition and identities of the enrichments are compatible, in that\n\\begin{displaymath}\nTM^{\\mathcal{A}}_{A,B,C}=M^{\\caa{X}}_{PA,PB,PC}\\;\\textrm{ and }\\; Tj^\\mathcal{A}_A=j^{\\caa{X}}_{PA}.\n\\end{displaymath}\n\\end{itemize}\n\\end{defi}\n\nDually, we have the notion of an opfibration enriched in a monoidal opfibration. Moreover, we say\nthat a fibration $P$ is enriched in a monoidal opfibration $T$ if and only if the opfibration $P^\\mathrm{op}$ is $T$-enriched.\nFinally, \\cite[Thm.~3.11]{Enrichedfibration} gives a direct way of obtaining an enriched fibration.\n\n\\begin{thm}\\label{thmactionenrichedfibration}\nSuppose that $T:\\mathcal{V}\\to\\caa{W}$ is a monoidal fibration, which acts on an (ordinary) fibration $P:\\mathcal{A}\\to\\caa{X}$\nvia the fibred 1-cell \\cref{eq:fibred1cellaction}.\nIf this action has an oplax fibred parametrized adjoint $(R,S):P^\\mathrm{op}\\times P\\to T$, then we can enrich the fibration \n$P$ in the monoidal fibration $T$.\n\\end{thm}\n\nWe will later use the dual version, for which an action of a monoidal opfibration (a pseudomonoid in $\\mathbf{OpFib}$)\ninduces an enrichment via an opfibred parametrized adjunction.\n\n\n\\section{Double categories}\\label{doublecats}\n\nThe setting of double categories, and more specifically fibrant monoidal double categories, is crucial\nfor this work's development but also for further applications.\nA few references for the theory of double categories and results relevant here are\n\\cite{Limitsindoublecats,Adjointfordoublecats,Framedbicats};\nthe original concept of a double category as a category internal in $\\mathbf{Cat}$\ngoes back to \\cite{Ehresmanndouble}.\nIn order to provide a\npassage from double categories to bicategories, we largely follow the notation and approach of\n\\cite{ConstrSymMonBicats} where a method for constructing monoidal bicategories\nfrom monoidal double categories is described.\n\nWe then proceed to the study of monads (see also \\cite{Monadsindoublecats}) and comonads in double categories,\nas well a natural (op)fibrational picture they form over the vertical category\ninduced by fibrancy conditions. In the monoidal case, these are in fact monoidal (op)fibrations in the sense of the previous section.\n\nFinally, by introducing the notion of a \\emph{locally closed monoidal} double category, capturing a closed structure\nfor both vertical and horizontal categories, we are able to explore enrichment relations between the category of monads\nand comonads, sometimes forming an enriched fibration.\n\n\\subsection{Background on fibrant double categories}\n\nWe recall the central definitions and fix our notation.\n\n\\begin{defi}\\label{def:doublecats}\n A \\emph{(pseudo) double category} $\\caa{D}$\nconsists of a category of objects $\\caa{D}_0$ and\na category of arrows $\\caa{D}_1$, with (identity, source and target, composition) structure\nfunctors \n\\begin{displaymath}\n \\mathbf{1}:\\caa{D}_0\\to\\caa{D}_1,\\quad \n\\mathfrak{s},\\mathfrak{t}:\\caa{D}_1\\rightrightarrows\\caa{D}_0,\\quad\n\\odot:\\caa{D}_1{\\times_{\\caa{D}_0}}\\caa{D}_1\\to\\caa{D}_1\n\\end{displaymath}\nsuch that\n$\\mathfrak{s}(1_A)$=$\\mathfrak{t}(1_A)$=$A,\\;\\mathfrak{s}(M\\odot N)$=$\\mathfrak{s}(N),\\;\n\\mathfrak{t}(M\\odot N)$=$\\mathfrak{t}(M)$\nfor all $A\\in\\ensuremath{\\mathrm{ob}}\\caa{D}_0$ and $M,N\\in\\ensuremath{\\mathrm{ob}}\\caa{D}_1$,\nequipped with natural isomorphisms\n\\begin{gather*}\n\\alpha:(M\\odot N)\\odot P\\xrightarrow{\\sim}M\\odot(N\\odot P) \\\\\n\\lambda:1_{\\mathfrak{s}(M)}\\odot M\\xrightarrow{\\;\\sim\\;}M \\quad\n\\rho:M\\odot1_{\\mathfrak{t}(M)}\\xrightarrow{\\;\\sim\\;}M\n\\end{gather*}\nin $\\caa{D}_1$ such that \n$\\mathfrak{t}(\\alpha),\\mathfrak{s}(\\alpha),\\mathfrak{t}(\\lambda),\\mathfrak{s}(\\lambda),\n\\mathfrak{t}(\\rho),\\mathfrak{s}(\\rho)$ are all\nidentities, and satisfying the usual coherence conditions\n(as for a bicategory \\cref{bicataxiom1}).\n\\end{defi}\nThe objects of $\\caa{D}_0$ are called \\emph{0-cells} and the morphisms $f:A\\to B$ of $\\caa{D}_0$ are called \n\\emph{vertical 1-cells}. The objects of $\\caa{D}_1$ are the \\emph{horizontal 1-cells}\nor \\emph{proarrows},$\\SelectTips{eu}{10}\n\\xymatrix@C=.2in{M:A\\ar[r]\n\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}$.\nThe morphisms of $\\caa{D}_1$ are the \n\\emph{2-morphisms}\n\\begin{equation}\\label{2morphism}\n\\xymatrix @C=.3in @R=.3in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4>\\alpha} \\ar[d]_-f & B\\ar[d]^-g \\\\\nC\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & D}\n\\end{equation}\nor $^f\\alpha^g:M\\Rightarrow N$, \nwhere $\\mathfrak{s}(\\alpha)=f$ and $\\mathfrak{t}(\\alpha)=g$.\nThe composition of vertical 1-cells \nand the vertical composition of 2-morphisms\nare strictly associative, whereas \nhorizontal composition of horizontal\n1-cells and 2-morphisms is associative up to isomorphism, written\n\\begin{equation}\\label{2cellscomp}\n \\xymatrix @C=.25in @R=.25in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar[d]_-f\n\\rtwocell<\\omit>{<3>\\alpha} & B\\ar[d]^-g \\\\\nC\\ar[r]^-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar[d]_-h\n\\rtwocell<\\omit>{<3>\\beta} & D\\ar[d]^-k \\\\\nE\\ar[r]_-P\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F}\n\\xymatrix{\\hole \\\\ = \\\\ \\hole}\n\\xymatrix @C=.25in @R=.25in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar[dd]_-{hf} &\nB\\ar[dd]^-{kg} \\\\\n\\qquad\\color{white}{C} \\rtwocell<\\omit>{\\;\\beta\\alpha} & \\\\\nE\\ar[r]_-P\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F,}\\quad\n \\xymatrix @C=.08in @R=.08in\n{&& \\\\\nA\\ar[rr]^-M\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} \\ar[dd]_-f\n\\rrtwocell<\\omit>{<3.5>\\alpha} && B\\ar[rr]^-N\n\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} \\ar[dd]_-g \\rrtwocell\n<\\omit>{<3.5>\\beta} && C\\ar[dd]^-h \\\\\n&&& \\\\\nD\\ar[rr]_-P\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} && E\\ar[rr]_-K\n\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} && F \\\\\n&&}\n\\xymatrix @C=.08in @R=.08in\n{ \\\\\n\\hole \\\\\n= \\\\ }\n\\xymatrix @C=.08in @R=.08in\n{&& \\\\\nA\\ar[rrr]^-{N\\odot M}\\ar@{}[rrr]|-{\\scriptstyle{\\bullet}}\n\\ar[dd]_-f & \\rtwocell<\\omit>{<3.5>{\\quad\\beta\\odot\\alpha}} && \nC\\ar[dd]^-h \\\\\n&&& \\\\\nD\\ar[rrr]_-{K\\odot P}\\ar@{}[rrr]|-{\\scriptstyle{\\bullet}} &&& F. \\\\\n&&} \n\\end{equation}\nStrict (vertical) identities are $\\mathrm{id}_A:A\\to A$ and $\\mathrm{id}_M:M\\Rightarrow M$,\nand horizontal units are $\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{1_A:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$and\n$^f1_f^f:1_A\\Rightarrow 1_B$.\nFunctoriality of the horizontal composition results in the relation $1_N\\odot1_M=1_{N\\odot M}$ and \nthe interchange law $(\\beta'\\beta)\\odot(\\alpha'\\alpha)=(\\beta'\\odot\\alpha')(\\beta\\odot\\alpha).$\nA 2-morphism with identity source and target vertical 1-cell, like $a,l,r$ above, is called \\emph{globular}.\n\nThe \\emph{opposite double category} $\\caa{D}^\\mathrm{op}$\nis the double category with vertical category \n$\\caa{D}_0^\\mathrm{op}$ and horizontal category $\\caa{D}_1^\\mathrm{op}$.\nThere also exist the \\emph{horizontally opposite}\ndouble category $\\caa{D}^\\mathrm{hop}$ and \n\\emph{vertically opposite} double category \n$\\caa{D}^\\mathrm{vop}$ with opposite horizontal and \nvertical categories respectively.\n\nFor every double category $\\caa{D}$ there is a corresponding bicategory denoted by $\\mathcal{H}(\\caa{D})$, called its \\emph{horizontal bicategory};\nin a sense, it comes from discarding the vertical structure of the double category.\nIt consists of the objects, horizontal 1-cells and globular 2-morphisms, and the required axioms are satisfied by default.\nMany well-known bicategories arise as the horizontal bicategories of\nspecific double categories: in fact, all the examples of \\cref{sec:bicategories} can be seen as such for the following double\ncategories, see e.g. \\cite{Limitsindoublecats,Framedbicats}.\n\\begin{itemize}\n \\item $\\caa{S}\\mathbf{pan}(\\mathcal{C})$ and $\\caa{R}\\mathbf{el}(\\mathcal{C})$ with vertical category $\\mathcal{C}$;\n \\item $\\caa{B}\\mathbf{Mod}$ with vertical category $\\mathbf{Rng}$ of rings and ring homomorphisms;\n \\item ($\\mathcal{V}$-)$\\caa{P}\\mathbf{rof}$ with vertical category ($\\mathcal{V}$-)$\\mathbf{Cat}$.\n\\end{itemize}\nWhat is evident from the above examples is that the double categorical perspective includes not only the morphisms\nwhich the bicategorical structure is usually named after and describes best, but also the more fundamental, strict morphisms\nbetween the objects: functions, ring maps and functors above.\n\n\n\\begin{defi}\\label{defi:doublefunctor}\nFor $\\caa{D}$ and $\\caa{E}$ (pseudo) double categories, a \\emph{pseudo double functor} $F:\\caa{D}\\to\\caa{E}$\nconsists of functors $F_0:\\caa{D}_0\\to\\caa{E}_0$ and $F_1:\\caa{D}_1\\to\\caa{E}_1$ between the categories\nof objects and arrows, such that $\\mathfrak{s}\\circ F_1=F_0\\circ\\mathfrak{s}$ \nand $\\mathfrak{t}\\circ F_1=F_0\\circ\\mathfrak{t}$, and natural transformations $F_{\\odot}$, $F_U$ \nwith components globular isomorphisms\n$F_1M\\odot F_1N\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} F_1(M\\odot N)\\textrm{ and }1_{F_0A}\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} F_1(1_A)$\nwhich satisfy the usual coherence axioms \\cref{laxcond1,laxcond2} for a pseudofunctor.\n\\end{defi}\n\nDue to the compatibility of $F_0$, $F_1$ with sources and targets, we can write the mapping\nof $F_1$ on 1-cells and 2-morphisms as\n\\begin{equation}\\label{F1mapping}\n\\xymatrix@R=.35in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar[d]_-{f}\n\\rtwocell<\\omit>{<4>\\alpha} & B\\ar[d]^-{g} \\\\\nC\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & D}\\;\n\\xymatrix @R=.1in\n{\\hole \\\\ \\mapsto }\\;\n\\xymatrix @C=.5in @R=.35in\n{F_0A\\ar[r]^-{F_1M}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar[d]_-{F_0f}\n\\rtwocell<\\omit>{<4>\\quad F_1\\alpha} & F_0B\\ar[d]^-{F_0g} \\\\\nF_0C\\ar[r]_-{F_1N}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F_0D}\n\\end{equation}\nWe also have notions of \\emph{lax} and \\emph{colax double functors} between pseudo double categories, where the natural\ntransformations $F_{\\odot}$ and $F_U$ have components globular 2-morphisms in one of the two possible directions respectively.\nThe full definitions can be found in the appendix of \\cite{Limitsindoublecats} or \\cite{Adjointfordoublecats}.\n\nAny lax\/colax\/pseudo double functor $F:\\caa{D}\\to\\caa{E}$ naturally induces a lax\/colax\/pseudo functor, \\cref{laxfunctor},\nbetween the respective horizontal bicategories.\nIt is denoted by $\\mathcal{H}F:\\mathcal{H}(\\caa{D})\\to\\mathcal{H}(\\caa{E})$, where each $A\\in\\caa{D}_0$ is mapped to $F_0A\\in\\caa{E}_0$, and\nthere are ordinary functors $\\mathcal{H}F_{A,B}:\\mathcal{H}(\\caa{D})(A,B)\\to\\mathcal{H}(\\caa{E})(F_0A,F_0B)$ mapping globular 2-cells\nto globular 2-cells via \\cref{F1mapping}.\n\nWith an appropriate notion for transformations between double functors, there is a 2-category $\\mathcal{D}bl$ of double categories.\nA monoidal double category then is a pseudomonoid therein, see \\cite[2.9]{ConstrSymMonBicats}\nfor the full definition. Notably, in \\cite{Adjointfordoublecats} the tensor product $\\otimes$ is required to be a colax double functor\nrather than pseudo double. \n\n\\begin{defi}\\label{monoidaldoublecategory}\nA \\emph{monoidal double category} is a double category $\\caa{D}$ equipped with pseudo double functors\n$\\otimes=(\\otimes_1,\\otimes_1):\\caa{D}\\times\\caa{D}\\to\\caa{D}$ and $\\mathbf{I}:\\mathbf{1}\\to\\caa{D}$\nand invertible transformations expressing associativity and unity constraints, subject to axioms.\n\nThese amount to $(\\caa{D}_0,\\otimes_0,I)$ and $(\\caa{D}_1,\\otimes_1,1_I)$ being monoidal categories with units $I=\\mathbf{I}(*)$\nand$\\SelectTips{eu}{10}\\xymatrix@C=.2in{1_I:I\\ar[r]|-{\\scriptstyle\\bullet} & I,}$ $\\mathfrak{s},\\mathfrak{t}$ being strict monoidal and preserving\nassociativity and unit constraints, and the existence of globular isomorphisms\n\\begin{align}\\label{monoidaldoubleiso}\n(M\\otimes_1 N)\\odot(M'\\otimes_1 N')&\\cong\n(M\\odot M')\\otimes_1(N\\odot N') \\\\\n1_{(A\\otimes_0 B)}&\\cong\n1_A\\otimes_1 1_B\\nonumber\n\\end{align}\nsubject to coherence conditions.\n\\end{defi}\n\nA \\emph{braided} or \\emph{symmetric} monoidal double category $\\caa{D}$ is one for which $\\caa{D}_0$, $\\caa{D}_1$ are\nbraided or symmetric, and the source and target functors $\\mathfrak{s},\\mathfrak{t}$ are strict braided monoidal, subject subject to two more axioms.\nBy definition \\cref{F1mapping}, $\\otimes_1$ is the following mapping:\n\\begin{equation}\\label{D1monoidal}\n\\otimes_1:\\xymatrix @C=1.5in\n{\\caa{D}_1\\times\\caa{D}_1\\ar[r] & \\caa{D}_1\\phantom{ABC}}\n\\end{equation}\\vspace{-0.2in}\n\\begin{displaymath}\n\\xymatrix @C=.045in @R=.25in\n{(A\\ar[rrr]|-\\scriptstyle\\bullet^M\\ar[d]_-f &\\rtwocell<\\omit>{<4>{\\alpha}}&& B,\\ar[d]^-g & C\\ar[rrr]^-N|-\\scriptstyle\\bullet\\ar[d]_-h\n&\\rtwocell<\\omit>{<4>\\beta}&& D)\\ar[d]^-k\n\\ar@{|.>}[rrrr] &&&& A\\otimes_0 C\\ar[rrr]^-{M\\otimes_1 N}|-\\scriptstyle\\bullet\n\\ar[d]_-{f\\otimes_0 h} &\\rtwocell<\\omit>{<4>\\quad\\alpha\\otimes_1\\beta}\n&& B\\otimes_0 D\\ar[d]^-{g\\otimes_0 k} \\\\\n(A'\\ar[rrr]_-{M'}|-\\scriptstyle\\bullet &&& B', & C'\\ar[rrr]_-{N'}|-\\scriptstyle\\bullet &&& D')\n\\ar@{|.>}[rrrr] &&&& A'\\otimes_0 B'\\ar[rrr]_-{M'\\otimes_1 N'}|-\\scriptstyle\\bullet &&& B'\\otimes_1 D'} \n\\end{displaymath}\n\nPassing on to the theory of fibrant double categories, it is the case that in many examples of double categories,\nthere exists a canonical way of turning vertical 1-cells into horizontal 1-cells.\nSuch links have been studied in various works, and the terminology used below can be found in\n\\cite{Adjointfordoublecats,Framedbicats,Thespanconstruction}.\n\n\\begin{defi}\\label{deficompconj}\n Let $\\caa{D}$ be a double category and $f:A\\to B$\na vertical 1-cell. A \\emph{companion} of $f$\nis a horizontal 1-cell$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{\\hat{f}:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}$together with\n2-morphisms\n\\begin{displaymath}\n \\xymatrix\n{A\\ar[r]^-{\\hat{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4>\\;p_1} \\ar[d]_-f & B\\ar[d]^-{\\mathrm{id}_B} \\\\\nB\\ar[r]_-{1_B}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B} \n\\quad\\xymatrix@R=.05in{\\hole \\\\\n\\textrm{and}}\\quad\n \\xymatrix\n{A\\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4>\\;p_2} \\ar[d]_-{\\mathrm{id}_A} & \nA\\ar[d]^-{f} \\\\\nA\\ar[r]_-{\\hat{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}\n\\end{displaymath}\nsuch that $p_1p_2=1_f$ and $p_1\\odot p_2\\cong1_{\\hat{f}}$.\nDually, a \\emph{conjoint} of \n$f$ is a horizontal 1-cell$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{\\check{f}:B\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$together with 2-morphisms\n\\begin{displaymath}\n \\xymatrix\n{B\\ar[r]^-{\\check{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4>\\;q_1} \\ar[d]_-{\\mathrm{id}_B} & A\\ar[d]^-f \\\\\nB\\ar[r]_-{1_B}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B} \\quad\\xymatrix@R=.05in{\\hole \\\\\n\\textrm{and}}\\quad\n \\xymatrix\n{A\\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4>\\;q_2} \\ar[d]_-{f} & \nA\\ar[d]^-{\\mathrm{id}_A} \\\\\nB\\ar[r]_-{\\check{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}\n\\end{displaymath}\nsuch that $q_1q_2=1_f$ and $q_2\\odot q_1\\cong 1_{\\check{f}}$.\n\\end{defi}\nThe ideas which led to the above definitions go\nback to \\cite{Doublegroupoidsandcrossedmodules},\nwhere a \\emph{connection} on a double category\ncorresponds to a strictly functorial choice\nof a companion for each vertical arrow.\n\n\\begin{defi}\\cite[Definition 3.4]{ConstrSymMonBicats}\\label{fibrantdoublecat}\nA \\emph{fibrant double category} is a double category\nfor which every vertical 1-morphism has a companion and a conjoint.\n\\end{defi}\n\nFibrant double categories are also called \\emph{framed bicategories} or equivalently \\emph{proarrow equipments} \\cite{Wood:1982a,Verityequip}.\nThe above definition's equivalence with the following can be found for example at \\cite[Thm.~4.1]{Framedbicats}.\n\n\\begin{defi}\\label{Grothfibrant}\nA fibrant double category is one where the functor\n\\begin{displaymath}\n(\\mathfrak{s},\\mathfrak{t})\\colon\\caa{D}_1\\longrightarrow\\caa{D}_0\\times\\caa{D}_0\n\\end{displaymath}\nmapping each horizontal 1-cell and 2-morphism to the pair of source and target is a fibration, or equivalently an opfibration.\n\\end{defi}\n\nIn this view, the canonical cartesian lifting of some$\\proar{N}{C}{D}$ along\na pair of vertical morphisms $f\\colon A\\to C$, $g\\colon B\\to D$\n\\begin{equation}\\label{cartliftframdebicat}\n\\xymatrix @C=.17in\n{\\check{g}\\odot N\\odot\\hat{f}\\ar[rrr]^-{\\ensuremath{\\mathrm{Cart}}((f,g),N)}\\ar @{.>}[d] &&& N \\ar @{.>}[d] &\\caa{D}_1\\ar[d]^-{(\\mathfrak{s},\\mathfrak{t})} \\\\\n(A,B)\\ar[rrr]_-{(f,g)} &&& (C,D) & \\caa{D}_0\\times\\caa{D}_0}\\quad\\textrm{ is }\\quad\n\\xymatrix @R=.43in\n{A\\ar[d]_-f \\ar[r]^-{\\hat{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\rtwocell<\\omit>{<5>\\;p^f_1} &\nC\\ar[r]^-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar@{=}[d]\\rtwocell<\\omit>{<5>\\;1_N} & D\\ar@{=}[d]\\ar[r]^-{\\check{g}}\n\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\rtwocell<\\omit>{<5>\\;q^g_1} & C\\ar[d]^-g \\\\\nC\\ar[r]_-{1_C}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & C\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & \nD\\ar[r]_-{1_D}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F}\n\\end{equation}\nMany properties for fibrant double categories can be deduced from the companion and conjoint definitions.\nThe following lemma gathers the most useful for us; the explicit proofs can be found in\n\\cite{ConstrSymMonBicats}, or can be easily deduced e.g. via mates and factorization\nthrough lifting \\cref{factor} for \\cref{five}.\n\n\\begin{lem}\\label{compconjprops}\nSuppose $\\caa{D}$ is a fibrant double category.\n\\begin{enumerate}\n \\item Companions and conjoints of a vertical 1-cell are essentially unique (up to unique globular isomorphism).\n \\item\\label{five} For any vertical 1-cells $f\\colon A\\to C$, $g\\colon B\\to D$ and horizontal 1-cells\n $\\proar{M}{A}{B,}\\proar{N}{C}{D,}$ we have bijections between\n \\begin{gather}\\label{matesforcompconj}\n \\mathcal{H}(\\caa{D})(M,\\check{g}\\odot N\\odot\\hat{f})\\cong \\mathcal{H}(\\caa{D})(\\hat{g}\\odot M,N\\odot\\hat{f}) \\cong \\\\\n \\mathcal{H}(\\caa{D})(M\\odot\\check{f},\\check{g}\\odot N)\\cong\\mathcal{H}(\\caa{D})(\\hat{g}\\odot M\\odot\\check{f},N) \\nonumber\n \\end{gather}\n and the 2-morphisms $M\\Rightarrow N$ with source and target $f$ and $g$ \\cref{2morphism}.\n \\item\\label{compositecompconj} The horizontal composites $\\hat{g}\\odot\\hat{f}$ and $\\check{g}\\odot\\check{f}$ are the\n companion and the conjoint of the vertical composite $gf$, for any composable vertical 1-cells.\n \\item The companion and conjoint of the vertical identities are the horizontal identites, $\\widehat{\\mathrm{id}_A}=\\widecheck{\\mathrm{id}_A}=1_A$.\n \\item For any vertical 1-cell $f\\colon A\\to B$, we have an adjunction $\\hat{f}\\dashv\\check{f}$ in the horizontal\n bicategory $\\mathcal{H}(\\caa{D})$.\n \\item If $\\caa{D}$ is also monoidal, $\\hat{f}\\otimes_1\\hat{g}$ and $\\check{f}\\otimes_1\\check{g}$\n are the companion and conjoint of $f\\otimes_0 g$ for any vertical 1-cells $f$, $g$.\n \\end{enumerate}\n\\end{lem}\n\nFor example, $\\mathcal{V}$-$\\caa{P}\\mathbf{rof}$ is a fibrant double category: the companion and conjoint for a $\\mathcal{V}$-functor\n$F\\colon\\mathcal{A}\\to\\mathcal{B}$ are given by the \\emph{representable profunctors}\n\\begin{gather*}\n\\matr{\\hat{F}=F_*}{\\mathcal{A}}{\\mathcal{B}}\\textrm{ by }F_*(B,A)=\\mathcal{B}(B,FA) \\\\\n\\matr{\\check{F}=F^*}{\\mathcal{B}}{\\mathcal{A}}\\textrm{ by }F^*(A,B)=\\mathcal{B}(FA,B)\n\\end{gather*}\nFor $\\caa{S}\\mathbf{pan}(\\mathcal{C})$, the companion and conjoint of a function $f\\colon A\\to B$ are $\\check{f}=(\\mathrm{id}_A,f)$ and\n$\\hat{f}=(f,\\mathrm{id}_B)$, whereas for $\\mathbf{BMod}$ a ring morphism $f\\colon A\\to B$ gives rise to\n$B$ as a left-$A$ right-$B$ bimodule but also as a left-$B$ right-$A$ bimodule via restriction of scalars.\n\nA fundamental property of a fibrant double category with a monoidal structure is that its horizontal bicategory inherits it.\nThis process, studied in detail in \\cite{ConstrSymMonBicats}, allows us to reduce a lengthy and demanding task of verifying\nthe coherence conditions of monoidal structure on a bicategory into a much more concise one, essentially involving a pair \nof ordinary monoidal categories.\n\n\\begin{thm}\\cite[Theorem 5.1]{ConstrSymMonBicats}\\label{monoidalhorizontalbicategory}\nIf $\\caa{D}$ is a fibrant monoidal double category,\nthen $\\mathcal{H}(\\caa{D})$ is a monoidal bicategory. If $\\caa{D}$\nis braided or symmetric, then so is $\\mathcal{H}(\\caa{D})$.\n\\end{thm}\n\nEvidently, the monoidal structure of the bicategory consists of\nthe induced pseudofunctor of bicategories $\\mathcal{H}(\\otimes):\\mathcal{H}(\\caa{D})\\times\\mathcal{H}(\\caa{D})\\to\n\\mathcal{H}(\\caa{D})$ and the monoidal unit $1_I$ of $\\caa{D}_1$, for a $(\\caa{D},\\otimes, I)$ as in\n\\cref{monoidaldoublecategory}.\n\n\n\\subsection{Monads and comonads in double categories}\\label{moncomondouble}\n\n\nSuppose $\\caa{D}$ is a double category. Define the category of \\emph{endomorphisms} $\\caa{D}_1^\\bullet$ to be\nthe (non-full) subcategory of $\\caa{D}_1$ of all horizontal endo-1-cells and 2-morphisms\nwith the same source and target. Explicitly, objects are of the form$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{M:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$and arrows\n\\begin{equation}\\label{endo2morphism}\n\\xymatrix\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4>\\alpha} \\ar[d]_-f & A\\ar[d]^-f \\\\\nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}\n\\end{equation}\ndenoted by $\\alpha_f:M_A\\to N_B$.\nIn \\cite{Monadsindoublecats}, this category\ncoincides with the vertical 1-category of the \ndouble category $\\caa{E}\\mathbf{nd}(\\caa{D})$\nof (horizontal) endomorphisms,\nhorizontal endomorphism maps, vertical endomorphism\nmaps and endomorphism squares\nin $\\caa{D}$.\n\n\\begin{defi}\\label{Monadindoublecat}\nA \\emph{monad} in a double category $\\caa{D}$ is a horizontal endo-1-cell$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{M:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$ \\emph{i.e.}\nan object in $\\caa{D}_1^\\bullet$, equipped with \nglobular 2-morphisms\n\\begin{displaymath}\n\\xymatrix @C=.4in @R=.4in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rrtwocell<\\omit>{<4.5>m} \\ar[d]_-{\\mathrm{id_A}} \n& A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A\\ar[d]^-{\\mathrm{id}_A} \\\\\nA\\ar[rr]_-M\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} && A,}\\qquad\n\\xymatrix @C=.4in @R=.4in\n{A\\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<4.5>\\eta} \\ar[d]_-{\\mathrm{id_A}} \n& A\\ar[d]^-{\\mathrm{id}_A} \\\\\nA\\ar[r]_-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}\n\\end{displaymath}\nsatisfying the usual associativity and unit laws; this is the same as a monad in its horizontal bicategory $\\mathcal{H}(\\caa{D})$\n(\\cref{monadbicat}).\nA \\emph{monad morphism} consists of an arrow $\\alpha_f:M_A\\to N_B$ in $\\caa{D}_1^\\bullet$ which respects multiplication and unit:\n\\begin{equation}\\label{monadhom}\n\\xymatrix@C=.3in @R=.2in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar[d]_-f\n\\rtwocell<\\omit>{<3>\\alpha} & \nA\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar[d]^-f\n\\rtwocell<\\omit>{<3>\\alpha} &\nA\\ar[d]^-f \\\\\nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\rrtwocell<\\omit>{<3>m}\n\\ar@{=}[d] &\nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\n& B \\ar@{=}[d] \\\\\nB\\ar[rr]_-N\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} && B}\n\\xymatrix@R=.2in{\\hole \\\\ =}\n\\xymatrix@C=.3in @R=.2in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\n\\rrtwocell<\\omit>{<3>m}\\ar@{=}[d] & \nA\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n& A\\ar@{=}[d] \\\\\nA\\ar[rr]_-M\\ar@{}[rr]|-{\\scriptstyle{\\bullet}}\\ar[d]_-f\n\\rrtwocell<\\omit>{<4>\\alpha} && A\\ar[d]^-f \\\\\nB\\ar[rr]_-N\\ar@{}[rr]|-{\\scriptstyle{\\bullet}}\n && B,}\n\\qquad\n\\xymatrix@C=.3in @R=.2in\n{A\\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar@{=}[d]\n\\rtwocell<\\omit>{<3>\\eta} & A\\ar@{=}[d] \\\\\nA\\ar[r]_-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar[d]_-f\n\\rtwocell<\\omit>{<3.5>\\alpha} &\nA\\ar[d]^-f \\\\\nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}\n\\xymatrix@R=.2in{\\hole \\\\ =}\n\\xymatrix@C=.3in @R=.2in\n{A\\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar[d]_-f\n\\rtwocell<\\omit>{<3>1_f} & A\\ar[d]^-f \\\\\nB\\ar[r]_-{1_B}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar@{=}[d]\n\\rtwocell<\\omit>{<3.5>\\eta} &\nB\\ar@{=}[d] \\\\\nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B.}\n\\end{equation}\n\\end{defi}\nWe obtain a non-full subcategory of $\\caa{D}_1$, the category $\\mathbf{Mnd}(\\caa{D})$. These definitions can be found in \\cite{Framedbicats}\nunder the names of \\emph{monoids} and \\emph{monoid homomorphisms} for fibrant double categories, as well as in \\cite{Monadsindoublecats}\nas monads and \\emph{vertical} monad maps in a double category $\\caa{D}$. In the latter work, $\\mathbf{Mnd}(\\caa{D})$ is the vertical \ncategory of $\\caa{M}\\mathbf{nd}(\\caa{D})$, a double category of monads, horizontal and vertical monad maps and monad squares.\n\nDually, we have the following definition.\n\n\\begin{defi}\\label{Comonadindoublecat}\nThere is a category $\\mathbf{Cmd}(\\caa{D})$ with objects \\emph{comonads} in $\\caa{D}$, \\emph{i.e.} horizontal \nendo-1-cells$\\SelectTips{eu}{10}\\xymatrix@C=.2in{C:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$equipped with globular 2-morphisms\n\\begin{displaymath}\n\\xymatrix @C=.4in @R=.4in\n{A\\ar[rr]^-C\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} \\ar[d]_-{\\mathrm{id_A}} \n&& A\\ar[d]^-{\\mathrm{id}_A} \\\\\nA\\ar[r]_-C\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rrtwocell<\\omit>{<-4>\\Delta} \n& A\\ar[r]_-C\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A,}\\qquad\n\\xymatrix @C=.4in @R=.4in\n{A\\ar[r]^-C\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar[d]_-{\\mathrm{id_A}} \n& A\\ar[d]^-{\\mathrm{id}_A} \\\\\nA\\ar[r]_-C\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \n\\rtwocell<\\omit>{<-4>\\epsilon} \n& A}\n\\end{displaymath}\nsatisfying the usual coassociativity and counit axioms for a comonad in the horizontal bicategory $\\mathcal{H}(\\caa{D})$\n(\\cref{comonadbicat}). Arrows are \\emph{comonad morphisms}, \\emph{i.e.} $\\alpha_f:C_A\\to D_B$ in $\\caa{D}_1^\\bullet$\nsatisfying dual axioms to \\cref{monadhom}.\n\\end{defi}\n\nObserve that $\\mathbf{Mnd}(\\caa{D}^\\mathrm{op})=\\mathbf{Cmd}(\\caa{D})^\\mathrm{op}$, and that the forgetful functors\n$\\mathbf{Mnd}(\\caa{D}),\\mathbf{Cmd}(\\caa{D})\\to\\caa{D}_1^\\bullet\\to\\caa{D}_1$ reflect isomorphisms.\nMoreover, there are also forgetful functors to $\\caa{D}_0$, mapping a horizontal endo-1-cell$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{M:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$to its source and target $A$, and a 2-morphism $\\alpha_f\\colon M_A\\to N_B$\nto its source and target $f\\colon A\\to B$; these are studied in detail below. \n\nIn \\cite[\\S 8]{PhDChristina}, the above structures were called (co)monoids;\nthe current terminology is preferred due to the fact that it doesn't require any monoidal structure on the\ndouble category. A monoid in a monoidal double category should correspond to a lax double functor\n$\\mathbf{1}\\to\\caa{D}$, which comes down to a monoid in the vertical category $\\caa{D}_0$ as the source and target of a monoid\nin the horizontal category $\\caa{D}_1$.\n\nWe now consider how different notions of double functors relate to the \ncategories of endomorphisms, monads and comonads. The following can be deduced from the definition of a double functor \\cref{F1mapping}\nin a straightforward way.\n\n\\begin{cor}\\label{F1bullet}\nSuppose that $F\\colon\\caa{D}\\to\\caa{E}$ is a lax\/colax\/pseudo double functor.\nThen $F_1$ naturally induces an ordinary functor $F_1^\\bullet\\colon\\caa{D}_1^\\bullet\\to\\caa{E}_1^\\bullet$.\n\\end{cor}\n\nFor monads and comonads, the following resembles to standard properties of monoidal functors,\nsee \\cref{Monoidalcats}, which is also part of \\cite[11.11]{Framedbicats}\n\\begin{prop}\\label{MonFdouble}\nAny lax double functor $F=(F_0,F_1):\\caa{D}\\to\\caa{E}$ induces an ordinary functor\n\\begin{displaymath}\n \\ensuremath{\\mathbf{Mon}} F:\\mathbf{Mnd}(\\caa{D})\\to\\mathbf{Mnd}(\\caa{E})\n\\end{displaymath}\nbetween their categories of monads, by restricting \n$F_1$ to $\\mathbf{Mnd}(\\caa{D})$. Dually, any colax double functor induces\na functor between the categories of comonoids,\n\\begin{displaymath}\n \\ensuremath{\\mathbf{Comon}} F:\\mathbf{Cmd}(\\caa{D})\\to\\mathbf{Cmd}(\\caa{E}).\n\\end{displaymath}\n\\end{prop}\n\n\\begin{proof}\nA monad$\\SelectTips{eu}{10}\\xymatrix@C=.2in{M:A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & A}$with $m:M\\odot M\\to M$\nand $\\eta:1_M\\to M$ is mapped to$\\SelectTips{eu}{10}\\xymatrix@C=.2in{F_1M:F_0A\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F_0A}$with \nmultiplication and unit\n\\begin{displaymath}\n \\xymatrix\n{F_0A\\ar[r]^-{F_1M}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar@{=}[d]\\rrtwocell<\\omit>{<5>\\;F_\\odot}\n& F_0A\\ar[r]^-{F_1M}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F_0A\\ar@{=}[d] \\\\\nF_0A\\ar[rr]_-{F_1(M\\odot M)}\\ar@{}[rr]|-{\\scriptstyle{\\bullet}}\\ar@{=}[d]\\rrtwocell<\\omit>{<5>\\quad F_1m}\n&& F_0A\\ar@{=}[d] \\\\\nF_0A\\ar[rr]_-{F_1 M}\\ar@{}[rr]|-{\\scriptstyle{\\bullet}} && F_0A}\\quad\n\\xymatrix\n{\\hole \\\\ \\mathrm{and}}\n\\quad\n\\xymatrix\n{F_0A\\ar[r]^-{F_1(1_A)}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar@{=}[d]\\rtwocell<\\omit>{<5>\\;F_U} &\nF_0A\\ar@{=}[d] \\\\\nF_0A\\ar[r]_-{1_{F_0A}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar@{=}[d]\\rtwocell<\\omit>{<5>\\quad F_1\\eta} &\nF_0A\\ar@{=}[d] \\\\\nF_0A\\ar[r]_-{F_1M}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F_0A}\n\\end{displaymath}\nand the axioms follow from the axioms for $F_{\\odot}$ and \n$F_U$. A monad map $\\alpha_f:M_A\\to N_B$ is mapped to $F_1^\\bullet\\alpha$,\n\\begin{displaymath}\n \\xymatrix\n{F_0A\\ar[r]^-{F_1 M}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\\ar[d]_-{F_0f}\\rtwocell<\\omit>{<4>\\;\\; F_1\\alpha} &\nF_0A\\ar[d]^-{F_0f} \\\\\nF_0B\\ar[r]_-{F_1 N}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & F_0B}\n\\end{displaymath}\nwhich respects multiplications and units by naturality \nof $F_{\\odot}$\nand $F_U$.\nSimilarly for the induced functor between comonads.\n\\end{proof}\n\n\\begin{rmk}\\label{doublemonadsaremonoids}\nRecall by \\cref{monadsaremonoids} that monads in a bicategory are mo\\-no\\-ids\nin a monoidal endo-hom-category with horizontal composition. This point of view will be useful later,\nhence we should equivalently view double categorical monads as $M_A\\in\\ensuremath{\\mathbf{Mon}}(\\ca{H}(\\caa{D})(A,A),\\odot,1_A)$\nand comonads as $C_A\\in\\ensuremath{\\mathbf{Comon}}(\\ca{H}(\\caa{D})(A,A),\\odot,1_A)$. (Co)monad morphisms cannot be expressed\nas arrows therein, since the respective 2-morphisms are more general than just globular ones;\nthis is exactly why categories of double (co)monads capture further desired structure.\n\nSince (co)lax double functors induce (co)lax functors between the horizontal bicategories,\non the level of objects \\cref{MonFdouble} coincides with \\cref{laxfunctorspreservemonads}. \n\\end{rmk}\n\nAs an application of the above, consider a monoidal double\ncategory $(\\caa{D},\\otimes,\\mathbf{I})$ as in \\cref{monoidaldoublecategory}.\nThe pseudo double functor $\\otimes\\colon\\caa{D}\\times\\caa{D}\\to\\caa{D}$\ninduces, by \\cref{F1bullet} and \\cref{MonFdouble}, ordinary functors \n\\begin{gather*}\n\\otimes_1^\\bullet\\colon\\caa{D}_1^\\bullet\\times\\caa{D}_1^\\bullet\\to\\caa{D}_1^\\bullet \\\\\n\\ensuremath{\\mathbf{Mon}}\\otimes\\colon\\mathbf{Mnd}(\\caa{D})\\times\\mathbf{Mnd}(\\caa{D})\\to\\mathbf{Mnd}(\\caa{D}) \\\\\n\\ensuremath{\\mathbf{Comon}}\\otimes\\colon\\mathbf{Cmd}(\\caa{D})\\times\\mathbf{Cmd}(\\caa{D})\\to\\mathbf{Cmd}(\\caa{D})\n\\end{gather*}\ngiven by $\\otimes_1$ \\cref{D1monoidal} restricted to the specific subcategories of $\\caa{D}_1$.\nAlong with the monoidal unit $\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{1_I:I\\ar[r]\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & I}$, and since the forgetful functors to the monoidal $\\caa{D}_1$\nare conservative, we obtain the following.\n\\begin{prop}\\label{DendoMonDComonDmonoidal}\nIf $\\caa{D}$ is a monoidal double category, then the categories $\\caa{D}_1^\\bullet$,\n$\\mathbf{Mnd}(\\caa{D})$ and $\\mathbf{Cmd}(\\caa{D})$ inherit a monoidal structure from $\\caa{D}_1$.\nWhen $\\caa{D}$ is braided or symmetric, then so are the categories of endomorphisms, monads and comonads.\n\\end{prop}\n\nWe now further study these categories in the fibrant setting, \\cref{fibrantdoublecat}. The following\nis proved in detail, to serve as reference for future constructions.\n\n\\begin{prop}\\label{D_1^.bifibred}\n If $\\caa{D}$ is a fibrant double category, $\\caa{D}_1^\\bullet$ is bifibred over $\\caa{D}_0$.\n\\end{prop}\n\n\\begin{proof}\nDue to the correspondence of \\cref{Grothendieckcorrespondence}, it is enough to define\npseudofunctors from $\\caa{D}_0^{(\\mathrm{op})}$ which give rise to a fibration and opfibration\nwith total categories isomorphic to $\\caa{D}_1^\\bullet$ via the Grothendieck\nconstruction; define\n\\begin{equation}\\label{pseudofunctorsdoublebifibration}\n \\mathscr{M}:\n\\xymatrix @R=.02in\n{\\caa{D}_0^\\mathrm{op}\\ar[r] & \\mathbf{Cat}, \\\\\nA\\ar @{|.>}[r]\n\\ar [dd]_-f & \\mathcal{H}(\\caa{D})(A,A) \\\\\n\\hole \\\\\nB\\ar @{|.>}[r] &\n\\mathcal{H}(\\caa{D})(B,B)\\ar[uu]_-{(\\check{f}\\odot\\text{-}\\odot\\hat{f})}}\n\\qquad\n\\mathscr{F}:\n\\xymatrix @R=.02in\n{\\caa{D}_0\\ar[r] & \\mathbf{Cat} \\\\\nA\\ar @{|.>}[r]\n\\ar [dd]_-f & \\mathcal{H}(\\caa{D})(A,A)\n\\ar[dd]^-{(\\hat{f}\\odot\\text{-}\\odot\\check{f})} \\\\\n\\hole \\\\\nB\\ar @{|.>}[r] &\n\\mathcal{H}(\\caa{D})(B,B).}\n\\end{equation}\nIn more detail, the first one is given by the mapping\non objects and arrows\n\\begin{displaymath}\n\\SelectTips{eu}{10}\n\\xymatrix{(B \\ar @\/^2ex\/[r]|-{\\scriptstyle{\\bullet}}^-H\n\\ar@\/_2ex\/[r]|-{\\scriptstyle{\\bullet}}_-{H'}\n\\rtwocell<\\omit>{\\sigma} & B)\n\\ar @{|.>}[r] & (A\\ar[r]|-{\\scriptstyle{\\bullet}}\n^-{\\hat{f}} & B \\ar @\/^2ex\/[r]|-{\\scriptstyle{\\bullet}}^-H\n\\ar@\/_2ex\/[r]|-{\\scriptstyle{\\bullet}}_-{H'}\n\\rtwocell<\\omit>{\\sigma} & B\n\\ar[r]|-{\\scriptstyle{\\bullet}}^-{\\check{f}} & A)}\n\\end{displaymath}\npre-composing with the companion and post-composing with the conjoint\nof the given vertical 1-cell.\nFor these mappings to constitute a pseu\\-do\\-fu\\-nctor $\\mathscr{M}$,\nwe need certain natural isomorphisms\nsatisfying coherence conditions as in \\cref{laxfunctor}.\nFor every triple of 0-cells $A,B,C$, there is a natural isomorphism\n$\\delta$ with components\n\\begin{displaymath}\n\\xymatrix @R=.04in\n{& \\mathcal{H}(\\caa{D})(B,B)\\ar@\/^\/[dr]^-{\\mathscr{M}f} & \\\\\n\\mathcal{H}(\\caa{D})(C,C)\\ar@\/^\/[ur]^-{\\mathscr{M}g}\n\\ar@\/_3ex\/[rr]_-{\\mathscr{M}(g\\circ f)}\n\\rrtwocell<\\omit>{\\quad\\delta^{g,f}} && \n\\mathcal{H}(\\caa{D})(A,A)}\n\\end{displaymath}\nfor any $f:A\\to B$ and $g:B\\to C$, satisfying the commutativity\nof \\cref{laxcond1}. Explicitely, each $\\delta^{g,f}$\nhas components, for each horizontal 1-cell$\\SelectTips{eu}{10}\n\\xymatrix@C=.2in{J:C\\ar[r]|-{\\scriptstyle\\bullet} & C,}$\n\\begin{equation}\\label{Mdelta}\n\\delta^{g,f}_J:(\\mathscr{M}f\\circ\\mathscr{M}g)J\n\\xrightarrow{\\;\\sim\\;}\\mathscr{M}(g\\circ f)J=\n\\widecheck{f}\\odot\\widecheck{g}\\odot J\\odot\\widehat{g}\\odot\\widehat{f}\\xrightarrow{\\;\\sim\\;}\n\\widecheck{gf}\\odot J\\odot\\widehat{gf}\n\\end{equation}\nin $\\mathcal{H}(\\caa{D})(A,A)$, due to \\cref{compconjprops}.\nMoreover, for any 0-cell $A$ there is a natural isomorphism\n$\\gamma$ with components\n\\begin{displaymath}\n\\xymatrix @C=.5in{\\mathcal{H}(\\caa{D})(A,A)\n\\rrtwocell<5>^{\\mathbf{1}_{\\mathcal{H}(\\caa{D})(A,A)}}\n_{\\mathscr{M}(\\mathrm{id}_A)}\n{\\quad\\gamma^A} && \\mathcal{H}(\\caa{D})(A,A)}\n\\end{displaymath}\nwith components invertible arrows in $\\mathcal{H}(\\caa{D})(A,A)$ \n\\begin{equation}\\label{Mgamma}\n\\gamma^X_G:G\\xrightarrow{\\;\\sim\\;}\\mathscr{M}(\\mathrm{id}_A)G=\\widecheck{\\mathrm{id}_A}\\odot\\widehat{\\mathrm{id}_A}\n\\end{equation}\nagain by \\cref{compconjprops}; it can be verified that the axioms \\cref{laxcond2} are satisfied.\n\nThe Grothendieck category $\\mathfrak{G}\\mathscr{M}$ has as objects pairs $(G,A)$ where $A$ is a 0-cell and $G$ is in $\\mathcal{H}(\\caa{D})(A,A)$, and as arrows\n$(\\phi,f):(G,A)\\to(H,B)$ pairs\n\\begin{displaymath}\n\\begin{cases} \nG\\xrightarrow{\\phi}\\check{f}\\odot H\\odot \\hat{f} \n&\\text{in }\\mathcal{H}(\\caa{D})(A,A)\\\\\nA\\xrightarrow{f}B &\\text{in }\\caa{D}_0.\n\\end{cases}\n\\end{displaymath}\nIt is not hard to verify its isomorphism with $\\caa{D}_1^\\bullet$: objects are the same (horizontal endo-1-cells),\nand there is a bijective correspondence between the morphisms, essentially given by \\cref{cartliftframdebicat}.\nGiven an arrow $\\alpha_f$ in $\\caa{D}_1^\\bullet$, we obtain a composite 2-cell\n\\begin{equation}\\label{Grothiso}\n\\xymatrix @R=.25in\n{A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\n\\rtwocell<\\omit>{<3.5>\\alpha} \\ar[d]_-f & A\\ar[d]^-f \\\\\nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}\n\\quad\\xymatrix@R=.1in\n{\\hole \\\\ \\mapsto }\\quad\n \\xymatrix @C=.5in @R=.25in\n{A\\ar[d]_-{\\mathrm{id}_A} \\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\n\\rtwocell<\\omit>{<3.5>\\;p_2} &\n A\\ar[r]^-M\\ar@{}[r]|-{\\scriptstyle{\\bullet}} \\ar[d]^-f \n\\rtwocell<\\omit>{<3.5>\\alpha} & \nA\\ar[d]_-f\\ar[r]^-{1_A}\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\n\\rtwocell<\\omit>{<3.5>\\;q_2} & \nA\\ar[d]^{\\mathrm{id}_A} \\\\\nA\\ar[r]_-{\\hat{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & \nB\\ar[r]_-N\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & \nB\\ar[r]_-{\\check{f}}\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}\n\\end{equation}\nwhich is a morphism in $\\mathfrak{G}\\mathscr{M}$, where $p_2$ and \n$q_2$ come with the companion and conjoint as in \\cref{deficompconj}.\nThis assignment is an isomorphism, with inverse mapping $\\beta\\mapsto\n(q_1\\odot 1_N\\odot p_1)\\beta$ for\nsome $\\beta:M\\Rightarrow\\check{f}\\circ N\\circ\\hat{f}$\nin $\\mathcal{H}(\\caa{D})(A,A)$. Thus $\\mathscr{M}$ gives rise to a fibration\n$\\mathfrak{G}\\mathscr{M}\\to\\caa{D}_0$ which is isomorphic to $\\caa{D}_1^\\bullet\\to\\caa{D}_0$ \nmapping $G_X$ to $X$ and $\\alpha_f$ to $f$:\n\\begin{displaymath}\n\\xymatrix @C=.4in @R=.3in\n{\\mathfrak{G}\\mathscr{M}\\ar[rr]^-{\\cong}\n\\ar[dr] && \n\\caa{D}_1^\\bullet\\ar[dl] \\\\\n& \\caa{D}_0 &}\n\\end{displaymath}\n\nIn a very similar way, it can be checked that $\\mathscr{F}$ from \\cref{pseudofunctorsdoublebifibration}\nis a pseudofunctor, using again standard properties of companions and conjoints.\nTherefore, $\\mathfrak{G}\\mathscr{F}\\cong\\caa{D}_1^\\bullet\\to\\caa{D}_0$ is an opfibration. \n\\end{proof}\n\nNotice that $\\caa{D}_1^\\bullet$ being a bifibration over $\\caa{D}_0$ could be deduced from the fibration part combined\nwith \\cref{rmkforadjointintexingbifr}, since we have an adjunction $(\\check{f}\\odot\\text{-}\\odot\\hat{f})\\vdash\n(\\hat{f}\\odot\\text{-}\\odot\\check{f})$ for all $f$ (\\cref{compconjprops}).\n\nAthough the above result was independently established as a generalization of our case study of (co)categories, as will be clear later,\nthe fibration was also shown in \\cite[Proposition 3.3]{Monadsindoublecats}, by\nrestricting the cartesian liftings \\cref{cartliftframdebicat} of the fibration $(\\mathfrak{s},\\mathfrak{t})\\colon\\caa{D}_1\\to\\caa{D}_0$\nto the category of endomorphisms, i.e.\n\\begin{gather}\\label{cocartliftComonD}\n\\ensuremath{\\mathrm{Cart}}(f,N)=p_1\\odot 1_N\\odot q_1\\colon\\check{f}\\odot N\\odot\\hat{f}\\Rightarrow N \\\\\n\\ensuremath{\\mathrm{Cocart}}(f,N)=p_2\\odot 1_N\\odot q_2:N\\Rightarrow\\hat{f}\\odot N\\odot \\check{f}\\nonumber\n\\end{gather}\nStill, the pseudofunctor formulation of the above proof gives clearer perspectives for the objects involved in the applications.\n\nWe can now adjust the above constructions to obtain similar results for categories of monads and comonads in fibrant double categories.\nThe following lemma ensures that is feasible. \n\n\\begin{lem}\\label{pseudofunctorsrestrict}\nFor any vertical 1-cell $f\\colon A\\to B$ in a fibrant double category\n$\\caa{D}$, the functors\n\\begin{gather*}\n \\check{f}\\odot-\\odot\\hat{f}\\colon\\ca{H}(\\caa{D})(B,B)\\longrightarrow\\ca{H}(\\caa{D})(A,A) \\\\\n \\hat{f}\\odot-\\odot\\check{f}\\colon\\ca{H}(\\caa{D})(A,A)\\longrightarrow\\ca{H}(\\caa{D})(B,B)\n\\end{gather*}\nare lax and colax monoidal respectively, for the monoidal endo-hom-categories of the bicategory $\\ca{H}(\\caa{D})$ with horizontal composition.\n\\end{lem}\n\n\\begin{proof}\nFor horizontal endo-1-cells$\\SelectTips{eu}{10}\\xymatrix @C=.2in{M,N:B\\ar[r]|-{\\scriptstyle\\bullet} & B,}$the lax\nmonoidal structure map \n\\begin{displaymath}\n\\phi_{M,N}: \\check{f}\\odot M\\odot\\hat{f}\\odot\\check{f}\\odot N\\odot\\hat{f}\n\\Rightarrow\\check{f}\\odot M\\odot N\\odot\\hat{f}\n\\end{displaymath}\nis a natural transformation with components the composite 2-cells\n\\begin{displaymath}\n \\xymatrix @R=.1in \n{&&& A\\ar@\/^\/[dr]|-{\\scriptstyle\\bullet}^-{\\hat{f}} &&& \\\\\nA\\ar[r]|-{\\scriptstyle\\bullet}^-{\\hat{f}} & B\\ar[r]|-{\\scriptstyle\\bullet}^-{N}\n& B\\ar@\/^\/[ur]|-{\\scriptstyle\\bullet}^-{\\check{f}}\\ar[rr]|-{\\scriptstyle\\bullet}_-{1_B} \n\\rrtwocell<\\omit>{<-2>\\dot{\\varepsilon}}\\ar@\/_5ex\/[rrr]|-{\\scriptstyle\\bullet}_-M \n& \\rtwocell<\\omit>{<2>\\cong} & B\\ar[r]|-{\\scriptstyle\\bullet}^-M &\nB\\ar[r]|-{\\scriptstyle\\bullet}^-{\\check{f}} &A}\n\\end{displaymath}\nwhere $\\dot{\\varepsilon}$ is the counit of the adjunction $\\check{f}\\dashv\\hat{f}$.\nSimilarly, $\\phi_0$ is given by\n\\begin{displaymath}\n\\xymatrix @R=.1in \n{A\\ar@\/^5ex\/[rrr]|-{\\scriptstyle\\bullet}^-{1_A}\\ar[r]|-{\\scriptstyle\\bullet}_-{\\hat{f}} &\nB\\ar[r]|-{\\scriptstyle\\bullet}_-{1_B}\\rtwocell<\\omit>{<-3>\\dot{\\eta}} & B\\ar[r]|-{\\scriptstyle\\bullet}_-{\\check{f}} & A}\n\\end{displaymath}\nwhere $\\dot{\\eta}$ is the unit of $\\check{f}\\dashv\\hat{f}$. These structure maps satisfy the usual conditions,\nhence $\\check{f}\\odot-\\odot\\hat{f}$ is a lax monoidal functor; dually, the colax monoidal structure of\n$\\hat{f}\\odot-\\odot\\check{f}\\colon\\ca{H}(\\caa{D})(A,A)\\to\\ca{H}(\\caa{D})(B,B)$ can be identified. \n\\end{proof}\n\nDue to this lax and colax monoidal structure, the induced monoid structure of $(\\check{f}\\odot N\\odot\\hat{f})$\nfor a monoid $(\\proar{N}{B}{B},\\mu,\\eta)$ and the induced comonoid structure of $(\\hat{f}\\odot C\\odot\\check{f})$\nfor $(\\proar{C}{A}{A},\\Delta,\\epsilon)$ are\n\\begin{equation}\\label{compositemonoid}\n\\xymatrix @C=.25in @R=.05in\n{&&& A\\ar @\/^\/[dr]|-{\\scriptstyle\\bullet}^-{\\hat{f}} &&&\\\\\n&& B\\ar @\/^\/[ur]|-{\\scriptstyle\\bullet}^-{\\check{f}} \n\\ar @\/_3ex\/[rr]|-{\\scriptstyle\\bullet}_-{1_B}\n\\rrtwocell<\\omit>{\\dot{\\varepsilon}} \n&& B\\ar @\/^\/[dr]|-{\\scriptstyle\\bullet}^-N && \\\\\nA\\ar[r]|-{\\scriptstyle\\bullet}^-{\\hat{f}}\n&B\\ar @\/^\/[ur]|-{\\scriptstyle\\bullet}^-N\n\\ar @\/_6ex\/[rrrr]|-{\\scriptstyle\\bullet}_-N\n& \\rrtwocell<\\omit>{<3>\\;M} &&&\nB\\ar[r]|-{\\scriptstyle\\bullet}^-{\\check{f}} & A}\n\\xymatrix @C=.3in @R=.05in\n{\\hole \\\\\nA\\ar @\/^3ex\/[rrr]|-{\\scriptstyle\\bullet}^-{1_A} \n\\ar[dr]|-{\\scriptstyle\\bullet}_-{\\hat{f}} &&& A \\\\\n& B\\ar @\/^2ex\/[r]|-{\\scriptstyle\\bullet}^-{1_B}\n\\ar @\/_2ex\/[r]|-{\\scriptstyle\\bullet}_-N \n\\rtwocell<\\omit>{\\eta} \n\\rtwocell<\\omit>{<-5>\\dot{\\eta}} &\nB,\\ar[ur]|-{\\scriptstyle\\bullet}_-{\\check{f}} &}\n\\end{equation}\n\n\\begin{equation}\\label{compositecomonoid}\n\\xymatrix @C=.25in @R=.05in\n{B \\ar[r]|-{\\scriptstyle\\bullet}^-{\\check{f}}\n& A\\ar @\/^6ex\/[rrrr]|-{\\scriptstyle\\bullet}^-C\n\\ar @\/_\/[dr]|-{\\scriptstyle\\bullet}^-C\n& \\rrtwocell<\\omit>{<-3>\\Delta}\n&&&\nA\\ar[r]|-{\\scriptstyle\\bullet}^-{\\hat{f}} & B \\\\\n&& A\\ar @\/_\/[dr]|-{\\scriptstyle\\bullet}_-{\\hat{f}}\n\\ar @\/^3ex\/[rr]|-{\\scriptstyle\\bullet}^-{1_A}\n\\rrtwocell<\\omit>{\\dot{\\eta}} &&\nA\\ar @\/_\/[ur]|-{\\scriptstyle\\bullet}^-C && \\\\\n&&&\nB\\ar @\/_\/[ur]|-{\\scriptstyle\\bullet}_-{\\check{f}} &&&}\n\\xymatrix @R=.05in @C=.3in\n{& A\\ar @\/_2ex\/[r]|-{\\scriptstyle\\bullet}_-{1_A}\n\\ar @\/^2ex\/[r]|-{\\scriptstyle\\bullet}^-C \n\\rtwocell<\\omit>{\\epsilon} \n\\rtwocell<\\omit>{<5.3>\\dot{\\varepsilon}} &\nA\\ar[dr]|-{\\scriptstyle\\bullet}^-{\\hat{f}} & \\\\\nB\\ar @\/_3ex\/[rrr]|-{\\scriptstyle\\bullet}_-{1_B} \n\\ar[ur]|-{\\scriptstyle\\bullet}^-{\\check{f}} &&& B}\n\\end{equation}\nwhere $\\dot{\\eta},\\dot{\\varepsilon}$ are the unit and counit of $\\check{f}\\dashv\\hat{f}$.\n\nThe above lemma provides a different, again independent, approach\nto the monad fibration proof of \\cite[Proposition 3.3]{Monadsindoublecats}.\n\n\\begin{prop}\\label{MonComonfibred}\nIf $\\caa{D}$ is a fibrant double category, $\\mathbf{Mnd}(\\caa{D})$ is fibred over $\\caa{D}_0$ and $\\mathbf{Cmd}(\\caa{D})$ is opfibred over $\\caa{D}_0$.\n\\end{prop}\n\n\\begin{proof}\nWe will address the opfibration part; the fibration is established similarly.\nOnce again, we will construct a pseudofunctor $\\mathscr{K}\\colon\\caa{D}_0\\to\\mathbf{Cat}$\nfor which the Grothendieck construction gives a total category\nisomorphic to $\\mathbf{Cmd}(\\caa{D})$, along with the evident forgetful functor to\n$\\caa{D}_0$. It resembles $\\mathscr{F}$ from \\cref{pseudofunctorsdoublebifibration},\nbut with fibre categories capturing the desired comonad structure.\n\nAn object $A$ is mapped to the category $\\ensuremath{\\mathbf{Comon}}(\\ca{H}(\\caa{D})(A,A),\\odot,1_A)$ where double categorical monads with source and target $A$ live\n(\\cref{doublemonadsaremonoids}). A vertical $1$-cell $f\\colon A\\to B$ is mapped to the functor\n\\begin{displaymath}\n \\mathscr{K}f:=\\hat{f}\\odot-\\odot\\check{f}\\colon\\ensuremath{\\mathbf{Comon}}(\\ca{H}(\\caa{D})(A,A))\\to\\ensuremath{\\mathbf{Comon}}(\\ca{H}(\\caa{D})(B,B))\n\\end{displaymath}\nwhich is precisely the induced $\\ensuremath{\\mathbf{Comon}}(\\mathscr{F}f)$ by \\cref{pseudofunctorsrestrict}.\nThe fact that these data form a pseudofunctor follows in a straightforward way from $\\mathscr{F}$ being a pseudofunctor; the natural isomorphisms\n$\\delta$ and $\\gamma$ are given in a dual way to \\cref{Mdelta,Mgamma}\nusing \\cref{compconjprops}.\n\nThe induced Grothendieck category $\\mathfrak{G}\\mathscr{K}$ has as objects pairs\n$(C,A)$ where $C\\in\\ensuremath{\\mathbf{Comon}}(\\ca{H}(\\caa{D})(A,A))$ for a $0$-cell $A$, and as arrows $(C,A)\\to(D,B)$ pairs\n\\begin{displaymath}\n \\begin{cases} \n\\hat{f}\\odot C\\odot \\check{f}\\xrightarrow{\\psi}D \n&\\text{in }\\ensuremath{\\mathbf{Comon}}(\\ca{H}(\\caa{D})(B,B))\\\\\nA\\xrightarrow{f}B &\\text{in }\\caa{D}_0.\n\\end{cases}\n\\end{displaymath}\nThis category is isomorphic to $\\mathbf{Cmd}(\\caa{D})$ since they have the same\nobjects, and there is a bijection between morphisms dually to \\cref{Grothiso}\n\\begin{displaymath}\n\\xymatrix @R=.25in\n{A\\ar[r]^-C\\ar@{}[r]|-{\\scriptstyle{\\bullet}}\n\\rtwocell<\\omit>{<3.5>\\alpha} \\ar[d]_-f & A\\ar[d]^-f \\\\\nB\\ar[r]_-D\\ar@{}[r]|-{\\scriptstyle{\\bullet}} & B}\n\\quad\\xymatrix@R=.1in\n{\\hole \\\\ \\mapsto }\\quad\n \\xymatrix @C=.5in @R=.25in\n{B\\ar@{=}[d] \\ar[r]^-{\\check{f}}|-{\\scriptstyle{\\bullet}} \\rtwocell<\\omit>{<3.5>\\;q_1} &\n A\\ar[r]^-C|-{\\scriptstyle{\\bullet}} \\ar[d]^-f \\rtwocell<\\omit>{<3.5>\\alpha} & \nA\\ar[d]_-f\\ar[r]^-{\\hat{f}}|-{\\scriptstyle{\\bullet}}\\rtwocell<\\omit>{<3.5>\\;p_1} & B\\ar@{=}[d] \\\\\nB\\ar[r]_-{1_B}|-{\\scriptstyle{\\bullet}} & B\\ar[r]_-D|-{\\scriptstyle{\\bullet}} & \nB\\ar[r]_-{1_B}|-{\\scriptstyle{\\bullet}} & B} \n\\end{displaymath}\nwhere $q_1,p_2$ are as in \\cref{deficompconj}; checking that $p_1\\odot\\alpha\\odot q_1$\nis a comonoid morphism follows from their properties.\n\\end{proof}\n\nFinally, as the following result shows,\nthese fibrations and opfibrations have a monoidal structure in the sense of \\cref{monoidalfibration},\nwhen $\\caa{D}$ is moreover monoidal.\n\n\\begin{prop}\\label{monadscomonadsmonoidalfibr}\nSuppose that $\\caa{D}$ is a fibrant monoidal double category. The bifibration $T\\colon\\caa{D}_1^\\bullet\\to\\caa{D}_0$\nas well as the fibration $S\\colon\\mathbf{Mnd}(\\caa{D})\\to\\caa{D}_0$ and opfibration $W\\colon\\mathbf{Cmd}(\\caa{D})\\to\\caa{D}_0$ are monoidal.\n\\end{prop}\n\n\\begin{proof}\nBy \\cref{DendoMonDComonDmonoidal} and \\cref{monoidaldoublecategory} of a monoidal double category, all categories\ninvolved are monoidal. Moreover, for horizontal endo-1-cells$\\proar{M}{A}{A}$and$\\proar{N}{B}{B,}$\n\\begin{displaymath}\nT(M\\otimes_1 N)=A\\otimes_0 B=T(M)\\otimes_1T(N)\n\\end{displaymath}\nand similarly for $P$ and $W$,\nby the mapping of $\\otimes_1$ \\cref{D1monoidal} whose restriction on $\\caa{D}_1^\\bullet,\\mathbf{Mnd}(\\caa{D}),\\mathbf{Cmd}(\\caa{D})$ is their tensor product.\n\nFinally, $\\otimes_1^\\bullet\\colon\\caa{D}_1^\\bullet\\times\\caa{D}_1^\\bullet\\to\\caa{D}_1^\\bullet$ preserves cartesian arrows:\na pair of cartesian liftings $\\ensuremath{\\mathrm{Cart}}(f,M)$ and $\\ensuremath{\\mathrm{Cart}}(g,N)$ as in \\cref{cocartliftComonD} is mapped to the top arrow\n\\begin{displaymath}\n\\xymatrix @C=.6in @R=.3in\n{(\\hat{f}\\odot M\\odot\\check{f})\\otimes_1(\\hat{g}\\odot N\\odot\\check{g})\\ar[rr]^{\\qquad\\quad\\ensuremath{\\mathrm{Cart}}(f,M)\\otimes_1\\ensuremath{\\mathrm{Cart}}(g,N)}\n\\ar @{-->}[d]_-{\\cong} && M\\otimes_1N\\ar @{.>}[dd] &\\\\\n\\widehat{(f\\otimes_0 g)}\\odot(M\\otimes_1 N)\\odot\\widecheck{(f\\otimes_0 g)}\\ar[urr]_-{\\quad\\ensuremath{\\mathrm{Cart}}(f\\otimes_0g,M\\otimes_1 N)}\\ar @{.>}[d]\n&&& \\textrm{in }\\caa{D}_1^\\bullet \\\\\nA\\otimes_0C\\ar[rr]_-{f\\otimes_0g} && B\\otimes_0C & \\textrm{in }\\caa{D}_0}\n\\end{displaymath}\nwhere the left side isomorphism is obtained by \\cref{monoidaldoubleiso} and \\cref{compconjprops},\n\\begin{gather*}\n \\left((\\hat{f}\\odot M)\\odot\\check{f}\\right)\\otimes_1\\Big((\\hat{g}\\odot N)\\odot\\check{g}\\Big)\\cong\n \\left((\\hat{f}\\odot M)\\otimes_1(\\hat{g}\\odot N)\\right)\\odot(\\check{f}\\otimes_1\\check{g}) \\\\\n \\cong (\\hat{f}\\otimes_1\\hat{g})\\odot(M\\otimes_1 N)\\odot(\\check{f}\\otimes_1\\check{g})\n\\end{gather*}\nThis vertical isomorphism can be shown to make the triangle commute.\nThe proof is thus complete, since this vertical isomorphism is reflected to monads and a dual cocartesian lifting\ntriangle to comonads.\n\\end{proof}\n\n\n\\subsection{Locally closed monoidal double categories}\\label{locallyclosedmonoidaldoublecats}\n\nWhen $\\caa{D}$ is a monoidal double category as in \\cref{monoidaldoublecategory},\nboth vertical and horizontal categories are endowed with a monoidal structure, $(\\caa{D}_0,\\otimes_0,I)$ and $(\\caa{D}_1,\\otimes_1,1_I)$.\nNaturally, one could expect that the appropriate notion of a \\emph{monoidal closed}\ndouble category would result in a similar `local' closed structure for the two categories $\\caa{D}_0$ and $\\caa{D}_1$.\nFor the following existing definition though, this does not seem to be the case.\n\n\\begin{defi}\\cite[\\S 5]{Adjointfordoublecats}\nA \\emph{(weakly) monoidal closed} pseudo double category $\\caa{D}$ is a monoidal\ndouble category such that each pseudo double functor $(\\text{-}\\otimes D):\\caa{D}\\to\\caa{D}$\nhas a lax right adjoint.\n\\end{defi}\n\nThis definition uses \\emph{lax adjunctions} between pseudo double categories, as described in \\cite[3.2]{Adjointfordoublecats};\ndouble adjunctions are also studied in \\cite{Doubleadjunctionsandfreemonads}. Since these do not end up being relevant\nto the current work, we omit their details and simply discuss what they mean in this particular context.\n\nThe lax double functor $\\text{-}\\otimes D$ consists of the ordinary functors\n$(\\text{-}\\otimes_0D\\colon\\caa{D}_0\\to\\caa{D}_0,\\text{-}\\otimes_11_D\\colon\\caa{D}_1\\to\\caa{D}_1)$.\nThe existence of a lax right double adjoint, call it $\\ensuremath{\\mathrm{Hom}}^\\caa{D}(D,-)$,\namounts in particular to two ordinary adjunctions\n\\begin{displaymath}\n\\xymatrix @C=.7in\n{\\caa{D}_0\\ar@<+.8ex>[r]^-{-\\otimes_0D}\n\\ar@{}[r]|-{\\bot} &\n\\caa{D}_0\\ar@<+.8ex>[l]^-{\\ensuremath{\\mathrm{Hom}}^\\caa{D}_0(D,-)}}, \\qquad\n\\xymatrix @C=.6in\n{\\caa{D}_1\\ar@<+.8ex>[r]^-{-\\otimes_11_D}\n\\ar@{}[r]|-{\\bot} &\n\\caa{D}_1\\ar@<+.8ex>[l]^-{\\ensuremath{\\mathrm{Hom}}^\\caa{D}_1(1_D,-)}}\n\\end{displaymath}\nfor any 0-cell $D$ in $\\caa{D}$, such that conditions expressing compatibility with the horizontal composition \nand identities are satisfied. It immediately follows that $\\caa{D}_0$ is a monoidal closed\ncategory; however this cannot be deduced for $\\caa{D}_1$ as well, since\n$1_D$ is not an arbitrary horizontal 1-cell.\n\nDue to the application of these notions to our context of interest later,\nwe proceed to the definition of a different closed-like structure\nwhich arises naturally in what follows.\n\n\\begin{defi}\\label{loccloseddoublecat}\nA monoidal (pseudo) double category $\\caa{D}$ is called \\emph{locally closed monoidal}\nif it comes equipped with a lax double functor\n\\begin{displaymath}\n H=(H_0,H_1)\\colon\\caa{D}^\\mathrm{op}\\times\\caa{D}\\longrightarrow\\caa{D}\n\\end{displaymath}\nsuch that $\\otimes_0\\dashv H_0$ and $\\otimes_1\\dashv H_1$ are parametrized adjunctions.\n\\end{defi\nBy definition \\cref{F1mapping}, the functor $H_1$ in particular is the mapping\n\\begin{equation}\\label{H1mapping}\nH_1:\\xymatrix @C=1.5in{\\caa{D}^\\mathrm{op}_1\\times\\caa{D}_1\\ar[r] & \\caa{D}_1\\phantom{ABC}}\n\\end{equation}\\vspace{-0.2in}\n\\begin{displaymath}\n\\xymatrix @C=.08in\n{(X\\ar[rrr]|-\\scriptstyle\\bullet^M\\ar[d]_-f &\\rtwocell<\\omit>{<4>{\\alpha}}&& Y,\\ar[d]^-g & Z\\ar[rrr]^-N|-\\scriptstyle\\bullet\\ar[d]_-h\n&\\rtwocell<\\omit>{<4>\\beta}&& W)\\ar[d]^-k\n\\ar@{|.>}[rrrr] &&&& H_0(X,Z)\\ar[rrr]^-{H_1(M,N)}|-\\scriptstyle\\bullet\n\\ar[d]_-{H_0(f,h)} &\\rtwocell<\\omit>{<4>\\qquad H_1(\\alpha,\\beta)} && H_0(Y,W)\\ar[d]^-{H_0(g,k)} \\\\\n(X'\\ar[rrr]_-{M'}|-\\scriptstyle\\bullet &&& Y', & Z'\\ar[rrr]_-{N'}|-\\scriptstyle\\bullet &&& W')\n\\ar@{|.>}[rrrr] &&&& H_0(X',Z')\\ar[rrr]_-{H_1(M',N')}|-\\scriptstyle\\bullet &&& H_0(Y',W')} \n\\end{displaymath}\nCall $H$ the \\emph{internal hom} of $\\caa{D}$.\nClearly $H_0$ gives a monoidal closed structure on the vertical monoidal category\n$(\\caa{D}_0,\\otimes_0,I)$ and $H_1$ on the horizontal category\n$(\\caa{D}_1,\\otimes_1,1_I)$. The above arguments justify that a monoidal closed structure\non a double category does not imply a locally closed monoidal structure.\n\nWe will now explore the relations of this lax double functor $H$ on a locally closed monoidal double category $\\caa{D}$\nwith the categories of endomorphisms, monads and comonads discussed in \\cref{moncomondouble}. Recall that by \\cref{DendoMonDComonDmonoidal},\nall these categories inherit a monoidal structure from $\\caa{D}_1$.\n\n\\begin{prop}\\label{Dendoclosed}\nSuppose $\\caa{D}$ is a locally closed monoidal double category, with internal\nhom $H=(H_0,H_1)$. Then $H_1^\\bullet$ endows the category\nof endomorphisms $\\caa{D}_1^\\bullet$ with a monoidal closed structure.\n\\end{prop}\n\n\\begin{proof}\nThe lax double functor $H$ induces $H_1^\\bullet\\colon{\\caa{D}_1^\\bullet}^\\mathrm{op}\\times\\caa{D}_1^\\bullet\\to\\caa{D}_1^\\bullet$ by \\cref{F1bullet}.\nThe natural isomorphism $\\caa{D}_1(M\\otimes_1 N,P)\\cong\\caa{D}_1(M,H_1(N,P))$\nwhich defines the adjunction $(-\\otimes_1 N)\\dashv H_1(N,-)$ for the monoidal closed\ncategory $\\caa{D}_1$, considered only on endo-1-cells and endo-2-morphisms,\nimplies that $\\caa{D}_1^\\bullet$ is also a monoidal closed category via\n$\\otimes_1^\\bullet\\dashv H_1^\\bullet$.\n\\end{proof}\n\nBy \\cref{MonFdouble}, the lax double functor $H\\colon\\caa{D}^\\mathrm{op}\\times\\caa{D}\\to\\caa{D}$ induces\nan ordinary functor between the categories of (co)monads\n\\begin{equation}\\label{MonHdouble}\n\\ensuremath{\\mathbf{Mon}} H:\\mathbf{Cmd}(\\caa{D})^\\mathrm{op}\\times\\mathbf{Mnd}(\\caa{D})\\to\\mathbf{Mnd}(\\caa{D})\n\\end{equation}\nwhich is $H_1^\\bullet$ restricted on $\\mathbf{Mnd}(\\caa{D}^\\mathrm{op}\\times\\caa{D})\\cong\\mathbf{Mnd}(\\caa{D}^\\mathrm{op})\\times\\mathbf{Mnd}(\\caa{D})$.\nThis functor is fundamental in order to study enrichment relations between the category of monads and comonads\nin a braided or symmetric locally closed monoidal (fibrant) double category, by applying results from \\cref{sec:actionenrich,fibrations}.\nFor example, it is an action as explained below.\n\n\\begin{lem}\\label{doubleMonHaction}\nThe functor $\\ensuremath{\\mathbf{Mon}} H\\colon\\mathbf{Cmd}(\\caa{D})^\\mathrm{op}\\times\\mathbf{Mnd}(\\caa{D})\\to\\mathbf{Mnd}(\\caa{D})$\nin a braided locally closed monoidal double category, as well as $(\\ensuremath{\\mathbf{Mon}} H)^\\mathrm{op}$, is an action.\n\\end{lem}\n\\begin{proof}\nThe induced monoidal closed structure $H_1^\\bullet$ on the braided monoidal $\\caa{D}_1^\\bullet$, as well as its opposite functor,\nare both actions of ${\\caa{D}_1^\\bullet}^\\mathrm{op}$ and $\\caa{D}_1^\\bullet$ respectively, as is the case in any braided monoidal closed category by \\cref{inthomaction}.\nTherefore there are structure isomorphisms as in \\cref{actionmaps},\n\\begin{displaymath}\nH_1^\\bullet(M\\otimes N,P)\\cong H_1^\\bullet(M,H_1^\\bullet(N,P)),\\quad H_1^\\bullet(I,P)\\cong P \n\\end{displaymath}\nfor any endo-1-cells $M,N,P$ satisfying compatibility conditions.\nSince the forgetful functors from $\\mathbf{Cmd}(\\caa{D})$, $\\mathbf{Mnd}(\\caa{D})$ to $\\caa{D}_1^\\bullet$ reflect isomorphisms,\n$\\ensuremath{\\mathbf{Mon}} H$ and its opposite come equipped with these isomorphisms applied to\n$M,N\\in\\mathbf{Cmd}(\\caa{D})$, $P\\in\\mathbf{Mnd}(\\caa{D})$ thus are actions.\n\\end{proof}\n\n\\begin{thm}\\label{MndenrichedCmnd}\nSuppose that $(\\caa{D},\\otimes,\\mathbf{I})$ is a braided locally closed monoidal double category,\nwith internal hom $H$. If the induced functor $\\ensuremath{\\mathbf{Mon}} H$ has a parametrized right adjoint, then the category of monads $\\mathbf{Mnd}(\\caa{D})$ is\nenriched in the category of comonads $\\mathbf{Cmd}(\\caa{D})$.\n\nMoreover, if $\\mathbf{Cmd}(\\caa{D})$ is monoidal closed this enrichment is cotensored, and if each $\\ensuremath{\\mathbf{Mon}} H(M,-)$ also has a right adjoint,\nthe enrichment is tensored.\n\\end{thm}\n\\begin{proof}\nThe category of comonads is braided monoidal by \\cref{DendoMonDComonDmonoidal}.\nSince $\\ensuremath{\\mathbf{Mon}} H$ and $(\\ensuremath{\\mathbf{Mon}} H)^\\mathrm{op}\\colon\\mathbf{Cmd}(\\caa{D})\\times\\mathbf{Mnd}(\\caa{D})^\\mathrm{op}\\to\\mathbf{Mnd}(\\caa{D})^\\mathrm{op}$ are actions,\nthe existence of a right adjoint for the latter\n\\begin{displaymath}\nS\\colon\\mathbf{Mnd}(\\caa{D})^\\mathrm{op}\\times\\mathbf{Mnd}(\\caa{D})\\longrightarrow\\mathbf{Cmd}(\\caa{D}) \n\\end{displaymath}\ninduces the desired enrichment of $\\mathbf{Mnd}(\\caa{D})^\\mathrm{op}$ and thus of $\\mathbf{Mnd}(\\caa{D})$, by \\cref{actionenrich}.\nThe rest of the clauses follow by assumption.\n\\end{proof}\n\nNotice that monoidal closedness of $\\mathbf{Cmd}(\\caa{D})$ does not seem to follow in a straightforward way from that of $\\caa{D}_1^\\bullet$,\n\\cref{Dendoclosed}. Even in the application that follows, this result is obtained after establishing (co)completeness\nand (co)monadicity properties for the specific structure, which are heavily related to the double category we choose to work in;\nsee \\cref{VCocatclosed}. \n\nMoving to the fibrant case, we would now want to combine the above enrichment with the (op)fibration structure of monads\nand comonads over $\\caa{D}_0$ to exhibit an enriched fibration, \\cref{enrichedfibration}.\nTowards that end, notice that\n\\begin{equation}\\label{hopefulaction}\n\\xymatrix @C=.7in @R=.5in\n{\\mathbf{Cmd}(\\caa{D})\\times\\mathbf{Mnd}(\\caa{D})^\\mathrm{op}\\ar[r]^-{(\\ensuremath{\\mathbf{Mon}} H)^\\mathrm{op}} \\ar[d]_-{W\\times S^\\mathrm{op}} & \\mathbf{Mnd}(\\caa{D})^\\mathrm{op}\\ar[d]^{S^\\mathrm{op}} \\\\\n\\caa{D}_0\\times(\\caa{D}_0)^\\mathrm{op}\\ar[r]_-{H_0^\\mathrm{op}} & \\caa{D}_0^\\mathrm{op}}\n\\end{equation}\ncommutes by definition of the involved functors, and moreover $W$, $S^\\mathrm{op}$ are monoidal opfibrations by \\cref{monadscomonadsmonoidalfibr}.\nFinally, the actions $(\\ensuremath{\\mathbf{Mon}} H)^\\mathrm{op}$ and $(H_0)^\\mathrm{op}$ are above each other in the sense of \\cref{actionsabove}:\nby the mapping \\cref{H1mapping} that restricts as $\\ensuremath{\\mathbf{Mon}} H$ to (co)monads, the source and target\nof the action isomorphisms in $\\mathbf{Mnd}(\\caa{D})$ is precisely the action isomorphism in $\\caa{D}_0$, e.g.\n\\begin{displaymath}\n \\xymatrix @C=.8in\n{H_0(X\\otimes_0Y,Z)\\ar[d]_-{\\cong}\\ar[r]|-\\scriptstyle\\bullet^-{H_1(C\\otimes_1D,M)}\\rtwocell<\\omit>{<4>\\cong} & H_0(X\\otimes_0Y,Z)\\ar[d]^-{\\cong} \\\\\nH_0(X,H_0(Y,Z))\\ar[r]_-{H_1(C,H_1(D,M))}|-\\scriptstyle\\bullet & H_0(X,H_0(Y,Z))}\n\\end{displaymath}\nAs a result, when $\\ensuremath{\\mathbf{Mon}} H$ preserves cartesian liftings, then $W$ acts on $S^\\mathrm{op}$ in the sense of \\cref{Trepresentation}.\nWe can now apply the dual of \\cref{thmactionenrichedfibration}.\n\n\\begin{thm}\\label{MndfibredenrichedCmnd}\nSuppose $\\caa{D}$ is a braided locally closed monoidal fibrant double category.\nIf $(\\ensuremath{\\mathbf{Mon}} H)^\\mathrm{op}$ is cocartesian, and \\cref{hopefulaction} has an opfibred parametri\\-zed\nadjoint as in \\cref{generaloplaxparametrized},\nthen the fibration $S\\colon\\mathbf{Mnd}(\\caa{D})\\to\\caa{D}_0$ is enriched in the symmetric monoidal opfibration\n$W\\colon\\mathbf{Cmd}(\\caa{D})\\to\\caa{D}_0$.\n\\end{thm}\n\n\n\\section{Enriched matrices and (co)categories}\\label{sec:Enrichedmatrices}\n\nIn this section, we initially study the double category of $\\mathcal{V}$-matrices.\nAfter establishing its monoidal fibrant double categorical structure,\nspecial focus will be given to its well-known horizontal bicategory of enriched matrices. The main references\nfor that are \\cite{VarThrEnr} and \\cite{KellyLack}; in the former, the more general bicategory\n$\\mathcal{W}$-$\\mathbf{Mat}$ of matrices enriched in a bicategory $\\mathcal{W}$ was studied, leading to the theory of bicategory-enriched categories.\n\nFurthermore, we investigate the categories of monads and comonads in the double category\n$\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$. These are specifically $\\ca{V}\\textrm{-}\\B{Cat}$ of $\\mathcal{V}$-enriched categories\nand functors \\cite{Kelly}, and $\\ca{V}\\textrm{-}\\B{Cocat}$ of $\\mathcal{V}$-enriched \\emph{cocategories} and \\emph{cofunctors}.\nApplying earlier results, passing from the double categorical to the bicategorical view according to our needs,\nthe goal is to establish an enrichment of $\\mathcal{V}$-categories in $\\mathcal{V}$-cocategories.\n\nAs an intermediate step, $\\mathcal{V}$-enriched graphs are given special attention; they provide a natural\ncommon framework for (co)categories, since both are graphs with extra structure.\nIn \\cite{MacLane}, the notion of a small (directed) graph\nis employed to describe the free category construction (in analogy with the free monoid construction on a set)\nand also $O$-graphs with a fixed set of objects $O$ inspires the fibrational view of these categories.\nFor $\\mathcal{V}$-$\\mathbf{Grph}$ and $\\mathcal{V}$-$\\mathbf{Cat}$ from a more traditional point \nof view, rather than the matrices approach followed here, Wolff's \\cite{Wolff} is a classical reference for a symmetric monoidal closed base.\n\nThere is a 2-dimensional aspect for all the categories studied in this chapter,\ne.g. $\\mathcal{V}$-natural transformations. We choose to omit its description in this treatment, since it is not relevant to\nour main objectives.\n\n\\subsection{\\texorpdfstring{$\\mathcal{V}$}{V}-matrices}\\label{bicatVMat}\n\nSuppose that $\\mathcal{V}$ is a monoidal category with coproducts which are preserved by the tensor product functor\n$-\\otimes-$ in each variable; for example, this is certainly the case when $\\mathcal{V}$ is monoidal closed.\n\nFor sets $X$ and $Y$, a $\\mathcal{V}$\\emph{-matrix}$\\SelectTips{eu}{10}\\xymatrix @C=.2in\n{S:X\\ar[r]|-{\\object@{|}} & Y}$from $X$ to $Y$ is defined to be a functor $S:X\\times Y\\to\\mathcal{V}$,\nwhere the set $X\\times Y$ is viewed as a discrete category. This can equivalently given by a family of objects in $\\mathcal{V}$\n$$\\{S(x,y)\\}_{(x,y)\\in X\\times Y}$$\nsometimes also denoted as $\\{S_{x,y}\\}_{X\\times Y}$.\nFor example, each set $X$ gives rise to a $\\mathcal{V}$-matrix$\\SelectTips{eu}{10}\n\\xymatrix @C=.2in{1_X:X\\ar[r]|-{\\object@{|}} & X}$called the \\emph{identity matrix} given by\n\\begin{displaymath}\n1_X(x,x')=\\begin{cases}\nI,\\quad \\mathrm{if }\\;x=x'\\\\\n0,\\quad \\mathrm{ otherwise}\n\\end{cases}\n\\end{displaymath}\nwhere $I$ is the unit object in $\\mathcal{V}$ and $0$ is the initial object.\n\nThere is a double category $\\mathcal{V}$-$\\mathbf{\\caa{M}at}$ of $\\mathcal{V}$-matrices as in \\cref{def:doublecats}, with vertical category $\\mathcal{V}$-$\\mathbf{\\caa{M}at}_0$\nthe usual category of sets and functions $\\B{Set}$. Its horizontal category $\\mathcal{V}$-$\\mathbf{\\caa{M}at}_1$\nconsists of $\\mathcal{V}$-matrices$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{S:X\\ar[r]|-{\\object@{|}} & Y}$as horizontal 1-cells, and 2-morphisms $^f\\alpha^g:S\\Rightarrow T$\nare natural transformations\n\\begin{equation}\\label{VMat2morphism}\n\\xymatrix@R=.1in\n{X\\ar[r]^-S\\ar@{}[r]|-{\\object@{|}}\\rtwocell<\\omit>{<5>\\alpha} \\ar[dd]_-f & Y\\ar[dd]^-g &&&\\\\\n&& \\textrm{=} & X\\times Y \\ar@\/^5ex\/[rr]^-S\\ar@\/_\/[dr]_{f\\times g}\\rrtwocell<\\omit>{\\alpha} && \\mathcal{V} \\\\\nZ\\ar[r]_-T\\ar@{}[r]|-{\\object@{|}} & W &&& Z\\times W\\ar@\/_\/[ur]_-T &}\n\\end{equation}\ngiven by families of arrows $\\alpha_{x,y}:S(x,y)\\to T(fx,gy)$ in $\\mathcal{V}$, for all $x\\in X$ and $y\\in Y$.\nThere is a functor $\\mathbf{1}\\colon\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_0\\to\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1$ which gives the identity $\\mathcal{V}$-matrix$\\SelectTips{eu}{10}\n\\xymatrix@C=.2in{1_X:X\\ar[r]|-{\\object@{|}} & X}$for each $X$, and the unit 2-morphism $1_f$ with components\n\\begin{displaymath}\n (1_f)_{x,x'}:1_X(x,x')\\to1_X(x,x')\\equiv\n\\begin{cases}\n I\\xrightarrow{1_I}I, &\\textrm{ if}\\;x=x' \\\\\n0\\to 0, &\\textrm{ if}\\;x\\neq x'.\n\\end{cases}\n\\end{displaymath}\nThe source and target functors give the evident sets and functions, and the horizontal composition functor\n\\begin{displaymath}\n \\odot:\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1{\\times_{\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_0}}\n\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1\\to\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1\n\\end{displaymath}\nmaps two composable $\\mathcal{V}$-matrices$\\SelectTips{eu}{10}\\xymatrix @C=.2in{T:Y\\ar[r]|-{\\object@{|}} & Z}$and$\\SelectTips{eu}{10}\n\\xymatrix @C=.2in{S:X\\ar[r]|-{\\object@{|}} & Y}$to the matrix\n$\\SelectTips{eu}{10}\\xymatrix @C=.2in{T\\circ S:X\\ar[r]|-{\\object@{|}} & Z,}$given\nby the family of objects in $\\mathcal{V}$\n\\begin{equation}\\label{horizontalcompositionVmatrices}\n(T\\circ S)(x,z)=\\sum_{y\\in Y} S(x,y)\\otimes T(y,z)\n\\end{equation}\nfor all $z\\in Z$ and $x\\in X$, reminiscent of the usual matrix multiplication.\nThe horizontal composite of 2-morphisms $^f(\\beta\\odot\\alpha)^g:T\\circ S\\Rightarrow T'\\circ S'$ as in\n\\cref{2cellscomp} is given by the composite arrows\n\\begin{equation}\\label{horizontalcompositionVmatricearrows}\n\\xymatrix @C=1in @R=.25in\n{\\sum_{y} S(x,y)\\otimes T(y,z)\\ar[r]^-{\\sum\\alpha_{x,y}\\otimes\\beta_{y,z}} \\ar@\/_3ex\/@{-->}[dr] &\n\\sum_{y}S'(fx,gy)\\otimes T'(gy,hz)\\ar@{_(->}[d] \\\\\n& \\sum_{y'}S'(fx,y')\\otimes T'(y',hz)}\n\\end{equation}\nin $\\mathcal{V}$, for all $x\\in X$ and $z\\in Z$. Compatibility conditions of source and target \nfunctors with composition can be easily checked.\n\nFor composable $\\mathcal{V}$-matrices$\\SelectTips{eu}{10}\\xymatrix @C=.2in{X\\ar[r]|-{\\object@{|}}^-S & \nY\\ar[r]|-{\\object@{|}}^-T & Z\\ar[r]|-{\\object@{|}}^-R & W,}$\nthe associator $\\alpha$ has components globular isomorphisms $\\alpha^{R,T,S}:\n(R\\odot T)\\odot S\\stackrel{\\sim}{\\longrightarrow}R\\odot(T\\odot S)$\ngiven by the family $\\{\\alpha_{x,w}\\}$ of composite isomorphisms\n\\begin{displaymath}\n\\xymatrix @R=.53in\n{\\sum_z\\left(\\sum_y S_{x,y}\\otimes T_{y,z}\\right)\\otimes R_{z,w}\\ar@{-->}[r] \\ar[d]_-{\\cong} &\n\\sum_y S_{x,y}\\otimes\\left(\\sum_z T_{y,z}\\otimes R_{z,w}\\right) \\\\\n\\sum_{y,z}\\left((S_{x,y}\\otimes T_{y,z})\\otimes R_{z,w}\\right)\\ar[r]_-{\\sum{a}} & \n\\sum_{y,z}\\left(S_{x,y}\\otimes(T_{y,z}\\otimes R_{z,w})\\right)\\ar[u]_-{\\cong}}\n\\end{displaymath}\nwhere $a$ is the associativity constraint of $\\mathcal{V}$ and the invertible arrows express the fact that $\\otimes$ commutes with colimits.\nFinally, for each $\\mathcal{V}$-matrix$\\SelectTips{eu}{10}\\xymatrix @C=.2in{S:X\\ar[r]|-{\\object@{|}} & Y,}$ \nthe unitors $\\lambda, \\rho$ have components globular $\\lambda^S:1_Y\\odot S\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} S,\n\\rho^S:S\\odot 1_X\\xrightarrow{\\raisebox{-4pt}[0pt][0pt]{\\ensuremath{\\sim}}} S$ given by families\n\\begin{align*}\n\\lambda^S_{x,y}&:\\sum_{y'\\in Y}{S(x,y')\\otimes1_Y(y',y) }\\equiv S(x,y)\\otimes I\\xrightarrow{\\;r_{S(x,y)}\\;} S(x,y) \\\\\n\\rho^S_{x,y}&:\\sum_{x'\\in X}{1_X(x,x')\\otimes S(x',y)}\\equiv I\\otimes S(x,y)\\xrightarrow{\\;l_{S(x,y)}\\;} S(x,y).\n\\end{align*}\nof morphisms in $\\mathcal{V}$. The respective coherence conditions are satisfied, thus these data indeed define a double category.\n\nMoreover, $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is fibrant as in \\cref{fibrantdoublecat}. Any function $f:X\\to Y$ determines two $\\mathcal{V}$-matrices, $\\SelectTips{eu}{10}\n\\xymatrix @C=.2in{f_*:X\\ar[r]|-{\\object@{|}} & Y}$and$\\SelectTips{eu}{10}\\xymatrix @C=.2in\n{f^*:Y\\ar[r]|-{\\object@{|}} & X,}$ given by\n\\begin{equation}\\label{f*}\nf_*(x,y)=f^*(y,x)=\\begin{cases}\nI,\\quad \\mathrm{if }\\;f(x)=y\\\\\n0,\\quad \\mathrm{ otherwise}\n\\end{cases}\n\\end{equation}\nThese are precisely the companion and the conjoint of the vertical 1-cell $f$, since\nthey come equipped with appropriate 2-cells as in \\cref{deficompconj}:\n\\begin{displaymath}\n\\xymatrix{X\\ar[r]^-{f_*}\\ar@{}[r]|-{\\object@{|}} \\rtwocell<\\omit>{<4>\\;p_1} \\ar[d]_-f & Y\\ar@{=}[d] \\\\\nY\\ar[r]_-{1_Y}\\ar@{}[r]|-{\\object@{|}} & Y}\\qquad\n\\xymatrix{X\\ar[r]^-{1_X}|-{\\object@{|}}\\rtwocell<\\omit>{<4>\\;p_2} \\ar@{=}[d] & X\\ar[d]^-{f} \\\\\nX\\ar[r]_-{f_*}\\ar@{}[r]|-{\\object@{|}} & Y}\\quad\n\\xymatrix{\\hole \\\\\n\\textrm{are given by}}\n\\end{displaymath}\n\\begin{gather*}\nf_*(x,y)\\xrightarrow{(p_1)_{x,y}}1_Y(fx,y)=\n\\begin{cases}\nI\\xrightarrow{\\mathrm{id}}I, & \\text{if }y=fx\\\\\n0\\xrightarrow{\\mathrm{id}}0, & \\text{otherwise}\n\\end{cases} \\\\\n1_X(x,x')\\xrightarrow{(p_2)_{x,x'}}f_*(x,fx')=\n\\begin{cases}\nI\\xrightarrow{\\mathrm{id}} I, & \\text{if }x=x' \\\\\n0\\xrightarrow{!}\\begin{cases}I, & fx=fx' \\\\\n0, &\\text{else}\n\\end{cases} & \\text{if }x\\neq x'\n\\end{cases}\n\\end{gather*}\nsatisfying the required relations, and similarly for $f^*$.\n\nWhen $\\mathcal{V}$ is braided monoidal, the double category $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ has a monoidal structure as in \\cref{monoidaldoublecategory}.\nThe required double functors $\\otimes=(\\otimes_0,\\otimes_1)$ and $\\mathbf{I}=(\\mathbf{I}_0,\\mathbf{I}_1)$ consist of the cartesian monoidal structure\non the vertical category $(\\mathbf{Set},\\times,\\{*\\})$ and\n\\begin{equation}\\label{VMMat1monoidal}\n\\otimes_1:\\xymatrix @C=1.2in\n{\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1\\times\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1\n\\ar[r] & \\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1}\\phantom{ABC}\n\\end{equation}\\vspace{-0.2in}\n\\begin{displaymath}\n \\xymatrix @C=.025in\n{(X\\ar[rrr]|-{\\object@{|}}^S\\ar[d]_-f\n&\\rtwocell<\\omit>{<4>{\\alpha}}&& Y\\ar[d]^-g\n& , & Z\\ar[rrr]^-T|-{\\object@{|}}\\ar[d]_-h\n&\\rtwocell<\\omit>{<4>\\beta}&& W)\\ar[d]^-k\n\\ar@{|.>}[rrrr] &&&& X\\times Z\\ar[rrr]^-{S\\otimes T}|-{\\object@{|}}\n\\ar[d]_-{f\\times h} &\\rtwocell<\\omit>{<4>\\quad\\alpha\\otimes\\beta}\n&& Y\\times W\\ar[d]^-{g\\times k} \\\\\n(X'\\ar[rrr]_-{S'}|-{\\object@{|}} &&& Y' & , &\nZ'\\ar[rrr]_-{T'}|-{\\object@{|}} &&& W')\n\\ar@{|.>}[rrrr] &&&& X'\\times Z'\\ar[rrr]_-{S'\\otimes T'}|-{\\object@{|}} \n&&& Y'\\times W'} \n\\end{displaymath}\nwhich is defined on objects and morphisms by the families in $\\mathcal{V}$\n\\begin{gather}\\label{monoidalVMat}\n(S\\otimes T)\\left((x,z),(y,w)\\right):=S(x,y)\\otimes T(z,w) \\\\\n(\\alpha\\otimes\\beta)_{(x,z),(y,w)}:= S(x,y)\\otimes T(z,w)\\xrightarrow{\\alpha_{x,y}\\otimes\\beta_{z,w}}S'(fx,gy)\\otimes T'(hz,kw).\n\\nonumber\n\\end{gather}\nAlong with the $\\mathcal{V}$-matrix $\\SelectTips{eu}{10}\\xymatrix@C=.2in{\\mathcal{I}:\\{*\\}\\ar[r]|-{\\object@{|}} & \\{*\\}}$given by\n$\\mathcal{I}(*,*)=I_\\mathcal{V}$, this defines a monoidal structure of $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1$. The conditions for $\\mathfrak{s}$ and $\\mathfrak{t}$\nare satisfied, and the globular isomorphisms \\cref{monoidaldoubleiso} come down to the tensor product in\n$\\mathcal{V}$ commuting with coproducts. More specifically,\nfor matrices$\\matr{S}{X}{Y,}\\matr{T}{Z}{W,}$ $\\matr{S'}{Y}{U,}\\matr{T'}{W}{V}$we can compute the isomorphic families in $\\mathcal{V}$\n\\begin{gather*}\n\\left((S\\otimes_1 T)\\odot(S'\\otimes_1 T')\\right)_{(x,z),(u,v)}=\n\\sum_{(y,w)}S_{x,y}\\otimes T_{z,w}\\otimes S'_{y,u}\\otimes T'_{w,v} \\\\\n\\left((S\\odot S')\\otimes_1(T\\odot T')\\right)_{(x,z),(u,v)}=\\sum_{y}\\left(S_{x,y}\\otimes S'_{y,u}\\right)\\otimes\n\\sum_{w}\\left(T_{z,w}\\otimes T'_{w,v}\\right)\n\\end{gather*}\nvia the braiding, and also $1_{X\\times Y}\\cong 1_X\\otimes_1 1_Y$ in a straightforward way.\nThis monoidal structure on $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is symmetric, when\nthe base monoidal category $\\mathcal{V}$ is symmetric. Then $\\B{Set}$ and $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1$ are both symmetric monoidal categories,\nand the rest of the axioms follow.\n\n\\begin{prop}\\label{VMatmonoidaldoublefibrant}\nIf $\\mathcal{V}$ is a monoidal category with coproducts, such that the tensor product preserves them in both variables,\nthe double category $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is fibrant. Moreover, $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is monoidal if $\\mathcal{V}$ is braided monoidal, and\ninherits the braided or symmetric structure from $\\mathcal{V}$.\n\\end{prop}\n\n\\begin{rmk}\nIt is evident that there is a strong relation between $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ and $\\mathcal{V}$-$\\caa{P}\\mathbf{rof}$, the double category of $\\mathcal{V}$-profunctors.\nOn a first level, we can see that $\\mathcal{V}$-matrices are special cases of $\\mathcal{V}$-profunctors when the latter\nare considered only on discrete categories. In \\cite[11.8]{Framedbicats}, a more elaborate relation between these double categories\nis established: $\\caa{M}\\mathbf{od}(\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at})=\\mathcal{V}$-$\\caa{P}\\mathbf{rof}$ for a construction $\\caa{M}\\mathbf{od}$ building new fibrant double categories\nfrom old, with vertical category that of monads.\n\\end{rmk}\n\nWhen $\\mathcal{V}$ is moreover monoidal closed with products, we can determine a locally closed monoidal structure on $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$.\nFollowing \\cref{loccloseddoublecat}, we are after a lax double functor\n\\begin{equation}\\label{HforVMMat}\n H=(H_0,H_1)\\colon\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}^\\mathrm{op}\\times\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}\\to\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}\n\\end{equation}\nwhich endows $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_0=\\B{Set}$ and $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1$ with a monoidal closed structure.\nFor the vertical category, we clearly have the exponentiation functor\n\\begin{displaymath}\n H_0:\\mathbf{Set}^\\mathrm{op}\\times\\mathbf{Set}\\xrightarrow{\\;(-)^{(-)}\\;}\\mathbf{Set}\n\\end{displaymath}\nas the internal hom. For the horizontal category, we can define\n\\begin{equation}\\label{H1functor}\n H_1:\\xymatrix @C=1.3in\n{\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1^\\mathrm{op}\\times\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1\n\\ar[r] & \\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1}\\phantom{ABC}\n\\end{equation}\\vspace{-0.2in}\n\\begin{displaymath}\n \\xymatrix @C=.025in @R=.25in\n{(X\\ar[rrr]|-{\\object@{|}}^S\\ar[d]_-f\n&\\rtwocell<\\omit>{<4>{\\alpha}}&& Y\\ar[d]^-g\n& , & Z\\ar[rrr]^-T|-{\\object@{|}}\\ar[d]_-h\n&\\rtwocell<\\omit>{<4>\\beta}&& W)\\ar[d]^-k\n\\ar@{|.>}[rrr] &&& Z^X\\ar[rrrr]^-{H_1(S,T)}|-{\\object@{|}}\n\\ar[d]_-{h^f} &\\rtwocell<\\omit>{<4>\\qquad H_1(\\alpha,\\beta)}\n&&& W^Y\\ar[d]^-{k^g} \\\\\n(X'\\ar[rrr]_-{S'}|-{\\object@{|}} &&& Y' & , &\nZ'\\ar[rrr]_-{T'}|-{\\object@{|}} &&& W')\n\\ar@{|.>}[rrr] &&& Z'^{X'}\\ar[rrrr]_-{H_1(S',T')}|-{\\object@{|}} \n&&&& {W'}^{Y'}}\n\\end{displaymath}\non horizontal 1-cells given by families of objects in $\\mathcal{V}$, for $n\\in Z^X, m\\in W^Y$, \n\\begin{equation}\\label{H1onobjects}\nH_1(S,T)(n,m)=\\prod_{x,y}[S(x,y),T(n(x),m(y))] \n\\end{equation}\nand on 2-morphisms $H_1(\\alpha,\\beta):H_1(S,T)(n,m)\\to H_1(S',T')(h^f(n),k^g(m))$ by families of arrows in $\\mathcal{V}$\n\\begin{equation}\\label{H1onarrows}\n\\prod_{x,y} [S(x,y),T(n(x),m(y))]\\to \\prod_{x',y'}[S'(x',y'),T'(hnf(x'),kmg(y'))]\n\\end{equation}\nwhich correspond under $(\\text{-}\\otimes X)\\dashv [X,-]$ in $\\mathcal{V}$ for fixed $x',y'$ to the composite\n\\begin{displaymath}\n\\xymatrix @C=.8in\n{\\prod\\limits_{x,y}[S(x,y),T(nx,my)]\\otimes S'(x',y')\\ar @{-->}[r]\n\\ar[d]_-{1\\otimes \\alpha_{x',y'}} & T'(hnfx',kmgy') \\\\\n\\prod\\limits_{x,y}[S(x,y),T(nx,my)]\\otimes S(fx',gy')\\ar[d]_-{\\pi_{fx',gy'}\\otimes 1} & \\\\\n[S(fx',gy'),T(nfx',mgy')]\\otimes S(fx',gy')\\ar[r]^-{\\textrm{ev}}& T(nfx',mgy').\\ar[uu]_-{\\beta_{nfx',mgy'}}}\n\\end{displaymath\nThe globular transformations from \\cref{defi:doublefunctor} for a lax double functor\n\\begin{displaymath}\n \\xymatrix @R=.02in @C=.8in\n{& W^Z \\ar @\/^\/[dr]|-{\\object@{|}}^-{H_1(R,O)} & \\\\\nY^X \\ar @\/^\/[ur]|-{\\object@{|}}^-{H_1(S,T)}\n\\rrtwocell<\\omit>{\\qquad\\qquad\\delta_{(S,T),(R,O)}}\n\\ar @\/_3ex\/[rr]|-{\\object@{|}}_-{H_1(R\\circ S,O\\circ T)} && V^U}\n\\quad\n\\xymatrix @C=1in @R=.02in\n{\\hole \\\\\nY^X\\ar @\/^3ex\/[r]|-{\\object@{|}}^-{1_{Y^X}}\n\\ar@\/_3ex\/[r]|-{\\object@{|}}_-{H_1(1_X,1_Y)}\n\\rtwocell<\\omit>{\\qquad\\;\\;\\gamma_{(X,Y)}} & Y^X}\n\\end{displaymath}\nfor each$\\SelectTips{eu}{10}\\xymatrix @C=.2in{(R:Z\\ar[r]|-{\\object@{|}} & U,}\\SelectTips{eu}{10}\\xymatrix @C=.2in\n{O:W\\ar[r]|-{\\object@{|}} & V)}$and$\\SelectTips{eu}{10}\\xymatrix @C=.2in{(S:X\\ar[r]|-{\\object@{|}} & Z,}\\SelectTips{eu}{10}\n\\xymatrix @C=.2in{T:Y\\ar[r]|-{\\object@{|}} & W)}$are given by families of arrows in $\\mathcal{V}$\n\\begin{gather*}\n\\sum_{q\\in W^Z}{H_1(S,T)(k,q)\\otimes H_1(R,O)(q,t)}\\xrightarrow{\\delta_{k,t}}\n\\prod_{(x,u)}{[(R\\circ S)(x,u),(O\\circ T)(kx,tu)]} \\\\\n\\gamma_{k,k}:I\\xrightarrow{\\;\\sim\\;}[1_X(x,x),1_Y(kx,kx)]=[I,I]\n\\end{gather*}\nfor all $k\\in Y^X, t\\in V^U$, $x=x'\\in X$. These again can be understood via their transposes under the tensor-hom adjunction, \\emph{i.e.} \ncomposites of projections, inclusions, braidings and evaluations, using the fact that the tensor product preserves sums.\nThe coherence axioms of \\cref{laxfunctor} as for a lax functor of bicategories are satisfied, therefore $H=(H_0,H_1)$\nis a lax double functor.\n\n\\begin{prop}\\label{VMMat1closed}\nUnder the above assumptions, the functor $H_1$ \\cref{H1functor} constitutes a monoidal closed structure\nfor $(\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1,\\otimes_1,1_I)$.\n\\end{prop}\n\\begin{proof}\nWe need to show that $-\\otimes_1 T\\dashv H_1(T,-)\\colon\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1\\to\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1$ for any $\\mathcal{V}$-matrix $\\matr{T}{Z}{W,}$\ni.e. there is a natural bijection between 2-morphisms\n\\begin{displaymath}\n\\xymatrix @C=.6in{X\\times Z\\ar[r]^-{S\\otimes_1 T}|-{\\object@{|}}\\rtwocell<\\omit>{<4>\\alpha} \\ar[d]_-f & Y\\times W\\ar[d]^-g \\\\\nU\\ar[r]_-P|-{\\object@{|}} & V}\\quad\\textrm{ and }\\quad\n\\xymatrix @C=.6in{X\\ar[r]^-{S}|-{\\object@{|}}\\rtwocell<\\omit>{<4>\\beta} \\ar[d]_-k & Y\\ar[d]^-l \\\\\nU^Z\\ar[r]_-{H_1(T,P)}|-{\\object@{|}} & V^W}\n\\end{displaymath}\nTaking components of the left side 2-morphism \\cref{VMat2morphism} and using the monoidal closed structure of $\\mathcal{V}$,\nwe deduce that any $\\alpha_{(x,z),(y,x)}\\colon S(x,y)\\otimes T(z,w)\\to P(f(x,z),g(y,w))$ bijectively corresponds,\nfor all $x\\in X,y\\in Y,z\\in Z,w\\in W$, to some $\\mathcal{V}$-morphism $S(x,y)\\to[T(z,w),P(f(x,z),g(y,w))]$. Since $\\mathcal{V}$ has products\nand $\\B{Set}$ is closed, this uniquely corresponds to some\n$$\\beta_{x,y}\\colon S(x,y)\\to\\prod_{z,w}[T(z,w),P(f_x(z),g_y(w))]$$\nfor the transpose functions $f_x\\in U^X$, $g_y\\in V^W$ and the proof is complete.\n\\end{proof}\n\nHence we built a lax double functor $H$ which satisfies the conditions of \\cref{loccloseddoublecat}; the desired result follows.\n\n\\begin{cor}\\label{VMatlocallymoidalclosed}\nIf $\\mathcal{V}$ is a braided monoidal closed category with products and coproducts,\nthe monoidal double category $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is locally closed monoidal.\n\\end{cor}\n\nThe horizontal bicategory $\\mathcal{H}(\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at})$ of the double category of $\\mathcal{V}$-matrices is the well-known bicategory $\\mathcal{V}$-$\\mathbf{Mat}$.\nIn more detail, sets and $\\mathcal{V}$-matrices are the 0- and 1-cells, and 2-cells between $\\mathcal{V}$-matrices $S$ and $S'$ are\nglobular 2-morphisms, i.e. natural transformations\n\\begin{displaymath}\n\\xymatrix{X\\ar@\/^2ex\/[rr]|-{\\object@{|}}^-S \\ar@\/_2ex\/[rr]|-{\\object@{|}}_-{S'}\n\\rrtwocell<\\omit>{\\sigma} && Y}:=\n\\xymatrix{X\\times Y\\rrtwocell^{S}_{S'}{\\;\\sigma} && \\mathcal{V}}\n\\end{displaymath}\ngiven by families $\\sigma_{x,y}:S(x,y)\\to S'(x,y)$ of arrows in $\\mathcal{V}$.\nThe horizontal composition $\\circ:\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Z)\\times\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,Y)\n\\to\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,Z)$ is given by matrix multiplication \\cref{horizontalcompositionVmatrices}\non objects, and by the special case of \\cref{horizontalcompositionVmatricearrows} mapping\n$(\\sigma,\\tau)$ to $\\{(\\tau*\\sigma)_{x,z}\\}=\\{\\sum{\\sigma_{x,y}\\otimes\\tau_{y,z}}\\}$ on morphisms.\n\nMany useful properties of the companion and conjoint \\cref{f*} can be deduced in the bicategorical context from \\cref{compconjprops}.\nFor example, for any $f\\colon X\\to Y$ we have an adjunction $f_*\\dashv f^*$ in the bicategory $\\mathcal{V}$-$\\mathbf{Mat}$, with unit and counit\n\\begin{equation}\\label{fetafepsilon}\n\\xymatrix @C=.6in\n{X \\ar @\/^2ex\/[r]|-{\\object@{|}}^-{1_X}\n\\ar@\/_2ex\/[r]|-{\\object@{|}}_-{f^*\\circ f_*}\n\\rtwocell<\\omit>{\\;\\dot{\\eta}} & X}\n\\qquad\\mathrm{and}\\qquad\n\\xymatrix @=.6in\n{Y \\ar @\/^2ex\/[r]|-{\\object@{|}}^-{f_*\\circ f^*}\n\\ar@\/_2ex\/[r]|-{\\object@{|}}_-{1_Y}\n\\rtwocell<\\omit>{\\;\\dot{\\varepsilon}} & Y}\n\\end{equation}\nwith components arrows in $\\mathcal{V}$\n\\begin{gather*}\n\\dot{\\varepsilon}_{y,y'}:(f_*\\circ f^*)(y,y')\\to 1_Y(y,y')\\equiv\n\\begin{cases}\n\\sum\\limits_{x\\in f^{-1}(y)}{I\\otimes I}\\xrightarrow{r_I}I, & \\text{if }y=y' \\\\\n\\phantom{\\sum\\limits_{x\\in f^{-1}(y)}}0\\xrightarrow{!}0, & \\text{if }y\\neq y'\n\\end{cases} \\\\\n\\dot{\\eta}_{x,x'}:1_X(x,x')\\to(f^*\\circ f_*)(x',x)\\equiv\n\\begin{cases}\nI\\xrightarrow{(r_I)^{-1}}I\\otimes I, & \\text{if }x'=x \\\\\n0\\xrightarrow{!}{\\begin{cases} I\\otimes I, & fx=fx'\\\\\n0, & \\text{else}\n\\end{cases}} & \\text{if }x'\\neq x\n\\end{cases}\n\\end{gather*}\nNotice that $\\dot{\\eta}$ and $\\dot{\\varepsilon}$ are isomorphisms if and only if $f$ is a bijection.\n\nFor explicit calculations in the context of $\\mathcal{V}$-matrices, it will be useful\nto compute that for any $F\\colon X\\to Y,$ $\\SelectTips{eu}{10}\\xymatrix @C=.2in{S:Y\\ar[r]|-{\\object@{|}} & Z}$and$\\SelectTips{eu}{10}\n\\xymatrix @C=.2in{T:Z\\ar[r]|-{\\object@{|}} & Y,}$\n\\begin{equation}\\label{matrixmachine}\n(S\\circ f_*)(x,z)=\\sum_{y\\in Y}{f_*(x,y)\\otimes S(y,z)}=I\\otimes S(fx,z)\\stackrel{r}{\\cong}S(fx,z)\n\\end{equation}\n\\begin{displaymath}\n(f^*\\circ T)(z,x)=\\sum_{y\\in Y}{T(z,y)\\otimes f^*(y,x)}=T(z,fx)\\otimes I\\stackrel{l}{\\cong}T(z,fx)\n\\end{displaymath}\nare the families in $\\mathcal{V}$ that define the composite matrices $S\\circ f_*$ and $f^*\\circ T$.\nUsing such machinery, we re-obtain the following results for composites of companions and conjoints, \\cref{compositecompconj}.\n\n\\begin{lem}\\label{isosofstars}\nLet $f:X\\to Y$ and $g:Y\\to Z$ be functions. There exist isomorphisms\n\\begin{gather*}\n\\zeta^{g,f}:g_*\\circ f_*\\cong(gf)_*:\n\\SelectTips{eu}{10}\\xymatrix\n{X\\ar[r]|-{\\object@{|}} & Z} \\\\\n\\xi^{g,f}:f^*\\circ g^*\\cong(gf)^*:\n\\SelectTips{eu}{10}\\xymatrix\n{Z\\ar[r]|-{\\object@{|}} & X}\n\\end{gather*}\nwhich are families of invertible arrows\n\\begin{equation}\\label{zeta}\n\\zeta^{g,f}_{x,z}=\\xi^{g,f}_{z,x}:\\begin{cases}\nI\\otimes I\\xrightarrow{r_I=l_I}I, &\\textrm{if }g(f(x))=z \\\\\n\\quad\\quad 0\\xrightarrow{\\;!\\;}0, & \\textrm{otherwise}\n\\end{cases}\n\\end{equation}\n\\end{lem}\n\nUnder the assumptions of \\cref{VMatmonoidaldoublefibrant}, $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is a fibrant monoidal double category\ntherefore \\cref{monoidalhorizontalbicategory} applies.\n\n\\begin{prop}\\label{bicatVMatmonoidal}\nIf $\\mathcal{V}$ is a braided monoidal category with coproducts such that $\\otimes$ preserves them in both enries,\nthe bicategory $\\mathcal{V}$-$\\mathbf{Mat}$ is a monoidal bicategory; if $\\mathcal{V}$ is symmetric then so is $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$.\n\\end{prop}\n\nThe monoidal unit is the unit $\\mathcal{V}$-matrix $\\mathcal{I}$ and the induced tensor product pseudofunctor\n$\\otimes:\\mathcal{V}\\text{-}\\mathbf{Mat}\\times\\mathcal{V}\\text{-}\\mathbf{Mat}\\to\\mathcal{V}\\text{-}\\mathbf{Mat}$\nmaps two sets $X,Y$ to their cartesian product\n$X\\times Y$, and the functor\n\\begin{displaymath}\n\\otimes_{(X,Y),(Z,W)}:\\mathcal{V}\\text{-}\\mathbf{Mat}(X,Z)\\times\n\\mathcal{V}\\text{-}\\mathbf{Mat}(Y,W)\\to\\mathcal{V}\\text{-}\\mathbf{Mat}(X\\times Y, Z\\times W),\n\\end{displaymath}\nis defined as in \\cref{VMMat1monoidal} for globular 2-morphisms.\n\nWhen $\\mathcal{V}$ is moreover monoidal closed with products, its locally closed monoidal structure $H=(H_0,H_1)$ \\cref{HforVMMat}\ninduces a lax functor of bicategories\n\\begin{displaymath}\n\\ensuremath{\\mathrm{Hom}}:(\\mathcal{V}\\textrm{-}\\mathbf{Mat})^{\\textrm{co}}\\times\\mathcal{V}\\textrm{-}\\mathbf{Mat}\\longrightarrow\\mathcal{V}\\textrm{-}\\mathbf{Mat}\n\\end{displaymath}\nwhere $\\mathcal{V}$-$\\mathbf{Mat}^\\textrm{co}$ is the bicategory of $\\mathcal{V}$-matrices with reversed 2-cells,\nsince $\\mathcal{H}(\\caa{D}^\\mathrm{op})=\\left(\\mathcal{H}(\\caa{D})\\right)^\\textrm{co}$. On objects is given by exponentiation, \nand the functor on hom-categories, for all $(X,Y),(Z,W)$, is\n\\begin{equation}\\label{Hom_}\n\\ensuremath{\\mathrm{Hom}}_{(X,Y),(Z,W)}\\colon\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,Z)^\\mathrm{op}\\times\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,W)\\to\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y^X,W^Z)\n\\end{equation}\nis given by $\\ensuremath{\\mathrm{Hom}}(S,T)=H_1(S,T)$ as in \\cref{H1onobjects} on objects and \n$\\ensuremath{\\mathrm{Hom}}(\\sigma,\\tau)=H_1(\\sigma,\\tau)$ as in \\cref{H1onarrows} on globular 2-morphisms, i.e. 2-cells.\n\nThe hom-categories of the bicategory $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$ are the functor categories $\\mathcal{V}$-$\\mathbf{Mat}(X,Y)=\\mathcal{V}^{X\\times Y}$.\nThe endo-hom-categories for a fixed set $X$ will play an important role; the following proposition exhibits\nsome useful properties.\n\n\\begin{prop}\\label{propVMat}\nLet $\\mathcal{V}$ be a monoidal category with all colimits such that $\\otimes$ preserves them on both entries. For any 0-cell $X$,\nthe hom-category $\\mathcal{V}$-$\\mathbf{Mat}(X,X)=[X\\times X,\\mathcal{V}]$ is\n\\begin{enumerate}[(i)]\n\\item cocomplete and has all limits that exist in $\\mathcal{V}$;\n\\item a monoidal category, and $\\otimes=\\circ$ preserves any colimit on both entries;\n\\item locally presentable when $\\mathcal{V}$ is; \n\\item monoidal closed when $\\mathcal{V}$ is monoidal closed with products.\n\\end{enumerate}\n\\end{prop} \n\\begin{proof}\\hfill\n\n$(i)$ They are formed pointwise from those in $\\mathcal{V}$.\n\n$(ii)$ $(\\mathcal{V}\\text{-}\\mathbf{Mat}(X,X),\\circ,1_X)$ is monoidal for any bicategory, \\cref{monadsaremonoids}.\n\nIf $(G_j\\to G\\,|\\,j\\in\\mathcal{J})$ is a colimiting cocone of shape $\\mathcal{J}$ in $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$, for any $x,y\\in X$\nthe arrows $G_j(x,y)\\to G(x,y)$ form colimiting cocones in $\\mathcal{V}$. If we apply $S\\circ -$,\nwe obtain a collection of 2-cells $(S\\circ G_j\\to S\\circ G\\,|\\,j\\in\\mathcal{J})$ in $\\mathcal{V}$-$\\mathbf{Mat}$.\nFor this to be a colimit, for any $x,z\\in X$ the arrows\n\\begin{displaymath}\n\\sum_{y\\in X}{G_j(x,y)\\otimes S(y,z)}\\longrightarrow\n\\sum_{y\\in X}{{\\mathrm{colim}_j}G_j(x,y)\\otimes S(y,z)}\n\\end{displaymath}\nmust be colimiting in $\\mathcal{V}$, which is the case since $(-\\otimes A)$ preserves colimits:\n\\begin{align*}\n\\sum_{y\\in X}{({\\mathrm{colim}_j}G_j(x,y))\\otimes S(y,z)}\n&\\cong\\sum_{y\\in X}{{\\mathrm{colim}_j}(G_j(x,y)\\otimes S(y,z))} \\\\\n&\\cong{\\mathrm{colim}_j}(\\sum_{y\\in X}{G_j(x,y)\\otimes S(y,z)}).\n\\end{align*}\n\n$(iii)$ This follows from \\cite[1.54]{LocallyPresentable}: any functor category $[\\mathcal{A},\\mathcal{V}]$ over a presentable category\n$\\mathcal{V}$ is also presentable.\n\n$(iv)$ This is obtained by a restriction of \\cref{H1onobjects} on globular 2-morphisms. It is not hard to establish a bijective\ncorrespondence\n\\begin{displaymath}\n\\xymatrix @R=.02in{\\qquad\\quad S\\circ T \\ar[rr] && R\\phantom{ABCDE} \n&\\mathrm{in}\\;\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)\\\\ \n\\ar@{-}[rr] &&& \\\\ \n\\qquad\\qquad S \\ar[rr] && F(T,R)\\phantom{ABC} \n& \\mathrm{in}\\;\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)} \n\\end{displaymath}\nfor $G(T,R)(x,y):=\\prod_{z\\in X}{[T(y,z),R(x,z)]}$.\n\\end{proof}\n\n\n\\begin{rmk}\nThe endo-hom-categories of $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$ have in fact a \\emph{duoidal} structure, since they are equipped with a second, pointwise monoidal product\n\\begin{displaymath}\n(S\\bullet T)(x,y):=S(x,y)\\otimes T(x,y),\\quad J(x,y)=I,\n\\end{displaymath}\nThis point of view is discussed in \\cite[\\S 7]{Hopfcats}, without mentioning $\\mathcal{V}$-matrices.\nThis fact is crucial for expressing the so-called \\emph{semi-Hopf categories} (categories enriched in comonoids)\nas bimonoids in $(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X),\\circ,\\bullet,1_X,J)$, and subsequently \\emph{Hopf categories} as Hopf monoids\nin that duoidal category. This approach is relevant to work in progress \\cite{HopfcatsasHopfmonads}\nregarding the expression of Hopf categories as \\emph{Hopf monads}\nin a double categorical context. Work in similar direction, establishing\nan abstract context for various Hopf-structure generalized notions, can be found in \\cite{BohmLack,Gabipolyads};\nin fact, the above duoidal structure can be seen as a consequence of all sets being \\emph{opmap monoidales} in the monoidal bicategory $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$.\n\\end{rmk}\n\n\nDue to the first three part of the above proposition, we obtain the following corollary to \\cref{moncomonadm}.\n\\begin{cor}\\label{cofreecomonVMat}\nIf $\\mathcal{V}$ is a locally presentable monoidal category where $\\otimes$ preserves colimits in both entries, the forgetful functors\n\\begin{gather*}\nS:\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X))\\to\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X) \\\\\nU:\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X))\\to\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)\n\\end{gather*}\nare monadic and comonadic respectively, and all categories are locally presentable.\n\\end{cor}\nNotice that $(\\mathcal{V}\\text{-}\\mathbf{Mat}(X,X),\\circ,1_X)$ is non-braided monoidal, therefore\nthe categories of monoids and comonoids cannot inherit a monoidal structure.\n\n\n\\subsection{\\texorpdfstring{$\\mathcal{V}$}{V}-graphs and \\texorpdfstring{$\\mathcal{V}$}{V}-categories}\\label{Vgraphs}\n\nIn this section, we will describe $\\mathcal{V}$-graphs and $\\mathcal{V}$-categories within the context of $\\mathcal{V}$-matrices.\nThis allows us, by dualizing certain arguments, to later construct the category of $\\mathcal{V}$-cocategories in a natural way. This is motivated\nby realizing enriched categories and cocategories as `many-object' generalizations of monoids and comonoids in a monoidal category:\na one-object $\\mathcal{V}$-category is an object in $\\ensuremath{\\mathbf{Mon}}(\\mathcal{V})$.\nFor enriched graphs or categories, usually there are no required assumptions on the monoidal base $\\mathcal{V}$\nas it is clear from their definition. In this matrices context though, we ask that $\\mathcal{V}$ has coproducts\npreserved by the tensor product.\n\nA (small) $\\mathcal{V}$-\\emph{graph} $\\mathcal{G}$ consists of a set of objects $\\ensuremath{\\mathrm{ob}}\\mathcal{G}$, and for every pair of objects $x,y\\in\\ensuremath{\\mathrm{ob}}\\mathcal{G}$\nan object $\\mathcal{G}(x,y)\\in\\mathcal{V}$. If $\\mathcal{G}$ and $\\mathcal{H}$ are $\\mathcal{V}$-graphs, a $\\mathcal{V}$-\\emph{graph morphism}\n$F:\\mathcal{G}\\to\\mathcal{H}$ consists of a function $f:\\ensuremath{\\mathrm{ob}}\\mathcal{G}\\to\\ensuremath{\\mathrm{ob}}\\mathcal{H}$ between their sets of objects, together with\narrows $F_{x,y}:\\mathcal{G}(x,y)\\to\\mathcal{H}(fx,fy)$ in $\\mathcal{V}$, for each pair of objects $x,y$ in $\\mathcal{G}$.\nThese data, with appropriate compositions and identities, form a category $\\mathcal{V}$-$\\mathbf{Grph}$.\nThere is an evident forgetful functor $Q\\colon\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\to\\B{Set}$ which maps a graph\nto its set of objects and a graph morphism to its underlying function.\n\nIf $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is the double category of $\\mathcal{V}$-matrices, it follows that the category of graphs is precisely that of its endomorphisms\nas described in \\cref{moncomondouble}, i.e. $\\mathcal{V}\\text{-}\\mathbf{\\caa{M}at}_1^\\bullet=\\mathcal{V}\\text{-}\\mathbf{Grph}$.\nIndeed, objects are endo-$\\mathcal{V}$-matrices$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{G:X\\ar[r]|-{\\object@{|}} & X}$given by families of objects $\\{G(x,x')\\}_X$ in $\\mathcal{V}$, and morphisms between them are $\\alpha_f:G_X\\to H_Y$\nas in \\cref{endo2morphism}, given by arrows $\\alpha_{x,x'}:G(x,x')\\to H(fx,fx')$ in $\\mathcal{V}$ by \\cref{VMat2morphism}.\n\n\\begin{rmk}\nThis viewpoint is very similar to that of \\cite[Remark 2.5]{Monadsindoublecats}, where it is observed that the category $\\mathbf{Grph}_\\mathcal{E}$ of graphs\nand graph morphisms internal to a finitely complete $\\mathcal{E}$ is identified with the category of endomorphisms\nand vertical endomorphism maps in the double category $\\caa{S}\\mathbf{pan}_\\mathcal{E}$, i.e. in our notation\n$\\caa{S}\\mathbf{pan}_\\mathcal{E}^\\bullet=\\mathbf{Grph}_\\mathcal{E}$.\n\\end{rmk}\n\nIn fact, $\\mathcal{V}$-graph morphisms can equivalently be seen as functions $f:X\\to Y$ between the sets of objects, equipped with a 2-cell\n\\begin{displaymath}\n\\xymatrix @C=.6in\n{X\\ar @\/^2ex\/[r]|-{\\object@{|}}^-{G}\n\\ar@\/_2ex\/[r]|-{\\object@{|}}_-{f^*\\circ H\\circ f_*}\n\\rtwocell<\\omit>{\\;\\phi} & X}\n\\end{displaymath}\nin $\\mathcal{V}$-$\\mathbf{Mat}$, where $f_*$ and $f^*$ are as in \\cref{f*}. This is clear by the following\ncorollary to \\cref{D_1^.bifibred}, since $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is a fibrant double category.\n\n\\begin{prop}\\label{VGrphbifibr}\nThe category $\\mathcal{V}$-$\\mathbf{Grph}$ is a bifibration over $\\mathbf{Set}$.\n\\end{prop}\n\nThe pseudofunctors giving rise to the fibred and opfibred structure are precisely given by \\cref{pseudofunctorsdoublebifibration}\nin this case,\n\\begin{equation}\\label{Grphpseudofunctors}\n \\mathscr{M}:\\xymatrix @R=.02in{\\B{Set}^\\mathrm{op}\\ar[r] & \\mathbf{Cat}, \\\\\nX\\ar @{|.>}[r]\\ar[dd]_-f & \\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X) \\\\ \\hole \\\\\nY\\ar @{|.>}[r] & \\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Y)\\ar[uu]_-{f^*\\circ\\text{-}\\circ f_*}}\n\\qquad \\mathscr{F}:\\xymatrix @R=.02in\n{\\B{Set}\\ar[r] & \\mathbf{Cat} \\\\\nX\\ar @{|.>}[r] \\ar[dd]_-f & \\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)\\ar[dd]^-{f_*\\circ\\text{-}\\circ f^*} \\\\\\hole \\\\\nY\\ar @{|.>}[r] & \\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Y)}\n\\end{equation}\nand the Grothendieck categories give the following isomorphic characterization of the category of $\\mathcal{V}$-graphs.\n\n\\begin{lem}\\label{charactVGrph}\nThe category $\\mathcal{V}$-$\\mathbf{Grph}$ has objects $(G,X)\\in\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)\\times\\mathbf{Set}$\nand arrows $(\\phi,f):(G,X)\\to(H,Y)$ or equivalently $(\\psi,f)$ given by\n\\begin{displaymath}\n\\begin{cases}\n\\phi:G\\to f^*Hf_* &\\textrm{in }\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)\\\\\nf:X\\to Y & \\textrm{in }\\mathbf{Set}\n\\end{cases} \\;\\textrm{or}\\;\n\\begin{cases}\n\\psi:f_*Gf^*\\to H &\\textrm{in }\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Y)\\\\\nf:X\\to Y & \\textrm{in }\\mathbf{Set}.\n\\end{cases}\n\\end{displaymath}\n\\end{lem}\nTo see how this works, using \\cref{matrixmachine} we can explicitly compute the composite\n\\begin{equation}\\label{machine1}\n(f^*Hf_*)_{x,x'} =\nI\\otimes(Hf_*)_{x,fx'}\n= I\\otimes H_{fx,fx'}\\otimes I\n\\end{equation}\nhence $\\phi$ has components $\\phi_{x,x'}:G_{x,x'}\\to I\\otimes H_{fx,fx'}\\otimes I\\cong H_{fx,fx'}$.\nSimilarly,\n\\begin{equation}\\label{machine2}\n(f_*Gf^*)_{y,y'}=\\sum_{fx=y,fx'=y'}{I\\otimes G_{x,x'}\\otimes I}\n\\cong\\sum_{fx=y,fx'=y'}{G_{x,x'}}\n\\end{equation}\nso $\\psi_{y,y'}:\\sum_{\\scriptscriptstyle{\\stackrel{fx=y}{fx'=y'}}}{I\\otimes G_{x,x'}\\otimes I}\\to H_{y,y'}$\nwhich, for fixed $x\\in f^{-1}(y)$ and $x'\\in f^{-1}(y')$ corresponds uniquely to $\\phi_{x,x'}$.\n\nNotice that the above lemma is completely in terms of the bicategory $\\mathcal{V}$-$\\mathbf{Mat}$; moving between this and\nthe double $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}_1^\\bullet$ perspective will be efficient in the proofs that follow.\n\nWhen $\\mathcal{V}$ is braided, $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is monoidal double by \\cref{VMatmonoidaldoublefibrant} thus\nits category of endomorphisms is also monoidal by \\cref{DendoMonDComonDmonoidal}: the tensor product is given\nlike in \\cref{monoidalVMat} for endo-1-cells and the monoidal unit is the unit $\\mathcal{V}$-matrix$\\matr{I}{\\{*\\}}{\\{*\\}}$.\nBraiding or symmetry is also inherited from $\\mathcal{V}$.\n\nRecall from \\cref{VMatlocallymoidalclosed} that when $\\mathcal{V}$ is furthermore closed with products,\nthe double category of $\\mathcal{V}$-matrices is locally closed monoidal. Hence by \\cref{Dendoclosed}, we deduce\nthat $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}^\\bullet_1=\\mathcal{V}\\textrm{-}\\mathbf{Grph}$ is also monoidal closed.\n\n\\begin{prop}\\label{VGrphclosed}\nSuppose $\\mathcal{V}$ is a braided monoidal closed category with products and coproducts. The restriction of\n\\cref{H1functor} on the endomorphism category\n\\begin{displaymath}\nH_1^\\bullet\\colon\\mathcal{V}\\textrm{-}\\mathbf{Grph}^\\mathrm{op}\\times\n\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\to\\mathcal{V}\\textrm{-}\\mathbf{Grph}\n\\end{displaymath}\nmapping $(G_X$, $H_Y)$ to the graph $H_1^\\bullet(G,H)_{Y^X}$ given by\n$H_1^\\bullet(G,H)(s,k):=\\prod_{x,x'}[G(x,x'),H(sx,kx')]$\nfor $s,k\\in Y^X$ is the internal hom of $\\mathcal{V}$-$\\mathbf{Grph}$. \n\\end{prop}\n\nFollowing \\cite{KellyLack,Wolff} or the more general case of bicategory enrichment \\cite{VarThrEnr}, we gather some of\nthe main categorical properties of $\\mathcal{V}$-$\\mathbf{Grph}$.\n\n\\begin{prop}\\label{Vgraphprops}\\hfill\n\\begin{enumerate}\n\\item $\\mathcal{V}$-$\\mathbf{Grph}$ is complete when $\\mathcal{V}$ is;\n\\item $\\mathcal{V}$-$\\mathbf{Grph}$ is cocomplete when $\\mathcal{V}$ is;\n\\item \\cite[4.4]{KellyLack} $\\mathcal{V}$-$\\mathbf{Grph}$ is locally presentable when $\\mathcal{V}$ is.\n\\end{enumerate}\n\\end{prop}\n\\begin{proof}\n(1) The constructions of limits of enriched graphs are built up from limits in $\\B{Set}$ and $\\mathcal{V}$ in a straightforward way.\n\n(2) Suppose $F$ is a diagram of shape $\\mathcal{J}$ in $\\mathcal{V}$-$\\mathbf{Grph}$\n\\begin{equation}\\label{diagraminVgraph}\n F:\\xymatrix @R=.01in @C=.5in\n{\\mathcal{J}\\ar[r] & \\mathcal{V}\\textrm{-}\\mathbf{Grph} \\\\\nj\\ar@{.>}[r]\n\\ar[dd]_-\\theta & \n(G_j,X_j)\\ar[dd]^-{(\\psi_\\theta,f_\\theta)} \\\\\n\\hole \\\\\nk\\ar@{.>}[r] & (G_k,X_k).}\n\\end{equation}\nBy \\cref{charactVGrph}, $f_\\theta$ is a function between the sets and\n$(f_\\theta)_*G_j(f_\\theta)^*\\stackrel{\\psi_\\theta}{\\Rightarrow}G_k$ is a 2-cell in $\\mathcal{V}$-$\\mathbf{Mat}$.\nThe composite $\\mathcal{J}\\to\\mathcal{V}\\text{-}\\mathbf{Grph}\\to\\mathbf{Set}$ has a colimiting cocone $(\\tau_j:X_j\\to X\\,|\\,j\\in\\mathcal{J})$ in $\\B{Set}$;\nsince $\\tau_j=f_\\theta\\tau_k$ for any $f_\\theta:X_j\\to X_k$, we have isomorphisms of $\\mathcal{V}$-matrices \n\\begin{displaymath}\n \\xymatrix\n{X_j\\ar[rr]|-{\\object@{|}}^-{(\\tau_j)_*}\n_-{\\stackrel{\\stackrel{\\phantom{A}}{\\zeta}}{\\cong}}\n\\ar[dr]|-{\\object@{|}}_-{(f_\\theta)_*} && X, \\\\\n& X_k\\ar[ur]|-{\\object@{|}}_-{(\\tau_k)_*} &}\\qquad\n\\xymatrix\n{X\\ar[rr]|-{\\object@{|}}^-{(\\tau_j)^*}\n_-{\\stackrel{\\stackrel{\\phantom{A}}{\\xi}}{\\cong}}\n\\ar[dr]|-{\\object@{|}}_-{(\\tau_k)^*} && X_j \\\\\n& X_k\\ar[ur]|-{\\object@{|}}_-{(f_\\theta)^*} &}\n\\end{displaymath}\nwhere $\\zeta$ and $\\xi$ are defined as in \\cref{zeta}. Now consider the functor \n\\begin{equation}\\label{defKdiagram}\nK:\\xymatrix @C=.6in @R=.02in\n{\\mathcal{J}\\ar[r]\n& \\mathcal{V}\\textrm{-}\n\\mathbf{Mat}(X,X)\\qquad\\qquad\\qquad\\qquad\\quad \\\\\nj\\ar @{|.>}[r] \\ar[dd]_-{\\theta}& \n(\\tau_j)_*G_j(\\tau_j)^*\n{\\scriptstyle{\\cong}}(\\tau_k)_*(f_\\theta)_*G_j\n(f_\\theta)^*(\\tau_k)^*\n\\ar@<-14ex>\n[dd]^-{(\\tau_k)_*\\psi_\\theta(\\tau_k)^*}\\\\\n\\hole \\\\\nk\\ar@{.>}[r] & \n(\\tau_k)_*G_k(\\tau_k)^*\n\\phantom{\\;\\cong(\\tau_k)_*(f_\\theta)_*G_j\n(\\tau_k)^*(f_\\theta)^*}}\n\\end{equation}\nwhich explicitly maps an arrow $\\theta:j\\to k$ in $\\mathcal{J}$ to the composite 2-cell\n\\begin{equation}\\label{Konarrows}\n\\xymatrix @R=.4in @C=.8in\n{X\\ar@\/_3.5ex\/[dr]|-{\\object@{|}}_-{(\\tau_k)^*}\n\\drtwocell<\\omit>{'\\stackrel{\\xi}{\\cong}}\n\\ar[r]|-{\\object@{|}}^-{(\\tau_j)^*} &\n X_j\\ar[r]|-{\\object@{|}}\n^-{G_j} & X_j \\ar[d]|-{\\object@{|}}\n^-{(f_\\theta)_*}\\ar[r]|-{\\object@{|}}^-\n{(\\tau_j)_*} & X.\n\\dltwocell<\\omit>{'\\stackrel{\\zeta}{\\cong}}\\\\\n & X_k\\ar[u]|-{\\object@{|}}\n^-{(f_\\theta)^*}\\ar[r]|-{\\object@{|}}_-{G_k}\n\\rtwocell<\\omit>{<-4>\\;\\psi_\\theta} & \nX_k\\ar@\/_3.5ex\/[ur]|-{\\object@{|}}_-{(\\tau_k)_*} &}\n\\end{equation}\nThe colimit of $K$ is formed pointwise in $[X\\times X,\\mathcal{V}]$, so there is a colimiting cocone \n$(\\lambda_j:(\\tau_j)_*G_j(\\tau_j)^*\\to G\\,|\\,j\\in\\mathcal{J})$. These data allow us to form a new cocone \n\\begin{displaymath}\n\\big((G_j,X_j)\\xrightarrow{(\\lambda_j,\\tau_j)}\n(G,X)\\,|\\,j\\in\\mathcal{J}\\big)\n\\end{displaymath}\nfor the initial diagram $F$ in $\\mathcal{V}$-$\\mathbf{Grph}$, since the pairs $(\\lambda_j,\\tau_j)$ commute accordingly with the $(\\psi_\\theta,f_\\theta)$'s; \nthis cocone can be checked to be colimiting, since $\\tau_j$ and $\\lambda_j$ are.\n\n(3) Briefly, if $\\mathcal{V}$ is a locally $\\lambda$-presentable category and the set $\\mathscr{G}$ of objects constitutes\na strong generator of $\\mathcal{V}$, it can be shown that the set\n\\begin{displaymath}\n \\{(\\bar{G},2)\\;\/\\;G\\in\\mathscr{G}\\;\\textrm{or}\\;G=0\\}\n\\end{displaymath}\nconstitutes a strong generator of $\\mathcal{V}$-$\\mathbf{Grph}$, where the graph $(\\bar{G},2)$ has as set of objects\n$2=\\{0,1\\}$ and is given by $\\{\\bar{G}(0,0)=G,\\bar{G}(0,1)=\\bar{G}(1,0)=\\bar{G}(1,1)=0\\}$ in $\\mathcal{V}$. Also, this set is $\\lambda$-presentable\nin that the functors $\\mathcal{V}\\textrm{-}\\mathbf{Grph}((\\bar{G},2),-):\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\to\\mathbf{Set}$ preserve $\\lambda$-filtered colimits.\n\\end{proof}\n\nPassing on to $\\ca{V}\\textrm{-}\\B{Cat}$, again following the more general \\cite{VarThrEnr}, a $\\mathcal{V}$-category is defined to be a monad in\nthe bicategory $\\mathcal{V}$-$\\mathbf{Mat}$. Unravelling \\cref{monadbicat}, it consists \nof a set $X$ together with an endoarrow$\\SelectTips{eu}{10}\\xymatrix @C=.2in{A:X\\ar[r]|-{\\object@{|}} & X}$ (i.e. a $\\mathcal{V}$-graph $A_X$)\nequipped with two 2-cells, the multiplication and the unit\n\\begin{displaymath}\n\\xymatrix @R=.1in @C=.4in\n{& X \\ar[dr]|-{\\object@{|}}\n^-{A} &\\\\\nX\\ar[ru]|-{\\object@{|}}^-A\n\\ar @\/_\/[rr]|-{\\object@{|}}_-A\n\\rrtwocell<\\omit>{<-1.3>\\;M} && X}\n\\quad\n\\xymatrix @C=.3in @R=.1in\n{\\hole \\\\ \\textrm{and} }\n\\quad\n\\xymatrix @C=.3in @R=.1in\n{\\hole \\\\\nX \\rrtwocell<\\omit>{\\eta}\n\\ar @\/^2.2ex\/ [rr]|-{\\object@{|}}^-{1_X}\n\\ar @\/_2.2ex\/ [rr]|-{\\object@{|}}_-A && X}\n\\end{displaymath}\nsatisfying the following axioms:\n\\begin{displaymath}\n\\xymatrix @R=.2in\n{& X\\ar[r]|-{\\object@{|}}^-A &\nX\\ar @\/^\/[dr]|-{\\object@{|}}^-A & \\\\\nX\\ar @\/^\/[ur]|-{\\object@{|}}^-A \n\\ar @\/_2ex\/[urr]|-{\\object@{|}}_-A\n\\ar @\/_3ex\/[rrr]|-{\\object@{|}}_-A\n\\urrtwocell<\\omit>{<-.3>\\;M}\n&\\urrtwocell<\\omit>{<1.3>\\;M} && X}\n\\quad\\xymatrix @R=.2in\n{\\hole\\\\\n=}\\quad\n\\xymatrix @R=.2in\n{\\drrtwocell<\\omit>{<1.3>\\;M} & \nX\\ar[r]|-{\\object@{|}}^-A \n\\ar @\/_2ex\/[drr]|-{\\object@{|}}_-A \n\\drrtwocell<\\omit>{<-.3>\\;M} &\nX\\ar @\/^\/[dr]|-{\\object@{|}}^-A & \\\\\nX\\ar @\/^\/[ur]|-{\\object@{|}}^-A \n\\ar @\/_3ex\/[rrr]|-{\\object@{|}}_-A\n&&& X,}\n\\end{displaymath}\n\\begin{displaymath}\n\\xymatrix @C=.5in @R=.2in\n{& X \\ar @\/^\/[dr]|-{\\object@{|}}^-A &\\\\\nX\\urrtwocell<\\omit>{<1.3>\\;M}\n\\urtwocell<\\omit>{\\eta}\n\\ar @\/^2ex\/[ur]|-{\\object@{|}}^-{1_X}\n\\ar @\/_2ex\/[ur]|-{\\object@{|}}_-A \n\\ar @\/_2ex\/[rr]|-{\\object@{|}}_-A\n&& X}\n\\xymatrix @C=.5in @R=.2in\n{\\hole \\\\\n=}\n\\xymatrix @C=.5in @R=.2in\n{\\hole\\\\\nX\\rtwocell<\\omit>{\\;1_A}\n\\ar @\/^2.3ex\/[r]|-{\\object@{|}}^-A\n\\ar @\/_2.3ex\/[r]|-{\\object@{|}}_A \n& X}\n\\xymatrix @C=.5in @R=.2in\n{\\hole \\\\\n=}\n\\xymatrix @C=.4in @R=.2in\n{\\drrtwocell<\\omit>{<1.3>\\;M}\n& X \\ar @\/^2ex\/[dr]|-{\\object@{|}}^-{1_X} \n\\ar @\/_2ex\/[dr]|-{\\object@{|}}_-A \n\\drtwocell<\\omit>{\\eta} &\\\\\nX \\ar @\/^\/[ur]|-{\\object@{|}}^-A\n\\ar @\/_2ex\/[rr]|-{\\object@{|}}_-A\n&& X.}\n\\end{displaymath}\nIn terms of components, they are given by\n\\begin{displaymath}\nM_{x,z}\\colon\\sum_{y\\in X}{A(x,y)\\otimes A(y,z)}\\to A(x,z)\\quad\\mathrm{and}\\quad\\eta_x\\colon I\\to A(x,x)\n\\end{displaymath}\nwhich are the usual composition law and identity elements.\nThe relations that $M$ and $\\eta$ have to satisfy give the usual associativity and unit axioms. By \\cref{monadsaremonoids}, a monad\nin a bicategory is the same as a monoid in the appropriate endoarrow hom-category, \\emph{i.e.} a $\\mathcal{V}$-category\n$A$ with set of objects $X$ is a monoid in the monoidal category ($\\mathcal{V}$-$\\mathbf{Mat}(X,X)$,$\\circ$,$1_X$).\n\nA $\\mathcal{V}$-functor $F:\\mathcal{A}\\to\\mathcal{B}$ between two $\\mathcal{V}$-categories $A_X$ and $B_Y$ is as usual defined as a morphism\nof graphs $\\alpha_f:A_X\\to B_Y$ which respects the composition law and the identities.\nNaturally, one could ask whether this corresponds to the notion of a monad morphism; as will be clear by what follows, this is not the case,\nsee \\cref{Vfunct=monadopfunct}.\n\nIn fact, the category $\\mathcal{V}$-$\\mathbf{Cat}$ is fully encompassed as the category of monads $\\mathbf{Mnd}(\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at})$ of \\cref{Monadindoublecat}\nfor the double category of $\\mathcal{V}$-matrices. Indeed, objects are monads$\\SelectTips{eu}{10}\\xymatrix@C=.2in\n{A:X\\ar[r]|-{\\object@{|}} & X}$in its horizontal\nbicategory, and morphisms are arrows between the underlying graphs\nthat respect the structure: writing down what diagrams \\cref{monadhom} give in components for $\\caa{D}=\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$, we end up to the usual axioms\n\\begin{equation}\\label{Vfunctaxioms}\n\\xymatrix @R=.5in @C=.5in\n{A(x,y)\\otimes A(y,z)\\ar[r]^-{M^A_{x,y,z}}\\ar[d]_-{\\alpha_{x,y}\\otimes\\alpha_{y,z}} & A(x,z)\\ar[d]^-{\\alpha_{x,z}}\\\\\nB(fx,fy)\\otimes B(fy,fz)\\ar[r]_-{M^B_{fx,fy,fz}} & B(fx,fz),}\\qquad\n\\xymatrix @R=.5in @C=.5in\n{I\\ar[r]^-{\\eta_x}\\ar[dr]_-{\\eta_{fx}} & A(x,x)\\ar[d]^-{\\alpha_{xx}}\\\\\n& B(fx,fx)}\n\\end{equation}\n\nDue to the fibrant structure of $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$, we obtain the following as a corollary to\n\\cref{MonComonfibred}.\n\n\\begin{prop}\\label{VCatfibred}\nThe category $\\mathcal{V}$-$\\mathbf{Cat}$ is a fibration over $\\mathbf{Set}$.\n\\end{prop}\n\nThe pseudofunctor that gives rise to this fibration is $\\mathscr{M}$ from \\cref{Grphpseudofunctors},\nrestricted between the categories of monoids of the endo-hom-categories. For this to be well-defined, we note\nthe following corollary to \\cref{pseudofunctorsrestrict} for $\\caa{D}=\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$.\n\\begin{cor}\\label{B*monoid}\nLet $B_Y$ be a $\\mathcal{V}$-category. For any function $f:X\\to Y$,\n\\begin{displaymath}\n\\SelectTips{eu}{10}\\xymatrix @C=.3in\n{X\\ar[r]|-{\\object@{|}}^-{f_*} & Y\\ar[r]|-{\\object@{|}}^-B & Y\\ar[r]|-{\\object@{|}}^-{f^*} & X}\n\\end{displaymath}\nis a monoid in $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$, \\emph{i.e.} $(f^*Bf_*)_X$ is a $\\mathcal{V}$-category.\n\\end{cor}\n\nThe new composition and unit are given by \\cref{compositemonoid} in this case, i.e.\n$M'=f^*\\left(M\\cdot(B\\dot{\\varepsilon} B)\\right)f_*$ and $\\eta'=(f^*\\eta f_*)\\cdot\\dot{\\eta}$ using pasting operations,\nwhere $\\dot{\\eta},\\dot{\\varepsilon}$ are the unit and counit of $f_*\\dashv f^*$ as in \\cref{fetafepsilon}.\n\nOnce again, the Grothendieck construction that gives rise to the above fibration provide\nthe following isomorphic characterization of the category of enriched categories and functors;\ncompare with \\cref{charactVGrph}.\n\n\\begin{lem}\\label{charactVCat}\nThe objects of $\\mathcal{V}$-$\\mathbf{Cat}$ are $(A,X)\\in\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X))\\times\\mathbf{Set}$\nand morphisms are $(\\phi,f):(A,X)\\to(B,Y)$ where\n\\begin{displaymath}\n\\begin{cases}\n\\phi:A\\to f^*Bf_* &\\textrm{in }\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X))\\\\\nf:X\\to Y & \\textrm{in }\\mathbf{Set}.\n\\end{cases}\n\\end{displaymath}\n\\end{lem}\n\nUsing the mates correspondence for the appropriate 2-cells as in \\cref{matesforcompconj}\nso that $\\phi$ corresponds to $\\bar{\\phi}:f_*A\\Rightarrow Bf_*$, we can the $\\mathcal{V}$-functors axioms in the form\n\\begin{align*}\n\\xymatrix @C=.5in @R=.5in\n{X\\ar[r]|-{\\object@{|}}^-A\\ar[d]|-{\\object@{|}}_-{f_*}\\drtwocell<\\omit>{\\bar{\\phi}}\n& X\\ar[r]|-{\\object@{|}}^-A\\ar[d]|-{\\object@{|}}^-{f_*}\\drtwocell<\\omit>{\\bar{\\phi}}\n& X \\ar[d]|-{\\object@{|}}^-{f_*}\\\\\nY \\ar[r]|-{\\object@{|}}_-B\\ar @\/_6ex\/[rr]|-{\\object@{|}}_-B\\rrtwocell<\\omit>{<3>\\;M}\n& Y \\ar[r]|-{\\object@{|}}_-B & Y} \n&\\xymatrix @R=.2in{\\hole \\\\ = \\\\ \\hole}\n\\xymatrix @C=.5in @R=.3in\n{& X \\ar @\/^\/[dr]|-{\\object@{|}}^-{A} &\\\\\nX\\ar[d]|-{\\object@{|}}_-{f_*}\\ar @\/^\/[ru]|-{\\object@{|}}^-A\\ar[rr]|-{\\object@{|}}_-A\\rrtwocell<\\omit>{<-3>\\;M}\n\\drrtwocell<\\omit>{\\bar{\\phi}} && X\\ar[d]|-{\\object@{|}}^-{f_*}\\\\\nY \\ar[rr]|-{\\object@{|}}_-B && Y,} \\\\\n\\xymatrix @C=1.2in @R=.5in\n{X\\ar @\/^5ex\/[r]|-{\\object@{|}}^-{1_X} \\rtwocell<\\omit>{<-2>\\eta}\\ar[r]|-{\\object@{|}}_-{A}\\ar[d]|-{\\object@{|}}_-{f_*}\n& X \\ar[d]|-{\\object@{|}}^-{f_*} \\\\\nY\\ar[r]|-{\\object@{|}}_-{B}\\rtwocell<\\omit>{<-4>\\bar{\\phi}} & Y}\n&\\xymatrix{ = \\\\ \\hole}\n\\xymatrix @C=1.2in @R=.5in\n{X\\ar[r]|-{\\object@{|}}^-{1_X}\\ar[d]|-{\\object@{|}}_-{f_*}^{\\phantom{ab}\\cong}\\ar @{.>}[dr]|-{\\object@{|}}^-{f_*}\n& X\\ar[d]|-{\\object@{|}}^-{f_*}_{\\cong\\phantom{ab}} \\\\\nY\\ar[r]|-{\\object@{|}}^-{1_Y}\\ar @\/_5ex\/ [r]|-{\\object@{|}}_-B\\rtwocell<\\omit>{<2>\\eta} & Y.}\n\\end{align*}\nThe mate's components are $\\bar{\\phi}_{x,y}:I\\otimes A(x,x')\\to B(fx,fx')\\otimes I$ for $x'\\in f^{\\text{-1}}y$,\nand these diagrams in components agree with \\cref{Vfunctaxioms} up to tensoring with $I$'s and composing\nwith the left and right unit constraints of $\\mathcal{V}$.\n\n\\begin{rmk}\\label{Vfunct=monadopfunct}\nNotice that $(f_*,\\bar{\\phi})$ constitutes a colax monad functor (\\cref{monadfunctor}) between the monads $A_X$ and $B_Y$ in \nthe bicategory $\\mathcal{V}$-$\\mathbf{Mat}$. Evidently, however, it is not true that any colax monad functor given by the data\n\\begin{displaymath}\n\\xymatrix @C=.45in @R=.3in\n{X\\ar[r]|-{\\object@{|}}^-A \\ar[d]|-{\\object@{|}}_-S \\rtwocell<\\omit>{<4>\\chi} & X\\ar[d]|-{\\object@{|}}^-S\\\\\nY\\ar[r]|-{\\object@{|}}_-B & Y}\n\\end{displaymath}\nis a $\\mathcal{V}$-functor, since not every$\\SelectTips{eu}{10}\\xymatrix @C=.2in\n{S:X\\ar[r]|-{\\object@{|}} & Y}$is of the form $f_*$ for some function $f:X\\to Y$.\nThis explains why the category $\\mathcal{V}$-$\\mathbf{Cat}$ cannot be characterized as $\\mathbf{Mnd}(\\mathcal{V}$-$\\mathbf{Mat})$ for the bicategory,\neven if they have the same objects. Similar issues were discussed in a bigger depth in \\cite{GarnerShulman}.\n\nThis provides a distinct advantage when cosidering categories of monads in double categories rather than in the horizontal bicategory;\nthe notion of a $\\mathcal{V}$-functor properly matches the motion of a double monad map in $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$.\n\\end{rmk}\n\nAs it is well-known, but also deduced from \\cref{DendoMonDComonDmonoidal}, when $\\mathcal{V}$ is a braided monoidal category,\n$\\mathcal{V}$-$\\mathbf{Cat}$ is monoidal via the pointwise tensor product \\cref{monoidalVMat} like graphs.\nWe now move on to further properties of this category.\n\nSimilarly to the free monoid construction on an object in a monoidal $\\mathcal{V}$, there is an endofunctor on $\\mathcal{V}$-$\\mathbf{Grph}$ inducing the \n`free $\\mathcal{V}$-category' monad; for the proof below, see also \\cite{VarThrEnr,KellyLack}.\nWe spell it out in detail in our context, in order to later dualize for $\\mathcal{V}$-cocategories.\n\\begin{prop}\\label{freeVcatfunctor}\nLet $\\mathcal{V}$ be a monoidal category with coproducts, such that $\\otimes$ preserves them on both sides. The forgetful functor \n$\\tilde{S}:\\mathcal{V}\\textrm{-}\\mathbf{Cat}\\to\\mathcal{V}\\textrm{-}\\mathbf{Grph}$\nhas a left adjoint $\\tilde{L}$, which maps a $\\mathcal{V}$-graph$\\SelectTips{eu}{10}\\xymatrix @C=.2in{G:X\\ar[r]|-{\\object@{|}} & X}$to\nthe geometric series\n\\begin{displaymath}\n\\SelectTips{eu}{10}\\xymatrix @C=.3in\n{\\sum\\limits_{n\\in\\caa{N}}{G^{\\otimes n}}:X\\ar[r]\n|-{\\object@{|}} & X.}\n\\end{displaymath}\n\\end{prop}\n\\begin{proof}\nRecall that by \\cref{propVMat}, $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$ admits the same class of colimits as $\\mathcal{V}$, \nand also $\\otimes=\\circ$ preserves them. Hence, the forgetful $S$ from its category of monoids has a left adjoint\nas in \\cref{freemonoidprop}\n\\begin{displaymath}\nL:\\xymatrix @R=.02in\n{\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)\\ar[r] & \n\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X))\\\\\nG\\ar@{|->}[r] & \\sum_{n\\in\\caa{N}}{G^n}}\n\\end{displaymath}\nwhich by \\cref{charactVCat} means that this geometric series is a $\\mathcal{V}$-category with set of objects $X$. \nThe claim is that the induced functor\n\\begin{equation}\\label{deftildeL}\n\\tilde{L}:\\xymatrix @R=.02in @C=.4in\n{\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\ar[r] & \\mathcal{V}\\textrm{-}\\mathbf{Cat}\\\\\n(G,X)\\ar@{|->}[r] & (\\sum_nG^n,X)}\n\\end{equation}\nis a left adjoint of $\\tilde{S}$, i.e. for any $\\mathcal{V}$-category $B_Y$ and $\\phi_f\\colon G_X\\to\\tilde{S}(B_Y)$\na $\\mathcal{V}$-graph morphism, there exists a unique $\\mathcal{V}$-functor $H:(\\sum_nG^n)_X\\to B_Y$\nsuch that\n\\begin{equation}\\label{univprop}\n\\xymatrix @R=.2in\n{(G,X)\\ar[rr]^{\\tilde{\\eta}} \\ar[dr]_-F && \n\\tilde{S}(\\sum\\limits_{n\\in\\caa{N}}{G^n},X)\n\\ar @{.>}[dl]^-{\\tilde{S}H}\\\\\n& \\tilde{S}(B,Y) &}\n\\end{equation}\ncommutes, for $\\tilde{\\eta}:(G,X)\\to\\tilde{S}\\tilde{L}(G,X)$ the identity-on-objects inclusion of the summand $G$ into the series.\n\nBy \\cref{charactVGrph}, a $\\mathcal{V}$-graph functor $F$ is a pair $(\\phi,f)$ with $\\phi:G\\to f^*Bf_*$ an arrow in\n$\\mathcal{V}$-$\\mathbf{Mat}(X,X)$, and furthermore \\cref{B*monoid} ensures that $f^*Bf_*$ obtains a monoid structure. \nSince $L(G)$ is the free monoid on $G\\in\\mathcal{V}$-$\\mathbf{Mat}(X,X)$, $\\phi$ extends uniquely to a monoid morphism\n$\\chi:LG\\to f^*Bf_*$ such that\n\\begin{displaymath}\n\\xymatrix @R=.15in\n{G\\ar[rr]^{\\eta} \\ar[dr]_-{\\phi} && \n\\sum\\limits_{n\\in\\caa{N}}{G^n}\\ar @{.>}[dl]^-{S\\chi}\\\\\n& f^*Bf_* &}\n\\end{displaymath}\ncommutes in $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$, where $\\eta$ and $S$ are respectively the unit and forgetful functor of the `free monoid'\nadjunction $L\\dashv S$.\nBy \\cref{charactVCat}, this 2-cell $\\chi:\\sum_{n}{G^n}\\Rightarrow f^*Bf_*$ in $\\mathcal{V}$-$\\mathbf{Mat}$ determines\na $\\mathcal{V}$-functor $H=(\\chi,f):(LG,X)\\to(B,Y)$ satisfying the universal property \\cref{univprop}. These data suffice\nto define an adjoint functor $\\tilde{L}$ \\cref{deftildeL}, thus the `free $\\mathcal{V}$-category' adjunction\n$\\tilde{L}\\dashv\\tilde{S}:\\ca{V}\\textrm{-}\\B{Cat}\\to\\ca{V}\\textrm{-}\\B{Grph}$ is established.\n\\end{proof}\n\nAlso, as proved in detail in \\cite{Wolff} and later generalized in \\cite{VarThrEnr},\n$\\mathcal{V}$-$\\mathbf{Cat}$ has and the forgetful functor $\\tilde{S}$ reflects split coequalizers when $\\mathcal{V}$ is \ncocomplete. By Beck's monadicity theorem, since $\\tilde{S}$ also reflects isomorphisms, we have the following well-known result. \n\n\\begin{prop}\\label{VCatmonadic}\nIf $\\mathcal{V}$ is a cocomplete monoidal category such that $\\otimes$ preserves colimits on both variables,\n$\\tilde{S}:\\mathcal{V}$-$\\mathbf{Cat}\\to\\mathcal{V}$-$\\mathbf{Grph}$ is monadic.\n\\end{prop}\n\nSince $\\mathcal{V}$-$\\mathbf{Grph}$ is complete when $\\mathcal{V}$ is, we obtain the following corollary.\n\n\\begin{cor}\\label{VCatcomplete}\nThe category $\\mathcal{V}$-$\\mathbf{Cat}$ is complete when $\\mathcal{V}$ is.\n\\end{cor}\n\nMoreover, by \\cref{Vgraphprops} $\\mathcal{V}$-$\\mathbf{Grph}$ admits all colimits if $\\mathcal{V}$ does;\nsince any category of Eilenberg-Moore algebras has colimits if it has coequalizers of reflexive pairs and\nits base has colimits by a standard result in \\cite{Linton}, the following is also true.\n\n\\begin{cor}\\label{VCatcocomplete}\nThe category $\\mathcal{V}$-$\\mathbf{Cat}$ is cocomplete when $\\mathcal{V}$ is.\n\\end{cor}\n\nFinally, as shown in \\cite{KellyLack} the monad $\\tilde{S}\\tilde{L}$ is finitary. Thus by \\cite[Satz 10.3]{GabrielUlmer}\nwhich states that the category of algebras for a finitary monad over a locally presentable category retains that\nstructure, we obtain the following.\n\n\\begin{thm*}~\\cite[4.5]{KellyLack}\nIf $\\mathcal{V}$ is a monoidal closed category whose underlying ordinary category is locally $\\lambda$-presentable,\nthen $\\mathcal{V}$-$\\mathbf{Cat}$ is also $\\lambda$-presentable.\n\\end{thm*}\n\n\n\\subsection{\\texorpdfstring{$\\mathcal{V}$}{A}-cocategories}\\label{VcatsandVcocats}\n\nWe now proceed to the dualization of the concept of a $\\mathcal{V}$-category in the context of $\\mathcal{V}$-matrices,\nfollowing \\cref{comonadbicat}. Henceforth $\\mathcal{V}$ is again a monoidal category with\ncoproducts, such that the tensor product $\\otimes$ preserves them on both entries.\n\n\\begin{defi}\\label{cocategory}\nA $\\mathcal{V}$-\\emph{cocategory} $C$ is a comonad in the bicategory $\\mathcal{V}$-$\\mathbf{Mat}$. It consists of a set $X$ with \nan endoarrow$\\SelectTips{eu}{10}\\xymatrix @C=.2in{C:X\\ar[r]|-{\\object@{|}} & X}$(\\emph{i.e.} a $\\mathcal{V}$-graph $C_X$)\nequipped with two 2-cells, the comultiplication and the counit\n\\begin{displaymath}\n\\xymatrix @R=.1in @C=.4in\n{X \\ar[dr]|-{\\object@{|}}_-{C} \\ar @\/^3ex\/[rr]|-{\\object@{|}}^-C\\rrtwocell<\\omit>{<.5>\\Delta} && X \\\\\n & X\\ar[ur]|-{\\object@{|}}_-C &}\n\\quad\\textrm{and}\\quad\n\\xymatrix @C=.3in\n{X \\rrtwocell<\\omit>{<0>\\epsilon}\\ar @\/^2.2ex\/ [rr]|-{\\object@{|}}^-{C}\\ar @\/_2.2ex\/ [rr]|-{\\object@{|}}_-{1_X} && X}\n\\end{displaymath}\nsatisfying the following axioms:\n\\begin{gather}\\label{Vfunctaxioms2cells}\n\\xymatrix @R=.2in\n{X\\ar @\/_\/[dr]|-{\\object@{|}}_-C\\ar @\/^3ex\/[drr]|-{\\object@{|}}^-C\\ar @\/^4ex\/[rrr]|-{\\object@{|}}^-C\\drrtwocell<\\omit>{<+.3>\\Delta}\n&\\drrtwocell<\\omit>{<-1.3>\\Delta} && X \\\\\n& X\\ar[r]|-{\\object@{|}}_-C & X\\ar @\/_\/[ur]|-{\\object@{|}}_-C &} \n\\quad = \\quad\n\\xymatrix @R=.2in\n{X\\ar @\/_\/[dr]|-{\\object@{|}}_-C\\ar @\/^4ex\/[rrr]|-{\\object@{|}}^-C&&& X \\\\\n\\urrtwocell<\\omit>{<-1.3>\\Delta} & X\\ar[r]|-{\\object@{|}}_-C\\ar @\/^3ex\/[urr]|-{\\object@{|}}^-C\\urrtwocell<\\omit>{<+.3>\\Delta} &\nX,\\ar @\/_\/[ur]|-{\\object@{|}}_-C &} \\\\\n\\xymatrix @C=.5in @R=.2in\n{X\\drrtwocell<\\omit>{<-2.3>\\Delta}\\drtwocell<\\omit>{<-0.4>\\epsilon}\\ar @\/_2ex\/[dr]|-{\\object@{|}}_-{1_X}\\ar @\/^3ex\/[dr]|-{\\object@{|}}^-C \n\\ar @\/^4ex\/[rr]|-{\\object@{|}}^-C && X \\\\\n& X \\ar @\/_\/[ur]|-{\\object@{|}}_-C &}\n\\xymatrix @C=.5in @R=.2in{=\\\\\\hole}\n\\xymatrix @C=.5in @R=.2in\n{X\\rtwocell<\\omit>{\\;1_C}\\ar @\/_2.3ex\/[r]|-{\\object@{|}}_-C\\ar @\/^2.3ex\/[r]|-{\\object@{|}}^-C \n& X \\\\ \\hole}\n\\xymatrix @C=.5in @R=.2in{= \\\\\\hole}\n\\xymatrix @C=.5in @R=.2in\n{X \\ar @\/_\/[dr]|-{\\object@{|}}_-C\\ar @\/^4ex\/[rr]|-{\\object@{|}}^-C && X \\\\\n\\urrtwocell<\\omit>{<-2.3>\\Delta} & X. \\ar @\/_2ex\/[ur]|-{\\object@{|}}_-{1_X}\\ar @\/^3ex\/[ur]|-{\\object@{|}}^-C \n\\urtwocell<\\omit>{<-0.4>\\epsilon} &}\\nonumber\n\\end{gather}\n\\end{defi}\nIn terms of components, the \\emph{cocomposition} of a $\\mathcal{V}$-cocategory $ C $ is given by\n\\begin{displaymath}\n\\Delta_{x,z}:C(x,z)\\to\\sum_{y\\in X}{C(x,y)\\otimes C(y,z)}\n\\end{displaymath}\nfor any two objects $x,y\\in X$, and the \\emph{coidentity elements} are given by\n\\begin{displaymath}\n \\epsilon_{x,y}:C(x,y)\\to 1_X(x,y)\\equiv\n\\begin{cases}\nC(x,x)\\xrightarrow{\\epsilon_{x,x}}I,\\quad \\mathrm{if }\\;x=y\\\\\nC(x,y)\\xrightarrow{\\epsilon_{x,y}}0,\\quad \\mathrm{if }\\;x\\neq y\n\\end{cases}\n\\end{displaymath}\nfor all objects $x\\in X$. The coassociativity and counity axioms are\n\\begin{displaymath}\n\\xymatrix @C=.3in @R=.1in\n{& C_{x,w}\\ar[dl]_-{\\Delta}\\ar[dr]^-{\\Delta} &\\\\\n\\sum\\limits_{z}{C_{x,z}\\otimes C_{z,w}}\\ar[dd]_-{\\sum\\limits_{z}{\\Delta\\otimes 1}} &&\n\\sum\\limits_{y}{C_{x,y}\\otimes C_{y,w}}\\ar[dd]^-{\\sum\\limits_{y}{1\\otimes\\Delta}} \\\\\n\\hole \\\\\n\\sum\\limits_{z}(\\sum\\limits_{y}{C_{x,y}\\otimes C_{y,z}})\\otimes C_{z,w}\\ar[rr]_-{\\alpha}^-\\sim &&\n\\sum\\limits_{y}{C_{x,y}\\otimes(\\sum\\limits_{z}{C_{y,z}\\otimes C_{y,w}})}}\n\\end{displaymath}\n\\begin{displaymath}\n\\xymatrix @C=.9in @R=.4in\n{\\sum\\limits_{z}{C_{x,z}\\otimes C_{z,y}}\\ar[d]_-{\\sum\\limits_{z}{\\epsilon\\otimes 1}} &\nC_{x,y}\\ar[dr]_-{\\rho^{\\text{-}1}}\\ar[dl]^-{\\lambda^{\\text{-}1}}\\ar[l]_-{\\Delta}\\ar[r]^-{\\Delta} &\n\\sum\\limits_{z}{C_{x,z}\\otimes C_{z,y}}\\ar[d]^-{\\sum\\limits_{z}{1\\otimes\\epsilon}} \\\\\nI\\otimes C_{x,y} && C_{x,y}\\otimes I}\n\\end{displaymath}\nwhere $\\alpha$ is the associator and $\\lambda$, $\\rho$ are the unitors of $\\mathcal{V}$-$\\mathbf{Mat}$.\n\nAs for any comonad in a bicategory, a $\\mathcal{V}$-cocategory $ C $ with $\\ensuremath{\\mathrm{ob}} C =X$ is the same as a comonoid\nin the monoidal category $(\\mathcal{V}$-$\\mathbf{Mat}(X,X),\\circ,1_X)$. Thus a one-object $\\mathcal{V}$-cocategory\nis the same as a comonoid in $\\mathcal{V}$.\n\nA $\\mathcal{V}$-cofunctor between two $\\mathcal{V}$-cocategories $C_X$, $D_Y$ should be a $\\mathcal{V}$-graph morphism\n$F_f\\colon C_X\\to D_Y$ that respects cocomposition and coidentities. As a result, we obtain the following definition.\n\n\\begin{defi}\\label{cofunctor}\nA $\\mathcal{V}$-\\emph{cofunctor} $F_f:C_X\\to D_Y$ between two $\\mathcal{V}$-cocategories consists of a function $f:X\\to Y$ between their\nsets of objects and arrows $F_{x,z}:C(x,z)\\to D(fx,fz)$ in $\\mathcal{V}$ for any $x,z\\in\\ensuremath{\\mathrm{ob}} C$,\nsatisfying the commutativity of\n\\begin{equation}\\label{cofuncts}\n\\xymatrix @C=.5in @R=.27in\n{C(x,z)\\ar[r]^-{\\Delta_{x,z}}\\ar[dd]_-{F_{x,z}} &\n\\sum\\limits_{y}{C(x,y)\\otimes C(y,z)}\\ar[d]^-{\\sum\\limits_{y}{F_{x,y}\\otimes F_{y,z}}} \\\\\n& \\sum\\limits_{fy}{D(fx,fy)\\otimes D(fy,fz)}\\ar @{>->}[d] \\\\\nD(fx,fz)\\ar[r]_-{\\Delta_{fx,fz}} & \\sum\\limits_{w}{D(fx,w)\\otimes D(w,fz)}}\n\\qquad\n\\xymatrix @R=.43in\n{C(x,x)\\ar[rd]^-{\\epsilon_{x,x}} \\ar[dd]_-{F_{x,x}} & \\\\ & I\\\\\nD(fx,fx)\\ar[ur]_-{\\epsilon_{fx,fx}} &}\n\\end{equation}\n\\end{defi}\n\nAlong with compositions and identities of cofunctors that follow those of graphs,\nwe obtain a category $\\ca{V}\\textrm{-}\\B{Cocat}$. As was the case for $\\ca{V}\\textrm{-}\\B{Cat}$, this category is fully encapsulated as\nthe category of comonads in the double category of $\\mathcal{V}$-matrices, i.e. $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at})=\\ca{V}\\textrm{-}\\B{Cocat}$\nas in \\cref{Comonadindoublecat}. Indeed, an object is just a comonad in the horizontal bicategory,\nand the comonad morphism axioms in components give \\cref{cofuncts}.\n\n\\begin{rmk}\nAt \\cite[\\S 9]{Monoidalbicatshopfalgebroids}, a $\\mathcal{V}$-\\emph{opcategory} $\\mathcal{A}$ is defined, as a category\nenriched in $\\mathcal{V}^\\mathrm{op}$. In particular, the cocomposition and counit arrows are simply\n\\begin{displaymath}\n\\Delta\\colon\\mathcal{A}(x,z)\\to\\mathcal{A}(y,z)\\otimes\\mathcal{A}(x,y),\\quad \\varepsilon\\colon\\mathcal{A}(x,x)\\to I.\n\\end{displaymath}\nAlso, a $\\mathcal{V}$-\\emph{opfunctor} $F\\colon\\mathcal{A}\\to\\mathcal{B}$ is a $\\mathcal{V}^\\mathrm{op}$-functor, mapping $x\\mapsto Fx$ and\nwith arrows $\\mathcal{B}(Fx,Fy)\\to\\mathcal{A}(x,y)$ in $\\mathcal{V}$ satisfying respective axioms.\nThe category $\\mathcal{V}$-$\\mathbf{opCat}$ is in a sense broader than\n$\\ca{V}\\textrm{-}\\B{Cocat}^{(\\mathrm{op})}$, since for example for $\\mathcal{V}=\\ensuremath{\\mathbf{Mod}}_R$ any cocategory is a special case of an opcategory: due to\n\\begin{displaymath}\n\\xymatrix@C=.5in\n{A(x,y)\\ar[r]^-{\\Delta_{x,y}}\\ar@{-->}[dr]_-{\\Delta_{x,z,y}} & \\sum\\limits_{z\\in X}{A(x,z)\\otimes A(z,y)}\\ar@{>->}[r]\n& \\prod\\limits_{z\\in X}A(x,z)\\otimes A(z,y)\\ar[dl]^-{\\pi_z} \\\\\n& A(x,z)\\otimes A(z,y) &}\n\\end{displaymath}\na $\\ensuremath{\\mathbf{Mod}}_R$-cocategory is a $\\ensuremath{\\mathbf{Mod}}_R$-opcategory for which the cocomposition $\\Delta_{x,z,y}$ vanishes for all\nbut finitely many objects $z$.\nHowever, for the current development it is crucial that a $\\mathcal{V}$-cocategory can be expressed as a comonoid in the monoidal endo-hom-categories\nof $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$. A $\\mathcal{V}$-opcategory on the other hand does not seem to be expressed as a comonoid, since for example \nthe tensor product of such a monoidal category would have to commute with the products rather than the sums.\n\nMoreover, the cocategories point of view seems to be useful in other settings too;\nin a series of papers related to $A_\\infty$-categories, see \\cite{Ainfinitycategories,Ainfinityalgebras,Equalizerscocompletecocategories},\nthe authors study and employ \\emph{cocategories} and \\emph{cocategory homorphisms} which are precisely our $\\ensuremath{\\mathbf{Mod}}_R$-enriched case,\nin order to express $A_\\infty$-functor categories as internal hom-objects, building models of a closed structure of the homotopy category\nof differential graded categories.\n\\end{rmk}\n\nDue to the fibrant structure of $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$, we again the following as a corollary to \\cref{MonComonfibred}.\n\n\\begin{prop}\\label{VCocatopfibred}\nThe category $\\mathcal{V}$-$\\mathbf{Cocat}$ is an opfibration over $\\mathbf{Set}$.\n\\end{prop}\n\nThe pseudofunctor giving rise to this opfibration is $\\mathscr{F}$ from \\cref{Grphpseudofunctors}, now restricted to the categories\nof comonoids of the endo-hom-categories. Again for this to be well-defined, dually to \\cref{B*monoid}\nwe have the following consequence of $f_*\\circ\\textrm{-}\\circ f^*$ being colax monoidal, \\cref{pseudofunctorsrestrict}.\n\n\\begin{lem}\\label{C*comonoid}\nLet $C_X$ be a $\\mathcal{V}$-cocategory. If $f:X\\to Y$ is a function, then\n\\begin{displaymath}\n\\SelectTips{eu}{10}\\xymatrix\n{Y\\ar[r]|-{\\object@{|}}^-{f^*} & X\\ar[r]|-{\\object@{|}}^-C & X\\ar[r]|-{\\object@{|}}^-{f_*} & Y}\n\\end{displaymath}\nis a comonoid in $\\mathcal{V}$-$\\mathbf{Mat}(Y,Y)$, i.e. $(f_*Cf^*)_Y$ is a $\\mathcal{V}$-cocategory.\n\\end{lem}\nThe new comultiplication and counit come from \\cref{compositecomonoid}; using pasting operations,\nwe can express them as $\\Delta'=f_*\\left((C\\dot{\\eta} C)\\cdot\\Delta\\right)f^*$, $\\epsilon'=\\dot{\\varepsilon}\\cdot(f_*\\epsilon f^*)$.\n\nOnce more, the Grothendieck category gives an isomorphic characterization of the category of\n$\\mathcal{V}$-cocategories and cofunctors, completely in terms of $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$.\n\n\\begin{lem}\\label{charactVCocat}\nObjects in $\\mathcal{V}$-$\\mathbf{Cocat}$ are $(C,X)\\in\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X))\\times\\mathbf{Set}$ and morphisms are $(\\psi,f):(C,X)\\to(D,Y)$ where \n\\begin{displaymath}\n\\begin{cases}\n\\psi:f_*Cf^*\\to D &\\textrm{in }\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Y))\\\\\nf:X\\to Y & \\textrm{in }\\mathbf{Set}.\n\\end{cases}\n\\end{displaymath}\n\\end{lem}\n\nComparing with the two equivalent formulations for $\\mathcal{V}$-graph morphisms of \\cref{charactVGrph}, notice that $\\mathcal{V}$-functors \nare expressed as pairs $(\\phi,f)$ and $\\mathcal{V}$-cofunctors are expressed as pairs $(\\psi,f)$, where the 2-cells\n$\\phi:G\\Rightarrow f^*Hf_*$ and $\\psi:f_*Gf^*\\Rightarrow H$ are mates under $f_*\\dashv f^*$.\n\nWriting explicitly what it means for $\\psi$ to be a comonoid morphism, which is clearer in terms of its mate \n$\\hat{\\phi}:f_*C\\Rightarrow Df_*$, we obtain\n\\begin{align}\\label{cofunctaxioms}\n\\xymatrix @C=.5in @R=.5in\n{X \\ar[r]|-{\\object@{|}}^-C\\ar[d]|-{\\object@{|}}_-{f_*}\\rrtwocell<\\omit>{<-3>\\Delta}\\drtwocell<\\omit>{\\hat{\\phi}}\\ar @\/^6ex\/[rr]|-{\\object@{|}}^-C\n& X\\ar[r]|-{\\object@{|}}^-C\\ar[d]|-{\\object@{|}}^-{f_*}\\drtwocell<\\omit>{\\hat{\\phi}} & X \\ar[d]|-{\\object@{|}}^-{f_*}\\\\\nY \\ar[r]|-{\\object@{|}}_-D & Y \\ar[r]|-{\\object@{|}}_-D & Y} \n&\\xymatrix @R=.2in{\\hole \\\\ = \\\\ \\hole}\n\\xymatrix @C=.5in @R=.3in\n{X\\ar[d]|-{\\object@{|}}_-{f_*}\\ar[rr]|-{\\object@{|}}^-C\\drrtwocell<\\omit>{\\hat{\\phi}} && X \\ar[d]|-{\\object@{|}}^-{f_*}\\\\\nY \\rrtwocell<\\omit>{<4>\\Delta} \\ar @\/_\/[dr]|-{\\object@{|}}_-D \\ar[rr]|-{\\object@{|}}_-D && Y\\\\\n& Y \\ar @\/_\/[ur]|-{\\object@{|}}_-D &} \\\\\n\\xymatrix @C=1in @R=.4in\n{X\\rtwocell<\\omit>{<-2>\\epsilon}\\ar @\/^5ex\/[r]|-{\\object@{|}}^-C\\ar[r]|-{\\object@{|}}_-{1_X}\\ar[d]|-{\\object@{|}}_-{f_*}^{\\phantom{ab}\\cong}\n\\ar @{.>}[dr]|-{\\object@{|}}_-{f_*} & X \\ar[d]|-{\\object@{|}}^-{f_*}_{\\cong\\phantom{ab}} \\\\\nY\\ar[r]|-{\\object@{|}}_-{1_Y} & Y}\n&\\xymatrix{ = \\\\ \\hole}\n\\xymatrix @C=1in @R=.4in\n{X\\ar[r]|-{\\object@{|}}^-C \\ar[d]|-{\\object@{|}}_-{f_*} & X \\ar[d]|-{\\object@{|}}^-{f_*} \\\\\nY\\ar @\/_5ex\/[r]|-{\\object@{|}}_-{1_Y} \\rtwocell<\\omit>{<2.5>\\epsilon}\\ar[r]|-{\\object@{|}}^-D\\rtwocell<\\omit>{<-4>\\hat{\\phi}} & Y}\\nonumber\n\\end{align}\nThe components of $\\hat{\\phi}$ are given by $\\sum_{x'\\in f^{\\text{-}1}y}I\\otimes C(x,x')\\to D(fx,fx')\\otimes I$\nand the above relations componentwise give \\cref{cofuncts} up to isomorphism.\nDually to \\cref{Vfunct=monadopfunct}, cofunctors correspond to specific types of lax comonad functors\nin $\\mathcal{V}\\textrm{-}\\mathbf{Mat}$; viewing them as comonad homomorphisms in $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ is conceptually simpler and less technical,\nbut both expressions will be of use.\n\nWhen $\\mathcal{V}$ is braided monoidal, by \\cref{DendoMonDComonDmonoidal} $\\mathcal{V}$-$\\mathbf{Cocat}$ obtains a mo\\-noi\\-dal \nstructure, as for $\\mathcal{V}$-graphs and categories: for two $\\mathcal{V}$-cocategories $C_X$ and $D_Y$,\n$(C\\otimes D)_{X\\times Y}$ is given by $(C\\otimes D)\\left((x,y),(z,w)\\right)=C(x,z)\\otimes D(y,w)$\nin $\\mathcal{V}$. Writing down in components what the dual of \\cref{MonFdouble} gives for the pseudo double functor\n$\\otimes$ on $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$, we deduce\nthat the cocomposition is\n\\begin{displaymath}\n \\xymatrix @C=.7in @R=.2in\n{C(x,z)\\otimes D(y,w)\\ar@{-->}[r] \\ar@\/_8ex\/[ddr]_-{\\Delta^C_{x,z}\\otimes\\Delta^D_{y,w}} &\n\\sum\\limits_{(x',y')}{C(x,x')\\otimes D(y,y')\\otimes C(x',z)\\otimes D(y',w)} \\\\\n& \\sum\\limits_{(x',y')}{C(x,x')\\otimes C(x',z)\\otimes D(y,y')\\otimes D(y',w)}\\ar[u]^-s_-{\\cong} \\\\\n& \\sum\\limits_{x'}{C(x,x')\\otimes C(x',z)}\\otimes\\sum\\limits_{y'}{D(y,y')\\otimes D(y',w)}\n\\ar[u]_-{\\cong}}\n\\end{displaymath}\nand the coidentity element is $C(x,x)\\otimes D(y,y)\\xrightarrow{\\;\\epsilon^C_{x,x}\\otimes\\epsilon^D_{y,y}\\;}I\\otimes I\\cong I$.\nThe monoidal $\\ca{V}\\textrm{-}\\B{Cocat}$ also inherits the braiding or symmetry from $\\mathcal{V}$.\n\nDually to \\cref{freeVcatfunctor}, we now construct the cofree $\\mathcal{V}$-cocategory functor using the cofree comonoid construction.\nAs discussed in \\cref{Monoidalcats}, the existence of the cofree comonoid usually requires more assumptions on $\\mathcal{V}$\nthan the free monoid, and the following construction is no exception.\n\n\\begin{prop}\\label{cofreeVcocatfunctor}\nSuppose $\\mathcal{V}$ is a locally presentable monoidal category, such that $\\otimes$ preserves colimits in both variables. \nThen, the evident forgetful functor\n\\begin{displaymath}\n\\tilde{U}:\\mathcal{V}\\textrm{-}\\mathbf{Cocat}\\longrightarrow\\mathcal{V}\\textrm{-}\\mathbf{Grph}\n\\end{displaymath}\nhas a right adjoint $\\tilde{R}$, which maps a $\\mathcal{V}$-graph $G_Y$ to the cofree comonoid $(RG,Y)$ on $G\\in\\mathcal{V}$-$\\mathbf{Mat}(Y,Y)$.\n\\end{prop}\n\\begin{proof}\nThe forgetful $\\tilde{U}$ maps any $\\mathcal{V}$-cocategory $C_X$ to its underlying $\\mathcal{V}$-graph $(UC)_X$, where $U$ is the forgetful from\nthe category of comonoids of the monoidal ($\\mathcal{V}$-$\\mathbf{Mat}(Y,Y),\\circ,1_Y)$. By \\cref{cofreecomonVMat}, $U$ has a right adjoint\n\\begin{displaymath}\nR:\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Y)\\longrightarrow\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y,Y)),\n\\end{displaymath}\nthe cofree comonoid functor. By \\cref{charactVCocat}, $(RG)_Y$ for any$\\SelectTips{eu}{10}\\xymatrix @C=.2in{G:Y\\ar[r]|-{\\object@{|}} & Y}$is\na $\\mathcal{V}$-cocategory; we claim that\n\\begin{displaymath}\n\\tilde{R}:\\xymatrix @R=.02in\n{\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\ar[r] & \\mathcal{V}\\textrm{-}\\mathbf{Cocat}\\\\\nG_Y\\ar@{|->}[r] & (RG)_Y}\n\\end{displaymath}\nis a right adjoint of $\\tilde{U}$. It suffices to show that for $\\varepsilon$ the counit of $U\\dashv R$,\nthe $\\mathcal{V}$-graph arrow $\\tilde{\\varepsilon}=(\\varepsilon,\\mathrm{id}_Y):\\tilde{U}\\tilde{R}(G_Y)\\to G_Y$ is universal. This means that for \nany $\\mathcal{V}$-cocategory $C_X$ and any $\\mathcal{V}$-graph morphism $F$ from its underlying $\\tilde{U}(C_X)$ to $G_Y$, there exists \na unique $\\mathcal{V}$-cofunctor $H:C_X\\to (RG)_Y$ such that\n\\begin{equation}\\label{thisuniversality}\n\\xymatrix @R=.35in\n{\\tilde{U}(RG_Y)\\ar[rr]^-{\\tilde{\\varepsilon}} && G_Y\\\\ & \\tilde{U}(C_X)\\ar @{.>}[ul]^-{\\tilde{U}H}\\ar[ur]_-F &}\n\\end{equation} \ncommutes. Indeed, suppose $F$ is $(\\psi,f)$ with $f:X\\to Y$ and $\\psi:f_*Cf^*\\to G$ in $\\mathcal{V}$-$\\mathbf{Mat}(Y,Y)$. Since\n$f_*Cf^*$ is in $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}$-$\\mathbf{Mat}(Y,Y))$ due to \\cref{C*comonoid} and $RG$ is the cofree comonoid on $G$, $\\psi$ extends\nuniquely to a comonoid arrow $\\chi:f_*Cf^*\\to RG$ such that\n\\begin{displaymath}\n\\xymatrix @R=.35in\n{RG \\ar[rr]^-{\\varepsilon} && G\\\\\n& f_*Cf^* \\ar[ur]_-{\\psi}\n\\ar @{.>}[ul]^-{U\\chi} &}\n\\end{displaymath}\ncommutes in $\\mathcal{V}$-$\\mathbf{Mat}(Y,Y)$. By \\cref{charactVCocat}, this $\\chi$ along with the function $f:X\\to Y$ determines\na $\\mathcal{V}$-cofunctor $H:(C,X)\\to(RG,Y)$ which makes \\cref{thisuniversality} commute.\nTherefore $\\tilde{R}$ extends to a functor establishing the `cofree $\\mathcal{V}$-cocategory'\nadjunction $\\tilde{U}\\dashv\\tilde{R}:\\mathcal{V}\\text{-}\\mathbf{Grph}\\to\\mathcal{V}\\text{-}\\mathbf{Cocat}$.\n\\end{proof}\n\nAt this point, properties of $\\mathcal{V}$-$\\mathbf{Cocat}$ cease to be straightforward dualizations of the $\\mathcal{V}$-$\\mathbf{Cat}$\nones. The results that follow more or less employ similar techniques as for the one-object case,\nthat of comonoids in a monoidal category, generalized to this context.\n \nThe construction of colimits in $\\mathcal{V}$-$\\mathbf{Cocat}$ follows from that in $\\mathcal{V}$-$\\mathbf{Grph}$ of \\cref{Vgraphprops}, with \nan induced extra structure on the colimiting cocone.\n\n\\begin{prop}\\label{VCocatcocomplete}\nIf $\\mathcal{V}$ is a locally presentable monoidal category such that $\\otimes$ preserves colimits in both terms,\nthe category $\\mathcal{V}$-$\\mathbf{Cocat}$ has all colimits.\n\\end{prop}\n\n\\begin{proof}\nConsider a diagram in $\\mathcal{V}$-$\\mathbf{Cocat}$ given by\n\\begin{displaymath}\nD:\\xymatrix @R=.05in @C=.6in\n{\\mathcal{J}\\ar[r] & \\mathcal{V}\\textrm{-}\\mathbf{Cocat} \\\\\nj\\ar@{|.>}[r]\n\\ar[dd]_-\\theta & \n(C_j,X_j)\\ar[dd]^-{(\\psi_\\theta,f_\\theta)} \\\\\n\\hole \\\\\nk\\ar@{|.>}[r] & (C_k,X_k)}\n\\end{displaymath}\nfor a small category $\\mathcal{J}$. By \\cref{charactVCocat}, $f_\\theta:X_j\\to X_k$ is a function and $\\psi_\\theta$ is an arrow\n$(f_\\theta)_*C_j(f_\\theta)^*\\to C_k$ in $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}$-$\\mathbf{Mat}(X_k,X_k))$. First constructing the colimit of the underlying $\\mathcal{V}$-graphs,\nwe obtain a colimiting cocone\n\\begin{equation}\\label{colimgraph}\n \\big((C_j,X_j)\\xrightarrow{\\;(\\lambda_j,\\tau_j\\;)}\n(C,X)\\,|\\,j\\in\\mathcal{J}\\big)\n\\end{equation}\nin $\\mathcal{V}$-$\\mathbf{Grph}$, where $(\\tau_j:X_j\\to X\\,|\\,j\\in\\mathcal{J})$ is the colimit of the sets of objects of the $\\mathcal{V}$-cocategories in $\\mathbf{Set}$,\nand $(\\lambda_j:(\\tau_j)_*C_j(\\tau_j)^*\\to C\\,|\\,j\\in\\mathcal{J})$ is the colimiting cocone of the diagram $K$ as in \\cref{defKdiagram}\nin the cocomplete $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$. In fact, $K:\\mathcal{J}\\to\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)$ lands inside $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}$-$\\mathbf{Mat}(X,X))$:\n\\cref{C*comonoid} ensures that $\\mathcal{V}$-matrices of the form $f_*Cf^*$ for any comonoid $C$ inherit a comonoid structure, and the composite\narrows \\cref{Konarrows} where the middle 2-cell is now the comonoid arrow $\\psi_\\theta$ ensure that $K\\theta$ are comonoid morphisms.\n\nBy \\cref{cofreecomonVMat}, the category of comonoids is comonadic over $\\mathcal{V}\\textrm{-}\\mathbf{Mat}(X,X)$ hence the forgetful functor\ncreates all colimits and so$\\SelectTips{eu}{10}\\xymatrix@C=.2in{C:X\\ar[r]|-{\\object@{|}} & X}$obtains a unique comonoid structure.\nMoreover, the legs of the cocone\n\\begin{displaymath}\n\\xymatrix\n{X_j\\ar[r]|-{\\object@{|}} ^-{C_j} & X_j \\ar[d]|-{\\object@{|}} ^-{(\\tau_j)_*}\\\\\nX\\ar[u]|-{\\object@{|}} ^-{(\\tau_j)^*}\\ar[r]|-{\\object@{|}}_-{C} \\rtwocell<\\omit>{<-4>\\lambda_j} & X}\n\\end{displaymath}\nare comonoid arrows, so together with the functions $\\tau_j$ they form $\\mathcal{V}$-cofunctors. Therefore the colimit \\cref{colimgraph}\nlifts in $\\mathcal{V}$-$\\mathbf{Cocat}$.\n\\end{proof}\n\nWe will now apply techniques similar to \\cref{moncomonadm} regarding the expression of the category $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V})$ as an equifier,\nto obtain the following.\n\n\\begin{prop}\\label{VCocatlocpresent}\nSuppose that $\\mathcal{V}$ is a locally presentable monoidal category, such that $\\otimes$ preserves colimits in both terms.\nThen, $\\mathcal{V}$-$\\mathbf{Cocat}$ is a locally presentable category.\n\\end{prop}\n\n\\begin{proof}\nUsing \\cref{charactVGrph}, we can define an endofunctor on $\\mathcal{V}$-graphs by\n\\begin{displaymath}\n F:\\xymatrix @R=.03in @C=.5in\n{\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\ar[r] & \\mathcal{V}\\textrm{-}\\mathbf{Grph}\\quad \\\\\n(G,X)\\ar@{|.>}[r]\\ar[dd]_-{(\\psi,f)} & (G\\circ G,X)\\times(1_X,X) \\ar[dd]^-{F(\\psi,f)} \\\\\n\\hole \\\\ (H,Y)\\ar@{|.>}[r] & (H\\circ H,Y)\\times(1_Y,Y)}\n\\end{displaymath}\nwith explicit mapping on arrows, for a 2-cell $\\psi:f_*Gf^*\\Rightarrow H$,\n\\begin{equation}\\label{Fonarrows}\n\\xymatrix @C=.4in @R=.5in\n{X\\rrtwocell<\\omit>{<6>\\psi}\\ar[rr]|-{\\object@{|}}^-G && X \\ar[d]|-{\\object@{|}}_-{f_*}\\ar[r]|-{\\object@{|}}^-{1_X}\n\\rtwocell<\\omit>{<3>\\dot{\\eta}}\n& X\\rtwocell<\\omit>{<6>\\psi}\\ar[r]|-{\\object@{|}}^-G & X\\ar[d]|-{\\object@{|}}^-{f_*} \\\\\nY\\ar[u]|-{\\object@{|}}^-{f^*}\\ar[rr]|-{\\object@{|}}_-H &&Y\\ar@\/_\/[ur]|-{\\object@{|}}_-{f^*} \\ar[rr]|-{\\object@{|}}_-H && Y}\n\\xymatrix @R=.1in{\\hole \\\\ \\times}\n\\xymatrix @C=.4in @R=.5in\n{X\\ar[rr]|-{\\object@{|}}^-{1_X}\\ar[drr]|-{\\object@{|}}^-{f_*} & \\rtwocell<\\omit>{<4>\\cong} & X\\ar[d]|-{\\object@{|}}^-{f_*} \\\\\nY\\ar[u]|-{\\object@{|}}^-{f^*} \\ar[rr]|-{\\object@{|}}_-{1_Y}\\rtwocell<\\omit>{<-4>\\dot{\\varepsilon}} && Y.}\n\\end{equation}\nThe category of functor coalgebras $\\ensuremath{\\mathbf{Coalg}} F$ has as objects $\\mathcal{V}$-graphs $(C,X)$\nwith a morphism $\\alpha:C\\to C\\circ C\\times 1_X$, \\emph{i.e.} two $\\mathcal{V}$-graph arrows \n\\begin{displaymath}\n \\alpha_1:(C,X)\\to (C\\circ C,X)\\quad\\textrm{and}\\quad\\alpha_2:(C,X)\\to\n(1_X,X).\n\\end{displaymath}\nA morphism $(C,\\alpha)\\to(D,\\beta)$\nis a $\\mathcal{V}$-graph morphism $(\\psi,f):(C,X)\\to(D,Y)$\nwhich is compatible with $\\alpha$ and $\\beta$,\n\\emph{i.e.} satisfy the equalities\n\\begin{gather*}\n \\xymatrix @R=.45in\n{X\\ar@\/^5ex\/[rrrr]|-{\\object@{|}}^-C\n\\rrtwocell<\\omit>{<5>\\psi}\n\\ar[rr]|-{\\object@{|}}^-C &\n\\rrtwocell<\\omit>{<-3>\\;\\alpha_1} & X\n\\rtwocell<\\omit>{<3>\\dot{\\eta}}\n\\ar[d]|-{\\object@{|}}_-{f_*}\n\\ar[r]|-{\\object@{|}}^-{1_X}\n& X\\rtwocell<\\omit>{<5>\\psi}\n\\ar[r]|-{\\object@{|}}^-C & X\\ar[d]|-{\\object@{|}}^-{f_*} \\\\\nY\\ar[u]|-{\\object@{|}}^-{f^*}\\ar[rr]|-{\\object@{|}}_-D &&\nY\\ar@\/_\/[ur]|-{\\object@{|}}_-{f^*} \\ar[rr]|-{\\object@{|}}_-D && Y}\n\\xymatrix @R=.1in{\\hole \\\\ = \\\\ \\hole}\n\\xymatrix @R=.15in\n{X \\ar[rr]|-{\\object@{|}}^-C\n\\rrtwocell<\\omit>{<4>\\psi}&& X\n\\ar[dd]|-{\\object@{|}}^-{f_*}\\\\\n& \\\\\nY \\ar[uu]|-{\\object@{|}}^-{f^*}\n\\rrtwocell<\\omit>{<2.5>\\beta_1}\n\\ar @\/_\/[dr]|-{\\object@{|}}_-D\n\\ar[rr]|-{\\object@{|}}^-D && Y\\\\\n& Y \\ar @\/_\/[ur]|-{\\object@{|}}_-D &} \\\\\n\\xymatrix @C=.5in @R=.4in\n{X\\rrtwocell<\\omit>{<-2>\\;\\alpha_2}\n\\ar @\/^4ex\/[rr]|-{\\object@{|}}^-C\n\\ar[rr]|-{\\object@{|}}_-{1_X}\n\\ar @{.>}[drr]|-{\\object@{|}}_-{f_*}\n&& X\\ar[d]|-{\\object@{|}}^-{f_*}\n_{\\cong\\phantom{ab}} \\\\\nY\\ar[u]|-{\\object@{|}}^-{f^*}\n\\rtwocell<\\omit>{<-3.5>\\dot{\\varepsilon}}\n\\ar[rr]|-{\\object@{|}}_-{1_Y}\n && Y}\n\\xymatrix{ = \\\\ \\hole}\n\\xymatrix @C=1.1in @R=.4in\n{X\\ar[r]|-{\\object@{|}}^-C & X \\ar[d]|-{\\object@{|}}^-{f_*} \\\\\nY\\ar[u]|-{\\object@{|}}^-{f^*}\\ar @\/_4ex\/[r]|-{\\object@{|}}_-{1_Y} \\rtwocell<\\omit>{<2>\\;\\beta_2}\n\\ar[r]|-{\\object@{|}}^-D \n\\rtwocell<\\omit>{<-5>\\psi} & Y.}\n\\end{gather*}\nClearly $\\ensuremath{\\mathbf{Coalg}} F$ contains $\\mathcal{V}$-$\\mathbf{Cocat}$ as a full subcategory: the morphisms satisfy the same axioms\n\\cref{cofunctaxioms} for the mate of $\\psi$, and objects are $\\mathcal{V}$-graphs equipped with cocomposition and coidentities arrows\nthat don't necessarily satisfy coassociativity and counity. \n\nSince $\\mathcal{V}$-$\\mathbf{Cocat}$ is cocomplete by \\cref{VCocatcocomplete}, we only need to show that it is accessible.\nIt is enough to express it as an equifier of a family of pairs of natural transformations between\naccessible functors. First of all, $F$ preserves all filtered colimits: take a colimiting cocone for a small filtered category $\\mathcal{J}$\n\\begin{displaymath}\n\\big((G_j,X_j)\\xrightarrow{\\;(\\lambda_j,\\tau_j)\\;}(G,X)\\,|\\,j\\in\\mathcal{J}\\big)\n\\end{displaymath}\nin $\\mathcal{V}$-$\\mathbf{Grph}$ for a diagram like (\\ref{diagraminVgraph}) constructed in that proof, \\emph{i.e.} $(\\tau_j:X_j\\to X)$ is colimiting\nin $\\mathbf{Set}$ and $(\\lambda_j:(\\tau_j)_*C_j(\\tau_j)^*\\to C)$ is colimiting in $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$. We require its image under $F$\n\\begin{equation}\\label{imageunderF}\n F(\\lambda_j,\\tau_j):\n(G_j\\circ G_j,X_j)\\times(1_{X_j},X_j)\\to\n(G\\circ G,X)\\times(1_X,X)\n\\end{equation}\nto be colimiting in $\\mathcal{V}$-$\\mathbf{Grph}$. For its first part \\cref{Fonarrows}, we can deduce that \n\\begin{displaymath}\n(\\tau_j)_*\\circ G_j\\circ(\\tau_j)^*\\circ(\\tau_j)_*\\circ G_j\\circ(\\tau_j)^*\n\\xrightarrow{\\;\\lambda_j*\\lambda_j\\;}G\\circ G\n\\end{displaymath}\nis a colimit in $(\\mathcal{V}$-$\\mathbf{Mat}(X,X),\\circ,1_X)$, as the tensor product (horizontal composite) of two colimiting cocones.\nPre-composing this with the unit \n\\begin{displaymath}\n1*\\dot{\\eta}*1:(\\tau_j)_*\\circ G_j\\circ1_{X_j}\\circ G_j\\circ(\\tau_j)^*\n\\to(\\tau_j)_*\\circ G_j\\circ(\\tau_j)^*\\circ(\\tau_j)_*\\circ G_j\\circ(\\tau_j)^*\n\\end{displaymath}\nstill gives a colimiting cocone: if we take components in $\\mathcal{V}$\nof the respective 2-cells in $\\mathcal{V}$-$\\mathbf{Mat}$, this comes down to showing that \nthe inclusion\n\\begin{displaymath}\n \\sum^{\\scriptscriptstyle{\\stackrel{\\tau_ju=x'}{\\tau_jw=x}}}_{z\\in X_j}\n{G_j(u,z)\\otimes G_j(z,w)}\\hookrightarrow\n\\sum^{\\scriptscriptstyle{\\stackrel{\\tau_ju=x'}{\\tau_jw=x}}}_{\\tau_ja=\\tau_jb}\n{G_j(u,a)\\otimes G_j(b,w)}\n\\end{displaymath}\nfor any two fixed $x,x'\\in X$, where $u,w,a,b\\in X_j$, does not \nalter the colimit. One way of showing this is by considering\nthe following discrete opfibrations over the filtered shape \n$\\mathcal{J}$:\n\\begin{align*}\n\\mathcal{L}&=\\{(j,a,b)\\,|\\,j\\in\\mathcal{J},a,b\\in X_j,\\tau_ja=\\tau_jb\\} \\\\\n\\mathcal{M}&=\\{(j,z)\\,|\\,j\\in\\mathcal{J},z\\in X_j\\}\n\\end{align*}\nwhere for example the arrows $(j,a,b)\\to(j',a',b')$ in $\\mathcal{L}$ \nare determined by arrows $\\theta:j\\to j'$ \nin $\\mathcal{J}$ such that $a'=f_\\theta(a)$ and $b'=f_\\theta(b)$\n(the function $f_\\theta:X_j\\to X_{j'}$ \nis the image of the diagram (\\ref{diagraminVgraph}) in $\\mathbf{Set}$).\nWe can now define diagrams of shape $\\mathcal{L}$ and \n$\\mathcal{M}$ in $\\mathcal{V}$\n\\begin{displaymath}\n L:\\xymatrix@R=.02in{\\mathcal{L}\\ar[r] & \\mathcal{V}\\qquad\\qquad \\\\\n(j,a,b)\\ar@{|->}[r] & G_j(u,a)\\otimes G_j(b,w)}\\qquad\nM:\\xymatrix@R=.02in{\\mathcal{M}\\ar[r] & \\mathcal{V}\\qquad\\qquad \\\\\n(j,z)\\ar@{|->}[r] & G_j(u,z)\\otimes G_j(z,w)}\n\\end{displaymath}\nand appropriately on morphisms. The colimits for these diagrams in \n$\\mathcal{V}$, taking into account that the fibres \nare discrete categories, are\n\\begin{align*}\n \\colim L & \\cong\\colim_j\\sum_{\\tau_ja=\\tau_jb}\n{G_j(u,a)\\otimes G_j(b,w)} \\\\\n\\colim M & \\cong\\colim_j\\sum_{z\\in X_j}\n{G_j(u,z)\\otimes G_j(z,w)}.\n\\end{align*}\nFinally, notice that there exists a functor \n$T:\\mathcal{M}\\to\\mathcal{L}$ mapping each $(j,z)$ to $(j,z,z)$\nand making the triangle\n\\begin{displaymath}\n \\xymatrix\n{\\mathcal{M}\\ar[rr]^-T\\ar[dr]_-M && \\mathcal{L}\\ar[dl]^-L \\\\\n&\\mathcal{V}&}\n\\end{displaymath}\ncommute. Due to the construction of filtered colimits in $\\mathbf{Set}$,\nit is not hard to show that the slice category $\\big((j,z,w)\\downarrow T\\big)$\nis non-empty and connected. Hence $T$ is a final \nfunctor and we can restrict the diagram on $\\mathcal{L}$\nto $\\mathcal{M}$ without changing the colimit, as claimed.\n\nFor the second part of the diagram \\cref{Fonarrows}, it is enough to show that\n\\begin{displaymath}\n\\xymatrix @C=.5in @R=.1in\n{\\rrtwocell<\\omit>{<4>\\dot{\\varepsilon}} &\nX_j\\ar[dr]|-{\\object@{|}}^-{(\\tau_j)_*} & \\\\\nX\\ar@\/_2ex\/[rr]|-{\\object@{|}}_-{1_X} \n\\ar[ur]|-{\\object@{|}}^-{(\\tau_j)^*} && Y}\n\\end{displaymath}\nis a colimiting cocone in $\\mathcal{V}$-$\\mathbf{Mat}(X,X)$, for the diagram mapping each $j$ to \n\\begin{displaymath}\n\\xymatrix{X\\ar[r]|-{\\object@{|}}^-{(\\tau_j)^*} & \nX_j\\ar[r]|-{\\object@{|}}^-{1_{X_j}} & \nX_j\\ar[r]|-{\\object@{|}}^-{(\\tau_j)_*} & X.} \n\\end{displaymath}\nThis can be established by first verifying that $\\dot{\\varepsilon}$ is a cocone, and then that it has the required universal property. \nWe have thus shown that the cocone (\\ref{imageunderF}) is indeed colimiting, hence $F$ is an accessible functor as required.\n\nSince $\\mathcal{V}$-$\\mathbf{Grph}$ is locally presentable and the endofunctor $F$ preserves filtered colimits, $\\ensuremath{\\mathbf{Coalg}} F$ is a\nlocally presentable category by \\cref{functoralgebrasprops} and the forgetful functor $\\overline{V}:\\ensuremath{\\mathbf{Coalg}} F\\to\\mathcal{V}$-$\\mathbf{Grph}$\ncreates all colimits. We consider the following pairs of transformations between functors from $\\ensuremath{\\mathbf{Coalg}} F$ to $\\mathcal{V}$-$\\mathbf{Grph}$:\n\\begin{displaymath}\n\\phi^1,\\psi^1:\\overline{V}\\Rightarrow FF\\overline{V},\\quad\n\\phi^2,\\psi^2:\\overline{V}\\Rightarrow (-\\circ 1_X)\\overline{V},\\quad\n\\phi^3,\\psi^3:\\overline{V}\\Rightarrow \\overline{V}(-\\circ 1_X)\n\\end{displaymath}\nwith natural components\n\\begin{align*}\n\\phi^1_{(C,X)}:\n\\xymatrix @R=.1in\n{X\\ar @\/_\/[dr]|-{\\object@{|}}_-C\n\\ar @\/^3ex\/[drr]|-{\\object@{|}}^-C\n\\ar @\/^4ex\/[rrr]|-{\\object@{|}}^-C\n\\drrtwocell<\\omit>{<+.3>\\;\\alpha_1}\n&\\drrtwocell<\\omit>{<-1.3>\\;\\alpha_1} && X, \\\\\n& X\\ar[r]|-{\\object@{|}}_-C &\nX\\ar @\/_\/[ur]|-{\\object@{|}}_-C &}&\\quad\n\\psi^1_{(C,X)}:\n\\xymatrix @R=.1in\n{X\\ar @\/_\/[dr]|-{\\object@{|}}_-C\n\\ar @\/^4ex\/[rrr]|-{\\object@{|}}^-C\n&&& X \\\\\n\\urrtwocell<\\omit>{<-1.3>\\;\\alpha_1} & \nX\\ar[r]|-{\\object@{|}}_-C \n\\ar @\/^3ex\/[urr]|-{\\object@{|}}^-C \n\\urrtwocell<\\omit>{<+.3>\\;\\alpha_1} &\nX\\ar @\/_\/[ur]|-{\\object@{|}}_-C &} \\\\\n\\phi^2_{(C,X)}:\n\\xymatrix @C=.6in @R=.05in\n{X\\drrtwocell<\\omit>{<-2.3>\\;\\alpha_1}\n\\drtwocell<\\omit>{<-0.4>\\;\\alpha_2}\n\\ar @\/_2ex\/[dr]|-{\\object@{|}}_-{1_X}\n\\ar @\/^3ex\/[dr]|-{\\object@{|}}^-C \n\\ar @\/^4ex\/[rr]|-{\\object@{|}}^-C\n&& X, \\\\\n& X \\ar @\/_\/[ur]|-{\\object@{|}}_-C &}&\\quad\n\\psi^2_{(C,X)}:\n\\xymatrix @R=.05in @C=.6in\n{X \\ar@\/_\/[dr]|-{\\object@{|}}\n_-{1_X} \\ar @\/^3ex\/[rr]|-{\\object@{|}}^-C\n\\rrtwocell<\\omit>{'\\cong} && X \\\\\n& X\\ar@\/_\/[ur]|-{\\object@{|}}_-{C} &} \\\\\n\\phi^3_{(C,X)}:\n\\xymatrix @R=.05in @C=.6in\n{X \\ar @\/_\/[dr]|-{\\object@{|}}_-C\n\\ar @\/^4ex\/[rr]|-{\\object@{|}}^-C\n&& X, \\\\\n\\urrtwocell<\\omit>{<-2.3>\\;\\alpha_1}\n& X \\ar @\/_2ex\/[ur]|-{\\object@{|}}_-{1_X} \n\\ar @\/^3ex\/[ur]|-{\\object@{|}}^-C \n\\urtwocell<\\omit>{<-0.4>\\;\\alpha_2} &}&\\quad\n\\psi^3_{(C,X)}:\n\\xymatrix @R=.05in @C=.6in\n{X \\ar@\/_\/[dr]|-{\\object@{|}}\n_-{C} \\ar @\/^3ex\/[rr]|-{\\object@{|}}^-C\n\\rrtwocell<\\omit>{'\\cong} && X. \\\\\n & X\\ar@\/_\/[ur]|-{\\object@{|}}_-{1_X} &}\n\\end{align*}\nThe full subcategory of $\\ensuremath{\\mathbf{Coalg}} F$ spanned by those objects $(C,X)$ which satisfy $\\phi^i_{(C,X)}=\\psi^i_{(C,X)}$\nis precisely the category of $\\mathcal{V}$-cocategories by \\cref{Vfunctaxioms2cells}, thus\n\\begin{displaymath}\n \\mathbf{Eq}((\\phi^i,\\psi^i)_{i=1,2,3})=\\mathcal{V}\\textrm{-}\\mathbf{Cocat}.\n\\end{displaymath}\nSince all categories and functors involved are accessible, $\\mathcal{V}$-$\\mathbf{Cocat}$ is accessible.\n\\end{proof}\n\nThe fact that $\\mathcal{V}$-$\\mathbf{Cocat}$ is a locally presentable category is very useful for the proof of existence of various adjoints, as seen below.\n\\begin{prop}\\label{VCocatcomonadic}\nSuppose $\\mathcal{V}$ is a locally presentable monoidal category such that $\\otimes$ preserves colimits in both entries.\nThe forgetful functor $\\tilde{U}:\\mathcal{V}$-$\\mathbf{Cocat}\\to\\mathcal{V}$-$\\mathbf{Grph}$ is comonadic.\n\\end{prop\n\n\\begin{proof}\nBy \\cref{cofreeVcocatfunctor} the forgetful $\\tilde{U}$ has a right adjoint, namely the cofree $\\mathcal{V}$-cocategory functor $\\tilde{R}$.\nBy adjusting \\cref{diagforComoncomonadicity}, consider the commutative\n\\begin{displaymath}\n\\xymatrix @C=.7in @R=.4in\n{\\mathcal{V}\\textrm{-}\\mathbf{Cocat}\\ar[dr]_-{\\tilde{U}}\n\\ar@{^(->}[r]^-{\\iota} & \\ensuremath{\\mathbf{Coalg}} F \n\\ar[d]^-{\\overline{V}} \\\\\n& \\mathcal{V}\\textrm{-}\\mathbf{Grph}}\n\\end{displaymath}\nwhere the top functor is the inclusion in the functor coalgebra category as described above, and the\nrespective forgetful functors discard the structures maps $\\alpha$ of the coalgebras. By \\cref{functoralgebrasprops}\n$\\overline{V}$ creates equalizers of split pairs,\nso it is enough to show that the inclusion $\\iota$ also creates equalizers of split pairs, since we already have\n$\\tilde{U}\\dashv\\tilde{R}$.\nBoth $\\mathcal{V}$-$\\mathbf{Cocat}$ and $\\mathcal{V}$-$\\mathbf{Grph}$ are locally presentable categories so in particular complete,\nand it is easy to see that $\\iota$ preserves and reflects, thus creates, all limits. Hence $\\tilde{U}$ satisfy the conditions of \nPrecise Monadicity Theorem and the result follows.\n\\end{proof}\n\n\\begin{prop}\\label{VCocatclosed}\nSuppose that $\\mathcal{V}$ is a locally presentable symmetric monoidal closed category. Then the category of $\\mathcal{V}$-cocategories is symmetric\nmonoidal closed as well.\n\\end{prop}\n\n\\begin{proof}\nIf $\\otimes\\colon\\ca{V}\\textrm{-}\\B{Cocat}\\times\\ca{V}\\textrm{-}\\B{Cocat}\\to\\ca{V}\\textrm{-}\\B{Cocat}$ is the symmetric monoidal structure of $\\mathcal{V}$-$\\mathbf{Cocat}$ described earlier,\nwe can form the commutative\n\\begin{displaymath}\n\\xymatrix @C=.7in @R=.5in\n{\\mathcal{V}\\textrm{-}\\mathbf{Cocat}\\ar[r]^-{-\\otimes D_Y}\\ar[d]_-{\\tilde{U}} & \\mathcal{V}\\textrm{-}\\mathbf{Cocat}\\ar[d]^-{\\tilde{U}} \\\\\n\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\ar[r]_-{-\\otimes\\tilde{U}(D_Y)} & \\mathcal{V}\\textrm{-}\\mathbf{Grph}}\n\\end{displaymath}\nwhere the comonadic $\\tilde{U}$ creates all colimits and the bottom arrow preserves them by the monoidal closed structure of $\\ca{V}\\textrm{-}\\B{Grph}$,\n\\cref{VGrphclosed}. Therefore $(-\\otimes D_Y)$ preserves colimits, and \\cref{Kellyadj} ensures it has a right adjoint\nsince $\\mathcal{V}$-$\\mathbf{Cocat}$ is a locally presentable category. If we call it $\\textrm{\\scshape{Hom}}(D_Y,-)$, we obtain a parametrized adjunction\n\\begin{displaymath}\n\\xymatrix @C=.8in\n{\\mathcal{V}\\textrm{-}\\mathbf{Cocat} \\ar @<+.8ex>[r]^-{-\\otimes D_Y}\\ar@{}[r]|-{\\bot}\n& \\mathcal{V}\\textrm{-}\\mathbf{Cocat}\\ar @<+.8ex>[l]^-{\\textrm{\\scshape{Hom}}(D_Y,-)}}\n\\end{displaymath}\nwhich exhibits the uniquely induced $\\textrm{\\scshape{Hom}}\\colon\\ca{V}\\textrm{-}\\B{Cocat}^\\mathrm{op}\\times\\ca{V}\\textrm{-}\\B{Cocat}\\to\\ca{V}\\textrm{-}\\B{Cocat}$ as its internal hom.\n\\end{proof}\n\n\n\\subsection{Enrichment of \\texorpdfstring{$\\mathcal{V}$}{V}-categories in \\texorpdfstring{$\\mathcal{V}$}{V}-cocategories}\n\\label{enrichmentofVcatsinVcocats}\n\nHaving described the categories of $\\mathcal{V}$-graphs, $\\mathcal{V}$-categories and $\\mathcal{V}$-cocategories in terms of $\\mathcal{V}$-matrices,\nand specified some of their categorical properties relatively to limits and colimits, local presentability and monoidal closed structure,\nwe are now in position to explore an enrichment relation (\\cref{VCatenrichedinVCocat})\nas a many-object generalization of \\cref{monoidenrichment} for monoids\nand comonoids. In particular, viewing $\\ca{V}\\textrm{-}\\B{Cat}$ and $\\ca{V}\\textrm{-}\\B{Cocat}$ as monads and comonads in the locally symmetric monoidal closed fibrant double\ncategory $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$, the desired result will follow from the relevant development in \\cref{locallyclosedmonoidaldoublecats}.\n\nSupposed that $\\mathcal{V}$ is a braided monoidal closed category with products and coproducts.\nRecall that the locally closed monoidal structure of $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$\nby \\cref{VMatlocallymoidalclosed}\nis given by a lax double functor $$H=(H_0,H_1)\\colon\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}^\\mathrm{op}\\times\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}\\to\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$$ where $H_0$ is the exponentiation\nin $\\B{Set}$ and $H_1$ is defined in \\cref{H1functor}. This induces a functor $\\ensuremath{\\mathbf{Mon}} H$ \\cref{MonHdouble}\nas the restriction of $H_1^\\bullet$ between the category of monads and comonads, which in this context becomes\n\\begin{equation}\\label{defK}\nK\\colon\\ca{V}\\textrm{-}\\B{Cocat}^\\mathrm{op}\\times\\ca{V}\\textrm{-}\\B{Cat}\\longrightarrow\\ca{V}\\textrm{-}\\B{Cat}\n\\end{equation}\nmapping a $\\mathcal{V}$-cocategory and a $\\mathcal{V}$-category $(C_X,B_Y)$ to $K(C,B)_{Y^X}$ given by\n\\begin{displaymath}\nK(C,B)(s,k)=\\prod_{x,x'}[G(x,x'),H(sx,kx')]\\textrm{ for }s,k\\in Y^X.\n\\end{displaymath}\nOf course this comes from the induced internal hom in $\\ca{V}\\textrm{-}\\B{Grph}$, \\cref{VGrphclosed}, with the extra structure of a category coming from\nthe more general \\cref{MonFdouble}.\nExplicitly, for each triple $s,k,t\\in Y^X$, the composition $M:K(C,B)(s,k)\\otimes K(C,B)(k,t)\\to K(C,B)(s,t)$ for $\\mathcal{K}(C,B)$ is an arrow\n\\begin{displaymath}\n\\prod_{a,a}{[C(a,a'),B(sa,ka')]}\\otimes\\prod_{b,b'}{[C(b,b'),B(kb,tb')]}\\to\\prod_{c,c'}{[C(c,c'),B(sc,tc')].}\n\\end{displaymath}\nThis is defined via its adjunct under the tensor-hom adjunction\n\\begin{displaymath}\n\\xymatrix @C=.25i\n{\\prod\\limits_{a,a'}{[C_{a,a'},B_{sa,ka'}]\\otimes\\prod\\limits_{b,b'}[C_{b,b'},B_{kb,tb'}]\\otimes \nC(c,c')}\\ar[d]_-{1\\otimes\\Delta_{c,c'}}\\ar@{-->}[r] & B_{sc,tc'}\\\\\n\\prod\\limits_{a,a'}[C_{a,a'},B_{sa,ka'}]\\otimes\\prod\\limits_{b,b'}[C_{b,b'},B_{kb,tb'}]\n\\otimes\\sum\\limits_{c''}C_{c,c''}\\otimes C_{c'',c'}\\ar[d]_-{\\cong} &\\\\\n\\sum\\limits_{c''}\\prod\\limits_{a,a'}[C_{a,a'},B_{sa,ka'}]\\otimes C_{c,c''}\\otimes\n\\prod\\limits_{b,b'}[C_{b,b'},B_{kb,tb'}]\\otimes C_{c',c''} \\ar[d]_-{\\pi_{c,c''}\\otimes1\\otimes\\pi_{c'',c'}\\otimes1} & \\\\\n\\sum\\limits_{c''}[C_{c,c''},B_{sc,kc''}]\\otimes C_{c,c''}\\otimes[C_{c'',c'},B_{kc'',tc'}]\\otimes C_{c'',c'}\n\\ar[r]_-{\\mathrm{ev}\\otimes\\mathrm{ev}} & \\sum\\limits_{c''}B_{sc,kc''}\\otimes B_{kc'',tc'} \\ar[uuu]_-{M_{sc,tc'}}}\n\\end{displaymath}\nfor fixed $c,c'$.\nThe identities for each object $s\\in Y^X$ are arrows\n\\begin{displaymath}\n\\eta_d:I\\to K(C,B)(d,d)=\\prod_{a,a'\\in X}{[C(a,a'),B(sa,sa')]}\n\\end{displaymath}\nwhich correspond uniquely for fixed $a=a'\\in X$ \nto the composite\n\\begin{displaymath}\n\\xymatrix @R=.3in\n{I\\otimes C_{a,a}\\ar @{-->}[rrr]\\ar @\/_\/[dr]_-{1\\otimes\\epsilon_{a,a}} &&& B_{sa,sa}. \\\\\n& I\\otimes I\\ar[r]_-{r_I} & I\\ar @\/_\/[ur]_-{\\eta_{sa,sa}} &}\n\\end{displaymath}\n\nIn order to apply results from the theory of actions and enrichment as presented in \\cref{sec:actionenrich},\nwe need to realize the functor $K$ as an action of $\\ca{V}\\textrm{-}\\B{Cocat}$ on $\\ca{V}\\textrm{-}\\B{Cat}$. Due to \\cref{doubleMonHaction}, we can deduce this in\na straightforward way.\n\n\\begin{prop}\\label{Kaction}\nIf $\\mathcal{V}$ is a symmetric monoidal closed category with products and coproducts, the functor $K$ (\\ref{defK}) is an action\nof the symmetric monoidal $\\ca{V}\\textrm{-}\\B{Cocat}^\\mathrm{op}$, and so is its opposite $K^\\mathrm{op}\\colon\\ca{V}\\textrm{-}\\B{Cocat}\\times\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}\\to\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}.$\n\\end{prop}\n\nWhat is left to show is that this action $K^\\mathrm{op}$ has a parametrized adjoint, which will induce the enrichment of the category on\nwhich the monoidal category acts. This can be deduced when $\\mathcal{V}$ is furthermore locally presentable.\n\n\\begin{prop}\\label{Texistence}\nSuppose that $\\mathcal{V}$ is a locally presentable symmetric monoidal closed category.\nThe functor $K^\\mathrm{op}$ has a parametrized adjoint\n\\begin{equation}\\label{defT}\nT:\\mathcal{V}\\textrm{-}\\mathbf{Cat}^\\mathrm{op}\\times\\mathcal{V}\\textrm{-}\\mathbf{Cat}\\longrightarrow\\mathcal{V}\\textrm{-}\\mathbf{Cocat},\n\\end{equation}\ngiven by adjunctions $K(-,B_Y)^\\mathrm{op}\\dashv T(-,B_Y)$ for every $\\mathcal{V}$-category $B_Y$.\n\\end{prop}\n\n\\begin{proof}\nIf $H_1^\\bullet$ is the internal hom of $\\ca{V}\\textrm{-}\\B{Grph}$ as in \\cref{VGrphclosed}, we can form a square which commutes by definition of $K$\n\\begin{displaymath}\n\\xymatrix @C=1in @R=.5in\n{\\ca{V}\\textrm{-}\\B{Cocat}\\ar[r]^-{K(-,B_Y)^\\mathrm{op}}\\ar[d]_-{\\tilde{U}} & \\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op} \\ar[d]^-{\\tilde{S}} \\\\\n\\ca{V}\\textrm{-}\\B{Grph}\\ar[r]_-{H_1^\\bullet(-,\\tilde{S}B_Y)^\\mathrm{op}} & \\ca{V}\\textrm{-}\\B{Grph}^\\mathrm{op}}\n\\end{displaymath}\nwhere the left and right legs create all colimits by \\cref{VCatmonadic} and \\ref{VCocatcomonadic} and the bottom arrow preserves all colimits by \n$H_1^\\bullet(-,G_Y)^\\mathrm{op}\\dashv H_1^\\bullet(-,G_Y)$ in any monoidal closed category. Therefore $K(-,B_Y)^\\mathrm{op}$ is cocontinuous, and since its domain\nis locally presentable by \\cref{VCocatlocpresent}, \\cref{Kellyadj} provides adjunctions\n$K(-,B_Y)^\\mathrm{op}\\dashv T(-,B_Y):\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}\\to\\ca{V}\\textrm{-}\\B{Cocat}$ for all $\\mathcal{V}$-categories $B_Y$; this uniquely induces \\cref{defT}.\n\\end{proof}\n\nThe functor $T$ which generalizes the universal measuring comonoid functor \\cref{Sweedlerhom} is called\nthe \\emph{generalized Sweedler hom}. Morever, the functor $K^\\mathrm{op}$ fixed in the second variable has also a right adjoint,\nwhich generalizes the Sweedler product \\cref{Sweedlerprod}.\n\n\\begin{lem}\nThere is an adjunction $K(C_X,-)^\\mathrm{op}\\dashv(C_X\\triangleright-)^\\mathrm{op}$, for any $\\mathcal{V}$-cocategory $C_X$.\n\\end{lem}\n\n\\begin{proof}\nConsider the commutative diagram\n\\begin{displaymath}\n\\xymatrix @C=.9in @R=.5in\n{\\ca{V}\\textrm{-}\\B{Cat}\\ar[r]^-{K(C_X,-)}\\ar[d]_-{\\tilde{S}} & \\ca{V}\\textrm{-}\\B{Cat}\\ar[d]^-{\\tilde{S}} \\\\\n\\mathcal{V}\\textrm{-}\\mathbf{Grph}\\ar[r]_-{H_1^\\bullet(\\tilde{U}C_X,-)} & \\mathcal{V}\\textrm{-}\\mathbf{Grph}}\n\\end{displaymath}\nwhere $\\tilde{S}$ is the monadic forgetful functor and the locally presentable category $\\mathcal{V}$-$\\mathbf{Cat}$\nhas all coequalizers. Thus by Dubuc's Adjoint Triangle Theorem \\cite{AdjointTriangles},\nthe existence of a left adjoint of the bottom arrow by monoidal closedness of $\\ca{V}\\textrm{-}\\B{Grph}$ implies the existence of a left adjoint \n$(C_X\\triangleright-)$ of the top arrow.\n\\end{proof}\n\nThe induced functor of two variables $\\triangleright:\\ca{V}\\textrm{-}\\B{Cocat}\\times\\ca{V}\\textrm{-}\\B{Cat}\\to\\ca{V}\\textrm{-}\\B{Cat}$ is called the \\emph{generalized Sweedler product}.\nNow \\cref{MndenrichedCmnd} applies to provide the desired enrichment,\nvia the action of the symmetric monoidal closed category $\\ca{V}\\textrm{-}\\B{Cocat}$ (\\cref{VCocatclosed}).\n\n\\begin{thm}\\label{VCatenrichedinVCocat}\nSuppose $\\mathcal{V}$ is a symmetric monoidal closed category which is locally presentable, and $T$ is the generalized Sweedler hom functor.\n\\begin{enumerate}\n\\item $\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}$ is enriched in $\\ca{V}\\textrm{-}\\B{Cocat}$, tensored and cotensored, with hom-objects $\\underline{\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}}(A_X,B_Y)=T(B_Y,A_X).$\n\\item $\\ca{V}\\textrm{-}\\B{Cat}$ is a tensored and cotensored $(\\ca{V}\\textrm{-}\\B{Cocat})$-enriched category, with\n\\begin{displaymath}\n\\underline{\\ca{V}\\textrm{-}\\B{Cat}}(A_X,B_Y)=T(A_X,B_Y)\n\\end{displaymath}\ncotensor product $K(C,B)_{Y^Z}$ and tensor product $C_Z\\triangleright A_X$, for any $\\mathcal{V}$-co\\-ca\\-te\\-go\\-ry $C_Z$ and \nany $\\mathcal{V}$-categories $A_X,B_Y$.\n\\end{enumerate}\n\\end{thm}\n\nThe final goal is to combine the above enrichment with the (op)fibrations that these categories form,\nand characterize them as enriched fibrations, \\cref{enrichedfibration}. First of all, the fibration\n$P\\colon\\ca{V}\\textrm{-}\\B{Cat}\\to\\B{Set}$ (\\cref{VCatfibred}) as well as the opfibration $W\\colon\\ca{V}\\textrm{-}\\B{Cocat}\\to\\B{Set}$ (\\cref{VCocatopfibred})\nare both monoidal by \\cref{monadscomonadsmonoidalfibr}, due to their expression as categories of monads and comonads in $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$;\nthey inherit their symmetry from $\\mathcal{V}$.\n\\cref{MndfibredenrichedCmnd} applied to $\\mathcal{V}\\textrm{-}\\mathbf{\\caa{M}at}$ will give the required result.\n\nFirst of all, we need to show that $K^\\mathrm{op}$ preserves cocartesian liftings, or equivalently $K$ preserves cartesian\nliftings between the fibrations\n\\begin{equation}\\label{fibredaction}\n\\xymatrix @C=.8in @R=.5in\n{\\ca{V}\\textrm{-}\\B{Cocat}^\\mathrm{op}\\times\\ca{V}\\textrm{-}\\B{Cat}\\ar[r]^-K\\ar[d]_-{W^\\mathrm{op}\\times P} & \\ca{V}\\textrm{-}\\B{Cat}\\ar[d]^-P \\\\\n\\B{Set}^\\mathrm{op}\\times\\B{Set}\\ar[r]_-{(-)^{(-)}} & \\B{Set}.}\n\\end{equation}\nUsing the canonical (co)cartesian liftings \\cref{canonicalcartesianlift} for any Grothendieck fibration,\ni.e. $\\ensuremath{\\mathrm{Cocart}}(f,C)=(1_{f_*Cf^*},f)\\colon B\\to f_*Cf^*$ for a cocategory $C_X$ and $f\\colon X\\to Z$,\n$\\ensuremath{\\mathrm{Cart}}(g,B)=(1_{g^*Bg_*},g)\\colon g^*Bg_*\\to B$ for a category $B_Y$ and $g\\colon W\\to Y$,\nwe want to deduce that $K$ maps them to the chosen cartesian lifting\n\\begin{displaymath}\n\\xymatrix @C=.6in @R=.3in\n{K(f_*Cf^*,g^*Bg_*)\\ar[rr]^{\\qquad K(\\ensuremath{\\mathrm{Cart}}(f,C),\\ensuremath{\\mathrm{Cart}}(g,B))}\n\\ar @{-->}[d]_-{\\cong} && K(C,B)\\ar @{.>}[dd] &\\\\\n(g^f)^*K(C,B)(g^f)_*\\ar[urr]_-{\\quad\\ensuremath{\\mathrm{Cart}}(g^f,K(C,B))}\\ar @{.>}[d]\n&&& \\textrm{in }\\ca{V}\\textrm{-}\\B{Cat} \\\\\nW^Z\\ar[rr]_-{g^f} && Y^X & \\textrm{in }\\B{Set}}\n\\end{displaymath}\nUsing \\cref{machine1,machine2}, we can initially compute\n\\begin{align*}\nK(f_*Cf^*,g^*Bg_*)_{s,k} &=\\prod_{z,z'\\in Z}[(f_*Cf^*)_{z,z'},(g^*Bg_*)_{sz,kz'}] \\\\\n\\phantom{A} &\\cong\\prod_{z,z'\\in Z}[\\sum_{fx=z}^{fx'=z'}C_{x,x'},B_{gsz,gkz'}], \\\\\n\\left((g^f)^*K(C,B)(g^f)_*\\right)_{s,k} &=K(C,B)_{gsf,gsk}=\\prod_{x,x'\\in X}[C_{x,x'},B_{gsfx,gsfx'}]\n\\end{align*\nwhich are isomorphic since the internal hom maps sums to products in the first variable,\nand the triangle commutes by also applying $K$ to the maps.\n\nThe only thing left to show is that the opposite of \\cref{fibredaction} has a general lax parametrized opfibred adjoint,\ni.e. the opfibred 1-cell for any $\\mathcal{V}$-category $B_Y\n\\begin{displaymath}\n\\xymatrix @C=.8in @R=.4in\n{\\ca{V}\\textrm{-}\\B{Cocat}\\ar[r]^-{K(-,B_Y)^\\mathrm{op}}\\ar[d]_-{W} & \\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}\\ar[d]^-{P^\\mathrm{op}} \\\\\n\\mathbf{Set}\\ar[r]_-{{Y^{(-)}}^\\mathrm{op}} & \\mathbf{Set}^\\mathrm{op}}\n\\end{displaymath}\nhas a lax opfibred adjoint; this will be deduced from \\cref{totaladjointthm}.\nIndeed, there is an adjunction between the base categories\n\\begin{displaymath}\n\\xymatrix @C=.5in\n{\\mathbf{Set} \\ar @<+.8ex>[r]^-{{Y^{(-)}}^\\mathrm{op}}\n\\ar@{}[r]|-{\\bot} & \n\\mathbf{Set}^\\mathrm{op}\\ar @<+.8ex>[l]^-{Y^{(-)}}}\n\\end{displaymath}\nsince $\\B{Set}$ is cartesian monoidal closed, with counit $\\varepsilon$. Moreover, we need to show is that the composite \\cref{specialfunctor}\nbetween the fibres \n\\begin{displaymath}\n\\mathcal{V}\\textrm{-}\\mathbf{Cocat}_{Y^Z}\\xrightarrow{\\;K_{Y^Z}(-,B_Y)^\\mathrm{op}\\;}\\mathcal{V}\\textrm{-}\\mathbf{Cat}_{Y^{Y^Z}}^\\mathrm{op}\n\\xrightarrow{\\quad(\\varepsilon_Z)_!\\quad}\\mathcal{V}\\textrm{-}\\mathbf{Cat}_Z^\\mathrm{op}\n\\end{displaymath}\nhas a right adjoint. We can rewrite it as\n\\begin{displaymath}\n\\xymatrix @C=1.2in @R=.5in\n{\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y^Z,Y^Z))\\ar@{-->}[dr]\\ar[r]^-{\\ensuremath{\\mathbf{Mon}}(\\ensuremath{\\mathrm{Hom}}(-,B_Y))^\\mathrm{op}} &\n\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\text{-}\\mathbf{Mat}({Y^Y}^Z,{Y^Y}^Z))^\\mathrm{op}\\ar[d]^-{(\\varepsilon)^*\\circ-\\circ(\\varepsilon)_*} \\\\\n& \\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\text{-}\\mathbf{Mat}(Z,Z))^\\mathrm{op}}\n\\end{displaymath}\nwhere the top functor is \\cref{Hom_} between the categories of monoids (as a restriction of $\\ensuremath{\\mathbf{Mon}} H$ on globular 2-cells)\nand the side functor is the reindexing functor for the fibration $P$, \\cref{VCatfibred}.\nBy \\cref{cofreecomonVMat}, the domain $\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\text{-}\\mathbf{Mat}(Y^Z,Y^Z))$ is a locally presentable category for any set $Y^Z$.\nMoreover, the following commutative\n\\begin{displaymath}\n\\xymatrix @C=1.3in\n{\\ensuremath{\\mathbf{Comon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y^Z,Y^Z))\n\\ar[r]^-{\\ensuremath{\\mathbf{Mon}}(\\ensuremath{\\mathrm{Hom}}(-,B_Y)^\\mathrm{op}} \\ar[d]_-U &\n\\ensuremath{\\mathbf{Mon}}(\\mathcal{V}\\textrm{-}\\mathbf{Mat}({Y^Y}^Z,{Y^Y}^X))^\\mathrm{op} \\ar[d]^-{S^\\mathrm{op}} \\\\\n\\mathcal{V}\\textrm{-}\\mathbf{Mat}(Y^Z,Y^Z) \n\\ar[r]_-{\\ensuremath{\\mathrm{Hom}}(-,B_Y)^\\mathrm{op}} &\n\\mathcal{V}\\textrm{-}\\mathbf{Mat}({Y^Y}^Z,{Y^Y}^Z)^\\mathrm{op}}\n\\end{displaymath}\nfor a fixed $\\mathcal{V}$-category $B_Y$ shows that the top arrow is cocontinuous: $U$ and $S^\\mathrm{op}$ are comonadic by the same \\cref{cofreecomonVMat}\nand the bottom arrow is the cocontinuous internal hom of $\\ca{V}\\textrm{-}\\B{Grph}$ (\\cref{VGrphclosed})\nrestricted between the cocomplete fibres. Finally, composing with the\ncompanion and conjoint of $\\varepsilon$ on either side always preserves colimits, since tensoring does (see \\cref{propVMat}). Therefore,\n\\cref{Kellyadj} establishes an adjunction\n\\begin{displaymath}\n\\xymatrix @C=1in\n{\\mathcal{V}\\textrm{-}\\mathbf{Cocat}_{Y^Z}\\ar @<+.8ex>[r]^-{(\\varepsilon_Z)_!\\circ K(-,B_Y)^\\mathrm{op}}\\ar@{}[r]|-\\bot\n& \\mathcal{V}\\textrm{-}\\mathbf{Cat}_Z^\\mathrm{op}\\ar @<+.8ex>[l]^-{T_0(-,B_Y)}}\n\\end{displaymath}\nbetween the fibre categories, enough by \\cref{totaladjointthm}\nto induce a right adjoint of $K(-,B_Y)^\\mathrm{op}$ between the total categories such that \n\\begin{displaymath}\n\\xymatrix @R=.5in @C=.8in \n{\\mathcal{V}\\textrm{-}\\mathbf{Cocat} \\ar @<+.8ex>[r]^-{K(-,B_Y)^\\mathrm{op}}\n\\ar@{}[r]|-\\bot \\ar[d]_-{W} &\n\\mathcal{V}\\textrm{-}\\mathbf{Cat}^\\mathrm{op}\\ar @<+.8ex>[l]^-{T(-,B_Y)}\n\\ar[d]^-{P^\\mathrm{op}} \\\\ \n\\mathbf{Set} \\ar@<+.8ex>[r]^-{{Y^{(-)}}^\\mathrm{op}} \n\\ar@{}[r]|-\\bot &\n\\mathbf{Set}^\\mathrm{op} \\ar @<+.8ex>[l]^-{Y^{(-)}}}\n\\end{displaymath}\nis a general lax opfibred adjunction. The assumptions of \\cref{MndfibredenrichedCmnd} are now satisfied and the result follows.\n\n\\begin{thm}\nSuppose $\\mathcal{V}$ is a symmetric monoidal closed category, which is locally presentable.\nThe opfibration $\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}\\to\\B{Set}^\\mathrm{op}$ as well as the fibration $\\ca{V}\\textrm{-}\\B{Cat}\\to\\B{Set}$ are enriched in the symmetric monoidal opfibration\n$\\ca{V}\\textrm{-}\\B{Cocat}\\to\\B{Set}$.\n\\end{thm}\n\nNotice that the total parametrized adjoint $T\\colon\\ca{V}\\textrm{-}\\B{Cat}^\\mathrm{op}\\times\\ca{V}\\textrm{-}\\B{Cat}\\to\\ca{V}\\textrm{-}\\B{Cocat}$ of $K$ obtained as above is isomorphic\nto \\cref{defT}, but the fibred approach provided with the extra information that the underlying set of objects of some $T(A_X,B_Y)$\nis precisely $Y^X$ in a straightforward way.\n\n\\subsection*{Acknowledgements}\nI would like to thank Martin Hyland for the insightful ideas that led to this work, as well\nas Ignacio L\\'opez Franco for helpful discussions that affected this development.\nMajor parts of this work were accomplished during my PhD \\cite{PhDChristina}, for which period I gratefully acknowledge\nthe financial support by Trinity College and DPMMS, University of Cambridge, as well as Propondis and Leventis Foundations.\nThis paper was written within the framework the ARC\nConsolidator project ``Hopf algebras and the symmetries of non-commutative space'', sponsored by F\\'ed\\'eration Wallonie-Bruxelles,\nduring my postdoc at Universit{\\'e} Libre de Bruxelles with Joost Vercruysse.\n\n\n\\bibliographystyle{alpha}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}