├── .mailmap ├── assets ├── bonak.png └── bonak.svg ├── dune-project ├── theories ├── dune └── νSet │ ├── Notation.v │ ├── RewLemmas.v │ ├── SigT.v │ ├── HSet.v │ ├── LeYoneda.v │ └── νSet.v ├── .gitmodules ├── paper ├── .gitignore ├── tab-coind.tex ├── tab-core.tex ├── tab-frames.tex ├── tab-faces-ett.tex ├── depstream.v ├── tab-coh-ett.tex ├── restruct.tex ├── paper.bib ├── msclike.bst └── restruct-new.tex ├── gendoc.sh ├── .vscode ├── ltex.disabledRules.en-US.txt ├── ltex.dictionary.en-US.txt ├── settings.json └── ltex.hiddenFalsePositives.en-US.txt ├── _CoqProject ├── .gitignore ├── .github └── workflows │ └── coq-action.yml ├── bonak.opam ├── LICENSE └── README.md /.mailmap: -------------------------------------------------------------------------------- 1 | Ramkumar Ramachandra 2 | -------------------------------------------------------------------------------- /assets/bonak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artagnon/bonak/HEAD/assets/bonak.png -------------------------------------------------------------------------------- /dune-project: -------------------------------------------------------------------------------- 1 | (lang dune 3.17) 2 | 3 | (using coq 0.8) 4 | 5 | (name bonak) 6 | -------------------------------------------------------------------------------- /theories/dune: -------------------------------------------------------------------------------- 1 | (coq.theory 2 | (name Bonak) 3 | (theories Stdlib)) 4 | 5 | (include_subdirs qualified) 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "paper/art.cls"] 2 | path = paper/art.cls 3 | url = https://github.com/artagnon/art.cls 4 | -------------------------------------------------------------------------------- /paper/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.log 3 | *.bbl 4 | *.blg 5 | *.out 6 | *.toc 7 | *.dvi 8 | *.ps 9 | paper.pdf 10 | FTT*.tex 11 | -------------------------------------------------------------------------------- /gendoc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | coqdoc -t Bonak --no-lib-name --parse-comments --utf8 -d docs -Q _build/default/theories Bonak _build/default/theories/νType/*.v 4 | -------------------------------------------------------------------------------- /.vscode/ltex.disabledRules.en-US.txt: -------------------------------------------------------------------------------- 1 | COMMA_PARENTHESIS_WHITESPACE 2 | UPPERCASE_SENTENCE_START 3 | MORFOLOGIK_RULE_EN_US 4 | NON_STANDARD_WORD 5 | DOUBLE_PUNCTUATION 6 | WHITESPACE_RULE 7 | IF_IS 8 | -------------------------------------------------------------------------------- /_CoqProject: -------------------------------------------------------------------------------- 1 | -R _build/default/theories Bonak 2 | theories/νSet/HSet.v 3 | theories/νSet/LeYoneda.v 4 | theories/νSet/Notation.v 5 | theories/νSet/RewLemmas.v 6 | theories/νSet/SigT.v 7 | theories/νSet/νSet.v 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.vo 2 | *.vos 3 | *.vok 4 | *.glob 5 | *.aux 6 | *.bbl 7 | *.bcf 8 | *.xml 9 | *.pdf 10 | *.out 11 | *.log 12 | *.fdb_latexmk 13 | *.fls 14 | paper/*.pygtex 15 | .coqdeps.d 16 | .Makefile.d 17 | Makefile.coq* 18 | Makefile.conf 19 | TAGS 20 | .DS_Store 21 | _build 22 | .lia.cache 23 | _minted*/ 24 | .vscode 25 | *~ 26 | -------------------------------------------------------------------------------- /paper/tab-coind.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\lab}{tab:coind} 2 | \begin{eqntable}{Main definition\label{\lab}} 3 | \eqnline{\Xp{m}}{}{:}{\U[m+1]} 4 | \eqnline{\Xp{m}}{}{\defeq}{\Xfrom{m}{0}[D=\unitpoint]} 5 | \graymidrule 6 | \eqnline{\Xfrom{m}{n}}{\eqnarg{X}{D}{\Xto{m}{n}}}{:}{\U[m+1]} 7 | \eqnline{\Xfrom{m}{n}}{D}{\defeq}{\Sigma R:\Xcomp{m}{n}[D=\D]. \Xfrom{m}{n+1}[D=\pair{D}{R}]} 8 | \end{eqntable} 9 | -------------------------------------------------------------------------------- /.vscode/ltex.dictionary.en-US.txt: -------------------------------------------------------------------------------- 1 | semi-simplicial 2 | fibered 3 | parametricity 4 | bonak 5 | fullframe 6 | univalence 7 | extensionality 8 | degeneracies 9 | simplicial 10 | Agda 11 | restrframe 12 | restrlayer 13 | restrfiller 14 | cohframe 15 | cohlayer 16 | cohfiller 17 | coh 18 | restr 19 | Ramkumar 20 | Ramachandra 21 | simplices 22 | Bezem 23 | Mörtberg 24 | Coquand 25 | Angiuli 26 | Brunerie 27 | coq 28 | Coq 29 | CoqInCoq 30 | coherences 31 | -------------------------------------------------------------------------------- /.github/workflows/coq-action.yml: -------------------------------------------------------------------------------- 1 | name: coq-action 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | jobs: 7 | build: 8 | runs-on: "ubuntu-latest" 9 | steps: 10 | - uses: "actions/checkout@v4" 11 | with: 12 | submodules: "true" 13 | - name: "Docker Coq action" 14 | uses: "coq-community/docker-coq-action@v1" 15 | with: 16 | opam_file: "bonak.opam" 17 | coq_version: "9.0.0" 18 | -------------------------------------------------------------------------------- /paper/tab-core.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\lab}{tab:core} 2 | \begin{eqntable}{Truncated $\nu$-sets, the core\label{\lab}} 3 | \eqnline{\Xto{m}{n}}{}{:}{\U[m+1]} 4 | \eqnline{\Xto{m}{0}}{}{\defeq}{\unittype} 5 | \eqnline{\Xto{m}{n'+1}}{}{\defeq}{\ensuremath{\Sigma}D:\Xto{m}{n'}.\,\Xcomp{m}{n'}[D=\D]} 6 | \graymidrule 7 | \eqnline{\Xcomp{m}{n}}{\eqnarg{X}{D}{\Xto{m}{n}}}{:}{\U[m+1]} 8 | \eqnline{\Xcomp{m}{n}}{D}{\defeq}{\fullframe[m][n][D=\D] \imp \U[m]} 9 | \end{eqntable} 10 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.wordWrapColumn": 80, 3 | "spellright.language": [ 4 | "en" 5 | ], 6 | "spellright.documentTypes": [ 7 | "latex", 8 | ], 9 | "files.exclude": { 10 | "**/*.vo": true, 11 | "**/*.vok": true, 12 | "**/*.vos": true, 13 | "**/*.aux": true, 14 | "**/*.glob": true, 15 | "**/.git": true, 16 | "**/.svn": false, 17 | "**/.hg": false, 18 | "**/CVS": false, 19 | "**/.DS_Store": true, 20 | "**/Thumbs.db": true, 21 | "**/.ruby-lsp": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bonak.opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | name: "bonak" 3 | synopsis: "An indexed construction of semi-simplicial and semi-cubical types" 4 | maintainer: "Ramkumar Ramachandra " 5 | authors: [ "Ramkumar Ramachandra " 6 | "Hugo Herbelin " ] 7 | license: "MIT" 8 | homepage: "https://github.com/artagnon/bonak" 9 | bug-reports: "https://github.com/artagnon/bonak/issues" 10 | dev-repo: "git+https://github.com/artagnon/bonak" 11 | depends: [ 12 | "coq" { >= "9.0.0" } 13 | "dune" { >= "3.17.2" } 14 | ] 15 | build: [ 16 | ["dune" "build"] 17 | ] 18 | url { 19 | src: "git+https://github.com/artagnon/bonak.git#master" 20 | } 21 | -------------------------------------------------------------------------------- /theories/νSet/Notation.v: -------------------------------------------------------------------------------- 1 | (** Miscellaneous notations *) 2 | 3 | Notation "x .+1" := (S x) (at level 1, left associativity, format "x .+1"). 4 | Notation "x .+2" := (S (S x)) (at level 1, left associativity, format "x .+2"). 5 | Notation "x .+3" := (S (S (S x))) 6 | (at level 1, left associativity, format "x .+3"). 7 | 8 | (** This is in Program.Basics for some strange reason *) 9 | Arguments id {A} x. 10 | 11 | (** Notations for rew *) 12 | Notation "'rew' [ P ] H 'in' H'" := (eq_rect _ P H' _ H) 13 | (at level 10, H' at level 10, 14 | format "'[' 'rew' [ P ] '/ ' H in '/' H' ']'"). 15 | Notation "'rew' <- [ P ] H 'in' H'" := (eq_rect_r P H' H) 16 | (at level 10, H' at level 10, 17 | format "'[' 'rew' <- [ P ] '/ ' H in '/' H' ']'"). 18 | 19 | Infix "•" := eq_trans (at level 65, left associativity). 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ramkumar Ramachandra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /paper/tab-frames.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\lab}{tab:frames} 2 | \begin{eqntable}{$\mathsf{frame}$, $\mathsf{layer}$, and $\mathsf{painting}$\label{\lab}} 3 | \eqnline{\fullframe[m][n]}{\eqnarg{fullframe}{D}{\Xto{m}{n}}}{:}{\U[m]} 4 | \eqnline{\fullframe[m][n]}{D}{\defeq}{\framep[m][n][n][][D=\D]} 5 | \graymidrule 6 | 7 | \eqnline{\framep[m][n][p][p \leq n]}{\eqnarg{frame}{D}{\Xto{m}{n}}}{:}{\U[m]} 8 | \eqnline{\framep[m][n][0]}{D}{\defeq}{\unittype} 9 | \eqnline{\framep[m][n][p+1]}{D}{\defeq}{\Sigma d:\framep[m][n][p][][D=\D].\,\layer[m][n-1][p][][D=\D, d=\d]} 10 | \graymidrule 11 | 12 | \eqnline{\layer[m][n][p][p \leq n]}{\makecell{\eqnarg{layer}{D}{\Xto{m}{n+1}} \\ \eqnarg{layer}{d}{\framep[m][n+1][p][][D=\D]}}}{:}{\U[m]} 13 | \eqnline{\layer[m][n][p]}{D~d}{\defeq}{\Pi \epsilon.\painting[m][n][p][][D=\hdD, E=\tlD, d={\restrf[m][\epsilon][p][n][p][][D=\D, d=\d]}]} 14 | \graymidrule 15 | 16 | \eqnline{\painting[m][n][p][p \leq n]}{\makecell{\eqnarg{filler}{D}{\Xto{m}{n}} \\ \eqnarg{filler}{E}{\Xcomp{m}{n}[D=\D]} \\ \eqnarg{filler}{d}{\framep[m][n][p][][D=\D]}}}{:}{\U[m]} 17 | \eqnline{\painting[m][n][p][p=n]}{\D~\E~\d}{\defeq}{\E(\d)} 18 | \eqnline{\painting[m][n][p][p Type} {Q: {a &T P a} -> Type} 9 | {y} {H: x = y} 10 | {u: P x} {v: Q (x; u)} 11 | {u': P y} {v': Q (y; u')} 12 | {Hu: rew H in u = u'} {Hv: rew (=H; Hu) in v = v'}: 13 | rew [fun x => {a: P x &T Q (x; a)}] H in (u; v) = (u'; v'). 14 | Proof. 15 | now destruct Hu, Hv, H. 16 | Qed. 17 | 18 | Lemma rew_permute_ll_hset: forall (A: Type) (P Q: A -> HSet) (x y: A) 19 | (H: forall z: A, P z = Q z) (H': x = y) (a: P x), 20 | rew [Dom] H y in rew [P] H' in a = rew [Q] H' in rew [Dom] H x in a. 21 | Proof. 22 | now destruct H'. 23 | Defined. 24 | 25 | Lemma rew_swap: forall A (P: A -> Type) a b (H: a = b) (x: P a) (y: P b), 26 | x = rew <- H in y <-> rew H in x = y. 27 | Proof. 28 | now destruct H. 29 | Qed. 30 | 31 | Lemma rew_app_rl A (P: A -> Type) (x y: A) (H H': x = y) (a: P x) : 32 | H = H' -> rew <- [P] H in rew [P] H' in a = a. 33 | Proof. 34 | intros * ->. now destruct H'. 35 | Qed. 36 | 37 | Lemma map_subst_app {A B} {x y} {𝛉: A} (H: x = y :> B) (P: A -> B -> Type) 38 | (f: forall 𝛉, P 𝛉 x): 39 | rew [P 𝛉] H in f 𝛉 = (rew [fun x => forall 𝛉, P 𝛉 x] H in f) 𝛉. 40 | Proof. 41 | now destruct H. 42 | Qed. 43 | -------------------------------------------------------------------------------- /paper/tab-faces-ett.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\lab}{fulltab:faces} 2 | \begin{eqntable}{$q$-th projection of $\mathsf{restr}$, or faces\label{\lab}} 3 | \eqnline{\restrf[m][\epsilon][q][n][p][q \leq n-p]}{\makecell{\eqnarg{restrframe}{D}{\Xto{m}{n+1}} \\ \eqnarg{restrframe}{d}{\framep[m][n+1][p][][D=\D]}}}{:}{\framep[m][n][p][][D=\hdD]} 4 | \eqnline{\restrf[m][\epsilon][q][n][0]}{D~\unitpoint}{\defeq}{\unitpoint} 5 | \eqnline{\restrf[m][\epsilon][q][n][p+1]}{D~(\pair{d}{l})}{\defeq}{(\restrf[m][\epsilon][q+1][n][p][][D=\D, d=\d],\restrl[m][\epsilon][q+1][n-1][p][][D=\D, d=\d, l=\l])} 6 | \graymidrule 7 | 8 | \eqnline{\restrl[m][\epsilon][q][n][p][q \leq n-p]}{\makecell{\eqnarg{restrlayer}{D}{\Xto{m}{n+2}} \\ \eqnarg{restrlayer}{d}{\framep[m][n+2][p][][D=\D]} \\ \eqnarg{restrlayer}{l}{\layer[m][n+1][p][][D=\D, d=\d]}}}{:}{\layer[m][n][p][][D=\hdD, d={\restrf[m][\epsilon][q+1][n+1][p][][D=\D, d=\d]}]} 9 | \eqnline{\restrl[m][\epsilon][q][n][p]}{\D~\d~\l}{\defeq}{\lambda \omega.(\restrp[m][\epsilon][q][n][p][][D=\hdD, E=\tlD, d={\restrf[m][\omega][0][n][p][][D=\D, d=\d]}, c={\l_\omega}])} 10 | \graymidrule 11 | 12 | \eqnline{\restrp[m][\epsilon][q][n][p][q \leq n-p]}{\makecell{\eqnarg{restrpainting}{D}{\Xto{m}{n+1}} \\ \eqnarg{restrpainting}{E}{\Xcomp{m}{n+1}[D=\D]} \\\eqnarg{restrpainting}{d}{\framep[m][n+1][p][][D=\D]} \\ \eqnarg{restrpainting}{c}{\painting[m][n+1][p][][D=\D, E=\E, d=\d]}}}{:}{\painting[m][n][p][][D=\hdD, E=\tlD, d={\restrf[m][\epsilon][q][n][p][][D=\D, d=\d]}]} 13 | \eqnline{\restrp[m][\epsilon][0][n][p][]}{\D~\E~\d~(\pair{l}{\_})}{\defeq}{\l_\epsilon} 14 | \eqnline{\restrp[m][\epsilon][q+1][n][p][p Type) (f: forall a, B a -> A). 6 | 7 | CoInductive DepStream (a: A): Type := 8 | { this : B a ; next : DepStream (f a this) }. 9 | 10 | Check this: forall a, DepStream a -> B a. 11 | Check next: forall a (x: DepStream a), DepStream (f a x.(this a)). 12 | 13 | Context (D: A -> Type) (v: forall a, D a -> B a) 14 | (s: forall a d, D (f a (v a d))). 15 | 16 | CoFixpoint make a (d: D a) : DepStream a := 17 | {| this := v a d; next := make (f a (v a d)) (s a d) |}. 18 | 19 | Check fun a d => eq_refl: (make a d).(this a) = v a d. 20 | Check fun a d => eq_refl: (make a d).(next a) = 21 | make (f a (make a d).(this a)) (s a d). 22 | 23 | End DepStream. 24 | 25 | (** Over propositions, we can also give a second-order interpretation *) 26 | 27 | Section DepStreamProp. 28 | 29 | Context {A: Prop} (B: A->Prop) (f: forall a, B a -> A). 30 | 31 | Definition DepStreamProp (a: A): Prop := 32 | exists D: A -> Prop, (D a /\ exists (v: forall a, D a -> B a), 33 | (forall a d, D (f a (v a d)))). 34 | 35 | Definition this_prop a (x: DepStreamProp a): B a := 36 | let '(ex_intro _ D (conj d (ex_intro _ v s))) := x in v a d. 37 | 38 | Definition next_prop a (x: DepStreamProp a): 39 | DepStreamProp (f a (this_prop a x)) := 40 | let '(ex_intro _ D (conj d (ex_intro _ v s))) := x in 41 | ex_intro _ D (conj (s a d) (ex_intro _ v s)). 42 | 43 | Context (D: A -> Prop) (v: forall a, D a -> B a) 44 | (s: forall a d, D (f a (v a d))). 45 | 46 | Definition make_prop a (d: D a): DepStreamProp a := 47 | ex_intro _ D (conj d (ex_intro _ v s)). 48 | 49 | Check fun a d => eq_refl: this_prop a (make_prop a d) = v a d. 50 | Check fun a d => eq_refl: next_prop a (make_prop a d) = 51 | make_prop (f a (this_prop a (make_prop a d))) (s a d). 52 | 53 | End DepStreamProp. 54 | -------------------------------------------------------------------------------- /theories/νSet/SigT.v: -------------------------------------------------------------------------------- 1 | Set Primitive Projections. 2 | Set Printing Projections. 3 | 4 | Record sigT {A: Type} (P: A -> Type): Type := 5 | existT { projT1: A; projT2: P projT1 }. 6 | 7 | Arguments sigT {A} P. 8 | Arguments projT1 {A P} _. 9 | Arguments projT2 {A P} _. 10 | Arguments existT {A} P _ _. 11 | 12 | Set Warnings "-notation-overridden". 13 | 14 | Notation "{ x &T P }" := (sigT (fun x => P%type)) 15 | (x at level 99, format "{ '[ ' x &T '/' P ']' }"): type_scope. 16 | Notation "{ x : A &T P }" := (sigT (A := A) (fun x => P%type)) 17 | (x at level 99, format "{ '[ ' '[' x : A ']' &T '/' P ']' }"): type_scope. 18 | Notation "( x 'as' z 'in' T ; y 'in' P )" := (existT (fun z: T => P%type) x y) 19 | (at level 0, only parsing). 20 | Notation "( x ; y )" := (existT _ x y) 21 | (at level 0, format "'[' ( x ; '/ ' y ) ']'"). 22 | Notation "x .1" := (projT1 x) (at level 1, left associativity, format "x .1"). 23 | Notation "x .2" := (projT2 x) (at level 1, left associativity, format "x .2"). 24 | 25 | Import Logic.EqNotations. 26 | 27 | Definition eq_existT_uncurried {A: Type} {P: A -> Type} {u1 v1: A} 28 | {u2: P u1} {v2: P v1} (pq: { p: u1 = v1 &T rew p in u2 = v2 }): 29 | (u1; u2) = (v1; v2). 30 | Proof. 31 | now destruct pq as [p q], q, p. 32 | Defined. 33 | 34 | Definition eq_sigT_uncurried {A: Type} {P: A -> Type} (u v: { a: A &T P a }) 35 | (pq: { p: u.1 = v.1 &T rew p in u.2 = v.2 }): u = v. 36 | Proof. 37 | destruct u, v; now apply eq_existT_uncurried. 38 | Defined. 39 | 40 | Lemma eq_existT_curried {A: Type} {P: A -> Type} {u1 v1: A} {u2: P u1} 41 | {v2: P v1} (p: u1 = v1) (q: rew p in u2 = v2): (u1; u2) = (v1; v2). 42 | Proof. 43 | apply eq_sigT_uncurried; now exists p. 44 | Defined. 45 | 46 | Definition projT1_eq {A} {P: A -> Type} {u v: { a: A &T P a }} (p: u = v): 47 | u.1 = v.1 := f_equal (fun x => x.1) p. 48 | 49 | Definition projT2_eq {A} {P: A -> Type} {u v: { a: A &T P a }} (p: u = v): 50 | rew projT1_eq p in u.2 = v.2 := rew dependent p in eq_refl. 51 | 52 | Notation "(= u ; v )" := (eq_existT_curried u v) 53 | (at level 0, format "(= u ; '/ ' v )"). 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bonak ![logo](assets/bonak.png) 2 | 3 | Bonak is an active hobby-research project around formalizing simplicial and cubical sets in [Rocq](https://rocq-prover.org) as a particular case of iterated parametricity translation. The project started when Hugo met Ram in late 2019, and they continue to meet online weekly to continue this line of research. 4 | 5 | The name _bonak_ comes from an imaginary monster in Daisy Johnson's novel [Everything Under](https://thebookerprizes.com/the-booker-library/books/everything-under), which was shortlisted for the Booker Prize in 2018. It happens to be an exciting read, and Ram had read the book at around the time this project started. 6 | 7 | Some features of this project: 8 | 9 | 1. We do not make use of [HoTT](https://github.com/HoTT/HoTT), or any fancy libraries for that matter. Bonak is written is vanilla Rocq, making use of the core standard library. In particular, we make use of [SProp](https://rocq-prover.org/doc/master/refman/addendum/sprop.html) for definitional proof irrelevance. 10 | 2. Bonak has led to many bugs being filed and fixed in core Rocq. It pushes the boundaries of proof assistant technology, and can serve as a benchmark against which to improve core Rocq features. Rocq 9.0 is required to build the current version. 11 | 3. As the main contribution of Bonak is the Rocq code, we have placed high emphasis on code cleanliness and readability. 12 | 4. Bonak is tiny! In ~800 lines of Rocq code, we have managed to prove something remarkable. 13 | 14 | ## Axioms 15 | 16 | ```coq 17 | Axioms: 18 | functional_extensionality_dep 19 | : forall (A : Type) (B : A -> Type) (f g : forall x : A, B x), 20 | (forall x : A, f x = g x) -> f = g 21 | ``` 22 | 23 | Our approach is generic over the arity of the parametricity translation: we use functional extensionality for this, but it can, in principle, be done without this axiom for any fixed finite arity. 24 | 25 | ## Current status 26 | 27 | The first paper describing our initial work can be found at [arXiv:2401.00512](https://arxiv.org/abs/2401.00512) (pre-print) or [10.1017/S096012952500009X](https://doi.org/10.1017/S096012952500009X) (published version), and the corresponding code can be found under the tag [hr25](https://github.com/artagnon/bonak/tree/962647e33cfe653eaac989bae16817b42dab3280). 28 | 29 | `master` and other branches contain work-in-progress for future publications. 30 | -------------------------------------------------------------------------------- /paper/tab-coh-ett.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\lab}{fulltab:coh} 2 | \begin{eqntable}{Commutation of $q$-th projection and $r$-th projection, or coherence conditions\label{\lab}} 3 | \eqnline{\cohf[m][\epsilon][\omega][q][r][n][p][r \leq q \leq n-p]}{\makecell{\eqnarg{cohframe}{D}{\Xto{m}{n+2}} \\ \eqnarg{cohframe}{d}{\framep[m][n+2][p][][D=\D]}}}{:}{\makecell{\restrf[m][\epsilon][q][n][p][][D=\hdD, d={\restrf[m][\omega][r][n+1][p][][D=\D, d=\d]}] \\ = \restrf[m][\omega][r][n][p][][D=\hdD, d={\restrf[m][\epsilon][q+1][n+1][p][][D=\D, d=\d]}]}} 4 | \eqnline{\cohf[m][\epsilon][\omega][q][r][n][0]}{\D~\unitpoint}{\defeq}{\refl(\unitpoint)} 5 | \eqnline{\cohf[m][\epsilon][\omega][q][r][n][p+1]}{\D~(\pair{\d}{\l})}{\defeq}{(\cohf[m][\epsilon][\omega][q+1][r+1][n][p][][D=\D, d=\d], \cohl[m][\epsilon][\omega][q+1][r+1][n-1][p][][D=\D, d=\d, l=\l])} 6 | \graymidrule 7 | 8 | \eqnline{\cohl[m][\epsilon][\omega][q][r][n][p][r \leq q \leq n-p]}{\makecell{\eqnarg{cohlayer}{D}{\Xto{m}{n+3}} \\ \eqnarg{cohlayer}{d}{\framep[m][n+3][p][][D=\D]} \\ \eqnarg{cohlayer}{l}{\layer[m][n+2][p][][D=\D, d=\d]}}}{:}{\makecell{\restrl[m][\epsilon][q][n][p][][D=\hdD, d={\restrf[m][\omega][r][n+1][p][][D=\D, d=\d]}](\restrl[m][\omega][r][n+1][p][][D=\D, d=\d, l=\l]) \\ = \restrl[m][\omega][r][n][p][][D=\hdD, d={\restrf[m][\epsilon][q+1][n+1][p][][D=\D, d=\d]}, l={\restrl[m][\epsilon][q+1][n+1][p][][D=\D, d=\d, l=\l]}]}} 9 | \eqnline{\cohl[m][\epsilon][\omega][q][r][n][p]}{\D~\d~\l}{\defeq}{\makecell{\lambda \theta .\;\cohp[m][\epsilon][\omega][q][r][n][p][][E=\tlD, c=\l_\theta]}} 10 | \graymidrule 11 | 12 | \eqnline{\cohp[m][\epsilon][\omega][q][r][n][p][r \leq q \leq n-p]}{\makecell{\eqnarg{cohpainting}{D}{\Xto{m}{n+2}} \\ \eqnarg{cohpainting}{E}{\Xcomp{m}{n+2}[D=\D]} \\ \eqnarg{cohpainting}{d}{\framep[m][n+2][p][][D=\D]} \\ \eqnarg{cohpainting}{c}{\painting[m][n+2][p][][D=\D, E=\E, d=\d]}}}{:}{\makecell{\restrp[m][\epsilon][q][n][p][][D=\hdD, E=\tlD, d={\restrf[m][\omega][r][n+1][p][][D=\D, d=\d]}, c={\restrp[m][\omega][r][n+1][p][][D=\D, E=\E, d=\d, c=\c]}] \\ = \restrp[m][\omega][r][n][p][][D=\hdD, E=\tlD, D={\restrf[m][\epsilon][q+1][n+1][p][][D=\D, d=\d]}, c={\restrp[m][\epsilon][q+1][n+1][p][][D=\D, E=\E, d=\d, c=\c]}]}} 13 | \eqnline{\cohp[m][\epsilon][\omega][q][0][n][p][]}{\D~\E~\d~(\pair{\l}{\_})}{\defeq}{\refl(\restrp[m][\epsilon][q][n][p][][D=\hdD, E=\tlD, d={\restrf[m][\omega][0][n][p][][D=\D, d=\d]}, c={\l_\epsilon}])} 14 | \eqnline{\cohp[m][\epsilon][\omega][q+1][r+1][n][p][p Type; 17 | UIP {x y: Dom} {h g: x = y}: h = g; 18 | }. 19 | 20 | (** [unit] seen as an [HSet] *) 21 | 22 | Lemma unit_UIP (x y: unit) (h g: x = y): h = g. 23 | Proof. 24 | destruct g, x; now apply UIP_refl_unit. 25 | Qed. 26 | 27 | Lemma bool_UIP (x y: bool) (h g: x = y): h = g. 28 | Proof. 29 | destruct g, x; now apply UIP_refl_bool. 30 | Qed. 31 | 32 | Definition hunit@{m}: HSet@{m} := {| 33 | Dom := unit; 34 | UIP := unit_UIP; 35 | |}. 36 | 37 | Definition hbool@{m}: HSet@{m} := {| 38 | Dom := bool; 39 | UIP := bool_UIP; 40 | |}. 41 | 42 | (** [sigT] seen as a type constructor on [HSet] *) 43 | 44 | Lemma sigT_eq {A: Type} {B} {x y: {a: A &T B a}}: 45 | (x.1; x.2) = (y.1; y.2) -> x = y. 46 | Proof. 47 | now easy. 48 | Qed. 49 | 50 | Lemma sigT_decompose_eq {A: Type} {B} {x y: {a: A &T B a}} {p: x = y}: 51 | p = (= projT1_eq p; projT2_eq p). 52 | Proof. 53 | now destruct p, x. 54 | Qed. 55 | 56 | Lemma sigT_decompose {A: Type} {B: A -> Type} {u v: {a: A &T B a}} {p q: u = v} 57 | {alpha: projT1_eq p = projT1_eq q} 58 | {beta: rew [fun r => rew [fun b: A => B b] r in u.2 = v.2] alpha in 59 | projT2_eq p = projT2_eq q}: p = q. 60 | Proof. 61 | rewrite (sigT_decompose_eq (p := q)), (sigT_decompose_eq (p := p)). 62 | destruct u, v; simpl. now destruct beta, alpha. 63 | Qed. 64 | 65 | Lemma sigT_UIP {A: HSet} {B: A -> HSet} (x y: {a: A &T B a}) (p q: x = y): 66 | p = q. 67 | Proof. 68 | unshelve eapply sigT_decompose. now apply A. now apply (B y.1). 69 | Qed. 70 | 71 | Definition hsigT {A: HSet} (B: A -> HSet): HSet := {| 72 | Dom := {a: A &T B a}; 73 | UIP := sigT_UIP; 74 | |}. 75 | 76 | Set Warnings "-notation-overridden". 77 | 78 | Notation "{ x & P }" := (hsigT (fun x => P%type)): type_scope. 79 | Notation "{ x : A & P }" := (hsigT (A := A) (fun x => P%type)): type_scope. 80 | 81 | (** [forall] defined over an [HSet] codomain *) 82 | 83 | Lemma hpiT_decompose {A: Type} (B: A -> HSet) 84 | (f g: forall a: A, B a) (p: f = g): 85 | functional_extensionality_dep_good _ _ 86 | (fun x => f_equal (fun H => H x) p) = p. 87 | Proof. 88 | destruct p; now apply functional_extensionality_dep_good_refl. 89 | Qed. 90 | 91 | Definition hpiT_UIP {A: Type} (B: A -> HSet) (f g: forall a: A, B a) 92 | (p q: f = g): p = q. 93 | Proof. 94 | rewrite <- hpiT_decompose with (p := p), 95 | <- hpiT_decompose with (p := q). 96 | f_equal. 97 | apply functional_extensionality_dep_good; intro a. now apply (B a). 98 | Qed. 99 | 100 | Definition hpiT {A: Type} (B: A -> HSet): HSet. 101 | Proof. 102 | exists (forall a: A, B a). now apply hpiT_UIP. 103 | Defined. 104 | 105 | Notation "'hforall' x .. y , P" := 106 | (hpiT (fun x => .. (hpiT (fun y => P%type)) ..)) 107 | (at level 10, x binder, y binder, P at level 200, 108 | format "'[ ' '[ ' 'hforall' x .. y ']' , '/' P ']'"): type_scope. 109 | -------------------------------------------------------------------------------- /theories/νSet/LeYoneda.v: -------------------------------------------------------------------------------- 1 | (** Two definitions of "less than or equal" in SProp: 2 | - Recursive definition 3 | - "Yoneda trick" *) 4 | 5 | From Bonak Require Import Notation. 6 | From Stdlib Require Import Logic.StrictProp. 7 | 8 | Set Warnings "-notation-overridden". 9 | 10 | (** False and True in SProp *) 11 | Inductive SFalse: SProp :=. 12 | Inductive STrue: SProp := sI. 13 | 14 | (** A recursive definition of le *) 15 | Fixpoint leR (n m: nat): SProp := 16 | match n, m with 17 | | O, _ => STrue 18 | | S n, O => SFalse 19 | | S n, S m => leR n m 20 | end. 21 | 22 | Lemma leR_refl {n}: leR n n. 23 | Proof. 24 | now induction n. 25 | Qed. 26 | 27 | (** A Yoneda-style encoding of the recursive definition of le *) 28 | Class leY n m := le_intro: forall p, leR p n -> leR p m. 29 | Infix "<=" := leY: nat_scope. 30 | 31 | (* Equality in SProp is =S *) 32 | Inductive eqsprop {A: SProp} (x: A): A -> Prop := eqsprop_refl: eqsprop x x. 33 | Infix "=S" := eqsprop (at level 70): type_scope. 34 | 35 | Theorem leY_irrelevance: forall {n m} (H H': n <= m), H =S H'. 36 | now reflexivity. 37 | Qed. 38 | 39 | (** A simple contraction used in the next lemma *) 40 | Lemma leR_O_contra {n}: leR n.+1 O -> SFalse. 41 | now auto. 42 | Qed. 43 | 44 | Lemma leY_O {n}: O <= n. 45 | unfold "<=". intros p. destruct p. now auto. now auto. 46 | Qed. 47 | 48 | (** Contradiction of type n.+1 <= 0 *) 49 | Theorem leY_O_contra {n}: n.+1 <= O -> False. 50 | intros. cut SFalse. intro Hn; elim Hn. unfold leY in H. 51 | specialize H with (p := 1); eapply leR_O_contra. 52 | apply H; clear H. now auto. 53 | Qed. 54 | 55 | (** Reflexivity in leY *) 56 | Definition leY_refl n: n <= n := 57 | fun _ x => x. (* Coq bug! *) 58 | 59 | Notation "♢" := leY_refl (at level 0). 60 | 61 | (** Transitivity in leY *) 62 | Definition leY_trans {n m p} (Hnm: n <= m) (Hmp: m <= p): n <= p := 63 | fun q (Hqn: leR q n) => Hmp _ (Hnm _ Hqn). 64 | 65 | Infix "↕" := leY_trans (at level 45). 66 | 67 | (** Some trivial inequality proofs in leYoneda *) 68 | 69 | Lemma leR_up {n m} (Hnm: leR n m): leR n m.+1. 70 | revert m Hnm. induction n. now auto. destruct m. intros H. 71 | now apply leR_O_contra in H. now apply IHn. 72 | Qed. 73 | 74 | Lemma leY_up {n m} (Hnm: n <= m): n <= m.+1. 75 | unfold "<=" in *. intros p Hpn. now apply leR_up, Hnm, Hpn. 76 | Qed. 77 | 78 | Notation "↑ h" := (leY_up h) (at level 40). 79 | 80 | Lemma leR_down {n m} (Hnm: leR n.+1 m): leR n m. 81 | revert m Hnm. induction n. now auto. destruct m. intros H. 82 | now apply leR_O_contra in H. now apply IHn. 83 | Qed. 84 | 85 | Lemma leY_down {n m} (Hnm: n.+1 <= m): n <= m. 86 | unfold "<=" in *. intros p Hpn. now apply leR_down, Hnm. 87 | Qed. 88 | 89 | Notation "↓ p" := (leY_down p) (at level 40). 90 | 91 | Lemma leR_lower_both {n m} (Hnm: leR n.+1 m.+1): leR n m. 92 | now auto. 93 | Qed. 94 | 95 | Lemma leY_lower_both {n m} (Hnm: n.+1 <= m.+1): n <= m. 96 | unfold "<=" in *. intros p Hpn. now apply leR_lower_both, Hnm. 97 | Qed. 98 | 99 | Notation "⇓ p" := (leY_lower_both p) (at level 40). 100 | 101 | Lemma leR_raise_both {n m} (Hnm: leR n m): leR n.+1 m.+1. 102 | now auto. 103 | Qed. 104 | 105 | Lemma leY_raise_both {n m} (Hnm: n <= m): n.+1 <= m.+1. 106 | unfold "<=" in *. intros p Hpn. destruct p. now auto. 107 | now apply leR_raise_both, Hnm. 108 | Qed. 109 | 110 | Notation "⇑ p" := (leY_raise_both p) (at level 40). 111 | -------------------------------------------------------------------------------- /.vscode/ltex.hiddenFalsePositives.en-US.txt: -------------------------------------------------------------------------------- 1 | {"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\QTechnically speaking, we use some axioms related to functional extensionality, but the requirement arises only from our generalization to \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q-types; if \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q is finite (say, unit type corresponding to augmented semi-simplicial types), this requirement vanishes.\\E$"} 2 | {"rule":"WHITESPACE_RULE","sentence":"^\\QThe accompanying artifact is an axiom-less  Coq formalization that uses sophisticated rewriting techniques and pushes the boundaries of proof assistant technology.\\E$"} 3 | {"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\QThe accompanying artifact is an axiom-less  Coq formalization that uses sophisticated rewriting techniques and pushes the boundaries of proof assistant technology.\\E$"} 4 | {"rule":"COMMA_PARENTHESIS_WHITESPACE","sentence":"^\\QJust as in , we define semi-cubical sets as the functor category:\\E$"} 5 | {"rule":"UPPERCASE_SENTENCE_START","sentence":"^\\Qorder-preserving.\\E$"} 6 | {"rule":"NON_STANDARD_WORD","sentence":"^\\Q.m m m m.#1 #2 #3 #4 .\\E$"} 7 | {"rule":"DOUBLE_PUNCTUATION","sentence":"^\\QWe have modelled the core of semi-cubical sets in a way that naturally generalizes to augmented semi-simplicial sets in type theory, and we call our generalization \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q-sets..\\E$"} 8 | {"rule":"DOUBLE_PUNCTUATION","sentence":"^\\QarXiv preprint arXiv:1611.02108..\\E$"} 9 | {"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\QAnnali di Matematica pura ed applicata, 178.(1), 317-324.\\E$"} 10 | {"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\Q[CubSet]Antolini00.\\E$"} 11 | {"rule":"DOUBLE_PUNCTUATION","sentence":"^\\QUnpublished expository article available online from the author's web page..\\E$"} 12 | {"rule":"EN_DIACRITICS_REPLACE","sentence":"^\\QInstitut de Recherche en Informatique Fondamentale.\\E$"} 13 | {"rule":"WHITESPACE_RULE","sentence":"^\\Q[m][][][q][r][n][p][p r q n - 2] cohfiller D m n cohfiller E m n[D=] cohfiller d [m][n][p][][D=] cohfiller c [m][n][p][][D=, E=, d=] : [m][][][q][r][n][p][][D=, d=]([m][][q][n-1][p][][D=, E=, d=[m][][r][n][p][][D=, d=], c=[m][][r][n][p][][D=, E=, d=, c=]]) [m][][r][n-1][p][][D=, E=, D=[m][][q+1][n][p][][D=, d=], c=[m][][q+1][n][p][][D=, E=, d=, c=]] [m][][][q][r][n][p][p=r] (ł ) ([m][][q-1][n-1][p][][D=, E=, d=[m][][p][n][p][][D=, d=], c=ł_]) [m][][][q][r][n][p][p 2 | 3 | 4 | 19 | 38 | 40 | 48 | 53 | 54 | 62 | 67 | 68 | 76 | 81 | 82 | 90 | 95 | 96 | 104 | 109 | 110 | 118 | 123 | 124 | 132 | 137 | 138 | 146 | 151 | 152 | 153 | 158 | 162 | 166 | 170 | 174 | 178 | 182 | 186 | 190 | 194 | 198 | 202 | 204 | 207 | 210 | 215 | 220 | 224 | 229 | 230 | 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /paper/restruct.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,english,cleveref,autoref,thm-restate]{article} 2 | 3 | \usepackage[utf8x]{inputenc} 4 | \usepackage{t1enc} 5 | 6 | \usepackage{hyperref} 7 | %\usepackage{proof} 8 | \usepackage{fullpage} 9 | \usepackage{amssymb} 10 | \usepackage{stmaryrd} 11 | %\usepackage{txfonts} 12 | \usepackage{url} 13 | 14 | \usepackage{xcolor} 15 | %\usepackage{textcomp} 16 | \usepackage{amsmath} 17 | \usepackage{graphicx} 18 | \usepackage{yfonts} 19 | 20 | \newcommand{\Overrightarrow}[2]{\raisebox{#1}{$\ext@arrow 0359\Rightarrowfill@{\mbox{${#2}$}}{}$}} 21 | \newcommand{\Overleftarrow}[2]{\raisebox{#1}{$\ext@arrow 0359\Leftarrowfill@{\mbox{${#2}$}}{}$}} 22 | %\newcommand{\Overrightarrow}[1]{\raisebox{1.4ex}{$\ext@arrow 0359\Rightarrowfill@{\mbox{${#1}$}}{}$}} 23 | \makeatother 24 | 25 | \newcommand{\rocq}[1]{(\mbox{\texttt{#1}})} 26 | \newcommand{\highlight}[1]{\emph{#1}} 27 | 28 | \newcommand{\imp}{\rightarrow} 29 | \newcommand{\Type}{\mathsf{Type}} 30 | \newcommand{\Set}{\mathsf{Set}} 31 | \newcommand{\Prop}{\mathsf{Prop}} 32 | \newcommand{\refl}[1]{\mathsf{refl}\,{#1}} 33 | \newcommand{\mkmlidtype}[3]{{#1} =^{\mathrm{id}}_{#2} {#3}} 34 | \newcommand{\mkmleqdep}[3]{{#1} =^{\mathrm{dep}}_{#2} {#3}} 35 | \newcommand{\hrefl}[1]{\mathsf{refl^{\mathrm{dep}}}\,{#1}} 36 | \newcommand{\mluniv}{\mathsf{U}} 37 | \newcommand{\Jdep}[2]{\mathsf{J}\;{#1}\;{#2}} 38 | \newcommand{\unittype}{\ensuremath{\mathsf{unit}}} 39 | \newcommand{\unitpoint}{\ensuremath{\ast}} 40 | 41 | \newcommand{\nth}[1]{{#1}^{\mbox{\scriptsize th}}} 42 | \newcommand{\defeq}{\triangleq} 43 | 44 | \begin{document} 45 | 46 | \section{Structure built by induction on the dimension} 47 | 48 | \begin{tiny} 49 | %\rotatebox{90} 50 | {$ 51 | \begin{array}{|l|} 52 | \hline 53 | \!\!\!\colorbox{yellow}{$ 54 | \!\!\! 55 | \begin{array}{l} 56 | frame^{n,p\leq n}:\Type\\ 57 | painting^{n,p\leq n}:\Type\\ 58 | \end{array} 59 | $}\\ 60 | \!\!\!\colorbox{green}{$ 61 | \!\!\! 62 | \begin{array}[t]{l} 63 | \colorbox{lime}{$restrFrameTypes^{n+1,p\leq n+1}:\Type$} \rocq{mkRestrFrameTypes}\\ 64 | \quad restrFrameTypes^{n+1,0}\defeq \unittype\\ 65 | \quad restrFrameTypes^{n+1,p+1}\defeq \Sigma R:restrFrameTypes^{n+1,p}.(\Pi p\leq q\leq n.\Pi \epsilon. depFrame^{n+1,p}(R)\rightarrow frame^{n,p})\\ 66 | \colorbox{lime}{$depFrame^{n+1,p\leq n+1}(R:restrFrameTypes^{n+1,p\leq n+1}) : \Type$} \rocq{mkFrameOfRestrFrames}\\ 67 | \quad depFrame^{n+1,0}(R) \defeq \unittype\\ 68 | \quad depFrame^{n+1,p+1}(R) \defeq \Sigma d:depFrame^{n+1,p}(R.1).(\Pi \epsilon. painting^{n,p}(R.2(d))) \imp \Type)\\ 69 | \end{array} 70 | $}\!\!\!\\ 71 | \hline 72 | \!\!\!\colorbox{yellow}{$ 73 | \!\!\! 74 | \begin{array}[t]{l} 75 | fullRestrFrames^{n+1}:restrFrameTypes^{n+1,n+1}\\ 76 | \end{array} 77 | $}\\ 78 | \!\!\!\colorbox{green}{$ 79 | \!\!\! 80 | \begin{array}{l} 81 | \colorbox{lime}{$restrFrames^{n+1,p\leq n+1}:restrFrameTypes^{n+1,p}$} \rocq{mkRestrFramesFromFull}\\ 82 | \quad restrFrames^{n+1,p}\defeq \downarrow_p fullRestrFrames^{n+1}\\ 83 | \colorbox{lime}{$frame^{n+1,p\leq n+1}:\Type$} \rocq{mkFrame}\\ 84 | \quad frame^{n+1,p}\defeq depFrame^{n+1,p}(restrFrames^{n+1,p})\\ 85 | \colorbox{lime}{$restrFrame^{n+1,p\leq q\leq n}_{\epsilon} : \Pi p\leq q\leq n.\Pi \epsilon. frame^{n+1,p}\rightarrow frame^{n,p}$} \rocq{mkRestrFrame}\\ 86 | \quad restrFrame^{n+1,p,q}_{\epsilon}\defeq restrFrames^{n+1,p\leq n}.2[q,\epsilon]\\ 87 | \colorbox{cyan}{$painting^{n+1,p\leq n+1}(E:frame^{n+1,n+1}\rightarrow \Type)(d:frame^{n+1,p\leq n+1}) :\Type$} \rocq{mkPainting}\\ 88 | \quad painting^{n+1,n+1}(E)(d)\defeq E(d)\\ 89 | \quad painting^{n+1,p}(E)(d)\defeq \Sigma l:(\Pi \epsilon. painting^{n,p}(restrFrame^{n+1,p,p}_{\epsilon}(d))).painting^{n+1,p+1}(E)(d,l)\\ 90 | \end{array} 91 | $}\!\!\!\\ 92 | \hline 93 | \!\!\!\colorbox{yellow}{$ 94 | \!\!\! 95 | \begin{array}{l} 96 | restrPainting^{n+1,p\leq q \leq n}_\epsilon(E:frame^{n+1,n+1}\rightarrow \Type)(d:frame^{n+1,p})(c:painting^{n+1,p}(E)(d)): painting^{n,p}(restrFrame^{n+1,p,q}_{\epsilon}(d))\\ 97 | \end{array} 98 | $}\!\!\!\\ 99 | \!\!\!\colorbox{green}{$ 100 | \!\!\! 101 | \begin{array}[t]{l} 102 | \colorbox{lime}{$restrFrameTypes^{n+2,p\leq n+2}:\Type$} \rocq{mkRestrFramesFromFull}\\ 103 | \quad restrFrameTypes^{n+2,0}\defeq \unittype\\ 104 | \quad restrFrameTypes^{n+2,p+1}\defeq \Sigma R:restrFrameTypes^{n+2,p}.(\Pi p\leq q\leq n.\Pi \epsilon. depFrame^{n+2,p}(R)\rightarrow frame^{n+1,p})\\ 105 | \colorbox{lime}{$depFrame^{n+2,p\leq n+2}(R:restrFrameTypes^{n+2,p\leq n+2}) : \Type$} \rocq{mkFrameOfRestrFrames}\\ 106 | \quad depFrame^{n+2,0}(R) \defeq \unittype\\ 107 | \quad depFrame^{n+2,p+1}(R) \defeq \Sigma d:depFrame^{n+2,p}(R.1).(\Pi \epsilon. painting^{n+1,p}(R.2(d))) \imp \Type)\\ 108 | \end{array} 109 | $}\!\!\!\\ 110 | \!\!\!\colorbox{green}{$ 111 | \!\!\! 112 | \begin{array}{l} 113 | \colorbox{lime}{$cohFrameTypes^{n+2,p\leq n+1}:\Type$}\\ 114 | \quad cohFrameTypes^{n+2,0}\defeq \unittype\\ 115 | \quad cohFrameTypes^{n+2,p+1}\defeq 116 | \Sigma C:cohFrameTypes^{n+2,p}.\, 117 | \Pi p \leq r \leq q \leq n.\, \Pi \epsilon \omega.\, \Pi d:depFrame^{n+2,p}(depRestrFrames^{n+2,p}(C)).\,\\ 118 | \qquad restrFrame^{n+1,p,q}_{\epsilon} (depRestrFrames^{n+2,p}(C).2[r,\omega](d)) = 119 | restrFrame^{n+1,p,r}_{\omega} (depRestrFrames^{n+2,p}(C).2[q+1,\epsilon](d))\\ 120 | \colorbox{lime}{$depRestrFrames^{n+2,p\leq n+1}(C:cohFrameTypes^{n+2,p\leq n+1}):restrFrameTypes^{n+2,p}$}\\ 121 | \quad depRestrFrames^{n+2,0}(C)\defeq (\unitpoint,\lambda q\epsilon d.\,\unitpoint)\\ 122 | \quad depRestrFrames^{n+2,p+1}(C)\defeq (depRestrFrames^{n+2,p}(C.1), 123 | \lambda q\epsilon (d,l).\,(depRestrFrames^{n+2,p}(C.1).2[q+1,\epsilon](d),\lambda \omega.\,\overrightarrow{C.2[p,q,\epsilon,\omega](d)}(restrPainting^{n+1,p}_{\epsilon}(l)))\\ 124 | \end{array} 125 | $}\!\!\!\\ 126 | \hline 127 | \!\!\!\colorbox{yellow}{$ 128 | \!\!\! 129 | \begin{array}{l} 130 | fullCohFrames^{n+2}:cohFrameTypes^{n+2,n+1}\\ 131 | \end{array} 132 | $}\\ 133 | \!\!\!\colorbox{green}{$ 134 | \!\!\! 135 | \begin{array}{l} 136 | \colorbox{lime}{$fullRestrFrames^{n+2}:restrFrameTypes^{n+2,n+2}$} \rocq{mkFullRestrFrames}\\ 137 | \quad fullRestrFrames^{n+2}\defeq depRestrFrames^{n+2,n+1}(fullCohFrames^{n+2})\\ 138 | \colorbox{lime}{$restrFrames^{n+2,p\leq n+1}:restrFrameTypes^{n+2,p}$} \rocq{RestrFrames}\\ 139 | \quad restrFrames^{n+2,p}\defeq \downarrow_p (depRestrFrames^{n+2,n+1}(fullCohFrames^{n+2}))\\ 140 | \colorbox{lime}{$restrFrames_{aux}^{n+2,p\leq n+1}:restrFrameTypes^{n+2,p}$} \rocq{RestrFrames2}\\ 141 | \quad restrFrames_{aux}^{n+2}\defeq depRestrFrames^{n+2,p}(\downarrow_p fullCohFrames^{n+2})\\ 142 | \colorbox{pink}{$eqRestrFrames^{n+2,p\leq n+1}:restrFrame^{n+2,p\leq n+1}=restrFrame_{aux}^{n+2,p\leq n+1}$}\rocq{eqRestrFramesDef}\\ 143 | \quad eqRestrFrames^{n+2,n+1}\defeq ...\\ 144 | \quad eqRestrFrames^{n+2,p}\defeq ...eqRestrFrames^{n+2,p+1}...\\ 145 | \colorbox{lime}{$frame^{n+2,p\leq n+2}:\Type$}\rocq{Frame}\\ 146 | \quad frame^{n+2,p\leq n+2}\defeq depFrame^{n+2,p}(restrFrames^{n+2,p})\\ 147 | \colorbox{lime}{$frame_{aux}^{n+2,p\leq n+2}:\Type$}\rocq{Frame2}\\ 148 | \quad frame^{n+2,p\leq n+2}\defeq depFrame^{n+2,p}(restrFrames_{aux}^{n+2,p})\\ 149 | \colorbox{pink}{$eqFrame^{n+2,p\leq n+2}:frame^{n+2,p\leq n+2}=frame_{aux}^{n+2,p\leq n+2}$}\rocq{eqFrameDef}\\ 150 | \quad eqFrame^{n+2,n+2}\defeq refl\\ 151 | \quad eqFrame^{n+2,p}\defeq ap(depFrame^{n+2,p})(eqRestrFrames^{n+2,p})\\ 152 | \colorbox{lime}{$restrFrame^{n+2,p\leq q\leq n+1}_{\epsilon} : \Pi p\leq q\leq n+1.\Pi \epsilon. frame^{n+2,p}\rightarrow frame^{n+1,p}$} \rocq{mkRestrFrame}\\ 153 | \quad restrFrame^{n+2,p,q}_{\epsilon}\defeq restrFrames^{n+2,p\leq n+1}.2[q,\epsilon]\\ 154 | \colorbox{lime}{$restrFrame_{aux,\epsilon}^{n+2,p\leq q\leq n+1} : \Pi p\leq q\leq n+1.\Pi \epsilon. frame_{aux}^{n+2,p}\rightarrow frame^{n+1,p}$} \rocq{mkRestrFrame2}\\ 155 | \quad restrFrame_{aux,\epsilon}^{n+2,p,q}\defeq restrFrames_{aux}^{n+2,p\leq n+1}.2[q,\epsilon]\\ 156 | \colorbox{pink}{$eqRestrFrame_{\epsilon}^{n+2,p\leq q\leq n+1}:\Pi d.restrFrame_{\epsilon}^{n+2,p\leq q\leq n+1}(d)=restrFrame_{aux,\epsilon}^{n+2,p\leq q\leq n+1}(\overrightarrow{eqFrame^{n+2,p}(d)})$}\rocq{eqRestrFrameDef}\\ 157 | \quad eqRestrFrame_{\epsilon}^{n+2,p\leq q\leq n+1}\defeq eqRestrFrames^{n+2,p}.2[q,\epsilon]\quad (to~check)\\ 158 | \colorbox{lime}{$cohFrame^{n+2,p\leq r\leq q\leq n}_{\epsilon,\omega} : \Pi d:Frame^{n+2,p}.\, 159 | restrFrame^{n+1,p,q}_{\epsilon} (restrFrame^{n+2,p,r}_\omega(d)) = 160 | restrFrame^{n+1,p,r}_{\omega} (restrFrame^{n+2,p,q+1}_\epsilon(d))$} \rocq{CohFrame}\\ 161 | \quad cohFrame^{n+2,p,r,q}_{\epsilon,\omega}\defeq \lambda d.\overrightarrow{eqRestrFrame}(\overrightarrow{eqRestrFrame}(\downarrow_p fullCohFrames^{n+2}).2[r,q,\epsilon,\omega](\overrightarrow{eqFrame}(d)))\\ 162 | \colorbox{cyan}{$painting^{n+2,p\leq n+2}(E':frame^{n+1,n+1}\rightarrow \Type)(E:frame^{n+2,n+2}\rightarrow \Type)(d:frame^{n+2,p\leq n+2}):\Type$} \rocq{Painting}\\ 163 | \quad painting^{n+2,n+2}(E')(E)(d)\defeq E(d)\\ 164 | \quad painting^{n+2,p}(E')(E)(d)\defeq \Sigma l:(\Pi \epsilon. painting^{n+1,p}(E')(restrFrame^{n+2,p,p}_{\epsilon}(d))).painting^{n+2,p+1}(E')(E)(d,l) \\ 165 | \colorbox{cyan}{$restrPainting^{n+2,p\leq q\leq n+1}_{\epsilon}(E')(E:frame^{n+2,n+2}\rightarrow \Type)(d:frame^{n+2,p})(c:painting^{n+2,p}(E')(E)(d)): painting^{n+1,p}(E')(restrFrame_{\epsilon}^{n+2,p}(d))$}\\ 166 | \quad restrPainting^{n+2,n+2}_{\epsilon}(E')(E)(d)(l,c)\defeq l_{\epsilon}\\ 167 | \quad restrPainting^{n+2,p}_{\epsilon}(E')(E)(d)(l,c)\defeq (\lambda \omega.\,\overrightarrow{cohFrame_{\epsilon,\omega}^{n+2,p,q}(d)}(restrPainting^{n+1,p}_{\epsilon}(E')(l))),restrPainting^{n+2,p+1}_{\epsilon}(E')(E)(d,l)(c))\\ 168 | \end{array} 169 | $}\!\!\!\\ 170 | \!\!\!\colorbox{yellow}{$ 171 | \!\!\! 172 | \begin{array}{l} 173 | cohPainting_{\epsilon,\omega}^{n+2,p\leq r\leq q\leq n}: \overrightarrow{cohFrame^{n+2,p,r,q}_{\epsilon\omega}(d)}(restrPainting^{n+1,p,q}_{\epsilon}(restrPainting^{n+2,p,r}_{\omega}(c))) = restrPainting^{n+1,p,r}_{\omega}(restrPainting^{n+2,p,q+1}_{\epsilon}(c))\\ 174 | \end{array} 175 | $}\\ 176 | \hline 177 | \end{array} 178 | $ 179 | } 180 | \end{tiny} 181 | 182 | \section{Base case} 183 | 184 | We need to fill the axiomatic part of the structure. 185 | 186 | \begin{tiny} 187 | %\rotatebox{90} 188 | {$ 189 | \begin{array}{|l|} 190 | \hline 191 | \!\!\!\colorbox{yellow}{$ 192 | \!\!\! 193 | \begin{array}{l} 194 | frame^{0,p\leq 0}:\Type\\ 195 | painting^{0,p\leq 1}:\Type\\ 196 | \end{array} 197 | $}\\ 198 | \hline 199 | \!\!\!\colorbox{yellow}{$ 200 | \!\!\! 201 | \begin{array}[t]{l} 202 | fullRestrFrames^{2}:restrFrameTypes^{2,2}\\ 203 | \end{array} 204 | $}\\ 205 | \hline 206 | \!\!\!\colorbox{yellow}{$ 207 | \!\!\! 208 | \begin{array}{l} 209 | restrPainting^{2,p\leq q \leq 0}_\epsilon(E:frame^{2,2}\rightarrow \Type)(d:frame^{2,p})(c:painting^{2,p}(E)(d)): painting^{0,p}(restrFrame^{2,p,q}_{\epsilon}(d))\\ 210 | \end{array} 211 | $}\!\!\!\\ 212 | \hline 213 | \!\!\!\colorbox{yellow}{$ 214 | \!\!\! 215 | \begin{array}{l} 216 | fullCohFrames^{3}:cohFrameTypes^{3,2}\\ 217 | \end{array} 218 | $}\\ 219 | \hline 220 | \!\!\!\colorbox{yellow}{$ 221 | \!\!\! 222 | \begin{array}{l} 223 | cohPainting_{\epsilon,\omega}^{3,p\leq r\leq q\leq 0}: \overrightarrow{cohFrame^{3,p,r,q}_{\epsilon\omega}(d)}(restrPainting^{2,p,q}_{\epsilon}(restrPainting^{3,p,r}_{\omega}(c))) = restrPainting^{2,p,r}_{\omega}(restrPainting^{3,p,q+1}_{\epsilon}(c))\\ 224 | \end{array} 225 | $}\\ 226 | \hline 227 | \end{array} 228 | $ 229 | } 230 | \end{tiny} 231 | 232 | \section{Successor case} 233 | 234 | We need to fill the axiomatic part of the structure at level $n+1$ 235 | assuming it is defined at level $n$. 236 | 237 | \begin{tiny} 238 | %\rotatebox{90} 239 | {$ 240 | \begin{array}{|l|} 241 | \hline 242 | \!\!\!\colorbox{yellow}{$ 243 | \!\!\! 244 | \begin{array}{l} 245 | frame^{n+1,p\leq n+1}:\Type\\ 246 | painting^{n+1,p\leq n+2}:\Type\\ 247 | \end{array} 248 | $}\\ 249 | \hline 250 | \!\!\!\colorbox{yellow}{$ 251 | \!\!\! 252 | \begin{array}[t]{l} 253 | fullRestrFrames^{n+2}:restrFrameTypes^{n+2,n+2}\\ 254 | \end{array} 255 | $}\\ 256 | \hline 257 | \!\!\!\colorbox{yellow}{$ 258 | \!\!\! 259 | \begin{array}{l} 260 | restrPainting^{n+2,p\leq q \leq n}_\epsilon(E:frame^{n+2,n+2}\rightarrow \Type)(d:frame^{n+2,p})(c:painting^{n+2,p}(E)(d)): painting^{n+1,p}(restrFrame^{n+2,p,q}_{\epsilon}(d))\\ 261 | \end{array} 262 | $}\!\!\!\\ 263 | \hline 264 | \!\!\!\colorbox{green}{$ 265 | \!\!\! 266 | \begin{array}{l} 267 | \colorbox{pink}{$fullCohFrames^{n+3}:cohFrameTypes^{n+3,n+2}$}\\ 268 | \quad fullCohFrames^{n+3}\defeq cohFramesTypes^{n+3,n+2} \\ 269 | \colorbox{pink}{$cohFrames^{n+3,p\leq n+1}:cohFrameTypes^{n+3,p}$}\\ 270 | \quad cohFrames^{n+3,0}\defeq \star\\ 271 | \quad cohFrames^{n+3,p+1}\defeq (cohFrames^{n+3,p},\lambda p \leq r \leq q \leq n.\, \lambda \epsilon \omega.\, \lambda(d,l).(cohFrames^{n+3,p}.2[r,q,\epsilon,\omega](d),...)) 272 | \end{array} 273 | $}\\ 274 | \hline 275 | \!\!\!\colorbox{yellow}{$ 276 | \!\!\! 277 | \begin{array}{l} 278 | cohPainting_{\epsilon,\omega}^{n+3,p\leq r\leq q\leq n}: \overrightarrow{cohFrame^{n+3,p,r,q}_{\epsilon\omega}(d)}(restrPainting^{n+2,p,q}_{\epsilon}(restrPainting^{n+3,p,r}_{\omega}(c))) = restrPainting^{n+2,p,r}_{\omega}(restrPainting^{n+3,p,q+1}_{\epsilon}(c))\\ 279 | \end{array} 280 | $}\\ 281 | \hline 282 | \end{array} 283 | $ 284 | } 285 | \end{tiny} 286 | 287 | \end{document} 288 | -------------------------------------------------------------------------------- /paper/paper.bib: -------------------------------------------------------------------------------- 1 | @inproceedings{reynolds83, 2 | author = {John C. Reynolds}, 3 | editor = {R. E. A. Mason}, 4 | title = {Types, Abstraction and Parametric Polymorphism}, 5 | booktitle = {Information Processing 83, Proceedings of the {IFIP} 9th World Computer Congress, Paris, France, September 19-23, 1983}, 6 | pages = {513--523}, 7 | publisher = {North-Holland/IFIP}, 8 | year = {1983}, 9 | timestamp = {Sun, 28 Jul 2019 17:03:41 +0200}, 10 | biburl = {https://dblp.org/rec/conf/ifip/Reynolds83.bib}, 11 | bibsource = {dblp computer science bibliography, https://dblp.org} 12 | } 13 | 14 | @article{johann17, 15 | author = {Patricia Johann and Kristina Sojakova}, 16 | title = {Cubical Categories for Higher-Dimensional Parametricity}, 17 | journal = {CoRR}, 18 | volume = {abs/1701.06244}, 19 | year = {2017}, 20 | url = {http://arxiv.org/abs/1701.06244}, 21 | eprinttype = {arXiv}, 22 | eprint = {1701.06244}, 23 | timestamp = {Mon, 13 Aug 2018 16:47:36 +0200}, 24 | biburl = {https://dblp.org/rec/journals/corr/JohannS17.bib}, 25 | bibsource = {dblp computer science bibliography, https://dblp.org} 26 | } 27 | 28 | @inproceedings{bernardy12, 29 | title = {A computational interpretation of parametricity}, 30 | author = {Bernardy, Jean-Philippe and Moulin, Guilhem}, 31 | booktitle = {2012 27th Annual IEEE Symposium on Logic in Computer Science}, 32 | pages = {135--144}, 33 | year = {2012}, 34 | organization = {IEEE} 35 | } 36 | 37 | @inproceedings{altenkirch15, 38 | author = {Thorsten Altenkirch and Ambrus Kaposi}, 39 | editor = {Tarmo Uustalu}, 40 | title = {Towards a Cubical Type Theory without an Interval}, 41 | booktitle = {21st International Conference on Types for Proofs and Programs, {TYPES} 2015, May 18-21, 2015, Tallinn, Estonia}, 42 | series = {LIPIcs}, 43 | volume = {69}, 44 | pages = {3:1--3:27}, 45 | publisher = {Schloss Dagstuhl - Leibniz-Zentrum f{\"{u}}r Informatik}, 46 | year = {2015}, 47 | url = {https://doi.org/10.4230/LIPIcs.TYPES.2015.3}, 48 | doi = {10.4230/LIPIcs.TYPES.2015.3}, 49 | timestamp = {Tue, 11 Feb 2020 15:52:14 +0100}, 50 | biburl = {https://dblp.org/rec/conf/types/AltenkirchK15.bib}, 51 | bibsource = {dblp computer science bibliography, https://dblp.org} 52 | } 53 | 54 | @phdthesis{moulin16, 55 | title = {Internalizing parametricity}, 56 | author = {Moulin, Guilhem}, 57 | year = {2016}, 58 | school = {Department of Computer Science and Engineering, Chalmers University of Technology} 59 | } 60 | 61 | @inproceedings{cchm, 62 | author = {Cyril Cohen and Thierry Coquand and Simon Huber and Anders M{\"{o}}rtberg}, 63 | editor = {Tarmo Uustalu}, 64 | title = {Cubical Type Theory: {A} Constructive Interpretation of the Univalence Axiom}, 65 | booktitle = {21st International Conference on Types for Proofs and Programs, {TYPES} 2015, May 18-21, 2015, Tallinn, Estonia}, 66 | series = {LIPIcs}, 67 | volume = {69}, 68 | pages = {5:1--5:34}, 69 | publisher = {Schloss Dagstuhl - Leibniz-Zentrum f{\"{u}}r Informatik}, 70 | year = {2015}, 71 | url = {https://doi.org/10.4230/LIPIcs.TYPES.2015.5}, 72 | doi = {10.4230/LIPIcs.TYPES.2015.5}, 73 | timestamp = {Tue, 11 Feb 2020 15:52:14 +0100}, 74 | biburl = {https://dblp.org/rec/conf/types/CohenCHM15.bib}, 75 | bibsource = {dblp computer science bibliography, https://dblp.org} 76 | } 77 | 78 | @article{fri08, 79 | title = {An elementary illustrated introduction to simplicial sets}, 80 | author = {Friedman, Greg}, 81 | journal = {arXiv preprint arXiv:0809.4221}, 82 | year = {2008}, 83 | url = {https://arxiv.org/abs/0809.4221v7} 84 | } 85 | 86 | @article{herbelin15, 87 | title = {A dependently-typed construction of semi-simplicial types}, 88 | author = {Herbelin, Hugo}, 89 | journal = {Mathematical Structures in Computer Science}, 90 | volume = {25}, 91 | number = {5}, 92 | pages = {1116--1131}, 93 | year = {2015}, 94 | publisher = {Cambridge University Press} 95 | } 96 | 97 | @book{hottbook, 98 | author = {{The Univalent Foundations Program}}, 99 | title = {Homotopy Type Theory: Univalent Foundations of Mathematics}, 100 | publisher = {Institute for Advanced Study}, 101 | year = {2013}, 102 | url = {https://homotopytypetheory.org/book/}, 103 | timestamp = {Fri, 06 Dec 2019 15:25:34 +0100}, 104 | biburl = {https://dblp.org/rec/books/daglib/0046165.bib}, 105 | bibsource = {dblp computer science bibliography, https://dblp.org} 106 | } 107 | 108 | @article{gilbert19, 109 | author = {Ga{\"{e}}tan Gilbert and 110 | Jesper Cockx and 111 | Matthieu Sozeau and 112 | Nicolas Tabareau}, 113 | title = {Definitional proof-irrelevance without {K}}, 114 | journal = {Proc. {ACM} Program. Lang.}, 115 | volume = {3}, 116 | number = {{POPL}}, 117 | pages = {3:1--3:28}, 118 | year = {2019}, 119 | url = {https://doi.org/10.1145/3290316}, 120 | doi = {10.1145/3290316}, 121 | timestamp = {Wed, 17 Feb 2021 08:54:00 +0100}, 122 | biburl = {https://dblp.org/rec/journals/pacmpl/GilbertCST19.bib}, 123 | bibsource = {dblp computer science bibliography, https://dblp.org} 124 | } 125 | 126 | @inproceedings{martinlof75, 127 | author = {Per Martin-L\"of}, 128 | title = {An Intuitionistic Theory of Types, Predicative Part}, 129 | booktitle = {Logic Colloquium}, 130 | editors = {H.E. Rose and J.C. Shepherdson}, 131 | publisher = {North Holland}, 132 | year = {1975}, 133 | pages = {73-118} 134 | } 135 | 136 | @book{martinlof84, 137 | author = {Per Martin{-}L{\"{o}}f}, 138 | title = {Intuitionistic type theory}, 139 | series = {Studies in proof theory}, 140 | volume = {1}, 141 | publisher = {Bibliopolis}, 142 | year = {1984}, 143 | isbn = {978-88-7088-228-5}, 144 | timestamp = {Thu, 19 Sep 2019 11:29:54 +0200}, 145 | biburl = {https://dblp.org/rec/books/daglib/0000395.bib}, 146 | bibsource = {dblp computer science bibliography, https://dblp.org} 147 | } 148 | 149 | @article{grandis03, 150 | title = {Cubical sets and their site}, 151 | author = {Grandis, Marco and Mauri, Luca}, 152 | journal = {Theory and Applications of Categories}, 153 | volume = {11}, 154 | pages = {185--211}, 155 | year = {2003}, 156 | publisher = {Mount Allison University, Department of Mathematics and Computer Science} 157 | } 158 | 159 | @inproceedings{buchholtz17, 160 | title = {Varieties of cubical sets}, 161 | author = {Buchholtz, Ulrik and Morehouse, Edward}, 162 | booktitle = {International Conference on Relational and Algebraic Methods in Computer Science}, 163 | pages = {77--92}, 164 | year = {2017}, 165 | organization = {Springer} 166 | } 167 | 168 | @inproceedings{moeneclaey21, 169 | author = {Hugo Moeneclaey}, 170 | title = {Parametricity and Semi-Cubical Types}, 171 | booktitle = {36th Annual {ACM/IEEE} Symposium on Logic in Computer Science, {LICS} 172 | 2021, Rome, Italy, June 29 - July 2, 2021}, 173 | pages = {1--11}, 174 | publisher = {{IEEE}}, 175 | year = {2021}, 176 | url = {https://doi.org/10.1109/LICS52264.2021.9470728}, 177 | doi = {10.1109/LICS52264.2021.9470728}, 178 | biburl = {https://dblp.org/rec/conf/lics/Moeneclaey21.bib}, 179 | bibsource = {dblp computer science bibliography, https://dblp.org} 180 | } 181 | 182 | @phdthesis{moeneclaey22phd, 183 | author = {Hugo Moeneclaey}, 184 | title = {Cubical models are cofreely parametric}, 185 | year = {2022}, 186 | school = {Universit\'e Paris Cit\'e} 187 | } 188 | 189 | @misc{voevodsky12, 190 | author = {Vladimir Voevodsky}, 191 | title = {Semi-simplicial types}, 192 | year = {2012}, 193 | month = {Nov}, 194 | note = {Briefly described in Section~8 of \cite{herbelin15}} 195 | } 196 | 197 | @inproceedings{cavallo19, 198 | author = {Evan Cavallo and Robert Harper}, 199 | title = {{Internal Parametricity for Cubical Type Theory}}, 200 | booktitle = {28th EACSL Annual Conference on Computer Science Logic (CSL 2020)}, 201 | pages = {13:1--13:17}, 202 | series = {Leibniz International Proceedings in Informatics (LIPIcs)}, 203 | isbn = {978-3-95977-132-0}, 204 | issn = {1868-8969}, 205 | year = {2020}, 206 | volume = {152}, 207 | editor = {Maribel Fern{\'a}ndez and Anca Muscholl}, 208 | publisher = {Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik}, 209 | address = {Dagstuhl, Germany}, 210 | url = {https://drops.dagstuhl.de/opus/volltexte/2020/11656}, 211 | urn = {urn:nbn:de:0030-drops-116564}, 212 | doi = {10.4230/LIPIcs.CSL.2020.13}, 213 | annote = {Keywords: parametricity, cubical type theory, higher inductive types} 214 | } 215 | 216 | @misc{herbelin-hott-uf, 217 | author = {Hugo Herbelin}, 218 | title = {Investigations into syntactic iterated parametricity and cubical type theory}, 219 | year = {2020}, 220 | note = {Available at \url{https://hott-uf.github.io/2020/HoTTUF_2020_paper_22.pdf}} 221 | } 222 | 223 | @article{nuyts17, 224 | author = {Andreas Nuyts and Andrea Vezzosi and Dominique Devriese}, 225 | title = {Parametric Quantifiers for Dependent Type Theory}, 226 | year = {2017}, 227 | issue_date = {September 2017}, 228 | publisher = {Association for Computing Machinery}, 229 | address = {New York, NY, USA}, 230 | volume = {1}, 231 | number = {ICFP}, 232 | url = {https://doi.org/10.1145/3110276}, 233 | doi = {10.1145/3110276}, 234 | journal = {Proc. ACM Program. Lang.}, 235 | month = {aug}, 236 | articleno = {32}, 237 | numpages = {29} 238 | } 239 | 240 | @inproceedings{bezem13, 241 | author = {Marc Bezem and Thierry Coquand and Simon Huber}, 242 | title = {A Model of Type Theory in Cubical Sets}, 243 | booktitle = {19th International Conference on Types for Proofs and Programs, {TYPES} 244 | 2013, April 22-26, 2013, Toulouse, France}, 245 | pages = {107--128}, 246 | year = {2013}, 247 | url = {https://doi.org/10.4230/LIPIcs.TYPES.2013.107}, 248 | doi = {10.4230/LIPIcs.TYPES.2013.107}, 249 | editor = {Ralph Matthes and Aleksy Schubert}, 250 | series = {LIPIcs}, 251 | volume = {26}, 252 | publisher = {Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik} 253 | } 254 | 255 | @article{bernardy15, 256 | author = {Jean{-}Philippe Bernardy and Thierry Coquand and Guilhem Moulin}, 257 | title = {A Presheaf Model of Parametric Type Theory}, 258 | journal = {Electr. Notes Theor. Comput. Sci.}, 259 | volume = {319}, 260 | pages = {67--82}, 261 | year = {2015}, 262 | url = {https://doi.org/10.1016/j.entcs.2015.12.006}, 263 | doi = {10.1016/j.entcs.2015.12.006} 264 | } 265 | 266 | ## Parametricity 267 | @inproceedings{bernardy10, 268 | author = {Jean{-}Philippe Bernardy and Patrik Jansson and Ross Paterson}, 269 | title = {Parametricity and dependent types}, 270 | booktitle = {Proceeding of the 15th {ACM} {SIGPLAN} international conference on 271 | Functional programming, {ICFP} 2010, Baltimore, Maryland, USA, September 272 | 27-29, 2010}, 273 | pages = {345--356}, 274 | year = {2010}, 275 | url = {http://doi.acm.org/10.1145/1863543.1863592}, 276 | doi = {10.1145/1863543.1863592}, 277 | editor = {Paul Hudak and Stephanie Weirich}, 278 | publisher = {{ACM}}, 279 | isbn = {978-1-60558-794-3} 280 | } 281 | 282 | @inproceedings{bernardy11, 283 | author = {Jean{-}Philippe Bernardy and Marc Lasson}, 284 | title = {Realizability and Parametricity in Pure Type Systems}, 285 | booktitle = {Foundations of Software Science and Computational Structures - 14th 286 | International Conference, {FOSSACS} 2011, Held as Part of the Joint 287 | European Conferences on Theory and Practice of Software, {ETAPS} 2011, 288 | Saarbr{\"{u}}cken, Germany, March 26-April 3, 2011. Proceedings}, 289 | pages = {108--122}, 290 | year = {2011}, 291 | series = {Lecture Notes in Computer Science}, 292 | volume = {6604}, 293 | publisher = {Springer}, 294 | url = {https://doi.org/10.1007/978-3-642-19805-2_8}, 295 | doi = {10.1007/978-3-642-19805-2_8} 296 | } 297 | 298 | @inproceedings{atkey14, 299 | author = {Robert Atkey and Neil Ghani and Patricia Johann}, 300 | booktitle = {The 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '14, San Diego, CA, USA, January 20-21, 2014.}, 301 | date-added = {2019-11-04 10:11:58 +0100}, 302 | date-modified = {2019-11-04 10:14:33 +0100}, 303 | title = {A relationally parametric model of dependent type theory}, 304 | year = {2014} 305 | } 306 | 307 | @phdthesis{lasson12, 308 | title = {R\'ealisabilit\'e et Param\'etricit\'e dans les Syst\`emes de Types Purs}, 309 | year = {2014}, 310 | author = {Marc Lasson}, 311 | month = {Nov}, 312 | school = {Universit\'e de Lyon} 313 | } 314 | 315 | @inproceedings{altenkirch16, 316 | author = {Thorsten Altenkirch and 317 | Paolo Capriotti and 318 | Nicolai Kraus}, 319 | editor = {Jean{-}Marc Talbot and 320 | Laurent Regnier}, 321 | title = {Extending Homotopy Type Theory with Strict Equality}, 322 | booktitle = {25th {EACSL} Annual Conference on Computer Science Logic, {CSL} 2016, 323 | August 29 - September 1, 2016, Marseille, France}, 324 | series = {LIPIcs}, 325 | volume = {62}, 326 | pages = {21:1--21:17}, 327 | publisher = {Schloss Dagstuhl - Leibniz-Zentrum f{\"{u}}r Informatik}, 328 | year = {2016}, 329 | url = {https://doi.org/10.4230/LIPIcs.CSL.2016.21}, 330 | doi = {10.4230/LIPIcs.CSL.2016.21}, 331 | timestamp = {Tue, 11 Feb 2020 15:52:14 +0100}, 332 | biburl = {https://dblp.org/rec/conf/csl/AltenkirchCK16.bib}, 333 | bibsource = {dblp computer science bibliography, https://dblp.org} 334 | } 335 | 336 | @inproceedings{kraus21, 337 | author = {Nicolai Kraus}, 338 | title = {Internal {\(\infty\)}-Categorical Models of Dependent Type Theory 339 | : Towards {2LTT} Eating {HoTT}}, 340 | booktitle = {36th Annual {ACM/IEEE} Symposium on Logic in Computer Science, {LICS} 341 | 2021, Rome, Italy, June 29 - July 2, 2021}, 342 | pages = {1--14}, 343 | publisher = {{IEEE}}, 344 | year = {2021}, 345 | url = {https://doi.org/10.1109/LICS52264.2021.9470667}, 346 | doi = {10.1109/LICS52264.2021.9470667}, 347 | timestamp = {Mon, 03 Jan 2022 22:15:35 +0100}, 348 | biburl = {https://dblp.org/rec/conf/lics/Kraus21.bib}, 349 | bibsource = {dblp computer science bibliography, https://dblp.org} 350 | } 351 | 352 | @inproceedings{cohen16, 353 | author = {Cyril Cohen and Thierry Coquand and Simon Huber and Anders M{\"{o}}rtberg}, 354 | title = {{Cubical Type Theory: A Constructive Interpretation of the Univalence Axiom}}, 355 | booktitle = {TYPES 2015}, 356 | pages = {5:1--5:34}, 357 | series = {LIPIcs}, 358 | isbn = {978-3-95977-030-9}, 359 | issn = {1868-8969}, 360 | year = {2018}, 361 | volume = {69}, 362 | editor = {Tarmo Uustalu}, 363 | publisher = {Schloss Dagstuhl}, 364 | url = {http://drops.dagstuhl.de/opus/volltexte/2018/8475}, 365 | urn = {urn:nbn:de:0030-drops-84754}, 366 | doi = {10.4230/LIPIcs.TYPES.2015.5}, 367 | annote = {Keywords: univalence axiom, dependent type theory, cubical sets} 368 | } 369 | 370 | @article{angiuli21, 371 | author = {Carlo Angiuli and 372 | Guillaume Brunerie and 373 | Thierry Coquand and 374 | Robert Harper and 375 | Hou (Favonia), Kuen-Bang and 376 | Daniel R. Licata}, 377 | title = {Syntax and models of Cartesian cubical type theory}, 378 | journal = {Math. Struct. Comput. Sci.}, 379 | volume = {31}, 380 | number = {4}, 381 | pages = {424--468}, 382 | year = {2021}, 383 | url = {https://doi.org/10.1017/S0960129521000347}, 384 | doi = {10.1017/S0960129521000347}, 385 | timestamp = {Wed, 23 Feb 2022 11:16:44 +0100}, 386 | biburl = {https://dblp.org/rec/journals/mscs/AngiuliBCHHL21.bib}, 387 | bibsource = {dblp computer science bibliography, https://dblp.org} 388 | } 389 | 390 | @article{kapulkin21, 391 | title = {The simplicial model of {Univalent Foundations} (after {Voevodsky})}, 392 | author = {Kapulkin, Krzysztof and Lumsdaine, Peter LeFanu}, 393 | journal = {Journal of the European Mathematical Society}, 394 | volume = {23}, 395 | number = {6}, 396 | pages = {2071--2126}, 397 | year = {2021} 398 | } 399 | 400 | @article{curien93, 401 | author = {Pierre{-}Louis Curien}, 402 | title = {Substitution up to Isomorphism}, 403 | journal = {Fundam. Informaticae}, 404 | volume = {19}, 405 | number = {1/2}, 406 | pages = {51--85}, 407 | year = {1993}, 408 | timestamp = {Fri, 18 Sep 2020 11:15:52 +0200}, 409 | biburl = {https://dblp.org/rec/journals/fuin/Curien93.bib}, 410 | bibsource = {dblp computer science bibliography, https://dblp.org} 411 | } 412 | 413 | @article{kraus17, 414 | title = {Space-valued diagrams, type-theoretically}, 415 | author = {Kraus, Nicolai and Sattler, Christian}, 416 | journal = {arXiv preprint arXiv:1704.04543}, 417 | year = {2017} 418 | } 419 | 420 | @article{shulman15, 421 | title = {Univalence for inverse diagrams and homotopy canonicity}, 422 | volume = {25}, 423 | doi = {10.1017/S0960129514000565}, 424 | number = {5}, 425 | journal = {Mathematical Structures in Computer Science}, 426 | publisher = {Cambridge University Press}, 427 | author = {Shulman, Michael}, 428 | year = {2015}, 429 | pages = {1203–1277} 430 | } 431 | 432 | @misc{shulman14, 433 | author = {Michael Shulman}, 434 | title = {Homotopy type theory should eat itself (but so far, it’s too big to swallow)}, 435 | month = {Mar}, 436 | year = {2014}, 437 | note = {Blog post, \url{homotopytypetheory.org/2014/03/03/hott-should-eat-itself}} 438 | } 439 | 440 | @article{part15, 441 | author = {Fedor Part and 442 | Zhaohui Luo}, 443 | title = {Semi-simplicial Types in Logic-enriched Homotopy Type Theory}, 444 | journal = {CoRR}, 445 | volume = {abs/1506.04998}, 446 | year = {2015}, 447 | url = {http://arxiv.org/abs/1506.04998}, 448 | eprinttype = {arXiv}, 449 | eprint = {1506.04998}, 450 | timestamp = {Mon, 13 Aug 2018 16:47:25 +0200}, 451 | biburl = {https://dblp.org/rec/journals/corr/PartL15.bib}, 452 | bibsource = {dblp computer science bibliography, https://dblp.org} 453 | } 454 | 455 | @article{curien14, 456 | title = {Revisiting the categorical interpretation of dependent type theory}, 457 | journal = {Theoretical Computer Science}, 458 | volume = {546}, 459 | pages = {99-119}, 460 | year = {2014}, 461 | note = {Models of Interaction: Essays in Honour of Glynn Winskel}, 462 | issn = {0304-3975}, 463 | doi = {https://doi.org/10.1016/j.tcs.2014.03.003}, 464 | url = {https://www.sciencedirect.com/science/article/pii/S0304397514001789}, 465 | author = {Pierre-Louis Curien and Richard Garner and Martin Hofmann} 466 | } 467 | 468 | @techreport{aitchison86, 469 | title = {The geometry of oriented cubes}, 470 | author = {Iain R. Aitchison}, 471 | institution = {Macquarie University}, 472 | year = {1986}, 473 | eprint = {1008.1714}, 474 | archiveprefix = {arXiv}, 475 | primaryclass = {math.CT} 476 | } 477 | 478 | @article{annenkovCK17, 479 | author = {Danil Annenkov and 480 | Paolo Capriotti and 481 | Nicolai Kraus}, 482 | title = {Two-Level Type Theory and Applications}, 483 | journal = {CoRR}, 484 | volume = {abs/1705.03307}, 485 | year = {2017}, 486 | url = {http://arxiv.org/abs/1705.03307}, 487 | eprinttype = {arXiv}, 488 | eprint = {1705.03307}, 489 | timestamp = {Sat, 23 Jan 2021 01:20:40 +0100}, 490 | biburl = {https://dblp.org/rec/journals/corr/AnnenkovCK17.bib}, 491 | bibsource = {dblp computer science bibliography, https://dblp.org} 492 | } 493 | 494 | @article{AnnenkovCKS2023, 495 | author={Annenkov, Danil and Capriotti, Paolo and Kraus, Nicolai and Sattler, Christian}, 496 | title={Two-level type theory and applications}, 497 | volume={33}, DOI={10.1017/S0960129523000130}, 498 | number={8}, journal={Mathematical Structures in Computer Science}, 499 | year={2023}, 500 | pages={688–743} 501 | } 502 | 503 | @article{shulman_2014, 504 | doi = {10.1017/s0960129514000565}, 505 | url = {https://doi.org/10.1017%2Fs0960129514000565}, 506 | year = 2014, 507 | month = {nov}, 508 | publisher = {Cambridge University Press ({CUP})}, 509 | volume = {25}, 510 | number = {5}, 511 | pages = {1203--1277}, 512 | author = {MICHAEL SHULMAN}, 513 | title = {Univalence for inverse diagrams and homotopy canonicity}, 514 | journal = {Mathematical Structures in Computer Science} 515 | } 516 | 517 | @phdthesis{HofmannPhd, 518 | author = {Martin Hofmann}, 519 | title = {Extensional concepts in intensional type theory}, 520 | school = {University of Edinburgh}, 521 | year = 1995 522 | } 523 | 524 | @inproceedings{HofmannStreicher94, 525 | author = {Martin Hofmann and Thomas Streicher}, 526 | title = {The Groupoid Model Refutes Uniqueness of Identity Proofs}, 527 | booktitle = {Proceedings of the Ninth Annual Symposium on Logic in Computer Science 528 | {(LICS} '94), Paris, France, July 4-7, 1994}, 529 | pages = {208--212}, 530 | year = {1994}, 531 | publisher = {{IEEE} Computer Society}, 532 | } 533 | 534 | @inproceedings{BezemCoquandHuber13, 535 | author = {Marc Bezem and Thierry Coquand and Simon Huber}, 536 | title = {A Model of Type Theory in Cubical Sets}, 537 | booktitle = {19th International Conference on Types for Proofs and Programs, {TYPES} 538 | 2013, April 22-26, 2013, Toulouse, France}, 539 | pages = {107--128}, 540 | year = {2013}, 541 | url = {https://doi.org/10.4230/LIPIcs.TYPES.2013.107}, 542 | doi = {10.4230/LIPIcs.TYPES.2013.107}, 543 | editor = {Ralph Matthes and Aleksy Schubert}, 544 | series = {LIPIcs}, 545 | volume = {26}, 546 | publisher = {Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik}, 547 | } 548 | 549 | @article{LoregianRiehl20, 550 | title = {Categorical notions of fibration}, 551 | journal = {Expositiones Mathematicae}, 552 | volume = {38}, 553 | number = {4}, 554 | pages = {496-514}, 555 | year = {2020}, 556 | issn = {0723-0869}, 557 | doi = {https://doi.org/10.1016/j.exmath.2019.02.004}, 558 | author = {Fosco Loregian and Emily Riehl}, 559 | keywords = {Grothendieck fibration, Two-sided fibration, Profunctor}, 560 | } 561 | 562 | @article{nuytsdevriese24, 563 | title = {{Transpension: The Right Adjoint to the Pi-type}}, 564 | author = {Andreas Nuyts and Dominique Devriese}, 565 | url = {https://lmcs.episciences.org/13798}, 566 | doi = {10.46298/lmcs-20(2:16)2024}, 567 | journal = {{Logical Methods in Computer Science}}, 568 | volume = {{Volume 20, Issue 2}}, 569 | year = {2024}, 570 | month = Jun, 571 | keywords = {Computer Science - Logic in Computer Science}, 572 | } 573 | 574 | @article{hr25, 575 | title = {A parametricity-based formalization of semi-simplicial and semi-cubical sets}, 576 | volume = 35, 577 | DOI = {10.1017/S096012952500009X}, 578 | journal = {Mathematical Structures in Computer Science}, 579 | author = {Herbelin, Hugo and Ramachandra, Ramkumar}, 580 | year = {2025}, 581 | pages= {e13} 582 | } 583 | 584 | @inproceedings{Hickey96, 585 | title={Formal Objects in Type Theory Using Very Dependent Types}, 586 | author={Jason J. Hickey}, 587 | year={1996}, 588 | month={july}, 589 | location={New Brunswick, NJ}, 590 | booktitle={FOOL 3: The Third International Workshop on 591 | Foundations of Object-Oriented Languages}, 592 | url={https://api.semanticscholar.org/CorpusID:14983194} 593 | } 594 | -------------------------------------------------------------------------------- /theories/νSet/νSet.v: -------------------------------------------------------------------------------- 1 | From Stdlib Require Import Logic.FunctionalExtensionality. 2 | 3 | Set Warnings "-notation-overridden". 4 | From Bonak Require Import SigT RewLemmas HSet LeYoneda Notation. 5 | 6 | Set Primitive Projections. 7 | Set Printing Projections. 8 | Set Keyed Unification. 9 | 10 | Section νSet. 11 | Variable arity: HSet. 12 | 13 | (** The type of lists [frame(n,0);...;frame(n,p-1)] for arbitrary k := n-p 14 | (the non-mandatory dependency in k is useful for type inference) *) 15 | 16 | Fixpoint mkFrameTypes p k: Type := 17 | match p with 18 | | 0 => unit 19 | | S p => { frames: mkFrameTypes p k.+1 &T HSet } 20 | end. 21 | 22 | (** The type of lists [painting(n,0);...;painting(n,p-1)] for n := k+p *) 23 | 24 | Fixpoint mkPaintingTypes p k: mkFrameTypes p k -> Type := 25 | match p with 26 | | 0 => fun _ => unit 27 | | S p => fun frames => 28 | { paintings: mkPaintingTypes p k.+1 frames.1 &T frames.2 -> HSet } 29 | end. 30 | 31 | (** A helper type so as to mutually build the types of restrFrames and 32 | the body of frames using a single fixpoint *) 33 | 34 | Class RestrFrameTypeBlock p k := { 35 | RestrFrameTypesDef: Type; 36 | FrameDef: RestrFrameTypesDef -> mkFrameTypes p.+1 k; 37 | }. 38 | 39 | (** 40 | For n and p<=n be given, and assuming [frame(n,0);...;frame(n,p)] and 41 | [painting(n,0);...;painting(n,p)], we build the list of pairs: 42 | - of the types RestrFrameTypes(n,p) of the list 43 | [restrFrame(n,0);...;restrFrame(n,p-1)] 44 | (represented as an inhabitant of a sigma-type 45 | {R:RestrFrameTypes(n,0) & ... & RestrFrameTypes(n,p-1)}) 46 | - and of the list [frame(n+1,0);...;frame(n+1,p)] in function of effective 47 | restrFrames of type RestrFrameTypes(n,p) 48 | 49 | That is, we build: 50 | p = 0 : { RestrFrameTypes(n,0..0-1) := unit ; 51 | (which denotes the empty list of restrFrameTypes) 52 | Frames(n+1,0..0)(restrFrames^n_{0..0-1}) := [unit] 53 | (representing lists by Sigma-types) } 54 | p = 1 : { RestrFrameTypes(n,0..0) = {_:unit & restrFrameType(n,0)} ; 55 | (thus denoting the singleton list [restrFrameType(n,0]) 56 | Frames(n+1,0..1)(restrFrames(n,0..0) := 57 | [unit;{d:Frame(n,0)&Painting(n,0)(restrFrame(n,0)(d)}] } 58 | ... 59 | p : { RestrFrameTypes(n,0..p-1) = 60 | {RestrFrameType(n,0) & ... & RestrFrameType(n,p-1)} ; 61 | Frames(n+1,0..p)(restrFrames(n,0..p-1)) := 62 | [frame(n+1,0);...;frame(n+1,p)] } 63 | 64 | In practise, it is convenient to work with the difference k := n-p 65 | rather than n itself. So, below, k is the difference. 66 | *) 67 | 68 | Generalizable Variables p k frames. 69 | 70 | Definition mkRestrFrameTypesStep `(frames: mkFrameTypes p.+1 k) 71 | (prev: RestrFrameTypeBlock p k.+1) := 72 | { R: prev.(RestrFrameTypesDef) &T 73 | forall q (Hq: q <= k) (ε: arity), (prev.(FrameDef) R).2 -> frames.2 }. 74 | 75 | Definition mkLayer `{paintings: mkPaintingTypes p.+1 k frames} 76 | {prev: RestrFrameTypeBlock p k.+1} 77 | (restrFrames: mkRestrFrameTypesStep frames prev) 78 | (d: (prev.(FrameDef) restrFrames.1).2) := 79 | hforall ε, paintings.2 (restrFrames.2 0 leY_O ε d). 80 | 81 | Fixpoint mkRestrFrameTypesAndFrames {p k}: 82 | forall `(paintings: mkPaintingTypes p k frames), RestrFrameTypeBlock p k := 83 | match p with 84 | | 0 => fun frames paintings => 85 | {| 86 | RestrFrameTypesDef := unit; 87 | FrameDef _ := (tt; hunit): mkFrameTypes 1 k 88 | |} 89 | | p.+1 => fun frames paintings => 90 | let prev := 91 | mkRestrFrameTypesAndFrames paintings.1 in 92 | let frames' := prev.(FrameDef) in 93 | {| 94 | RestrFrameTypesDef := mkRestrFrameTypesStep frames prev; 95 | FrameDef R := 96 | (frames' R.1; { d: (frames' R.1).2 & 97 | mkLayer (paintings := paintings) R d }): mkFrameTypes p.+2 k 98 | |} 99 | end. 100 | 101 | Definition mkRestrFrameTypes `(paintings: mkPaintingTypes p k frames) := 102 | (mkRestrFrameTypesAndFrames paintings).(RestrFrameTypesDef). 103 | 104 | Class DepsRestr p k := { 105 | _frames: mkFrameTypes p k; 106 | _paintings: mkPaintingTypes p k _frames; 107 | _restrFrames: mkRestrFrameTypes _paintings; 108 | }. 109 | 110 | Instance toDepsRestr `{paintings: mkPaintingTypes p k frames} 111 | (restrFrames: mkRestrFrameTypes paintings) : DepsRestr p k := 112 | {| _restrFrames := restrFrames |}. 113 | 114 | #[local] 115 | Instance proj1DepsRestr `(deps: DepsRestr p.+1 k): DepsRestr p k.+1 := 116 | {| 117 | _frames := deps.(_frames).1; 118 | _paintings := deps.(_paintings).1; 119 | _restrFrames := deps.(_restrFrames).1; 120 | |}. 121 | 122 | Declare Scope depsrestr_scope. 123 | Delimit Scope depsrestr_scope with depsrestr. 124 | Bind Scope depsrestr_scope with DepsRestr. 125 | Notation "x .(1)" := (proj1DepsRestr x%_depsrestr) 126 | (at level 1, left associativity, format "x .(1)"): depsrestr_scope. 127 | 128 | Definition mkFrames `(deps: DepsRestr p k): mkFrameTypes p.+1 k := 129 | (mkRestrFrameTypesAndFrames 130 | deps.(_paintings)).(FrameDef) deps.(_restrFrames). 131 | 132 | Definition mkFrame `(deps: DepsRestr p k): HSet := (mkFrames deps).2. 133 | 134 | Inductive DepsRestrExtension p: forall k, DepsRestr p k -> Type := 135 | | TopRestrDep {deps} (E: mkFrame deps -> HSet): DepsRestrExtension p 0 deps 136 | | AddRestrDep {k} deps: 137 | DepsRestrExtension p.+1 k deps -> DepsRestrExtension p k.+1 deps.(1). 138 | 139 | Arguments TopRestrDep {p deps}. 140 | Arguments AddRestrDep {p k} deps. 141 | 142 | Declare Scope extra_depsrestr_scope. 143 | Delimit Scope extra_depsrestr_scope with extradepsrestr. 144 | Bind Scope extra_depsrestr_scope with DepsRestrExtension. 145 | Notation "( x ; y )" := (AddRestrDep x y) 146 | (at level 0, format "( x ; y )"): extra_depsrestr_scope. 147 | 148 | (* Example: if p := 0, extraDeps := ([],E) mkPainting:= [E] *) 149 | 150 | Generalizable Variables deps. 151 | 152 | Fixpoint mkPainting `(extraDeps: DepsRestrExtension p k deps): 153 | mkFrame deps -> HSet := 154 | match extraDeps with 155 | | TopRestrDep E => fun d => E d 156 | | AddRestrDep deps extraDeps => fun (d: mkFrame deps.(1)) => 157 | {l: mkLayer deps.(_restrFrames) d & mkPainting extraDeps (d; l)} 158 | end. 159 | 160 | Fixpoint mkPaintingsPrefix {p k}: 161 | forall `(extraDeps: DepsRestrExtension p k deps), 162 | mkPaintingTypes p k.+1 (mkFrames deps).1 := 163 | match p with 164 | | 0 => fun _ _ => tt 165 | | S p => fun deps extraDeps => 166 | (mkPaintingsPrefix (deps; extraDeps)%extradepsrestr; 167 | mkPainting (deps; extraDeps)%extradepsrestr) 168 | end. 169 | 170 | Definition mkPaintings {p k}: forall `(extraDeps: DepsRestrExtension p k deps), 171 | mkPaintingTypes p.+1 k (mkFrames deps) := 172 | fun deps extraDeps => (mkPaintingsPrefix extraDeps; mkPainting extraDeps). 173 | 174 | Definition mkRestrPaintingType 175 | `(extraDeps: DepsRestrExtension p.+1 k deps) := 176 | forall q (Hq: q <= k) ε (d: mkFrame deps.(1)), 177 | (mkPaintings (deps; extraDeps)).2 d -> 178 | deps.(_paintings).2 (deps.(_restrFrames).2 q _ ε d). 179 | 180 | Fixpoint mkRestrPaintingTypes {p}: 181 | forall `(extraDeps: DepsRestrExtension p k deps), Type := 182 | match p with 183 | | 0 => fun _ _ _ => unit 184 | | S p => 185 | fun k deps extraDeps => 186 | { _: mkRestrPaintingTypes (deps; extraDeps) &T 187 | mkRestrPaintingType extraDeps } 188 | end. 189 | 190 | (** A helper type so as to mutually build the types of cohFrames and 191 | the body of restrFrames using a single fixpoint *) 192 | 193 | Class CohFrameTypeBlock `{extraDeps: DepsRestrExtension p k deps} := { 194 | CohFrameTypesDef: Type; 195 | RestrFramesDef: CohFrameTypesDef -> mkRestrFrameTypes (mkPaintings extraDeps) 196 | }. 197 | 198 | (** Auxiliary definitions to mutually build cohFrameTypes and restrFrames *) 199 | 200 | Definition mkCohFrameTypesStep `{extraDeps: DepsRestrExtension p.+1 k deps} 201 | (prev: CohFrameTypeBlock (extraDeps := (deps; extraDeps))): Type := 202 | { Q: prev.(CohFrameTypesDef) &T 203 | forall r q (Hrq: r <= q) (Hq: q <= k) (ε ω: arity) d, 204 | deps.(_restrFrames).2 q Hq ε 205 | ((prev.(RestrFramesDef) Q).2 r (Hrq ↕ (↑ Hq)) ω d) = 206 | deps.(_restrFrames).2 r (Hrq ↕ Hq) ω 207 | ((prev.(RestrFramesDef) Q).2 q.+1 (⇑ Hq) ε d) }. 208 | 209 | Definition mkRestrLayer `{extraDeps: DepsRestrExtension p.+1 k deps} 210 | (restrPaintings: mkRestrPaintingTypes extraDeps) 211 | {prev: CohFrameTypeBlock (extraDeps := (deps; extraDeps))} 212 | (cohFrames: mkCohFrameTypesStep prev) 213 | q (Hq: q <= k) (ε: arity) 214 | (d: mkFrame (toDepsRestr (prev.(RestrFramesDef) cohFrames.1)).(1)): 215 | mkLayer (prev.(RestrFramesDef) cohFrames.1) d -> mkLayer deps.(_restrFrames) 216 | ((prev.(RestrFramesDef) cohFrames.1).2 q.+1 (⇑ Hq) ε d) := 217 | fun l ω => rew [deps.(_paintings).2] cohFrames.2 0 q leY_O Hq ε ω d in 218 | restrPaintings.2 q Hq ε _ (l ω). 219 | 220 | (** Under previous assumptions, and, additionally: 221 | [restrPainting(n,0);...;restrPainting(n,p-1)] 222 | we mutually build the pair of: 223 | - the list of types for [cohFrame(n,0);...;cohFrame(n,p-1)] 224 | - definitions of [restrFrame(n+1,0);...;restrFrame(n+1,p)] *) 225 | 226 | Fixpoint mkCohFrameTypesAndRestrFrames {p k}: 227 | forall `{extraDeps: DepsRestrExtension p k deps} 228 | (restrPaintings: mkRestrPaintingTypes extraDeps), CohFrameTypeBlock := 229 | match p with 230 | | 0 => 231 | fun deps extraDeps restrPaintings => 232 | {| 233 | CohFrameTypesDef := unit; 234 | RestrFramesDef _ := (tt; fun _ _ _ _ => tt) 235 | |} 236 | | S p => 237 | fun deps extraDeps restrPaintings => 238 | let prev := mkCohFrameTypesAndRestrFrames restrPaintings.1 in 239 | let restrFrames := prev.(RestrFramesDef) in 240 | {| 241 | CohFrameTypesDef := mkCohFrameTypesStep prev; 242 | RestrFramesDef Q := 243 | let restrFrame q (Hq: q <= k) ε 244 | (d: mkFrame (toDepsRestr (restrFrames Q.1))) := 245 | ((restrFrames Q.1).2 q.+1 (⇑ Hq) ε d.1; 246 | mkRestrLayer restrPaintings Q q _ ε d.1 d.2) 247 | in (restrFrames Q.1; restrFrame) 248 | |} 249 | end. 250 | 251 | (* Example: if p := 0, extraDeps := ([],E) 252 | mkCohFrameTypes := [] *) 253 | 254 | Definition mkCohFrameTypes `{extraDeps: DepsRestrExtension p k deps} 255 | (restrPaintings: mkRestrPaintingTypes extraDeps) := 256 | (mkCohFrameTypesAndRestrFrames restrPaintings).(CohFrameTypesDef). 257 | 258 | Class DepsCohs p k := { 259 | _deps: DepsRestr p k; 260 | _extraDeps: DepsRestrExtension p k _deps; 261 | _restrPaintings: mkRestrPaintingTypes _extraDeps; 262 | _cohs: mkCohFrameTypes _restrPaintings; 263 | }. 264 | 265 | #[local] 266 | Instance toDepsCohs `{extraDeps: DepsRestrExtension p k deps} 267 | {restrPaintings: mkRestrPaintingTypes extraDeps} 268 | (cohs: mkCohFrameTypes restrPaintings): DepsCohs p k := 269 | {| _cohs := cohs |}. 270 | 271 | #[local] 272 | Instance proj1DepsCohs `(depsCohs: DepsCohs p.+1 k): DepsCohs p k.+1 := 273 | {| 274 | _deps := depsCohs.(_deps).(1); 275 | _extraDeps := (depsCohs.(_deps); depsCohs.(_extraDeps)); 276 | _restrPaintings := depsCohs.(_restrPaintings).1; 277 | _cohs := depsCohs.(_cohs).1; 278 | |}. 279 | 280 | Declare Scope depscohs_scope. 281 | Delimit Scope depscohs_scope with depscohs. 282 | Bind Scope depscohs_scope with DepsCohs. 283 | Notation "x .(1)" := (proj1DepsCohs x%depscohs) 284 | (at level 1, left associativity, format "x .(1)"): depscohs_scope. 285 | 286 | (** The restrFrame(n+1,0..p) component of the fixpoint *) 287 | 288 | Definition mkRestrFrames `{depsCohs: DepsCohs p k} := 289 | (mkCohFrameTypesAndRestrFrames depsCohs.(_restrPaintings)).(RestrFramesDef) 290 | depsCohs.(_cohs). 291 | 292 | (** For n=p+k, we combine mkFrames (that is frames(n+1,p)), 293 | mkPaintings (that is paintings(n+1,p)) and restrFrames 294 | (that is restrFrames(n+1,p)) to build "dependencies" at the next 295 | level, that is a deps(n+1,p). 296 | That is, from: 297 | [frame(n,0);...;frame(n,p-1)] 298 | [painting(n,0);...;painting(n,p-1)] 299 | [restrFrame(n,0);...;restrFrame(n,p-1)] for p<=n+1 300 | (forming a "deps"), and 301 | [frame(n,p);...;frame(n,n] 302 | [painting(n,p);...;painting(n,n)] 303 | [restrFrame(n,p);...;restrFrame(n,n)] 304 | E:frame(n+1,n+1) -> HSet 305 | (forming an "extraDeps") 306 | we form: 307 | [frame(n+1,0);...;frame(n+1,p)] (built by mkFrames) 308 | [painting(n+1,0);...;painting(p+n,p)] (built by mkPaintings) 309 | [restrFrame(n+1,0);...;restrFrame(n+1,p)] (built by mkRestrFrames) 310 | 311 | Example: if p := 0, extraDeps := ([],E), restrPaintings := [], cohs := [] 312 | then mkDepsRestr := {_frames'':=[unit]; 313 | _paintings'':=[E]}; 314 | _restrFrames':=[\qω().()]} 315 | (where _restrFrames' is presented as a dependent pair, i.e. ((),\qω().()) *) 316 | 317 | Definition mkDepsRestr `{depsCohs: DepsCohs p k} := 318 | toDepsRestr mkRestrFrames. 319 | 320 | (** Deducing restrFrame(n+1,p) *) 321 | 322 | (** Note that we use mkRestrFrames(n+1,p) both to build frame(n+2,p) and 323 | restrFrame(n+1,p) : frame(n+2,p) -> frame(n+1,p), according to the 324 | circularity between Frames and RestrFrameTypes. 325 | But now, thanks to restrPaintings and cohFrames, we have an effective 326 | definition of RestrFrame(n+1,p) and the circular dependency of frame(n+2,p) 327 | with an inhabitant RestrFrame(n+1,p) of RestrFrameType(n+1,p) is gone. 328 | *) 329 | 330 | Definition mkRestrFrame `{depsCohs: DepsCohs p k}: 331 | forall q (Hq: q <= k) (ε: arity), 332 | mkFrame mkDepsRestr.(1) -> mkFrame depsCohs.(_deps) := 333 | mkRestrFrames.2. 334 | 335 | Inductive DepsCohsExtension p: forall k (depsCohs: DepsCohs p k), Type := 336 | | TopCohDep `{depsCohs: DepsCohs p 0} 337 | (E: mkFrame mkDepsRestr -> HSet): 338 | DepsCohsExtension p 0 depsCohs 339 | | AddCohDep {k} (depsCohs: DepsCohs p.+1 k): 340 | DepsCohsExtension p.+1 k depsCohs -> DepsCohsExtension p k.+1 depsCohs.(1). 341 | 342 | Arguments TopCohDep {p depsCohs}. 343 | Arguments AddCohDep {p k}. 344 | 345 | Declare Scope extra_depscohs_scope. 346 | Delimit Scope extra_depscohs_scope with extradepscohs. 347 | Bind Scope extra_depscohs_scope with DepsCohsExtension. 348 | Notation "( x ; y )" := (AddCohDep x y) 349 | (at level 0, format "( x ; y )"): extra_depscohs_scope. 350 | 351 | Generalizable Variables depsCohs. 352 | 353 | Fixpoint mkExtraDeps `(extraDepsCohs: DepsCohsExtension p k depsCohs): 354 | DepsRestrExtension p.+1 k mkDepsRestr. 355 | Proof. 356 | destruct extraDepsCohs. 357 | - now constructor. 358 | - apply (AddRestrDep mkDepsRestr 359 | (mkExtraDeps p.+1 k depsCohs extraDepsCohs)). 360 | Defined. 361 | 362 | Fixpoint mkRestrPainting `(extraDepsCohs: DepsCohsExtension p k depsCohs): 363 | mkRestrPaintingType (mkExtraDeps extraDepsCohs). 364 | Proof. 365 | red; intros * (l, c); destruct q. 366 | - now exact (l ε). 367 | - destruct extraDepsCohs. 368 | + exfalso; now apply leY_O_contra in Hq. 369 | + unshelve esplit. 370 | * now exact (mkRestrLayer depsCohs.(_restrPaintings) depsCohs.(_cohs) 371 | q (⇓ Hq) ε d l). 372 | * now exact (mkRestrPainting p.+1 k depsCohs extraDepsCohs 373 | q (⇓ Hq) ε (d; l) c). 374 | Defined. 375 | 376 | Fixpoint mkRestrPaintingsPrefix {p k}: 377 | forall `(extraDepsCohs: DepsCohsExtension p k depsCohs), 378 | mkRestrPaintingTypes 379 | (mkDepsRestr; mkExtraDeps extraDepsCohs)%extradepsrestr := 380 | match p with 381 | | 0 => fun _ _ => tt 382 | | S p => 383 | fun depsCohs extraDepsCohs => 384 | (mkRestrPaintingsPrefix (depsCohs; extraDepsCohs)%extradepscohs; 385 | mkRestrPainting (depsCohs; extraDepsCohs)%extradepscohs) 386 | end. 387 | 388 | Definition mkRestrPaintings {p k}: 389 | forall `(extraDepsCohs: DepsCohsExtension p k depsCohs), 390 | mkRestrPaintingTypes (mkExtraDeps extraDepsCohs) := 391 | fun depsCohs extraDepsCohs => (mkRestrPaintingsPrefix extraDepsCohs; mkRestrPainting extraDepsCohs). 392 | 393 | Definition mkCohPaintingType 394 | `(extraDepsCohs: DepsCohsExtension p.+1 k depsCohs) := 395 | forall r q (Hrq: r <= q) (Hq: q <= k) (ε ω: arity) 396 | (d: mkFrame mkDepsRestr.(1)) 397 | (c: (mkPaintings (mkDepsRestr; 398 | mkExtraDeps (depsCohs; extraDepsCohs))).2 d), 399 | rew [depsCohs.(_deps).(_paintings).2] depsCohs.(_cohs).2 r q Hrq Hq ε ω d in 400 | depsCohs.(_restrPaintings).2 q Hq ε _ 401 | ((mkRestrPaintings (depsCohs; extraDepsCohs)).2 r _ ω d c) = 402 | depsCohs.(_restrPaintings).2 r (Hrq ↕ Hq) ω _ 403 | ((mkRestrPaintings (depsCohs; extraDepsCohs)).2 q.+1 _ ε d c). 404 | 405 | Fixpoint mkCohPaintingTypes {p}: 406 | forall `(extraDepsCohs: DepsCohsExtension p k depsCohs), Type := 407 | match p with 408 | | 0 => fun _ _ _ => unit 409 | | S p => 410 | fun k depsCohs extraDepsCohs => 411 | { R: mkCohPaintingTypes (depsCohs; extraDepsCohs) &T 412 | mkCohPaintingType extraDepsCohs } 413 | end. 414 | 415 | Lemma mkCoh2Frame `(extraDepsCohs: DepsCohsExtension p.+1 k depsCohs) 416 | (cohPaintings: mkCohPaintingTypes extraDepsCohs) 417 | (prevCohFrames: mkCohFrameTypes 418 | (extraDeps := (mkDepsRestr; mkExtraDeps extraDepsCohs)) 419 | (mkRestrPaintings extraDepsCohs).1): 420 | forall (r q: nat) (Hrq: r <= q) (Hq: q <= k) (ε ω: arity) 421 | (d: mkFrame (mkDepsRestr (depsCohs := toDepsCohs prevCohFrames.1)).(1)) 422 | (𝛉: arity), 423 | f_equal 424 | (fun x : mkFrame depsCohs.(_deps).(1) => 425 | depsCohs.(_deps).(_restrFrames).2 q _ ε x) 426 | (prevCohFrames.2 0 r leY_O (Hrq ↕ ↑ Hq) ω 𝛉 d) 427 | • (depsCohs.(_cohs).2 0 q leY_O Hq ε 𝛉 428 | (((mkCohFrameTypesAndRestrFrames 429 | (mkRestrPaintings (depsCohs; extraDepsCohs)).1).( 430 | RestrFramesDef) prevCohFrames.1).2 r.+1 (⇑ (Hrq ↕ ↑ Hq)) ω d) 431 | • f_equal 432 | (fun x => 433 | depsCohs.(_deps).(_restrFrames).2 0 leY_O 𝛉 x) 434 | (prevCohFrames.2 r.+1 q.+1 (⇑ Hrq) (⇑ Hq) ε ω d)) = 435 | depsCohs.(_cohs).2 r q Hrq Hq ε ω 436 | (((mkCohFrameTypesAndRestrFrames 437 | (mkRestrPaintings (depsCohs; extraDepsCohs)).1).( 438 | RestrFramesDef) prevCohFrames.1).2 0 leY_O 𝛉 d) 439 | • (f_equal 440 | (fun x : mkFrame depsCohs.(_deps).(1) => 441 | depsCohs.(_deps).(_restrFrames).2 r _ ω x) 442 | (prevCohFrames.2 0 q.+1 leY_O (⇑ Hq) ε 𝛉 d) 443 | • depsCohs.(_cohs).2 0 r leY_O (Hrq ↕ Hq) ω 𝛉 444 | (((mkCohFrameTypesAndRestrFrames 445 | (mkRestrPaintings (depsCohs; extraDepsCohs)).1).( 446 | RestrFramesDef) prevCohFrames.1).2 q.+2 (⇑ (⇑ Hq)) ε d)). 447 | Proof. 448 | now intros; apply depsCohs.(_deps).(_frames).2.(UIP). 449 | Defined. 450 | 451 | Definition mkCohLayer `{extraDepsCohs: DepsCohsExtension p.+1 k depsCohs} 452 | (cohPaintings: mkCohPaintingTypes extraDepsCohs) 453 | {prevCohFrames: mkCohFrameTypes 454 | (extraDeps := (mkDepsRestr; mkExtraDeps extraDepsCohs)) 455 | (mkRestrPaintings extraDepsCohs).1} 456 | r q {Hrq: r <= q} {Hq: q <= k} (ε ω: arity) 457 | (d: mkFrame (mkDepsRestr (depsCohs := toDepsCohs prevCohFrames.1)).(1)) 458 | (l: mkLayer mkRestrFrames d): 459 | rew [mkLayer _] prevCohFrames.2 r.+1 q.+1 (⇑ Hrq) (⇑ Hq) ε ω d in 460 | mkRestrLayer depsCohs.(_restrPaintings) depsCohs.(_cohs) q Hq ε _ 461 | (mkRestrLayer (mkRestrPaintings extraDepsCohs).1 _ r (Hrq ↕ ↑ Hq) ω d l) = 462 | mkRestrLayer depsCohs.(_restrPaintings) depsCohs.(_cohs) r (Hrq ↕ Hq) ω _ 463 | (mkRestrLayer (mkRestrPaintings extraDepsCohs).1 _ q.+1 (⇑ Hq) ε d l). 464 | Proof. 465 | apply functional_extensionality_dep; intros 𝛉. 466 | rewrite <- map_subst_app. unfold mkRestrLayer; simpl. 467 | rewrite 468 | <- map_subst with (f := fun x => depsCohs.(_restrPaintings).2 q Hq ε x), 469 | <- map_subst with 470 | (f := fun x => depsCohs.(_restrPaintings).2 r (Hrq ↕ Hq) ω x), 471 | -> rew_map with (P := fun x => depsCohs.(_deps).(_paintings).2 x) 472 | (f := fun x => depsCohs.(_deps).(_restrFrames).2 O leY_O 𝛉 x), 473 | -> rew_map with (P := fun x => depsCohs.(_deps).(_paintings).2 x) 474 | (f := fun x => depsCohs.(_deps).(_restrFrames).2 r 475 | (Hrq ↕ Hq) ω x), 476 | -> rew_map with (P := fun x => depsCohs.(_deps).(_paintings).2 x) 477 | (f := fun x => depsCohs.(_deps).(_restrFrames).2 q _ ε x), 478 | <- cohPaintings.2. 479 | repeat rewrite rew_compose. 480 | apply rew_swap with (P := fun x => depsCohs.(_deps).(_paintings).2 x). 481 | rewrite rew_app_rl. now trivial. 482 | now apply mkCoh2Frame. 483 | Defined. 484 | 485 | Fixpoint mkCohFrames `{extraDepsCohs: DepsCohsExtension p k depsCohs} 486 | (cohPaintings: mkCohPaintingTypes extraDepsCohs) {struct p}: 487 | mkCohFrameTypes (mkRestrPaintings extraDepsCohs). 488 | Proof. 489 | destruct p. 490 | - unshelve esplit. now exact tt. now intros. 491 | - unshelve esplit. 492 | + now exact (mkCohFrames p k.+1 depsCohs.(1)%depscohs 493 | (depsCohs; extraDepsCohs)%extradepscohs cohPaintings.1). 494 | + intros r q Hrq Hq ε ω d. unshelve eapply eq_existT_curried. 495 | now exact ((mkCohFrames p k.+1 depsCohs.(1)%depscohs 496 | (depsCohs; extraDepsCohs)%extradepscohs 497 | cohPaintings.1).2 r.+1 q.+1 (⇑ Hrq) (⇑ Hq) ε ω d.1). 498 | now exact (mkCohLayer cohPaintings r q ε ω d.1 d.2). 499 | Defined. 500 | 501 | Class DepsCohs2 p k := { 502 | _depsCohs: DepsCohs p k; 503 | _extraDepsCohs: DepsCohsExtension p k _depsCohs; 504 | _cohPaintings: mkCohPaintingTypes _extraDepsCohs; 505 | }. 506 | 507 | #[local] 508 | Instance toDepsCohs2 `{extraDepsCohs: DepsCohsExtension p k depsCohs} 509 | (cohPaintings: mkCohPaintingTypes extraDepsCohs): DepsCohs2 p k := 510 | {| _cohPaintings := cohPaintings |}. 511 | 512 | #[local] 513 | Instance proj1DepsCohs2 `(depsCohs2: DepsCohs2 p.+1 k): DepsCohs2 p k.+1 := 514 | {| 515 | _depsCohs := depsCohs2.(_depsCohs).(1); 516 | _extraDepsCohs := (depsCohs2.(_depsCohs); depsCohs2.(_extraDepsCohs)); 517 | _cohPaintings := depsCohs2.(_cohPaintings).1; 518 | |}. 519 | 520 | Declare Scope depscohs2_scope. 521 | Delimit Scope depscohs2_scope with depscohs2. 522 | Bind Scope depscohs2_scope with DepsCohs2. 523 | Notation "x .(1)" := (proj1DepsCohs2 x%depscohs2) 524 | (at level 1, left associativity, format "x .(1)"): depscohs2_scope. 525 | 526 | #[local] 527 | Instance mkDepsCohs `(depsCohs2: DepsCohs2 p k): DepsCohs p.+1 k := 528 | {| 529 | _deps := mkDepsRestr; 530 | _extraDeps := mkExtraDeps depsCohs2.(_extraDepsCohs); 531 | _restrPaintings := mkRestrPaintings depsCohs2.(_extraDepsCohs); 532 | _cohs := mkCohFrames depsCohs2.(_cohPaintings); 533 | |}. 534 | 535 | Inductive DepsCohs2Extension p: forall k (depsCohs2: DepsCohs2 p k), Type := 536 | | TopCoh2Dep `{depsCohs2: DepsCohs2 p 0} 537 | (E: mkFrame (mkDepsRestr (depsCohs := mkDepsCohs depsCohs2)) -> HSet) 538 | : DepsCohs2Extension p 0 depsCohs2 539 | | AddCoh2Dep {k} (depsCohs2: DepsCohs2 p.+1 k): 540 | DepsCohs2Extension p.+1 k depsCohs2 -> 541 | DepsCohs2Extension p k.+1 depsCohs2.(1). 542 | 543 | Arguments TopCoh2Dep {p depsCohs2}. 544 | Arguments AddCoh2Dep {p k}. 545 | 546 | Declare Scope extra_depscohs2_scope. 547 | Delimit Scope extra_depscohs2_scope with extradepscohs2. 548 | Bind Scope extra_depscohs2_scope with DepsCohs2Extension. 549 | Notation "( x ; y )" := (AddCoh2Dep x y) 550 | (at level 0, format "( x ; y )"): extra_depscohs2_scope. 551 | 552 | Fixpoint mkExtraCohs `{depsCohs2: DepsCohs2 p k} 553 | (extraDepsCohs2: DepsCohs2Extension p k depsCohs2): 554 | DepsCohsExtension p.+1 k (mkDepsCohs depsCohs2). 555 | Proof. 556 | destruct extraDepsCohs2. 557 | - now constructor. 558 | - apply (AddCohDep (mkDepsCohs depsCohs2)). 559 | now exact (mkExtraCohs p.+1 k depsCohs2 extraDepsCohs2). 560 | Defined. 561 | 562 | Fixpoint mkCohPainting `{depsCohs2: DepsCohs2 p k} 563 | (extraDepsCohs2: DepsCohs2Extension p k depsCohs2): 564 | mkCohPaintingType (mkExtraCohs extraDepsCohs2). 565 | Proof. 566 | red; intros *. destruct c as (l, c), r. 567 | - (* r = 0 *) 568 | destruct extraDepsCohs2, depsCohs2. 569 | generalize dependent _extraDepsCohs0. intro. 570 | now refine (match _extraDepsCohs0 with TopCohDep E => _ end). 571 | now reflexivity. 572 | - (* r = r'+1, q is necessarily q'+1 and extraDepsCohs non empty *) 573 | destruct q. 574 | { exfalso; now apply leY_O_contra in Hrq. } 575 | destruct extraDepsCohs2. 576 | { exfalso; now apply leY_O_contra in Hq. } 577 | simpl. 578 | unshelve eapply (rew_existT_curried 579 | (Q := mkPainting depsCohs2.(_depsCohs).(_extraDeps))). 580 | + now exact 581 | (mkCohLayer depsCohs2.(_cohPaintings) r q (Hrq := ⇓ Hrq) ε ω d l). 582 | + now exact (mkCohPainting p.+1 k depsCohs2 extraDepsCohs2 583 | r q (⇓ Hrq) (⇓ Hq) ε ω (d; l) c). 584 | Defined. 585 | 586 | Fixpoint mkCohPaintings `{depsCohs2: DepsCohs2 p k} 587 | (extraDepsCohs2: DepsCohs2Extension p k depsCohs2) {struct p}: 588 | mkCohPaintingTypes (mkExtraCohs extraDepsCohs2). 589 | Proof. 590 | destruct p. 591 | - unshelve esplit. now exact tt. 592 | now exact (mkCohPainting extraDepsCohs2). 593 | - unshelve esplit. now exact (mkCohPaintings p k.+1 594 | depsCohs2.(1)%depscohs2 (depsCohs2; extraDepsCohs2)%extradepscohs2). 595 | now exact (mkCohPainting extraDepsCohs2). 596 | Defined. 597 | 598 | Class νSetData p := { 599 | frames: mkFrameTypes p 0; 600 | paintings: mkPaintingTypes p 0 frames; 601 | restrFrames: mkRestrFrameTypes paintings; 602 | restrPaintings E: mkRestrPaintingTypes (TopRestrDep E); 603 | cohFrames E: mkCohFrameTypes (restrPaintings E); 604 | cohPaintings E E': mkCohPaintingTypes 605 | (depsCohs := toDepsCohs (deps := toDepsRestr restrFrames) (cohFrames E)) 606 | (TopCohDep E'); 607 | }. 608 | 609 | Section νSetData. 610 | Variable p: nat. 611 | Variable C: νSetData p. 612 | Variable E: mkFrame (toDepsRestr C.(restrFrames)) -> HSet. 613 | 614 | #[local] 615 | Instance mkνSetData: νSetData p.+1 := 616 | {| 617 | frames := mkFrames _; 618 | paintings := mkPaintings _; 619 | restrFrames := mkRestrFrames; 620 | restrPaintings E' := mkRestrPaintings (TopCohDep E'); 621 | cohFrames E' := mkCohFrames (C.(cohPaintings) E E'); 622 | cohPaintings E' E'' := 623 | mkCohPaintings (TopCoh2Dep (depsCohs2 := toDepsCohs2 (C.(cohPaintings) E E')) E''); 624 | |}. 625 | End νSetData. 626 | 627 | Class νSet p := { 628 | prefix: Type; 629 | data: prefix -> νSetData p; 630 | }. 631 | 632 | (***************************************************) 633 | (** The construction of [νSet n+1] from [νSet n] *) 634 | 635 | (** Extending the initial prefix *) 636 | Definition mkPrefix p {C: νSet p}: Type := 637 | { D: C.(prefix) &T mkFrame (toDepsRestr (C.(data) D).(restrFrames)) -> HSet }. 638 | 639 | #[local] 640 | Instance mkνSet0: νSet 0. 641 | unshelve esplit. 642 | - now exact hunit. 643 | - unshelve esplit; try now trivial. 644 | Defined. 645 | 646 | #[local] 647 | Instance mkνSet {p} (C: νSet p): νSet p.+1 := 648 | {| 649 | prefix := mkPrefix p; 650 | data := fun D: mkPrefix p => mkνSetData p (C.(data) D.1) D.2; 651 | |}. 652 | 653 | (** An [νSet] truncated up to dimension [n] *) 654 | Fixpoint νSetAt n: νSet n := 655 | match n with 656 | | O => mkνSet0 657 | | n.+1 => mkνSet (νSetAt n) 658 | end. 659 | 660 | CoInductive νSetFrom n (X: (νSetAt n).(prefix)): Type := cons { 661 | this: mkFrame (toDepsRestr ((νSetAt n).(data) X).(restrFrames)) -> HSet; 662 | next: νSetFrom n.+1 (X; this); 663 | }. 664 | 665 | (** The final construction *) 666 | Definition νSets := νSetFrom 0 tt. 667 | 668 | End νSet. 669 | 670 | Definition AugmentedSemiSimplicial := νSets hunit. 671 | Definition SemiSimplicial := νSetFrom hunit 1 (tt; fun _ => hunit). 672 | Definition SemiCubical := νSets hbool. 673 | 674 | (** Some examples *) 675 | 676 | Example SemiSimplicial4 := Eval compute in (νSetAt hunit 4).(prefix _). 677 | Print SemiSimplicial4. 678 | -------------------------------------------------------------------------------- /paper/msclike.bst: -------------------------------------------------------------------------------- 1 | % BibTeX `apalike' bibliography style (version 0.99a, 8-Dec-10), adapted from 2 | % the `alpha' style, version 0.99a; for BibTeX version 0.99a. 3 | % 4 | % Copyright (C) 1988, 2010 Oren Patashnik. 5 | % Unlimited copying and redistribution of this file are permitted as long as 6 | % it is unmodified. Modifications (and redistribution of modified versions) 7 | % are also permitted, but only if the resulting file is renamed. 8 | % 9 | % Differences between this style and `alpha' are generally heralded by a `%'. 10 | % The file btxbst.doc has the documentation for alpha.bst. 11 | % 12 | % This style should be used with the `apalike' LaTeX style (apalike.sty). 13 | % \cite's come out like "(Jones, 1986)" in the text but there are no labels 14 | % in the bibliography, and something like "(1986)" comes out immediately 15 | % after the author. Author (and editor) names appear as last name, comma, 16 | % initials. A `year' field is required for every entry, and so is either 17 | % an author (or in some cases, an editor) field or a key field. 18 | % 19 | % Editorial note: 20 | % Many journals require a style like `apalike', but I strongly, strongly, 21 | % strongly recommend that you not use it if you have a choice---use something 22 | % like `plain' instead. Mary-Claire van Leunen (A Handbook for Scholars, 23 | % Knopf, 1979) argues convincingly that a style like `plain' encourages better 24 | % writing than one like `apalike'. Furthermore the strongest arguments for 25 | % using an author-date style like `apalike'---that it's "the most practical" 26 | % (The Chicago Manual of Style, University of Chicago Press, thirteenth 27 | % edition, 1982, pages 400--401)---fall flat on their face with the new 28 | % computer-typesetting technology. For instance page 401 anachronistically 29 | % states "The chief disadvantage of [a style like `plain'] is that additions 30 | % or deletions cannot be made after the manuscript is typed without changing 31 | % numbers in both text references and list." LaTeX sidesteps the disadvantage. 32 | % 33 | % History: 34 | % 15-sep-86 (OP) Original version by Oren Patashnik, ideas from Susan King. 35 | % 10-nov-86 (OP) Truncated the sort.key$ string to the correct length 36 | % in bib.sort.order to eliminate error message. 37 | % 24-jan-88 (OP) Updated for BibTeX version 0.99a, from alpha.bst 0.99a; 38 | % apalike now sorts by author, then year, then title; 39 | % THIS `apalike' VERSION DOES NOT WORK WITH BIBTEX 0.98i. 40 | % 8-dec-10 (OP) Still version 0.99a, as the code itself was unchanged; 41 | % this release clarified the license. 42 | 43 | ENTRY 44 | { address 45 | author 46 | booktitle 47 | chapter 48 | edition 49 | editor 50 | howpublished 51 | institution 52 | journal 53 | key 54 | % month not used in apalike 55 | note 56 | number 57 | organization 58 | pages 59 | publisher 60 | school 61 | series 62 | title 63 | type 64 | volume 65 | year 66 | } 67 | {} 68 | { label extra.label sort.label } 69 | 70 | INTEGERS { output.state before.all mid.sentence after.sentence after.block } 71 | 72 | FUNCTION {init.state.consts} 73 | { #0 'before.all := 74 | #1 'mid.sentence := 75 | #2 'after.sentence := 76 | #3 'after.block := 77 | } 78 | 79 | STRINGS { s t } 80 | 81 | FUNCTION {output.nonnull} 82 | { 's := 83 | output.state mid.sentence = 84 | { ", " * write$ } 85 | { output.state after.block = 86 | { add.period$ write$ 87 | newline$ 88 | "\newblock " write$ 89 | } 90 | { output.state before.all = 91 | 'write$ 92 | { add.period$ " " * write$ } 93 | if$ 94 | } 95 | if$ 96 | mid.sentence 'output.state := 97 | } 98 | if$ 99 | s 100 | } 101 | 102 | FUNCTION {output} 103 | { duplicate$ empty$ 104 | 'pop$ 105 | 'output.nonnull 106 | if$ 107 | } 108 | 109 | FUNCTION {output.check} 110 | { 't := 111 | duplicate$ empty$ 112 | { pop$ "empty " t * " in " * cite$ * warning$ } 113 | 'output.nonnull 114 | if$ 115 | } 116 | 117 | % apalike needs this function because 118 | % the year has special punctuation; 119 | % apalike ignores the month 120 | FUNCTION {output.year.check} 121 | { year empty$ 122 | { "empty year in " cite$ * warning$ } 123 | { write$ 124 | " " year * extra.label * 125 | mid.sentence 'output.state := 126 | } 127 | if$ 128 | } 129 | 130 | FUNCTION {output.bibitem} 131 | { newline$ 132 | "\bibitem[" write$ 133 | label write$ 134 | "]{" write$ 135 | cite$ write$ 136 | "}" write$ 137 | newline$ 138 | "" 139 | before.all 'output.state := 140 | } 141 | 142 | FUNCTION {fin.entry} 143 | { add.period$ 144 | write$ 145 | newline$ 146 | } 147 | 148 | FUNCTION {new.block} 149 | { output.state before.all = 150 | 'skip$ 151 | { after.block 'output.state := } 152 | if$ 153 | } 154 | 155 | FUNCTION {new.sentence} 156 | { output.state after.block = 157 | 'skip$ 158 | { output.state before.all = 159 | 'skip$ 160 | { after.sentence 'output.state := } 161 | if$ 162 | } 163 | if$ 164 | } 165 | 166 | FUNCTION {not} 167 | { { #0 } 168 | { #1 } 169 | if$ 170 | } 171 | 172 | FUNCTION {and} 173 | { 'skip$ 174 | { pop$ #0 } 175 | if$ 176 | } 177 | 178 | FUNCTION {or} 179 | { { pop$ #1 } 180 | 'skip$ 181 | if$ 182 | } 183 | 184 | FUNCTION {new.block.checkb} 185 | { empty$ 186 | swap$ empty$ 187 | and 188 | 'skip$ 189 | 'new.block 190 | if$ 191 | } 192 | 193 | FUNCTION {field.or.null} 194 | { duplicate$ empty$ 195 | { pop$ "" } 196 | 'skip$ 197 | if$ 198 | } 199 | 200 | FUNCTION {emphasize} 201 | { duplicate$ empty$ 202 | { pop$ "" } 203 | { "{\em " swap$ * "}" * } 204 | if$ 205 | } 206 | 207 | INTEGERS { nameptr namesleft numnames } 208 | 209 | FUNCTION {format.names} 210 | { 's := 211 | #1 'nameptr := 212 | s num.names$ 'numnames := 213 | numnames 'namesleft := 214 | { namesleft #0 > } 215 | { "{\bf " s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ * "}" * 't := % last name first 216 | nameptr #1 > 217 | { namesleft #1 > 218 | { ", " * t * } 219 | { numnames #2 > 220 | { "," * } 221 | 'skip$ 222 | if$ 223 | t "others" = 224 | { " \textbf{et~al.}" * } 225 | { " \textbf{and} " * t * } 226 | if$ 227 | } 228 | if$ 229 | } 230 | 't 231 | if$ 232 | nameptr #1 + 'nameptr := 233 | namesleft #1 - 'namesleft := 234 | } 235 | while$ 236 | } 237 | 238 | FUNCTION {format.authors} 239 | { author empty$ 240 | { "" } 241 | { author format.names } 242 | if$ 243 | } 244 | 245 | FUNCTION {format.key} % this function is just for apalike 246 | { empty$ 247 | { key field.or.null } 248 | { "" } 249 | if$ 250 | } 251 | 252 | FUNCTION {format.editors} 253 | { editor empty$ 254 | { "" } 255 | { editor format.names 256 | editor num.names$ #1 > 257 | { ", editors" * } 258 | { ", editor" * } 259 | if$ 260 | } 261 | if$ 262 | } 263 | 264 | FUNCTION {format.title} 265 | { title empty$ 266 | { "" } 267 | { title "t" change.case$ } 268 | if$ 269 | } 270 | 271 | FUNCTION {n.dashify} 272 | { 't := 273 | "" 274 | { t empty$ not } 275 | { t #1 #1 substring$ "-" = 276 | { t #1 #2 substring$ "--" = not 277 | { "--" * 278 | t #2 global.max$ substring$ 't := 279 | } 280 | { { t #1 #1 substring$ "-" = } 281 | { "-" * 282 | t #2 global.max$ substring$ 't := 283 | } 284 | while$ 285 | } 286 | if$ 287 | } 288 | { t #1 #1 substring$ * 289 | t #2 global.max$ substring$ 't := 290 | } 291 | if$ 292 | } 293 | while$ 294 | } 295 | 296 | FUNCTION {format.btitle} 297 | { title emphasize 298 | } 299 | 300 | FUNCTION {tie.or.space.connect} 301 | { duplicate$ text.length$ #3 < 302 | { "~" } 303 | { " " } 304 | if$ 305 | swap$ * * 306 | } 307 | 308 | FUNCTION {either.or.check} 309 | { empty$ 310 | 'pop$ 311 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 312 | if$ 313 | } 314 | 315 | FUNCTION {format.bvolume} 316 | { volume empty$ 317 | { "" } 318 | { "volume" volume tie.or.space.connect 319 | series empty$ 320 | 'skip$ 321 | { " of " * series emphasize * } 322 | if$ 323 | "volume and number" number either.or.check 324 | } 325 | if$ 326 | } 327 | 328 | FUNCTION {format.number.series} 329 | { volume empty$ 330 | { number empty$ 331 | { series field.or.null } 332 | { output.state mid.sentence = 333 | { "number" } 334 | { "Number" } 335 | if$ 336 | number tie.or.space.connect 337 | series empty$ 338 | { "there's a number but no series in " cite$ * warning$ } 339 | { " in " * series * } 340 | if$ 341 | } 342 | if$ 343 | } 344 | { "" } 345 | if$ 346 | } 347 | 348 | FUNCTION {format.edition} 349 | { edition empty$ 350 | { "" } 351 | { output.state mid.sentence = 352 | { edition "l" change.case$ " edition" * } 353 | { edition "t" change.case$ " edition" * } 354 | if$ 355 | } 356 | if$ 357 | } 358 | 359 | INTEGERS { multiresult } 360 | 361 | FUNCTION {multi.page.check} 362 | { 't := 363 | #0 'multiresult := 364 | { multiresult not 365 | t empty$ not 366 | and 367 | } 368 | { t #1 #1 substring$ 369 | duplicate$ "-" = 370 | swap$ duplicate$ "," = 371 | swap$ "+" = 372 | or or 373 | { #1 'multiresult := } 374 | { t #2 global.max$ substring$ 't := } 375 | if$ 376 | } 377 | while$ 378 | multiresult 379 | } 380 | 381 | FUNCTION {format.pages} 382 | { pages empty$ 383 | { "" } 384 | { pages multi.page.check 385 | { "pp." pages n.dashify tie.or.space.connect } 386 | { "" pages tie.or.space.connect } 387 | if$ 388 | } 389 | if$ 390 | } 391 | 392 | FUNCTION {format.vol.num.pages} 393 | { volume field.or.null 394 | number empty$ 395 | 'skip$ 396 | { "(" number * ")" * * 397 | volume empty$ 398 | { "there's a number but no volume in " cite$ * warning$ } 399 | 'skip$ 400 | if$ 401 | } 402 | if$ 403 | pages empty$ 404 | 'skip$ 405 | { duplicate$ empty$ 406 | { pop$ format.pages } 407 | { ":" * pages n.dashify * } 408 | if$ 409 | } 410 | if$ 411 | } 412 | 413 | FUNCTION {format.chapter.pages} 414 | { chapter empty$ 415 | 'format.pages 416 | { type empty$ 417 | { "chapter" } 418 | { type "l" change.case$ } 419 | if$ 420 | chapter tie.or.space.connect 421 | pages empty$ 422 | 'skip$ 423 | { ", " * format.pages * } 424 | if$ 425 | } 426 | if$ 427 | } 428 | 429 | FUNCTION {format.in.ed.booktitle} 430 | { booktitle empty$ 431 | { "" } 432 | { editor empty$ 433 | { "In " booktitle emphasize * } 434 | { "In " format.editors * ", " * booktitle emphasize * } 435 | if$ 436 | } 437 | if$ 438 | } 439 | 440 | FUNCTION {format.thesis.type} 441 | { type empty$ 442 | 'skip$ 443 | { pop$ 444 | type "t" change.case$ 445 | } 446 | if$ 447 | } 448 | 449 | FUNCTION {format.tr.number} 450 | { type empty$ 451 | { "Technical Report" } 452 | 'type 453 | if$ 454 | number empty$ 455 | { "t" change.case$ } 456 | { number tie.or.space.connect } 457 | if$ 458 | } 459 | 460 | FUNCTION {format.article.crossref} 461 | { "In" % this is for apalike 462 | " \cite{" * crossref * "}" * 463 | } 464 | 465 | FUNCTION {format.book.crossref} 466 | { volume empty$ 467 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ 468 | "In " 469 | } 470 | { "Volume" volume tie.or.space.connect 471 | " of " * 472 | } 473 | if$ 474 | "\cite{" * crossref * "}" * % this is for apalike 475 | } 476 | 477 | FUNCTION {format.incoll.inproc.crossref} 478 | { "In" % this is for apalike 479 | " \cite{" * crossref * "}" * 480 | } 481 | 482 | FUNCTION {article} 483 | { output.bibitem 484 | format.authors "author" output.check 485 | author format.key output % special for 486 | output.year.check % apalike 487 | new.block 488 | format.title "title" output.check 489 | new.block 490 | crossref missing$ 491 | { journal emphasize "journal" output.check 492 | format.vol.num.pages output 493 | } 494 | { format.article.crossref output.nonnull 495 | format.pages output 496 | } 497 | if$ 498 | new.block 499 | note output 500 | fin.entry 501 | } 502 | 503 | FUNCTION {book} 504 | { output.bibitem 505 | author empty$ 506 | { format.editors "author and editor" output.check 507 | editor format.key output 508 | } 509 | { format.authors output.nonnull 510 | crossref missing$ 511 | { "author and editor" editor either.or.check } 512 | 'skip$ 513 | if$ 514 | } 515 | if$ 516 | output.year.check % special for apalike 517 | new.block 518 | format.btitle "title" output.check 519 | crossref missing$ 520 | { format.bvolume output 521 | new.block 522 | format.number.series output 523 | new.sentence 524 | publisher "publisher" output.check 525 | address output 526 | } 527 | { new.block 528 | format.book.crossref output.nonnull 529 | } 530 | if$ 531 | format.edition output 532 | new.block 533 | note output 534 | fin.entry 535 | } 536 | 537 | FUNCTION {booklet} 538 | { output.bibitem 539 | format.authors output 540 | author format.key output % special for 541 | output.year.check % apalike 542 | new.block 543 | format.title "title" output.check 544 | new.block 545 | howpublished output 546 | address output 547 | new.block 548 | note output 549 | fin.entry 550 | } 551 | 552 | FUNCTION {inbook} 553 | { output.bibitem 554 | author empty$ 555 | { format.editors "author and editor" output.check 556 | editor format.key output 557 | } 558 | { format.authors output.nonnull 559 | crossref missing$ 560 | { "author and editor" editor either.or.check } 561 | 'skip$ 562 | if$ 563 | } 564 | if$ 565 | output.year.check % special for apalike 566 | new.block 567 | format.btitle "title" output.check 568 | crossref missing$ 569 | { format.bvolume output 570 | format.chapter.pages "chapter and pages" output.check 571 | new.block 572 | format.number.series output 573 | new.sentence 574 | publisher "publisher" output.check 575 | address output 576 | } 577 | { format.chapter.pages "chapter and pages" output.check 578 | new.block 579 | format.book.crossref output.nonnull 580 | } 581 | if$ 582 | format.edition output 583 | new.block 584 | note output 585 | fin.entry 586 | } 587 | 588 | FUNCTION {incollection} 589 | { output.bibitem 590 | format.authors "author" output.check 591 | author format.key output % special for 592 | output.year.check % apalike 593 | new.block 594 | format.title "title" output.check 595 | new.block 596 | crossref missing$ 597 | { format.in.ed.booktitle "booktitle" output.check 598 | format.bvolume output 599 | format.number.series output 600 | format.chapter.pages output 601 | new.sentence 602 | publisher "publisher" output.check 603 | address output 604 | format.edition output 605 | } 606 | { format.incoll.inproc.crossref output.nonnull 607 | format.chapter.pages output 608 | } 609 | if$ 610 | new.block 611 | note output 612 | fin.entry 613 | } 614 | 615 | FUNCTION {inproceedings} 616 | { output.bibitem 617 | format.authors "author" output.check 618 | author format.key output % special for 619 | output.year.check % apalike 620 | new.block 621 | format.title "title" output.check 622 | new.block 623 | crossref missing$ 624 | { format.in.ed.booktitle "booktitle" output.check 625 | format.bvolume output 626 | format.number.series output 627 | format.pages output 628 | address output % for apalike 629 | new.sentence % there's no year 630 | organization output % here so things 631 | publisher output % are simpler 632 | } 633 | { format.incoll.inproc.crossref output.nonnull 634 | format.pages output 635 | } 636 | if$ 637 | new.block 638 | note output 639 | fin.entry 640 | } 641 | 642 | FUNCTION {conference} { inproceedings } 643 | 644 | FUNCTION {manual} 645 | { output.bibitem 646 | format.authors output 647 | author format.key output % special for 648 | output.year.check % apalike 649 | new.block 650 | format.btitle "title" output.check 651 | organization address new.block.checkb 652 | organization output 653 | address output 654 | format.edition output 655 | new.block 656 | note output 657 | fin.entry 658 | } 659 | 660 | FUNCTION {mastersthesis} 661 | { output.bibitem 662 | format.authors "author" output.check 663 | author format.key output % special for 664 | output.year.check % apalike 665 | new.block 666 | format.title "title" output.check 667 | new.block 668 | "Master's thesis" format.thesis.type output.nonnull 669 | school "school" output.check 670 | address output 671 | new.block 672 | note output 673 | fin.entry 674 | } 675 | 676 | FUNCTION {misc} 677 | { output.bibitem 678 | format.authors output 679 | author format.key output % special for 680 | output.year.check % apalike 681 | new.block 682 | format.title output 683 | new.block 684 | howpublished output 685 | new.block 686 | note output 687 | fin.entry 688 | } 689 | 690 | FUNCTION {phdthesis} 691 | { output.bibitem 692 | format.authors "author" output.check 693 | author format.key output % special for 694 | output.year.check % apalike 695 | new.block 696 | format.btitle "title" output.check 697 | new.block 698 | "PhD thesis" format.thesis.type output.nonnull 699 | school "school" output.check 700 | address output 701 | new.block 702 | note output 703 | fin.entry 704 | } 705 | 706 | FUNCTION {proceedings} 707 | { output.bibitem 708 | format.editors output 709 | editor format.key output % special for 710 | output.year.check % apalike 711 | new.block 712 | format.btitle "title" output.check 713 | format.bvolume output 714 | format.number.series output 715 | address output % for apalike 716 | new.sentence % we always output 717 | organization output % a nonempty organization 718 | publisher output % here 719 | new.block 720 | note output 721 | fin.entry 722 | } 723 | 724 | FUNCTION {techreport} 725 | { output.bibitem 726 | format.authors "author" output.check 727 | author format.key output % special for 728 | output.year.check % apalike 729 | new.block 730 | format.title "title" output.check 731 | new.block 732 | format.tr.number output.nonnull 733 | institution "institution" output.check 734 | address output 735 | new.block 736 | note output 737 | fin.entry 738 | } 739 | 740 | FUNCTION {unpublished} 741 | { output.bibitem 742 | format.authors "author" output.check 743 | author format.key output % special for 744 | output.year.check % apalike 745 | new.block 746 | format.title "title" output.check 747 | new.block 748 | note "note" output.check 749 | fin.entry 750 | } 751 | 752 | FUNCTION {default.type} { misc } 753 | 754 | MACRO {jan} {"January"} 755 | 756 | MACRO {feb} {"February"} 757 | 758 | MACRO {mar} {"March"} 759 | 760 | MACRO {apr} {"April"} 761 | 762 | MACRO {may} {"May"} 763 | 764 | MACRO {jun} {"June"} 765 | 766 | MACRO {jul} {"July"} 767 | 768 | MACRO {aug} {"August"} 769 | 770 | MACRO {sep} {"September"} 771 | 772 | MACRO {oct} {"October"} 773 | 774 | MACRO {nov} {"November"} 775 | 776 | MACRO {dec} {"December"} 777 | 778 | MACRO {acmcs} {"ACM Computing Surveys"} 779 | 780 | MACRO {acta} {"Acta Informatica"} 781 | 782 | MACRO {cacm} {"Communications of the ACM"} 783 | 784 | MACRO {ibmjrd} {"IBM Journal of Research and Development"} 785 | 786 | MACRO {ibmsj} {"IBM Systems Journal"} 787 | 788 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"} 789 | 790 | MACRO {ieeetc} {"IEEE Transactions on Computers"} 791 | 792 | MACRO {ieeetcad} 793 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} 794 | 795 | MACRO {ipl} {"Information Processing Letters"} 796 | 797 | MACRO {jacm} {"Journal of the ACM"} 798 | 799 | MACRO {jcss} {"Journal of Computer and System Sciences"} 800 | 801 | MACRO {scp} {"Science of Computer Programming"} 802 | 803 | MACRO {sicomp} {"SIAM Journal on Computing"} 804 | 805 | MACRO {tocs} {"ACM Transactions on Computer Systems"} 806 | 807 | MACRO {tods} {"ACM Transactions on Database Systems"} 808 | 809 | MACRO {tog} {"ACM Transactions on Graphics"} 810 | 811 | MACRO {toms} {"ACM Transactions on Mathematical Software"} 812 | 813 | MACRO {toois} {"ACM Transactions on Office Information Systems"} 814 | 815 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} 816 | 817 | MACRO {tcs} {"Theoretical Computer Science"} 818 | 819 | READ 820 | 821 | FUNCTION {sortify} 822 | { purify$ 823 | "l" change.case$ 824 | } 825 | 826 | INTEGERS { len } 827 | 828 | FUNCTION {chop.word} 829 | { 's := 830 | 'len := 831 | s #1 len substring$ = 832 | { s len #1 + global.max$ substring$ } 833 | 's 834 | if$ 835 | } 836 | 837 | % There are three apalike cases: one person (Jones), 838 | % two (Jones and de~Bruijn), and more (Jones et~al.). 839 | % This function is much like format.crossref.editors. 840 | % 841 | FUNCTION {format.lab.names} 842 | { 's := 843 | s #1 "{vv~}{ll}" format.name$ 844 | s num.names$ duplicate$ 845 | #2 > 846 | { pop$ " et~al." * } 847 | { #2 < 848 | 'skip$ 849 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = 850 | { " et~al." * } 851 | { " and " * s #2 "{vv~}{ll}" format.name$ * } 852 | if$ 853 | } 854 | if$ 855 | } 856 | if$ 857 | } 858 | 859 | FUNCTION {author.key.label} 860 | { author empty$ 861 | { key empty$ 862 | { cite$ #1 #3 substring$ } 863 | 'key % apalike uses the whole key 864 | if$ 865 | } 866 | { author format.lab.names } 867 | if$ 868 | } 869 | 870 | FUNCTION {author.editor.key.label} 871 | { author empty$ 872 | { editor empty$ 873 | { key empty$ 874 | { cite$ #1 #3 substring$ } 875 | 'key % apalike uses the whole key 876 | if$ 877 | } 878 | { editor format.lab.names } 879 | if$ 880 | } 881 | { author format.lab.names } 882 | if$ 883 | } 884 | 885 | FUNCTION {editor.key.label} 886 | { editor empty$ 887 | { key empty$ 888 | { cite$ #1 #3 substring$ } 889 | 'key % apalike uses the whole key, no organization 890 | if$ 891 | } 892 | { editor format.lab.names } 893 | if$ 894 | } 895 | 896 | FUNCTION {calc.label} 897 | { type$ "book" = 898 | type$ "inbook" = 899 | or 900 | 'author.editor.key.label 901 | { type$ "proceedings" = 902 | 'editor.key.label % apalike ignores organization 903 | 'author.key.label % for labeling and sorting 904 | if$ 905 | } 906 | if$ 907 | ", " % these three lines are 908 | * % for apalike, which 909 | year field.or.null purify$ #-1 #4 substring$ % uses all four digits 910 | * 911 | 'label := 912 | } 913 | 914 | FUNCTION {sort.format.names} 915 | { 's := 916 | #1 'nameptr := 917 | "" 918 | s num.names$ 'numnames := 919 | numnames 'namesleft := 920 | { namesleft #0 > } 921 | { nameptr #1 > 922 | { " " * } 923 | 'skip$ 924 | if$ % apalike uses initials 925 | s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't := % <= here 926 | nameptr numnames = t "others" = and 927 | { "et al" * } 928 | { t sortify * } 929 | if$ 930 | nameptr #1 + 'nameptr := 931 | namesleft #1 - 'namesleft := 932 | } 933 | while$ 934 | } 935 | 936 | FUNCTION {sort.format.title} 937 | { 't := 938 | "A " #2 939 | "An " #3 940 | "The " #4 t chop.word 941 | chop.word 942 | chop.word 943 | sortify 944 | #1 global.max$ substring$ 945 | } 946 | 947 | FUNCTION {author.sort} 948 | { author empty$ 949 | { key empty$ 950 | { "to sort, need author or key in " cite$ * warning$ 951 | "" 952 | } 953 | { key sortify } 954 | if$ 955 | } 956 | { author sort.format.names } 957 | if$ 958 | } 959 | 960 | FUNCTION {author.editor.sort} 961 | { author empty$ 962 | { editor empty$ 963 | { key empty$ 964 | { "to sort, need author, editor, or key in " cite$ * warning$ 965 | "" 966 | } 967 | { key sortify } 968 | if$ 969 | } 970 | { editor sort.format.names } 971 | if$ 972 | } 973 | { author sort.format.names } 974 | if$ 975 | } 976 | 977 | FUNCTION {editor.sort} 978 | { editor empty$ 979 | { key empty$ 980 | { "to sort, need editor or key in " cite$ * warning$ 981 | "" 982 | } 983 | { key sortify } 984 | if$ 985 | } 986 | { editor sort.format.names } 987 | if$ 988 | } 989 | 990 | % apalike uses two sorting passes; the first one sets the 991 | % labels so that the `a's, `b's, etc. can be computed; 992 | % the second pass puts the references in "correct" order. 993 | % The presort function is for the first pass. It computes 994 | % label, sort.label, and title, and then concatenates. 995 | FUNCTION {presort} 996 | { calc.label 997 | label sortify 998 | " " 999 | * 1000 | type$ "book" = 1001 | type$ "inbook" = 1002 | or 1003 | 'author.editor.sort 1004 | { type$ "proceedings" = 1005 | 'editor.sort 1006 | 'author.sort 1007 | if$ 1008 | } 1009 | if$ 1010 | #1 entry.max$ substring$ % for 1011 | 'sort.label := % apalike 1012 | sort.label % style 1013 | * 1014 | " " 1015 | * 1016 | title field.or.null 1017 | sort.format.title 1018 | * 1019 | #1 entry.max$ substring$ 1020 | 'sort.key$ := 1021 | } 1022 | 1023 | ITERATE {presort} 1024 | 1025 | SORT % by label, sort.label, title---for final label calculation 1026 | 1027 | STRINGS { last.label next.extra } % apalike labels are only for the text; 1028 | 1029 | INTEGERS { last.extra.num } % there are none in the bibliography 1030 | 1031 | FUNCTION {initialize.extra.label.stuff} % and hence there is no `longest.label' 1032 | { #0 int.to.chr$ 'last.label := 1033 | "" 'next.extra := 1034 | #0 'last.extra.num := 1035 | } 1036 | 1037 | FUNCTION {forward.pass} 1038 | { last.label label = 1039 | { last.extra.num #1 + 'last.extra.num := 1040 | last.extra.num int.to.chr$ 'extra.label := 1041 | } 1042 | { "a" chr.to.int$ 'last.extra.num := 1043 | "" 'extra.label := 1044 | label 'last.label := 1045 | } 1046 | if$ 1047 | } 1048 | 1049 | FUNCTION {reverse.pass} 1050 | { next.extra "b" = 1051 | { "a" 'extra.label := } 1052 | 'skip$ 1053 | if$ 1054 | label extra.label * 'label := 1055 | extra.label 'next.extra := 1056 | } 1057 | 1058 | EXECUTE {initialize.extra.label.stuff} 1059 | 1060 | ITERATE {forward.pass} 1061 | 1062 | REVERSE {reverse.pass} 1063 | 1064 | % Now that the label is right we sort for real, 1065 | % on sort.label then year then title. This is 1066 | % for the second sorting pass. 1067 | FUNCTION {bib.sort.order} 1068 | { sort.label 1069 | " " 1070 | * 1071 | year field.or.null sortify 1072 | * 1073 | " " 1074 | * 1075 | title field.or.null 1076 | sort.format.title 1077 | * 1078 | #1 entry.max$ substring$ 1079 | 'sort.key$ := 1080 | } 1081 | 1082 | ITERATE {bib.sort.order} 1083 | 1084 | SORT % by sort.label, year, title---giving final bibliography order 1085 | 1086 | FUNCTION {begin.bib} 1087 | { preamble$ empty$ % no \etalchar in apalike 1088 | 'skip$ 1089 | { preamble$ write$ newline$ } 1090 | if$ 1091 | "\begin{thebibliography}{}" write$ newline$ % no labels in apalike 1092 | } 1093 | 1094 | EXECUTE {begin.bib} 1095 | 1096 | EXECUTE {init.state.consts} 1097 | 1098 | ITERATE {call.type$} 1099 | 1100 | FUNCTION {end.bib} 1101 | { newline$ 1102 | "\end{thebibliography}" write$ newline$ 1103 | } 1104 | 1105 | EXECUTE {end.bib} 1106 | -------------------------------------------------------------------------------- /paper/restruct-new.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[a4paper, margin=2em]{geometry} 3 | 4 | \usepackage{hyperref, amssymb, stmaryrd, url, xcolor, amsmath, graphicx, yfonts, tikz, enumitem} 5 | \usetikzlibrary{cd, arrows} 6 | \setlist[enumerate]{left=0pt,nosep} 7 | 8 | \newcommand{\defeq}{\triangleq} 9 | \newcommand{\U}{\ensuremath{\mathsf{{HSet}}}} 10 | \newcommand{\myframe}{\mathit{frame}} 11 | \newcommand{\myframetype}{\mathit{frametype}} 12 | \newcommand{\painting}{\mathit{painting}} 13 | \newcommand{\paintingtype}{\mathit{paintingtype}} 14 | \newcommand{\restrframe}{\mathit{restrframe}} 15 | \newcommand{\restrframetype}{\mathit{restrframetype}} 16 | \newcommand{\restrpainting}{\mathit{restrpainting}} 17 | \newcommand{\cohframe}{\mathit{cohframe}} 18 | \newcommand{\cohpainting}{\mathit{cohpainting}} 19 | 20 | \newcommand{\udensdash}[1]{% 21 | \tikz[baseline=(todotted.base)]{ 22 | \node[inner sep=1pt,outer sep=0pt] (todotted) {$#1$}; 23 | \draw[densely dashed] (todotted.south west) -- (todotted.south east); 24 | }% 25 | }% 26 | 27 | \begin{document} 28 | 29 | \title{On the specific recursive structure of iterated parametricity} 30 | 31 | \maketitle 32 | 33 | \begin{abstract} 34 | In a previous paper, we gave equations describing the construction 35 | of semi-simplicial and semi-cubical sets via iterated parametricity. 36 | The construction was formalised in the Rocq (ex-Coq) proof assistant 37 | building $n$-truncated sets using an induction on a large structure 38 | embedding equational reasoning. 39 | 40 | The current paper describes a new and lighter presentation of the 41 | construction where equational reasoning is replaced by 42 | definition. Being lighter, it can now be described in full details, 43 | closely following the corresponding new machine-checked 44 | formalisation. 45 | \end{abstract} 46 | 47 | \section{The recursive structure of iterated parametricity} 48 | Iterated parametricity (in indexed form) produces a family of type 49 | families of the following form: 50 | \begin{equation*} 51 | \begin{array}{llr} 52 | X_0 & : & \U \\ 53 | X_1 & : & X_0 \times X_0 \rightarrow \U \\ 54 | X_2 & : \Pi a b c d. & X_1(a,b) \times X_1 (c,d) \times X_1(a,c) \times X_1 (b,d) \rightarrow \U \\ 55 | \ldots 56 | \end{array} 57 | \end{equation*} 58 | 59 | Such family can be recursively described by the equations given on Table ?. 60 | 61 | The well-foundedness of the construction can be justified by the observation that: 62 | \begin{itemize} 63 | \item Defining $\myframe^{n,p}$ for $p \leq n$ requires the definition 64 | of $\painting^{n-1,p-1}$, thus also $\myframe^{n-1,p-1}$ by typing 65 | dependency, as well as $\restrframe^{n,p-1}$, where 66 | $\restrframe^{n,p-1}$ in turn depends in $\myframe^{n,p-1}$ for its 67 | typing. 68 | 69 | Moreover, $\myframe^{n,p}$ depends on $\myframe^{n,p-1}$, so these 70 | dependencies are between the blocks of $\myframe^{n,k}$ for all 71 | $k\leq p$, as well as $\myframe^{n-1,k}$, $\painting^{n-1,k}$ and 72 | $\restrframe^{n,k}$ for all $k\leq p-1$, which we respectively 73 | abbreviate as $\myframe^{n,[0,...,p]}$, 74 | $\myframe^{n-1,[0,...,p-1]}$, $\painting^{n-1,[0,...,p-1]}$ and 75 | $\restrframe^{n,[0,...,p-1]}$. 76 | 77 | Also, $\restrframe^{n,p-1}$ depends on $n$. 78 | 79 | Schematically, using dotted arrows for dependencies in 80 | the type and plain arrows for dependencies in the definition, this 81 | gives the following dependencies for $p\leq n$ fixed: 82 | \begin{center} 83 | \begin{tikzcd} 84 | \myframe^{n,[0,...,p]} \arrow[d] \arrow[ddr]\\ 85 | \painting^{n-1,[0,...,p-1]} \arrow[d, dotted] \\ 86 | \myframe^{n-1,[0,...,p-1]} & 87 | \restrframe^{n,[0,...,p-1]} \arrow[l, dotted] \arrow[uul, dotted, "\mbox{$[0,...,p-1]$}"', near start, shift right=2mm, hook']\\ 88 | \end{tikzcd} 89 | \end{center} 90 | 91 | In particular, the mutual dependency on one side of 92 | $\myframe^{n,[0,...,p-1]}$ within the type of 93 | $\restrframe^{n,[0,...,p-1]}$ and on the other side of 94 | $\restrframe^{n,[0,...,p-1]}$ within the definition of 95 | $\myframe^{n,[0,...,p]}$ requires to mutually define the type of 96 | $\restrframe^{n,[0,...,p-1]}$ together with $\myframe^{n,p}$ (or 97 | $\myframe^{n,[0,...,p]}$) as a function from 98 | $\restrframe^{n,[0,...,p-1]}$. 99 | 100 | To talk about sequences of $\myframe$, $\painting$ or $\restrframe$, 101 | we need to specify their types. The type of $\restrframe$ will be 102 | defined mutually with $\myframe$ of the same level, but the type of 103 | $\myframe$, $\painting$ can be defined in advance, the second one 104 | being however dependent on the first one. In general, components of 105 | such sequences will have a type dependent on the previous components 106 | of the sequence, as it is the case for $\restrframe$. So, the type of 107 | a sequence of length $p$ will be expressed as a $n$-iterated 108 | $\Sigma$-type. In the case of $\myframe$ and $\painting$, there will 109 | be however no dependency, so an ordinary product can be used. If 110 | $\myframe^{n,[0,...,p]}$ is such a sequence of length $p+1$, we write 111 | $\myframe^{n,[0,...,p-1]}$ for its immediate subsequence of length $p$ 112 | and $\myframe^{n,p}$ for its last component. We can now define the 113 | types of sequences of $\myframe$ and $\painting$ as follows: 114 | 115 | $$ 116 | \begin{array}{llcl} 117 | \myframetype^{n,[0,...,p]} & & : & Type_{l+1} \\ 118 | \myframetype^{n,[]} & & \defeq & unit \\ 119 | \myframetype^{n,[0,...,p]} & & \defeq & \myframetype^{n,[0,...,p-1]} \times Type_l \\ 120 | \\ 121 | \paintingtype^{n,[0,...,p]} & (\myframe^{n,[0,...,p]}:\myframetype^{n,[0,...,p]}) & : & Type_{l+1} \\ 122 | \paintingtype^{n,[]} & \star & \defeq & unit \\ 123 | \paintingtype^{n,[0,...,p]} & (\myframe^{n,[0,...,p]}) & \defeq & \paintingtype^{n,[0,...,p-1]}(\myframe^{n,[0,...,p-1]}) \times (\myframe^{n,p} \rightarrow Type_l) \\ 124 | \end{array} 125 | $$ 126 | 127 | Formally, this can be described as: 128 | $$ 129 | \begin{array}{llcl} 130 | \myframe^{n,[0,...,p]} & 131 | \multicolumn{3}{l}{ 132 | \left(\begin{array}{l} 133 | \myframe^{n-1,[0,...,p-1]}:\myframetype^{n-1,[0,...,p-1]} \\ 134 | \painting^{n-1,[0,...,p-1]}:\paintingtype^{n-1,[0,...,p-1]}(\myframe^{n-1,[0,...,p-1]}) \\ 135 | \restrframe^{n,[0,...,p-1]}:\restrframetype^{n,[0,...,p-1]} 136 | \left(\begin{array}{l} 137 | \myframe^{n-1,[0,...,p-1]} \\ 138 | \painting^{n-1,[0,...,p-1]} \\ 139 | \end{array}\right) \\ 140 | \end{array}\right) : \myframetype^{n-1,[0,...,p]} 141 | } \\ 142 | \myframe^{n,[0]} & 143 | \left(\begin{array}{l} 144 | \star \\ 145 | \star \\ 146 | \star \\ 147 | \end{array}\right) & \defeq & (\star,unit) \\ 148 | \myframe^{n,[0,...,p+1]} & 149 | \left(\begin{array}{l} 150 | \myframe^{n-1,[0,...,p]} \\ 151 | \painting^{n-1,[0,...,p]} \\ 152 | \restrframe^{n,[0,...,p]} \\ 153 | \end{array}\right) & \defeq & 154 | \left(\begin{array}{l} 155 | \myframe^{n,[0,...,p]} 156 | \left(\begin{array}{l} 157 | \myframe^{n-1,[0,...,p-1]} \\ 158 | \painting^{n-1,[0,...,p-1]} \\ 159 | \restrframe^{n,[0,...,p-1]} \\ 160 | \end{array}\right) , \\ 161 | \Sigma d:\myframe^{n,[0,...,p]} 162 | \left(\begin{array}{l} 163 | \myframe^{n-1,[0,...,p-1]} \\ 164 | \painting^{n-1,[0,...,p-1]} \\ 165 | \restrframe^{n,[0,...,p-1]} \\ 166 | \end{array}\right).\, \\ 167 | \quad \Pi\omega.\,\painting^{n-1,p}(\restrframe^{n,p}(d)) \\ 168 | \end{array}\right) \\ 169 | \restrframetype^{n,[0,...,p-1]} & 170 | \multicolumn{3}{l}{ 171 | \left(\begin{array}{l} 172 | \myframe^{n-1,[0,...,p-1]}:\myframetype^{n-1,[0,...,p-1]} \\ 173 | \painting^{n-1,[0,...,p-1]}:\paintingtype^{n-1,[0,...,p-1]}(\myframe^{n-1,[0,...,p-1]}) \\ 174 | \end{array}\right) : Type_{l} 175 | } \\ 176 | \restrframetype^{n,[]} & 177 | \left(\begin{array}{l} 178 | \star \\ 179 | \star \\ 180 | \end{array}\right) & \defeq & 181 | unit \\ 182 | \restrframetype^{n,[0,...,p]} & 183 | \left(\begin{array}{l} 184 | \myframe^{n-1,[0,...,p]} \\ 185 | \painting^{n-1,[0,...,p]} \\ 186 | \end{array}\right) & \defeq & 187 | \begin{array}{l} 188 | \Sigma \restrframe^{n,[0,...,p-1]} \\ 189 | \quad:\restrframetype^{n,[0,...,p-1]} 190 | \left(\begin{array}{l} 191 | \myframe^{n-1,[0,...,p-1]} \\ 192 | \painting^{n-1,[0,...,p-1]} \\ 193 | \end{array}\right) 194 | .\, \\ 195 | \Pi q\leq n.\,\Pi \omega.\,\myframe^{n,[0,...,p]} 196 | \left(\begin{array}{l} 197 | \myframe^{n-1,[0,...,p-1]} \\ 198 | \painting^{n-1,[0,...,p-1]} \\ 199 | \restrframe^{n,[0,...,p-1]} \\ 200 | \end{array}\right) \\ 201 | \end{array} \\ 202 | \end{array} 203 | $$ 204 | 205 | Or, alternatively, as: 206 | $$\!\!\!\!\!\!\!\!\!\!\!\! 207 | \begin{array}{llcl} 208 | \restrframetype^{n,[0,...,p-1]} & 209 | \multicolumn{3}{l}{ 210 | \left(\begin{array}{l} 211 | \myframe^{n-1,[0,...,p-1]}:\myframetype^{n-1,[0,...,p-1]} \\ 212 | \painting^{n-1,[0,...,p-1]}:\paintingtype^{n-1,[0,...,p-1]}(\myframe^{n-1,[0,...,p-1]}) \\ 213 | \end{array}\right) : Type_{l} 214 | } \\ 215 | \restrframetype^{n,[]} & 216 | \left(\begin{array}{l} 217 | \star \\ 218 | \star \\ 219 | \end{array}\right) & \defeq & 220 | unit \\ 221 | \restrframetype^{n,[0,...,p]} & 222 | \left(\begin{array}{l} 223 | \myframe^{n-1,[0,...,p]} \\ 224 | \painting^{n-1,[0,...,p]} \\ 225 | \end{array}\right) & \defeq & 226 | \begin{array}{l} 227 | \Sigma \restrframe^{n,[0,...,p-1]} \\ 228 | \quad:\restrframetype^{n,[0,...,p-1]} 229 | \left(\begin{array}{l} 230 | \myframe^{n-1,[0,...,p-1]} \\ 231 | \painting^{n-1,[0,...,p-1]} \\ 232 | \end{array}\right) 233 | .\, \\ 234 | \Pi q\leq n.\,\Pi \omega.\,\myframe^{n,[0,...,p]} 235 | \left(\begin{array}{l} 236 | \myframe^{n-1,[0,...,p-1]} \\ 237 | \painting^{n-1,[0,...,p-1]} \\ 238 | \end{array}\right)(\restrframe^{n,[0,...,p-1]}) \\ 239 | \end{array} \\ 240 | \myframe^{n,[0,...,p]} & 241 | \multicolumn{3}{l}{ 242 | \left(\begin{array}{l} 243 | \myframe^{n-1,[0,...,p-1]}:\myframetype^{n-1,[0,...,p-1]} \\ 244 | \painting^{n-1,[0,...,p-1]}:\paintingtype^{n-1,[0,...,p-1]}(\myframe^{n-1,[0,...,p-1]}) \\ 245 | \end{array}\right) : \restrframetype^{n,[0,...,p-1]} 246 | \left(\begin{array}{l} 247 | \myframe^{n-1,[0,...,p-1]} \\ 248 | \painting^{n-1,[0,...,p-1]} \\ 249 | \end{array}\right) \rightarrow \myframetype^{n-1,[0,...,p]} 250 | } \\ 251 | \myframe^{n,[0]} & 252 | \left(\begin{array}{l} 253 | \star \\ 254 | \star \\ 255 | \end{array}\right) & \defeq & \star \mapsto (\star,unit) \\ 256 | \myframe^{n,[0,...,p+1]} & 257 | \left(\begin{array}{l} 258 | \myframe^{n-1,[0,...,p]} \\ 259 | \painting^{n-1,[0,...,p]} \\ 260 | \end{array}\right) & \defeq & 261 | \restrframe^{n,[0,...,p]} \mapsto 262 | \left(\begin{array}{l} 263 | \myframe^{n,[0,...,p]} 264 | \left(\begin{array}{l} 265 | \myframe^{n-1,[0,...,p-1]} \\ 266 | \painting^{n-1,[0,...,p-1]} \\ 267 | \end{array}\right)(\restrframe^{n,[0,...,p-1]}), \\ 268 | \Sigma d:\myframe^{n,[0,...,p]} 269 | \left(\begin{array}{l} 270 | \myframe^{n-1,[0,...,p-1]} \\ 271 | \painting^{n-1,[0,...,p-1]} \\ 272 | \end{array}\right)(\restrframe^{n,[0,...,p-1]}).\, \\ 273 | \quad \Pi\omega.\,\painting^{n-1,p}(\restrframe^{n,p}(d)) \\ 274 | \end{array}\right) \\ 275 | \end{array} 276 | $$ 277 | 278 | Or, even, using an alternative notation, as: 279 | $$\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! 280 | \begin{array}{llcl} 281 | \restrframetype^{n, 739 | p$ to build $\restrframe^{n,k\geq p}$: 740 | 741 | \begin{tiny} 742 | \begin{tikzcd} 743 | & & & frame^{n,p} \arrow[d] \arrow[ddr]\\ 744 | \painting^{n-1,k\geq p} \arrow[d, dotted] \arrow[dddr] \arrow[dd, bend right=70] & & & painting^{n-1,p} \arrow[ddlll] \arrow[dddll] \arrow[d, dotted] \\ 745 | \myframe^{n-1,k\geq p} \arrow[d] \arrow[ddr] & \restrframe^{n,k\geq p} \arrow[d] \arrow[ddr] \arrow[l, dotted] & & frame^{n-1,p} \arrow[d] \arrow[ddr] & \restrframe^{n,k 775 | p$ to also get $\restrpainting^{n,p}$ for all $p \leq n-1$: 776 | 777 | \begin{tiny} 778 | \begin{tikzcd} 779 | & & & painting^{n,p} \arrow[ddlll] \arrow[dddr] \arrow[d, dotted]\\ 780 | & & & frame^{n,p} \arrow[d] \arrow[ddr]\\ 781 | \painting^{n-1,k\geq p} \arrow[d, dotted] \arrow[dddr] \arrow[dd, bend right=70] & & & painting^{n-1,p} \arrow[ddlll] \arrow[dddll] \arrow[d, dotted] & \restrpainting^{n,k