-
Notifications
You must be signed in to change notification settings - Fork 1
/
frac.lagda
2987 lines (2544 loc) · 121 KB
/
frac.lagda
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{article}
\usepackage{agda}
\usepackage[utf8x]{inputenc}
\usepackage{amsthm}
\usepackage{fullpage}
\usepackage{bbold}
\usepackage{url}
\usepackage{xcolor}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{proof}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{stmaryrd}
\usepackage{mathrsfs}
\usepackage{mathabx}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{quotes}
\newcommand{\amr}[1]{\fbox{\begin{minipage}{0.9\textwidth}\color{purple}{Amr says: #1}\end{minipage}}}
\newcommand{\alt}{~|~}
\newcommand{\ag}[2]{#1 \sslash #2}
\newcommand{\order}[1]{\hash #1}
\newcommand{\inl}[1]{\textsf{inl}(#1)}
\newcommand{\inr}[1]{\textsf{inr}(#1)}
\newcommand{\zt}{\mathbb{0}}
\newcommand{\ot}{\mathbb{1}}
\newcommand{\G}{\mathcal{G}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Zn}{\mathbb{Z}_n}
\newcommand{\Zvn}{\mathbb{Z}^v_n}
\newcommand{\cycle}{\textsf{cycle}}
\newcommand{\twod}{\mathbb{T}}
\newcommand{\fract}[2]{#1/#2}
%% \newcommand{\mystrut}{\rule[-0.01\baselineskip]{0pt}{2.2\baselineskip}}
\newcommand{\fv}[2]{\fcolorbox{black}{white}{\strut $#1$}\fcolorbox{black}{gray!20}{$\strut #2$}}
\newcommand{\pt}[2]{\bullet[#1,#2]}
\newcommand{\refl}{\AgdaInductiveConstructor{refl}}
\theoremstyle{remark}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\renewcommand{\AgdaCodeStyle}{\small}
%% shorten the longarrow
\DeclareUnicodeCharacter{10231}{\ensuremath{\leftrightarrow}}
\DeclareUnicodeCharacter{9678}{$\circledcirc$}
\DeclareUnicodeCharacter{964}{$\tau$}
\DeclareUnicodeCharacter{945}{$\alpha$}
\DeclareUnicodeCharacter{7522}{${}_i$}
\DeclareUnicodeCharacter{8759}{$::$}
\DeclareUnicodeCharacter{737}{${}^{l}$}
\DeclareUnicodeCharacter{931}{$\Sigma$}
\DeclareUnicodeCharacter{8718}{$\qed$}
\DeclareUnicodeCharacter{7503}{${}^k$}
\AgdaHide{
\begin{code}
{-# OPTIONS --without-K #-}
module frac where
open import Level using (_⊔_) renaming (zero to lzero)
open import Data.Empty
open import Data.Unit hiding (_≤_; _≤?_)
open import Data.Bool hiding (T)
open import Data.Nat hiding (_⊔_)
open import Data.Nat.Properties
open import Data.Integer using (ℤ; +_; -[1+_]) renaming (_+_ to _ℤ+_)
open import Rational+ renaming (_+_ to _ℚ+_; _*_ to _ℚ*_)
hiding (_≤_; _≤?_)
open import Data.Fin using (Fin; inject+; raise; inject≤; toℕ; fromℕ)
renaming (zero to fzero; suc to fsuc; _+_ to _f+_)
open import Data.Fin.Properties hiding (reverse)
open import Data.Sum hiding (map)
open import Data.Product hiding (map)
open import Data.Vec hiding (reverse)
open import Function using (flip)
open import Relation.Nullary
open import Relation.Binary.Core using (Rel; IsEquivalence)
import Relation.Binary.PropositionalEquality as P
open import Relation.Binary
using (Rel; IsEquivalence; module IsEquivalence; Reflexive; Symmetric; Transitive)
renaming (_⇒_ to _⊆_)
open import Algebra
private
module CS = CommutativeSemiring Data.Nat.Properties.commutativeSemiring
open import Algebra.Structures
import Algebra.FunctionProperties
open Algebra.FunctionProperties (P._≡_ {A = ℤ})
open import Categories.Category
open import Categories.Sum
open import Categories.Product
open import Categories.Groupoid.Sum renaming (Sum to GSum)
open import Categories.Groupoid renaming (Product to GProduct)
-- import Categories.Morphisms
-- open import Categories.Support.PropositionalEquality
-- open import Categories.Support.Equivalence
-- open import Categories.Support.EqReasoning
\end{code}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Action Groupoids and Fractional Types}
\author{Everyone}
\begin{document}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
Conservation of information is our starting point. If your entire
framework is based on such a conservation principle then you
\emph{can}, temporarily, introduce \emph{negative information}. This
negative information will never be duplicated or erased and will
eventually have to be reconciled. But what could the benefit possibly
be? The intuition is simple and is essentially closely related to how
we use credit cards. A credit card creates money and a corresponding
debt out of nothing. The merchant can get their money and the debt
propagates through the system until it is reconciled at some later
point. If the entire system guarantees that the debt will not be
duplicated or erased, then the net effect is additional convenience
for everyone. Computationally what his happening is that we have
created needed resources at one site with a debt: someone must
eventually provide these resources.
If quantum field theory is correct (as it so far seems to be) then
\emph{information}, during any physical process, is neither created
nor destroyed. Our starting point is this \emph{conservation
principle} --- the \emph{conservation of entropy or information},
adapted to the computational setting, i.e., we study computations
which are information-preserving. Our initial investigation was in the
setting of computations over finite types: in that setting
information-preservation coincides with type isomorphsims,
permutations on finite sets, and HoTT equivalences. In this paper, we
extend the work to computations over \emph{groupoids}.
In both the situation with finite sets and groupoids, our measure of
information is the same. With each type $T$ (finite set or groupoid)
of cardinality $n$, we associate the information measure
$H(T) = \log{n}$. One way to think of $H(T)$ is that it is a measure
of how much space it takes to store values in $T$, not knowing
anything about their distribution. For non-empty finite sets,
$\log{n}$ is always a natural number representing the number of bits
necessary to store values of type $T$. For groupoids, it is possible
to have non-negative rational numbers as their cardinality, e.g.,
$\frac{1}{3}$, which would give us \emph{negative} entropy,
information, or space.
An important paper about negative entropy in the context of the
Landauer limit and reversible computation:
\url{http://www.nature.com/nature/journal/v474/n7349/full/nature10123.html}
Something else about negative entropy
\url{https://en.wikipedia.org/wiki/Negentropy}: In information theory
and statistics, negentropy is used as a measure of distance to
normality. Out of all distributions with a given mean and variance,
the normal or Gaussian distribution is the one with the highest
entropy. Negentropy measures the difference in entropy between a given
distribution and the Gaussian distribution with the same mean and
variance.
One more link about negative entropy
\url{https://www.quora.com/What-does-negative-entropy-mean}: For
example, if you burn fuel, you get water, CO2 and some other
wastes. Could be possible on a lab transform water + CO2 + some other
wastes on fuel again? Of course yes, but the energy to make that is
much more than the energy that you could obtain again from the
reconstructed fuel. If you see the local process (I've converted
water+ CO2 + some other wastes on fuel) the entropy is clearly
negative. But if you consider the energy necessary to achieve that the
global entropy is clearly positive.
Something about negative information:
\url{http://www.ucl.ac.uk/oppenheim/negative-information_p2.html}
In terms of space, we interpret a negative amount as the ability to
reclaim that much space.
Since information is defined using cardinality, the conclusion is that
we will consider computations between types $T_1$ and $T_2$ (finite
sets or groupoids) such that the cardinality of $T_1$ is the same as
the cardinality of $T_2$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example and Information Equivalence}
We have a type $C$ containing $n$ values and we want to operate on
each value. We will split the type $C$ as the product of $A$ and $B$
where the cardinalities of $A$ and $B$ are approximately $\sqrt{n}$
and we will operate on $A$ and $B$ independently and potentially in
parallel. We will do this even if $n$ is prime!
%%%%%
\subsection{Example}
We will use the type $C$ below as a running example in this
section. It has cardinality 7:
\begin{center}
\begin{tikzpicture}[scale=0.7,every node/.style={scale=0.8}]
\draw (0,0) ellipse (8cm and 1.6cm);
\node[below] at (-6,0) {\texttt{sun}};
\node[below] at (-4,0) {\texttt{mon}};
\node[below] at (-2,0) {\texttt{tue}};
\node[below] at (0,0) {\texttt{wed}};
\node[below] at (2,0) {\texttt{thu}};
\node[below] at (4,0) {\texttt{fri}};
\node[below] (B) at (6,0) {\texttt{sat}};
\draw[fill] (-6,0) circle [radius=0.05];
\draw[fill] (-4,0) circle [radius=0.05];
\draw[fill] (-2,0) circle [radius=0.05];
\draw[fill] (0,0) circle [radius=0.05];
\draw[fill] (2,0) circle [radius=0.05];
\draw[fill] (4,0) circle [radius=0.05];
\draw[fill] (6,0) circle [radius=0.05];
\end{tikzpicture}
\end{center}
We will decompose the type $C$ into the products of $A$ and $B$ where
$A$ will have cardinality $2\frac{1}{3}$ and $B$ will cardinality
3. The first step is to explain how to calculate such
cardinalities. We will use the Euler characteristic of a category
which in our case also correspond to the groupoid cardinality. There
are several formulations and explanations. The following is quite
simple to implement: first collapse all the isomorphic objects. Then
fix a particular order of the objects and write a matrix whose $ij$'s
entry is the number of morphisms from $i$ to $j$. Invert the
matrix. The cardinality is the sum of the elements in the matrix.
The next step is to write a permutation $p$ on $C$ of order 3. For
example:
\[\begin{array}{rcl}
p(\texttt{sun}) &=& \texttt{mon} \\
p(\texttt{mon}) &=& \texttt{tue} \\
p(\texttt{tue}) &=& \texttt{sun} \\
p(\texttt{wed}) &=& \texttt{thu} \\
p(\texttt{thu}) &=& \texttt{fri} \\
p(\texttt{fri}) &=& \texttt{wed} \\
p(\texttt{sat}) &=& \texttt{sat}
\end{array}\]
The definition of $p$ will induce three types (groupoids):
\begin{itemize}
\item The first is the action groupoid $\ag{C}{p}$ depicted below. The
objects are the elements of $C$ and there is a morphism between $x$
and $y$ iff $p^k$ for some $k$ maps $x$ to $y$. We do not draw the
identity morphisms. Note that all of $p^0$, $p^1$, and $p^2$ map
\texttt{sat} to \texttt{sat} which explains the two non-trivial
morphisms on \texttt{sat}:
\begin{center}
\begin{tikzpicture}[scale=0.7,every node/.style={scale=0.8}]
\draw (0,0) ellipse (8cm and 1.6cm);
\node[below] at (-6,0) {\texttt{sun}};
\node[below] at (-4,0) {\texttt{mon}};
\node[below] at (-2,0) {\texttt{tue}};
\node[below] at (0,0) {\texttt{wed}};
\node[below] at (2,0) {\texttt{thu}};
\node[below] at (4,0) {\texttt{fri}};
\node[below] (B) at (6,0) {\texttt{sat}};
\draw[fill] (-6,0) circle [radius=0.05];
\draw[fill] (-4,0) circle [radius=0.05];
\draw[fill] (-2,0) circle [radius=0.05];
\draw[fill] (0,0) circle [radius=0.05];
\draw[fill] (2,0) circle [radius=0.05];
\draw[fill] (4,0) circle [radius=0.05];
\draw[fill] (6,0) circle [radius=0.05];
\draw (-6,0) -- (-4,0);
\draw (-4,0) -- (-2,0);
\draw (0,0) -- (2,0);
\draw (2,0) -- (4,0);
\draw (-6,0) to[bend left] (-2,0) ;
\draw (0,0) to[bend left] (4,0) ;
\path (B) edge [loop above, looseness=3, in=48, out=132] node[above] {} (B);
\path (B) edge [loop above, looseness=5, in=40, out=140] node[above] {} (B);
\end{tikzpicture}
\end{center}
To calculate the cardinality, we first collapse all the isomorphic
objects (i.e., collapse the two strongly connected components to one
object each) and write the resulting matrix:
\[
\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 3
\end{pmatrix}
\]
Its inverse is 0 everywhere except on the main diagonal which has
entries 1, 1, and $\frac{1}{3}$ and hence the cardinality of this
category is $2\frac{1}{3}$.
\item The second which we call $1/p$ is depicted below. It has one
trivial object and a morphism for each iteration of $p$. It has
cardinality $\frac{1}{3}$ as the connectivity matrix has one entry
$3$ whose inverse is $\frac{1}{3}$:
\begin{center}
\begin{tikzpicture}[scale=0.7,every node/.style={scale=0.8}]
\draw (0,1.4) ellipse (2cm and 2cm);
\node[below] (B) at (0,0) {\texttt{*}};
%% \path (B) edge [loop above] node[above] {$p^0$} (B);
\path (B) edge [loop above, looseness=15, in=48, out=132] node[above] {$p$} (B);
\path (B) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (B);
\end{tikzpicture}
\end{center}
\item The third is the order type $\order{p}$ depicted below. It has
three objects corrsponding to each iteration of $p$. It has
cardinality $3$:
\begin{center}
\begin{tikzpicture}[scale=0.7,every node/.style={scale=0.8}]
\draw (0,0) ellipse (4cm and 1cm);
\node[below] at (-2,0) {$p^0$};
\node[below] at (0,0) {$p^1$};
\node[below] at (2,0) {$p^2$};
\draw[fill] (-2,0) circle [radius=0.05];
\draw[fill] (0,0) circle [radius=0.05];
\draw[fill] (2,0) circle [radius=0.05];
\end{tikzpicture}
\end{center}
\end{itemize}
Now we will take the type $C$ and apply the following sequence of transformations:
\[\begin{array}{rcl}
C &≃& C \boxtimes \ot \\
&≃& C \boxtimes (\order{p} \boxtimes 1/p) \\
&≃& (C \boxtimes 1/p) \boxtimes \order{p} \\
&≃& (\ag{C}{p}) \boxtimes \order{p}
\end{array}\]
First note that the types are built from permutations over finite
types: this is a different level of types from the level of plain
finite types. The usual $\Pi$-combinators lift to this level and there
are two new transfomations that we need to justify. If $p : \tau \leftrightarrow \tau$, then:
\begin{itemize}
\item $\order{p} \boxtimes 1/p ≃ \ot$, and
\item $\tau \boxtimes 1/p ≃ \ag{\tau}{p}$
\end{itemize}
In our running example, interpreting $\boxtimes$ are a regular
product, $\order{p} \boxtimes 1/p$ looks like:
\medskip
\begin{center}
\begin{tikzpicture}[scale=0.7,every node/.style={scale=0.7}]
\draw (0,0) ellipse (7cm and 2.5cm);
\node[below] (1) at (-3.5,-1.5) {$p^0$};
\node[below] (2) at (0,-1.5) {$p^1$};
\node[below] (3) at (3.5,-1.5) {$p^2$};
\draw[fill] (-3.5,-1.5) circle [radius=0.05];
\draw[fill] (0,-1.5) circle [radius=0.05];
\draw[fill] (3.5,-1.5) circle [radius=0.05];
%% \path (1) edge [loop above] node[above] {$p^0$} (1);
\path (1) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (1);
\path (1) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (1);
%% \path (2) edge [loop above] node[above] {$p^0$} (2);
\path (2) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (2);
\path (2) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (2);
%% \path (3) edge [loop above] node[above] {$p^0$} (3);
\path (3) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (3);
\path (3) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (3);
\end{tikzpicture}
\end{center}
This has the same cardinality as the finite set with one element and
hence ``informally-equivalent'' to $\ot$.
The type $C \boxtimes 1/p$ looks like:
\begin{center}
\begin{tikzpicture}[scale=0.7,every node/.style={scale=0.7}]
\draw (0,0) ellipse (9cm and 2.7cm);
\node[below] (1) at (-6,-1.5) {\texttt{sun}};
\node[below] (2) at (-4,-1.5) {\texttt{mon}};
\node[below] (3) at (-2,-1.5) {\texttt{tue}};
\node[below] (4) at (0,-1.5) {\texttt{wed}};
\node[below] (5) at (2,-1.5) {\texttt{thu}};
\node[below] (6) at (4,-1.5) {\texttt{fri}};
\node[below] (7) at (6,-1.5) {\texttt{sat}};
\draw[fill] (-6,-1.5) circle [radius=0.05];
\draw[fill] (-4,-1.5) circle [radius=0.05];
\draw[fill] (-2,-1.5) circle [radius=0.05];
\draw[fill] (0,-1.5) circle [radius=0.05];
\draw[fill] (2,-1.5) circle [radius=0.05];
\draw[fill] (4,-1.5) circle [radius=0.05];
\draw[fill] (6,-1.5) circle [radius=0.05];
%% \path (1) edge [loop above] node[above] {$p^0$} (1);
\path (1) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (1);
\path (1) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (1);
%% \path (2) edge [loop above] node[above] {$p^0$} (2);
\path (2) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (2);
\path (2) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (2);
%% \path (3) edge [loop above] node[above] {$p^0$} (3);
\path (3) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (3);
\path (3) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (3);
%% \path (4) edge [loop above] node[above] {$p^0$} (4);
\path (4) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (4);
\path (4) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (4);
%% \path (5) edge [loop above] node[above] {$p^0$} (5);
\path (5) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (5);
\path (5) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (5);
%% \path (6) edge [loop above] node[above] {$p^0$} (6);
\path (6) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (6);
\path (6) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (6);
%% \path (7) edge [loop above] node[above] {$p^0$} (7);
\path (7) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (7);
\path (7) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (7);
\end{tikzpicture}
\end{center}
This type is again informally-equivalent to $\ag{C}{p}$ as it has the
same cardinality.
% \begin{tabular}{ccc}
% \begin{minipage}{0.4\textwidth}
% \begin{tikzpicture}[scale=0.3,every node/.style={scale=0.3}]
% \draw (0,0) ellipse (9cm and 6cm);
% \node[below] (1) at (-6,0) {\texttt{sun}};
% \node[below] (2) at (-4,0) {\texttt{mon}};
% \node[below] (3) at (-2,0) {\texttt{tue}};
% \node[below] (4) at (0,0) {\texttt{wed}};
% \node[below] (5) at (2,0) {\texttt{thu}};
% \node[below] (6) at (4,0) {\texttt{fri}};
% \node[below] (7) at (6,0) {\texttt{sat}};
% \draw[fill] (-6,0) circle [radius=0.05];
% \draw[fill] (-4,0) circle [radius=0.05];
% \draw[fill] (-2,0) circle [radius=0.05];
% \draw[fill] (0,0) circle [radius=0.05];
% \draw[fill] (2,0) circle [radius=0.05];
% \draw[fill] (4,0) circle [radius=0.05];
% \draw[fill] (6,0) circle [radius=0.05];
% \path (1) edge [loop above] node[above] {$p^0$} (1);
% \path (1) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (1);
% \path (1) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (1);
% \path (2) edge [loop above] node[above] {$p^0$} (2);
% \path (2) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (2);
% \path (2) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (2);
% \path (3) edge [loop above] node[above] {$p^0$} (3);
% \path (3) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (3);
% \path (3) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (3);
% \path (4) edge [loop above] node[above] {$p^0$} (4);
% \path (4) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (4);
% \path (4) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (4);
% \path (5) edge [loop above] node[above] {$p^0$} (5);
% \path (5) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (5);
% \path (5) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (5);
% \path (6) edge [loop above] node[above] {$p^0$} (6);
% \path (6) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (6);
% \path (6) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (6);
% \path (7) edge [loop above] node[above] {$p^0$} (7);
% \path (7) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (7);
% \path (7) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (7);
% \end{tikzpicture}
% \end{minipage}
% &
% $\times$
% &
% \begin{minipage}{0.4\textwidth}
% \begin{tikzpicture}[scale=0.3,every node/.style={scale=0.3}]
% \draw (0,0) ellipse (8cm and 1.6cm);
% \node[below] at (-6,0) {\texttt{sun}};
% \node[below] at (-4,0) {\texttt{mon}};
% \node[below] at (-2,0) {\texttt{tue}};
% \node[below] at (0,0) {\texttt{wed}};
% \node[below] at (2,0) {\texttt{thu}};
% \node[below] at (4,0) {\texttt{fri}};
% \node[below] at (6,0) {\texttt{sat}};
% \draw[fill] (-6,0) circle [radius=0.05];
% \draw[fill] (-4,0) circle [radius=0.05];
% \draw[fill] (-2,0) circle [radius=0.05];
% \draw[fill] (0,0) circle [radius=0.05];
% \draw[fill] (2,0) circle [radius=0.05];
% \draw[fill] (4,0) circle [radius=0.05];
% \draw[fill] (6,0) circle [radius=0.05];
% \draw[->] (-6,0) -- (-4,0);
% \draw[->] (-4,0) -- (-2,0);
% \draw[->] (0,0) -- (2,0);
% \draw[->] (2,0) -- (4,0);
% \draw[->] (-6,0) to[bend left] (-2,0) ;
% \draw[->] (0,0) to[bend left] (4,0) ;
% \end{tikzpicture}
% \end{minipage}
% \end{tabular}
% The type of the left is equivalent to a type with $2\frac{1}{3}$
% elements. The type of the right is equivalent to a type with 3
% elements. So we have divided our 7 elements into the product of
% $2\frac{1}{3}$ and 3 and we can operate on each cluster
% separately. After simplification, the situation reduces to:
% \medskip
% \begin{tabular}{ccc}
% \begin{minipage}{0.4\textwidth}
% \begin{tikzpicture}[scale=0.5,every node/.style={scale=0.5}]
% \draw (0,0) ellipse (6cm and 4cm);
% \node[below] (3) at (-3,0) {\texttt{smt}};
% \node[below] (4) at (0,0) {\texttt{wrf}};
% \node[below] (5) at (3,0) {\texttt{sat}};
% \draw[fill] (-3,0) circle [radius=0.05];
% \draw[fill] (0,0) circle [radius=0.05];
% \draw[fill] (3,0) circle [radius=0.05];
% \path (5) edge [loop above] node[above] {$p^0$} (5);
% \path (5) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (5);
% \path (5) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (5);
% \end{tikzpicture}
% \end{minipage}
% &
% $\times$
% &
% \begin{minipage}{0.4\textwidth}
% \begin{tikzpicture}[scale=0.5,every node/.style={scale=0.5}]
% \draw (0,0) ellipse (5cm and 1.6cm);
% \node[below] at (-3,0) {\texttt{smt}};
% \node[below] at (0,0) {\texttt{wrf}};
% \node[below] at (3,0) {\texttt{sat}};
% \draw[fill] (-3,0) circle [radius=0.05];
% \draw[fill] (0,0) circle [radius=0.05];
% \draw[fill] (3,0) circle [radius=0.05];
% \end{tikzpicture}
% \end{minipage}
% \end{tabular}
% If we were to recombine the two types we would get:
% \medskip
% \begin{tikzpicture}[scale=0.5,every node/.style={scale=0.5}]
% \draw (0,0) ellipse (12cm and 4cm);
% \node[below] (1) at (-11,0) {\texttt{(smt,smt)}};
% \node[below] (2) at (-8,0) {\texttt{(wrf,smt)}};
% \node[below] (3) at (-5,0) {\texttt{(sat,smt)}};
% \draw[fill] (-11,0) circle [radius=0.05];
% \draw[fill] (-8,0) circle [radius=0.05];
% \draw[fill] (-5,0) circle [radius=0.05];
% \path (3) edge [loop above] node[above] {$p^0$} (3);
% \path (3) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (3);
% \path (3) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (3);
% \node[below] (4) at (-3,0) {\texttt{(smt,wrf)}};
% \node[below] (5) at (-1,0) {\texttt{(wrf,wrf)}};
% \node[below] (6) at (1,0) {\texttt{(sat,wrf)}};
% \draw[fill] (-3,0) circle [radius=0.05];
% \draw[fill] (-1,0) circle [radius=0.05];
% \draw[fill] (1,0) circle [radius=0.05];
% \path (6) edge [loop above] node[above] {$p^0$} (6);
% \path (6) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (6);
% \path (6) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (6);
% \node[below] (7) at (3,0) {\texttt{(smt,sat)}};
% \node[below] (8) at (5,0) {\texttt{(sat,wrf)}};
% \node[below] (9) at (7,0) {\texttt{(sat,sat)}};
% \draw[fill] (3,0) circle [radius=0.05];
% \draw[fill] (5,0) circle [radius=0.05];
% \draw[fill] (7,0) circle [radius=0.05];
% \path (9) edge [loop above] node[above] {$p^0$} (9);
% \path (9) edge [loop above, looseness=15, in=48, out=132] node[above] {$p^1$} (9);
% \path (9) edge [loop above, looseness=25, in=40, out=140] node[above] {$p^2$} (9);
% \end{tikzpicture}
% which is equivalent to $C$.
%%%%%
\subsection{Information-Equivalence}
Our notion of information equivalence is coarser than the conventional
notion of equivalence of categories (groupoids). This is fine as there
are several competing notions of equivalence of groupoids that are
coarser than strict categorical equivalence.
Need to explain the example above in terms of information!!! The best
explanation I have so far is the credit card analogy: we want money
here and now, so we create money and a debt. That debt is reconciled
somewhere else. The example above uses the same: we want to process
some values from $C$ here and now. So we create a third of them,
process them, and reconcile this third somewhere else. When all three
thirds have been reconciled the computation is finished.
\amr{adapt the following}
There are however other notions of equivalence of groupoids like
Morita equivalence and weak equivalence that we explore later. The
intuition of these weaker notions of equivalence is that two groupoids
can be considered equivalent if it is not possible to distinguish them
using certain observations. This informally corresponds to the notion
of ``observational equivalence'' in programming language
semantics. Note that negative entropy can only make sense locally in
an open system but that in a closed system, i.e., in a complete
computation, entropy cannot be negative. Thus we restrict
observational contexts to those in which fractional types do not
occur. Note that two categories can have the same cardinality but not
be equivalent or even Morita equivalent but the converse is
guaranteed. So it is necessary to have a separate notion of
equivalence and check that whenever we have the same cardinality, the
particular categories in question are equivalent. The second
equivalence, that $C \boxtimes 1/p$ is equivalent to $\ag{C}{p}$ would
follow from two facts: that three copies of $1/p$ simplify to a point
(which is the first equivalence above) and that three connected points
also simplify to a single point (which is relatively easy to
establish).
\amr{Is weak equivalence in HoTT related??? Here is one definition: A
map $f : X \rightarrow Y$ is a weak homotopy equivalence (or just a
weak equivalence) if for every $x \in X$, and all $n \geq 0$ the map
$\pi_n(X,x) \rightarrow \pi_n(Y,f(x))$ is a bijection. In our
setting this might mean something like: two types $T$ and $U$ are
equivalent if $T \leftrightarrow T$ is equivalent to
$U \leftrightarrow U$ are equivalent.}
First the equivalence can only make sense in a framework where
everything is reversible. If we allow arbitrary functions then bad
things happen as we can throw away the negative information for
example. In our reversible information-preserving framework, the
theory is consistent in the sense that not all types are
identified. This is easy to see as we only identify types that have
the same cardinality. This is evident for all the combinators except
for the new ones. For those new ones the only subtle situation is with
the empty type. Note however that there is no way to define 1/0 and no
permutation has order 0. For 0 we have one permutation id which has
order 1. So if we try to use it, we will map 1 to 1 times 1/id which
is fine. So if we always preserve types and trivially 1 and 0 have
different cardinalities so there is no way to identify them and we are
consistent.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Background}
Our starting point is $\Pi$:
\begin{itemize}
\item We have finite types $\zt$, $\ot$, $\tau_1\oplus\tau_2$, and
$\tau_1\otimes\tau_2$.
{\footnotesize{
\smallskip
\begin{code}
data U : Set where
ZERO : U
ONE : U
PLUS : U → U → U
TIMES : U → U → U
\end{code}
}}
\item A type $\tau$ has points in $\llbracket \tau \rrbracket$:
{\footnotesize{
\smallskip
\begin{code}
⟦_⟧ : U → Set
⟦ ZERO ⟧ = ⊥
⟦ ONE ⟧ = ⊤
⟦ PLUS t₁ t₂ ⟧ = ⟦ t₁ ⟧ ⊎ ⟦ t₂ ⟧
⟦ TIMES t₁ t₂ ⟧ = ⟦ t₁ ⟧ × ⟦ t₂ ⟧
\end{code}
}}
\item A type $\tau$ has a cardinality $|\tau|$ which just counts the points:
{\footnotesize{
\smallskip
\begin{code}
∣_∣ : U → ℕ
∣ ZERO ∣ = 0
∣ ONE ∣ = 1
∣ PLUS t₁ t₂ ∣ = ∣ t₁ ∣ + ∣ t₂ ∣
∣ TIMES t₁ t₂ ∣ = ∣ t₁ ∣ * ∣ t₂ ∣
\end{code}
}}
\item We have combinators $c : \tau_1\leftrightarrow\tau_2$ between
the types which witness type isomorphisms and which correspond to
the axioms of commutative rigs. Combinators are also a
representation of permutations and they preserve the size of types.
\item For $c_1, c_2 : \tau_1\leftrightarrow\tau_2$, we have level-2
combinators $\alpha : c_1 \Leftrightarrow c_2$ which are (quite
messy) equivalences of isomorphisms, and which happen to correspond
to the coherence conditions for rig groupoids.
\end{itemize}
\AgdaHide{
\begin{code}
infix 30 _⟷_
infixr 50 _◎_
data _⟷_ : U → U → Set where
unite₊l : {t : U} → PLUS ZERO t ⟷ t
uniti₊l : {t : U} → t ⟷ PLUS ZERO t
unite₊r : {t : U} → PLUS t ZERO ⟷ t
uniti₊r : {t : U} → t ⟷ PLUS t ZERO
swap₊ : {t₁ t₂ : U} → PLUS t₁ t₂ ⟷ PLUS t₂ t₁
assocl₊ : {t₁ t₂ t₃ : U} → PLUS t₁ (PLUS t₂ t₃) ⟷ PLUS (PLUS t₁ t₂) t₃
assocr₊ : {t₁ t₂ t₃ : U} → PLUS (PLUS t₁ t₂) t₃ ⟷ PLUS t₁ (PLUS t₂ t₃)
unite⋆l : {t : U} → TIMES ONE t ⟷ t
uniti⋆l : {t : U} → t ⟷ TIMES ONE t
unite⋆r : {t : U} → TIMES t ONE ⟷ t
uniti⋆r : {t : U} → t ⟷ TIMES t ONE
swap⋆ : {t₁ t₂ : U} → TIMES t₁ t₂ ⟷ TIMES t₂ t₁
assocl⋆ : {t₁ t₂ t₃ : U} → TIMES t₁ (TIMES t₂ t₃) ⟷ TIMES (TIMES t₁ t₂) t₃
assocr⋆ : {t₁ t₂ t₃ : U} → TIMES (TIMES t₁ t₂) t₃ ⟷ TIMES t₁ (TIMES t₂ t₃)
absorbr : {t : U} → TIMES ZERO t ⟷ ZERO
absorbl : {t : U} → TIMES t ZERO ⟷ ZERO
factorzr : {t : U} → ZERO ⟷ TIMES t ZERO
factorzl : {t : U} → ZERO ⟷ TIMES ZERO t
dist : {t₁ t₂ t₃ : U} →
TIMES (PLUS t₁ t₂) t₃ ⟷ PLUS (TIMES t₁ t₃) (TIMES t₂ t₃)
factor : {t₁ t₂ t₃ : U} →
PLUS (TIMES t₁ t₃) (TIMES t₂ t₃) ⟷ TIMES (PLUS t₁ t₂) t₃
distl : {t₁ t₂ t₃ : U } →
TIMES t₁ (PLUS t₂ t₃) ⟷ PLUS (TIMES t₁ t₂) (TIMES t₁ t₃)
factorl : {t₁ t₂ t₃ : U } →
PLUS (TIMES t₁ t₂) (TIMES t₁ t₃) ⟷ TIMES t₁ (PLUS t₂ t₃)
id⟷ : {t : U} → t ⟷ t
_◎_ : {t₁ t₂ t₃ : U} → (t₁ ⟷ t₂) → (t₂ ⟷ t₃) → (t₁ ⟷ t₃)
_⊕_ : {t₁ t₂ t₃ t₄ : U} →
(t₁ ⟷ t₃) → (t₂ ⟷ t₄) → (PLUS t₁ t₂ ⟷ PLUS t₃ t₄)
_⊗_ : {t₁ t₂ t₃ t₄ : U} →
(t₁ ⟷ t₃) → (t₂ ⟷ t₄) → (TIMES t₁ t₂ ⟷ TIMES t₃ t₄)
! : {t₁ t₂ : U} → (t₁ ⟷ t₂) → (t₂ ⟷ t₁)
! unite₊l = uniti₊l
! uniti₊l = unite₊l
! unite₊r = uniti₊r
! uniti₊r = unite₊r
! swap₊ = swap₊
! assocl₊ = assocr₊
! assocr₊ = assocl₊
! unite⋆l = uniti⋆l
! uniti⋆l = unite⋆l
! unite⋆r = uniti⋆r
! uniti⋆r = unite⋆r
! swap⋆ = swap⋆
! assocl⋆ = assocr⋆
! assocr⋆ = assocl⋆
! absorbl = factorzr
! absorbr = factorzl
! factorzl = absorbr
! factorzr = absorbl
! dist = factor
! factor = dist
! distl = factorl
! factorl = distl
! id⟷ = id⟷
! (c₁ ◎ c₂) = ! c₂ ◎ ! c₁
! (c₁ ⊕ c₂) = (! c₁) ⊕ (! c₂)
! (c₁ ⊗ c₂) = (! c₁) ⊗ (! c₂)
infix 30 _⇔_
data _⇔_ : {t₁ t₂ : U} → (t₁ ⟷ t₂) → (t₁ ⟷ t₂) → Set where
assoc◎l : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₃ ⟷ t₄} →
(c₁ ◎ (c₂ ◎ c₃)) ⇔ ((c₁ ◎ c₂) ◎ c₃)
assoc◎r : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₃ ⟷ t₄} →
((c₁ ◎ c₂) ◎ c₃) ⇔ (c₁ ◎ (c₂ ◎ c₃))
-- assocl⊕l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- ((c₁ ⊕ (c₂ ⊕ c₃)) ◎ assocl₊) ⇔ (assocl₊ ◎ ((c₁ ⊕ c₂) ⊕ c₃))
-- assocl⊕r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- (assocl₊ ◎ ((c₁ ⊕ c₂) ⊕ c₃)) ⇔ ((c₁ ⊕ (c₂ ⊕ c₃)) ◎ assocl₊)
-- assocl⊗l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- ((c₁ ⊗ (c₂ ⊗ c₃)) ◎ assocl⋆) ⇔ (assocl⋆ ◎ ((c₁ ⊗ c₂) ⊗ c₃))
-- assocl⊗r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- (assocl⋆ ◎ ((c₁ ⊗ c₂) ⊗ c₃)) ⇔ ((c₁ ⊗ (c₂ ⊗ c₃)) ◎ assocl⋆)
-- assocr⊕r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- (((c₁ ⊕ c₂) ⊕ c₃) ◎ assocr₊) ⇔ (assocr₊ ◎ (c₁ ⊕ (c₂ ⊕ c₃)))
-- assocr⊗l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- (assocr⋆ ◎ (c₁ ⊗ (c₂ ⊗ c₃))) ⇔ (((c₁ ⊗ c₂) ⊗ c₃) ◎ assocr⋆)
-- assocr⊗r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- (((c₁ ⊗ c₂) ⊗ c₃) ◎ assocr⋆) ⇔ (assocr⋆ ◎ (c₁ ⊗ (c₂ ⊗ c₃)))
-- assocr⊕l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
-- (assocr₊ ◎ (c₁ ⊕ (c₂ ⊕ c₃))) ⇔ (((c₁ ⊕ c₂) ⊕ c₃) ◎ assocr₊)
-- dist⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- ((a ⊕ b) ⊗ c) ◎ dist ⇔ dist ◎ ((a ⊗ c) ⊕ (b ⊗ c))
-- dist⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- dist ◎ ((a ⊗ c) ⊕ (b ⊗ c)) ⇔ ((a ⊕ b) ⊗ c) ◎ dist
-- distl⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- (a ⊗ (b ⊕ c)) ◎ distl ⇔ distl ◎ ((a ⊗ b) ⊕ (a ⊗ c))
-- distl⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- distl ◎ ((a ⊗ b) ⊕ (a ⊗ c)) ⇔ (a ⊗ (b ⊕ c)) ◎ distl
-- factor⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- ((a ⊗ c) ⊕ (b ⊗ c)) ◎ factor ⇔ factor ◎ ((a ⊕ b) ⊗ c)
-- factor⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- factor ◎ ((a ⊕ b) ⊗ c) ⇔ ((a ⊗ c) ⊕ (b ⊗ c)) ◎ factor
-- factorl⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- ((a ⊗ b) ⊕ (a ⊗ c)) ◎ factorl ⇔ factorl ◎ (a ⊗ (b ⊕ c))
-- factorl⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
-- {a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
-- factorl ◎ (a ⊗ (b ⊕ c)) ⇔ ((a ⊗ b) ⊕ (a ⊗ c)) ◎ factorl
idl◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (id⟷ ◎ c) ⇔ c
idl◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ⇔ id⟷ ◎ c
idr◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (c ◎ id⟷) ⇔ c
idr◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ⇔ (c ◎ id⟷)
-- linv◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (c ◎ ! c) ⇔ id⟷
-- linv◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → id⟷ ⇔ (c ◎ ! c)
-- rinv◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (! c ◎ c) ⇔ id⟷
-- rinv◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → id⟷ ⇔ (! c ◎ c)
-- unite₊l⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- (unite₊l ◎ c₂) ⇔ ((c₁ ⊕ c₂) ◎ unite₊l)
-- unite₊l⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- ((c₁ ⊕ c₂) ◎ unite₊l) ⇔ (unite₊l ◎ c₂)
-- uniti₊l⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- (uniti₊l ◎ (c₁ ⊕ c₂)) ⇔ (c₂ ◎ uniti₊l)
-- uniti₊l⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- (c₂ ◎ uniti₊l) ⇔ (uniti₊l ◎ (c₁ ⊕ c₂))
-- unite₊r⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- (unite₊r ◎ c₂) ⇔ ((c₂ ⊕ c₁) ◎ unite₊r)
-- unite₊r⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- ((c₂ ⊕ c₁) ◎ unite₊r) ⇔ (unite₊r ◎ c₂)
-- uniti₊r⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- (uniti₊r ◎ (c₂ ⊕ c₁)) ⇔ (c₂ ◎ uniti₊r)
-- uniti₊r⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
-- (c₂ ◎ uniti₊r) ⇔ (uniti₊r ◎ (c₂ ⊕ c₁))
-- swapl₊⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
-- (swap₊ ◎ (c₁ ⊕ c₂)) ⇔ ((c₂ ⊕ c₁) ◎ swap₊)
-- swapr₊⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
-- ((c₂ ⊕ c₁) ◎ swap₊) ⇔ (swap₊ ◎ (c₁ ⊕ c₂))
-- unitel⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- (unite⋆l ◎ c₂) ⇔ ((c₁ ⊗ c₂) ◎ unite⋆l)
-- uniter⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- ((c₁ ⊗ c₂) ◎ unite⋆l) ⇔ (unite⋆l ◎ c₂)
-- unitil⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- (uniti⋆l ◎ (c₁ ⊗ c₂)) ⇔ (c₂ ◎ uniti⋆l)
-- unitir⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- (c₂ ◎ uniti⋆l) ⇔ (uniti⋆l ◎ (c₁ ⊗ c₂))
-- unitel⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- (unite⋆r ◎ c₂) ⇔ ((c₂ ⊗ c₁) ◎ unite⋆r)
-- uniter⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- ((c₂ ⊗ c₁) ◎ unite⋆r) ⇔ (unite⋆r ◎ c₂)
-- unitil⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- (uniti⋆r ◎ (c₂ ⊗ c₁)) ⇔ (c₂ ◎ uniti⋆r)
-- unitir⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
-- (c₂ ◎ uniti⋆r) ⇔ (uniti⋆r ◎ (c₂ ⊗ c₁))
-- swapl⋆⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
-- (swap⋆ ◎ (c₁ ⊗ c₂)) ⇔ ((c₂ ⊗ c₁) ◎ swap⋆)
-- swapr⋆⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
-- ((c₂ ⊗ c₁) ◎ swap⋆) ⇔ (swap⋆ ◎ (c₁ ⊗ c₂))
id⇔ : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ⇔ c
trans⇔ : {t₁ t₂ : U} {c₁ c₂ c₃ : t₁ ⟷ t₂} →
(c₁ ⇔ c₂) → (c₂ ⇔ c₃) → (c₁ ⇔ c₃)
_⊡_ : {t₁ t₂ t₃ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₁ ⟷ t₂} {c₄ : t₂ ⟷ t₃} →
(c₁ ⇔ c₃) → (c₂ ⇔ c₄) → (c₁ ◎ c₂) ⇔ (c₃ ◎ c₄)
-- resp⊕⇔ : {t₁ t₂ t₃ t₄ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₁ ⟷ t₂} {c₄ : t₃ ⟷ t₄} →
-- (c₁ ⇔ c₃) → (c₂ ⇔ c₄) → (c₁ ⊕ c₂) ⇔ (c₃ ⊕ c₄)
-- resp⊗⇔ : {t₁ t₂ t₃ t₄ : U}
-- {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₁ ⟷ t₂} {c₄ : t₃ ⟷ t₄} →
-- (c₁ ⇔ c₃) → (c₂ ⇔ c₄) → (c₁ ⊗ c₂) ⇔ (c₃ ⊗ c₄)
-- -- below are the combinators added for the RigCategory structure
-- id⟷⊕id⟷⇔ : {t₁ t₂ : U} → (id⟷ {t₁} ⊕ id⟷ {t₂}) ⇔ id⟷
-- split⊕-id⟷ : {t₁ t₂ : U} → (id⟷ {PLUS t₁ t₂}) ⇔ (id⟷ ⊕ id⟷)
-- hom⊕◎⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
-- {c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
-- ((c₁ ◎ c₃) ⊕ (c₂ ◎ c₄)) ⇔ ((c₁ ⊕ c₂) ◎ (c₃ ⊕ c₄))
-- hom◎⊕⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
-- {c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
-- ((c₁ ⊕ c₂) ◎ (c₃ ⊕ c₄)) ⇔ ((c₁ ◎ c₃) ⊕ (c₂ ◎ c₄))
-- id⟷⊗id⟷⇔ : {t₁ t₂ : U} → (id⟷ {t₁} ⊗ id⟷ {t₂}) ⇔ id⟷
-- split⊗-id⟷ : {t₁ t₂ : U} → (id⟷ {TIMES t₁ t₂}) ⇔ (id⟷ ⊗ id⟷)
-- hom⊗◎⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
-- {c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
-- ((c₁ ◎ c₃) ⊗ (c₂ ◎ c₄)) ⇔ ((c₁ ⊗ c₂) ◎ (c₃ ⊗ c₄))
-- hom◎⊗⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
-- {c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
-- ((c₁ ⊗ c₂) ◎ (c₃ ⊗ c₄)) ⇔ ((c₁ ◎ c₃) ⊗ (c₂ ◎ c₄))
-- -- associativity triangle
-- triangle⊕l : {t₁ t₂ : U} →
-- (unite₊r {t₁} ⊕ id⟷ {t₂}) ⇔ assocr₊ ◎ (id⟷ ⊕ unite₊l)
-- triangle⊕r : {t₁ t₂ : U} →
-- assocr₊ ◎ (id⟷ {t₁} ⊕ unite₊l {t₂}) ⇔ (unite₊r ⊕ id⟷)
-- triangle⊗l : {t₁ t₂ : U} →
-- ((unite⋆r {t₁}) ⊗ id⟷ {t₂}) ⇔ assocr⋆ ◎ (id⟷ ⊗ unite⋆l)
-- triangle⊗r : {t₁ t₂ : U} →
-- (assocr⋆ ◎ (id⟷ {t₁} ⊗ unite⋆l {t₂})) ⇔ (unite⋆r ⊗ id⟷)
-- pentagon⊕l : {t₁ t₂ t₃ t₄ : U} →
-- assocr₊ ◎ (assocr₊ {t₁} {t₂} {PLUS t₃ t₄}) ⇔
-- ((assocr₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ assocr₊)
-- pentagon⊕r : {t₁ t₂ t₃ t₄ : U} →
-- ((assocr₊ {t₁} {t₂} {t₃} ⊕ id⟷ {t₄}) ◎ assocr₊) ◎ (id⟷ ⊕ assocr₊) ⇔
-- assocr₊ ◎ assocr₊
-- pentagon⊗l : {t₁ t₂ t₃ t₄ : U} →
-- assocr⋆ ◎ (assocr⋆ {t₁} {t₂} {TIMES t₃ t₄}) ⇔
-- ((assocr⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ assocr⋆)
-- pentagon⊗r : {t₁ t₂ t₃ t₄ : U} →
-- ((assocr⋆ {t₁} {t₂} {t₃} ⊗ id⟷ {t₄}) ◎ assocr⋆) ◎ (id⟷ ⊗ assocr⋆) ⇔
-- assocr⋆ ◎ assocr⋆
-- -- from the braiding
-- -- unit coherence
-- unite₊l-coh-l : {t₁ : U} → unite₊l {t₁} ⇔ swap₊ ◎ unite₊r
-- unite₊l-coh-r : {t₁ : U} → swap₊ ◎ unite₊r ⇔ unite₊l {t₁}
-- unite⋆l-coh-l : {t₁ : U} → unite⋆l {t₁} ⇔ swap⋆ ◎ unite⋆r
-- unite⋆l-coh-r : {t₁ : U} → swap⋆ ◎ unite⋆r ⇔ unite⋆l {t₁}
-- hexagonr⊕l : {t₁ t₂ t₃ : U} →
-- (assocr₊ ◎ swap₊) ◎ assocr₊ {t₁} {t₂} {t₃} ⇔
-- ((swap₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ swap₊)
-- hexagonr⊕r : {t₁ t₂ t₃ : U} →
-- ((swap₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ swap₊) ⇔
-- (assocr₊ ◎ swap₊) ◎ assocr₊ {t₁} {t₂} {t₃}
-- hexagonl⊕l : {t₁ t₂ t₃ : U} →
-- (assocl₊ ◎ swap₊) ◎ assocl₊ {t₁} {t₂} {t₃} ⇔
-- ((id⟷ ⊕ swap₊) ◎ assocl₊) ◎ (swap₊ ⊕ id⟷)
-- hexagonl⊕r : {t₁ t₂ t₃ : U} →
-- ((id⟷ ⊕ swap₊) ◎ assocl₊) ◎ (swap₊ ⊕ id⟷) ⇔
-- (assocl₊ ◎ swap₊) ◎ assocl₊ {t₁} {t₂} {t₃}
-- hexagonr⊗l : {t₁ t₂ t₃ : U} →
-- (assocr⋆ ◎ swap⋆) ◎ assocr⋆ {t₁} {t₂} {t₃} ⇔
-- ((swap⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ swap⋆)
-- hexagonr⊗r : {t₁ t₂ t₃ : U} →
-- ((swap⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ swap⋆) ⇔
-- (assocr⋆ ◎ swap⋆) ◎ assocr⋆ {t₁} {t₂} {t₃}
-- hexagonl⊗l : {t₁ t₂ t₃ : U} →
-- (assocl⋆ ◎ swap⋆) ◎ assocl⋆ {t₁} {t₂} {t₃} ⇔
-- ((id⟷ ⊗ swap⋆) ◎ assocl⋆) ◎ (swap⋆ ⊗ id⟷)
-- hexagonl⊗r : {t₁ t₂ t₃ : U} →
-- ((id⟷ ⊗ swap⋆) ◎ assocl⋆) ◎ (swap⋆ ⊗ id⟷) ⇔
-- (assocl⋆ ◎ swap⋆) ◎ assocl⋆ {t₁} {t₂} {t₃}
-- absorbl⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- (c₁ ⊗ id⟷ {ZERO}) ◎ absorbl ⇔ absorbl ◎ id⟷ {ZERO}
-- absorbl⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- absorbl ◎ id⟷ {ZERO} ⇔ (c₁ ⊗ id⟷ {ZERO}) ◎ absorbl
-- absorbr⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- (id⟷ {ZERO} ⊗ c₁) ◎ absorbr ⇔ absorbr ◎ id⟷ {ZERO}
-- absorbr⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- absorbr ◎ id⟷ {ZERO} ⇔ (id⟷ {ZERO} ⊗ c₁) ◎ absorbr
-- factorzl⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- id⟷ ◎ factorzl ⇔ factorzl ◎ (id⟷ ⊗ c₁)
-- factorzl⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- factorzl ◎ (id⟷ {ZERO} ⊗ c₁) ⇔ id⟷ {ZERO} ◎ factorzl
-- factorzr⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- id⟷ ◎ factorzr ⇔ factorzr ◎ (c₁ ⊗ id⟷)
-- factorzr⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
-- factorzr ◎ (c₁ ⊗ id⟷) ⇔ id⟷ ◎ factorzr
-- -- from the coherence conditions of RigCategory
-- swap₊distl⇔l : {t₁ t₂ t₃ : U} →
-- (id⟷ {t₁} ⊗ swap₊ {t₂} {t₃}) ◎ distl ⇔ distl ◎ swap₊
-- swap₊distl⇔r : {t₁ t₂ t₃ : U} →
-- distl ◎ swap₊ ⇔ (id⟷ {t₁} ⊗ swap₊ {t₂} {t₃}) ◎ distl
-- dist-swap⋆⇔l : {t₁ t₂ t₃ : U} →
-- dist {t₁} {t₂} {t₃} ◎ (swap⋆ ⊕ swap⋆) ⇔ swap⋆ ◎ distl
-- dist-swap⋆⇔r : {t₁ t₂ t₃ : U} →
-- swap⋆ ◎ distl {t₁} {t₂} {t₃} ⇔ dist ◎ (swap⋆ ⊕ swap⋆)
-- assocl₊-dist-dist⇔l : {t₁ t₂ t₃ t₄ : U} →
-- ((assocl₊ {t₁} {t₂} {t₃} ⊗ id⟷ {t₄}) ◎ dist) ◎ (dist ⊕ id⟷) ⇔
-- (dist ◎ (id⟷ ⊕ dist)) ◎ assocl₊
-- assocl₊-dist-dist⇔r : {t₁ t₂ t₃ t₄ : U} →
-- (dist {t₁} ◎ (id⟷ ⊕ dist {t₂} {t₃} {t₄})) ◎ assocl₊ ⇔
-- ((assocl₊ ⊗ id⟷) ◎ dist) ◎ (dist ⊕ id⟷)
-- assocl⋆-distl⇔l : {t₁ t₂ t₃ t₄ : U} →
-- assocl⋆ {t₁} {t₂} ◎ distl {TIMES t₁ t₂} {t₃} {t₄} ⇔
-- ((id⟷ ⊗ distl) ◎ distl) ◎ (assocl⋆ ⊕ assocl⋆)
-- assocl⋆-distl⇔r : {t₁ t₂ t₃ t₄ : U} →