-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmorita-equiv.tex
1881 lines (1649 loc) · 135 KB
/
morita-equiv.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[reqno]{amsart}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{mathtools}
\usepackage[all]{xy}
\usepackage{verbatim}
\usepackage{ifthen}
\usepackage{xargs}
\usepackage{bussproofs}
\usepackage{turnstile}
\usepackage{etex}
\hypersetup{colorlinks=true,linkcolor=blue}
\renewcommand{\turnstile}[6][s]
{\ifthenelse{\equal{#1}{d}}
{\sbox{\first}{$\displaystyle{#4}$}
\sbox{\second}{$\displaystyle{#5}$}}{}
\ifthenelse{\equal{#1}{t}}
{\sbox{\first}{$\textstyle{#4}$}
\sbox{\second}{$\textstyle{#5}$}}{}
\ifthenelse{\equal{#1}{s}}
{\sbox{\first}{$\scriptstyle{#4}$}
\sbox{\second}{$\scriptstyle{#5}$}}{}
\ifthenelse{\equal{#1}{ss}}
{\sbox{\first}{$\scriptscriptstyle{#4}$}
\sbox{\second}{$\scriptscriptstyle{#5}$}}{}
\setlength{\dashthickness}{0.111ex}
\setlength{\ddashthickness}{0.35ex}
\setlength{\leasturnstilewidth}{2em}
\setlength{\extrawidth}{0.2em}
\ifthenelse{%
\equal{#3}{n}}{\setlength{\tinyverdistance}{0ex}}{}
\ifthenelse{%
\equal{#3}{s}}{\setlength{\tinyverdistance}{0.5\dashthickness}}{}
\ifthenelse{%
\equal{#3}{d}}{\setlength{\tinyverdistance}{0.5\ddashthickness}
\addtolength{\tinyverdistance}{\dashthickness}}{}
\ifthenelse{%
\equal{#3}{t}}{\setlength{\tinyverdistance}{1.5\dashthickness}
\addtolength{\tinyverdistance}{\ddashthickness}}{}
\setlength{\verdistance}{0.4ex}
\settoheight{\lengthvar}{\usebox{\first}}
\setlength{\raisedown}{-\lengthvar}
\addtolength{\raisedown}{-\tinyverdistance}
\addtolength{\raisedown}{-\verdistance}
\settodepth{\raiseup}{\usebox{\second}}
\addtolength{\raiseup}{\tinyverdistance}
\addtolength{\raiseup}{\verdistance}
\setlength{\lift}{0.8ex}
\settowidth{\firstwidth}{\usebox{\first}}
\settowidth{\secondwidth}{\usebox{\second}}
\ifthenelse{\lengthtest{\firstwidth = 0ex}
\and
\lengthtest{\secondwidth = 0ex}}
{\setlength{\turnstilewidth}{\leasturnstilewidth}}
{\setlength{\turnstilewidth}{2\extrawidth}
\ifthenelse{\lengthtest{\firstwidth < \secondwidth}}
{\addtolength{\turnstilewidth}{\secondwidth}}
{\addtolength{\turnstilewidth}{\firstwidth}}}
\ifthenelse{\lengthtest{\turnstilewidth < \leasturnstilewidth}}{\setlength{\turnstilewidth}{\leasturnstilewidth}}{}
\setlength{\turnstileheight}{1.5ex}
\sbox{\turnstilebox}
{\raisebox{\lift}{\ensuremath{
\makever{#2}{\dashthickness}{\turnstileheight}{\ddashthickness}
\makehor{#3}{\dashthickness}{\turnstilewidth}{\ddashthickness}
\hspace{-\turnstilewidth}
\raisebox{\raisedown}
{\makebox[\turnstilewidth]{\usebox{\first}}}
\hspace{-\turnstilewidth}
\raisebox{\raiseup}
{\makebox[\turnstilewidth]{\usebox{\second}}}
\makever{#6}{\dashthickness}{\turnstileheight}{\ddashthickness}}}}
\mathrel{\usebox{\turnstilebox}}}
\newcommand{\axlabel}[1]{(#1) \phantomsection \label{ax:#1}}
\newcommand{\axtag}[1]{\label{ax:#1} \tag{#1}}
\newcommand{\axref}[1]{(\hyperref[ax:#1]{#1})}
\newcommand{\newref}[4][]{
\ifthenelse{\equal{#1}{}}{\newtheorem{h#2}[hthm]{#4}}{\newtheorem{h#2}{#4}[#1]}
\expandafter\newcommand\csname r#2\endcsname[1]{#3~\ref{#2:##1}}
\expandafter\newcommand\csname R#2\endcsname[1]{#4~\ref{#2:##1}}
\expandafter\newcommand\csname n#2\endcsname[1]{\ref{#2:##1}}
\newenvironmentx{#2}[2][1=,2=]{
\ifthenelse{\equal{##2}{}}{\begin{h#2}}{\begin{h#2}[##2]}
\ifthenelse{\equal{##1}{}}{}{\label{#2:##1}}
}{\end{h#2}}
}
\newref[section]{thm}{Theorem}{Theorem}
\newref{lem}{Lemma}{Lemma}
\newref{prop}{Proposition}{Proposition}
\newref{cor}{Corollary}{Corollary}
\newref{cond}{Condition}{Condition}
\theoremstyle{definition}
\newref{defn}{Definition}{Definition}
\newref{example}{Example}{Example}
\theoremstyle{remark}
\newref{remark}{Remark}{Remark}
\newcommand{\cat}[1]{\mathbf{#1}}
\newcommand{\colim}{\mathrm{colim}}
\newcommand{\C}{\cat{C}}
\newcommand{\PAlg}[1]{#1\text{-}\cat{PAlg}}
\newcommand{\Mod}[1]{#1\text{-}\cat{Mod}}
\newcommand{\Th}{\cat{Th}}
\newcommand{\St}{\cat{St}}
\newcommand{\PSt}{\cat{PSt}}
\newcommand{\algtt}{\cat{TT}}
\newcommand{\ThC}{\Th_{\mathcal{C}}}
\newcommand{\emptyCtx}{\mathbf{1}}
\newcommand{\nf}{\mathrm{nf}}
\newcommand{\red}{\Rightarrow}
\newcommand{\deq}{\equiv}
\newcommand{\repl}{:=}
\newcommand{\type}{}
\newcommand{\Syn}{\mathrm{Syn}}
\newcommand{\Lang}{\mathrm{Lang}}
\newcommand{\Ho}{\mathrm{Ho}}
\newcommand{\Term}{\mathrm{Term}}
\newcommand{\FV}{\mathrm{FV}}
\newcommand{\IdT}{\mathrm{Id}}
\newcommand{\Jeq}{\mathit{Jeq}}
\newcommand{\wUA}{\mathrm{wUA}}
\newcommand{\coeT}{\mathrm{coe}}
\newcommand{\PathT}{\mathrm{Path}}
\newcommand{\transportT}{\mathrm{transport}}
\newcommand{\at}{\mathit{at}}
\newcommand{\unit}{\mathit{unit}}
\newcommand{\Ceq}{\mathit{eq}}
\newcommand{\Id}{\mathit{Id}}
\newcommand{\idtype}{\rightsquigarrow}
\newcommand{\leftI}{\mathit{left}}
\newcommand{\rightI}{\mathit{right}}
\newcommand{\pair}{\mathit{pair}}
\newcommand{\elim}{\mathit{elim}}
\newcommand{\coe}{\mathit{coe}}
\newcommand{\app}{\mathit{app}}
\newcommand{\sq}{\mathit{sq}}
\newcommand{\conc}{\mathit{conc}}
\newcommand{\congI}{\mathit{cong}}
\newcommand{\refl}{\mathit{refl}}
\newcommand{\subst}{\mathit{subst}}
\newcommand{\wk}{\mathit{wk}}
\newcommand{\transport}{\mathit{transport}}
\newcommand{\ft}{\mathit{ft}}
\newcommand{\ty}{\mathit{ty}}
\newcommand{\ctx}{\mathit{ctx}}
\newcommand{\tm}{\mathit{tm}}
\newcommand{\we}{\mathcal{W}}
\newcommand{\fib}{\mathcal{F}}
\newcommand{\cof}{\mathcal{C}}
\newcommand{\I}{\mathrm{I}}
\newcommand{\J}{\mathrm{J}}
\newcommand{\class}[2]{#1\text{-}\mathrm{#2}}
\newcommand{\Iinj}[1][\I]{\class{#1}{inj}}
\newcommand{\Icell}[1][\I]{\class{#1}{cell}}
\newcommand{\Icof}[1][\I]{\class{#1}{cof}}
\newcommand{\Jinj}[1][]{\Iinj[\J#1]}
\newcommand{\Jcell}[1][]{\Icell[\J#1]}
\newcommand{\Jcof}[1][]{\Icof[\J#1]}
\newcommand{\cyli}{i}
\numberwithin{figure}{section}
\newcommand{\pb}[1][dr]{\save*!/#1-1.2pc/#1:(-1,1)@^{|-}\restore}
\newcommand{\po}[1][dr]{\save*!/#1+1.2pc/#1:(1,-1)@^{|-}\restore}
\begin{document}
\title{Morita equivalences between algebraic dependent type theories}
\author{Valery Isaev}
\begin{abstract}
We define a notion of equivalence between algebraic dependent type theories which we call Morita equivalence.
This notion has a simple syntactic description and an equivalent description in terms of models of the theories.
The category of models of a type theory often carries a natural structure of a model category.
If this holds for the categories of models of two theories, then a map between them is a Morita equivalence if and only if the adjunction generated by it is a Quillen equivalence.
\end{abstract}
\maketitle
\section{Introduction}
Homotopy type theory can be seen as an internal language of $\infty$-categories.
One way to formalize this point of view is to define a (semi-)model structure on the category of models of a type theory and
prove that it is Quillen equivalent to a model category presenting the $\infty$-category of $\infty$-categories with some additional structure depending on the theory.
This implies that every such $\infty$-category can be presented in the form of a model of this type theory and the theory is naturally ``the internal language'' of its models.
Such (semi-)model structures were constructed in \cite{alg-models} and \cite{kap-lum-model}.
A partial progress on the latter point was made in \cite{kapulkin-szumilo-fin-comp},
where an equivalence between the $\infty$-category of finitely complete $\infty$-categories and the $\infty$-category of models of the type theory with identity types, $\Sigma$-types, and unit types was constructed.
A type theory often can be formulated in several different ways so that the categories of models of these theories are not equivalent
For example, we give several ways to formulate the theory of $\Pi$-types in subsection~\ref{sec:simple}.
A natural question is whether the categories of models of these theories are equivalent in an appropriate sense.
If we can answer this question positively, then it does not matter which theory we use to formulate conjectures about the category of its models such as the one mentioned above.
There is another reason why we might be interested in this question.
There are several theories which should be equivalent in some sense:
\begin{itemize}
\item The theory of a unit type and the theory of a contractible type should be equivalent since the only difference between them is that the former postulate the contractibility of a type judgmentally.
\item It seems that the previous example generalizes to many theories such as the theory of identity types or various theories of inductive types.
We can replace judgmental equality rules with their propositional analogues.
For example, the rule $\Gamma \vdash J(A,a,D,d,a,\refl(a)) \deq d[a]$ is replaced with a new construction $\Jeq(A,D,d,a) : \Id(J(A,a,D,d,a,\refl(a)),d[a])$.
These two theories should be equivalent and, since the theory with the propositional rule is cofibrant, it is a cofibrant replacement of the theory of identity types.
\item If a theory has a judgmental equality between types, then we can replace it with an equivalence between these types.
It is useful to know that these theories are equivalent since there are many examples of models of the theory with the equivalence which are not known to be models of the theory with the judgmental rule.
\item There are two ways in which the theory of $\Sigma$-types can be defined: one of them uses projections and the $\eta$-rule and the other uses usual eliminator rule.
\item The theories of dependent and non-dependent function types should be equivalent (assuming $\Sigma$-types). This is similar to the statement that a category is locally Cartesian closed if and only if it has the $\Pi$-functor.
\item The theory of the interval type defined in \cite{alg-models} should be equivalent to the theory with identity types and the unit type.
\end{itemize}
For every pair of theories listed above, one of the theories can be interpreted in the other, but not the other way around.
This means that these equivalences should be some sort of weak equivalences in a category of type theories.
One definition of such a category was proposed in \cite{alg-tt}.
In this paper, we define several notions of weak equivalences between theories including syntactic equivalence and Morita equivalence.
There is a natural notion of weak equivalences between models of type theories.
It was shown in \cite{alg-models} that if a theory has the interval type, then there is a model structure on the category of models of this theory.
We will prove that there is also a model structure on the category of theories with the interval type with Morita equivalences as weak equivalences.
Morita equivalence between theories $T_1$ and $T_2$ is defined as a map $f : T_1 \to T_2$ such that the unit $\eta_X : X \to f^*(f_!(X))$ of the adjunction $f_! \dashv f^*$ generated by this map is a weak equivalence for every cofibrant object $X$.
Note that the notions of weak equivalences between models and cofibrant models make sense even the model structure does not exist.
If it does exist, then a map is a Morita equivalence if and only if the adjunction is a Quillen equivalence.
This gives us a tool that allows us to compare models of different type theories.
Syntactic equivalences are weaker than Morita equivalences.
A map is a syntactic equivalence if the initial models of theories are weakly equivalent.
More precisely, a map $f : T_1 \to T_2$ is a syntactic equivalence if and only if the unique map $0 \to f^*(0)$ is a weak equivalence.
There is also a characterization of Morita equivalences in syntactic terms.
It seems that this characterization is the most useful one if we want to check that a specific map is a Morita equivalence.
To work with this characterization, it is useful to assume that the theories are confluent.
Roughly speaking, this means that we can choose a direction of axioms so that the relation corresponding to the axioms with the chosen direction is confluent.
We will give a formal definition of confluent theories in the setting of algebraic type theories.
Unfortunately, we still do not know whether all of the examples listed above are indeed Morita equivalences.
Nevertheless, we prove that this is true for the first example and give several other simple examples.
The paper is organized as follows.
In section~\ref{sec:morita}, we give several definitions of syntactic equivalences and Morita equivalences and prove that they are equivalent.
In section~\ref{sec:model-structure}, we construct a model structure on the category of theories with the interval type.
In section~\ref{sec:triv-fib}, we give a characterization of trivial fibrations between theories.
In section~\ref{sec:confluent}, we define confluent theories and prove their properties.
In section~\ref{sec:examples}, we give several examples of Morita equivalences.
In section~\ref{sec:conclusion}, we summarize the results of this paper and discuss issues that prevent us from constructing more examples of Morita equivalences.
\section{Morita equivalences of theories}
\label{sec:morita}
In this section we define several notions of weak equivalence of algebraic dependent type theories.
\subsection{Algebraic dependent type theories}
In this paper, we will need a precise definition of a type theory.
Moreover, we will need a category of such theories.
We will work with definitions given in \cite{alg-tt}.
They are based on the notion of partial Horn theories defined in \cite{PHL}.
Similar ideas were developed by Lumsdaine, Bauer, and Haselwarter \cite{lum-tt}.
In this section, we briefly recall necessary definitions and notations.
A many sorted first-order signature $(\mathcal{S},\mathcal{F},\mathcal{P})$ consists of a set $\mathcal{S}$ of sorts,
a set $\mathcal{F}$ of function symbols and a set $\mathcal{P}$ of predicate symbols.
Each function symbol $\sigma$ is equipped with a signature of the form $\sigma : s_1 \times \ldots \times s_k \to s$, where $s_1$, \ldots $s_k$, $s$ are sorts.
Each predicate symbol $R$ is equipped with a signature of the form $R : s_1 \times \ldots \times s_k$.
If $V$ is an $\mathcal{S}$-set, then the $\mathcal{S}$-set of terms of $T$ with free variables in $V$ will be denoted by $\Term_T(V)$.
An atomic formula is an expression either of the form $t_1 = t_2$ or of the form $R(t_1, \ldots t_n)$,
where $R$ is a predicate symbol and $t_1$, \ldots $t_n$ are terms.
We abbreviate $t = t$ to $t\!\downarrow$.
A Horn formula is an expression of the form $\varphi_1 \land \ldots \land \varphi_n$, where $\varphi_1$, \ldots $\varphi_n$ are atomic formulas.
The conjunction of the empty set of atomic formulas is denoted by $\top$.
A sequent is an expression of the form $\varphi \sststile{}{x_1, \ldots x_n} \psi$, where $x_1$, \ldots $x_n$ are variables
and $\varphi$ and $\psi$ are Horn formulas such that $\FV(\varphi) \cup \FV(\psi) \subseteq \{ x_1, \ldots x_n \}$.
A \emph{partial Horn theory} consists of a signature and a set of Horn sequents in this signature.
An $\mathcal{S}$-set $M$ is a collection of sets $\{ M_s \}_{s \in \mathcal{S}}$.
An interpretation $M$ of a signature $(\mathcal{S},\mathcal{F},\mathcal{P})$ is an $\mathcal{S}$-set $M$
together with a collection of \emph{partial} functions $M(\sigma) : M_{s_1} \times \ldots \times M_{s_k} \to M_s$
for every function symbol $\sigma : s_1 \times \ldots \times s_k \to s$ of $T$
and relations $M(R) \subseteq M_{s_1} \times \ldots \times M_{s_k}$ for every predicate symbol $R : s_1 \times \ldots \times s_k$.
A model of a partial Horn theory $T$ is an interpretation of the underlying signature such that the axioms of $T$ hold in this interpretation.
The category of models of $T$ will be denoted by $\Mod{T}$.
The rules of \emph{partial Horn logic} are listed below.
A \emph{theorem} of a partial Horn theory $T$ is a sequent derivable from $T$ in this logic.
We will write $\varphi \sststile{T}{V} \psi$ to denote the fact that sequent $\varphi \sststile{}{V} \psi$ is derivable in $T$.
\begin{center}
$\varphi \sststile{}{V} \varphi$ \axlabel{b1}
\qquad
\AxiomC{$\varphi \sststile{}{V} \psi$}
\AxiomC{$\psi \sststile{}{V} \chi$}
\RightLabel{\axlabel{b2}}
\BinaryInfC{$\varphi \sststile{}{V} \chi$}
\DisplayProof
\qquad
$\varphi \sststile{}{V} \top$ \axlabel{b3}
\end{center}
\medskip
\begin{center}
$\varphi \land \psi \sststile{}{V} \varphi$ \axlabel{b4}
\qquad
$\varphi \land \psi \sststile{}{V} \psi$ \axlabel{b5}
\qquad
\AxiomC{$\varphi \sststile{}{V} \psi$}
\AxiomC{$\varphi \sststile{}{V} \chi$}
\RightLabel{\axlabel{b6}}
\BinaryInfC{$\varphi \sststile{}{V} \psi \land \chi$}
\DisplayProof
\end{center}
\medskip
\begin{center}
$\sststile{}{x} x\!\downarrow$ \axlabel{a1}
\qquad
$x = y \land \varphi \sststile{}{V,x,y} \varphi[y/x]$ \axlabel{a2}
\end{center}
\medskip
\begin{center}
\AxiomC{$\varphi \sststile{}{V} \psi$}
\RightLabel{, $x \in \FV(\varphi)$ \axlabel{a3}}
\UnaryInfC{$\varphi[t/x] \sststile{}{V,V'} \psi[t/x]$}
\DisplayProof
\end{center}
\medskip
We will give several proofs by induction on the derivation of a sequent.
We need to work with sequents in which the left hand side has some property, but in a derivation of a sequent in this logic the left hand side may vary arbitrary.
Thus we describe another set of rules which is equivalent to this one and in which the left hand side stays the same.
We call these rules the \emph{natural deduction system}.
In this system the right hand side of all sequents is an atomic formula.
\begin{center}
\AxiomC{}
\RightLabel{\axlabel{nv}}
\UnaryInfC{$\varphi \sststile{}{V} x\!\downarrow$}
\DisplayProof
\qquad
\AxiomC{$\varphi \sststile{}{V} a = b$}
\RightLabel{\axlabel{ns}}
\UnaryInfC{$\varphi \sststile{}{V} b = a$}
\DisplayProof
\end{center}
\begin{center}
\AxiomC{}
\RightLabel{\axlabel{nh}}
\UnaryInfC{$\varphi_1 \land \ldots \land \varphi_n \sststile{}{V} \varphi_i$}
\DisplayProof
\qquad
\AxiomC{$\varphi \sststile{}{V} a = b$}
\AxiomC{$\varphi \sststile{}{V} \psi[a/x]$}
\RightLabel{\axlabel{nl}}
\BinaryInfC{$\varphi \sststile{}{V} \psi[b/x]$}
\DisplayProof
\end{center}
\begin{center}
\AxiomC{$\varphi \sststile{}{V} R(t_1, \ldots t_n)$}
\RightLabel{\axlabel{np}}
\UnaryInfC{$\varphi \sststile{}{V} t_i\!\downarrow$}
\DisplayProof
\qquad
\AxiomC{$\varphi \sststile{}{V} \sigma(t_1, \ldots t_n)\!\downarrow$}
\RightLabel{\axlabel{nf}}
\UnaryInfC{$\varphi \sststile{}{V} t_i\!\downarrow$}
\DisplayProof
\end{center}
where $R$ is a predicate symbol of the theory and $\sigma$ is its function symbol.
Finally, for every axiom $\psi_1 \land \ldots \land \psi_n \sststile{}{x_1 : s_1, \ldots x_k : s_k} \chi_1 \land \ldots \land \chi_m$
and for all terms $t_1 : s_1$, \ldots $t_k : s_k$, we have the following rules for all $1 \leq j \leq m$:
\smallskip
\begin{center}
\AxiomC{$\varphi \sststile{}{V} t_i\!\downarrow$, $1 \leq i \leq k$}
\AxiomC{$\varphi \sststile{}{V} \psi_i[t_1/x_1, \ldots t_k/x_k]$, $1 \leq i \leq n$}
\RightLabel{\axlabel{na}}
\BinaryInfC{$\varphi \sststile{}{V} \chi_j[t_1/x_1, \ldots t_k/x_k]$}
\DisplayProof
\end{center}
\begin{prop}
A sequent $\varphi \sststile{}{V} \psi_1 \land \ldots \land \psi_n$ is derivable in the system of rules \axref{b1}-\axref{b6}, \axref{a1}-\axref{a3} if and only if
sequents $\varphi \sststile{}{V} \psi_1$, \ldots $\varphi \sststile{}{V} \psi_n$ are derivable in the natural deduction system.
\end{prop}
\begin{proof}
It is easy to prove the ``if'' part.
Conversely, the rules \axref{b1}, \axref{b4}, and \axref{b5} follow from \axref{nh},
the rules \axref{b3} and \axref{b6} hold trivially,
the rule \axref{a1} follows from \axref{nv},
the rule \axref{a2} follows from \axref{nl} and \axref{nh},
and every axiom is derivable from \axref{na}.
To prove the rule \axref{b2}, we just need to show that if sequents $\varphi \sststile{}{V} \psi_1$, \ldots $\varphi \sststile{}{V} \psi_n$,
and $\psi_1 \land \ldots \land \psi_n \sststile{}{V} \chi$ are derivable in the natural deduction, then $\varphi \sststile{}{V} \chi$ is also derivable.
We can construct a derivation tree for this sequent as a derivation tree for $\psi_1 \land \ldots \land \psi_n \sststile{}{V} \chi$
in which the left hand sides of all sequents are replaced with $\varphi$ and rules \axref{nh} are replaced with derivation trees for $\varphi \sststile{}{V} \psi_i$.
To prove the rule \axref{a3}, consider a derivation tree for a sequent $\varphi \sststile{}{V} \psi$.
To construct a derivation tree for $\varphi[t/x] \sststile{}{V,V'} \psi[t/x]$, we just need to apply the substitution to every sequent in this derivation tree.
The only rule that is not closed under substitution is \axref{nv}.
By assumption, $x \in \FV(\varphi)$.
In this case the sequent $\varphi[t/x] \sststile{}{V,V'} t\!\downarrow$ is derivable from \axref{np}, \axref{nf} and the following rules:
\begin{center}
\AxiomC{$\varphi \sststile{}{V} t_1 = t_2$}
\RightLabel{\axlabel{ne1}}
\UnaryInfC{$\varphi \sststile{}{V} t_1\!\downarrow$}
\DisplayProof
\qquad
\AxiomC{$\varphi \sststile{}{V} t_1 = t_2$}
\RightLabel{\axlabel{ne2}}
\UnaryInfC{$\varphi \sststile{}{V} t_2\!\downarrow$}
\DisplayProof
\end{center}
The rule \axref{ne2} follows from \axref{nl} if we take $\psi(x) = (x = b)$.
The rule \axref{ne1} follows from \axref{ne2} and \axref{ns}.
\end{proof}
We will need the following lemma later:
\begin{lem}[mcf]
A sequent $\varphi \sststile{}{x_1, \ldots x_n} \psi$ is provable in a theory $T$ if and only if
the sequent $\sststile{}{} \psi[c_1/x_1, \ldots c_n/x_n]$ is provable in the theory $T \cup \{ \sststile{}{} c_i\!\downarrow\ |\ 1 \leq i \leq n \} \cup \{ \varphi[c_1/x_1, \ldots c_n/x_n] \}$,
where $c_1$, \ldots $c_n$ are fresh constants.
\end{lem}
\begin{proof}
This follows from \cite[Theorem~10, Theorem~11]{PHL}.
\end{proof}
Partial Horn theories with a given set of sorts $\mathcal{S}$ form a category which we will denote by $\Th_\mathcal{S}$ (see \cite[Section~2]{alg-tt} for a definition).
The category of models $\Mod{T}$ embeds fully faithfully into the category $T/\Th_\mathcal{S}$.
We will denote the embedding functor by $\Lang$.
This functor has a right adjoint $\Syn : T/\Th_\mathcal{S} \to \Mod{T}$.
The model $\Syn(T')$ is defined as the syntactic model of the theory $T'$.
The precise definition of these functors is given in \cite[Section~4.1]{alg-models}.
The \emph{theory of substitutions} is the theory with $\mathcal{S} = \{ \ctx, \tm \} \times \mathbb{N}$ as the set of sorts, function symbols given below, and axioms listed in \cite[Section~3.1]{alg-tt}.
\begin{align*}
\emptyCtx & : (\ctx,0) \\
\ft_n & : (\ty,n) \to (\ctx,n) \\
\ty_n & : (\tm,n) \to (\ty,n) \\
v_{n,i} & : (\ctx,n) \to (\tm,n) \text{, } 0 \leq i < n \\
\subst_{p,n,k} & : (\ctx,n) \times (p,k) \times (\tm,n)^k \to (p,n) \text{, } p \in \{ \tm, \ty \}
\end{align*}
We often omit index $n$ in these function symbols.
So, we will write $\ft$, $\ty$, and $v_i$ instead of $\ft_n$, $\ty_n$, and $v_{n,i}$, respectively.
Function symbols $v_{n,i}$ represent de Bruijn indices.
We will sometimes use named representation of terms.
So, $A_1, \ldots A_n \vdash B(v_{n-1, \ldots v_0})$ and $x_1 : A_1, \ldots x_n : A_n \vdash B(x_1, \ldots x_n)$ represent the same judgment.
The judgment itself simply denotes the formula $\ft(B(v_{n-1, \ldots v_0})) = A_n \land \ft(A_n) = A_{n-1} \land \ldots \land \ft(A_1) = A_0$.
Similarly, judgement $\Gamma \vdash b : B$ represents formula $\ty(b) = B \land (\Gamma \vdash B)$.
Note that $\subst_{p,n,k}$ denotes the usual type-theoretic substitution while $t[s/x]$ denotes substitution on the meta level of algebraic theories.
We let $\ft^i_n : (\ctx,n+i) \to (\ctx,n)$ and $\ctx_{p,n} : (p,n) \to (\ctx,n)$ be the following derived operations:
\begin{align*}
\ft^0_n(A) & = A \\
\ft^{i+1}_n(A) & = \ft^i_n(\ft_{n+i}(A)) \\
\ctx_{\ty,n}(t) & = \ft_n(t) \\
\ctx_{\tm,n}(t) & = \ft_n(\ty_n(t)) \\
\ctx^i_{p,n}(t) & = \ft^i_n(\ctx_{p,n+i}(t))
\end{align*}
We also write $(\ty,n)$ for $(\ctx,n+1)$.
Let $\mathcal{F}_0$ be a set of function symbols and let $\mathcal{P}_0$ be a set of predicate symbols.
We call elements of these sets basic function symbols and basic predicate symbols, respectively.
Then we define the full sets of function and predicate symbols:
\begin{align*}
\mathcal{F} = \{ & \sigma_m : (\ctx,m) \times (p_1,m+n_1) \times \ldots \times (p_k,m+n_k) \to (p,m+n) \mid \\
& m \in \mathbb{N}, \sigma \in \mathcal{F}_0, \sigma : (p_1,n_1) \times \ldots \times (p_k,n_k) \to (p,n) \} \\
\mathcal{P} = \{ & R_m : (\ctx,m) \times (p_1,m+n_1) \times \ldots \times (p_k,m+n_k) \mid \\
& m \in \mathbb{N}, R \in \mathcal{P}_0, R : (p_1,n_1) \times \ldots \times (p_k,n_k) \}
\end{align*}
An \emph{algebraic dependent type theory} is a theory of the form $(\mathcal{S}, \mathcal{F}_s \cup \mathcal{F}, \mathcal{P}, \mathcal{A}_s \cup \mathcal{A})$, where $\mathcal{S}$, $\mathcal{F}$, and $\mathcal{P}$ are defined above,
$\mathcal{F}_s$ is the set of function symbols of the theory of substitutions, $\mathcal{A}_s$ is the set of its axioms, and $\mathcal{A}$ is an arbitrary set of axioms such that the following sequents are derivable for every $\sigma_m \in \mathcal{F}$ and $R_m \in \mathcal{P}$:
\begin{align*}
\sigma_m(\Gamma, x_1, \ldots x_k)\!\downarrow\ & \sststile{}{\Gamma, x_1, \ldots x_k} \ctx^n_{p,m}(\sigma_m(\Gamma, x_1, \ldots x_k)) = \Gamma \\
\sigma_m(\Gamma, x_1, \ldots x_k)\!\downarrow\ & \sststile{}{\Gamma, x_1, \ldots x_k} \bigwedge_{1 \leq i \leq k} \ctx^{n_i}_{p_i,m}(x_i) = \Gamma \\
R_m(\Gamma, x_1, \ldots x_k) & \sststile{}{\Gamma, x_1, \ldots x_k} \bigwedge_{1 \leq i \leq k} \ctx^{n_i}_{p_i,m}(x_i) = \Gamma
\end{align*}
Moreover, such a theory must satisfy the condition given in \cite[Definition~4.5]{alg-tt}, which just says that $\subst$ commutes with all function symbols.
We will also use the theory defined in \cite{alg-models}, which we denote by $\coeT_1 + \sigma + \PathT + \wUA$.
This theory has an interval type $I$ with two constructors $left$ and $right$ and an eliminator $\coe$, which is just the eliminator for the unit type.
It also has the following axiom, which we denote by $\sigma$:
\[ \coe(x.A, a, i) = a \text{, if } x \notin \FV(A) \]
It also has the type of paths, which we will denote by $\Id(a,a')$ and a weak univalence axiom.
\subsection{Model categories of models of type theories}
To define Morita equivalences between two theories $T_1$ and $T_2$, they must have some additional structure.
We assume that all of the theories are equipped with a morphism from the theory that has one function symbol
$\Id : (\tm,0) \times (\tm,0) \to (\ty,0)$ and the only axiom $\Id(x,y)\!\downarrow\ \sststile{}{x,y} \ty(x) = \ty(y)$.
We will denote this theory by $\IdT_0$.
We often need to assume even more structure, but we will always state additional assumptions explicitly.
Let $T$ be a theory under $\IdT_0$ and let $X$ be a model of $T$.
A \emph{relative homotopy} between terms $a,a' \in X_{(\tm,n)}$ is a term $h \in X_{(\tm,n)}$ such that $\ty(h) = \Id(a,a')$.
A \emph{relative homotopy} between types $A,A' \in X_{(\ty,n)}$ is a tuple $(f,g,p,g',p')$, where $f,g,p,g',p' \in X_{(\tm,n+1)}$ such that
\begin{align*}
x : A & \vdash f : A' \\
y : A' & \vdash g : A \\
x : A & \vdash p : \Id(g[y \mapsto f], x) \\
y : A' & \vdash g' : A \\
y : A' & \vdash p' : \Id(f[x \mapsto g], y)
\end{align*}
In general the homotopy relation is not an equivalence relation, but it is if $T$ also has the reflexivity and transport operations:
\begin{center}
\AxiomC{}
\UnaryInfC{$\vdash \refl(x) : \Id(x,x)$}
\DisplayProof
\qquad
\AxiomC{$\vdash p : \Id(a,a')$}
\AxiomC{$\vdash b : B[a]$}
\BinaryInfC{$\vdash \transport(B,a,a',p,b) : B[a']$}
\DisplayProof
\end{center}
Let $X$ and $Y$ be models of a theory with identity types.
A morphism of models $f : X \to Y$ is \emph{weak equivalence} if it satisfies the following conditions:
\begin{enumerate}
\item For all $A \in X_{(\ty,n)}$ and $a \in Y_{(\tm,n)}$ such that $\ty(a) = f(A)$,
there is a term $a' \in X_{(\tm,n)}$ such that $\ty(a') = A$ and $f(a')$ is relatively homotopic to $a$.
In this case we will say that $f$ is \emph{essentially surjective on terms}.
\item For all $\Gamma \in X_{(\ctx,n)}$ and $A \in Y_{(\ty,n)}$ such that $\ft(A) = f(\Gamma)$,
there is a type $A' \in X_{(\ty,n)}$ such that $\ft(A') = \Gamma$ and $f(A')$ is relatively homotopic to $A$.
In this case we will say that $f$ is \emph{essentially surjective on types}.
\end{enumerate}
For every theory $T$ under $\IdT_0$, we define a set $\I$ of maps in the category of models of $T$ as the set consisting of maps of the form
\[ F(\{ A : (d_p,n) \}) \to F(\{ e_p(a) = A \}) \]
where $d_\ty = \ctx$, $d_\tm = \ty$, $e_\ty(a) = \ft(a)$, $e_\tm(a) = \ty(a)$,
and $F(S)$ is the free model generated by the specified generators and relations.
The class of \emph{cofibrations} of $\Mod{T}$ is generated by $\I$.
Let $\J$ be the set consisting of maps of the following forms:
\begin{align*}
F(\{ a : (\tm,n) \}) & \to F(\{ a, a' : (\tm,n), p : \Id(a,a') \}) \\
F(\{ A : (\ty,n) \}) & \to F(\{ A, A' : (\ty,n), f,g,p,g',p' : (\tm,n+1), S \}),
\end{align*}
where $S$ is the set of formulas asserting that $(f,g,p,g',p')$ is a relative homotopy between $A$ and $A'$.
The class of \emph{anodyne extensions} is generated by $\J$.
We are interested in question when the classes of cofibrations and weak equivalences as defined above determine a model structure or a left semi-model structure.
We will use the definition of left semi-model structures given in \cite[Lemma~6.7]{kap-lum-model}.
We will say that a theory is \emph{a model theory} (resp., \emph{a semi-model theory}) if this model structure (resp., left semi-model structure) exists on the category of its models.
We proved several results about model structures in \cite{f-model-structures} which are useful when working with this model structure and they also apply to left semi-model structure.
\begin{prop}[model-theories]
A theory is a model theory if and only if the weak equivalences satisfy the 2-out-of-3 property and pushouts of maps in $\J$ are weak equivalences.
A theory is a semi-model theory if and only if the weak equivalences satisfy the 2-out-of-6 property and a pushout of a map in $\J$ is a weak equivalence if it has a cofibrant domain.
\end{prop}
\begin{proof}
This follows from \cite[Proposition~3.1]{f-model-structures} and the fact that weak equivalences are closed under transfinite compositions.
\end{proof}
It was shown in \cite{kap-lum-model} that a certain theory with identity types, $\Sigma$-types, and $\Pi$-types is a semi-model theory.
We proved in \cite{alg-models} that all theories under $\coeT_1 + \sigma + \PathT + \wUA$ are model theories.
The argument that shows this actually applies to any theory under $\coeT^{l'}_2 + \PathT + \wUA$ (see the cited paper for the definition of these theories).
We will prove that a theory under $\coeT_1 + \sigma + \PathT + \wUA$ is often equivalent to a theory under $\coeT^{l'}_2 + \PathT + \wUA$, so we might work with either of them,
but we prefer to use the latter theory since it is harder to show that theories with the $\sigma$-rule are confluent (see section~\ref{sec:confluent} for a definition of a confluent theory).
\subsection{Morita equivalences}
Now, we can give the main definition of this paper.
\begin{defn}
A \emph{Morita equivalence} between theories $T_1$ and $T_2$ is a morphism $f : T_1 \to T_2$ such that for every cofibrant model $X$ of $T_1$,
the unit $\eta_X : X \to f^*(f_!(X))$ of the adjunction $f_! \dashv f^*$ is a weak equivalence.
We will say that $f$ is a \emph{strict Morita equivalence} if $\eta_X$ is a weak equivalence for every $X$.
We will say that $f$ is a \emph{syntactic equivalence} if $\eta_X$ is a weak equivalence when $X$ is the initial model.
\end{defn}
If the theories are semi-model, then we can give a characterization of Morita equivalences in terms of the semi-model structures on the categories of their models.
\begin{prop}[morita-quillen]
Let $T_1$ and $T_2$ be semi-model theories.
Then, for every morphism $f : T_1 \to T_2$, the adjunction $f_! \dashv f^*$ is a Quillen adjunction.
It is a Quillen equivalence if and only if $f$ is a Morita equivalence.
\end{prop}
\begin{proof}
Since $f_!$ is a left adjoint, it preserves object defined by generators and relations.
Since the set of generating cofibration $\I$ and the set of generating trivial cofibration $\J_\I$
are both defined in terms of generators and relations, this implies that $f_!$ preserves them.
Hence $f_! \dashv f^*$ is a Quillen adjunction.
The second part of the proposition follows from \cite[Corollary~3.9]{f-model-structures}.
\end{proof}
We can give a useful characterization of (strict) Morita equivalences.
To do this, we need to define a notion of a relative homotopy between terms in a theory.
Let $T$ be a theory with identity types and let $\varphi$ be a formula of $T$.
A \emph{relative homotopy} between types $A,A' \in \Term_T(V)_{(\ty,n)}$ with respect to $\varphi$ is a tuple $f,g,p,g',p' \in \Term_T(V)_{(\tm,n+1)}$
such that sequent $\varphi \sststile{}{V} \psi$ is derivable in $T$, where $\psi$ is the conjunction of formulas that appear in the definition of a relative homotopy for models.
If $a,a' \in \Term_T(V)_{(\tm,n)}$ are terms such that $\varphi \sststile{}{V} \ty(a) = \ty(a')$, then a \emph{relative homotopy} between $a$ and $a'$ with respect to $\varphi$ is a term $h \in \Term_T(V)_{(\tm,n)}$
such that sequent $\varphi \sststile{}{V} \ty(h) = \Id(a,a')$ is derivable in $T$.
If $a$ and $a'$ are such that only $\varphi \sststile{}{V} \ft(\ty(a)) = \ft(\ty(a'))$ is true, then a \emph{relative (heterogeneous) homotopy} between $a$ and $a'$ with respect to $\varphi$
is a relative homotopy $f,g,p,g',p'$ between $\ty(a)$ and $\ty(a')$ together with a relative homotopy between $f[a]$ and $a'$.
We can study lifting properties of maps $\eta_X : X \to f^*(f_!(X))$ in syntactical terms.
Let $V$ be a set of variables and let $\varphi$ be a formula with free variables in $V$.
Then we can consider the syntactic model $M$ corresponding to the pair $(V,\varphi)$.
It is the model generated by constants corresponding to variables in $V$ together a relation corresponding to $\varphi$ (for a precise definition, see the proof of \rprop{str-morita-char}).
Then the lifting properties of $\eta_M$ are closely related to certain lifting properties in the category of theories.
More precisely, we will show that $\eta_M$ has a lifting property for all $M$ if and only if a certain lifting property holds in the category of theories.
Let us describe this lifting property.
Let $V$ be a set of variables and let $\varphi$ be a formula with free variables in $V$.
We will say that a morphism $f : T_1 \to T_2$ of theories with identity types has \emph{the weak lifting property} with respect to $V,\varphi$ if
for every term $A \in \Term_{T_1}(V)_{(d_p,n)}$ and every term $a \in \Term_{T_2}(V)_{(p,n)}$ such that $\varphi \sststile{}{V} A\!\downarrow$ and $f(\varphi) \sststile{}{V} e_p(a) = f(A)$,
there exists a term $a' \in \Term_{T_1}(V)_{(p,n)}$ such that $f(a')$ is relatively homotopic to $a$ with respect to $\varphi$.
We will say that $f$ has \emph{the lifting property} with respect to $V,\varphi$ if $f(a')$ is not only homotopic to $a$, but actually is equal to it.
If $P$ is a set of pairs of the form $V,\varphi$, then we will say that a map has the (weak) lifting property with respect to $P$ if it has this property with respect to every element of $P$.
We define $P_0$ as the singleton set $\{ \varnothing,\top \}$, $P_S$ as the set of all pairs, and $P_M$ as the set of pairs $V,\varphi$ such that $V = \{ x_1, \ldots x_k \}$
and $\varphi = \varphi_1 \land \ldots \land \varphi_k$, where $\varphi_i$ equals to $e_p(x_i) = t_i$,
where $t_i$ is a term of $T_1$ with free variables in $\{ x_1, \ldots x_{i-1} \}$ such that for every $1 \leq i \leq k$,
sequent $\varphi_1 \land \ldots \land \varphi_{i-1} \sststile{}{x_1, \ldots x_{i-1}} t_i\!\downarrow$ is derivable in $T_1$.
\begin{prop}[str-morita-char]
A morphism $f : T_1 \to T_2$ between theories with identity types is a strict Morita equivalence if and only if it has the weak lifting property with respect to $P_S$.
\end{prop}
\begin{proof}
First, we need to introduce an auxiliary construction.
Let $T$ be a theory, let $V$ be a set of variables, and let $\mathcal{A}$ be a set formulas of $T$ with variables in $V$.
Then we define $\Syn(T,V,\mathcal{A})$ as $\Syn(T \cup \{ O_x : s\ |\ x \in V_s \} \cup \mathrm{sp}(\mathcal{A}))$ (functors $\Syn$ and $\Lang$ are defined in \cite{alg-models}),
where $\mathrm{sp}(\mathcal{A})$ consists of formulas of the form $\sststile{}{} O_x\!\downarrow$ for every $x \in V$
and formulas of $\mathcal{A}$ in which every variable $x$ is replaced with $O_x$.
If $f : T_1 \to T_2$ is a morphism of theories, then it is easy to see that $f_!(\Syn(T_1,V,\mathcal{A})) = \Syn(T_2,V,f(\mathcal{A}))$.
Let us prove the ``only if'' direction.
Note that elements of $\Syn(T_1, V, \{\,\sststile{}{}~\varphi\,\})$ correspond to terms $t$ of $T_1$ with variables in $V$ such that $\varphi \sststile{T_1}{V} t\!\downarrow$.
Moreover, two terms $t_1$ and $t_2$ map to the same element under this correspondence if and only if $\varphi \sststile{T_1}{V} t_1 = t_2$.
An analogous statement holds for $\Syn(T_2, V, \{\,\sststile{}{}~f(\varphi)\,\})$.
Using this correspondence, the required conditions immediately follow from the fact that
map $\Syn(T_1, V, \{\,\sststile{}{}~\varphi\,\}) \to f^*(\Syn(T_2, V, \{\,\sststile{}{}~f(\varphi)\,\}))$ is a weak equivalence.
Now, let us prove the ``if'' direction.
Let $M$ be a model of $T_1$.
Note that $M$ is isomorphic to $\Syn(T_1, U(M), \mathcal{A})$, where $U(M)$ is the underlying set of $M$ and $\mathcal{A}$ is the set of formulas of the form
$x = \sigma(x_1, \ldots x_k)$ and $R(x_1, \ldots x_k)$ for all $x, x_1, \ldots x_k \in M$ such that these formulas hold in $M$.
Note that $sp(\mathcal{A})$ is the set of axioms of $\Lang(M)$.
Let $A \in M_{(d_p,n)}$ and $a \in f^*(f_!(M))$ be elements such that $e_p(a) = A$.
Since $f_!(M) = \Syn(T_2, U(M), f(\mathcal{A}))$, $a$ is a closed term of $T_2$.
There is a finite subset $\mathcal{A}_0$ of $\mathcal{A}$ such that $\sststile{T_2 \cup \mathrm{sp}(\mathcal{A}_0)}{} e_p(a) = A$.
Let $\varphi$ be the conjunction of $\mathcal{A}_0$, and let $b$ and $B$ be $a$ and $A$, respectively, in which every constant $O_x$ is replaced with variable $x$.
Then $\varphi \sststile{T_2}{U(M)} e_p(b) = B$.
By assumption, there exist a term $b' \in \Term_{T_1}(U(M))_{(p,n)}$ and a relative homotopy $h$ between $f(b)$ and $b'$.
These terms correspond under $\mathrm{sp}$ to elements of $M$ and $f^*(f_!(M))$, respectively.
These conditions imply that $b'$ is the required lifting and $h$ is the required homotopy.
\end{proof}
Analogous characterizations hold for Morita and syntactic equivalences:
\begin{prop}[morita-char]
A morphism $f : T_1 \to T_2$ between theories with identity types is a Morita equivalence if and only if it has the weak lifting property with respect to $P_M$.
\end{prop}
\begin{proof}
Suppose that $f$ is a Morita equivalence.
To prove that $f$ has the weak lifting property, we just need to show that model $M = \Syn(T_1, \{ x_1, \ldots x_k \}, \{\,\sststile{}{}~\varphi\,\})$
constructed in the previous proposition is cofibrant.
Note that for every $1 \leq i \leq k$, we have the following pushout square:
\[ \xymatrix{ F(\{ A : (d_p,n) \}) \ar[d] \ar[r] & \Syn(T_1, \{ x_1, \ldots x_{i-1} \}, \{\,\sststile{}{} \varphi_1 \land \ldots \land \varphi_{i-1} \,\}) \ar[d] \\
F(\{ e_p(a) = A \}) \ar[r] & \po \Syn(T_1, \{ x_1, \ldots x_i \}, \{\,\sststile{}{} \varphi_1 \land \ldots \land \varphi_i \,\}),
} \]
where the top arrow maps $A$ to $t_i$ and the bottom arrow maps $a$ to $x_i$.
This shows that $M$ is a relative $\I$-cell complex.
Now, let us prove the converse.
We just need to show that if $M$ is a cofibrant model of $T_1$, then we can choose formula $\varphi$
in the second part of the proof of the previous proposition so that it satisfies the conditions of this proposition.
Since every cofibrant object is a retract of a relative $\I$-cell complex and Morita equivalences are closed under retracts, we may assume that $M$ is a relative $\I$-cell complex.
Moreover, we may assume that there are subsets $\{S_i\}_{i \in \mathbb{N}}$ of elements of $M$ such that we have the following pushout diagrams:
\[ \xymatrix{ \coprod_{x \in S_i} F(\{ A_x : (d_p,n) \}) \ar[d] \ar[r] & M_i \ar[d] \\
\coprod_{x \in S_i} F(\{ e_p(a_x) = A_x \}) \ar[r] & \po M_{i+1},
} \]
$M_0$ is the initial model, $M$ is the colimit of $M_i$, and map $F(\{ e_p(a_x) = A_x \}) \to M_{i+1} \to M$ sends $a_x$ to $x$.
Note that $M_i$ is isomorphic to $\Syn(T_1, \bigcup_{1 \leq j \leq i} S_j, \mathcal{A}_i)$,
where $\mathcal{A}_i$ consists of formulas of the form $e_p(x) = t$, where $x \in S_i$ and $t \in \Term_{T_1}(\bigcup_{1 \leq j < i} S_j)$ corresponds to the image of $A_x$ in $M_{i-1}$.
Thus, $M$ is isomorphic to $\Syn(T_1, \bigcup_{i \in \mathbb{N}} S_i, \bigcup_{i \in \mathbb{N}} \mathcal{A}_i)$.
Now, if we choose a finite subset of $\bigcup_{i \in \mathbb{N}} \mathcal{A}_i$ as before, then the conjunction of this subset satisfies the required conditions.
\end{proof}
\begin{prop}[syn-equiv-char]
A morphism $f : T_1 \to T_2$ between theories with identity types is a syntactic equivalence if and only if it has the weak lifting property with respect to $P_0$.
\end{prop}
\begin{proof}
This is obvious since elements of the initial model of $T_1$ are closed terms $t$ of $T_1$ such that $\sststile{}{} t\!\downarrow$ is derivable.
\end{proof}
We will show that there is a model structure on the category of theories with the interval type, path types and the weak univalence axiom as described in \cite{alg-models}.
Note that if we assume only usual identity types with the J rule since, then no such model structure (or left semi-model structure, or structure of a cofibration category) can exist since trivial cofibrations are not closed under pushouts.
Indeed, let $\IdT$ be any version of the theory of identity types, let $T_1 = \IdT \amalg \{ A : (\ty,0), A\!\downarrow \}$, and let $T_2$ be $\IdT$ together with two constants $A,A' : (\ty,0)$ such that $\sststile{T_2}{} A\!\downarrow \land A'\!\downarrow$ and an equivalence between $A$ and $A'$.
\Rprop{str-morita-char} implies that the obvious morphism $T_1 \to T_2$ is a strict Morita equivalence.
Now, consider the theory $T_3 = \{ \sigma : (\ty,0) \to (\ty,0), \sigma(x)\!\downarrow \}$.
Then the map $T_1 \amalg T_3 \to T_2 \amalg T_3$ is not even a syntactic equivalence since types $\sigma(A)$ and $\sigma(A')$ are equal in $T_2 \amalg T_3$, but there is no term between them in $T_1 \amalg T_3$.
It was shown in \cite{alg-models} that the category of models of a theory under $\coeT_1 + \sigma + \PathT + \wUA$ carries a model structure.
If the theory has only identity types, then there is only a left semi-model structure as shown in \cite{kap-lum-model}.
We can generalize this theorem using the following lemma:
\begin{lem}
Let $T_1$ be a theory such that the weak equivalences in $\Mod{T_1}$ satisfy the 2-out-of-6 property.
If $T_2$ is a semi-model theory and $F : T_1 \to T_2$ is a Morita equivalence, then $T_1$ is also semi-model and $F_! \dashv F^*$ is a Quillen equivalence between $\Mod{T_1}$ and $\Mod{T_2}$.
\end{lem}
\begin{proof}
By \rprop{model-theories}, we just need to prove that pushouts of maps in $\J$ with cofibrant codomains are weak equivalences in $\Mod{T_1}$.
Let $f : X \to Y$ be a pushout of a map in $\J$ such that $X$ is cofibrant.
Since $F_!$ preserves pushouts and maps in $\J$, the map $F_!(f)$ is a weak equivalence.
The functor $F^*$ always preserves weak equivalences.
Thus, $F^*(F_!(f))$ is a weak equivalence.
Since $X$ and $Y$ are cofibrant, the maps $\eta_X : X \to F^*(F_!(X))$ and $\eta_Y : Y \to F^*(F_!(Y))$ are weak equivalences.
Hence, $f$ is also a weak equivalence.
\end{proof}
Note that \cite[Proposition~3.3]{kap-lum-model} implies that, for all theories with identity types, $\Sigma$-types, and the unit type, the weak equivalences satisfy the 2-out-of-6 property.
Thus, the first condition of the previous lemma is often true.
We believe that this might be true more generally for all theories with only identity types, but the proofs become much harder without $\Sigma$-types.
Finally, let us prove an analogous lemma for strict Morita equivalences:
\begin{lem}
Let $T_1$ be a theory under $\IdT_0 + \transportT$.
If $T_2$ is a model theory and $F : T_1 \to T_2$ is a strict Morita equivalence, then $T_1$ is also model and $F_! \dashv F^*$ is a Quillen equivalence between $\Mod{T_1}$ and $\Mod{T_2}$.
\end{lem}
\begin{proof}
Since we have the transport operation, the homotopy relation is transitive.
This implies that weak equivalences are closed under composition.
It is also easy to see that if $f : X \to Y$ and $g : Y \to Z$ are maps such that $g$ and $g \circ f$ are weak equivalences, then $f$ is also a weak equivalence.
Now, the same proof as in the previous lemma shows that $F_!$ reflects weak equivalences.
By Theorem~4.2, Proposition~4.3, and Proposition~4.4 from \cite{f-model-structures}, the model structure on $\Mod{T_1}$ exists if there is a path object functor $P : \Mod{T_1} \to \Mod{T_1}$
such that $p : P(X) \to X \times X$ belongs to $\Jinj$ and $\pi_1 \circ p$ belongs to $\Iinj$.
We can define $P(X)$ as usual factorization of the diagonal $X \to X \times X$ into a map $t : X \to P(X)$ in $\Jcell$ followed by a map $p : P(X) \to X \times X$ in $\Jinj$.
Since $F_!$ preserves maps in $\Jcell$, the map $F_!(t)$ is a weak equivalence.
By the 2-out-of-3 property, the map $F_!(\pi_1 \circ p)$ is also a weak equivalence.
Since $F_!$ reflects weak equivalences, this implies that $\pi_1 \circ p$ is a weak equivalence.
Now, since $\pi_1 \circ p$ belongs to $\Jinj$, \cite[Proposition~3.1]{f-model-structures} implies that it also belongs to $\Iinj$.
\end{proof}
\section{Model structure on theories}
\label{sec:model-structure}
In this section we define a model structure on the category of algebraic dependent type theories with enough structure.
Weak equivalences in this model structure are precisely Morita equivalences.
This model structure can be used to prove that some map is a Morita equivalence.
For example, we can use the 2-out-of-3 property.
We can also use the fact that every weak equivalence factors into a trivial cofibration and a trivial fibration and it is easier to check that a map is a trivial cofibration or a trivial fibration.
Several characterizations of trivial fibrations will be given in section~\ref{sec:triv-fib}.
To prove that a map is a trivial cofibration, we can construct a homotopy inverse for it.
Since all theories are fibrant in this model structures, such an inverse always exists.
\subsection{Categories of theories}
It was shown in \cite{PHL} that partial Horn theories are equivalent to essentially algebraic theories.
It follows that categories of models of these theories are locally presentable.
In this subsection we will prove that different categories of theories are also locally finitely presentable.
We will consider a prestable theory $T$ under some prestable theory $B$.
Recall that a prestable theory is a theory $T$ with a map $\alpha : L(T) \to T$, where $L$ is a functor defined in \cite{alg-tt}.
It was shown in \cite[Lemma~4.4]{alg-tt} that every such theory is isomorphic to a contextual theory,
that is a theory which has $\mathcal{F}_B \amalg (\mathcal{F}_0 \times \mathbb{N})$,
$\mathcal{P}_B \amalg (\mathcal{P}_0 \times \mathbb{N})$ and $\mathcal{A}_B \amalg \mathcal{A}_0$ as the sets of function and predicate symbols and the set of axioms, respectively,
where $\mathcal{F}_0$, $\mathcal{P}_0$, and $\mathcal{A}_0$ are some sets and $\mathcal{F}_B$, $\mathcal{P}_B$, and $\mathcal{A}_B$ are the corresponding sets of $B$.
Elements of $\mathcal{F}_0$, $\mathcal{P}_0$ and $\mathcal{A}_0$ are called basic function symbols, basic predicate symbols, and basic axioms.
Now, we give an explicit construction of coproducts and coequalizers in the category $B/\PSt_{\mathcal{S}_0}$ of prestable theories under $B$,
which is similar to the one described in \cite[Proposition~2.12]{alg-tt} for the category of theories.
If $\{ T_i \}_{i \in I}$ is a set of theories under $B$, then the basic function and predicate symbols
and axioms of $\coprod_{i \in I} T_i$ are the disjoint union of corresponding sets of $T_i$.
If $f,g : T \to T'$ is a pair of maps of theories under $B$, then their coequalizer can be defined as
$T'$ together with the following axioms for every basic function symbol $\sigma$ and every basic predicate symbol $R$ of $T$:
\begin{align*}
& \sststile{}{x_1, \ldots x_k} f(\sigma(x_1, \ldots x_k)) \cong g(\sigma(x_1, \ldots x_k)) \\
& f(R(x_1, \ldots x_k)) \ssststile{}{x_1, \ldots x_k} g(R(x_1, \ldots x_k))
\end{align*}
The colimit of a diagram $T : I \to B/\PSt_{\mathcal{S}_0}$ can be described as the coequalizer of the coproduct $\coprod_{i \in I} T_i$ as usual.
Thus we can assume that the sets of basic function and predicate symbols of $\colim_{i \in I} T_i$ are disjoint unions of the corresponding sets of $T_i$.
The axioms of $\colim_{i \in I} T_i$ are axioms of $T_i$ together with axioms of the form $\sststile{}{x_1, \ldots x_n} \sigma(x_1, \ldots x_n) \cong f(\sigma(x_1, \ldots x_n))$
and $R(x_1, \ldots x_n) \ssststile{}{x_1, \ldots x_n} f(R(x_1, \ldots x_n))$ for every morphism $f : T_i \to T_j$
in the diagram and every function symbol $\sigma$ and predicate symbol $R$ of $T_i$ which are not symbols of $B$.
Let $\lambda$ be a regular cardinal.
We will say that a theory $T = ((\mathcal{S}, \mathcal{F}_0 \amalg \mathcal{F}, \mathcal{P}_0 \amalg \mathcal{P}), \mathcal{A}_0 \amalg \mathcal{A})$
in $\Th_B$ is \emph{$\lambda$-small} if cardinalities of sets $\mathcal{F}$, $\mathcal{P}$ and $\mathcal{A}$ are less than $\lambda$.
We will say that $T$ is \emph{finite} if it is $\aleph_0$-small.
\begin{prop}[theories-presentable]
The category of prestable theories under a prestable theory $B$ is locally finitely presentable.
An object of this category is $\lambda$-presentable if and only if it is isomorphic to a $\lambda$-small object.
\end{prop}
\begin{proof}
First, let us prove that every $\lambda$-small object is $\lambda$-presentable.
Let $\colim_{i \in I} T_i$ be a directed colimit of theories in $B/\PSt_{\mathcal{S}_0}$.
Every term and every formula of a theory is constructed from a finite number of function and predicate symbols.
Thus for every formula of $\colim_{i \in I} T_i$ there exists a theory $T_i$ such that this formula belongs to $T_i$.
The same is true for terms and restricted terms.
Every derivation of a theorem $\varphi \sststile{}{V} \psi$ is constructed from a finite number of function symbols, predicate symbols and axioms.
Thus for every theorem $\varphi \sststile{}{V} \psi$ of $\colim_{i \in I} T_i$ there exists a theory $T_i$ such that $\varphi \sststile{}{V} \psi$ is a theorem of $T_i$.
Note that the additional axioms of $\colim_{i \in I} T_i$ that was added for every $f : T_i \to T_j$ are always true in $T_j$.
Let $h : T \to \colim_{i \in I} T_i$ be a morphism from a $\lambda$-small theory $T$ to a $\lambda$-directed colimit of theories $\{ T_i \}_{i \in I}$.
Since $T$ is $\lambda$-small, there exists a theory $T_i$ such that for every function symbol $\sigma$, predicate symbol $R$ and axiom $\varphi \sststile{}{V} \psi$ of $T$,
restricted terms $h(\sigma(x_1, \ldots x_n))$ and formulae $h(R(x_1, \ldots x_n))$ belong to $T_i$, and $h(\varphi) \sststile{}{V} h(\psi)$ is a theorem of $T$.
Thus $h$ factors through $T_i$.
Let $h_1,h_2 : T \to T_i$ be morphisms such that $g_i \circ h_1 = g_i \circ h_2$, where $g_i : T_i \to \colim_{i \in I} T_i$.
Then for every function symbol $\sigma$ of $T$, sequent
\[ \sststile{}{x_1, \ldots x_n} h_1(\sigma(x_1, \ldots x_n)) \cong h_2(\sigma(x_1, \ldots x_n)) \]
is a theorem of $\colim_{i \in I} T_i$.
But we already know that there exists a theory $T_j$ such that $i \leq j$ and this sequent is a theorem of $T_j$.
The same is true for every predicate symbol of $T$.
It follows that $f \circ h_1 = f \circ h_2$, where $f : T_i \to T_j$.
Now, let us prove that $B/\PSt_{\mathcal{S}_0}$ is locally finitely presentable.
We only need to show that every theory in $B/\PSt_{\mathcal{S}_0}$ is a $\lambda$-directed colimit of its $\lambda$-small subtheories.
Let $T$ be a theory, and let $\{ f_i : T_i \to T' \}_{i \in I}$ be a cocone over the diagram of $\lambda$-small subtheories of $T$.
For every basic function or predicate symbol $p$ of $T$,
there is a finite subtheory $T_p$ of $T$ which contains symbols and axioms of $B$ and one additional symbol $p$ and no other axiom.
A morphism $h$ of cocones $T$ and $T'$ must commute with morphisms from $T_p$.
Thus it must be defined as $h(p(x_1, \ldots x_n)) = f_p(p(x_1, \ldots x_n))$; hence it is unique.
To prove that this defines a morphism, we need to show that $h$ preserves axioms of $T$.
But every axiom involves only a finite number of symbols of $T$.
Hence there exists a subtheory $T_i$ of $T$ which consists of these symbols and this axiom.
Since $f_i$ is a morphism of theories, this axiom also holds in $T'$.
Finally, let us prove that every $\lambda$-presentable theory $T$ in $B/\PSt_{\mathcal{S}_0}$ is isomorphic to a $\lambda$-small theory.
Consider the identity map $id_T : T \to T$.
Since $T$ is a $\lambda$-directed colimit of its $\lambda$-small subtheories, $id_T$ factors through some $\lambda$-small subtheory $T'$ of $T$.
Thus we have maps $f : T \to T'$ and $g : T' \to T$ such that $g \circ f = id_T$.
Since $T$ is a coequalizer of $f \circ g$ and $id_{T'}$, it is isomorphic to the coequalizer of $f \circ g$ and $id_{T'}$ as constructed above, which is a $\lambda$-small theory.
\end{proof}
\begin{cor}
The categories of stable and $c$-stable theories and categories of (stable, $c$-stable) algebraic dependent type theories are all locally finitely presentable.
\end{cor}
\begin{proof}
Each of this categories is a full reflective subcategory of the category of prestable theories closed under all colimits.
It follows from the previous proposition that they are locally finitely presentable.
\end{proof}
\subsection{Model structure}
Let $T_I = \coeT^{l'}_2 + \PathT + \wUA$ be the theory defined in \cite{alg-models}.
In this subsection we define a model structure on the category $T_I/\algtt$ of algebraic dependent type theories under $T_I$.
To construct this model structure, we need to recall a few definitions from \cite{f-model-structures}.
A reflexive cylinder object $C_U(V)$ for a map $i : U \to V$ is any factorization of $[id_V,id_V] : V \amalg_U V \to V$.
Maps $f,g : V \to X$ are homotopic relative to a cylinder object $[\cyli_0,\cyli_1] : V \amalg_U V \to C_U(V)$, if there exists a map $h : C_U(V) \to X$
such that $h \circ \cyli_0 = f$ and $h \circ \cyli_1 = g$.
In this case we will write $f \sim_i g$.
We say that a map $f : X \to Y$ has RLP up to $\sim_i$ with respect to $i : U \to V$ if for every commutative square of the form
\[ \xymatrix{ U \ar[r]^u \ar@{}[dr]|(.7){\sim_i} \ar[d]_i & X \ar[d]^f \\
V \ar[r]_v \ar@{-->}[ur]^g & Y,
} \]
there is a dotted arrow $g : V \to X$ such that $g \circ i = u$ and $(f \circ g) \sim_i v$.
We will say that a map has RLP up to relative homotopy with respect to a set $\I$ of maps if it has RLP up to $\sim_i$ with respect to every $i \in \I$.
We will also need the following theorem from \cite{f-model-structures}:
\begin{thm}[model-structure]
Let $\C$ be a complete and cocomplete category, and let $\I$ be a set of maps of $\C$
such that the domains and the codomains of maps in $\I$ are small relative to $\Icell$.
For every $i : U \to V \in \I$, choose a reflexive relative cylinder object $C_U(V)$
such that $[\cyli_0,\cyli_1] : V \amalg_U V \to C_U(V) \in \Icof$.
Let $\J_\I = \{\ \cyli_0 : V \to C_U(V)\ |\ i : U \to V \in \I \ \}$, and
let $\we_\I$ be the set of maps which have RLP up to relative homotopy with respect to $\I$.
Suppose that for all composable $f \in \Jcell[_\I] \cup \we_\I$ and $g$, if $g \circ f \in \we_\I$, then $g \in \we_\I$.
Then there exists a cofibrantly generated model structure on $\C$ with $\I$ as a set of generating cofibrations,
$\J_\I$ as a set of generating trivial cofibrations, and $\we_\I$ as a class of weak equivalences.
\end{thm}
For every sequence $(p_1,n_1), \ldots (p_{k+1},n_{k+1})$ of sorts, let $T_{(p_1,n_1), \ldots (p_{k+1},n_{k+1})}$ be the theory
with function symbols $\sigma_i : (p_1,n_1) \times \ldots \times (p_{i-1},n_{i-1}) \to (d_{p_i},n_i)$ for every $1 \leq i \leq k$,
$\sigma_{k+1} : (p_1,n_1) \times \ldots \times (p_k,n_k) \to (p_{k+1},n_{k+1})$,
and axioms $\varphi_1 \land \ldots \land \varphi_i \sststile{}{x_1, \ldots x_i} \sigma_{i+1}(x_1, \ldots x_i)\!\downarrow$ for every $1 \leq i \leq k$,
where $\varphi_j$ equals to $e_{p_j}(x_j) = \sigma_j(x_1, \ldots x_{j-1})$.
Let $\I$ be the set of maps of the form $T_{l, (d_p,n)} \to T_{l, (p,n)}$, where $l = s_1, \ldots s_k$ is any sequence of sorts,
$\sigma_i$ maps to $\sigma_i$ for every $1 \leq i \leq k$, and $\sigma_{k+1}$ maps to $e_p(\sigma_{k+1})$.
Let $\I_0 \subseteq \I$ be the subset which consists of the maps $T_{l, (d_p,n)} \to T_{l, (p,n)}$ such that $l$ is empty.
For every map in $\I$, we need to define a relative cylinder object for it.
Let $C_{T_{l,(\ty,n)}}(T_{l,(\tm,n)})$ be the theory with the same symbols and axioms as $T_l$,
three additional function symbol $\sigma, \sigma', h : s_1 \times \ldots \times s_k \to (\tm,n)$,
and axioms making $h$ into a relative homotopy between $\sigma$ and $\sigma'$ with respect to $\varphi_1 \land \ldots \land \varphi_k$.
Analogously, we define $C_{T_{l,(\ctx,n)}}(T_{l,(\ty,n)})$ to be the theory with the same symbols and axioms as $T_l$,
seven additional function symbols $\sigma,\sigma' : s_1 \times \ldots \times s_k \to (\ty,n)$, $f,g,g',p,q : s_1 \times \ldots \times s_k \to (\tm,n+1)$,
and axioms making $(f,g,g',p,q)$ into a relative homotopy between $\sigma$ and $\sigma'$ with respect to $\varphi_1 \land \ldots \land \varphi_k$.
Maps $\cyli_0,\cyli_1 : T_{l,(\tm,n)} \to C_{T_{l,(\ty,n)}}(T_{l,(\tm,n)})$ and their retraction
$s : C_{T_{l,(\ty,n)}}(T_{l,(\tm,n)}) \to T_{l,(\tm,n)}$ are defined in the obvious way.
\begin{remark}[triv-fib-lift]
By \rprop{morita-char}, a map has RLP up to relative homotopy with respect to $\I$ if and only if it is a Morita equivalence.
Similarly, \rprop{syn-equiv-char} implies that a map has RLP up to relative homotopy with respect to $\I_0$ if and only if it is a syntactic equivalence.
\end{remark}
\begin{lem}[jcell-morita]
Let $f : X \to Y$ be a pushout of $\cyli_0 : T_{l,(\tm,n)} \to C_{T_{l,(\ty,n)}}(T_{l,(\tm,n)})$ (in the category of $I$-stable theories under $T_I$)
and let $g : Y \to X$ be the retraction of $f$ which is the pushout of $s$.
Let $\varphi$ be a formula of $X$ such that for every predicate symbol $R$ occurring in $\varphi$,
sequent $R(x_1, \ldots x_k) \sststile{}{x_1, \ldots x_k} \alpha(L(R))(I, I \times x_1, \ldots I \times x_k)$ is derivable in $X$.
Then for every term $t$ of $Y$ such that $f(\varphi) \sststile{}{V} t\!\downarrow$, terms $t$ and $f(g(t))$ are relatively homotopic with respect to $f(\varphi)$.
\end{lem}
\begin{proof}
This lemma is analogous to \cite[Lemma~3.7]{alg-models}.
We defined there a function $h : \Term_Y(V)_{(p,n)} \to \Term_Y(L(V))_{(p,n+1)}$ such that $h$ preserves theorems in the sense that
if $\chi \sststile{}{V} \psi$ is a theorem of $Y$, then $h(\chi) \land \bigwedge_{x \in L(V)} \ctx^n(x) = I \sststile{}{L(V)} h(\psi)$ is also a theorem.
Note that $h(f(\varphi)) = \alpha(L(f(\varphi)))$ since $f(\varphi)$ contains only symbols of $X$.
The condition we put on $\varphi$ implies that sequent $f(\varphi) \sststile{}{V} h(f(\varphi))[\rho]$ is derivable, where $\rho(x) = I \times x$.
Thus we have the following theorem: $f(\varphi) \sststile{}{V} h(t)[\rho]\!\downarrow$.
Moreover, we have theorems $h(t)[\rho]\!\downarrow\ \sststile{}{V} h(t)[\rho][left] = f(g(t))$ and $h(t)[\rho]\!\downarrow\ \sststile{}{V} h(t)[\rho][right] = t$
(here, $[\rho]$ is an operation of substitution on terms and $[left]$ and $[right]$ are derived function symbols in the theory; we are sorry for this clash of the notation).
Thus $h(t)[\rho]$ gives us the required homotopy between $t$ and $f(g(t))$.
\end{proof}
\begin{thm}[theories-model-structure]
There exists a model structure on the category of $I$-stable algebraic dependent type theories under $T_I$
with $\I$ as the set of generating cofibrations, Morita equivalences as weak equivalences, and in which all objects are fibrant.
We call it \emph{the Morita model structure}.
\end{thm}
\begin{proof}
Note that the set $\we_\I$ consists of Morita equivalences.
Since Quillen equivalences satisfy the 2-out-of-3 property, by \rprop{morita-quillen}, Morita equivalences between theories under $T_I$ also satisfy it.
Since the codomains of maps in $\I$ are finite, Morita equivalences are closed under transfinite compositions.
Thus by \rthm{model-structure}, we just need to prove that pushouts of maps $\cyli_0 : T_{l,(p,n)} \to C_{T_{l,(d_p,n)}}(T_{l,(p,n)})$ are Morita equivalences.
Let $f : X \to Y$ be a pushout of $\cyli_0$ and let $g : Y \to X$ be its retract.
Let $\varphi$ be a formula of $X$ which does not contain any predicate symbols and let $A$ be a term of $X$ such that $\varphi \sststile{}{V} A\!\downarrow$.
Let $a$ be a term of $Y$ such that $f(\varphi) \sststile{}{V} e_p(a) = f(A)$.
If we define $a'$ as $g(a)$, then $\varphi \sststile{}{V} e_p(a') = A$ and the fact that $f(a')$ and $a$ are relatively homotopic follows from \rlem{jcell-morita}.
\end{proof}
\Rlem{jcell-morita} implies that trivial cofibrations satisfying a mild additional condition are strict Morita equivalences:
\begin{prop}
Let $f : T_1 \to T_2$ be a trivial cofibration such that for every predicate symbol $R$ of $T_1$,
sequent $R(x_1, \ldots x_k) \sststile{}{x_1, \ldots x_k} \alpha(L(R))(I, I \times x_1, \ldots I \times x_k)$ is derivable.
Then $f$ is a strict Morita equivalence.
\end{prop}
\begin{proof}
Since trivial cofibrations are retracts of maps in $\Jcell[_\I]$ and strict Morita equivalences are closed under retracts,
we just need to prove that maps in $\Jcell[_\I]$ are strict Morita equivalences.
Since strict Morita equivalences are closed under transfinite compositions, we just need to prove this for maps $f$ which are pushouts of maps in $\Jcell[_\I]$.
Moreover, since maps in $\Jcell[_\I]$ do not change the set of predicate symbols,
we may assume that the domain and the codomain of $f$ satisfy the same condition on the predicate symbols as $T_1$.
Now, \rlem{jcell-morita} implies that such maps are strict Morita equivalences.
\end{proof}
Note that the domains and the codomains of maps in $\I$ do not have any predicate symbols.
Thus cofibrant objects also do not have them (to be precise, they are isomorphic to theories without predicate symbols).
So it seems rather pointless to have predicate symbols at this point.
We can consider the full subcategory $\algtt_f$ of $\algtt$ on theories without predicate symbols
(and without function symbols of the form $\sigma : s_1 \times \ldots \times s_k \to (\ctx,0)$).
\Rprop{theories-presentable} still holds for $\algtt_f$, so this category is locally finitely presentable.
There is a model structure on $T_I/\algtt_f$ in which the classes of cofibrations, fibrations, and weak equivalences
are the intersections of the corresponding classes in $T_I/\algtt$ with the class of morphisms of $\algtt_f$.
This model category has the same sets of generating cofibrations and generating trivial cofibrations as $\algtt$.
\begin{prop}
The inclusion functor $T_I/\algtt_f \to T_I/\algtt$ has a right adjoint and this adjunction is a Quillen equivalence.
\end{prop}
\begin{proof}
We will say that a theory $T$ \emph{has enough function symbols} if for every restricted term $t$ of sort $s$ with free variables $x_1 : s_1$, \ldots $x_k : s_k$,
there is a function symbol $\sigma : s_1 \times \ldots \times s_k \to s$ such that sequent $\sststile{}{x_1, \ldots x_k} t \cong \sigma(x_1, \ldots x_k)$ is derivable.
Note that every theory $T$ is isomorphic to a theory $T'$ with enough function symbols.
Indeed, function symbols of $T'$ are just terms of the original theory and
axioms of $T'$ are axioms of $T$ together with axioms that say that the new terms are equivalent to the old ones.
Thus we may restrict and corestrict the inclusion functor $i : \algtt_f \to \algtt$ to the full subcategories of $\algtt_f$ and $\algtt$ on theories with enough function symbols.
We will denote this functor by $i' : \algtt'_f \to \algtt'$.
Now, it is easy to describe a right adjoint to $i'$.
For every theory $T \in \algtt'$, let $r'(T)$ be the theory with the same function symbols as $T$, no predicate symbols,
and with the set of axioms which consists of all theorems of $T$ which do not involve predicate symbols.
Then $r'$ is a functor $\algtt' \to \algtt'_f$.
It is easy to see that $r'$ is right adjoint to $i'$.
Since $i'(r'(T))$ and $T$ have the same sets of terms and theorems (which do not involve predicate symbols), the counit $\epsilon_T : i'(r'(T)) \to T$ is a trivial fibration.
Finally, note that the inclusion functor $T_I/i : T_I/\algtt_f \to T_I/\algtt$ preserves and reflects cofibrations and weak equivalences.
Moreover, it has a right adjoint and the counit of the adjunction is a trivial fibrations.
Thus this adjunction is a Quillen equivalence.
\end{proof}
Now, let us return to the original problem of the absence of predicate symbols in cofibrant objects.