├── .gitmodules ├── src ├── .gitignore ├── 0005.rkt ├── 007F.rkt ├── lib │ ├── math │ │ ├── univalence.rkt │ │ ├── function.rkt │ │ ├── set.rkt │ │ ├── tex.rkt │ │ ├── cofiber.rkt │ │ ├── ackermann.rkt │ │ ├── embedding.rkt │ │ ├── suspension.rkt │ │ ├── funext.rkt │ │ ├── surjection.rkt │ │ ├── level.rkt │ │ ├── connected.rkt │ │ ├── sphere.rkt │ │ ├── cocone.rkt │ │ ├── magma.rkt │ │ ├── empty.rkt │ │ ├── qinv.rkt │ │ ├── refl-graph.rkt │ │ ├── hae.rkt │ │ ├── id-over.rkt │ │ ├── pointed-type.rkt │ │ ├── proposition.rkt │ │ ├── universe.rkt │ │ ├── nat-trans.rkt │ │ ├── nat.rkt │ │ ├── group.rkt │ │ ├── coproduct.rkt │ │ ├── biinv.rkt │ │ ├── ring.rkt │ │ ├── pair.rkt │ │ ├── truncation.rkt │ │ ├── bifunctor.rkt │ │ └── paren-level.rkt │ ├── markup │ │ ├── axiom.rkt │ │ ├── lemma.rkt │ │ ├── proof.rkt │ │ ├── rule.rkt │ │ ├── example.rkt │ │ ├── remark.rkt │ │ ├── exercise.rkt │ │ ├── notation.rkt │ │ ├── theorem.rkt │ │ ├── comparison.rkt │ │ ├── corollary.rkt │ │ ├── definition.rkt │ │ ├── proposition.rkt │ │ └── terminology.rkt │ ├── math.rkt │ ├── index │ │ └── notation.rkt │ └── bibliography.rkt ├── 007X.rkt ├── 002R.rkt ├── 004G.rkt ├── 005W.rkt ├── 000Z.rkt ├── Hovey--1999-0000.rkt ├── Pierce--2002-0000.rkt ├── 0020.rkt ├── 001O.rkt ├── 0021.rkt ├── Quillen--1967-0000.rkt ├── Lambek--Scott--1986-0000.rkt ├── 0019.rkt ├── Lurie--2009-0000.rkt ├── 0015.rkt ├── 006O.rkt ├── HoTT-Book.rkt ├── 0044.rkt ├── 005A.rkt ├── 0088.rkt ├── 0017.rkt ├── 001B.rkt ├── Church--1940-0000.rkt ├── 001I.rkt ├── Russell--1908-0000.rkt ├── 000I.rkt ├── Hedberg--1998-0000.rkt ├── Martin-Loef--1975-0000.rkt ├── 001G.rkt ├── Streicher--1993-0000.rkt ├── 0086.rkt ├── 004N.rkt ├── Lumsdaine--2010-0000.rkt ├── 0059.rkt ├── 006M.rkt ├── 000R.rkt ├── 0018.rkt ├── 000Y.rkt ├── 007H.rkt ├── van-den-Berg--Garner--2011-0000.rkt ├── 0052.rkt ├── 004M.rkt ├── 005X.rkt ├── 000G.rkt ├── 000M.rkt ├── 001H.rkt ├── 0010.rkt ├── 006R.rkt ├── 002M.rkt ├── 0043.rkt ├── Kapulkin--Lumsdaine--2021-0000.rkt ├── 0004.rkt ├── 0057.rkt ├── 005T.rkt ├── 000V.rkt ├── 000W.rkt ├── 005N.rkt ├── 0027.rkt ├── 001U.rkt ├── 004K.rkt ├── 006J.rkt ├── 0073.rkt ├── latex-config.rkt ├── 006U.rkt ├── 002P.rkt ├── 000D.rkt ├── 0060.rkt ├── 0065.rkt ├── 004C.rkt ├── 0064.rkt ├── 007U.rkt ├── 0047.rkt ├── 0061.rkt ├── 0040.rkt ├── 007T.rkt ├── 001P.rkt ├── 0053.rkt ├── 002W.rkt ├── 0075.rkt ├── 006I.rkt ├── 004O.rkt ├── 0071.rkt ├── 006P.rkt ├── 000N.rkt ├── 000K.rkt ├── 005H.rkt ├── 004S.rkt ├── 0079.rkt ├── 007E.rkt ├── 000F.rkt ├── 001M.rkt ├── 001Q.rkt ├── 0026.rkt ├── 005Q.rkt ├── 0084.rkt ├── 005F.rkt ├── 007V.rkt ├── 004U.rkt ├── 004Q.rkt ├── 005Y.rkt ├── 0013.rkt ├── 0011.rkt ├── 000T.rkt ├── 0054.rkt ├── 005U.rkt ├── 007W.rkt ├── 001Z.rkt ├── 007B.rkt ├── 0087.rkt ├── 008B.rkt ├── 002C.rkt ├── 0012.rkt ├── 0085.rkt ├── 008A.rkt ├── 0068.rkt ├── 007M.rkt ├── 0089.rkt ├── 0072.rkt └── 004V.rkt ├── .gitignore ├── dependency ├── .gitignore └── info.rkt ├── src-0 ├── latexmkrc ├── my-ref.sty ├── my-term.sty ├── my-label.sty ├── node-007F-index.tex ├── my-hyperref.sty ├── node-007G-node-index.tex ├── node-0005-homotopy-theory.tex ├── node-007E-bibliography.tex ├── node-002R-pentagon.tex ├── main.tex ├── node-0008-introduction.tex ├── node-004G-empty-prop.tex ├── my-block.sty ├── node-005W.tex ├── custom.ist ├── node-000Z-univalence-axiom.tex ├── node-0007-mathematics.tex ├── node-0020-funext-axiom.tex ├── my-sns.sty ├── .gitignore ├── node-0019-symmetry-iso.tex ├── node-006O.tex ├── node-0015-curry-iso.tex ├── node-0033-pushout.tex ├── node-0032-circle.tex ├── node-000D-level.tex ├── node-0021-univalence-implies-funext.tex ├── node-0003-higher-inductive-type.tex ├── node-0044.tex ├── node-007H-contributors.tex ├── node-005A.tex ├── node-006R.tex ├── my-bibliography.sty ├── node-0006-foundations.tex ├── node-003F.tex ├── node-000I-type-family.tex ├── node-000M-simple-pair.tex ├── node-006M.tex ├── node-000G-function-type-rule.tex ├── node-001O.tex ├── node-0059-lem.tex ├── my-math.sty ├── node-0010-identity.tex ├── node-003T.tex ├── node-0064.tex ├── node-0017-associativity-iso.tex ├── node-001B-distributive-iso.tex ├── node-003I.tex ├── node-005N-sip-precategory.tex ├── node-0018-symmetry.tex ├── node-001I-functor-comparison.tex ├── node-004N-equivalence.tex ├── node-006U.tex ├── node-006V-yoneda-lemma.tex ├── my-preamble.sty ├── node-000Y-univalence.tex ├── node-0043.tex ├── node-004C-set.tex ├── node-0052.tex ├── node-005X.tex ├── node-000V-equivalence.tex ├── node-001G-transport-comparison.tex ├── node-0040-proposition.tex ├── node-005F.tex ├── node-0073.tex ├── node-004M.tex ├── node-006P-yoneda.tex ├── node-0071.tex ├── node-004K.tex ├── node-0053-n-type.tex ├── node-0060.tex ├── node-0057-logic.tex ├── node-001U.tex ├── node-006J.tex ├── node-005Q-truncated-map.tex ├── node-0061.tex ├── node-000K-unit-rule.tex ├── node-0011-composition.tex ├── node-003M-circle.tex ├── node-005Y-embedding.tex ├── node-0075.tex ├── node-002M-diagonal.tex ├── node-002P-unit.tex ├── node-005T-connected.tex ├── node-000W-large-record.tex ├── node-001H-groupoid-comparison.tex ├── node-0027.tex ├── node-001P-fiber.tex ├── node-0034-descent.tex ├── node-0030-empty.tex ├── node-0031-initial-algebra.tex ├── node-000R-identifier.tex ├── node-001Q-is-equivalence.tex ├── node-003E.tex ├── node-004U.tex ├── node-005H.tex ├── node-0047-inverse.tex ├── node-0068.tex ├── node-005U-connected.tex ├── node-004S.tex ├── node-006I.tex ├── node-005Z-surjective.tex ├── node-0069-functor-category.tex ├── node-001D-extension.tex ├── node-004O.tex ├── node-0065-natural-transformation.tex ├── node-006Y.tex ├── node-005V-connected-map.tex ├── node-006K-presheaf-category.tex ├── node-004V-structure-identity-principle.tex ├── node-0079.tex ├── my-node.sty ├── node-000T-contractible.tex ├── node-0038-initial-n-algebra.tex ├── node-002W-plus.tex ├── node-003N-initial-circle-algebra.tex ├── node-000N-pair-notation.tex ├── node-004Q.tex ├── node-002I-homotopy.tex ├── node-0072.tex ├── node-0054.tex ├── node-006H-category-of-sets.tex ├── node-004T-qinv.tex ├── node-0004-category-theory.tex ├── node-000A-function.tex ├── node-0026.tex ├── node-0037-composition.tex ├── node-0074.tex ├── node-0035-n-algebra.tex ├── node-007B.tex ├── node-002B-pair-id.tex ├── node-0013-swap.tex ├── node-005I-category.tex ├── my-font.sty ├── node-000F-universe-notation.tex ├── node-0012-associativity.tex ├── node-003R-pushout.tex ├── node-004B-set.tex ├── my-imakeidx.sty ├── node-001Z-function-extensionality.tex ├── node-0063.tex ├── node-003J-circle-algebra.tex ├── node-004A-comprehension.tex ├── node-006S.tex ├── node-002S-fibration.tex ├── node-004P.tex ├── node-001F-functor.tex ├── node-000Q-implicit-argument.tex ├── node-002O-associativity.tex ├── node-001C-transport.tex ├── node-002X-primitive-recursion.tex ├── node-003H.tex ├── my-eq-reasoning.sty ├── node-0045.tex ├── node-003Q-initial-po-algebra.tex ├── node-0049.tex ├── node-0025.tex ├── node-002U-coproduct.tex ├── node-003Y-truncated.tex ├── node-005L.tex ├── node-006F.tex ├── my-theorem.sty ├── node-004F.tex ├── node-005M-equivalence.tex ├── node-0009-universe.tex ├── node-002C-unit-id.tex ├── node-003B.tex └── node-000B-record.tex ├── .github └── workflows │ └── build.yml └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | compiled/ 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _build 2 | _site 3 | -------------------------------------------------------------------------------- /dependency/.gitignore: -------------------------------------------------------------------------------- 1 | compiled/ 2 | -------------------------------------------------------------------------------- /src-0/latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = 4; 2 | -------------------------------------------------------------------------------- /src/0005.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{ホモトピー論} 6 | ] 7 | -------------------------------------------------------------------------------- /dependency/info.rkt: -------------------------------------------------------------------------------- 1 | #lang info 2 | 3 | (define deps 4 | (list "https://github.com/uemurax/morg.git#312bb17")) 5 | -------------------------------------------------------------------------------- /src/007F.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{索引} 6 | @print-index[] 7 | ] 8 | -------------------------------------------------------------------------------- /src-0/my-ref.sty: -------------------------------------------------------------------------------- 1 | \usepackage{cleveref} 2 | 3 | \let\myRef\cref 4 | \let\myRefLabel\labelcref 5 | \let\myRefName\namecref 6 | -------------------------------------------------------------------------------- /src-0/my-term.sty: -------------------------------------------------------------------------------- 1 | \usepackage{xparse} 2 | 3 | \NewDocumentCommand{\myNewTerm}{o m}{\index{\IfValueT{#1}{#1@}#2}\emph{#2}} 4 | -------------------------------------------------------------------------------- /src-0/my-label.sty: -------------------------------------------------------------------------------- 1 | \usepackage{my-node,my-imakeidx} 2 | 3 | \newcommand{\myNodeLabel}[1]{\label{#1}\myNodeIndex{\myNodeText{#1}}} 4 | -------------------------------------------------------------------------------- /src/lib/math/univalence.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide ua) 6 | 7 | (define ua (const "ua")) 8 | -------------------------------------------------------------------------------- /src-0/node-007F-index.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \myPrintIndex{007F} 6 | 7 | \end{document} 8 | -------------------------------------------------------------------------------- /src/lib/math/function.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide swap) 6 | 7 | (define swap (const "swap")) 8 | -------------------------------------------------------------------------------- /src/lib/math/set.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide is-set) 6 | 7 | (define is-set (const "IsSet")) 8 | -------------------------------------------------------------------------------- /src/lib/math/tex.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math) 4 | 5 | (provide mathbb) 6 | 7 | (define mathbb (macro-1 "mathbb")) 8 | -------------------------------------------------------------------------------- /src/lib/math/cofiber.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide cofiber) 6 | 7 | (define cofiber (const "Cofiber")) 8 | -------------------------------------------------------------------------------- /src-0/my-hyperref.sty: -------------------------------------------------------------------------------- 1 | \usepackage{hyperref,lwarp} 2 | 3 | \newcommand{\myHRef}[2]{\warpprintonly{#2\footnote{\url{#1}}}\warpHTMLonly{\href{#1}{#2}}} 4 | -------------------------------------------------------------------------------- /src-0/node-007G-node-index.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \myPrintNodeIndex{007G} 6 | 7 | \end{document} 8 | -------------------------------------------------------------------------------- /src/lib/markup/axiom.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide axiom) 6 | 7 | (define axiom @make-article{公理}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/lemma.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide lemma) 6 | 7 | (define lemma @make-article{補題}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/proof.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/proof) 4 | 5 | (provide proof) 6 | 7 | (define proof @make-proof{証明}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/rule.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide rule) 6 | 7 | (define rule @make-article{規則}) 8 | -------------------------------------------------------------------------------- /src/lib/math/ackermann.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide ackermann) 6 | 7 | (define ackermann (const "ack")) 8 | -------------------------------------------------------------------------------- /src-0/node-0005-homotopy-theory.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0005}{ホモトピー論} 6 | 7 | \end{document} 8 | -------------------------------------------------------------------------------- /src-0/node-007E-bibliography.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \myPrintBibliography{007E} 6 | 7 | \end{document} 8 | -------------------------------------------------------------------------------- /src/lib/markup/example.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide example) 6 | 7 | (define example @make-article{例}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/remark.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide remark) 6 | 7 | (define remark @make-article{注意}) 8 | -------------------------------------------------------------------------------- /src/lib/math/embedding.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide is-embedding) 6 | 7 | (define is-embedding (const "IsEmb")) 8 | -------------------------------------------------------------------------------- /src/lib/math/suspension.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide suspension) 6 | 7 | (define suspension (const "Susp")) 8 | -------------------------------------------------------------------------------- /src/lib/markup/exercise.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide exercise) 6 | 7 | (define exercise @make-article{演習}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/notation.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide notation) 6 | 7 | (define notation @make-article{記法}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/theorem.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide theorem) 6 | 7 | (define theorem @make-article{定理}) 8 | -------------------------------------------------------------------------------- /src/lib/math/funext.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide section-of-proj) 6 | 7 | (define section-of-proj (const "Sect")) 8 | -------------------------------------------------------------------------------- /src/lib/math/surjection.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide is-surjective) 6 | 7 | (define is-surjective (const "IsSurj")) 8 | -------------------------------------------------------------------------------- /src/lib/markup/comparison.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide comparison) 6 | 7 | (define comparison @make-article{比較}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/corollary.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide corollary) 6 | 7 | (define corollary @make-article{系}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/definition.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide definition) 6 | 7 | (define definition @make-article{定義}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/proposition.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide proposition) 6 | 7 | (define proposition @make-article{命題}) 8 | -------------------------------------------------------------------------------- /src/lib/markup/terminology.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/article) 4 | 5 | (provide terminology) 6 | 7 | (define terminology @make-article{用語}) 8 | -------------------------------------------------------------------------------- /src/007X.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/index/notation.rkt") 4 | 5 | @section[ 6 | #:id (current-id) 7 | #:title @%{記法の一覧} 8 | (print-notation-index) 9 | ] 10 | -------------------------------------------------------------------------------- /src/002R.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt") 4 | 5 | @exercise[ 6 | #:id (current-id) 7 | @paragraph{ 8 | いわゆる@emph{Mac Lane五角形}を表す型とその要素を構成せよ。 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /src/lib/math/level.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide level:zero 6 | level:succ) 7 | 8 | (define level:zero "0") 9 | (define level:succ (const "succ")) 10 | -------------------------------------------------------------------------------- /src-0/node-002R-pentagon.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002R}{myExercise} 6 | いわゆる\emph{Mac Lane五角形}を表す型とその要素を構成せよ。 7 | \end{myBlock} 8 | 9 | \end{document} -------------------------------------------------------------------------------- /src-0/main.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \subfile{node-0008-introduction} 6 | \subfile{node-0006-foundations} 7 | \subfile{node-0007-mathematics} 8 | 9 | \end{document} 10 | -------------------------------------------------------------------------------- /src-0/node-0008-introduction.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myShiftSections} 6 | \subfile{node-0000-introduction} 7 | \end{myShiftSections} 8 | 9 | \end{document} 10 | -------------------------------------------------------------------------------- /src/lib/math.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/math 4 | "math/core.rkt") 5 | 6 | (provide paren 7 | sub-sup _ ^ 8 | (all-from-out "math/core.rkt") 9 | math) 10 | -------------------------------------------------------------------------------- /src-0/node-004G-empty-prop.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004G}{myExample} 6 | \myInlineMath{\myEmptyType}は命題である。 7 | 実際、帰納法で直ちに示せる。 8 | \end{myBlock} 9 | 10 | \end{document} -------------------------------------------------------------------------------- /src-0/my-block.sty: -------------------------------------------------------------------------------- 1 | \usepackage{xparse} 2 | \usepackage{my-node,my-label} 3 | 4 | \NewDocumentEnvironment{myBlock}{m m o +b}{% 5 | \begin{#2}[{\myNodeTitleOpt{#1}[#3]}] 6 | \myNodeLabel{#1} 7 | #4 8 | \end{#2}% 9 | }{} 10 | -------------------------------------------------------------------------------- /src/lib/index/notation.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/markup/index) 4 | 5 | (provide notation-index 6 | print-notation-index) 7 | 8 | (define-values (notation-index print-notation-index) 9 | (make-index)) 10 | -------------------------------------------------------------------------------- /src/lib/math/connected.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide is-connected 6 | is-connected-map) 7 | 8 | (define is-connected (const "IsConnected")) 9 | (define is-connected-map (const "IsConnMap")) 10 | -------------------------------------------------------------------------------- /src/lib/bibliography.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/bibliography) 4 | 5 | (provide (except-out (all-from-out morg/bibliography) bibliography) 6 | (rename-out [bib bibliography])) 7 | 8 | (define bib @make-bibliography{文献}) 9 | -------------------------------------------------------------------------------- /src-0/node-005W.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005W}{myRemark} 6 | \myRef{005V}の意味での\myInlineMath{n}連結関数は 7 | 古典的なホモトピー論における\myInlineMath{n + 1}連結写像に対応するものである。 8 | \end{myBlock} 9 | 10 | \end{document} -------------------------------------------------------------------------------- /src/004G.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/example.rkt" 4 | "lib/math.rkt" 5 | "lib/math/empty.rkt") 6 | 7 | @example[ 8 | #:id (current-id) 9 | @paragraph{ 10 | @(math empty-type)は命題である。実際、帰納法で直ちに示せる。 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /src-0/custom.ist: -------------------------------------------------------------------------------- 1 | preamble 2 | "\\begin{theindex} 3 | " 4 | delim_0 ", \\hyperindexref{" 5 | delim_1 ", \\hyperindexref{" 6 | delim_2 ", \\hyperindexref{" 7 | delim_n "}, \\hyperindexref{" 8 | delim_r "} -- \\hyperindexref{" 9 | delim_t "}" 10 | page_compositor "." 11 | -------------------------------------------------------------------------------- /src/lib/math/sphere.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math) 4 | 5 | (provide sphere/symb 6 | sphere) 7 | 8 | (define sphere/symb 9 | ((macro-1 "mathbb") "S")) 10 | 11 | (define (sphere [n : MathTeX+Like]) 12 | (sphere/symb . ^ . n)) 13 | -------------------------------------------------------------------------------- /src-0/node-000Z-univalence-axiom.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000Z}{myAxiom}[一価性公理] 6 | \myNewTerm[いっかせいこうり]{一価性公理}(univalence axiom)は 7 | 任意の階数の宇宙が一価性を満たすことを要請する。 8 | \end{myBlock} 9 | 10 | \end{document} 11 | -------------------------------------------------------------------------------- /src/lib/math/cocone.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide cocone 6 | cocone:vertex 7 | cocone:in) 8 | 9 | (define cocone (const "Cocone")) 10 | (define cocone:vertex (const "Vertex")) 11 | 12 | (define cocone:in (const "in")) 13 | -------------------------------------------------------------------------------- /src/lib/math/magma.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide magma 6 | magma:carrier 7 | magma:operator) 8 | 9 | (define magma (const "Magma")) 10 | (define magma:carrier (const "Carrier")) 11 | (define magma:operator (const "op")) 12 | -------------------------------------------------------------------------------- /src-0/node-0007-mathematics.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0007}{数学} 6 | 7 | \begin{mySubsections} 8 | \subfile{node-0005-homotopy-theory} 9 | \subfile{node-0004-category-theory} 10 | \end{mySubsections} 11 | 12 | \end{document} 13 | -------------------------------------------------------------------------------- /src-0/node-0020-funext-axiom.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0020}{myAxiom}[関数外延性公理] 6 | \myNewTerm[かんすうがいえんせいこうり]{関数外延性公理}(function extensionality axiom)は 7 | すべての関数型が関数外延性を満たすことを要請する。 8 | \end{myBlock} 9 | 10 | \end{document} 11 | -------------------------------------------------------------------------------- /src/005W.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/remark.rkt" 4 | "lib/math.rkt") 5 | 6 | (define n "n") 7 | 8 | @remark[ 9 | #:id (current-id) 10 | @paragraph{ 11 | @ref["005V"]の意味での@(math n)連結関数は古典的なホモトピー論における@(math (n . + . "1"))連結写像に対応するものである。 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /src-0/my-sns.sty: -------------------------------------------------------------------------------- 1 | \usepackage{hyperref} 2 | 3 | \newcommand{\mySNSLink@internal}[3]{#1: \href{#3}{\nolinkurl{#2}}} 4 | 5 | \newcommand{\myTwitterLink}[1]{\mySNSLink@internal{Twitter}{#1}{https://twitter.com/#1}} 6 | \newcommand{\myGitHubLink}[1]{\mySNSLink@internal{GitHub}{#1}{https://github.com/#1}} 7 | -------------------------------------------------------------------------------- /src-0/.gitignore: -------------------------------------------------------------------------------- 1 | auto 2 | comment_*.cut 3 | *.aux 4 | *.fdb_latexmk 5 | *.fls 6 | *.idx 7 | *.ilg 8 | *.ind 9 | *.lof 10 | *.log 11 | *.lwarpmkconf 12 | *.out 13 | *.pdf 14 | *.synctex.gz 15 | *.toc 16 | *_html.tex 17 | lwarp* 18 | sample_project.css 19 | *.bbl 20 | *.bcf 21 | *.blg 22 | *.run.xml 23 | -------------------------------------------------------------------------------- /src/000Z.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/axiom.rkt") 4 | 5 | @axiom[ 6 | #:id (current-id) 7 | #:title @%{一価性公理} 8 | #:indexes @list[ 9 | @index[#:key "いっかせいこうり"]{一価性公理} 10 | ] 11 | @paragraph{ 12 | @dfn{一価性公理(univalence axiom)}は任意の階数の宇宙が一価性を満たすことを要請する。 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /src-0/node-0019-symmetry-iso.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0019}{myExercise} 6 | \myRef{0018}において、 7 | \myInlineMath{\myPairSym{B}{A} \myFunComp \myPairSym{A}{B} 8 | \myDefEq \myIdFun{\myBlank}}であることを確かめよ。 9 | \end{myBlock} 10 | 11 | \end{document} 12 | -------------------------------------------------------------------------------- /src-0/node-006O.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006O}{myCorollary} 6 | 関数外延性と一価性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏とすると、 9 | \myInlineMath{\myPresheaf{C}}は圏である。\myQed 10 | \end{myBlock} 11 | 12 | \end{document} -------------------------------------------------------------------------------- /src/Hovey--1999-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @book[ 8 | #:author @list[@%{Mark Hovey}] 9 | #:title @%{Model categories} 10 | #:date (date 1999) 11 | #:publisher @%{American Mathematical Society} 12 | ] 13 | ] 14 | -------------------------------------------------------------------------------- /src/lib/math/empty.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/math 4 | (prefix-in tex: morg/math/tex) 5 | "core.rkt") 6 | 7 | (provide empty-type 8 | empty-type:ind) 9 | 10 | (define empty-type @tex:mathbf{0}) 11 | 12 | (define empty-type:ind (ind/symb . _ . empty-type)) 13 | -------------------------------------------------------------------------------- /src-0/node-0015-curry-iso.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0015}{myExercise} 6 | \myRef{0014}において、 7 | \myInlineMath{\myUncurry{\myCurry{f}} \myDefEq f}と 8 | \myInlineMath{\myCurry{\myUncurry{g}} \myDefEq g}を確かめよ。 9 | \end{myBlock} 10 | 11 | \end{document} 12 | -------------------------------------------------------------------------------- /src-0/node-0033-pushout.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0033}{押し出し} 6 | 7 | \subfile{node-003O-po-algebra} 8 | \subfile{node-003S} 9 | \subfile{node-003P-po-hom} 10 | \subfile{node-003Q-initial-po-algebra} 11 | \subfile{node-003R-pushout} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src/Pierce--2002-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @book[ 8 | #:author @list[@%{Benjamin C. Pierce}] 9 | #:title @%{Types and programming languages} 10 | #:date (date 2002) 11 | #:publisher @%{MIT Press} 12 | ] 13 | ] 14 | -------------------------------------------------------------------------------- /src/lib/math/qinv.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide qinv 6 | qinv:inv 7 | qinv:unit 8 | qinv:counit) 9 | 10 | (define qinv (const "QInv")) 11 | (define qinv:inv (const "inv")) 12 | (define qinv:unit (const "unit")) 13 | (define qinv:counit (const "counit")) 14 | -------------------------------------------------------------------------------- /src/0020.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/axiom.rkt") 4 | 5 | @axiom[ 6 | #:id (current-id) 7 | #:title @%{関数外延性公理} 8 | #:indexes @list[ 9 | @index[#:key "かんすうがいえんせいこうり"]{関数外延性公理} 10 | ] 11 | @paragraph{ 12 | @dfn{関数外延性公理(function extensionality axiom)}はすべての関数型が関数外延性を満たすことを要請する。 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v3 15 | 16 | - name: Build 17 | uses: ./.github/actions/build 18 | -------------------------------------------------------------------------------- /src-0/node-0032-circle.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0032}{円周} 6 | 7 | \subfile{node-003J-circle-algebra} 8 | \subfile{node-003L-id-over} 9 | \subfile{node-003K-circle-hom} 10 | \subfile{node-003N-initial-circle-algebra} 11 | \subfile{node-003M-circle} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src/001O.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/example.rkt" 4 | "lib/math.rkt") 5 | 6 | @example[ 7 | #:id (current-id) 8 | @paragraph{ 9 | @(math unit-type)は可縮である。実際、@(math ((record-elem (list center unit-elem) (list contraction (abs "x" refl))) . elem-of . (is-contr . $ . unit-type)))を確かめられる。 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /src/0021.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{一価性から関数外延性を導く} 6 | @paragraph{ 7 | 実は、一価性公理から関数外延性公理が導出される(@ref["007D"])。 8 | } 9 | (include-part "0079.rkt") 10 | (include-part "007A.rkt") 11 | (include-part "007B.rkt") 12 | (include-part "007C.rkt") 13 | (include-part "007D.rkt") 14 | ] 15 | -------------------------------------------------------------------------------- /src/Quillen--1967-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @book[ 8 | #:author @list[@%{Daniel G. Quillen}] 9 | #:title @%{Homotopical algebra} 10 | #:date (date 1967) 11 | #:publisher @%{Springer} 12 | #:doi "doi:10.1007/BFb0097438" 13 | ] 14 | ] 15 | -------------------------------------------------------------------------------- /src-0/node-000D-level.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000D}{myRule} 6 | \begin{enumerate} 7 | \item 階数\myInlineMath{\myLevelZero}を構成できる。 8 | \item 階数\myInlineMath{i}に対し、 9 | 階数\myInlineMath{\myLevelSucc{i}}を構成できる。 10 | \end{enumerate} 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src-0/node-0021-univalence-implies-funext.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0021}{一価性から関数外延性を導く} 6 | 7 | 実は、一価性公理から関数外延性公理が導出される(\myRef{007D})。 8 | 9 | \subfile{node-0079} 10 | \subfile{node-007A} 11 | \subfile{node-007B} 12 | \subfile{node-007C} 13 | \subfile{node-007D} 14 | 15 | \end{document} 16 | -------------------------------------------------------------------------------- /src-0/node-0003-higher-inductive-type.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0003}{高次帰納的型} 6 | 7 | \begin{mySubsections} 8 | \subfile{node-0031-initial-algebra} 9 | \subfile{node-0032-circle} 10 | \subfile{node-0033-pushout} 11 | \subfile{node-0034-descent} 12 | \end{mySubsections} 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /src-0/node-0044.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0044}{myCorollary} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 9 | \myInlineMath{f \myElemOf A \myFunType B}を関数とすると、 10 | \myInlineMath{\myIsEquiv{f}}は命題である。\myQed 11 | \end{myBlock} 12 | 13 | \end{document} -------------------------------------------------------------------------------- /src-0/node-007H-contributors.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \myChapter{007H}{貢献者} 6 | 7 | 執筆、誤字脱字の報告などで本書の内容に直接影響を与えた者たちの一覧。 8 | 9 | \begin{itemize} 10 | \item Taichi Uemura (\myGitHubLink{uemurax}, \myTwitterLink{t_uemura669101}) 11 | \item 立腹層 (\myTwitterLink{rippukusou}) 12 | \end{itemize} 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /src/Lambek--Scott--1986-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @book[ 8 | #:author @list[@%{J. Lambek} @%{P. J. Scott}] 9 | #:title @%{Introduction to higher order categorical logic} 10 | #:date (date 1986) 11 | #:publisher @%{Cambridge University Press} 12 | ] 13 | ] 14 | -------------------------------------------------------------------------------- /src-0/node-005A.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005A}{myTerminology} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{P \myElemOf \myUniverse{i}}を型とする。 8 | \myInlineMath{P}が命題である場合、 9 | 「\myInlineMath{P}の要素がある」の代わりに 10 | 「\myInlineMath{P}は\myNewTerm[しん]{真}である」という言い方をする。 11 | \end{myBlock} 12 | 13 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006R.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006R}{myExercise} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C, D, X \myElemOf \myPreCat{i}}を前圏とする。 9 | 同値\myDisplayMath{\myFunctor{X}{\myFunctorCat{C}{D}} \myEquiv 10 | \myBiFunctor{C}{X}{D}}を構成せよ。 11 | \end{myBlock} 12 | 13 | \end{document} -------------------------------------------------------------------------------- /src-0/my-bibliography.sty: -------------------------------------------------------------------------------- 1 | \usepackage{biblatex} 2 | 3 | \let\myCiteParen\parencite 4 | \let\myCiteText\textcite 5 | \let\myCiteAuthor\citeauthor 6 | 7 | \newcommand{\myPrintBibliography}[1]{ 8 | \myChapter{#1}{\myBibliography@Title} 9 | \printbibliography[heading=none] 10 | } 11 | 12 | \addbibresource{my-references.bib} 13 | \newcommand{\myBibliography@Title}{参考文献} 14 | -------------------------------------------------------------------------------- /src/0019.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/pair.rkt" 5 | "lib/markup/exercise.rkt") 6 | 7 | (define A "A") 8 | (define B "B") 9 | 10 | @exercise[ 11 | #:id (current-id) 12 | @paragraph{ 13 | @ref["0018"]において、@(math (((pair-sym . $* . B A) . fun-comp . (pair-sym . $* . A B)) . def-eq . id-fun))であることを確かめよ。 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /src/Lurie--2009-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @book[ 8 | #:author @list[@%{Jacob Lurie}] 9 | #:title @%{Higher Topos Theory} 10 | #:date (date 2009) 11 | #:publisher @%{Princeton University Press} 12 | #:url "https://www.math.ias.edu/~lurie/papers/HTT.pdf" 13 | ] 14 | ] 15 | -------------------------------------------------------------------------------- /src-0/node-0006-foundations.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0006}{基礎} 6 | 7 | \begin{mySubsections} 8 | \subfile{node-0001-type-theory} % 型理論の一般の話はここで 9 | \subfile{node-0002-univalence-axiom} 10 | \subfile{node-0003-higher-inductive-type} 11 | \subfile{node-003W-n-type} 12 | \end{mySubsections} 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /src-0/node-003F.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003F}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | \myInlineMath{A}と\myInlineMath{B}が可縮ならば 10 | \myInlineMath{f}は同値であることを示せ。 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src/lib/math/refl-graph.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide refl-graph 6 | refl-graph:vertex 7 | refl-graph:edge 8 | refl-graph:refl) 9 | 10 | (define refl-graph (const "ReflGraph")) 11 | (define refl-graph:vertex (const "Vertex")) 12 | (define refl-graph:edge (const "Edge")) 13 | (define refl-graph:refl (const "refl")) 14 | -------------------------------------------------------------------------------- /src-0/node-000I-type-family.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000I}{myTerminology} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | 関数\myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を 9 | \myInlineMath{A}上の\myNewTerm[かたのぞく]{型の族}(type family)と呼ぶ。 10 | \end{myBlock} 11 | 12 | \end{document} 13 | -------------------------------------------------------------------------------- /src-0/node-000M-simple-pair.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000M}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型とする。 8 | 型\myInlineMath{A \myPairType B \myElemOf \myUniverse{i}}を 9 | \myInlineMath{\myDPairType{x \myElemOf A}{B}}と定義する。 10 | \end{myBlock} 11 | 12 | \end{document} 13 | -------------------------------------------------------------------------------- /src-0/node-006M.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006M}{myExercise} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏とする。 9 | \myInlineMath{\myPresheafCat{C}}と 10 | \myInlineMath{\myFunctorCat{\myOppositeCat{C}}{\mySetCat{i}}} 11 | の間の前圏の同型を構成せよ。 12 | \end{myBlock} 13 | 14 | \end{document} -------------------------------------------------------------------------------- /src-0/node-000G-function-type-rule.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000G}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型とする。 8 | このとき、\myInlineMath{A \myFunType B \myElemOf \myUniverse{i}}を 9 | \myInlineMath{\myDFunType{x \myElemOf A}{B}}と定義する。 10 | \end{myBlock} 11 | 12 | \end{document} 13 | -------------------------------------------------------------------------------- /src-0/node-001O.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001O}{myExample} 6 | \myInlineMath{\myUnitType}は可縮である。 7 | 実際、\myInlineMath{\myRecordElem{\myCenter \myDefEq \myUnitElem, 8 | \myContraction \myDefEq \myAbs{x}{\myRefl{\myUnitElem}}} 9 | \myElemOf \myIsContr{\myUnitType}}を確かめられる。 10 | \end{myBlock} 11 | 12 | \end{document} 13 | -------------------------------------------------------------------------------- /src-0/node-0059-lem.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0059}{myAxiom}[排中律] 6 | \myNewTerm[はいちゅうりつ]{排中律}(law of excluded middle) 7 | は任意の階数\myInlineMath{i}と 8 | 型\myInlineMath{P \myElemOf \myUniverse{i}}に対して、 9 | \myInlineMath{P}が命題ならば 10 | \myInlineMath{P \myLogicOr \myNeg P}が真であることを要請する。 11 | \end{myBlock} 12 | 13 | \end{document} -------------------------------------------------------------------------------- /src/0015.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/pair.rkt" 5 | "lib/markup/exercise.rkt") 6 | 7 | (define f "f") 8 | (define g "g") 9 | 10 | @exercise[ 11 | #:id (current-id) 12 | @paragraph{ 13 | @ref["0014"]において、@(math ((uncurry . $ . (curry . $ . f)) . def-eq . f))と@(math ((curry . $ . (uncurry . $ . g)) . def-eq . g))を確かめよ。 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /src-0/my-math.sty: -------------------------------------------------------------------------------- 1 | \usepackage{lwarp,xparse} 2 | 3 | \newcommand{\myInlineMath}[1]{\edef\myInlineMath@tmp@expression{{#1}}\expandafter\myInlineMath@raw\myInlineMath@tmp@expression} 4 | 5 | \NewDocumentCommand{\myDisplayMath}{+m}{\begin{center}\myInlineMath{#1}\end{center}}{} 6 | 7 | \newcommand{\myInlineMath@raw}[1]{\InlineClass{my-inline-math}{\(#1\)}} 8 | 9 | \newcommand{\myMathWrap}[1]{\noexpand#1} 10 | -------------------------------------------------------------------------------- /src-0/node-0010-identity.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0010}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | \myNewTerm[こうとうかんすう]{恒等関数}(identity function) 9 | \myInlineMath{\myIdFun{A} \myElemOf A \myFunType A}を 10 | \myInlineMath{\myAbs{x}{x}}と定義する。 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src/lib/math/hae.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide is-hae:coh 6 | is-hae:inv 7 | is-hae:unit 8 | is-hae:counit 9 | is-hae) 10 | 11 | (define is-hae:coh (const "coh")) 12 | 13 | (define is-hae (const "IsHAE")) 14 | (define is-hae:inv (const "inv")) 15 | (define is-hae:unit (const "unit")) 16 | (define is-hae:counit (const "counit")) 17 | -------------------------------------------------------------------------------- /src/lib/math/id-over.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | (prefix-in l: "paren-level.rkt") 5 | "core.rkt") 6 | 7 | (provide id-type-over 8 | fun-apply-id/d) 9 | 10 | (define (id-type-over [A : MathTeX+Like] [p : MathTeX+Like]) 11 | (binary #:level l:relation 12 | (sub-sup id-type/symb #:^ A #:_ p))) 13 | 14 | (define fun-apply-id/d (const "apd")) 15 | -------------------------------------------------------------------------------- /src/lib/math/pointed-type.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | (prefix-in tex: morg/math/tex) 5 | "core.rkt") 6 | 7 | (provide pointed-type 8 | pointed-type:carrier 9 | pointed-type:point) 10 | 11 | (define pointed-type (universe . _ . tex:bullet)) 12 | (define pointed-type:carrier (const "Carrier")) 13 | (define pointed-type:point (const "point")) 14 | -------------------------------------------------------------------------------- /src/lib/math/proposition.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | (prefix-in tex: morg/math/tex) 5 | "core.rkt") 6 | 7 | (provide is-prop 8 | prop-compr) 9 | 10 | (define is-prop (const "IsProp")) 11 | 12 | (define (prop-compr [A : MathTeX+Like] [P : MathTeX+Like]) 13 | ((delimiter #:left tex:lbrace 14 | #:right tex:rbrace) 15 | A tex:mid P)) 16 | -------------------------------------------------------------------------------- /src/006O.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/math.rkt" 5 | "lib/math/cat.rkt" 6 | "lib/math/presheaf.rkt") 7 | 8 | (define i "i") 9 | (define C "C") 10 | 11 | @corollary[ 12 | #:id (current-id) 13 | @paragraph{ 14 | 関数外延性と一価性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏とすると、@(math (presheaf . $ . C))は圏である。 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src-0/node-003T.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003T}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType \myEmptyType}を関数とする。 9 | \myInlineMath{f}は同値である。 10 | \end{myBlock} 11 | \begin{myProof} 12 | \myInlineMath{\myEmptyType}の帰納法による。 13 | \end{myProof} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0064.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0064}{myCorollary}[圏の構造同一原理] 6 | 一価性と関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C, D \myElemOf \myCat{i}}を圏とすると、 9 | 同値\myDisplayMath{(C \myIdType D) \myEquiv 10 | \myPropCompr{F \myElemOf \myFunctor{C}{D}} 11 | {\myIsWeakCatEquiv{F}}}を得る。\myQed 12 | \end{myBlock} 13 | 14 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0017-associativity-iso.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0017}{myExercise} 6 | \myRef{0016}において、 7 | \myInlineMath{\myPairAssocInv{C} \myFunComp \myPairAssoc{C} 8 | \myDefEq \myIdFun{\myBlank}}と 9 | \myInlineMath{\myPairAssoc{C} \myFunComp \myPairAssocInv{C} 10 | \myDefEq \myIdFun{\myBlank}}を確かめよ。 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src/HoTT-Book.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @book[ 8 | #:author @list[@%{The Univalent Foundations Program}] 9 | #:title @%{Homotopy Type Theory: Univalent Foundations of Mathematics} 10 | #:date (date 2013) 11 | #:address @%{Institute for Advanced Study} 12 | #:url "http://homotopytypetheory.org/book/" 13 | ] 14 | ] 15 | -------------------------------------------------------------------------------- /src-0/node-001B-distributive-iso.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001B}{myExercise} 6 | \myRef{001A}において、 7 | \myInlineMath{\myFunPairDistInv{C} \myFunComp \myFunPairDist{C} 8 | \myDefEq \myIdFun{\myBlank}}と 9 | \myInlineMath{\myFunPairDist{C} \myFunComp \myFunPairDistInv{C} 10 | \myDefEq \myIdFun{\myBlank}}を確かめよ。 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src-0/node-003I.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003I}{myCorollary} 6 | 関数外延性を仮定すると、 7 | \myInlineMath{\myNat \myElemOf \myUniverse{\myLevelZero}}と 8 | \myInlineMath{\myNatZero \myElemOf \myNat}と 9 | \myInlineMath{\myAbs{x}{\myNatSucc{x}} \myElemOf \myNat \myFunType \myNat}は 10 | 始\myInlineMath{\myNat}代数を定める。\myQed 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src-0/node-005N-sip-precategory.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005N}{myExercise}[前圏の構造同一原理] 6 | 一価性と関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏とする。 9 | 同値\myDisplayMath{(C \myIdType D) \myEquiv 10 | \myPropCompr{F \myElemOf \myFunctor{C}{D}} 11 | {\myIsPreCatEquiv{F}}}を構成せよ。 12 | \end{myBlock} 13 | 14 | \end{document} -------------------------------------------------------------------------------- /src/0044.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/math.rkt") 5 | 6 | (define i "i") 7 | (define A "A") 8 | (define B "B") 9 | (define f "f") 10 | 11 | @corollary[ 12 | #:id (current-id) 13 | @paragraph{ 14 | 関数外延性を仮定する。@(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とすると、@(math (is-equiv . $ . f))は命題である。 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src-0/node-0018-symmetry.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0018}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型とする。 8 | 関数\myInlineMath{\myPairSym{A}{B} \myElemOf 9 | A \myPairType B \myFunType B \myPairType A}を 10 | \myInlineMath{\myAbs{z}{\myPair{\myProjII{z}}{\myProjI{z}}}}と定義する。 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src/005A.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/terminology.rkt" 4 | "lib/math.rkt") 5 | 6 | (define i "i") 7 | (define P "P") 8 | 9 | @terminology[ 10 | #:id (current-id) 11 | #:indexes @list[ 12 | @index[#:key "しん"]{真} 13 | ] 14 | @paragraph{ 15 | @(math i)を階数、@(math (P . elem-of . (universe . $ . i)))を型とする。@(math P)が命題である場合、「@(math P)の要素がある」の代わりに「@(math P)は@dfn{真}である」という言い方をする。 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /src/0088.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/notation.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt") 6 | 7 | (define a "a") 8 | (define A "A") 9 | 10 | @notation[ 11 | #:id (current-id) 12 | #:indexes @list[ 13 | @notation-index[#:key "a:A"]{@(math (a . elem-of . A))} 14 | ] 15 | @paragraph{ 16 | 要素@(math a)の型が@(math A)であることを明示するときは@(math (a . elem-of . A))と書く。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-001I-functor-comparison.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001I}{myComparison} 6 | 述語論理において、 7 | \myInlineMath{f}を一変数の関数とすると、 8 | \myInlineMath{x_{1} \myIdType x_{2} \myFunType 9 | f\myAppParen{x_{1}} \myIdType f\myAppParen{x_{2}}}が成り立つ。 10 | これは関数が等しさを保つことを表す。 11 | \myRef{001F}はこの類似で、 12 | 型理論において関数は同一視を保つことを表す。 13 | \end{myBlock} 14 | 15 | \end{document} 16 | -------------------------------------------------------------------------------- /src/0017.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math/pair.rkt" 4 | "lib/markup/exercise.rkt" 5 | "lib/math.rkt") 6 | 7 | (define C "C") 8 | 9 | @exercise[ 10 | #:id (current-id) 11 | @paragraph{ 12 | @ref["0016"]において、@(math (((pair-assoc-inv . $ . C) . fun-comp . (pair-assoc . $ . C)) . def-eq . id-fun))と@(math (((pair-assoc . $ . C) . fun-comp . (pair-assoc-inv . $ . C)) . def-eq . id-fun))を確かめよ。 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /src-0/node-004N-equivalence.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{004N}{同値の概念} 6 | 7 | \myRef{0044}より、関数が同値であることは命題であることが分かったが、 8 | \myRef{004I}で導入した他の同値の概念が命題であることも示す。 9 | 10 | まずは両側可逆性(\myRef{004J})を考える。 11 | 12 | \subfile{node-004P} 13 | \subfile{node-004Q} 14 | \subfile{node-004O} 15 | 16 | 次に、半随伴同値(\myRef{004L})を考える。 17 | 18 | \subfile{node-004S} 19 | \subfile{node-004R} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006U.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006U}{myNotation} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 9 | \myInlineMath{x \myElemOf C}を対象とする。 10 | 要素\myInlineMath{\myYonedaGen{x} \myElemOf \myYoneda{C} 11 | \myAppParen{x}\myAppParen{x}}を 12 | \myInlineMath{\myCatId\myAppParen{x}}と定義する。 13 | \end{myBlock} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006V-yoneda-lemma.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006V}{myTheorem}[米田の補題] 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 9 | \myInlineMath{x \myElemOf C}を対象、 10 | \myInlineMath{A \myElemOf \myPresheafCat{C}}を前層とする。 11 | 関数\myDisplayMath{ 12 | \myCatMap\myAppParen{\myYoneday-com} 13 | } 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src-0/my-preamble.sty: -------------------------------------------------------------------------------- 1 | \newcommand{\myTitle}{ホモトピー型理論} 2 | \newcommand{\myAuthor}{上村 太一} 3 | 4 | \usepackage{my-hyperref} 5 | \usepackage{my-imakeidx} 6 | \usepackage{my-sections} 7 | \usepackage{my-theorem} 8 | \usepackage{my-block} 9 | \usepackage{my-term} 10 | \usepackage{my-math} 11 | \usepackage{my-ref} 12 | \usepackage{my-bibliography} 13 | \usepackage{my-command} 14 | \usepackage{my-eq-reasoning} 15 | \usepackage{my-font} 16 | \usepackage{my-sns} 17 | -------------------------------------------------------------------------------- /src/001B.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/pair.rkt" 5 | "lib/markup/exercise.rkt") 6 | 7 | (define C "C") 8 | 9 | @exercise[ 10 | #:id (current-id) 11 | @paragraph{ 12 | @ref["001A"]において、@(math (((fun-pair-dist-inv . $ . C) . fun-comp . (fun-pair-dist . $ . C)) . def-eq . id-fun))と@(math (((fun-pair-dist . $ . C) . fun-comp . (fun-pair-dist-inv . $ . C)) . def-eq . id-fun))を確かめよ。 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /src-0/node-000Y-univalence.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000Y}{myDefinition} 6 | \myInlineMath{i}を階層とする。 7 | 宇宙\myInlineMath{\myUniverse{i}}が 8 | \myNewTerm[いっかせい]{一価性}(univalence)を満たすとは、 9 | \myInlineMath{\myDFunType{X \myElemOf \myUniverse{i}} 10 | {\myIsContr{\myDPairType{Y \myElemOf \myUniverse{i}} 11 | {X \myEquiv Y}}}}の要素があることである。 12 | \end{myBlock} 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /src-0/node-0043.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0043}{myCorollary} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 9 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とすると、 10 | \myInlineMath{\myIsTrunc{n}{A}}は命題である 11 | \end{myBlock} 12 | \begin{myProof} 13 | \myRef{0042}と\myRef{0048}から、\myInlineMath{n}についての帰納法で示せる。 14 | \end{myProof} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src-0/node-004C-set.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004C}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | 型\myInlineMath{\myIsSet{A} \myElemOf \myUniverse{i}}を 9 | \myInlineMath{\myIsTrunc{\myTLZero}{A}}と定義する。 10 | \myInlineMath{\myIsSet{A}}の要素がある時、\myInlineMath{A}は 11 | \myNewTerm[しゅうごう]{集合}(set)であると言う。 12 | \end{myBlock} 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /src-0/node-0052.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0052}{myCorollary} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{a_{1}, a_{2} \myElemOf A}を要素、 9 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 10 | \myInlineMath{A}が\myInlineMath{n}型ならば、 11 | \myInlineMath{a_{1} \myIdType a_{2}}も\myInlineMath{n}型である。 \myQed 12 | \end{myBlock} 13 | 14 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005X.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005X}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 9 | \myInlineMath{A}が\myInlineMath{n}型かつ 10 | \myInlineMath{n}連結ならば、 11 | \myInlineMath{A}は可縮である。 12 | \end{myBlock} 13 | \begin{myProof} 14 | \myRef{0051}から従う。 15 | \end{myProof} 16 | 17 | \end{document} -------------------------------------------------------------------------------- /src/Church--1940-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Alonzo Church}] 9 | #:title @%{A Formulation of the Simple Theory of Types} 10 | #:journal-title @%{The Journal of Symbolic Logic} 11 | #:date (date 1940) 12 | #:volume @%{5} 13 | #:number @%{2} 14 | #:pages @%{56--68} 15 | #:doi "10.2307/2266170" 16 | ] 17 | ] 18 | -------------------------------------------------------------------------------- /src/lib/math/universe.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/math 4 | (prefix-in tex: morg/math/tex) 5 | "core.rkt") 6 | 7 | (provide universe:el 8 | universe:name 9 | universe:lift) 10 | 11 | (define name-of 12 | (delimiter 13 | #:left tex:lceil 14 | #:right tex:rceil)) 15 | 16 | (define universe:el @const{El}) 17 | (define universe:name (name-of universe)) 18 | (define universe:lift @const{Lift}) 19 | -------------------------------------------------------------------------------- /src-0/node-000V-equivalence.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000V}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型とする。 8 | 型\myInlineMath{A \myEquiv B \myElemOf \myUniverse{i}}を 9 | \myInlineMath{\myRecordType{\myEquivFun \myElemOf A \myFunType B, 10 | \myEquivIsEquiv \myElemOf \myIsEquiv{\myEquivFun}}}と定義する。 11 | \end{myBlock} 12 | 13 | \end{document} 14 | -------------------------------------------------------------------------------- /src-0/node-001G-transport-comparison.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001G}{myComparison} 6 | 述語論理において、 7 | \myInlineMath{B}を一変数の述語とすると、 8 | \myInlineMath{x_{1} \myIdType x_{2} \myFunType 9 | B\myAppParen{x_{1}} \myFunType 10 | B\myAppParen{x_{2}}}が成り立つ。 11 | これは等しい対象は述語によって区別できないことを表す。 12 | \myRef{001C}はこの類似で、 13 | 型理論においては同一視される要素を型の族では区別できないことを表す。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src/001I.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/comparison.rkt" 4 | "lib/math.rkt") 5 | 6 | (define f "f") 7 | (define x "x") 8 | (define x1 (x . _ . "1")) 9 | (define x2 (x . _ . "2")) 10 | 11 | @comparison[ 12 | #:id (current-id) 13 | @paragraph{ 14 | 述語論理において、@(math f)を一変数の関数とすると、@(math ((x1 . id-type . x2) . fun-type . ((f . $ . x1) . id-type . (f . $ . x2))))が成り立つ。これは関数が等しさを保つことを表す。@ref["001F"]はこの類似で、型理論において関数は同一視を保つことを表す。 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src-0/node-0040-proposition.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0040}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | 型\myInlineMath{\myIsProp{A} \myElemOf \myUniverse{i}}を 9 | \myInlineMath{\myIsTrunc{\myTLMinusOne}{A}}と定義する。 10 | \myInlineMath{\myIsProp{A}}の要素がある時、\myInlineMath{A}は 11 | \myNewTerm[めいだい]{命題}(proposition)であると言う。 12 | \end{myBlock} 13 | 14 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005F.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005F}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{x_{1}, x_{2} \myElemOf C}を対象とする。 9 | 型\myInlineMath{x_{1} \myCatIso x_{2} \myElemOf \myUniverse{i}}を 10 | \myInlineMath{\myPropCompr{f \myElemOf \myCatMap\myAppParen{x_{1}, x_{2}}} 11 | {\myCatIsIso{f}}}と定義する。 12 | \end{myBlock} 13 | 14 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0073.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0073}{myProposition} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 9 | \myInlineMath{A \myElemOf \myPresheaf{C}}を前層とする。 10 | \myInlineMath{C}が圏ならば、 11 | \myInlineMath{\myIsReprPsh{A}}は命題である。 12 | \end{myBlock} 13 | \begin{myProof} 14 | \myRef{0071}と\myRef{006V}と\myRef{006Z}から従う。 15 | \end{myProof} 16 | 17 | \end{document} -------------------------------------------------------------------------------- /src/Russell--1908-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Bertrand Russell}] 9 | #:title @%{Mathematical Logic as Based on the Theory of Types} 10 | #:journal-title @%{American Journal of Mathematics} 11 | #:date (date 1908) 12 | #:volume @%{30} 13 | #:number @%{3} 14 | #:pages @%{222--262} 15 | #:doi "10.2307/2369948" 16 | ] 17 | ] 18 | -------------------------------------------------------------------------------- /src-0/node-004M.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004M}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myIsEquiv{f}}と\myInlineMath{\myIsHAE{f}}は 10 | 論理的に同値であることを示せ。 11 | (ヒント:\myRef{002H}の証明を拡張すれば 12 | \myInlineMath{\myIsEquiv{f} \myFunType \myIsHAE{f}}を示せる。) 13 | \end{myBlock} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006P-yoneda.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006P}{myDefinition} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏とする。 9 | \myNewTerm[よねだうめこみ]{米田埋め込み}(Yoneda embedding) 10 | \myInlineMath{\myYoneda{C} \myElemOf 11 | \myFunctor{C}{\myPresheafCat{C}}}を 12 | \myRef{006R}と\myRef{006M}で\myInlineMath{\myCatMapFun{C}}に対応するものと定義する。 13 | \end{myBlock} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0071.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0071}{myLemma} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 9 | \myInlineMath{A \myElemOf \myPresheaf{C}}を前層とすると、 10 | 同値\myDisplayMath{\myIsReprPsh{A} \myEquiv 11 | \myIsoFiber{\myYoneda{C}}{A}}を構成できる。 12 | \end{myBlock} 13 | \begin{myProof} 14 | \myRef{006T}と\myRef{0072}から従う。 15 | \end{myProof} 16 | 17 | \end{document} -------------------------------------------------------------------------------- /src/000I.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/terminology.rkt" 4 | "lib/math.rkt") 5 | 6 | (define i "i") 7 | (define A "A") 8 | (define B "B") 9 | 10 | @terminology[ 11 | #:id (current-id) 12 | #:indexes @list[ 13 | @index[#:key "かたのぞく"]{型の族} 14 | ] 15 | @paragraph{ 16 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。関数@(math (B . elem-of . (A . fun-type . (universe . $ . i))))を@(math A)上の@dfn{型の族(type family)}と呼ぶ。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-004K.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004K}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myIsEquiv{f}}と 10 | \myInlineMath{\myIsBiinv{f}}は論理的に同値である。 11 | \end{myBlock} 12 | \begin{myProof} 13 | \myRef{0026}と\myRef{002G}と\myRef{002F}と\myRef{002H}から従う。 14 | \end{myProof} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0053-n-type.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0053}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 8 | 型\myInlineMath{\myTruncType{n}{i} \myElemOf \myUniverse{\myLevelSucc{i}}}を 9 | \myInlineMath{\myRecordType{\myTruncTypeType \myElemOf \myUniverse{i}, 10 | \myTruncTypeIsTrunc \myElemOf \myIsTrunc{n}{\myTruncTypeType}}}と定義する。 11 | \end{myBlock} 12 | 13 | \end{document} -------------------------------------------------------------------------------- /src/Hedberg--1998-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Michael Hedberg}] 9 | #:title @%{A coherence theorem for Martin-Löf's type theory} 10 | #:journal-title @%{Journal of Functional Programming} 11 | #:volume @%{8} 12 | #:date (date 1998 7) 13 | #:number @%{4} 14 | #:pages @%{413--436} 15 | #:doi "10.1017/S0956796898003153" 16 | ] 17 | ] 18 | -------------------------------------------------------------------------------- /src/Martin-Loef--1975-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Per Martin-Löf}] 9 | #:title @%{An Intuitionistic Theory of Types: Predicative Part} 10 | #:journal-title @%{Studies in Logic and the Foundations of Mathematics} 11 | #:date (date 1975) 12 | #:volume @%{80} 13 | #:pages @%{73--118} 14 | #:doi "10.1016/S0049-237X(08)71945-1" 15 | ] 16 | ] 17 | -------------------------------------------------------------------------------- /src/001G.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/markup/comparison.rkt") 5 | 6 | (define B "B") 7 | (define x "x") 8 | (define x1 (x . _ . "1")) 9 | (define x2 (x . _ . "2")) 10 | 11 | @comparison[ 12 | #:id (current-id) 13 | @paragraph{ 14 | 述語論理において、@(math B)を一変数の述語とすると、@(math ((x1 . id-type . x2) . fun-type . ((B . $ . x1) . fun-type . (B . $ . x2))))が成り立つ。これは等しい対象は述語によって区別できないことを表す。@ref["001C"]はこの類似で、型理論においては同一視される要素を型の族では区別できないことを表す。 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src/Streicher--1993-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @thesis[ 8 | #:author @list[@%{Thomas Streicher}] 9 | #:title @%{Investigations into Intensional Type Theory} 10 | #:type @%{Habilitation Thesis} 11 | #:institution @%{Ludwig-Maximilians-Universität München} 12 | #:date (date 1993) 13 | #:url "https://www2.mathematik.tu-darmstadt.de/~streicher/HabilStreicher.pdf" 14 | ] 15 | ] 16 | -------------------------------------------------------------------------------- /src-0/node-0060.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0060}{myExercise} 6 | \myInlineMath{i}階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{F \myElemOf \myFunctor{C}{D}}を関手、 9 | \myInlineMath{x_{1}, x_{2} \myElemOf C}を対象、 10 | \myInlineMath{f \myElemOf \myCatMap\myAppParen{x_{1}, x_{2}}}を射とする。 11 | \myInlineMath{f}が同型ならば、 12 | \myInlineMath{F\myAppParen{f}}は同型であることを示せ。 13 | \end{myBlock} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src/0086.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/notation.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | (prefix-in tex: morg/math/tex)) 7 | 8 | (define α tex:alpha) 9 | (define β tex:beta) 10 | 11 | @notation[ 12 | #:id (current-id) 13 | #:indexes @list[ 14 | @notation-index[#:key "a==b"]{@(math (α . def-eq . β))} 15 | ] 16 | @paragraph{ 17 | 同じ種類の対象@(math α)と@(math β)が@emph{定義により等しい}ことを@(math (α . def-eq . β))と書く。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/lib/math/nat-trans.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt" 4 | (prefix-in l: "paren-level.rkt") 5 | (prefix-in tex: morg/math/tex) 6 | morg/math) 7 | 8 | (provide nat-trans 9 | id-nat-trans 10 | nat-trans-comp) 11 | 12 | (define nat-trans (const "NatTrans")) 13 | (define id-nat-trans (const "id")) 14 | (define nat-trans-comp/symb tex:circ) 15 | (define nat-trans-comp 16 | (monoid #:level l:comp id-nat-trans nat-trans-comp/symb)) 17 | -------------------------------------------------------------------------------- /src/004N.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{同値の概念} 6 | @paragraph{ 7 | @ref["0044"]より、関数が同値であることは命題であることが分かったが、@ref["004I"]で導入した他の同値の概念が命題であることも示す。 8 | } 9 | @paragraph{ 10 | まずは両側可逆性(@ref["004J"])を考える。 11 | } 12 | (include-part "004P.rkt") 13 | (include-part "004Q.rkt") 14 | (include-part "004O.rkt") 15 | @paragraph{ 16 | 次に、半随伴同値(@ref["004L"])を考える。 17 | } 18 | (include-part "004S.rkt") 19 | (include-part "004R.rkt") 20 | ] 21 | -------------------------------------------------------------------------------- /src/lib/math/nat.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/math 4 | (prefix-in tex: "tex.rkt") 5 | "core.rkt") 6 | 7 | (provide nat 8 | nat:zero 9 | nat:succ 10 | nat:plus 11 | prim-rec 12 | nat:ind) 13 | 14 | (define nat @tex:mathbb{N}) 15 | (define nat:zero "0") 16 | (define nat:succ (const "succ")) 17 | (define nat:ind (ind/symb . _ . nat)) 18 | (define nat:plus (const "plus")) 19 | (define prim-rec (const "prim-rec")) 20 | -------------------------------------------------------------------------------- /src-0/node-0057-logic.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0057}{述語論理} 6 | 7 | 命題の概念の導入により、\emph{一階述語論理}を型理論の中で模倣できる。 8 | 9 | \subfile{node-0058-logic-notation} 10 | \subfile{node-005A} 11 | 12 | ただし、特別な公理を課さない限り 13 | 型理論で模倣できる論理は\emph{直観主義論理}である。 14 | 特に、命題\myInlineMath{P}に対して 15 | \myInlineMath{P \myLogicOr \myNeg P}が真であるとは限らない。 16 | 17 | \subfile{node-0059-lem} 18 | 19 | 排中律は従来の数学では当たり前のように使われるが、 20 | ホモトピー型理論ではほとんど\emph{排中律を仮定しない}。 21 | 22 | \end{document} -------------------------------------------------------------------------------- /src/Lumsdaine--2010-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Peter LeFanu Lumsdaine}] 9 | #:title @%{Weak ω-categories from intensional type theory} 10 | #:journal-title @%{Logical Methods in Computer Science} 11 | #:date (date 2010 9 17) 12 | #:volume @%{6} 13 | #:number @%{3} 14 | #:doi "10.2168/lmcs-6(3:24)2010" 15 | #:eprint @eprint["0812.0409v4"] 16 | ] 17 | ] 18 | -------------------------------------------------------------------------------- /src-0/node-001U.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001U}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A_{1}, A_{2}, A_{3} \myElemOf \myUniverse{i}}を型とする。 8 | 関数\myInlineMath{f \myElemOf A_{1} \myFunType A_{2}}, 9 | \myInlineMath{g \myElemOf A_{2} \myFunType A_{3}}, 10 | \myInlineMath{h \myElemOf A_{3} \myFunType A_{1}}がある時、 11 | 各\myInlineMath{A_{n}}と\myInlineMath{A_{m}}は論理的に同値であることを確かめよ。 12 | \end{myBlock} 13 | 14 | \end{document} 15 | -------------------------------------------------------------------------------- /src-0/node-006J.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006J}{myTheorem} 6 | 関数外延性と一価性を仮定する。 7 | \myInlineMath{i}を階数とすると、 8 | \myInlineMath{\mySetCat{i}}は圏である。 9 | \end{myBlock} 10 | \begin{myProof} 11 | 対象\myInlineMath{A, B \myElemOf \mySetCat{i}}に対して、 12 | \myRef{006I}より\myInlineMath{(A \myCatIso B) \myEquiv (A \myEquiv B)}を得て、 13 | 一価性と\myRef{0049}より\myInlineMath{(A \myEquiv B) \myEquiv (A \myIdType B)}を得る。 14 | \end{myProof} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src/0059.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/axiom.rkt" 4 | "lib/math.rkt" 5 | "lib/math/logic.rkt") 6 | 7 | (define i "i") 8 | (define P "P") 9 | 10 | @axiom[ 11 | #:id (current-id) 12 | #:title @%{排中律} 13 | #:indexes @list[ 14 | @index[#:key "はいちゅうりつ"]{排中律} 15 | ] 16 | @paragraph{ 17 | @dfn{排中律(law of excluded middle)}は任意の階数@(math i)と型@(math (P . elem-of . (universe . $ . i)))に対して、@(math P)が命題ならば@(math (P . logic-or . (logic-neg P)))が真であることを要請する。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/006M.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/cat.rkt" 6 | "lib/math/functor.rkt" 7 | "lib/math/presheaf.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | 12 | @exercise[ 13 | #:id (current-id) 14 | @paragraph{ 15 | 関数外延性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏とする。@(math (presheaf-cat . $ . C))と@(math (functor-cat . $* . (opposite-cat . $ . C) (set-cat . $ . i)))の間の前圏の同型を構成せよ。 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /src-0/node-005Q-truncated-map.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005Q}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数、 9 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 10 | 型\myInlineMath{\myIsTruncMap{n}{f} \myElemOf \myUniverse{i}}を 11 | \myInlineMath{\myDFunType{y \myElemOf B} 12 | {\myIsTrunc{n}{\myFiber{f}{y}}}}と定義する。 13 | \end{myBlock} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src/000R.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{識別子} 6 | @paragraph{ 7 | 本書ではすべての章や定理などに一意で恒久的な@emph{識別子}が割り当てられている。章番号や定理番号は本書の更新に伴って変わることがあるのに対し、識別子は変わることはない。そのため、本書の特定の箇所を参照する場合は識別子を使うことを強く推奨する。HTML版では識別子ごとのページも作成されており、@code{https://uemurax.github.io/hott-ja/<識別子>.html}からアクセスできる。PDF版では識別子ごとのページは作成していない。 8 | } 9 | @paragraph{ 10 | ちなみに、識別子を使うというアイディアは@href["https://stacks.math.columbia.edu/"]{Stacks project}や@href["https://kerodon.net/"]{Kerodon}を参考にしている。 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /src-0/node-0061.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0061}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{F \myElemOf \myFunctor{C}{D}}を関手、 9 | \myInlineMath{x_{1}, x_{2} \myElemOf C}を対象、 10 | \myInlineMath{f \myElemOf \myCatMap\myAppParen{x_{1}, x_{2}}}を射とする。 11 | \myInlineMath{F}は充満忠実であると仮定する。 12 | \myInlineMath{F\myAppParen{f}}が同型ならば 13 | \myInlineMath{f}は同型であることを示せ。 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src/0018.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/pair.rkt" 5 | "lib/markup/example.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define z "z") 11 | 12 | @example[ 13 | #:id (current-id) 14 | @paragraph{ 15 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型とする。関数@(math ((pair-sym . $* . A B) . elem-of . ((A . pair-type . B) . fun-type . (B . pair-type . A))))を@(math (abs z (pair . $* . ((proj 2) . $ . z) ((proj 1) . $ . z))))と定義する。 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /src/lib/math/group.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide group-str 6 | group:carrier 7 | group:unit 8 | group:mul 9 | group:inv 10 | group-axiom 11 | group) 12 | 13 | (define group-str (const "GroupStr")) 14 | (define group:carrier (const "Carrier")) 15 | (define group:unit (const "unit")) 16 | (define group:mul (const "mul")) 17 | (define group:inv (const "inv")) 18 | (define group-axiom (const "GroupAxiom")) 19 | (define group (const "Group")) 20 | -------------------------------------------------------------------------------- /src-0/node-000K-unit-rule.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000K}{myRule} 6 | \begin{enumerate} 7 | \item \myNewTerm[たんいがた]{単位型}(unit type) 8 | \myInlineMath{\myUnitType \myElemOf \myUniverse{\myLevelZero}} 9 | を構成できる。 10 | \item 要素\myInlineMath{\myUnitElem \myElemOf \myUnitType} 11 | を構成できる。 12 | \item 要素\myInlineMath{a \myElemOf \myUnitType}に対し、 13 | \myInlineMath{a \myDefEq \myUnitElem}と定義される。 14 | \end{enumerate} 15 | \end{myBlock} 16 | 17 | \end{document} 18 | -------------------------------------------------------------------------------- /src/000Y.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/markup/definition.rkt") 5 | 6 | (define i "i") 7 | (define X "X") 8 | (define Y "Y") 9 | 10 | @definition[ 11 | #:id (current-id) 12 | #:indexes @list[ 13 | @index[#:key "いっかせい"]{一価性} 14 | ] 15 | @paragraph{ 16 | @(math i)を階層とする。宇宙@(math (universe . $ . i))が@dfn{一価性(univalence)}を満たすとは、@(math (d-fun-type (X . elem-of . (universe . $ . i)) (is-contr . $ . (d-pair-type (Y . elem-of . (universe . $ . i)) (X . equiv . Y)))))の要素があることである。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-0011-composition.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0011}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B, C \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}と 9 | \myInlineMath{g \myElemOf B \myFunType C}を関数とする。 10 | \myNewTerm[ごうせいかんすう]{合成関数}(composed function) 11 | \myInlineMath{g \myFunComp f \myElemOf A \myFunType C}を 12 | \myInlineMath{\myAbs{x}{g\myAppParen{f\myAppParen{x}}}}と定義する。 13 | \end{myBlock} 14 | 15 | \end{document} 16 | -------------------------------------------------------------------------------- /src-0/node-003M-circle.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003M}{myAxiom} 6 | \begin{enumerate} 7 | \item 始\myInlineMath{\myCircle}代数\myInlineMath{\myCircle \myElemOf 8 | \myCircleAlg{\myLevelZero}}がある。 9 | \item \myInlineMath{i}を階数、 10 | \myInlineMath{A \myElemOf \myCircleAlg{i}}を始\myInlineMath{\myCircle}代数とすると、 11 | \myInlineMath{A}は階数\myInlineMath{\myLevelSucc{i}}においても 12 | 始\myInlineMath{\myCircle}代数である。 13 | \end{enumerate} 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005Y-embedding.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005Y}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myIsEmbedding{f} \myElemOf \myUniverse{i}}を 10 | \myInlineMath{\myIsTruncMap{\myTLMinusOne}{f}}と定義する。 11 | \myInlineMath{\myIsEmbedding{f}}の要素がある時、 12 | \myInlineMath{f}は\myNewTerm[うめこみ]{埋め込み}(embedding)であると言う。 13 | \end{myBlock} 14 | 15 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0075.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0075}{myLemma} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{\myFunctor{C}{D}}を関手とする。 9 | \myInlineMath{D}が圏で、 10 | \myInlineMath{F}が本質的全射ならば、 11 | \myInlineMath{F\myRecordField\myFunctorObj \myElemOf 12 | C\myRecordField\myCatObj \myFunType 13 | D\myRecordField\myCatObj}は全射である。 14 | \end{myBlock} 15 | \begin{myProof} 16 | 定義からすぐである。 17 | \end{myProof} 18 | 19 | \end{document} -------------------------------------------------------------------------------- /src/007H.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (define (GitHub [s : String]) 4 | (href (format "https://github.com/~a" s))) 5 | 6 | (define (Twitter [s : String]) 7 | (href (format "https://twitter.com/~a" s))) 8 | 9 | @section[ 10 | #:id (current-id) 11 | #:title @%{貢献者} 12 | @paragraph{ 13 | 執筆、誤字脱字の報告などで本書の内容に直接影響を与えた者たちの一覧。 14 | } 15 | @paragraph{ 16 | @unordered-list[ 17 | @list-item{Taichi Uemura (@GitHub["uemurax"], @Twitter["t_uemura669101"])} 18 | @list-item{立腹層(@Twitter["rippukusou"])} 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/van-den-Berg--Garner--2011-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Benno van den Berg} @%{Richard Garner}] 9 | #:title @%{Types are weak ω-groupoids} 10 | #:journal-title @%{Proceedings of the London Mathematical Society} 11 | #:date (date 2011) 12 | #:volume @%{102} 13 | #:number @%{2} 14 | #:pages @%{370--394} 15 | #:doi "10.1112/plms/pdq026" 16 | #:eprint @eprint["0812.0298v2"] 17 | ] 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-002M-diagonal.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002M}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | 関数\myInlineMath{\myDiagonal{A} \myElemOf 9 | A \myFunType A \myPairType A}であって、 10 | 任意の\myInlineMath{a \myElemOf A}に対して 11 | \myInlineMath{\myProjI{\myDiagonal{A}\myAppParen{a}} \myDefEq a}, 12 | \myInlineMath{\myProjII{\myDiagonal{A}\myAppParen{a}} \myDefEq a} 13 | となるものを構成せよ。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src-0/node-002P-unit.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002P}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{a_{1}, a_{2} \myElemOf A}を要素、 9 | \myInlineMath{p \myElemOf a_{1} \myIdType a_{2}}を同一視とする。 10 | 同一視\myInlineMath{\myIdUnitL{p} \myElemOf 11 | \myRefl{a_{2}} \myIdComp p \myIdType p}と 12 | \myInlineMath{\myIdUnitR{p} \myElemOf 13 | p \myIdType p \myIdComp \myRefl{a_{1}}}を構成せよ。 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005T-connected.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{005T}{連結性} 6 | 7 | \myInlineMath{n}型は\myInlineMath{n}次元より上の構造が自明な型であったが、 8 | 逆に\myInlineMath{n}次元以下の構造が自明な型を導入する。 9 | 10 | \subfile{node-005U-connected} 11 | \subfile{node-005V-connected-map} 12 | \subfile{node-005W} 13 | \subfile{node-005X} 14 | 15 | 定義から、任意の関数は\myInlineMath{\myTLMinusTwo}連結である。 16 | \myInlineMath{\myTLMinusOne}連結な関数は\emph{全射}であると考える。 17 | 18 | \subfile{node-005Z-surjective} 19 | \subfile{node-0074} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-000W-large-record.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000W}{myNotation} 6 | 大きなレコード型を定義する際には、 7 | 文章内で\myInlineMath{\myRecordType{x_{1} \myElemOf A_{1}, \myDots, x_{n} \myElemOf A_{n}}} 8 | と書く代わりに縦に並べて 9 | \begin{itemize} 10 | \item \myInlineMath{x_{1} \myElemOf A_{1}} 11 | \item \myInlineMath{\myVDots} 12 | \item \myInlineMath{x_{n} \myElemOf A_{n}} 13 | \end{itemize} 14 | と書くことがある。 15 | レコード型の要素を定義する際にも同様に縦に並べて書くことがある。 16 | \end{myBlock} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /src-0/node-001H-groupoid-comparison.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001H}{myComparison} 6 | 述語論理において、\emph{対称律} 7 | \myInlineMath{x_{1} \myIdType x_{2} \myFunType x_{2} \myIdType x_{1}} 8 | と\emph{推移律} 9 | \myInlineMath{x_{1} \myIdType x_{2} \myFunType 10 | x_{2} \myIdType x_{3} \myFunType 11 | x_{1} \myIdType x_{3}}が成り立つ。 12 | \myRef{001E}はこの類似である。 13 | ちなみに、\myInlineMath{\myRefl{x} \myElemOf x \myIdType x} 14 | は\emph{反射律}とも思える。 15 | \end{myBlock} 16 | 17 | \end{document} 18 | -------------------------------------------------------------------------------- /src-0/node-0027.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0027}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{a_{1}, a_{2} \myElemOf A}を要素、 9 | \myInlineMath{p \myElemOf a_{1} \myIdType a_{2}}を同一視とする。 10 | 同一視\myInlineMath{\myIdSymSym{p} \myElemOf 11 | (p^{\myIdInv})^{\myIdInv} \myIdType p}を帰納法により 12 | \myInlineMath{\myIdSymSym{\myRefl{a_{1}}} \myDefEq \myRefl{\myRefl{a_{1}}}} 13 | と定義する。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src-0/node-001P-fiber.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001P}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数、 9 | \myInlineMath{b \myElemOf B}を要素とする。 10 | 型\myInlineMath{\myFiber{f}{b} \myElemOf \myUniverse{i}}を 11 | \myInlineMath{\myRecordType{\myFiberElem \myElemOf A, 12 | \myFiberId \myElemOf f\myAppParen{\myFiberElem} \myIdType b}} 13 | と定義する。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src-0/node-0034-descent.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0034}{降下性} 6 | 7 | 高次帰納的型は一価性公理の下で\emph{降下性}(descent property)という著しい性質を持つ。 8 | 降下性という言葉は∞トポス理論から取ったもので、 9 | 余極限が有限極限に関して「良く」振る舞うという性質である。 10 | 11 | 最も簡単な降下性は空型\myInlineMath{\myEmptyType}が 12 | \emph{厳格}(strict)であることを表す次の\myRef{003T}であり、 13 | これには一価性は必要ない。 14 | 15 | \subfile{node-003T} 16 | 17 | 次の\myRef{003U}は余積の\emph{広域性}(extensivity)と呼ばれる性質で、 18 | これにも一価性は必要ない。 19 | 20 | \subfile{node-003U} 21 | 22 | \subfile{node-003V} 23 | 24 | \end{document} 25 | -------------------------------------------------------------------------------- /src/0052.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/math.rkt" 5 | "lib/math/n-type.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | (define a1 (a . _ . "1")) 11 | (define a2 (a . _ . "2")) 12 | (define n "n") 13 | 14 | @corollary[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (a1 a2 . elem-of* . A))を要素、@(math (n . elem-of . trunc-level))を要素とする。@(math A)が@(math n)型ならば、@(math (a1 . id-type . a2))も@(math n)型である。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/004M.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/hae.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define f "f") 11 | 12 | @exercise[ 13 | #:id (current-id) 14 | @paragraph{ 15 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。型@(math (is-equiv . $ . f))と@(math (is-hae . $ . f))は論理的に同値であることを示せ。(ヒント:@ref["002H"]の証明を拡張すれば@(math ((is-equiv . $ . f) . fun-type . (is-hae . $ . f)))を示せる。) 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /src/005X.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define n "n") 11 | 12 | @proposition[ 13 | #:id (current-id) 14 | @paragraph{ 15 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (n . elem-of . trunc-level))を要素とする。@(math A)が@(math n)型かつ@(math n)連結ならば、@(math A)は可縮である。 16 | } 17 | #:proof @proof[ 18 | @paragraph{ 19 | @ref["0051"]から従う。 20 | } 21 | ] 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-0030-empty.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0030}{myRule} 6 | \begin{enumerate} 7 | \item \myNewTerm[くうがた]{空型}(empty type) 8 | \myInlineMath{\myEmptyType \myElemOf \myUniverse{\myLevelZero}}を構成できる。 9 | \item \myInlineMath{c \myElemOf \myEmptyType}を要素、 10 | \myInlineMath{i}を階数、 11 | \myInlineMath{A \myElemOf \myEmptyType \myFunType \myUniverse{i}}を型の族とすると、 12 | 要素\myInlineMath{\myEmptyInd{c}{A} \myElemOf A\myAppParen{c}}を構成できる。 13 | \end{enumerate} 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0031-initial-algebra.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0031}{始代数} 6 | 7 | \subfile{node-0035-n-algebra} 8 | \subfile{node-0036-n-hom} 9 | \subfile{node-0037-composition} 10 | \subfile{node-0038-initial-n-algebra} 11 | \subfile{node-0039-displayed-n-algebra} 12 | \subfile{node-003A-n-section} 13 | \subfile{node-003B} 14 | \subfile{node-003G} 15 | \subfile{node-003H} 16 | \subfile{node-003D} 17 | \subfile{node-003E} 18 | \subfile{node-003F} 19 | \subfile{node-003C} 20 | \subfile{node-003I} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /src-0/node-000R-identifier.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{000R}{識別子} 6 | 7 | 本書ではすべての章や定理などに一意で恒久的な\emph{識別子}が割り当てられている。 8 | 識別子は4桁の英数字で、 9 | 題名の横に例えば\myNodeTitle{05AF}のように表示される。 10 | 章番号や定理番号は本書の更新に伴って変わることがあるのに対し、 11 | 識別子は変わることはない。 12 | そのため、本書の特定の箇所を参照する場合は識別子を使うことを強く推奨する。 13 | 14 | この識別子の様式は 15 | \myHRef{https://stacks.math.columbia.edu/}{Stacks project}や 16 | \myHRef{https://kerodon.net/}{Kerodon}のものと同等ではあるが、 17 | 本書では(今のところ)識別子に恒久的なURLは与えられていない。 18 | 「\myLinkNodeIndex{}」のページから識別子の場所を参照できる。 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src-0/node-001Q-is-equivalence.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001Q}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myIsEquiv{f} \myElemOf \myUniverse{i}}を 10 | \myInlineMath{\myDFunType{y \myElemOf B} 11 | {\myIsContr{\myFiber{f}{y}}}}と定義する。 12 | \myInlineMath{\myIsEquiv{f}}の要素がある時、 13 | \myInlineMath{f}は\myNewTerm[どうち]{同値}(equivalence)であると言う。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src-0/node-003E.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003E}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myNatAlg{i}}を\myInlineMath{\myNat}代数、 8 | \myInlineMath{B \myElemOf \myNatAlgOver{A}}を 9 | \myInlineMath{A}上の\myInlineMath{\myNat}代数とする。 10 | \myInlineMath{\myNatSection{B}}は 11 | \myInlineMath{\myFiber{\myAbs{(f \myElemOf \myNatHom{A}{\myTotalNatAlg{B}})} 12 | {\myTotalNatAlgProj{B} \myNatHomComp f}} 13 | {\myIdNatHom{A}}}のレトラクトであることを示せ。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src-0/node-004U.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004U}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myIsEquiv{f}}と\myInlineMath{\myQInv{f}}は 10 | 論理的に同値である。 11 | \end{myBlock} 12 | \begin{myProof} 13 | \myInlineMath{\myIsHAE{f} \myFunType \myQInv{f}}と 14 | \myInlineMath{\myQInv{f} \myFunType \myIsBiinv{f}}は容易に示せるので、 15 | \myRef{004K}と\myRef{004M}を使う。 16 | \end{myProof} 17 | 18 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005H.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005H}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{x_{1}, x_{2} \myElemOf C}を対象、 9 | \myInlineMath{f \myElemOf \myCatMap\myAppParen{x_{1}, x_{2}}}を射とすると、 10 | 型\myInlineMath{\myCatIsIso{f}}は命題である。 11 | \end{myBlock} 12 | \begin{myProof} 13 | \myRef{0041}より、\myInlineMath{f}が同型であると仮定して 14 | \myInlineMath{\myCatIsIso{f}}が可縮であることを示せばよいが、 15 | これは\myRef{005G}からすぐに従う。 16 | \end{myProof} 17 | 18 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0047-inverse.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0047}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{a_{1}, a_{2} \myElemOf A}を要素、 9 | \myInlineMath{p \myElemOf a_{1} \myIdType a_{2}}を同一視とする。 10 | 同一視\myInlineMath{\myIdSymInvL{p} \myElemOf p^{\myIdInv} \myIdComp p 11 | \myIdType \myRefl{a_{1}}}と 12 | \myInlineMath{\myIdSymInvR{p} \myElemOf p \myIdComp p^{\myIdInv} 13 | \myIdType \myRefl{a_{2}}}を構成せよ。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src-0/node-0068.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0068}{myProposition} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 9 | \myInlineMath{F, G \myElemOf \myFunctor{C}{D}}を関手、 10 | \myInlineMath{s, t \myElemOf \myNatTrans{F}{G}}を自然変換とすると、 11 | 同値\myDisplayMath{(s \myIdType t) \myEquiv 12 | (\myForall{x \myElemOf C}{s\myAppParen{x} \myIdType t\myAppParen{x}})}を構成できる。 13 | \end{myBlock} 14 | \begin{myProof} 15 | \myRef{0049}と関数外延性から従う。 16 | \end{myProof} 17 | 18 | \end{document} -------------------------------------------------------------------------------- /src/000G.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/markup/definition.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define x "x") 11 | 12 | @definition[ 13 | #:id (current-id) 14 | #:indexes @list[ 15 | @notation-index[#:key "A->B"]{@(math (A . fun-type . B))} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型とする。このとき、@(math ((A . fun-type . B) . elem-of . (universe . $ . i)))を@(math (d-fun-type (x . elem-of . A) B))と定義する。 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /src/000M.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define x "x") 11 | 12 | @definition[ 13 | #:id (current-id) 14 | #:indexes @list[ 15 | @notation-index[#:key "A×B"]{@(math (A . pair-type . B))} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型とする。型@(math ((A . pair-type . B) . elem-of . (universe . $ . i)))を@(math (d-pair-type (x . elem-of . A) B))と定義する。 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /src/001H.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/comparison.rkt" 4 | "lib/math.rkt") 5 | 6 | (define x "x") 7 | (define x1 (x . _ . "1")) 8 | (define x2 (x . _ . "2")) 9 | (define x3 (x . _ . "3")) 10 | 11 | @comparison[ 12 | #:id (current-id) 13 | @paragraph{ 14 | 述語論理において、@emph{対称律}@(math ((x1 . id-type . x2) . fun-type . (x2 . id-type . x1)))と@emph{推移律}@(math ((x1 . id-type . x2) . fun-type . ((x2 . id-type . x3) . fun-type . (x1 . id-type . x3))))が成り立つ。@ref["001E"]はこの類似である。ちなみに、@(math (refl . elem-of . (x . id-type . x)))は@emph{反射律}とも思える。 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src-0/node-005U-connected.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005U}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 9 | 型\myInlineMath{\myIsConnected{n}{A} \myElemOf \myUniverse{i}}を 10 | \myInlineMath{\myIsContr{\myTrunc{n}{A}}}と定義する。 11 | \myInlineMath{\myIsConnected{n}{A}}の要素がある時、 12 | \myInlineMath{A}は\myNewTerm[nれんけつ]{\protect\myInlineMath{n}連結} 13 | (\myInlineMath{n}-connected)であると言う。 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src/0010.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/markup/example.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define x "x") 10 | 11 | @example[ 12 | #:id (current-id) 13 | #:indexes @list[ 14 | @index[#:key "こうとうかんすう"]{恒等関数} 15 | @index[#:key "id"]{@(math id-fun) (関数)} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。@dfn{恒等関数(identity function)}@(math (id-fun . elem-of . (A . fun-type . A)))を@(math ((id-fun . $ . x) . def-eq . x))と定義する。 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /src/006R.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/cat.rkt" 6 | "lib/math/functor.rkt" 7 | "lib/math/bifunctor.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define D "D") 12 | (define X "X") 13 | 14 | @exercise[ 15 | #:id (current-id) 16 | @paragraph{ 17 | 関数外延性を仮定する。@(math i)を階数、@(math (C D X . elem-of* . (precat . $ . i)))を前圏とする。同値 18 | @disp{ 19 | @(math ((functor . $* . X (functor-cat . $* . C D)) . equiv . (bifunctor C X D))) 20 | } 21 | を構成せよ。 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /src/002M.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/pair.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | 11 | @exercise[ 12 | #:id (current-id) 13 | @paragraph{ 14 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。関数@(math ((diagonal . $ . A) . elem-of . (A . fun-type . (A . pair-type . A))))であって、任意の@(math (a . elem-of . A))に対して@(math (((proj 1) . $ . (diagonal . $* . A a)) . def-eq . a))かつ@(math (((proj 2) . $ . (diagonal . $* . A a)) . def-eq . a))となるものを構成せよ。 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src/0043.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define n "n") 11 | 12 | @corollary[ 13 | #:id (current-id) 14 | @paragraph{ 15 | 関数外延性を仮定する。@(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (n . elem-of . trunc-level))を要素とすると、@(math (is-trunc . $* . n A))は命題である。 16 | } 17 | #:proof @proof[ 18 | @paragraph{ 19 | @ref["0042"]と@ref["0048"]から、@(math n)についての帰納法で示せる。 20 | } 21 | ] 22 | ] 23 | -------------------------------------------------------------------------------- /src/Kapulkin--Lumsdaine--2021-0000.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/bibliography.rkt") 4 | 5 | @bibliography[ 6 | #:id (current-id) 7 | @article[ 8 | #:author @list[@%{Krzysztof Kapulkin} @%{Peter LeFanu Lumsdaine}] 9 | #:title @%{The simplicial model of univalent foundations (after Voevodsky)} 10 | #:journal-title @%{Journal of the European Mathematical Society (JEMS)} 11 | #:date (date 2021) 12 | #:volume @%{23} 13 | #:number @%{6} 14 | #:pages @%{2071--2126} 15 | #:doi "10.4171/JEMS/1050" 16 | #:eprint @eprint["1211.2851v5"] 17 | ] 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-004S.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004S}{myLemma} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数、 9 | \myInlineMath{a_{1}, a_{2} \myElemOf A}を要素とする。 10 | \myInlineMath{f}が同値ならば 11 | \myInlineMath{\myIdApp{f} \myElemOf 12 | a_{1} \myIdType a_{2} \myFunType 13 | f\myAppParen{a_{1}} \myIdType f\myAppParen{a_{2}}}は同値である。 14 | \end{myBlock} 15 | \begin{myProof} 16 | \myRef{004F}と\myRef{005R}から従う。 17 | \end{myProof} 18 | 19 | \end{document} -------------------------------------------------------------------------------- /src/0004.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{圏論} 6 | @paragraph{ 7 | @emph{圏論}は数学における対象とその間の写像の概念を抽象化した構造を調べる分野である。特に、対象の間の@emph{同型}の概念が一般的に定義され、同型こそが対象の「正しい」同一視のしかたと考えられる。しかし、例えば集合論を数学の基礎とした場合、同型な対象であっても等しいとは限らないので、それらを厳密に同一視するわけにはいかない。一方、型理論を数学の基礎とした場合、一価性公理と同様の発想で同型の型と同一視型が同値になるような条件を圏に課す余地があり、実際に多くの圏の具体例は一価性公理の下でその条件を満たす。その意味で、圏論はホモトピー型理論を基礎とするのが適切である分野の一つである。 8 | } 9 | #:subsections @list[ 10 | (include-part "005B.rkt") 11 | (include-part "005J.rkt") 12 | (include-part "0065.rkt") 13 | (include-part "006D.rkt") 14 | ] 15 | ] 16 | -------------------------------------------------------------------------------- /src-0/node-006I.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006I}{myLemma} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{A, B \myElemOf \mySetCat{i}}を対象、 9 | \myInlineMath{f \myElemOf \myCatMap\myAppParen{A, B}}を射とする。 10 | 次は論理的に同値である。 11 | \begin{enumerate} 12 | \item \label{006I:0000} \myInlineMath{f}は\myInlineMath{\mySetCat{i}}の 13 | 射として同型である。 14 | \item \label{006I:0001} \myInlineMath{f}は関数として同値である。 15 | \end{enumerate} 16 | \end{myBlock} 17 | \begin{myProof} 18 | \myRef{004K}による。 19 | \end{myProof} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src/0057.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/logic.rkt") 5 | 6 | (define P "P") 7 | 8 | @section[ 9 | #:id (current-id) 10 | #:title @%{述語論理} 11 | @paragraph{ 12 | 命題の概念の導入により、@emph{一階述語論理}を型理論の中で模倣できる。 13 | } 14 | (include-part "0058.rkt") 15 | (include-part "005A.rkt") 16 | @paragraph{ 17 | ただし、特別な公理を課さない限り型理論で模倣できる論理は@emph{直観主義論理}である。特に、命題@(math P)に対して@(math (P . logic-or . (logic-neg P)))が真であるとは限らない。 18 | } 19 | (include-part "0059.rkt") 20 | @paragraph{ 21 | 排中律は従来の数学では当たり前のように使われるが、ホモトピー型理論ではほとんど@emph{排中律を仮定しない}。 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /src-0/node-005Z-surjective.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005Z}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myIsSurjective{f} \myElemOf \myUniverse{i}}を 10 | \myInlineMath{\myForall{y \myElemOf B} 11 | {\myExists{x \myElemOf A} 12 | {f\myAppParen{x} \myIdType y}}}と定義する。 13 | \myInlineMath{\myIsSurjective{f}}の要素がある時、 14 | \myInlineMath{f}は\myNewTerm[ぜんしゃ]{全射}(surjection)であると言う。 15 | \end{myBlock} 16 | 17 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0069-functor-category.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0069}{myDefinition} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏とする。 9 | 前圏\myInlineMath{\myFunctorCat{C}{D} \myElemOf \myPreCat{i}}を次のように定義する。 10 | \begin{itemize} 11 | \item \myInlineMath{\myCatObj \myDefEq \myFunctor{C}{D}} 12 | \item \myInlineMath{\myCatMap \myDefEq \myAbs{F G}{\myNatTrans{F}{G}}} 13 | \item 恒等射と合成は\myRef{0067}の通り。 14 | \item 残りは\myRef{0068}から容易に示せる。 15 | \end{itemize} 16 | \end{myBlock} 17 | 18 | \end{document} -------------------------------------------------------------------------------- /src/005T.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/n-type.rkt") 5 | 6 | (define n "n") 7 | 8 | @section[ 9 | #:id (current-id) 10 | #:title @%{連結性} 11 | @paragraph{ 12 | @(math n)型は@(math n)次元より上の構造が自明な型であったが、逆に@(math n)次元以下の構造が自明な型を導入する。 13 | } 14 | (include-part "005U.rkt") 15 | (include-part "005V.rkt") 16 | (include-part "005W.rkt") 17 | (include-part "005X.rkt") 18 | @paragraph{ 19 | 定義から、任意の関数は@(math trunc-level:-2)連結である。@(math trunc-level:-1)連結な関数は@emph{全射}であると考える。 20 | } 21 | (include-part "005Z.rkt") 22 | (include-part "0074.rkt") 23 | ] 24 | -------------------------------------------------------------------------------- /src/lib/math/coproduct.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | (prefix-in l: "paren-level.rkt") 5 | "core.rkt" 6 | "empty.rkt") 7 | 8 | (provide coproduct-type 9 | coproduct-type/symb 10 | coproduct-type:ind 11 | coproduct-type:in) 12 | 13 | (define coproduct-type/symb "+") 14 | 15 | (define coproduct-type 16 | (monoid #:level l:+ empty-type coproduct-type/symb)) 17 | 18 | (define (coproduct-type:in [n : Natural]) 19 | ((const "in") . _ . (number->string n))) 20 | 21 | (define coproduct-type:ind (ind/symb . _ . coproduct-type/symb)) 22 | -------------------------------------------------------------------------------- /src-0/node-001D-extension.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001D}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{a_{0}, a_{1}, a_{2} \myElemOf A}を要素、 9 | \myInlineMath{p_{1} \myElemOf a_{0} \myIdType a_{1}}と 10 | \myInlineMath{p_{2} \myElemOf a_{0} \myIdType a_{2}}を同一視とする。 11 | 同一視\myInlineMath{\myIdExtension{p_{1}}{p_{2}} \myElemOf a_{1} \myIdType a_{2}}を 12 | \myInlineMath{\myTransport{\myAbs{x}{x \myIdType a_{2}}}{p_{1}}\myAppParen{p_{2}}}と定義する。 13 | \end{myBlock} 14 | 15 | \end{document} 16 | -------------------------------------------------------------------------------- /src-0/node-004O.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004O}{myProposition} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 9 | \myInlineMath{f \myElemOf A \myFunType B}を関数とすると、 10 | 型\myInlineMath{\myIsBiinv{f}}は命題である。 11 | \end{myBlock} 12 | \begin{myProof} 13 | \myRef{0041}より、 14 | \myInlineMath{f}が両側可逆であると仮定して 15 | \myInlineMath{\myIsBiinv{f}}が可縮であることを示せばよいが、 16 | \myRef{004K}より\myInlineMath{f}は同値なので、 17 | \myRef{004Q}から\myInlineMath{\myIsBiinv{f}}が可縮であることが従う。 18 | \end{myProof} 19 | 20 | \end{document} -------------------------------------------------------------------------------- /src/000V.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/markup/definition.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | 11 | @definition[ 12 | #:id (current-id) 13 | #:indexes @list[ 14 | @notation-index[#:key "A~_B"]{@(math (A . equiv . B))} 15 | ] 16 | @paragraph{ 17 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型とする。型@(math ((A . equiv . B) . elem-of . (universe . $ . i)))を@(math (record-type (list equiv:fun (A . fun-type . B)) (list equiv:is-equiv (is-equiv . $ . equiv:fun))))と定義する。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src-0/node-0065-natural-transformation.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0065}{自然変換} 6 | 7 | \emph{自然変換}は関手の間の射の概念である。 8 | 実際、関手を対象、自然変換を射とする前圏を構成できる(\myRef{0069})。 9 | さらに、終域が圏であるような関手のなす前圏は圏であることを示す(\myRef{006C})。 10 | 11 | \subfile{node-0066-natural-transformation} 12 | \subfile{node-0067} 13 | \subfile{node-0068} 14 | \subfile{node-0069-functor-category} 15 | \subfile{node-006A} 16 | \subfile{node-006C} 17 | 18 | \myInlineMath{\myFunctorCat{C}{D}}は\emph{普遍性}でも特徴づけられる(\myRef{006R})。 19 | 20 | \subfile{node-006Q-bifunctor} 21 | \subfile{node-006R} 22 | 23 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006Y.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006Y}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{F \myElemOf \myFunctor{C}{D}}を関手、 9 | \myInlineMath{y \myElemOf D}を対象とする。 10 | 型\myInlineMath{\myIsoFiber{F}{y} \myElemOf \myUniverse{i}}を 11 | 次のレコード型と定義する。 12 | \begin{itemize} 13 | \item \myInlineMath{\myIsoFiberObj \myElemOf C} 14 | \item \myInlineMath{\myIsoFiberIso \myElemOf 15 | F\myAppParen{\myIsoFiberObj} \myCatIso y} 16 | \end{itemize} 17 | \end{myBlock} 18 | 19 | \end{document} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ホモトピー型理論 2 | 3 | *ホモトピー型理論 (Homotopy Type Theory, HoTT)* を日本語で解説する文書です。 4 | 5 | ## 準備 6 | 7 | ### Racket 8 | 9 | 適当に[Racket](https://racket-lang.org/)をインストールします。 10 | 11 | ### MOrg 12 | 13 | [MOrg](https://github.com/uemurax/morg)をインストールします。 14 | 15 | ```shell 16 | raco pkg install https://github.com/uemurax/morg 17 | ``` 18 | 19 | ### LaTeX 20 | 21 | `latexmk`と`luatexja`が要ります。 22 | 足りないパッケージがあれば[action.yml](.github/actions/build/action.yml)を参考にします。 23 | 24 | ## ビルド 25 | 26 | `make`を実行するとHTML版とPDF版を生成し`_site/`にコピーします。 27 | 28 | ## ライセンス 29 | 30 | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 31 | -------------------------------------------------------------------------------- /src-0/node-005V-connected-map.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005V}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数、 9 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 10 | 型\myInlineMath{\myIsConnectedMap{n}{f} \myElemOf \myUniverse{i}}を 11 | \myInlineMath{\myDFunType{y \myElemOf B} 12 | \myIsConnected{n}{\myFiber{f}{y}}}と定義する。 13 | \myInlineMath{\myIsConnectedMap{n}{f}}の要素がある時、 14 | \myInlineMath{f}は\myInlineMath{n}連結であると言う。 15 | \end{myBlock} 16 | 17 | \end{document} -------------------------------------------------------------------------------- /src/000W.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/markup/notation.rkt") 5 | 6 | (define x "x") 7 | (define A "A") 8 | (define n "n") 9 | 10 | @notation[ 11 | #:id (current-id) 12 | @paragraph{ 13 | 大きなレコード型を定義する際には、文章内で@(math (record-type... (list (x . _ . "1") (A . _ . "1")) (list (x . _ . n) (A . _ . n))))と書く代わりに縦に並べて 14 | @unordered-list[ 15 | @list-item{@(math ((x . _ . "1") . elem-of . (A . _ . "1")))} 16 | @list-item{@(math vdots)} 17 | @list-item{@(math ((x . _ . n) . elem-of . (A . _ . n)))} 18 | ] 19 | と書くことがある。レコード型の要素を定義する際にも同様に縦に並べて書くことがある。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/005N.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/cat.rkt" 6 | "lib/math/proposition.rkt" 7 | "lib/math/functor.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define D "D") 12 | (define F "F") 13 | 14 | @exercise[ 15 | #:id (current-id) 16 | #:title @%{前圏の構造同一原理} 17 | @paragraph{ 18 | 一価性と関数外延性を仮定する。@(math i)を階数、@(math (C D . elem-of* . (precat . $ . i)))を前圏とする。同値@disp{ 19 | @(math ((C . id-type . D) . equiv . (prop-compr (F . elem-of . (functor . $* . C D)) (is-precat-equiv . $ . F)))) 20 | }を構成せよ。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-006K-presheaf-category.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006K}{myDefinition} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏とする。 9 | 前圏\myInlineMath{\myPresheafCat{C} \myElemOf \myUniverse{\myLevelSucc{i}}}を 10 | 次のように定義する。 11 | \begin{itemize} 12 | \item \myInlineMath{\myCatObj \myDefEq \myPresheaf{C}} 13 | \item \myInlineMath{\myCatMap \myDefEq 14 | \myAbs{A B}{\myPresheafHom{A}{B}}} 15 | \item 恒等射と合成は\myRef{006L}の通りである。 16 | \item 前圏の公理は関数外延性から分かる。 17 | \end{itemize} 18 | \end{myBlock} 19 | 20 | \end{document} -------------------------------------------------------------------------------- /src/0027.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math/id.rkt" 4 | "lib/markup/example.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | (define a1 (a . _ . "1")) 11 | (define a2 (a . _ . "2")) 12 | (define p "p") 13 | 14 | @example[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (a1 a2 . elem-of* . A))を要素、@(math (p . elem-of . (a1 . id-type . a2)))を同一視とする。同一視@(math ((id-sym-sym . $ . p) . elem-of . ((id-inv (id-inv p)) . id-type . p)))を帰納法により@(math ((id-sym-sym . $ . refl) . def-eq . refl))と定義する。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/lib/math/biinv.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide is-biinv 6 | is-biinv:linv 7 | is-biinv:rinv 8 | linv 9 | linv:inv 10 | linv:id 11 | rinv 12 | rinv:inv 13 | rinv:id) 14 | 15 | (define is-biinv (const "IsBiinv")) 16 | (define is-biinv:linv (const "linv")) 17 | (define is-biinv:rinv (const "rinv")) 18 | 19 | (define linv (const "LInv")) 20 | (define linv:inv (const "inv")) 21 | (define linv:id (const "is-linv")) 22 | 23 | (define rinv (const "RInv")) 24 | (define rinv:inv (const "inv")) 25 | (define rinv:id (const "is-rinv")) 26 | -------------------------------------------------------------------------------- /src/lib/math/ring.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require "core.rkt") 4 | 5 | (provide ring-str 6 | ring:carrier 7 | ring:zero 8 | ring:plus 9 | ring:minus 10 | ring:mul 11 | ring:one 12 | ring-axiom 13 | ring) 14 | 15 | (define ring-str (const "RingStr")) 16 | (define ring:carrier (const "Carrier")) 17 | (define ring:zero (const "zero")) 18 | (define ring:plus (const "plus")) 19 | (define ring:minus (const "neg")) 20 | (define ring:mul (const "mul")) 21 | (define ring:one (const "one")) 22 | (define ring-axiom (const "RingAxiom")) 23 | (define ring (const "Ring")) 24 | -------------------------------------------------------------------------------- /src-0/node-004V-structure-identity-principle.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{004V}{構造同一原理} 6 | 7 | \myRef{0022}で構造同一原理の例をいくつか見たが、 8 | 群や環などの数学的に興味深い構造については後回しにしていた。 9 | これは、型理論において「\myInlineMath{a_{1} \myIdType a_{2}}」は単なる型なので 10 | 公理を適切に記述するためには\myRef{003Z}の意味での命題の概念が必要だからである。 11 | 例えば、ある二項演算\myInlineMath{\times}の結合律を素直に 12 | \myInlineMath{(a_{1} \times a_{2}) \times a_{3} \myIdType 13 | a_{1} \times (a_{2} \times a_{3})}と書くと、 14 | これは公理というよりも構造の一部になってしまう。 15 | 結合律を適切に公理として扱うためには、 16 | 同一視型が命題であることを要請すればよい。 17 | 18 | \subfile{node-004W-group} 19 | \subfile{node-004Y-ring} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-0079.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0079}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族とする。 9 | 関数\myInlineMath{p \myElemOf 10 | (A \myFunType \myDPairType{x \myElemOf A}{B\myAppParen{x}}) 11 | \myFunType (A \myFunType A)}を 12 | \myInlineMath{\myAbs{f}{\myAbs{x}{\myProjI{f\myAppParen{x}}}}}とし、 13 | 型\myInlineMath{\mySectionOfProj{A}{B} \myElemOf \myUniverse{i}}を 14 | \myInlineMath{\myFiber{p}{\myIdFun{A}}}と定義する。 15 | \end{myBlock} 16 | 17 | \end{document} 18 | -------------------------------------------------------------------------------- /src/001U.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt") 5 | 6 | (define i "i") 7 | (define A "A") 8 | (define A1 (A . _ . "1")) 9 | (define A2 (A . _ . "2")) 10 | (define A3 (A . _ . "3")) 11 | (define f "f") 12 | (define g "g") 13 | (define h "h") 14 | 15 | @exercise[ 16 | #:id (current-id) 17 | @paragraph{ 18 | @(math i)を階数、@(math (A1 A2 A3 . elem-of* . (universe . $ . i)))を型とする。関数@(math (f . elem-of . (A1 . fun-type . A2)))と@(math (g . elem-of . (A2 . fun-type . A3)))と@(math (h . elem-of . (A3 . fun-type . A1)))がある時、各@(math (A . _ . "n"))と@(math (A . _ . "m"))は論理的に同値であることを確かめよ。 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /src/004K.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/biinv.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define B "B") 11 | (define f "f") 12 | 13 | @proposition[ 14 | #:id (current-id) 15 | @paragraph{ 16 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。型@(math (is-equiv . $ . f))と@(math (is-biinv . $ . f))は論理的に同値である。 17 | } 18 | #:proof @proof[ 19 | @paragraph{ 20 | @ref["0026"]と@ref["002G"]と@ref["002F"]と@ref["002H"]から従う。 21 | } 22 | ] 23 | ] 24 | -------------------------------------------------------------------------------- /src/006J.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/theorem.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define B "B") 11 | 12 | @theorem[ 13 | #:id (current-id) 14 | @paragraph{ 15 | 関数外延性と一価性を仮定する。@(math i)を階数とすると、@(math (set-cat . $ . i))は圏である。 16 | } 17 | #:proof @proof[ 18 | @paragraph{ 19 | 対象@(math (A B . elem-of* . (set-cat . $ . i)))に対して、@ref["006I"]より@(math ((A . cat:iso . B) . equiv . (A . equiv . B)))を得て、一価性と@ref["0049"]より@(math ((A . equiv . B) . equiv . (A . id-type . B)))を得る。 20 | } 21 | ] 22 | ] 23 | -------------------------------------------------------------------------------- /src/0073.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/presheaf.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define A "A") 12 | 13 | @proposition[ 14 | #:id (current-id) 15 | @paragraph{ 16 | 関数外延性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏、@(math (A . elem-of . (presheaf . $ . C)))を前層とする。@(math C)が圏ならば、@(math (is-repr-psh . $ . A))は命題である。 17 | } 18 | #:proof @proof[ 19 | @paragraph{ 20 | @ref["0071"]と@ref["006V"]と@ref["006Z"]から従う。 21 | } 22 | ] 23 | ] 24 | -------------------------------------------------------------------------------- /src/latex-config.rkt: -------------------------------------------------------------------------------- 1 | #lang at-exp typed/racket 2 | 3 | (require morg/latex 4 | (prefix-in eq: morg/eq-reasoning/latex)) 5 | 6 | (define (latex-config:make-section-ref [depth : Natural] [num : String]) 7 | (define x : String 8 | (if (depth . <= . 1) 9 | "章" 10 | "節")) 11 | @text-tex{@|num|@|x|}) 12 | 13 | (provide-config 14 | (define cfg book-config) 15 | (eq:config-update 16 | (struct-copy config cfg 17 | [make-section-ref latex-config:make-section-ref] 18 | [packages @list[ 19 | (package "amsmath" '()) 20 | ]] 21 | [class "ltjsbook"] 22 | [class-options '("a4paper")]))) 23 | -------------------------------------------------------------------------------- /src-0/my-node.sty: -------------------------------------------------------------------------------- 1 | \usepackage{xparse,xcolor,lwarp,hyperref} 2 | 3 | \newcommand{\myNodeText}[1]{\InlineClass{node-id}{\textcolor{gray}{\texttt{[#1]}}}} 4 | 5 | \newcommand{\myNodeTitle}[2]{\texorpdfstring{#2\myNodeText{#1}}{#2}} 6 | 7 | \NewDocumentCommand{\myNodeTitleOpt}{m O{}}{\myNodeTitle{#1}{#2}} 8 | 9 | \warpHTMLonly{ 10 | % Tell lwarp a fake title to use id for filename. 11 | \let\LWR@newhtmlfile@orig\LWR@newhtmlfile 12 | \newcommand\myNodeTitle@alt[2]{#1} 13 | \renewcommand*{\LWR@newhtmlfile}[1]{% 14 | \begingroup% 15 | \let\myNodeTitle\myNodeTitle@alt% 16 | \LWR@newhtmlfile@orig{#1}% 17 | \endgroup% 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src-0/node-000T-contractible.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000T}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | 型\myInlineMath{\myIsContr{A} \myElemOf \myUniverse{i}}を次のレコード型と定義する。 9 | \begin{itemize} 10 | \item \myInlineMath{\myCenter \myElemOf A} 11 | \item \myInlineMath{\myContraction \myElemOf 12 | \myDFunType{x \myElemOf A}{\myCenter \myIdType x}} 13 | \end{itemize} 14 | \myInlineMath{\myIsContr{A}}の要素がある時、 15 | \myInlineMath{A}は\myNewTerm[かしゅく]{可縮}(contractible)であると言う。 16 | \end{myBlock} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /src-0/node-0038-initial-n-algebra.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0038}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myNatAlg{i}}を\myInlineMath{\myNat}代数とする。 8 | 型\myInlineMath{\myIsInitNatAlg{A} \myElemOf \myUniverse{\myLevelSucc{i}}}を 9 | \myInlineMath{\myDFunType{X \myElemOf \myNatAlg{i}} 10 | {\myIsContr{\myNatHom{A}{X}}}}と定義する。 11 | \myInlineMath{\myIsInitNatAlg{A}}の要素がある時、 12 | \myInlineMath{A}は\myNewTerm[しNだいすう]{始\protect\myInlineMath{\protect\myNat}代数} 13 | (initial \myInlineMath{\myNat}-algebra)であると言う。 14 | \end{myBlock} 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /src/006U.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/notation.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/presheaf.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define x "x") 12 | 13 | @notation[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @notation-index[#:key "gen"]{@(math yoneda-gen) (米田)} 17 | ] 18 | @paragraph{ 19 | 関数外延性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏、@(math (x . elem-of . C))を対象とする。要素@(math ((yoneda-gen . $ . x) . elem-of . (((yoneda . $ . C) . $ . x) . $ . x)))を@(math (cat:id . $i . x))と定義する。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src-0/node-002W-plus.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002W}{myExample} 6 | \myInlineMath{n_{1}, n_{2} \myElemOf \myNat}を要素とする。 7 | 要素\myInlineMath{\myNatPlusFun{n_{1}}{n_{2}} \myElemOf \myNat}を構成する。 8 | 自然数の帰納法を使い、 9 | \myInlineMath{\myNatPlusFun{\myNatZero}{n_{2}} \myDefEq n_{2}}, 10 | \myInlineMath{\myNatPlusFun{\myNatSucc{n_{1}}}{n_{2}} \myDefEq 11 | \myNatSucc{\myNatPlusFun{n_{1}}{n_{2}}}}と定義する。 12 | 形式的には\myInlineMath{\myNatPlusFun{n_{1}}{n_{2}} \myDefEq 13 | \myNatInd{n_{1}}{\myAbs{x}{\myNat}} 14 | {n_{2}}{\myAbs{x y}{\myNatSucc{y}}}}と定義できる。 15 | \end{myBlock} 16 | 17 | \end{document} -------------------------------------------------------------------------------- /src/002P.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/id.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | (define a1 (a . _ . "1")) 11 | (define a2 (a . _ . "2")) 12 | (define p " p") 13 | 14 | @exercise[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (a1 a2 . elem-of* . A))を要素、@(math (p . elem-of . (a1 . id-type . a2)))を同一視とする。同一視@(math ((id-unit-l . $ . p) . elem-of . ((refl . id-comp . p) . id-type . p)))と@(math ((id-unit-r . $ . p) . elem-of . (p . id-type . (p . id-comp . refl))))を構成せよ。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/000D.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/level.rkt" 5 | "lib/index/notation.rkt" 6 | "lib/markup/rule.rkt") 7 | 8 | (define i "i") 9 | 10 | @rule[ 11 | #:id (current-id) 12 | #:indexes @list[ 13 | @index[#:key "かいすう"]{階数} 14 | @notation-index[#:key "0"]{@(math level:zero) (階数)} 15 | @notation-index[#:key "succ(i)"]{@(math (level:succ . $ . i)) (階数)} 16 | ] 17 | @paragraph{ 18 | @dfn{階数(level)}についての規則は次で与えられる。 19 | @unordered-list[ 20 | @list-item{階数@(math level:zero)を構成できる。} 21 | @list-item{階数@(math i)に対し、階数@(math (level:succ . $ . i))を構成できる。} 22 | ] 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src-0/node-003N-initial-circle-algebra.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003N}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myCircleAlg{i}}を\myInlineMath{\myCircle}代数とする。 8 | 型\myInlineMath{\myIsInitCircleAlg{A} \myElemOf \myUniverse{\myLevelSucc{i}}}を 9 | \myInlineMath{\myDFunType{X \myElemOf \myCircleAlg{i}} 10 | {\myIsContr{\myCircleHom{A}{X}}}}と定義する。 11 | \myInlineMath{\myIsInitCircleAlg{A}}の要素がある時、\myInlineMath{A}は 12 | \myNewTerm[しS1だいすう]{始\protect\myInlineMath{\protect\myCircle}代数} 13 | (initial \myInlineMath{\myCircle}-algebra)であると言う。 14 | \end{myBlock} 15 | 16 | \end{document} -------------------------------------------------------------------------------- /src/0060.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/cat.rkt" 6 | "lib/math/functor.rkt") 7 | 8 | (define i "i") 9 | (define C "C") 10 | (define D "D") 11 | (define F "F") 12 | (define x "x") 13 | (define x1 (x . _ . "1")) 14 | (define x2 (x . _ . "2")) 15 | (define f "f") 16 | 17 | @exercise[ 18 | #:id (current-id) 19 | @paragraph{ 20 | @(math i)階数、@(math (C D . elem-of* . (precat . $ . i)))を前圏、@(math (F . elem-of . (functor . $* . C D)))を関手、@(math (x1 x2 . elem-of* . C))を対象、@(math (f . elem-of . (cat:map . $* . x1 x2)))を射とする。@(math f)が同型ならば、@(math (F . $ . f))は同型であることを示せ。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src/lib/math/pair.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | "core.rkt") 5 | 6 | (provide curry 7 | uncurry 8 | pair-assoc 9 | pair-assoc-inv 10 | pair-sym 11 | diagonal 12 | fun-pair-dist 13 | fun-pair-dist-inv) 14 | 15 | (define curry (const "curry")) 16 | 17 | (define uncurry (const "uncurry")) 18 | 19 | (define pair-assoc (const "assoc")) 20 | (define pair-assoc-inv (pair-assoc . ^ . "-1")) 21 | 22 | (define pair-sym (const "sym")) 23 | 24 | (define fun-pair-dist (const "dist")) 25 | (define fun-pair-dist-inv (fun-pair-dist . ^ . "-1")) 26 | 27 | (define diagonal (const "diag")) 28 | -------------------------------------------------------------------------------- /src/lib/math/truncation.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | (prefix-in tex: morg/math/tex) 5 | "core.rkt") 6 | 7 | (provide trunc 8 | trunc:in 9 | trunc:ind) 10 | 11 | (define (trunc [n : MathTeX+Like] [A : MathTeX+Like]) 12 | ((group 13 | ((delimiter #:left tex:\| 14 | #:right tex:\|) 15 | A)) 16 | . _ . n)) 17 | 18 | (define (trunc:in [n : MathTeX+Like] [a : MathTeX+Like]) 19 | ((group 20 | ((delimiter #:left "|" 21 | #:right "|") 22 | a)) 23 | . _ . n)) 24 | 25 | (define (trunc:ind [n : MathTeX+Like] [A : MathTeX+Like]) 26 | (ind/symb . _ . (trunc n A))) 27 | -------------------------------------------------------------------------------- /src/0065.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/functor.rkt") 5 | 6 | @section[ 7 | #:id (current-id) 8 | #:title @%{自然変換} 9 | @paragraph{ 10 | @emph{自然変換}は関手の間の射の概念である。実際、関手を対象、自然変換を射とする前圏を構成できる(@ref["0069"])。さらに、終域が圏であるような関手のなす前圏は圏であることを示す(@ref["006C"])。 11 | } 12 | (include-part "0066.rkt") 13 | (include-part "0067.rkt") 14 | (include-part "0068.rkt") 15 | (include-part "0069.rkt") 16 | (include-part "006A.rkt") 17 | (include-part "006C.rkt") 18 | @paragraph{ 19 | @(math (functor-cat . $* . "C" "D"))は@emph{普遍性}でも特徴づけられる(@ref["006R"])。 20 | } 21 | (include-part "006Q.rkt") 22 | (include-part "006R.rkt") 23 | ] 24 | -------------------------------------------------------------------------------- /src-0/node-000N-pair-notation.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000N}{myNotation} 6 | \begin{enumerate} 7 | \item \myInlineMath{\myPairType}は右結合の演算子である。 8 | 例えば、\myInlineMath{A \myPairType B \myPairType C}は 9 | \myInlineMath{A \myPairType (B \myPairType C)}と読む。 10 | \item \myInlineMath{\myDPairType{x \myElemOf A}{}}の結合は弱い。 11 | 例えば、\myInlineMath{\myDPairType{x \myElemOf A} 12 | {\myDPairType{y \myElemOf B}{C \myPairType D}}}は 13 | \myInlineMath{\myDPairType{x \myElemOf A} 14 | {(\myDPairType{y \myElemOf B}{(C \myPairType D)})}}と読む。 15 | \end{enumerate} 16 | \end{myBlock} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /src/004C.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt" 7 | "lib/math/set.rkt") 8 | 9 | (define i "i") 10 | (define A "A") 11 | 12 | @definition[ 13 | #:id (current-id) 14 | #:indexes @list[ 15 | @index[#:key "しゅうごう"]{集合} 16 | @notation-index[#:key "IsSet"]{@(math is-set)} 17 | ] 18 | @paragraph{ 19 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。型@(math ((is-set . $ . A) . elem-of . (universe . $ . i)))を@(math (is-trunc . $* . trunc-level:0 A))と定義する。@(math (is-set . $ . A))の要素がある時、@(math A)は@dfn{集合(set)}であると言う。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/0064.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/functor.rkt" 8 | "lib/math/proposition.rkt") 9 | 10 | (define i "i") 11 | (define C "C") 12 | (define D "D") 13 | (define F "F") 14 | 15 | @corollary[ 16 | #:id (current-id) 17 | #:title @%{圏の構造同一原理} 18 | @paragraph{ 19 | 一価性と関数外延性を仮定する。@(math i)を階数、@(math (C D . elem-of* . (cat . $ . i)))を圏とすると、同値 20 | @disp{ 21 | @(math ((C . id-type . D) . equiv . (prop-compr (F . elem-of . (functor . $* . C D)) (is-weak-cat-equiv . $ . F)))) 22 | } 23 | を得る。 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /src/007U.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/span.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define C "C") 11 | (define D "D") 12 | 13 | @exercise[ 14 | #:id (current-id) 15 | @paragraph{ 16 | 関数外延性と一価性を仮定する。@(math i)を階数、@(math (A . elem-of . (span . $ . i)))をスパン、@(math (B . elem-of . (span-over . $ . A)))を@(math A)上のスパン、@(math (C . elem-of . (span/cocone . $ . A)))を余錐、@(math (D . elem-of . (span/cocone-over . $* . B C)))を@(math C)上の余錐とする。@(math B)がカルテシアンで、@(math C)が普遍余錐であるとすると、@(math D)がカルテシアンであることと@(math (total-span/cocone . $ . D))が普遍余錐であることは論理的に同値である。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-004Q.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004Q}{myCorollary} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 9 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 10 | \myInlineMath{f}が同値ならば、 11 | \myInlineMath{\myLInv{f}}と\myInlineMath{\myRInv{f}}は可縮である。 12 | \end{myBlock} 13 | \begin{myProof} 14 | 関数外延性から、レトラクト 15 | \myInlineMath{\myRInv{f} \myRetractRel 16 | \myFiber{\myAbs{(g \myElemOf B \myFunType A)}{f \myFunComp g}} 17 | {\myIdFun{B}}}を得て、 18 | 右辺は\myRef{004P}より可縮である。 19 | \myInlineMath{\myLInv{f}}についても同様である。 20 | \end{myProof} 21 | 22 | \end{document} -------------------------------------------------------------------------------- /src/0047.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/id.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | (define a1 (a . _ . "1")) 11 | (define a2 (a . _ . "2")) 12 | (define p "p") 13 | 14 | @exercise[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (a1 a2 . elem-of* . A))を要素、@(math (p . elem-of . (a1 . id-type . a2)))を同一視とする。同一視@(math ((id-sym-inv-l . $ . p) . elem-of . (((id-inv p) . id-comp . p) . id-type . refl)))と@(math ((id-sym-inv-r . $ . p) . elem-of . ((p . id-comp . (id-inv p)) . id-type . refl)))を構成せよ。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src-0/node-002I-homotopy.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002I}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族、 9 | \myInlineMath{f, g \myElemOf \myDFunType{x \myElemOf A}{B\myAppParen{x}}}を関数とする。 10 | 型\myInlineMath{f \myHomotopy g \myElemOf \myUniverse{i}}を 11 | \myInlineMath{\myDFunType{x \myElemOf A} 12 | {f\myAppParen{x} \myIdType g\myAppParen{x}}}と定義する。 13 | \myInlineMath{f \myHomotopy g}の要素を\myInlineMath{f}と\myInlineMath{g}の間の 14 | \myNewTerm[ほもとぴー]{ホモトピー}(homotopy)と呼ぶ。 15 | \end{myBlock} 16 | 17 | \end{document} 18 | -------------------------------------------------------------------------------- /src-0/node-0072.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0072}{myCorollary} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 9 | \myInlineMath{A, B \myElemOf \myPresheafCat{C}}を前層、 10 | \myInlineMath{f \myElemOf \myCatMap\myAppParen{A, B}}を射とする。 11 | 次は論理的に同値である。 12 | \begin{enumerate} 13 | \item \myInlineMath{f}は\myInlineMath{\myPresheafCat{C}}の射として同型である。 14 | \item 任意の対象\myInlineMath{x \myElemOf C}に対して、 15 | 関数\myInlineMath{\myAbs{a}{f\myAppParen{a}} \myElemOf 16 | A\myAppParen{x} \myFunType B\myAppParen{x}}は同値である。\myQed 17 | \end{enumerate} 18 | \end{myBlock} 19 | 20 | \end{document} -------------------------------------------------------------------------------- /src/0061.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/cat.rkt" 6 | "lib/math/functor.rkt") 7 | 8 | (define i "i") 9 | (define C "C") 10 | (define D "D") 11 | (define F "F") 12 | (define x "x") 13 | (define x1 (x . _ . "1")) 14 | (define x2 (x . _ . "2")) 15 | (define f "f") 16 | 17 | @exercise[ 18 | #:id (current-id) 19 | @paragraph{ 20 | @(math i)を階数、@(math (C D . elem-of* . (precat . $ . i)))を前圏、@(math (F . elem-of . (functor . $* . C D)))を関手、@(math (x1 x2 . elem-of* . C))を対象、@(math (f . elem-of . (cat:map . $* . x1 x2)))を射とする。@(math F)は充満忠実であると仮定する。@(math (F . $ . f))が同型ならば@(math f)は同型であることを示せ。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-0054.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0054}{myProposition} 6 | 一価性と関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 9 | \myInlineMath{\myTruncType{n}{i}}は\myInlineMath{\myTLSucc{n}}型である。 10 | \end{myBlock} 11 | \begin{myProof} 12 | \myInlineMath{A, B \myElemOf \myTruncType{n}{i}}を要素とする。 13 | 一価性と\myRef{0049}と\myRef{0043}より、 14 | 同値\myInlineMath{(A \myIdType B) \myEquiv 15 | (A\myRecordField\myTruncTypeType \myEquiv 16 | B\myRecordField\myTruncTypeType)}を得て、 17 | 後者は\myRef{0048}と\myRef{004X}と\myRef{0052}から\myInlineMath{n}型である。 18 | \end{myProof} 19 | 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006H-category-of-sets.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006H}{myExample} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数とする。 8 | 前圏\myInlineMath{\mySetCat{i} \myElemOf \myPreCat{\myLevelSucc{i}}}を 9 | 次のように定義する。 10 | \begin{itemize} 11 | \item \myInlineMath{\myCatObj \myDefEq 12 | \myPropCompr{A \myElemOf \myUniverse{i}}{\myIsSet{A}}} 13 | \item \myInlineMath{\myCatMap \myDefEq 14 | \myAbs{A B}{(A \myFunType B)}} 15 | \item 恒等射は\myRef{0010}、合成は\myRef{0011}による。 16 | \item \myRef{0048}より、各\myInlineMath{\myCatMap\myAppParen{A, B}}は集合である。 17 | \item 他の公理は自明である。 18 | \end{itemize} 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src/0040.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt" 7 | "lib/math/proposition.rkt") 8 | 9 | (define i "i") 10 | (define A "A") 11 | 12 | @definition[ 13 | #:id (current-id) 14 | #:indexes @list[ 15 | @index[#:key "めいだい"]{命題} 16 | @notation-index[#:key "IsProp"]{@(math is-prop)} 17 | ] 18 | @paragraph{ 19 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。型@(math ((is-prop . $ . A) . elem-of . (universe . $ . i)))を@(math (is-trunc . $* . trunc-level:-1 A))と定義する。@(math (is-prop . $ . A))の要素がある時、@(math A)は@dfn{命題(proposition)}であると言う。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/007T.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/span.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define C "C") 11 | (define D "D") 12 | 13 | @exercise[ 14 | #:id (current-id) 15 | @paragraph{ 16 | @(math i)を階数、@(math (A . elem-of . (span . $ . i)))をスパン、@(math (B . elem-of . (span-over . $ . A)))を@(math A)上のスパン、@(math (C . elem-of . (span/cocone . $ . A)))を余錐、@(math (D . elem-of . (span/cocone-over . $* . B C)))を@(math C)上の余錐とする。@(math B)がカルテシアンで、@(math C)が普遍余錐で、@(math D)がカルテシアンならば、@(math ((total-span/cocone . $ . D) . elem-of . (span/cocone . $ . (total-span . $ . B))))は普遍余錐である。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/node-004T-qinv.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004T}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 型\myInlineMath{\myQInv{f} \myElemOf \myUniverse{i}}を 10 | 次のレコード型と定義する。 11 | \begin{itemize} 12 | \item \myInlineMath{\myQInvInv \myElemOf 13 | B \myFunType A} 14 | \item \myInlineMath{\myQInvUnit \myElemOf 15 | \myQInvInv \myFunComp f \myHomotopy \myIdFun{A}} 16 | \item \myInlineMath{\myQInvCounit \myElemOf 17 | f \myFunComp \myQInvInv \myHomotopy \myIdFun{B}} 18 | \end{itemize} 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src/001P.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define f "f") 11 | (define b "b") 12 | 13 | @definition[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @notation-index[#:key "Fiber"]{@(math fiber)} 17 | ] 18 | @paragraph{ 19 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数、@(math (b . elem-of . B))を要素とする。型@(math ((fiber . $* . f b) . elem-of . (universe . $ . i)))を@(math (record-type (list fiber:elem A) (list fiber:id ((f . $ . fiber:elem) . id-type . b))))と定義する。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src-0/node-0004-category-theory.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0004}{圏論} 6 | 7 | \emph{圏論}は数学における対象とその間の写像の概念を抽象化した構造を調べる分野である。 8 | 特に、対象の間の\emph{同型}の概念が一般的に定義され、 9 | 同型こそが対象の「正しい」同一視のしかたと考えられる。 10 | しかし、例えば集合論を数学の基礎とした場合、 11 | 同型な対象であっても等しいとは限らないので、 12 | それらを厳密に同一視するわけにはいかない。 13 | 一方、型理論を数学の基礎とした場合、 14 | 一価性公理と同様の発想で同型の型と同一視型が同値になるような条件を 15 | 圏に課す余地があり、 16 | 実際に多くの圏の具体例は一価性公理の下でその条件を満たす。 17 | その意味で、圏論はホモトピー型理論を基礎とするのが適切である分野の一つである。 18 | 19 | \begin{mySubsections} 20 | \subfile{node-005B-category} 21 | \subfile{node-005J-functor} 22 | \subfile{node-0065-natural-transformation} 23 | \subfile{node-006D-presheaf} 24 | \end{mySubsections} 25 | 26 | \end{document} 27 | -------------------------------------------------------------------------------- /src-0/node-000A-function.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{000A}{関数型} 6 | 7 | \emph{関数}は型理論において最も基本的な概念である。 8 | 9 | \subfile{node-000H-dependent-function-type-rule} 10 | 11 | 関数型の導入により、 12 | 仮定\myInlineMath{x \myElemOf A}の下での\myInlineMath{B}の要素と 13 | \myInlineMath{\myDFunType{x \myElemOf A}{B}}型の関数は同じように振る舞う。 14 | 以降は仮定の下での要素の代わりに関数を使う。 15 | 16 | \subfile{node-000G-function-type-rule} 17 | \subfile{node-000J-function-notation} 18 | \subfile{node-000I-type-family} 19 | \subfile{node-0010-identity} 20 | \subfile{node-0011-composition} 21 | \subfile{node-0012-associativity} 22 | \subfile{node-0013-swap} 23 | \subfile{node-000Q-implicit-argument} 24 | 25 | \end{document} 26 | -------------------------------------------------------------------------------- /src-0/node-0026.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0026}{myLemma} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とすると、 8 | 関数\myInlineMath{\myIdFun{A} \myElemOf A \myFunType A}は同値である。 9 | \end{myBlock} 10 | \begin{myProof} 11 | \myInlineMath{a \myElemOf A}を要素とする。 12 | \myInlineMath{\myFiber{\myIdFun{A}}{a}}の定義から、 13 | \myInlineMath{\myDPairType{x \myElemOf A}{x \myIdType a}} 14 | が可縮であることを示せばよい。 15 | \myRef{0027}より\myInlineMath{x \myIdType a}は 16 | \myInlineMath{a \myIdType x}のレトラクトなので、 17 | \myRef{001S}より\myInlineMath{\myDPairType{x \myElemOf A}{x \myIdType a}} 18 | は可縮である。 19 | \end{myProof} 20 | 21 | \end{document} 22 | -------------------------------------------------------------------------------- /src/0053.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt" 7 | "lib/math/level.rkt") 8 | 9 | (define i "i") 10 | (define n "n") 11 | 12 | @definition[ 13 | #:id (current-id) 14 | #:indexes @list[ 15 | @notation-index[#:key "n-Type(i)"]{@(math ((trunc-type n) . $ . i))} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数、@(math (n . elem-of . trunc-level))を要素とする。型@(math (((trunc-type n) . $ . i) . elem-of . (universe . $ . (level:succ . $ . i))))を@(math (record-type (list trunc-type:type (universe . $ . i)) (list trunc-type:is-trunc (is-trunc . $* . n trunc-type:type))))と定義する。 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /src/002W.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/example.rkt" 4 | "lib/math.rkt" 5 | "lib/math/nat.rkt") 6 | 7 | (define n "n") 8 | (define n1 (n . _ . "1")) 9 | (define n2 (n . _ . "2")) 10 | (define x "x") 11 | (define y "y") 12 | 13 | @example[ 14 | #:id (current-id) 15 | @paragraph{ 16 | @(math (n1 n2 . elem-of* . nat))を要素とする。要素@(math ((nat:plus . $* . n1 n2) . elem-of . nat))を構成する。自然数の帰納法を使い、@(math ((nat:plus . $* . nat:zero n2) . def-eq . n2))と@(math ((nat:plus . $* . (nat:succ . $ . n1) n2) . def-eq . (nat:succ . $ . (nat:plus . $* . n1 n2))))と定義する。形式的には@(math ((nat:plus . $* . n1 n2) . def-eq . (nat:ind . $* . n1 (abs x nat) n2 (abs* x y (nat:succ . $ . y)))))と定義できる。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src/0075.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/lemma.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/functor.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define D "D") 12 | (define F "F") 13 | 14 | @lemma[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (C D . elem-of* . (precat . $ . i)))を前圏、@(math (F . elem-of . (functor . $* . C D)))を関手とする。@(math D)が圏で、@(math F)が本質的全射ならば、@(math ((F . record-field . functor:obj) . elem-of . ((C . record-field . cat:obj) . fun-type . (D . record-field . cat:obj))))は全射である。 18 | } 19 | #:proof @proof[ 20 | @paragraph{ 21 | 定義からすぐである。 22 | } 23 | ] 24 | ] 25 | -------------------------------------------------------------------------------- /src-0/node-0037-composition.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0037}{myExercise} 6 | \myInlineMath{i}を階数とする。 7 | \begin{enumerate} 8 | \item \myInlineMath{\myNat}代数\myInlineMath{A \myElemOf \myNatAlg{i}}に対して、 9 | \emph{恒等射}\myInlineMath{\myIdNatHom{A} \myElemOf \myNatHom{A}{A}}を構成せよ。 10 | \item \myInlineMath{\myNat}代数 11 | \myInlineMath{A, B, C \myElemOf \myNatAlg{i}}と 12 | \myInlineMath{\myNat}準同型写像 13 | \myInlineMath{f \myElemOf \myNatHom{A}{B}}と 14 | \myInlineMath{g \myElemOf \myNatHom{B}{C}}に対して、 15 | \emph{合成}\myInlineMath{g \myNatHomComp f \myElemOf \myNatHom{A}{C}}を構成せよ。 16 | \end{enumerate} 17 | \end{myBlock} 18 | 19 | \end{document} 20 | -------------------------------------------------------------------------------- /src-0/node-0074.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0074}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 次は論理的に同値である。 10 | \begin{enumerate} 11 | \item \myInlineMath{f}は全射である。 12 | \item \myInlineMath{f}は\myInlineMath{\myTLMinusOne}連結である。 13 | \end{enumerate} 14 | \end{myBlock} 15 | \begin{myProof} 16 | \myInlineMath{y \myElemOf B}を要素とする。 17 | \myRef{0041}より、 18 | \myInlineMath{\myTrunc{\myTLMinusOne}{\myFiber{f}{y}}}と 19 | \myInlineMath{\myIsContr{\myTrunc{\myTLMinusOne}{\myFiber{f}{y}}}}は 20 | 論理的に同値であるから主張が従う。 21 | \end{myProof} 22 | 23 | \end{document} -------------------------------------------------------------------------------- /src/006I.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/lemma.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define B "B") 11 | (define f "f") 12 | 13 | @lemma[ 14 | #:id (current-id) 15 | @paragraph{ 16 | 関数外延性を仮定する。@(math i)を階数、@(math (A B . elem-of* . (set-cat . $ . i)))を対象、@(math (f . elem-of . (cat:map . $* . A B)))を射とする。次は論理的に同値である。 17 | @ordered-list[ 18 | @list-item[#:id "0000"]{@(math f)は@(math (set-cat . $ . i))の射として同型である。} 19 | @list-item[#:id "0001"]{@(math f)は関数として同値である。} 20 | ] 21 | } 22 | #:proof @proof[ 23 | @paragraph{ 24 | @ref["004K"]による。 25 | } 26 | ] 27 | ] 28 | -------------------------------------------------------------------------------- /src/004O.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/biinv.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define B "B") 11 | (define f "f") 12 | 13 | @proposition[ 14 | #:id (current-id) 15 | @paragraph{ 16 | 関数外延性を仮定する。@(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とすると、型@(math (is-biinv . $ . f))は命題である。 17 | } 18 | #:proof @proof[ 19 | @paragraph{ 20 | @ref["0041"]より、@(math f)が両側可逆であると仮定して@(math (is-biinv . $ . f))が可縮であることを示せばよいが、@ref["004K"]より@(math f)は同値なので、@ref["004Q"]から@(math (is-biinv . $ . f))が可縮であることが従う。 21 | } 22 | ] 23 | ] 24 | -------------------------------------------------------------------------------- /src-0/node-0035-n-algebra.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0035}{myDefinition} 6 | \myInlineMath{i}を階数とする。 7 | 型\myInlineMath{\myNatAlg{i} \myElemOf \myUniverse{\myLevelSucc{i}}}を 8 | 次のレコード型と定義する。 9 | \begin{itemize} 10 | \item \myInlineMath{\myNatAlgCarrier \myElemOf \myUniverse{i}} 11 | \item \myInlineMath{\myNatAlgZero \myElemOf \myNatAlgCarrier} 12 | \item \myInlineMath{\myNatAlgSucc \myElemOf 13 | \myNatAlgCarrier \myFunType \myNatAlgCarrier} 14 | \end{itemize} 15 | \myInlineMath{\myNatAlg{i}}の要素を(階数\myInlineMath{i}の) 16 | \myNewTerm[Nだいすう]{\protect\myInlineMath{\protect\myNat}代数}(\myInlineMath{\myNat}-algebra)と呼ぶ。 17 | \end{myBlock} 18 | 19 | \end{document} 20 | -------------------------------------------------------------------------------- /src/0071.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/lemma.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/presheaf.rkt" 8 | "lib/math/functor.rkt") 9 | 10 | (define i "i") 11 | (define C "C") 12 | (define A "A") 13 | 14 | @lemma[ 15 | #:id (current-id) 16 | @paragraph{ 17 | 関数外延性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏、@(math (A . elem-of . (presheaf . $ . C)))を前層とすると、同値 18 | @disp{ 19 | @(math ((is-repr-psh . $ . A) . equiv . (iso-fiber . $* . (yoneda . $ . C) A))) 20 | } 21 | を構成できる。 22 | } 23 | #:proof @proof[ 24 | @paragraph{ 25 | @ref["006T"]と@ref["0072"]から従う。 26 | } 27 | ] 28 | ] 29 | -------------------------------------------------------------------------------- /src-0/node-007B.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{007B}{myLemma} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | \myInlineMath{\myUniverse{i}}が一価性を満たし、 10 | \myInlineMath{f}が同値ならば、 11 | 任意の型\myInlineMath{X \myElemOf \myUniverse{i}}に対して 12 | 関数\myInlineMath{\myAbs{g}{f \myFunComp g} \myElemOf 13 | (X \myFunType A) \myFunType (X \myFunType B)}は同値である。 14 | \end{myBlock} 15 | \begin{myProof} 16 | 一価性より、 17 | \myInlineMath{f}が恒等関数の場合を示せば十分であるが、 18 | \myInlineMath{\myAbs{g}{\myIdFun{A} \myFunComp g} 19 | \myDefEq \myAbs{g}{g}}なのでこれは同値である。 20 | \end{myProof} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /src-0/node-002B-pair-id.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002B}{myCorollary} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族、 9 | \myInlineMath{c_{1}, c_{2} \myElemOf 10 | \myDPairType{x \myElemOf A}{B\myAppParen{x}}}を要素とすると、 11 | 同値\myDisplayMath{ 12 | (c_{1} \myIdType c_{2}) \myEquiv 13 | \myDPairType{z \myElemOf \myProjI{c_{1}} \myIdType \myProjI{c_{2}}} 14 | {\myTransport{B}{z}\myAppParen{\myProjII{c_{1}}} 15 | \myIdType \myProjII{c_{2}}} 16 | }を構成できる。 17 | \end{myBlock} 18 | \begin{myProof} 19 | \myRef{001S}と\myRef{001X}による。 20 | \end{myProof} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /src/006P.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/presheaf.rkt" 8 | "lib/math/functor.rkt") 9 | 10 | (define i "i") 11 | (define C "C") 12 | 13 | @definition[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @index[#:key "よねだうめこみ"]{米田埋め込み} 17 | @notation-index[#:key "よ"]{@(math yoneda)} 18 | ] 19 | @paragraph{ 20 | 関数外延性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏とする。@dfn{米田埋め込み(Yoneda embedding)}@(math ((yoneda . $ . C) . elem-of . (functor . $* . C (presheaf-cat . $ . C))))を@ref["006R"]と@ref["006M"]で@(math (cat:map/fun . $ . C))に対応するものと定義する。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-0013-swap.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0013}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{C \myElemOf A \myFunType B \myFunType \myUniverse{i}}を型の族、 9 | \myInlineMath{f \myElemOf \myDFunType{x \myElemOf A} 10 | {\myDFunType{y \myElemOf B}{C\myAppParen{x, y}}}}を関数とする。 11 | 関数\myInlineMath{\mySwap{f} \myElemOf \myDFunType{y \myElemOf B} 12 | {\myDFunType{x \myElemOf A}{C\myAppParen{x, y}}}}であって、 13 | 任意の要素\myInlineMath{a \myElemOf A}と\myInlineMath{b \myElemOf B}に対して 14 | \myInlineMath{\mySwap{f}\myAppParen{b, a} \myDefEq f\myAppParen{a, b}} 15 | となるものを構成せよ。 16 | \end{myBlock} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /src-0/node-005I-category.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005I}{myDefinition} 6 | \myInlineMath{i}を階数とする。 7 | \begin{enumerate} 8 | \item 前圏\myInlineMath{C \myElemOf \myPreCat{i}}に対して、 9 | 型\myInlineMath{\myIsCat{C} \myElemOf \myUniverse{i}}を 10 | \myDisplayMath{\myDFunType{x \myElemOf C} 11 | {\myIsContr{\myDPairType{y \myElemOf C} 12 | {x \myCatIso y}}}}と定義する。 13 | \item 型\myInlineMath{\myCat{i} \myElemOf \myUniverse{i}}を 14 | \myInlineMath{\myPropCompr{C \myElemOf \myPreCat{i}} 15 | {\myIsCat{C}}}と定義する。 16 | \end{enumerate} 17 | \myInlineMath{\myCat{i}}の要素を(階数\myInlineMath{i}の) 18 | \myNewTerm[けん]{圏}(category)と呼ぶ。 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src/000N.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/notation.rkt" 4 | "lib/math.rkt") 5 | 6 | (define A "A") 7 | (define B "B") 8 | (define C "C") 9 | (define D "D") 10 | (define x "x") 11 | (define y "y") 12 | 13 | @notation[ 14 | #:id (current-id) 15 | @paragraph{ 16 | @unordered-list[ 17 | @list-item{@(math pair-type/symb)は右結合の演算子である。例えば、@(math (pair-type A B C))は@(math (A . pair-type . (paren (B . pair-type . C))))と読む。} 18 | @list-item{@(math (d-pair-type (x . elem-of . A) ""))の結合は弱い。例えば、@(math (d-pair-type (x . elem-of . A) (d-pair-type (y . elem-of . B) (C . pair-type . D))))は@(math (d-pair-type (x . elem-of . A) (paren (d-pair-type (y . elem-of . B) (paren (C . pair-type . D))))))と読む。} 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/lib/math/bifunctor.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require morg/math 4 | (prefix-in l: "paren-level.rkt") 5 | "core.rkt") 6 | 7 | (provide bifunctor 8 | bifunctor:obj 9 | bifunctor:map-1 10 | bifunctor:map-2) 11 | 12 | (define bifunctor/symb (const "BiFun")) 13 | 14 | (define (bifunctor [C1 : MathTeX+Like] [C2 : MathTeX+Like] [D : MathTeX+Like]) 15 | (bifunctor/symb 16 | . $ . 17 | ((C1 . (binary #:level l:comma ",") . C2) 18 | . (binary #:level l:semicolon ";") . 19 | D))) 20 | 21 | (define bifunctor:obj (const "obj")) 22 | (define bifunctor:map (const "map")) 23 | (define bifunctor:map-1 24 | (bifunctor:map . _ . "1")) 25 | (define bifunctor:map-2 26 | (bifunctor:map . _ . "2")) 27 | -------------------------------------------------------------------------------- /src/lib/math/paren-level.rkt: -------------------------------------------------------------------------------- 1 | #lang typed/racket 2 | 3 | (require (only-in morg/math make-level)) 4 | 5 | (module levels typed/racket 6 | (require morg/math) 7 | (provide (all-defined-out)) 8 | (define-levels 9 | dot 10 | $ 11 | unary 12 | comp 13 | * 14 | + 15 | binary 16 | logic-impl 17 | abs 18 | relation 19 | -> 20 | big-op 21 | subst-arrow 22 | def-eq 23 | weak-comma 24 | : 25 | comma 26 | semicolon 27 | punctuation)) 28 | 29 | (require 'levels) 30 | 31 | (provide 32 | (except-out 33 | (all-from-out 'levels) 34 | big-op 35 | $) 36 | (rename-out [big-op-lv big-op] 37 | [$-lv $])) 38 | 39 | (define big-op-lv (make-level big-op)) 40 | (define $-lv (make-level $)) 41 | -------------------------------------------------------------------------------- /src-0/my-font.sty: -------------------------------------------------------------------------------- 1 | \usepackage{fontspec,unicode-math} 2 | 3 | \setmonofont{DejaVu Sans Mono} 4 | \setmathfont{Stix Two Math} 5 | 6 | % Use some STIX symbols. 7 | % See https://tex.stackexchange.com/a/331899 8 | \DeclareFontEncoding{LS2}{}{\@noaccents} 9 | \DeclareFontSubstitution{LS2}{stix}{m}{n} 10 | \DeclareSymbolFont{myStix@largesymbols}{LS2}{stixex}{m}{n} 11 | 12 | \DeclareMathDelimiter{\lBrace}{\mathopen}{myStix@largesymbols}{"E8}{myStix@largesymbols}{"0E} 13 | \DeclareMathDelimiter{\rBrace}{\mathclose}{myStix@largesymbols}{"E9}{myStix@largesymbols}{"0F} 14 | \DeclareMathDelimiter{\lParen}{\mathopen}{myStix@largesymbols}{"DE}{myStix@largesymbols}{"02} 15 | \DeclareMathDelimiter{\rParen}{\mathclose}{myStix@largesymbols}{"DF}{myStix@largesymbols}{"03} 16 | -------------------------------------------------------------------------------- /src-0/node-000F-universe-notation.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000F}{myNotation} 6 | \begin{enumerate} 7 | \item \myInlineMath{\myUniverseEl{\myPhantom{A}}}はよく省略する。 8 | つまり、要素\myInlineMath{A \myElemOf \myUniverse{i}} 9 | そのものを型とみなす。 10 | \item \myInlineMath{\myUniverseLift{\myPhantom{A}}}はよく省略する。 11 | つまり、要素\myInlineMath{A \myElemOf \myUniverse{i}} 12 | は\myInlineMath{\myUniverse{\myLevelSucc{i}}}の要素でもあるとみなす。 13 | \item \myInlineMath{\myUniverse{i}}と 14 | \myInlineMath{\myUniverseName{i}}を表記上区別しない。 15 | つまり、\myInlineMath{\myUniverse{i}}そのものを 16 | \myInlineMath{\myUniverse{\myLevelSucc{i}}}の要素とみなす。 17 | \end{enumerate} 18 | \end{myBlock} 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src-0/node-0012-associativity.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0012}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B, C, D \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}, 9 | \myInlineMath{g \myElemOf B \myFunType C}, 10 | \myInlineMath{h \myElemOf C \myFunType D}を関数とする。 11 | \begin{enumerate} 12 | \item \myInlineMath{f \myDefEq f \myFunComp \myIdFun{A}} 13 | であることを確かめよ。 14 | \item \myInlineMath{\myIdFun{B} \myFunComp f \myDefEq f} 15 | であることを確かめよ。 16 | \item \myInlineMath{(h \myFunComp g) \myFunComp f \myDefEq 17 | h \myFunComp (g \myFunComp f)} 18 | であることを確かめよ。 19 | \end{enumerate} 20 | \end{myBlock} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /src-0/node-003R-pushout.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003R}{myAxiom} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B, C \myElemOf \myUniverse{i}}を型 8 | \myInlineMath{f \myElemOf C \myFunType A}と 9 | \myInlineMath{g \myElemOf C \myFunType B}を関数とする。 10 | \begin{itemize} 11 | \item 始\myInlineMath{\myPO{f}{g}}代数 12 | \myInlineMath{\myPO{f}{g} \myElemOf \myPOAlg{f}{g}}がある。 13 | \item \myInlineMath{j}を階数、 14 | \myInlineMath{D \myElemOf \myPOAlg{f}{g}}を 15 | 階数\myInlineMath{j}における始\myInlineMath{\myPO{f}{g}}代数とすると、 16 | \myInlineMath{D}は階数\myInlineMath{\myLevelSucc{j}}においても 17 | 始\myInlineMath{\myPO{f}{g}}代数である。 18 | \end{itemize} 19 | \end{myBlock} 20 | 21 | \end{document} 22 | -------------------------------------------------------------------------------- /src/000K.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math/level.rkt" 4 | "lib/markup/rule.rkt" 5 | "lib/index/notation.rkt" 6 | "lib/math.rkt") 7 | 8 | (define a "a") 9 | 10 | @rule[ 11 | #:id (current-id) 12 | #:indexes @list[ 13 | @index[#:key "たんいがた"]{単位型} 14 | @notation-index[#:key "1"]{@(math unit-type)} 15 | @notation-index[#:key "★"]{@(math unit-elem)} 16 | ] 17 | @paragraph{ 18 | @unordered-list[ 19 | @list-item{@dfn{単位型(unit type)}@(math (unit-type . elem-of . (universe . $ . level:zero)))を構成できる。} 20 | @list-item{要素@(math (unit-elem . elem-of . unit-type))を構成できる。} 21 | @list-item{要素@(math (a . elem-of . unit-type))に対し、@(math (a . def-eq . unit-elem))と定義される。} 22 | ] 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src/005H.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt") 7 | 8 | (define i "i") 9 | (define C "C") 10 | (define x "x") 11 | (define x1 (x . _ . "1")) 12 | (define x2 (x . _ . "2")) 13 | (define f "f") 14 | 15 | @proposition[ 16 | #:id (current-id) 17 | @paragraph{ 18 | @(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏、@(math (x1 x2 . elem-of* . C))を対象、@(math (f . elem-of . (cat:map . $* . x1 x2)))を射とすると、型@(math (cat:is-iso . $ . f))は命題である。 19 | } 20 | #:proof @proof[ 21 | @paragraph{ 22 | @ref["0041"]より、@(math f)が同型であると仮定して@(math (cat:is-iso . $ . f))が可縮であることを示せばよいが、これは@ref["005G"]からすぐに従う。 23 | } 24 | ] 25 | ] 26 | -------------------------------------------------------------------------------- /src-0/node-004B-set.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{004B}{集合} 6 | 7 | \myInlineMath{\myTLMinusOne}型の次に単純な型は 8 | \myInlineMath{\myTLZero}型である。 9 | \myInlineMath{A}が\myInlineMath{\myTLZero}型の時は、 10 | 任意の\myInlineMath{x_{1}, x_{2} \myElemOf A}に対して 11 | \myInlineMath{x_{1} \myIdType x_{2}}は命題である。 12 | よって、二つの要素が同一視されるかどうかには興味があるが、 13 | どう同一視されるかは考える意味がない。 14 | このような型を\emph{集合}であると考える。 15 | 16 | \subfile{node-004C-set} 17 | \subfile{node-004D} 18 | 19 | 型が集合であることの十分条件として、 20 | 同一視型が\emph{決定可能}であるというのがある(\myRef{004H})。 21 | ここで、型\myInlineMath{P}が決定可能とは、 22 | \myInlineMath{P \myCoproduct (P \myFunType \myEmptyType)}の要素があることを言う。 23 | 24 | \subfile{node-004E} 25 | \subfile{node-004H-Hedberg} 26 | 27 | \end{document} 28 | -------------------------------------------------------------------------------- /src/004S.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/lemma.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define f "f") 11 | (define a "a") 12 | (define a1 (a . _ . "1")) 13 | (define a2 (a . _ . "2")) 14 | 15 | @lemma[ 16 | #:id (current-id) 17 | @paragraph{ 18 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数、@(math (a1 a2 . elem-of* . A))を要素とする。@(math f)が同値ならば@(math ((fun-apply-id . $ . f) . elem-of . ((a1 . id-type . a2) . fun-type . ((f . $ . a1) . id-type . (f . $ . a2)))))は同値である。 19 | } 20 | #:proof @proof[ 21 | @paragraph{ 22 | @ref["004F"]と@ref["005R"]から従う。 23 | } 24 | ] 25 | ] 26 | -------------------------------------------------------------------------------- /src/0079.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/math.rkt" 5 | "lib/math/funext.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define p "p") 11 | (define x "x") 12 | (define f "f") 13 | 14 | @definition[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (B . elem-of . (A . fun-type . (universe . $ . i))))を型の族とする。関数@(math (p . elem-of . ((paren (A . fun-type . (d-pair-type (x . elem-of . A) (B . $ . x)))) . fun-type . (paren (A . fun-type . A)))))を@(math (abs f (abs x ((proj 1) . $ . (f . $ . x)))))とし、型@(math ((section-of-proj . $* . A B) . elem-of . (universe . $ . i)))を@(math (fiber . $* . p id-fun))と定義する。 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/007E.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | @section[ 4 | #:id (current-id) 5 | #:title @%{参考文献} 6 | (include-part "Church--1940-0000.rkt") 7 | (include-part "Hedberg--1998-0000.rkt") 8 | (include-part "HoTT-Book.rkt") 9 | (include-part "Hovey--1999-0000.rkt") 10 | (include-part "Kapulkin--Lumsdaine--2021-0000.rkt") 11 | (include-part "Lambek--Scott--1986-0000.rkt") 12 | (include-part "Lumsdaine--2010-0000.rkt") 13 | (include-part "Lurie--2009-0000.rkt") 14 | (include-part "Martin-Loef--1975-0000.rkt") 15 | (include-part "Pierce--2002-0000.rkt") 16 | (include-part "Quillen--1967-0000.rkt") 17 | (include-part "Russell--1908-0000.rkt") 18 | (include-part "Streicher--1993-0000.rkt") 19 | (include-part "van-den-Berg--Garner--2011-0000.rkt") 20 | ] 21 | -------------------------------------------------------------------------------- /src/000F.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math/level.rkt" 4 | "lib/math/universe.rkt" 5 | "lib/markup/notation.rkt" 6 | "lib/math.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | 11 | @notation[ 12 | #:id (current-id) 13 | @paragraph{ 14 | @unordered-list[ 15 | @list-item{@(math universe:el)はよく省略する。つまり、要素@(math (A . elem-of . (universe . $ . i)))そのものを型とみなす。} 16 | @list-item{@(math universe:lift)はよく省略する。つまり、要素@(math (A . elem-of . (universe . $ . i)))は@(math (universe . $ . (level:succ . $ . i)))の要素でもあるとみなす。} 17 | @list-item{@(math (universe . $ . i))と@(math (universe:name . $ . i))を表記上区別しない。つまり、@(math (universe . $ . i))そのものを@(math (universe . $ . (level:succ . $ . i)))の要素とみなす。} 18 | ] 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /src-0/my-imakeidx.sty: -------------------------------------------------------------------------------- 1 | \usepackage{imakeidx,hyperref} 2 | 3 | \newcommand{\myNodeIndex}[1]{\index[node]{#1}} 4 | 5 | \newcommand{\myPrintNodeIndex}[1]{ 6 | \myChapter{#1}{\myNodeIndex@Title} 7 | \hypertarget{ListOfNodes}{} 8 | \printindex[node] 9 | } 10 | 11 | \newcommand{\myLinkNodeIndex}{\hyperlink{ListOfNodes}{\myNodeIndex@Title}} 12 | 13 | \newcommand{\myPrintIndex}[1]{ 14 | \myChapter{#1}{\indexname} 15 | \printindex 16 | } 17 | 18 | \newcommand{\myNodeIndex@Title}{識別子一覧} 19 | 20 | \newcommand{\myIndex@IgnoreI}[1]{} 21 | \newcommand{\myIndex@Options}{-s custom.ist} 22 | 23 | \indexsetup{level=\myIndex@IgnoreI,noclearpage} 24 | 25 | \makeindex[options={\myIndex@Options}] 26 | \makeindex[name=node,title={\myNodeIndex@Title},options={\myIndex@Options}] 27 | -------------------------------------------------------------------------------- /src-0/node-001Z-function-extensionality.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001Z}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族とする。 9 | 関数型\myInlineMath{\myDFunType{x \myElemOf A}{B\myAppParen{x}}}が 10 | \myNewTerm[かんすうがいえんせい]{関数外延性}(function extensionality)を満たすとは、 11 | \myInlineMath{\myDFunType{f \myElemOf \myDFunType{x \myElemOf A}{B\myAppParen{x}}} 12 | {\myIsContr{\myDPairType{g \myElemOf \myDFunType{x \myElemOf A}{B\myAppParen{x}}} 13 | {\myDFunType{x \myElemOf A} 14 | {f\myAppParen{x} \myIdType g\myAppParen{x}}}}}} 15 | の要素があることである。 16 | \end{myBlock} 17 | 18 | \end{document} 19 | -------------------------------------------------------------------------------- /src/001M.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math/id.rkt" 4 | "lib/markup/example.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | (define a1 (a . _ . "1")) 11 | (define a2 (a . _ . "2")) 12 | (define p "p") 13 | (define x "x") 14 | (define z "z") 15 | 16 | @example[ 17 | #:id (current-id) 18 | @paragraph{ 19 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (a1 a2 . elem-of* . A))を要素、@(math (p . elem-of . (a1 . id-type . a2)))を同一視とする。同一視@(math ((id-extension-self . $ . p) . elem-of . ((id-extension . $* . p p) . id-type . refl)))を構成する。定義より@(math ((id-extension . $* . refl refl) . def-eq . refl))なので帰納法により@(math ((id-extension-self . $ . refl) . def-eq . refl))と定義すればよい。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/001Q.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define f "f") 11 | (define y "y") 12 | 13 | @definition[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @index[#:key "どうち"]{同値} 17 | @notation-index[#:key "IsEquiv"]{@(math is-equiv)} 18 | ] 19 | @paragraph{ 20 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。型@(math ((is-equiv . $ . f) . elem-of . (universe . $ . i)))を@(math (d-fun-type (y . elem-of . B) (is-contr . $ . (fiber . $* . f y))))と定義する。@(math (is-equiv . $ . f))の要素がある時、@(math f)は@dfn{同値(equivalence)}であると言う。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-0063.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0063}{myLemma} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{F \myElemOf \myFunctor{C}{D}}を関手とする。 9 | \myInlineMath{C}と\myInlineMath{D}が圏で、 10 | \myInlineMath{F}が充満忠実ならば、 11 | \myInlineMath{F\myRecordField\myFunctorObj \myElemOf 12 | C\myRecordField\myCatObj \myFunType 13 | D\myRecordField\myCatObj}は埋め込みである。 14 | \end{myBlock} 15 | \begin{myProof} 16 | \myInlineMath{y \myElemOf D}を対象とする。 17 | \myInlineMath{D}が圏であることから、 18 | \myInlineMath{\myFiber{F\myRecordField\myFunctorObj}{y}}は 19 | \myInlineMath{\myIsoFiber{F}{y}}のレトラクトであることが分かる。 20 | 後者は\myRef{006Z}より命題である。 21 | \end{myProof} 22 | 23 | \end{document} -------------------------------------------------------------------------------- /src/0026.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/lemma.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define a "a") 10 | (define x "x") 11 | 12 | @lemma[ 13 | #:id (current-id) 14 | @paragraph{ 15 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とすると、関数@(math (id-fun . elem-of . (A . fun-type . A)))は同値である。 16 | } 17 | #:proof @proof[ 18 | @paragraph{ 19 | @(math (a . elem-of . A))を要素とする。@(math (fiber . $* . id-fun a))の定義から、@(math (d-pair-type (x . elem-of . A) (x . id-type . a)))が可縮であることを示せばよい。@ref["0027"]より@(math (x . id-type . a))は@(math (a . id-type . x))のレトラクトなので、@ref["001S"]より@(math (d-pair-type (x . elem-of . A) (x . id-type . a)))は可縮である。 20 | } 21 | ] 22 | ] 23 | -------------------------------------------------------------------------------- /src/005Q.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define B "B") 11 | (define f "f") 12 | (define n "n") 13 | (define y "y") 14 | 15 | @definition[ 16 | #:id (current-id) 17 | #:indexes @list[ 18 | @notation-index[#:key "IsTruncMap"]{@(math is-trunc-map)} 19 | ] 20 | @paragraph{ 21 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数、@(math (n . elem-of . trunc-level))を要素とする。型@(math ((is-trunc-map . $* . n f) . elem-of . (universe . $ . i)))を@(math (d-fun-type (y . elem-of . B) (is-trunc . $* . n (fiber . $* . f y))))と定義する。 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /src/0084.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/localization.rkt") 7 | 8 | (define i "i") 9 | (define G "G") 10 | (define A "A") 11 | 12 | @definition[ 13 | #:id (current-id) 14 | #:indexes @list[ 15 | @index[#:key "きょくしょか"]{局所化} 16 | @notation-index[#:key "Loc"]{@(math localization)} 17 | ] 18 | @paragraph{ 19 | @(math i)を階数、@(math (G . elem-of . (local-generator . $ . i)))を局所生成系、@(math (A . elem-of . (universe . $ . i)))を型とする。@(math A)の@dfn{@(math G)-局所化(@(math G)-localization)} @(math ((localization . $* . G A) . elem-of . (universe . $ . i)))を@(math (weak-localization . $* . (local-generator-add-codiagonal . $ . G) A))と定義する。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src-0/node-003J-circle-algebra.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003J}{myDefinition} 6 | \myInlineMath{i}を階数とする。 7 | 型\myInlineMath{\myCircleAlg{i} \myElemOf \myUniverse{\myLevelSucc{i}}}を 8 | 次のレコード型と定義する。 9 | \begin{itemize} 10 | \item \myInlineMath{\myCircleAlgCarrier \myElemOf \myUniverse{i}} 11 | \item \myInlineMath{\myCircleAlgBase \myElemOf 12 | \myCircleAlgCarrier} 13 | \item \myInlineMath{\myCircleAlgLoop \myElemOf 14 | \myCircleAlgBase \myIdType \myCircleAlgBase} 15 | \end{itemize} 16 | \myInlineMath{\myCircleAlg{i}}の要素を(階数\myInlineMath{i}の) 17 | \myNewTerm[S1だいすう]{\protect\myInlineMath{\protect\myCircle}代数} 18 | (\myInlineMath{\myCircle}-algebra)と呼ぶ。 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-004A-comprehension.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004A}{myNotation} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族とする。 9 | 関数外延性の下で 10 | \myInlineMath{\myDFunType{x \myElemOf A} 11 | {\myIsProp{B\myAppParen{x}}}}の要素がある時、 12 | \myInlineMath{\myDPairType{x \myElemOf A}{B\myAppParen{x}}}のことを 13 | \myInlineMath{\myPropCompr{x \myElemOf A}{B\myAppParen{x}}}と書くことがある。 14 | さらに、要素\myInlineMath{c \myElemOf \myPropCompr{x \myElemOf A} 15 | {B\myAppParen{x}}}に対して、 16 | \myInlineMath{\myProjI{\myPhantom{c}}}を省略して 17 | \myInlineMath{c}そのものを\myInlineMath{A}の要素とみなすことがある。 18 | \end{myBlock} 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src-0/node-006S.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006S}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏とする。 8 | \myInlineMath{\myCatMapFun{C} \myElemOf 9 | \myBiFunctor{\myOppositeCat{C}}{C}{\mySetCat{i}}}を 10 | 次のように定義する。 11 | \begin{itemize} 12 | \item \myInlineMath{\myBiFunctorObj \myDefEq 13 | \myAbs{x_{1} x_{2}}{\myCatMap\myAppParen{x_{1}, x_{2}}}} 14 | \item \myInlineMath{\myBiFunctorMapI \myDefEq 15 | \myAbs{x_{11} x_{12} f x_{2}} 16 | {\myAbs{h}{h \myCatCompBin f}}} 17 | \item \myInlineMath{\myBiFunctorMapII \myDefEq 18 | \myAbs{x_{1} x_{21} x_{22} f} 19 | {\myAbs{h}{f \myCatCompBin h}}} 20 | \end{itemize} 21 | \end{myBlock} 22 | 23 | \end{document} -------------------------------------------------------------------------------- /src/005F.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/proposition.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define x "x") 12 | (define x1 (x . _ . "1")) 13 | (define x2 (x . _ . "2")) 14 | (define f "f") 15 | 16 | @definition[ 17 | #:id (current-id) 18 | #:indexes @list[ 19 | @notation-index[#:key "x~=y"]{@(math (x1 . cat:iso . x2))} 20 | ] 21 | @paragraph{ 22 | @(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏、@(math (x1 x2 . elem-of* . C))を対象とする。型@(math ((x1 . cat:iso . x2) . elem-of . (universe . $ . i)))を@(math (prop-compr (f . elem-of . (cat:map . $* . x1 x2)) (cat:is-iso . $ . f)))と定義する。 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src/007V.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/fiber-coproduct.rkt" 7 | "lib/math/suspension.rkt") 8 | 9 | (define i "i") 10 | (define A "A") 11 | (define f "f") 12 | 13 | @definition[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @index[#:key "けんすい"]{懸垂} 17 | @notation-index[#:key "Susp"]{@(math suspension)} 18 | ] 19 | @paragraph{ 20 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。関数@(math (f . elem-of . (A . fun-type . unit-type)))を@(math (abs blank unit-elem))とする。@dfn{懸垂(suspension)} @(math ((suspension . $ . A) . elem-of . (universe . $ . i)))を@(math (unit-type . (fiber-coproduct-type f f) . unit-type))と定義する。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-002S-fibration.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002S}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族とする。 9 | 要素\myInlineMath{a_{1}, a_{2}, a_{3} \myElemOf A}と 10 | 同一視\myInlineMath{p_{1} \myElemOf a_{1} \myIdType a_{2}}と 11 | \myInlineMath{p_{2} \myElemOf a_{2} \myIdType a_{3}}に対して、 12 | 同一視\myInlineMath{\myTransportComp{B}{p_{2}}{p_{1}} \myElemOf 13 | \myTransport{B}{p_{2} \myIdComp p_{1}} \myIdType 14 | \myTransport{B}{p_{2}} \myFunComp \myTransport{B}{p_{1}}}を構成できる。 15 | 実際、\myInlineMath{\myTransportComp{B}{p_{2}}{\myRefl{a_{1}}} \myDefEq 16 | \myRefl{\myBlank}}と定義すればよい。 17 | \end{myBlock} 18 | 19 | \end{document} -------------------------------------------------------------------------------- /src/004U.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/qinv.rkt" 7 | "lib/math/hae.rkt" 8 | "lib/math/biinv.rkt") 9 | 10 | (define i "i") 11 | (define A "A") 12 | (define B "B") 13 | (define f "f") 14 | 15 | @proposition[ 16 | #:id (current-id) 17 | @paragraph{ 18 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。型@(math (is-equiv . $ . f))と@(math (qinv . $ . f))は論理的に同値である。 19 | } 20 | #:proof @proof[ 21 | @paragraph{ 22 | @(math ((is-hae . $ . f) . fun-type . (qinv . $ . f)))と@(math ((qinv . $ . f) . fun-type . (is-biinv . $ . f)))は容易に示せるので、@ref["004K"]と@ref["004M"]を使う。 23 | } 24 | ] 25 | ] 26 | -------------------------------------------------------------------------------- /src-0/node-004P.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004P}{myExercise} 6 | 関数外延性を仮定する。 7 | \myInlineMath{i}を階数、 8 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 9 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 10 | \myInlineMath{f}は同値であると仮定して、次を示せ。 11 | \begin{enumerate} 12 | \item \label{004P:0000} 任意の型\myInlineMath{X \myElemOf \myUniverse{i}}に対して、 13 | 関数\myInlineMath{\myAbs{g}{f \myFunComp g} \myElemOf 14 | (X \myFunType A) \myFunType (X \myFunType B)}は同値である。 15 | \item \label{004P:0001} 任意の型\myInlineMath{Y \myElemOf \myUniverse{i}}に対して、 16 | 関数\myInlineMath{\myAbs{h}{h \myFunComp f} \myElemOf 17 | (B \myFunType Y) \myFunType (A \myFunType Y)}は同値である。 18 | \end{enumerate} 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-001F-functor.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001F}{myDefinition} 6 | \myInlineMath{i}階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf A \myFunType B}を関数とする。 9 | 関数\myInlineMath{\myIdApp{f} \myElemOf 10 | \myDFunType{\myImplicit{x_{1}, x_{2} \myElemOf A}} 11 | {x_{1} \myIdType x_{2} \myFunType 12 | f\myAppParen{x_{1}} \myIdType f\myAppParen{x_{2}}}}を 13 | \myInlineMath{\myAbs{x_{1} x_{2} z} 14 | {\myTransport{\myAbs{x}{f\myAppParen{x_{1}} \myIdType f\myAppParen{x}}} 15 | {z}\myAppParen{\myRefl{f\myAppParen{x_{1}}}}}}と定義する。 16 | 文脈上わかる場合は、\myInlineMath{\myIdApp{f}\myAppParen{p}}のことを 17 | \myInlineMath{f\myAppParen{p}}と書いてしまうこともある。 18 | \end{myBlock} 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src/004Q.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/biinv.rkt") 7 | 8 | (define i "i") 9 | (define A "A") 10 | (define B "B") 11 | (define f "f") 12 | (define g "g") 13 | 14 | @corollary[ 15 | #:id (current-id) 16 | @paragraph{ 17 | 関数外延性を仮定する。@(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。@(math f)が同値ならば、@(math (linv . $ . f))と@(math (rinv . $ . f))は可縮である。 18 | } 19 | #:proof @proof[ 20 | @paragraph{ 21 | 関数外延性から、レトラクト@(math ((rinv . $ . f) . retract-rel . (fiber . $* . (abs (g . elem-of . (B . fun-type . A)) (f . fun-comp . g)) id-fun)))を得て、右辺は@ref["004P"]より可縮である。@(math (linv . $ . f))についても同様である。 22 | } 23 | ] 24 | ] 25 | -------------------------------------------------------------------------------- /src/005Y.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/embedding.rkt" 7 | "lib/math/n-type.rkt") 8 | 9 | (define i "i") 10 | (define A "A") 11 | (define B "B") 12 | (define f "f") 13 | 14 | @definition[ 15 | #:id (current-id) 16 | #:indexes @list[ 17 | @index[#:key "うめこみ"]{埋め込み} 18 | @notation-index[#:key "IsEmb"]{@(math is-embedding)} 19 | ] 20 | @paragraph{ 21 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。型@(math ((is-embedding . $ . f) . elem-of . (universe . $ . i)))を@(math (is-trunc-map . $* . trunc-level:-1 f))と定義する。@(math (is-embedding . $ . f))の要素がある時、@(math f)は@dfn{埋め込み(embedding)}であると言う。 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /src-0/node-000Q-implicit-argument.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{000Q}{myNotation} 6 | \myInlineMath{f \myElemOf \myDFunType{\myImplicit{x \myElemOf A}} 7 | {\myDFunType{y \myElemOf B}{C}}} 8 | のように引数を\myInlineMath{\myImplicit{\myPhantom{x}}}で囲った場合、 9 | その引数は\myNewTerm[あんもくてき]{暗黙的}(implicit)であると約束する。 10 | つまり、要素\myInlineMath{a \myElemOf A}と 11 | \myInlineMath{b \myElemOf B\mySubstParen{x \mySubst a}}に対して、 12 | 関数適用を\myInlineMath{f\myAppParen{a, b}}の代わりに 13 | \myInlineMath{a}を省略して\myInlineMath{f\myAppParen{b}}と書く。 14 | \myInlineMath{B}の構成で\myInlineMath{x}を明示的に使う場合には実用上は曖昧性は無い。 15 | 暗黙的な引数\myInlineMath{a}だけを適用したい場合は 16 | \myInlineMath{f\myImplicit{a} \myElemOf B\mySubstParen{x \mySubst a}}と書く。 17 | \end{myBlock} 18 | 19 | \end{document} 20 | -------------------------------------------------------------------------------- /src-0/node-002O-associativity.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002O}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{a_{1}, a_{2}, a_{3}, a_{4} \myElemOf A}を要素、 9 | \myInlineMath{p_{1} \myElemOf a_{1} \myIdType a_{2}}と 10 | \myInlineMath{p_{2} \myElemOf a_{2} \myIdType a_{3}}と 11 | \myInlineMath{p_{3} \myElemOf a_{3} \myIdType a_{4}}を同一視とする。 12 | 同一視\myInlineMath{\myIdAssoc{p_{3}}{p_{2}}{p_{1}} \myElemOf 13 | (p_{3} \myIdComp p_{2}) \myIdComp p_{1} \myIdType 14 | p_{3} \myIdComp (p_{2} \myIdComp p_{1})}を構成する。 15 | 同一視型の帰納法により、 16 | \myInlineMath{\myIdAssoc{p_{3}}{p_{2}}{\myRefl{a_{1}}} \myDefEq 17 | \myRefl{p_{3} \myIdComp p_{2}}}と定義すればよい。 18 | \end{myBlock} 19 | 20 | \end{document} -------------------------------------------------------------------------------- /src/0013.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/math/function.rkt" 5 | "lib/markup/example.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define C "C") 11 | (define f "f") 12 | (define x "x") 13 | (define y "y") 14 | (define a x) 15 | (define b y) 16 | 17 | @example[ 18 | #:id (current-id) 19 | @paragraph{ 20 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (C . elem-of . (A . fun-type . (B . fun-type . (universe . $ . i)))))を型の族、@(math (f . elem-of . (d-fun-type (x . elem-of . A) (d-fun-type (y . elem-of . B) (C . $* . x y)))))を関数とする。関数@(math ((swap . $ . f) . elem-of . (d-fun-type (y . elem-of . B) (d-fun-type (x . elem-of . A) (C . $* . x y)))))を@(math ((swap . $* . f b a) . def-eq . (f . $* . a b)))と定義する。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src-0/node-001C-transport.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{001C}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{j}を階数、 9 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{j}}を型の族とする。 10 | \myInlineMath{a_{1}, a_{2} \myElemOf A}と 11 | \myInlineMath{p \myElemOf a_{1} \myIdType a_{2}}を要素とする。 12 | \myNewTerm[ゆそうかんすう]{輸送関数}(transport function) 13 | \myInlineMath{\myTransport{B}{p} \myElemOf 14 | B\myAppParen{a_{1}} \myFunType B\myAppParen{a_{2}}}を 15 | \myInlineMath{\myAbs{y_{1}}{\myIdInd{p}{\myAbs{x z}{B\myAppParen{x}}}{y_{1}}}}と定義する。 16 | \myInlineMath{\myTransport{B}{\myRefl{a_{1}}} \myDefEq 17 | \myIdFun{B\myAppParen{a_{1}}}}であることが確かめられる。 18 | \end{myBlock} 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src-0/node-002X-primitive-recursion.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002X}{myExample} 6 | \myInlineMath{n \myElemOf \myNat}を要素、 7 | \myInlineMath{f \myElemOf \myNat \myFunType \myNat \myFunType \myNat}を関数とする。 8 | \myNewTerm[げんしさいき]{原始再帰}(primitive recursion)による関数 9 | \myInlineMath{\myPrimRec{n}{f} \myElemOf \myNat \myFunType \myNat}が 10 | \myInlineMath{\myPrimRec{n}{f}\myAppParen{\myNatZero} \myDefEq n}と 11 | \myInlineMath{\myPrimRec{n}{f}\myAppParen{\myNatSucc{m}} \myDefEq 12 | f\myAppParen{m, \myPrimRec{n}{f}\myAppParen{m}}}で定義される。 13 | 形式的には\myInlineMath{\myPrimRec{n}{f} \myDefEq \myAbs{m} 14 | {\myNatInd{m}{\myAbs{x}{\myNat}}{n}{\myAbs{x y}{f\myAppParen{x, y}}}}}である。 15 | よって、いわゆる\emph{原始再帰的関数}はすべて構成できる。 16 | \end{myBlock} 17 | 18 | \end{document} -------------------------------------------------------------------------------- /src-0/node-003H.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003H}{myExercise} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myNatAlg{i}}を\myInlineMath{\myNat}代数、 8 | \myInlineMath{B \myElemOf \myNatAlgOver{A}}を 9 | \myInlineMath{A}上の\myInlineMath{\myNat}代数、 10 | \myInlineMath{f \myElemOf \myNatSection{B}}を切断とする。 11 | \begin{enumerate} 12 | \item \myInlineMath{\myNatSection{\myNatSectionId{f}{f}}}の要素を構成せよ。 13 | \item 関数外延性を仮定すると 14 | \myInlineMath{\myDPairType{g \myElemOf \myNatSection{B}} 15 | {\myNatSection{\myNatSectionId{f}{g}}}}は可縮であることを示せ。 16 | \end{enumerate} 17 | よって、\myRef{001S}より、関数外延性の下で同値 18 | \myInlineMath{(f \myIdType g) \myEquiv 19 | \myNatSection{\myNatSectionId{f}{g}}}を得る。 20 | \end{myBlock} 21 | 22 | \end{document} 23 | -------------------------------------------------------------------------------- /src/0011.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/markup/example.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define C "C") 11 | (define f "f") 12 | (define g "g") 13 | (define x "x") 14 | 15 | @example[ 16 | #:id (current-id) 17 | #:indexes @list[ 18 | @index[#:key "ごうせいかんすう"]{合成関数} 19 | @notation-index[#:key "gof"]{@(math (g . fun-comp . f)) (関数)} 20 | ] 21 | @paragraph{ 22 | @(math i)を階数、@(math (A B C . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))と@(math (g . elem-of . (B . fun-type . C)))を関数とする。@dfn{合成関数(composed function)}@(math ((g . fun-comp . f) . elem-of . (A . fun-type . C)))を@(math (((g . fun-comp . f) . $ . x) . def-eq . (g . $ . (f . $ . x))))と定義する。 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src-0/my-eq-reasoning.sty: -------------------------------------------------------------------------------- 1 | % Inside the `\myEqReasoning` command, commands `\term`, `\by`, and 2 | % `\rel` are available. The intended use is like this. 3 | % 4 | % \myEqReasoning{ 5 | % & \term{x + y} \\ 6 | % \rel{=}& \by{Commutativity} \\ 7 | % & \term{y + x} 8 | % } 9 | 10 | \usepackage{lwarp,longtable,my-math} 11 | 12 | \NewDocumentCommand{\myEqReasoning}{+m}{% 13 | \begin{center} 14 | \let\term\myEqReasoning@term 15 | \let\by\myEqReasoning@by 16 | \let\rel\myEqReasoning@rel 17 | \setlength{\LTpre}{0pt} 18 | \setlength{\LTpost}{-20pt} 19 | \begin{longtable}{ll} 20 | #1 21 | \end{longtable} 22 | \end{center}} 23 | 24 | \newcommand{\myEqReasoning@term}[1]{\myInlineMath{#1}} 25 | \newcommand{\myEqReasoning@by}[1]{\qquad\{#1\}} 26 | \newcommand{\myEqReasoning@rel}[1]{\myInlineMath{#1}} 27 | -------------------------------------------------------------------------------- /src/000T.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/markup/definition.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define x "x") 10 | 11 | @definition[ 12 | #:id (current-id) 13 | #:indexes @list[ 14 | @index[#:key "かしゅく"]{可縮} 15 | @notation-index[#:key "IsContr"]{@(math is-contr)} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型とする。型@(math ((is-contr . $ . A) . elem-of . (universe . $ . i)))を次のレコード型と定義する。 19 | @unordered-list[ 20 | @list-item{@(math (center . elem-of . A))} 21 | @list-item{@(math (contraction . elem-of . (d-fun-type (x . elem-of . A) (center . id-type . x))))} 22 | ] 23 | @(math (is-contr . $ . A))の要素がある時、@(math A)は@dfn{可縮(contractible)}であると言う。 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /src-0/node-0045.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0045}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{r \myElemOf \myRetract{A}{B}}と 9 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 10 | \myInlineMath{B}が\myInlineMath{n}型ならば、 11 | \myInlineMath{A}も\myInlineMath{n}型である。 12 | \end{myBlock} 13 | \begin{myProof} 14 | \myInlineMath{n}についての帰納法による。 15 | \myInlineMath{n}が\myInlineMath{\myTLMinusTwo}の時は 16 | \myRef{001K}による。 17 | 18 | \myInlineMath{n}について主張が成り立つと仮定し、 19 | \myInlineMath{\myTLSucc{n}}の場合を示す。 20 | \myInlineMath{x_{1}, x_{2} \myElemOf A}に対して、 21 | \myInlineMath{\myIsTrunc{n}{x_{1} \myIdType x_{2}}}を示せばよいが、 22 | \myRef{0046}と帰納法の仮定から直ちに従う。 23 | \end{myProof} 24 | 25 | \end{document} 26 | -------------------------------------------------------------------------------- /src/0054.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt") 7 | 8 | (define i "i") 9 | (define n "n") 10 | (define A "A") 11 | (define B "B") 12 | 13 | @proposition[ 14 | #:id (current-id) 15 | @paragraph{ 16 | 一価性と関数外延性を仮定する。@(math i)を階数、@(math (n . elem-of . trunc-level))を要素とする。@(math ((trunc-type n) . $ . i))は@(math (trunc-level:succ . $ . n))型である。 17 | } 18 | #:proof @proof[ 19 | @paragraph{ 20 | @(math (A B . elem-of* . ((trunc-type n) . $ . i)))を要素とする。一価性と@ref["0049"]と@ref["0043"]より、同値@(math ((A . id-type . B) . equiv . ((A . record-field . trunc-type:type) . equiv . (B . record-field . trunc-type:type))))を得て、後者は@ref["0048"]と@ref["004X"]と@ref["0052"]から@(math n)型である。 21 | } 22 | ] 23 | ] 24 | -------------------------------------------------------------------------------- /src-0/node-003Q-initial-po-algebra.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003Q}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B, C \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{f \myElemOf C \myFunType A}と 9 | \myInlineMath{g \myElemOf C \myFunType B}を関数、 10 | \myInlineMath{D \myElemOf \myPOAlg{f}{g}}を 11 | \myInlineMath{\myPO{f}{g}}代数とする。 12 | 型\myInlineMath{\myIsInitPOAlg{D} \myElemOf \myUniverse{\myLevelSucc{i}}}を 13 | \myInlineMath{\myDFunType{X \myElemOf \myPOAlg{f}{g}} 14 | {\myIsContr{\myPOHom{D}{X}}}}と定義する。 15 | \myInlineMath{\myIsInitPOAlg{D}}の要素がある時、\myInlineMath{D}は 16 | \myNewTerm[しPOfgだいすう]{始\protect\myInlineMath{\protect\myPO{f}{g}}代数} 17 | (initial \myInlineMath{\myPO{f}{g}}-algebra)であると言う。 18 | \end{myBlock} 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src-0/node-0049.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0049}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族、 9 | \myInlineMath{c_{1}, c_{2} \myElemOf \myDPairType{x \myElemOf A} 10 | {B\myAppParen{x}}}を要素とする。 11 | \myInlineMath{\myDFunType{x \myElemOf A} 12 | {\myIsProp{B\myAppParen{x}}}}の要素があるならば、 13 | 同値\myInlineMath{(c_{1} \myIdType c_{2}) \myEquiv 14 | (\myProjI{c_{1}} \myIdType \myProjI{c_{2}})}を得る。 15 | \end{myBlock} 16 | \begin{myProof} 17 | \myRef{001S}を適用する。 18 | \myRef{006B}より、 19 | \myInlineMath{\myDPairType{x \myElemOf A}{\myProjI{c_{1}} \myIdType x}} 20 | が可縮であることを示せばよいが、 21 | これは\myRef{001N}から従う。 22 | \end{myProof} 23 | 24 | \end{document} 25 | -------------------------------------------------------------------------------- /src-0/node-0025.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{0025}{myLemma} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{B \myElemOf A \myFunType \myUniverse{i}}を型の族、 9 | \myInlineMath{C \myElemOf \myDFunType{x \myElemOf A} 10 | {B\myAppParen{x} \myFunType \myUniverse{i}}}を型の族、 11 | \myInlineMath{a \myElemOf A}と 12 | \myInlineMath{b \myElemOf B\myAppParen{a}}を要素とする。 13 | \myInlineMath{\myDPairType{x \myElemOf A}{B\myAppParen{x}}}が可縮ならば 14 | \myInlineMath{(\myDPairType{x \myElemOf A} 15 | {\myDPairType{y \myElemOf B\myAppParen{x}} 16 | {C\myAppParen{x, y}}}) \myBiRetractRel 17 | C\myAppParen{a, b}}の要素を構成できる。 18 | \end{myBlock} 19 | \begin{myProof} 20 | \myRef{0024}からすぐに従う。 21 | \end{myProof} 22 | 23 | \end{document} 24 | -------------------------------------------------------------------------------- /src-0/node-002U-coproduct.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{002U}{有限余積} 6 | 7 | 自然数型の他にも重要な帰納的型がある。 8 | 最も簡単な帰納的型は\emph{空型}である。 9 | 10 | \subfile{node-0030-empty} 11 | 12 | 空型には構成子が一つも与えられていない。 13 | よって、型理論の中の人にとっては\myInlineMath{\myEmptyType}の要素は存在しないはずである。 14 | 言い換えれば、\myInlineMath{\myEmptyType}の要素は 15 | \myNewTerm[むじゅん]{矛盾}(contradiction)を表し、 16 | 帰納法原理は矛盾からはすべてを導けること、 17 | \myNewTerm[ばくはつげんり]{爆発原理}(principle of explosionまたは\textit{ex falso quodlibet}) 18 | を意味する。 19 | 20 | 次に簡単な帰納的型は\emph{余積}である。 21 | 22 | \subfile{node-002Z-coproduct} 23 | 24 | \myInlineMath{\myCoproductInI{\myPhantom{a}}}と 25 | \myInlineMath{\myCoproductInII{\myPhantom{b}}}が 26 | \myInlineMath{A \myCoproduct B}の構成子であり、 27 | 帰納法原理はやはりこれらの構成子のみを使って得られるものだけが 28 | \myInlineMath{A \myCoproduct B}の要素であることを表す。 29 | 30 | \end{document} -------------------------------------------------------------------------------- /src-0/node-003Y-truncated.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003Y}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型とする。 8 | \myInlineMath{n \myElemOf \myTruncLevel}に対して、 9 | 型\myInlineMath{\myIsTrunc{n}{A} \myElemOf \myUniverse{i}}を次のように定義する。 10 | \begin{itemize} 11 | \item \myInlineMath{\myIsTrunc{\myTLMinusTwo}{A} \myDefEq 12 | \myIsContr{A}} 13 | \item \myInlineMath{\myIsTrunc{\myTLSucc{n}}{A} \myDefEq 14 | \myDFunType{x_{1}, x_{2} \myElemOf A} 15 | {\myIsTrunc{n}{x_{1} \myIdType x_{2}}}} 16 | \end{itemize} 17 | \myInlineMath{\myIsTrunc{n}{A}}の要素がある時、\myInlineMath{A}は 18 | \myNewTerm[nかた]{\protect\myInlineMath{n}型}(\myInlineMath{n}-type) 19 | である、または\myInlineMath{n}-truncatedであると言う。 20 | \end{myBlock} 21 | 22 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005L.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005L}{myNotation} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{F \myElemOf \myFunctor{C}{D}}を関手とする。 9 | \begin{enumerate} 10 | \item 対象\myInlineMath{x \myElemOf C}に対して、 11 | \myInlineMath{F\myRecordField\myFunctorObj\myAppParen{x} \myElemOf D}の代わりに 12 | 単に\myInlineMath{F\myAppParen{x}}と書く。 13 | \item 対象\myInlineMath{x_{1}, x_{2} \myElemOf C}と 14 | 射\myInlineMath{f \myElemOf \myCatMap\myAppParen{x_{1}, x_{2}}}に対して、 15 | \myInlineMath{F\myRecordField\myFunctorMap\myAppParen{f} \myElemOf 16 | \myCatMap\myAppParen{F\myAppParen{x_{1}}, F\myAppParen{x_{2}}}}の代わりに 17 | 単に\myInlineMath{F\myAppParen{f}}と書く。 18 | \end{enumerate} 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src-0/node-006F.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{006F}{myNotation} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{A \myElemOf \myPresheaf{C}}を前層とする。 9 | \begin{enumerate} 10 | \item 対象\myInlineMath{x \myElemOf C}に対して、 11 | \myInlineMath{A\myRecordField\myPresheafCarrier\myAppParen{x}}の代わりに 12 | 単に\myInlineMath{A\myAppParen{x}}と書く。 13 | \item 対象\myInlineMath{x_{1}, x_{2} \myElemOf C}と 14 | 射\myInlineMath{f \myElemOf \myCatMap\myAppParen{x_{1}, x_{2}}}と 15 | 要素\myInlineMath{a \myElemOf A\myAppParen{x_{2}}}に対して、 16 | 要素\myInlineMath{a \myPresheafActBin f \myElemOf A\myAppParen{x_{1}}}を 17 | \myInlineMath{A\myRecordField\myPresheafAct\myAppParen{a, f}}と定義する。 18 | \end{enumerate} 19 | \end{myBlock} 20 | 21 | \end{document} -------------------------------------------------------------------------------- /src/005U.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/n-type.rkt" 7 | "lib/math/connected.rkt" 8 | "lib/math/truncation.rkt") 9 | 10 | (define n "n") 11 | (define i "i") 12 | (define A "A") 13 | 14 | @definition[ 15 | #:id (current-id) 16 | #:indexes @list[ 17 | @index[#:key "nれんけつ"]{@(math n)連結} 18 | @notation-index[#:key "IsConnected"]{@(math is-connected)} 19 | ] 20 | @paragraph{ 21 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (n . elem-of . trunc-level))を要素とする。型@(math ((is-connected . $* . n A) . elem-of . (universe . $ . i)))を@(math (is-contr . $ . (trunc n A)))と定義する。@(math (is-connected . $* . n A))の要素がある時、@(math A)は@dfn{@(math n)連結(@(math n)-connected)}であると言う。 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /src/007W.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cofiber.rkt" 7 | "lib/math/fiber-coproduct.rkt") 8 | 9 | (define i "i") 10 | (define A "A") 11 | (define B "B") 12 | (define f "f") 13 | (define g "g") 14 | 15 | @definition[ 16 | #:id (current-id) 17 | #:indexes @list[ 18 | @index[#:key "こふぁいばー"]{コファイバー} 19 | @notation-index[#:key "Cofiber"]{@(math cofiber)} 20 | ] 21 | @paragraph{ 22 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。関数@(math (g . elem-of . (A . fun-type . unit-type)))を@(math (abs blank unit-elem))とする。@(math f)の@dfn{コファイバー(cofiber)} @(math (cofiber . $ . f))を@(math (B . (fiber-coproduct-type f g) . unit-type))と定義する。 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src/001Z.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/math.rkt") 5 | 6 | (define i "i") 7 | (define A "A") 8 | (define B "B") 9 | (define x "x") 10 | (define f "f") 11 | (define g "g") 12 | 13 | @definition[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @index[#:key "かんすうがいえんせい"]{関数外延性} 17 | ] 18 | @paragraph{ 19 | @(math i)を階数、@(math (A . elem-of . (universe . $ . i)))を型、@(math (B . elem-of . (A . fun-type . (universe . $ . i))))を型の族とする。関数型@(math (d-fun-type (x . elem-of . A) (B . $ . x)))が@dfn{関数外延性(function extensionality)}を満たすとは、@(math (d-fun-type (f . elem-of . (d-fun-type (x . elem-of . A) (B . $ . x))) (is-contr . $ . (d-pair-type (g . elem-of . (d-fun-type (x . elem-of . A) (B . $ . x))) (d-fun-type (x . elem-of . A) ((f . $ . x) . id-type . (g . $ . x)))))))の要素があることである。 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/007B.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/lemma.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt") 6 | 7 | (define i "i") 8 | (define A "A") 9 | (define B "B") 10 | (define f "f") 11 | (define g "g") 12 | (define X "X") 13 | 14 | @lemma[ 15 | #:id (current-id) 16 | @paragraph{ 17 | @(math i)を階数、@(math (A B . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))を関数とする。@(math (universe . $ . i))が一価性を満たし、@(math f)が同値ならば、任意の型@(math (X . elem-of . (universe . $ . i)))に対して関数@(math ((abs g (f . fun-comp . g)) . elem-of . ((paren (X . fun-type . A)) . fun-type . (paren (X . fun-type . B)))))は同値である。 18 | } 19 | #:proof @proof[ 20 | @paragraph{ 21 | 一価性より、@(math f)が恒等関数の場合を示せば十分であるが、@(math ((abs g (id-fun . fun-comp . g)) . def-eq . (abs g g)))なのでこれは同値である。 22 | } 23 | ] 24 | ] 25 | -------------------------------------------------------------------------------- /src/0087.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/notation.rkt" 4 | "lib/index/notation.rkt" 5 | (prefix-in tex: morg/math/tex) 6 | "lib/math.rkt") 7 | 8 | (define α tex:alpha) 9 | (define x "x") 10 | (define a "a") 11 | (define n "n") 12 | (define i "i") 13 | 14 | @notation[ 15 | #:id (current-id) 16 | #:indexes @list[ 17 | @notation-index[#:key "a[x:=b]"]{@(math (α . subst-apply... . (list (x . _ . "1") (a . _ . "1")) (list (x . _ . n) (a . _ . n))))} 18 | ] 19 | @paragraph{ 20 | @(math α)を仮定@(math (seq (x . _ . "1") dots (x . _ . n)))の下での対象、@(math (a . _ . i))を@(math (x . _ . i))と同じ種類の対象とする。@(math α)の構成において各@(math (x . _ . i))に@(math (a . _ . i))を@emph{代入}したものはまた妥当な構成である。代入の結果得られる対象を@(math (α . subst-apply... . (list (x . _ . "1") (a . _ . "1")) (list (x . _ . n) (a . _ . n))))と書く。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src/008B.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/example.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math/level.rkt" 6 | "lib/math.rkt" 7 | "lib/math/magma.rkt") 8 | 9 | (define i "i") 10 | 11 | @example[ 12 | #:id (current-id) 13 | #:indexes @list[ 14 | @index[#:key "まぐま"]{マグマ} 15 | @notation-index[#:key "Magma(i)"]{@(math (magma . $ . i))} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数とする。型@(math ((magma . $ . i) . elem-of . (universe . $ . (level:succ . $ . i))))を次のレコード型と定義する。 19 | @unordered-list[ 20 | @list-item{@(math (magma:carrier . elem-of . (universe . $ . i)))} 21 | @list-item{@(math (magma:operator . elem-of . (magma:carrier . fun-type . (magma:carrier . fun-type . magma:carrier))))} 22 | ] 23 | @(math (magma . $ . i))の要素を@dfn{マグマ(magma)}と呼ぶ。 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /src/002C.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/example.rkt" 4 | "lib/math.rkt" 5 | "lib/math/level.rkt") 6 | 7 | (define a "a") 8 | (define a1 (a . _ . "1")) 9 | (define a2 (a . _ . "2")) 10 | (define B "B") 11 | (define x "x") 12 | 13 | @example[ 14 | #:id (current-id) 15 | @paragraph{ 16 | @(math (a1 a2 . elem-of* . unit-type))を要素とする。同値@(math ((a1 . id-type . a2) . equiv . unit-type))を構成しよう。@ref["001S"]を適用する。@(math (B . elem-of . (unit-type . fun-type . (universe . $ . level:zero))))を@(math (abs x unit-type))と定義する。要素@(math (unit-elem . elem-of . (B . $ . a1)))を得る。@ref["001O"]と@ref["0024"]により、@(math (d-pair-type (x . elem-of . unit-type) (B . $ . x)))は@(math (B . $ . a1))のレトラクトである。再び@ref["001O"]により@(math (B . $ . a1))は可縮なので、@ref["001K"]により@(math (d-pair-type (x . elem-of . unit-type) (B . $ . x)))は可縮である。 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src-0/my-theorem.sty: -------------------------------------------------------------------------------- 1 | \usepackage{amsthm,hyperref,cleveref} 2 | 3 | \newtheorem{thmcounter}{Dummy}[section] 4 | \theoremstyle{definition} 5 | \newtheorem{myRule}[thmcounter]{規則} 6 | \newtheorem{myNotation}[thmcounter]{記法} 7 | \newtheorem{myTerminology}[thmcounter]{用語} 8 | \newtheorem{myDefinition}[thmcounter]{定義} 9 | \newtheorem{myAxiom}[thmcounter]{公理} 10 | \newtheorem{myExample}[thmcounter]{例} 11 | \newtheorem{myExercise}[thmcounter]{演習} 12 | \newtheorem{myComparison}[thmcounter]{比較} 13 | \newtheorem{myProposition}[thmcounter]{命題} 14 | \newtheorem{myTheorem}[thmcounter]{定理} 15 | \newtheorem{myLemma}[thmcounter]{補題} 16 | \newtheorem{myCorollary}[thmcounter]{系} 17 | \newtheorem{myRemark}[thmcounter]{注意} 18 | 19 | \newcommand{\myProof@title}{証明} 20 | \newenvironment{myProof}[1][\myProof@title]{\begin{proof}[#1]}{\end{proof}} 21 | 22 | \newcommand{\myQed}{\qed} 23 | -------------------------------------------------------------------------------- /src-0/node-004F.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{004F}{myProposition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A \myElemOf \myUniverse{i}}を型、 8 | \myInlineMath{n \myElemOf \myTruncLevel}を要素とする。 9 | \myInlineMath{A}が\myInlineMath{n}型ならば、 10 | \myInlineMath{A}は\myInlineMath{\myTLSucc{n}}型である。 11 | \end{myBlock} 12 | \begin{myProof} 13 | \myInlineMath{n}についての帰納法による。 14 | \myInlineMath{n}が\myInlineMath{\myTLMinusTwo}の場合は 15 | \myRef{001L}による。 16 | 17 | \myInlineMath{n}の場合に主張が成り立つと仮定して、 18 | \myInlineMath{\myTLSucc{n}}の場合を示す。 19 | \myInlineMath{A}が\myInlineMath{\myTLSucc{n}}型と仮定して、 20 | 任意の\myInlineMath{x_{1}, x_{2} \myElemOf A}に対して 21 | \myInlineMath{x_{1} \myIdType x_{2}}が 22 | \myInlineMath{\myTLSucc{n}}型であることを示せばよいが、 23 | 仮定と帰納法の過程から直ちに従う。 24 | \end{myProof} 25 | 26 | \end{document} -------------------------------------------------------------------------------- /src-0/node-005M-equivalence.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{005M}{myDefinition} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{C, D \myElemOf \myPreCat{i}}を前圏、 8 | \myInlineMath{F \myElemOf \myFunctor{C}{D}}を関手とする。 9 | 型\myInlineMath{\myIsPreCatEquiv{F} \myElemOf \myUniverse{i}}を 10 | 次のレコード型と定義する。 11 | \begin{itemize} 12 | \item \myInlineMath{\myBlank \myElemOf \myIsEquiv{F\myRecordField\myFunctorObj}} 13 | \item \myInlineMath{\myBlank \myElemOf 14 | \myDFunType{x_{1}, x_{2} \myElemOf C\myRecordField\myCatObj} 15 | {\myIsEquiv{F\myRecordField\myFunctorMap\myImplicit{x_{1}, x_{2}}}}} 16 | \end{itemize} 17 | \myInlineMath{\myIsPreCatEquiv{F}}の要素がある時、 18 | \myInlineMath{F}は\myNewTerm[ぜんけんのどうち]{前圏の同型}(isomorphism of precategories) 19 | であると言う。 20 | \end{myBlock} 21 | 22 | \end{document} -------------------------------------------------------------------------------- /src/0012.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | "lib/markup/exercise.rkt") 5 | 6 | (define i "i") 7 | (define A "A") 8 | (define B "B") 9 | (define C "C") 10 | (define D "D") 11 | (define f "f") 12 | (define g "g") 13 | (define h "h") 14 | 15 | @exercise[ 16 | #:id (current-id) 17 | @paragraph{ 18 | @(math i)を階数、@(math (A B C D . elem-of* . (universe . $ . i)))を型、@(math (f . elem-of . (A . fun-type . B)))と@(math (g . elem-of . (B . fun-type . C)))と@(math (h . elem-of . (C . fun-type . D)))を関数とする。 19 | @ordered-list[ 20 | @list-item{@(math (f . def-eq . (f . fun-comp . id-fun)))であることを確かめよ。} 21 | @list-item{@(math ((id-fun . fun-comp . f) . def-eq . f))であることを確かめよ。} 22 | @list-item{@(math (((h . fun-comp . g) . fun-comp . f) . def-eq . (h . fun-comp . (g . fun-comp . f))))であることを確かめよ。} 23 | ] 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /src/0085.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/exercise.rkt" 4 | "lib/math.rkt" 5 | "lib/math/localization.rkt") 6 | 7 | (define i "i") 8 | (define G "G") 9 | (define A "A") 10 | (define X "X") 11 | (define f "f") 12 | 13 | @exercise[ 14 | #:id (current-id) 15 | @paragraph{ 16 | 関数外延性を仮定する。@(math i)を階数、@(math (G . elem-of . (local-generator . $ . i)))を局所生成系、@(math (A . elem-of . (universe . $ . i)))を型とする。 17 | @ordered-list[ 18 | @list-item{@(math (localization . $* . G A))は@(math G)-局所的である。} 19 | @list-item{@(math (X . elem-of . (universe . $ . i)))を型とし、@(math X)は@(math G)-局所的であると仮定する。関数@disp{ 20 | @(math ((abs f (f . fun-comp . localization:in)) . elem-of . ((paren ((localization . $* . G A) . fun-type . X)) . fun-type . (paren (A . fun-type . X))))) 21 | }は同値である。} 22 | ] 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /src/008A.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/example.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/level.rkt" 7 | "lib/math/pointed-type.rkt") 8 | 9 | (define i "i") 10 | 11 | @example[ 12 | #:id (current-id) 13 | #:indexes @list[ 14 | @index[#:key "てんつきかた"]{点付き型} 15 | @notation-index[#:key "U*(i)"]{@(math (pointed-type . $ . i))} 16 | ] 17 | @paragraph{ 18 | @(math i)を階数とする。型@(math ((pointed-type . $ . i) . elem-of . (universe . $ . (level:succ . $ . i))))を次のレコード型と定義する。 19 | @unordered-list[ 20 | @list-item{@(math (pointed-type:carrier . elem-of . (universe . $ . i)))} 21 | @list-item{@(math (pointed-type:point . elem-of . pointed-type:carrier))} 22 | ] 23 | @(math (pointed-type . $ . i))の要素を(階数@(math i)の)@dfn{点付き型(pointed type)}と呼ぶ。 24 | } 25 | ] 26 | -------------------------------------------------------------------------------- /src-0/node-0009-universe.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{0009}{宇宙} 6 | 7 | 要素が型であるような型を\myNewTerm[うちゅう]{宇宙}(universe)と呼ぶ。 8 | 本書で考える型理論は「可算個」の非有界な宇宙の列 9 | \myDisplayMath{ 10 | \myUniverse{0} \myElemOf 11 | \myUniverse{1} \myElemOf 12 | \myUniverse{2} \myElemOf 13 | \myDots 14 | } 15 | を持つ。 16 | 17 | 数学を基礎付ける文脈では\myInlineMath{0, 1, 2, \myDots}が何なのか分からないので、 18 | \myNewTerm[かいすう]{階数}(level)の概念を導入する。 19 | 階数は型でも要素でもない別の種類の対象である。 20 | 21 | \subfile{node-000D-level} 22 | 23 | 宇宙に関する規則は次の通りである。 24 | 25 | \subfile{node-000E-universe-rule} 26 | \subfile{node-000F-universe-notation} 27 | 28 | 本書で考える型理論では\myRef{000E}の他には形式的な意味での型を構成する規則は与えず、 29 | 代わりに\myInlineMath{\myUniverse{i}}の要素を構成する規則を与える。 30 | 以降、\myInlineMath{\myUniverse{i}}の要素を 31 | (階数\myInlineMath{i}の)\myNewTerm[かた]{型}(type)と呼ぶ。 32 | 33 | \end{document} 34 | -------------------------------------------------------------------------------- /src-0/node-002C-unit-id.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{002C}{myExample} 6 | \myInlineMath{a_{1}, a_{2} \myElemOf \myUnitType}を要素とする。 7 | 同値\myInlineMath{(a_{1} \myIdType a_{2}) \myEquiv \myUnitType}を構成しよう。 8 | \myRef{001S}を適用する。 9 | \myInlineMath{B \myElemOf \myUnitType \myFunType \myUniverse{\myBlank}}を 10 | \myInlineMath{\myAbs{x}{\myUnitType}}と定義する。 11 | 要素\myInlineMath{\myUnitElem \myElemOf B\myAppParen{a_{1}}}を得る。 12 | \myRef{001O}と\myRef{0024}により、 13 | \myInlineMath{\myDPairType{x \myElemOf \myUnitType}{B\myAppParen{x}}} 14 | は\myInlineMath{B\myAppParen{a_{1}}}のレトラクトである。 15 | 再び\myRef{001O}により\myInlineMath{B\myAppParen{a_{1}}}は可縮なので、 16 | \myRef{001K}により\myInlineMath{\myDPairType{x \myElemOf \myUnitType} 17 | {B\myAppParen{x}}}は可縮である。 18 | \end{myBlock} 19 | 20 | \end{document} 21 | -------------------------------------------------------------------------------- /src/0068.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/proposition.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/functor.rkt" 8 | "lib/math/nat-trans.rkt" 9 | "lib/math/logic.rkt") 10 | 11 | (define i "i") 12 | (define C "C") 13 | (define D "D") 14 | (define F "F") 15 | (define G "G") 16 | (define s "s") 17 | (define t "t") 18 | (define x "x") 19 | 20 | @proposition[ 21 | #:id (current-id) 22 | @paragraph{ 23 | 関数外延性を仮定する。@(math i)を階数、@(math (C D . elem-of* . (precat . $ . i)))を前圏、@(math (F G . elem-of* . (functor . $* . C D)))を関手、@(math (s t . elem-of* . (nat-trans . $* . F G)))を自然変換とすると、同値 24 | @disp{ 25 | @(math ((s . id-type . t) . equiv . (forall (x . elem-of . C) ((s . $ . x) . id-type . (t . $ . x))))) 26 | } 27 | を構成できる。 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /src/007M.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/definition.rkt" 4 | "lib/index/notation.rkt" 5 | "lib/math.rkt" 6 | "lib/math/span.rkt" 7 | "lib/math/fiber-coproduct.rkt") 8 | 9 | (define i "i") 10 | (define A "A") 11 | (define C "C") 12 | 13 | @definition[ 14 | #:id (current-id) 15 | #:indexes @list[ 16 | @index[#:key "すぱんかのふへんよすい"]{スパン下の普遍余錐} 17 | @notation-index[#:key "IsUniversal"]{@(math span/cocone-is-universal)} 18 | ] 19 | @paragraph{ 20 | @(math i)を階数、@(math (A . elem-of . (span . $ . i)))をスパン、@(math (C . elem-of . (span/cocone . $ . A)))を余錐とする。型@(math ((span/cocone-is-universal . $ . C) . elem-of . (universe . $ . i)))を@(math (is-equiv . $ . (span/cocone:comparison . $ . C)))と定義する。@(math (span/cocone-is-universal . $ . C))の要素があるとき、@(math C)は@dfn{普遍余錐(universal cocone)}であると言う。 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src/0089.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/notation.rkt" 4 | "lib/math.rkt") 5 | 6 | (define f "f") 7 | (define x "x") 8 | (define A "A") 9 | (define B "B") 10 | (define b "b") 11 | 12 | @notation[ 13 | #:id (current-id) 14 | @paragraph{ 15 | 関数を定義するには次のいずれかような言い回しをする。 16 | @unordered-list[ 17 | @list-item{ 18 | 関数@(math (f . elem-of . (d-fun-type (x . elem-of . A) (B . $ . x))))を@(math (abs x b))と定義する。 19 | } 20 | @list-item{ 21 | 関数@(math (f . elem-of . (d-fun-type (x . elem-of . A) (B . $ . x))))を@(math ((f . $ . x) . def-eq . b))と定義する。 22 | } 23 | @list-item{ 24 | @(math (x . elem-of . A))を要素とする。要素@(math ((f . $ . x) . elem-of . (B . $ . x)))を@(math b)と定義する。 25 | } 26 | ] 27 | 最後の記法において、@(math f)の引数のリストに現れない仮定は@(math f)の暗黙的引数(@ref["000J"])と解釈する。 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /src-0/node-003B.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \begin{myBlock}{003B}{myExample} 6 | \myInlineMath{i}を階数、 7 | \myInlineMath{A, B \myElemOf \myNatAlg{i}}を\myInlineMath{\myNat}代数とする。 8 | \myInlineMath{A}上の\myInlineMath{\myNat}代数 9 | \myInlineMath{A^{\myBaseChange}B \myElemOf \myNatAlgOver{A}}を 10 | 次のように定義する。 11 | \begin{itemize} 12 | \item \myInlineMath{\myNatAlgOverCarrier \myDefEq 13 | \myAbs{x}{B \myRecordField \myNatAlgCarrier}} 14 | \item \myInlineMath{\myNatAlgOverZero \myDefEq 15 | B \myRecordField \myNatAlgZero} 16 | \item \myInlineMath{\myNatAlgOverSucc \myDefEq 17 | \myAbs{x y}{(B \myRecordField \myNatAlgSucc)\myAppParen{y}}} 18 | \end{itemize} 19 | 定義から\myInlineMath{\myNatSection{A^{\myBaseChange}B} \myDefEq 20 | \myNatHom{A}{B}}である。 21 | \end{myBlock} 22 | 23 | \end{document} 24 | -------------------------------------------------------------------------------- /src/0072.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/markup/corollary.rkt" 4 | "lib/markup/proof.rkt" 5 | "lib/math.rkt" 6 | "lib/math/cat.rkt" 7 | "lib/math/presheaf.rkt") 8 | 9 | (define i "i") 10 | (define C "C") 11 | (define A "A") 12 | (define B "B") 13 | (define f "f") 14 | (define x "x") 15 | (define a "a") 16 | 17 | @corollary[ 18 | #:id (current-id) 19 | @paragraph{ 20 | 関数外延性を仮定する。@(math i)を階数、@(math (C . elem-of . (precat . $ . i)))を前圏、@(math (A B . elem-of* . (presheaf-cat . $ . C)))を前層、@(math (f . elem-of . (cat:map . $* . A B)))を射とする。次は論理的に同値である。 21 | @ordered-list[ 22 | @list-item{@(math f)は@(math (presheaf-cat . $ . C))の射として同型である。} 23 | @list-item{任意の対象@(math (x . elem-of . C))に対して、関数@(math ((abs a (f . $ . a)) . elem-of . ((A . $ . x) . fun-type . (B . $ . x))))は同値である。} 24 | ] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /src/004V.rkt: -------------------------------------------------------------------------------- 1 | #lang morg 2 | 3 | (require "lib/math.rkt" 4 | (prefix-in l: "lib/math/paren-level.rkt") 5 | morg/math) 6 | 7 | (define times/symb (macro "times")) 8 | (define times 9 | (binary #:level l:* times/symb)) 10 | 11 | (define a "a") 12 | (define a1 (a . _ . "1")) 13 | (define a2 (a . _ . "2")) 14 | (define a3 (a . _ . "3")) 15 | 16 | @section[ 17 | #:id (current-id) 18 | #:title @%{構造同一原理} 19 | @paragraph{ 20 | @ref["0022"]で構造同一原理の例をいくつか見たが、群や環などの数学的に興味深い構造については後回しにしていた。これは、型理論において「@(math (a1 . id-type . a2))」は単なる型なので公理を適切に記述するためには@ref["003Z"]の意味での命題の概念が必要だからである。例えば、ある二項演算@(math times/symb)の結合律を素直に@(math (((a1 . times . a2) . times . a3) . id-type . (a1 . times . (a2 . times . a3))))と書くと、これは公理というよりも構造の一部になってしまう。結合律を適切に公理として扱うためには、同一視型が命題であることを要請すればよい。 21 | } 22 | (include-part "004W.rkt") 23 | (include-part "004Y.rkt") 24 | ] 25 | -------------------------------------------------------------------------------- /src-0/node-000B-record.tex: -------------------------------------------------------------------------------- 1 | \documentclass[index]{subfiles} 2 | 3 | \begin{document} 4 | 5 | \mySection{000B}{レコード型} 6 | 7 | \emph{レコード型}は構造を記述するのに便利な型である。 8 | 本書では、組み込み型としては単位型と対型を導入し、 9 | レコード型は記法として実現する。 10 | これは体系を単純なものに抑えるためである。 11 | 12 | \subfile{node-000K-unit-rule} 13 | \subfile{node-000L-pair-rule} 14 | \subfile{node-000M-simple-pair} 15 | \subfile{node-000N-pair-notation} 16 | \subfile{node-0014-curry} 17 | \subfile{node-0015-curry-iso} 18 | \subfile{node-0016-associativity} 19 | \subfile{node-0017-associativity-iso} 20 | \subfile{node-0018-symmetry} 21 | \subfile{node-0019-symmetry-iso} 22 | \subfile{node-001A-distributive} 23 | \subfile{node-001B-distributive-iso} 24 | \subfile{node-002M-diagonal} 25 | \subfile{node-000O-record-notation} 26 | \subfile{node-000W-large-record} 27 | \subfile{node-001T-logical-equivalence} 28 | \subfile{node-001U} 29 | 30 | \end{document} 31 | --------------------------------------------------------------------------------