SlideShare a Scribd company logo
A very brief introduction to 
Homotopy Type Theory
The Institute for Advanced Study in Princeton, in my opinion, has ruined more good scientists than any institution has 
created, judged by what they did before they came and judged by what they did after. Not that they weren't good 
afterwards, but they were superb before they got there and were only good afterwards. 
-- Richard Hamming
Vladimir Voevodsky 
• Cutting-edge Math so complex probability 
of mistake in any given proof very high 
• Automated proof checking the present 
and future of Math 
• Video: 
Univalent Foundations: New 
Foundations of Mathematics 
http://video.ias.edu/node/6395
Frege  Martin-Löf  Voevodsky 
• Gottlob Frege, active 1879 – 1923 
works in logic, foundations of arithmetic, and philosophy 
• Per Martin-Löf 
An Intuitionistic Theory of Types, 1975 
• Vladimir Voevodsky 
A very short note on the homotopy λ-calculus, 2006 
• Institute for Advanced Study 
Homotopy Type Theory: Univalent Foundation of Mathematics, 2013 
a.k.a. The HoTT Book
Every-thing has a type 
• Objects are types 
• Propositions are types 
• Functions are types 
• Proofs are types
A theory of rules and no axioms 
(For our purposes. There are 2 axioms in higher homotopy type theory) 
• “axioms” appear when we introduce concrete types 
• The game is to manipulate concrete types and elements with the rules 
• i.e. Type Theory provides an algebra over types
a:A ”a is of type A ” 
• Type theory is a deductive system based on 2 forms of judgment 
• ”a is of type A ” is the most basic form of judgment 
• Construction of a proposition is a proof in intuitionistic mathematics
Equality has special cases 
• Judgmental equality a :≡ b is a “witness” 
• p : a =A b is a proposition (and of course a type) 
• p-1 : b =A a is a different type (we will come back to this)
Universes and families 
• Universe : a type whose elements are types 
• U0 : U1 : U2 : … 
• Every type belongs to some universe A : Ui 
• A family of types: type B varying over a type A 
B : A  U 
indicates the universe U is the codomain 
note this is a simple function signature
0 : U the type that is not 
• False, ⊥, bottom 
• You cannot construct it 
• Hence it does not exist. Anything can derive from it. 
ex falso quodlibit
1 : U unit 
• True, ⊤, top, () 
• Always the same 
one-valued logic 
• C family of languages oddly names this type “void”
2 : U boolean 
• 2-valued logic 
highest n-valued fully consistent logic 
• Can be derived as a special case of coproduct / summation type
Infinite types 
• E.g. Natural numbers 
which have a special place in practical application 
• Defined recursively
A  B function type 
• Signature matters to define type 
not the body of function
Exercise: 
• Construct a theorem of function equivalence 
( f = g )
Exercise: 
• Construct a theorem of function equivalence 
( f = g ) 
• Trick exercise…we will come back to this
A + B : U Coproduct type 
• a.k.a. Summation type 
F# discriminated union 
• To construct the function A + B  C 
requires the functions 
A  C 
B  C
A x B : U Product type 
• Tuple, Cartesian product
Introducing types 
• Formation rule 
e.g. you can form A  B when A is a type and B is a type 
• Introduction rule (a.k.a. constructor) 
e.g. functions have one constructor, λ-abstraction 
• Elimination rule 
how to use elements of type, e.g. function application 
• Uniqueness principle (optional, a.k.a. η-expansion) 
unique maps into and out of type (e.g. coproduct)
Lots of other types 
• E.g. Lists 
which of course are defined recursively 
• Not so important from the standpoint of theory 
because we can construct them from what we have…
EXCEPT…
Π(x:A)B(x) Dependent Functions 
• Type of output depends on element of input 
not the type of input 
hence, not just a “parameterized function” 
• Normal function is a special case 
resulting type family a constant type
Σ(x:A)B(x) Dependent pair type 
• Second element depends on a dependently typed function on first 
• Example: 
1, 10 
2, “I am a string”
Logical operations, represented in types 
• True 1 
• False 0 
• A and B A x B 
• A or B A + B 
• If A then B A  B 
• A if and only if B (A  B) x (B  A) 
• Not A A  0
Predicate logic in type theory 
• For all x 
∀x corresponds to Π(x:A)P(x) 
• There exists x 
∃x corresponds to Σ(x:A)P(x)
Connection to computability 
• Constructive logic confines itself to that which can be effectively 
constructed by computation 
• It does not include Law of Excluded Middle or Proof by Contradiction 
• In general the tautologies of classical logic involving NOT cannot be 
constructed
IdA(a,b) Indentity function 
• Has special importance in type theory 
IdA(a,b) type representing proposition of equality 
p : a =A b 
a = b (shorthand) 
refl : Π(a:A)(a=Aa)reflexivity 
• Homotopy Type Theory – 
there is a path between equals 
reflexivity is an infinitesimally short path from self to self 
paths are types (inverse path is not the same type)
Fundamental “Mathy” Properties of Path 
• Reflexivity 
constant path, e.g. identity 
• Symmetry 
paths can be reversed (a =A b)  (b =A a) 
• Transitivity 
concatenation of paths
Operations on paths 
• Identity (fundamental compositional element) 
• Associativity 
(p ∙ q) ∙ r = p ∙ (q ∙ r) 
• Transitivity 
p ∙ p-1 = Id(p)
…but equalities are proofs 
• So paths are proofs p : x =A y 
• The equivalence of 2 paths (proofs) is called a homotopy 
• And equality of proofs can have proofs 
p' : p =x=Ay q Paths between paths (i.e. equality of paths) 
• And these are all types 
• It’s turtles all the way down (equivalences of paths)
Exercise: 
• Why do paths have direction?
Exercise: 
• Why do paths have direction? 
• A space X is a set of points with a topology 
• x =A y can be seen as giving a point in X at each “moment in time” 
• More intuitively, proofs are directional
The Fundamental Theorem of Type Theory 
• Induction principal for identity types 
• Similar to 2 step number theory induction (prove base case, prove a step) 
• Except there is only one step to prove 
• To prove a statement (or construct an object) that depends on path 
identity, 
p: x = A y 
it suffices to prove (or construct) the special case where x and y are the 
same. p is thus the reflexivity element. 
• “by induction it suffices to assume…”
Axiom of function extensionality 
• (f = g) ⋍ Π(x:A)(f(x) =B(x) g(x)) 
2 functions that are pointwise equal, would be equal 
a path in a function space would be a continuous homotopy 
…but basic type theory is insufficient to prove this 
• Axiom: there is a certain function 
happly : (f = g)  Π(x:A)(f(x) = B(x)g(x))
Exercise: 
• Why is function extensionality an axiom?
Axiom of univalence 
• Lemma: for types A,B : U, there is a certain function 
idtoeqv : (A =U B)  (A ⋍ B) 
• Axiom (univalence): for any A,B : U, the function idtoeqv is 
an equivalence, 
(A =U B) ⋍ (A ⋍ B)
More exercises (from the Hott Book): 
• 2.4 – Define, by induction on n, a general notion of n-dimensional 
path in a type A, simultaneously with the type of boundaries for such 
paths.
More exercises (from the Hott Book): 
• 1.15 – Show the indiscernibility of identicals follows from path 
induction.
More exercises (from the Hott Book): 
• 1.14 – Why do the induction principles for identity types not allow us 
to construct a function f : Π(x:A) Π(p:x=x)(p= reflx) 
with the defining equation f(x, reflx) :≡ reflreflx 
?

More Related Content

What's hot

プログラムを高速化する話
プログラムを高速化する話プログラムを高速化する話
プログラムを高速化する話
京大 マイコンクラブ
 
圏とHaskellの型
圏とHaskellの型圏とHaskellの型
圏とHaskellの型
KinebuchiTomo
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介
Masahiro Sakai
 
パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化Miyoshi Yuya
 
Neural Processes Family
Neural Processes FamilyNeural Processes Family
Neural Processes Family
Kota Matsui
 
自由エネルギー原理(FEP)とはなにか 20190211
自由エネルギー原理(FEP)とはなにか 20190211自由エネルギー原理(FEP)とはなにか 20190211
自由エネルギー原理(FEP)とはなにか 20190211
Masatoshi Yoshida
 
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
Masahiro Sakai
 
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
kiki utagawa
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組み
Masahiro Sakai
 
大規模ネットワークの性質と先端グラフアルゴリズム
大規模ネットワークの性質と先端グラフアルゴリズム大規模ネットワークの性質と先端グラフアルゴリズム
大規模ネットワークの性質と先端グラフアルゴリズムTakuya Akiba
 
充足可能性問題のいろいろ
充足可能性問題のいろいろ充足可能性問題のいろいろ
充足可能性問題のいろいろ
Hiroshi Yamashita
 
モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化
Yusuke Uchida
 
Coqチュートリアル
CoqチュートリアルCoqチュートリアル
Coqチュートリアル
Yoshihiro Mizoguchi
 
4 データ間の距離と類似度
4 データ間の距離と類似度4 データ間の距離と類似度
4 データ間の距離と類似度
Seiichi Uchida
 
マルコフ過程とその応用
マルコフ過程とその応用マルコフ過程とその応用
マルコフ過程とその応用
Ryuichi Matsumoto
 
チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019
cocodrips
 
Quick Search algorithm and strstr
Quick Search algorithm and strstrQuick Search algorithm and strstr
Quick Search algorithm and strstr
MITSUNARI Shigeo
 
行列計算を利用したデータ解析技術
行列計算を利用したデータ解析技術行列計算を利用したデータ解析技術
行列計算を利用したデータ解析技術
Yoshihiro Mizoguchi
 
【解説】 一般逆行列
【解説】 一般逆行列【解説】 一般逆行列
【解説】 一般逆行列
Kenjiro Sugimoto
 
安全性を証明するために知っておくべき4つのこと
安全性を証明するために知っておくべき4つのこと安全性を証明するために知っておくべき4つのこと
安全性を証明するために知っておくべき4つのことshibataka000
 

What's hot (20)

プログラムを高速化する話
プログラムを高速化する話プログラムを高速化する話
プログラムを高速化する話
 
圏とHaskellの型
圏とHaskellの型圏とHaskellの型
圏とHaskellの型
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介
 
パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化
 
Neural Processes Family
Neural Processes FamilyNeural Processes Family
Neural Processes Family
 
自由エネルギー原理(FEP)とはなにか 20190211
自由エネルギー原理(FEP)とはなにか 20190211自由エネルギー原理(FEP)とはなにか 20190211
自由エネルギー原理(FEP)とはなにか 20190211
 
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
 
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
Pythonの処理系はどのように実装され,どのように動いているのか? 我々はその実態を調査すべくアマゾンへと飛んだ.
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組み
 
大規模ネットワークの性質と先端グラフアルゴリズム
大規模ネットワークの性質と先端グラフアルゴリズム大規模ネットワークの性質と先端グラフアルゴリズム
大規模ネットワークの性質と先端グラフアルゴリズム
 
充足可能性問題のいろいろ
充足可能性問題のいろいろ充足可能性問題のいろいろ
充足可能性問題のいろいろ
 
モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化
 
Coqチュートリアル
CoqチュートリアルCoqチュートリアル
Coqチュートリアル
 
4 データ間の距離と類似度
4 データ間の距離と類似度4 データ間の距離と類似度
4 データ間の距離と類似度
 
マルコフ過程とその応用
マルコフ過程とその応用マルコフ過程とその応用
マルコフ過程とその応用
 
チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019
 
Quick Search algorithm and strstr
Quick Search algorithm and strstrQuick Search algorithm and strstr
Quick Search algorithm and strstr
 
行列計算を利用したデータ解析技術
行列計算を利用したデータ解析技術行列計算を利用したデータ解析技術
行列計算を利用したデータ解析技術
 
【解説】 一般逆行列
【解説】 一般逆行列【解説】 一般逆行列
【解説】 一般逆行列
 
安全性を証明するために知っておくべき4つのこと
安全性を証明するために知っておくべき4つのこと安全性を証明するために知っておくべき4つのこと
安全性を証明するために知っておくべき4つのこと
 

Viewers also liked

SIAMSEAS2015
SIAMSEAS2015SIAMSEAS2015
SIAMSEAS2015
Ogugua Onyejekwe
 
Earth Day 2014
Earth Day 2014Earth Day 2014
Earth Day 2014
Daina Lujan
 
Ta plスライド第4章
Ta plスライド第4章Ta plスライド第4章
Ta plスライド第4章Kyoko Kadowaki
 
ネット検索をしなくなる時代
ネット検索をしなくなる時代ネット検索をしなくなる時代
ネット検索をしなくなる時代
Masakazu Mito
 
PPL2016-9-3
PPL2016-9-3PPL2016-9-3
PPL2016-9-3
Kyoko Kadowaki
 
Agda による型推論器の定式化
Agda による型推論器の定式化Agda による型推論器の定式化
Agda による型推論器の定式化
Kyoko Kadowaki
 
ホモトピー型理論入門
ホモトピー型理論入門ホモトピー型理論入門
ホモトピー型理論入門
k h
 
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ
Yusuke Matsushita
 
MANAGEMENT BY OBJECTIVES (MBO)
MANAGEMENT BY OBJECTIVES (MBO)MANAGEMENT BY OBJECTIVES (MBO)
MANAGEMENT BY OBJECTIVES (MBO)
Mr.Yes!
 

Viewers also liked (10)

SIAMSEAS2015
SIAMSEAS2015SIAMSEAS2015
SIAMSEAS2015
 
Earth Day 2014
Earth Day 2014Earth Day 2014
Earth Day 2014
 
Ta plスライド第4章
Ta plスライド第4章Ta plスライド第4章
Ta plスライド第4章
 
Hott_1
Hott_1Hott_1
Hott_1
 
ネット検索をしなくなる時代
ネット検索をしなくなる時代ネット検索をしなくなる時代
ネット検索をしなくなる時代
 
PPL2016-9-3
PPL2016-9-3PPL2016-9-3
PPL2016-9-3
 
Agda による型推論器の定式化
Agda による型推論器の定式化Agda による型推論器の定式化
Agda による型推論器の定式化
 
ホモトピー型理論入門
ホモトピー型理論入門ホモトピー型理論入門
ホモトピー型理論入門
 
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ
 
MANAGEMENT BY OBJECTIVES (MBO)
MANAGEMENT BY OBJECTIVES (MBO)MANAGEMENT BY OBJECTIVES (MBO)
MANAGEMENT BY OBJECTIVES (MBO)
 

Similar to Intoduction to Homotopy Type Therory

Type Theory and Practical Application
Type Theory and Practical ApplicationType Theory and Practical Application
Type Theory and Practical Application
Jack Fox
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
SURBHI SAROHA
 
Thinking with shapes
Thinking with shapesThinking with shapes
Thinking with shapes
Brendan Larvor
 
Formal methods 7 - category theory
Formal methods   7 - category theoryFormal methods   7 - category theory
Formal methods 7 - category theory
Vlad Patryshev
 
Module_5_1.pptx
Module_5_1.pptxModule_5_1.pptx
Module_5_1.pptx
DrKalaavathiBuvanesh
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
Nitesh Singh
 
First Order Logic in Discrete Math Presentation
First Order Logic in Discrete Math PresentationFirst Order Logic in Discrete Math Presentation
First Order Logic in Discrete Math Presentation
Ferry Wahyu Wibowo
 
Logic
LogicLogic
App a
App aApp a
Probability statistics assignment help
Probability statistics assignment helpProbability statistics assignment help
Probability statistics assignment help
HomeworkAssignmentHe
 
Elements of functional programming
Elements of functional programmingElements of functional programming
Elements of functional programming
Sajjad Ali Pulikkanat
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional Logic
ArchanaT32
 
Fis2010 0823
Fis2010 0823Fis2010 0823
Fis2010 0823
Koji Sawa
 
Transform as a vector? Tying functional parity with rotation angle of coordin...
Transform as a vector? Tying functional parity with rotation angle of coordin...Transform as a vector? Tying functional parity with rotation angle of coordin...
Transform as a vector? Tying functional parity with rotation angle of coordin...
SayakBhattacharjee4
 
Fuzzy Logic_HKR
Fuzzy Logic_HKRFuzzy Logic_HKR
Fuzzy Logic_HKR
Hirak Kr. Roy
 
Chapter10
Chapter10Chapter10
Logicrevo15
Logicrevo15Logicrevo15
Logicrevo15
Moshe Vardi
 
Finite mathematics
Finite mathematicsFinite mathematics
Finite mathematics
Igor Rivin
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
Istiak Ahmed
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
Istiak Ahmed
 

Similar to Intoduction to Homotopy Type Therory (20)

Type Theory and Practical Application
Type Theory and Practical ApplicationType Theory and Practical Application
Type Theory and Practical Application
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
Thinking with shapes
Thinking with shapesThinking with shapes
Thinking with shapes
 
Formal methods 7 - category theory
Formal methods   7 - category theoryFormal methods   7 - category theory
Formal methods 7 - category theory
 
Module_5_1.pptx
Module_5_1.pptxModule_5_1.pptx
Module_5_1.pptx
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
First Order Logic in Discrete Math Presentation
First Order Logic in Discrete Math PresentationFirst Order Logic in Discrete Math Presentation
First Order Logic in Discrete Math Presentation
 
Logic
LogicLogic
Logic
 
App a
App aApp a
App a
 
Probability statistics assignment help
Probability statistics assignment helpProbability statistics assignment help
Probability statistics assignment help
 
Elements of functional programming
Elements of functional programmingElements of functional programming
Elements of functional programming
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional Logic
 
Fis2010 0823
Fis2010 0823Fis2010 0823
Fis2010 0823
 
Transform as a vector? Tying functional parity with rotation angle of coordin...
Transform as a vector? Tying functional parity with rotation angle of coordin...Transform as a vector? Tying functional parity with rotation angle of coordin...
Transform as a vector? Tying functional parity with rotation angle of coordin...
 
Fuzzy Logic_HKR
Fuzzy Logic_HKRFuzzy Logic_HKR
Fuzzy Logic_HKR
 
Chapter10
Chapter10Chapter10
Chapter10
 
Logicrevo15
Logicrevo15Logicrevo15
Logicrevo15
 
Finite mathematics
Finite mathematicsFinite mathematics
Finite mathematics
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
 

More from Jack Fox

Dependent Types make bad data unrepresentable
Dependent Types make bad data unrepresentableDependent Types make bad data unrepresentable
Dependent Types make bad data unrepresentable
Jack Fox
 
Dependent Types
Dependent TypesDependent Types
Dependent Types
Jack Fox
 
Introduction to the lambda calculus
Introduction to the lambda calculusIntroduction to the lambda calculus
Introduction to the lambda calculus
Jack Fox
 
Tools for reading papers
Tools for reading papersTools for reading papers
Tools for reading papers
Jack Fox
 
Functional programming for production quality code
Functional programming for production quality codeFunctional programming for production quality code
Functional programming for production quality code
Jack Fox
 
F# for functional enthusiasts
F# for functional enthusiastsF# for functional enthusiasts
F# for functional enthusiasts
Jack Fox
 
Semantically coherent functional linear data structures
Semantically coherent functional linear data structuresSemantically coherent functional linear data structures
Semantically coherent functional linear data structures
Jack Fox
 
Linear structures lightning talk
Linear structures lightning talkLinear structures lightning talk
Linear structures lightning talk
Jack Fox
 
Functional linear data structures in f#
Functional linear data structures in f#Functional linear data structures in f#
Functional linear data structures in f#
Jack Fox
 

More from Jack Fox (9)

Dependent Types make bad data unrepresentable
Dependent Types make bad data unrepresentableDependent Types make bad data unrepresentable
Dependent Types make bad data unrepresentable
 
Dependent Types
Dependent TypesDependent Types
Dependent Types
 
Introduction to the lambda calculus
Introduction to the lambda calculusIntroduction to the lambda calculus
Introduction to the lambda calculus
 
Tools for reading papers
Tools for reading papersTools for reading papers
Tools for reading papers
 
Functional programming for production quality code
Functional programming for production quality codeFunctional programming for production quality code
Functional programming for production quality code
 
F# for functional enthusiasts
F# for functional enthusiastsF# for functional enthusiasts
F# for functional enthusiasts
 
Semantically coherent functional linear data structures
Semantically coherent functional linear data structuresSemantically coherent functional linear data structures
Semantically coherent functional linear data structures
 
Linear structures lightning talk
Linear structures lightning talkLinear structures lightning talk
Linear structures lightning talk
 
Functional linear data structures in f#
Functional linear data structures in f#Functional linear data structures in f#
Functional linear data structures in f#
 

Recently uploaded

Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
European Sustainable Phosphorus Platform
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
KrushnaDarade1
 
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
University of Maribor
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
terusbelajar5
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
PRIYANKA PATEL
 
Basics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different formsBasics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different forms
MaheshaNanjegowda
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Texas Alliance of Groundwater Districts
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
Abdul Wali Khan University Mardan,kP,Pakistan
 
Immersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths ForwardImmersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths Forward
Leonel Morgado
 
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
Advanced-Concepts-Team
 
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
MAGOTI ERNEST
 
Oedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptxOedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptx
muralinath2
 
20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx
Sharon Liu
 
The cost of acquiring information by natural selection
The cost of acquiring information by natural selectionThe cost of acquiring information by natural selection
The cost of acquiring information by natural selection
Carl Bergstrom
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
Sérgio Sacani
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
HongcNguyn6
 

Recently uploaded (20)

Thornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdfThornton ESPP slides UK WW Network 4_6_24.pdf
Thornton ESPP slides UK WW Network 4_6_24.pdf
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
 
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
 
Basics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different formsBasics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different forms
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
 
Immersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths ForwardImmersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths Forward
 
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
 
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxThe use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptx
 
Oedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptxOedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptx
 
20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx20240520 Planning a Circuit Simulator in JavaScript.pptx
20240520 Planning a Circuit Simulator in JavaScript.pptx
 
The cost of acquiring information by natural selection
The cost of acquiring information by natural selectionThe cost of acquiring information by natural selection
The cost of acquiring information by natural selection
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
 

Intoduction to Homotopy Type Therory

  • 1. A very brief introduction to Homotopy Type Theory
  • 2. The Institute for Advanced Study in Princeton, in my opinion, has ruined more good scientists than any institution has created, judged by what they did before they came and judged by what they did after. Not that they weren't good afterwards, but they were superb before they got there and were only good afterwards. -- Richard Hamming
  • 3. Vladimir Voevodsky • Cutting-edge Math so complex probability of mistake in any given proof very high • Automated proof checking the present and future of Math • Video: Univalent Foundations: New Foundations of Mathematics http://video.ias.edu/node/6395
  • 4. Frege  Martin-Löf  Voevodsky • Gottlob Frege, active 1879 – 1923 works in logic, foundations of arithmetic, and philosophy • Per Martin-Löf An Intuitionistic Theory of Types, 1975 • Vladimir Voevodsky A very short note on the homotopy λ-calculus, 2006 • Institute for Advanced Study Homotopy Type Theory: Univalent Foundation of Mathematics, 2013 a.k.a. The HoTT Book
  • 5.
  • 6. Every-thing has a type • Objects are types • Propositions are types • Functions are types • Proofs are types
  • 7. A theory of rules and no axioms (For our purposes. There are 2 axioms in higher homotopy type theory) • “axioms” appear when we introduce concrete types • The game is to manipulate concrete types and elements with the rules • i.e. Type Theory provides an algebra over types
  • 8. a:A ”a is of type A ” • Type theory is a deductive system based on 2 forms of judgment • ”a is of type A ” is the most basic form of judgment • Construction of a proposition is a proof in intuitionistic mathematics
  • 9. Equality has special cases • Judgmental equality a :≡ b is a “witness” • p : a =A b is a proposition (and of course a type) • p-1 : b =A a is a different type (we will come back to this)
  • 10. Universes and families • Universe : a type whose elements are types • U0 : U1 : U2 : … • Every type belongs to some universe A : Ui • A family of types: type B varying over a type A B : A  U indicates the universe U is the codomain note this is a simple function signature
  • 11. 0 : U the type that is not • False, ⊥, bottom • You cannot construct it • Hence it does not exist. Anything can derive from it. ex falso quodlibit
  • 12. 1 : U unit • True, ⊤, top, () • Always the same one-valued logic • C family of languages oddly names this type “void”
  • 13. 2 : U boolean • 2-valued logic highest n-valued fully consistent logic • Can be derived as a special case of coproduct / summation type
  • 14. Infinite types • E.g. Natural numbers which have a special place in practical application • Defined recursively
  • 15. A  B function type • Signature matters to define type not the body of function
  • 16. Exercise: • Construct a theorem of function equivalence ( f = g )
  • 17. Exercise: • Construct a theorem of function equivalence ( f = g ) • Trick exercise…we will come back to this
  • 18. A + B : U Coproduct type • a.k.a. Summation type F# discriminated union • To construct the function A + B  C requires the functions A  C B  C
  • 19. A x B : U Product type • Tuple, Cartesian product
  • 20. Introducing types • Formation rule e.g. you can form A  B when A is a type and B is a type • Introduction rule (a.k.a. constructor) e.g. functions have one constructor, λ-abstraction • Elimination rule how to use elements of type, e.g. function application • Uniqueness principle (optional, a.k.a. η-expansion) unique maps into and out of type (e.g. coproduct)
  • 21. Lots of other types • E.g. Lists which of course are defined recursively • Not so important from the standpoint of theory because we can construct them from what we have…
  • 23. Π(x:A)B(x) Dependent Functions • Type of output depends on element of input not the type of input hence, not just a “parameterized function” • Normal function is a special case resulting type family a constant type
  • 24. Σ(x:A)B(x) Dependent pair type • Second element depends on a dependently typed function on first • Example: 1, 10 2, “I am a string”
  • 25. Logical operations, represented in types • True 1 • False 0 • A and B A x B • A or B A + B • If A then B A  B • A if and only if B (A  B) x (B  A) • Not A A  0
  • 26. Predicate logic in type theory • For all x ∀x corresponds to Π(x:A)P(x) • There exists x ∃x corresponds to Σ(x:A)P(x)
  • 27. Connection to computability • Constructive logic confines itself to that which can be effectively constructed by computation • It does not include Law of Excluded Middle or Proof by Contradiction • In general the tautologies of classical logic involving NOT cannot be constructed
  • 28. IdA(a,b) Indentity function • Has special importance in type theory IdA(a,b) type representing proposition of equality p : a =A b a = b (shorthand) refl : Π(a:A)(a=Aa)reflexivity • Homotopy Type Theory – there is a path between equals reflexivity is an infinitesimally short path from self to self paths are types (inverse path is not the same type)
  • 29. Fundamental “Mathy” Properties of Path • Reflexivity constant path, e.g. identity • Symmetry paths can be reversed (a =A b)  (b =A a) • Transitivity concatenation of paths
  • 30. Operations on paths • Identity (fundamental compositional element) • Associativity (p ∙ q) ∙ r = p ∙ (q ∙ r) • Transitivity p ∙ p-1 = Id(p)
  • 31. …but equalities are proofs • So paths are proofs p : x =A y • The equivalence of 2 paths (proofs) is called a homotopy • And equality of proofs can have proofs p' : p =x=Ay q Paths between paths (i.e. equality of paths) • And these are all types • It’s turtles all the way down (equivalences of paths)
  • 32. Exercise: • Why do paths have direction?
  • 33. Exercise: • Why do paths have direction? • A space X is a set of points with a topology • x =A y can be seen as giving a point in X at each “moment in time” • More intuitively, proofs are directional
  • 34. The Fundamental Theorem of Type Theory • Induction principal for identity types • Similar to 2 step number theory induction (prove base case, prove a step) • Except there is only one step to prove • To prove a statement (or construct an object) that depends on path identity, p: x = A y it suffices to prove (or construct) the special case where x and y are the same. p is thus the reflexivity element. • “by induction it suffices to assume…”
  • 35. Axiom of function extensionality • (f = g) ⋍ Π(x:A)(f(x) =B(x) g(x)) 2 functions that are pointwise equal, would be equal a path in a function space would be a continuous homotopy …but basic type theory is insufficient to prove this • Axiom: there is a certain function happly : (f = g)  Π(x:A)(f(x) = B(x)g(x))
  • 36. Exercise: • Why is function extensionality an axiom?
  • 37. Axiom of univalence • Lemma: for types A,B : U, there is a certain function idtoeqv : (A =U B)  (A ⋍ B) • Axiom (univalence): for any A,B : U, the function idtoeqv is an equivalence, (A =U B) ⋍ (A ⋍ B)
  • 38. More exercises (from the Hott Book): • 2.4 – Define, by induction on n, a general notion of n-dimensional path in a type A, simultaneously with the type of boundaries for such paths.
  • 39. More exercises (from the Hott Book): • 1.15 – Show the indiscernibility of identicals follows from path induction.
  • 40. More exercises (from the Hott Book): • 1.14 – Why do the induction principles for identity types not allow us to construct a function f : Π(x:A) Π(p:x=x)(p= reflx) with the defining equation f(x, reflx) :≡ reflreflx ?