SlideShare a Scribd company logo
Eliminators into dependent types
Dmytro Mitin
https://stepik.org/course/Introduction-to-programming-
with-dependent-types-in-Scala-2294/
March 2017
Dmytro Mitin Eliminators into dependent types
Empty type
Eliminator into type C
Γ C : ∗
Γ, x : 0 abortC x : C
Eliminator into dependent type C
Γ, u : 0 C : ∗
Γ, x : 0 abortC x : C[u ← x]
ind0 ≡ abort :
C:0→∗ x:0
C(x)
abort(C) ≡ C
Dmytro Mitin Eliminators into dependent types
Unit type
Eliminator into type C
Γ c : C
Γ, x : 1 case1(c)(x) : C
x match { case () => c }
Eliminator into dependent type C
Γ, u : 1 C : ∗ Γ c : C[u ← 1]
Γ, x : 1 case1(λu.C)(c)(x) : C[u ← x]
ind1 ≡ case1 :
C:1→∗
C(1) →
x:1
C(x)
case1(C, c, 1) ≡ c
Dmytro Mitin Eliminators into dependent types
Sum type
Eliminator into type C
Γ C : ∗ Γ, a : A c1 : C Γ, b : B c2 : C
Γ, s : A + B case+(λa.c1, λb.c2)(s) : C
s match { case Inl(a) => c1(a); case Inr(b) => c2(b) }
Eliminator into dependent type C
Γ, u : A + B C : ∗
Γ, a : A c1 : C[u ← inl a] Γ, b : B c2 : C[u ← inr b]
Γ, s : A + B case+(λu.C)(λa.c1, λb.c2)(s) : C[u ← s]
ind+ ≡ case+ :
C:A+B→∗ a:A
C(inl a) ×
b:B
C(inr b) →
s:A+B
C(s)
case+(C, f , g, inl a) ≡ f (a)
case+(C, f , g, inr b) ≡ g(b)
Dmytro Mitin Eliminators into dependent types
Product type
Eliminators into types A and B
Γ p : A × B
Γ fst p : A
Γ p : A × B
Γ snd p : B
Eliminator into dependent type C
Γ, u : A × B C : ∗ Γ, a : A, b : B c : C[u ← (a, b)]
Γ, p : A × B c[a ← fst p, b ← snd p]
≡ case×(λu.C)(λab.c)(p)
: C[u ← p]
ind× ≡ case× :
C:A×B→∗ a:A b:B
C(a, b) →
p:A×B
C(p)
case×(C, f , (a, b)) ≡ f (a)(b)
Dmytro Mitin Eliminators into dependent types
Function type
Eliminators into type B
Γ f : A → B Γ a : A
Γ f a : B
Higher-order eliminator[1] [2] [3] into dependent type C
Γ, u : A → B C : ∗
(Γ, x : A b : B) c : C[u ← λx.b]
Γ, g : A → B c : C[u ← λ(g)]
Γ, f : A → B caseΠ(λu.C) λg.c (f ) : C[u ← f ]
funsplit ≡ ind→ ≡ case→ :
C:(A→B)→∗ g:A→B
C(λx.b) →
f :A→B
C(f )
case→(C, h, λx.b) ≡ h(λx.b)
Dmytro Mitin Eliminators into dependent types
Dependent pair type (Σ-type)
Eliminators into types A and B
Γ p :
x:A
B
Γ fst p : A
Γ p :
x:A
B
Γ snd p : B[x ← fst p]
Eliminator into dependent type C
Γ, u :
x:A
B C : ∗ Γ, a : A, b : B[u ← a] c : C[u ← (a, b)]
Γ, p :
x:A
B c[a ← fst p, b ← snd p]
≡ caseΣ(λu.C)(λab.c)(p)
: C[u ← p]
split ≡ indΣ ≡ caseΣ :
C:
x:A
B(x)→∗ a:A b:B(a)
C(a, b) →
p:
x:A
B(x)
C(p)
caseΣ(C, f , (a, b)) ≡ f (a)(b)
Dmytro Mitin Eliminators into dependent types
Dependent function type (Π-type)
Eliminators into type B
Γ f :
x:A
B Γ a : A
Γ f a : B[x ← a]
Higher-order eliminator[1] [2] [3] into dependent type C
Γ, u :
x:A
B C : ∗ (Γ, x : A b : B) c : C[u ← λx.b]
Γ, g :
x:A
B c : C[u ← λ(g)]
Γ, f :
x:A
B caseΠ(λu.C) λg.c (f ) : C[u ← f ]
funsplit ≡ indΠ ≡ caseΠ :
C:
x:A
B(x)→∗ g:
x:A
B(x)
C(λx.b) →
f :
x:A
B(x)
C(f )
caseΠ(C, h, λx.b) ≡ h(λx.b)
Dmytro Mitin Eliminators into dependent types
Boolean type
Eliminator into type C
Γ c1 : C Γ c2 : C
Γ, x : Bool if(c1, c2)(x) : C
x match { case True => c1; case False => c2 }
Eliminator into dependent type C
Γ, u : Bool C : ∗ Γ c1 : C[u ← true] Γ c2 : C[u ← false]
Γ, x : Bool if(c1, c2)(x)
caseBool(λu.C)(c1,c2)(x)
: C[u ← x]
indBool ≡ caseBool :
C:Bool→∗
C(true) × C(false) →
x:Bool
C(x)
caseBool(C, c1, c2, true) ≡ c1
caseBool(C, c1, c2, false) ≡ c2
Dmytro Mitin Eliminators into dependent types
Type of natural numbers
Eliminator into type C
Γ c1 : C Γ, n : Nat c2 : C
Γ, x : Nat caseNat(c1, λn.c2)(x) : C
x match { case Zero => c1; case Suc(n) => c2(n) }
Eliminator into dependent type C
Γ, u : Nat C : ∗ Γ c1 : C[u ← zero]
Γ, n : Nat, c : C[u ← n] c2 : C[u ← suc n]
Γ, x : Nat caseNat(λu.C)(c1, λnc.c2)(x) : C[u ← x]
indNat ≡ caseNat :
C:Nat→∗
C(zero) ×
n:Nat
C(n) → C(suc n) →
x:Nat
C(x)
caseNat(C, c1, f , zero) ≡ c1
caseNat(C, c1, f , suc n) ≡ f (n)(caseNat(C, c1, f , n))
Dmytro Mitin Eliminators into dependent types
List type
Eliminator into type C
Γ c1 : C Γ, h : A, t : List A c2 : C
Γ, x : List A caseList(x)(c1, λht.c2) : C
x match { case Nil => c1; case Cons(h, t) => c2(h, t) }
Eliminator into dependent type C
Γ, u : List A C : ∗ Γ c1 : C[u ← nil]
Γ, h : A, t : List A, c : C[u ← t] c2 : C[u ← cons h t]
Γ, x : List A caseList(λu.C)(c1, λhtc.c2)(x) : C[u ← x]
indList ≡ caseList :
C:List A→∗
C(nil) ×
h:A t:List A
C(t) → C(cons h t) →
x:List A
C(x)
caseList(C, c1, f , nil) ≡ c1
caseList(C, c1, f , cons h t) ≡ f (h, t)(caseList(C, c1, f , t))
Dmytro Mitin Eliminators into dependent types
Type of fixed-length vectors
Eliminator into dependent type C
Γ, n : Nat, u : Vect n A C : ∗ Γ c1 : C[n ← zero, u ← nil]
Γ, h : A, m : Nat, t : Vect m A, c : C[n ← m, u ← t]
c2 : C[n ← suc m, u ← cons h t]
Γ, k : Nat, x : Vect k A
caseVect(λnu.C)(c1, λhmtc.c2)(k, x) : C[n ← k, u ← x]
indVect ≡ caseVect :
C:
n:Nat
(Vect n A→∗)
C(zero, nil) ×
h:A m:Nat t:Vect m A
C(m, t)
→ C(suc m, cons h t) →
x:
k:Nat
Vect k A
C(x)
caseVect C, c1, f , (zero, nil) ≡ c1
caseVect C, c1, f , (suc m, cons h t) ≡ f (h, m, t)(caseVect(C, c1, f , (m, t)))
Dmytro Mitin Eliminators into dependent types
Identity type
Eliminator into dependent type C
Γ, a1 : A, a2 : A, u : a1 =A a2 C : ∗
Γ, a : A c : C[a1 ← a, a2 ← a, u ← refl a]
Γ, a1 : A, a2 : A, x : a1 =A a2 caseId(λa1a2u.C)(λa.c)(λa1a2.x)
: C[a1 ← a1, a2 ← a2, u ← x]
J ≡ indId ≡ caseId :
C:
a1:A a2:A
(a1=Aa2→∗) a:A
C(a, a, refl a) →
a1:A a2:A x:a1=Aa2
C(a1, a2, x)
caseId(C, f , a, a, refl a) = f (a)
Dmytro Mitin Eliminators into dependent types

More Related Content

PPTX
Algebra booleana y fcc, fcd
PPTX
5.8 rectilinear motion
PPT
5.2 first and second derivative test
PPTX
5.5 optimization
PPT
5.7 rolle's thrm & mv theorem
PDF
March 4 and 5, 2009
PPT
4.5 tan and cot.ppt worked
PPT
4.5 sec and csc worked 3rd
Algebra booleana y fcc, fcd
5.8 rectilinear motion
5.2 first and second derivative test
5.5 optimization
5.7 rolle's thrm & mv theorem
March 4 and 5, 2009
4.5 tan and cot.ppt worked
4.5 sec and csc worked 3rd

What's hot (15)

PPTX
Num Integration
PPT
Graphing day 1 worked
PPTX
Numerical
PDF
Y11+gdc+maximize+your+use+of+the++ev+2
PPT
Properties real numbers basic
PPTX
PPTX
Chapter 4 review
PPT
Quadratic Functions
PPT
Period 4 Quadratic Funtions
PDF
Derivatives Lesson Oct 13
DOC
Karnaugh maps
PDF
AP Calculus Slides December 10, 2007
PPT
Graphing day 2 worked
PDF
All three forms (variety)
DOCX
Ninth grade 4th period study guide key
Num Integration
Graphing day 1 worked
Numerical
Y11+gdc+maximize+your+use+of+the++ev+2
Properties real numbers basic
Chapter 4 review
Quadratic Functions
Period 4 Quadratic Funtions
Derivatives Lesson Oct 13
Karnaugh maps
AP Calculus Slides December 10, 2007
Graphing day 2 worked
All three forms (variety)
Ninth grade 4th period study guide key
Ad

Similar to 19 - Scala. Eliminators into dependent types (induction) (20)

PDF
Can two fixpoint types in Mendler style unite?
PDF
11 - Scala. Function type
PDF
Expressiveness and Model of the Polymorphic λ Calculus
PDF
PPTX
Dependent Types with Idris
PDF
Cody Roux - Pure Type Systems - Boston Haskell Meetup
PPT
Ch09.ppt dilfidsnpfpdsvklnvskv vdv;dlvd k;vsvdvk
PPTX
Unit4_CL_Unit_4_on Computation Logic_srm
PDF
Sigma type
PDF
13 - Scala. Dependent pair type (Σ-type)
PDF
15 - Scala. Dependent function type (Π-type)
PPTX
Introduction to the lambda calculus
PPT
Chomsky_Greibach-Hector-Chavez.ppt
PPT
Chomsky_GreibachNF.ppt
PPT
Pl vol1
PDF
05 - Scala. List type
PDF
Computing with P systems
PPTX
Introduction to Dependently Types: Idris
PPT
Pl vol1
PPTX
Theorem proving 2018 2019
Can two fixpoint types in Mendler style unite?
11 - Scala. Function type
Expressiveness and Model of the Polymorphic λ Calculus
Dependent Types with Idris
Cody Roux - Pure Type Systems - Boston Haskell Meetup
Ch09.ppt dilfidsnpfpdsvklnvskv vdv;dlvd k;vsvdvk
Unit4_CL_Unit_4_on Computation Logic_srm
Sigma type
13 - Scala. Dependent pair type (Σ-type)
15 - Scala. Dependent function type (Π-type)
Introduction to the lambda calculus
Chomsky_Greibach-Hector-Chavez.ppt
Chomsky_GreibachNF.ppt
Pl vol1
05 - Scala. List type
Computing with P systems
Introduction to Dependently Types: Idris
Pl vol1
Theorem proving 2018 2019
Ad

More from Roman Brovko (20)

PDF
Individual task Networking
PPTX
Networking essentials lect3
PPTX
Gl embedded starterkit_ethernet
PPTX
Networking essentials lect2
PPTX
Networking essentials lect1
PPTX
Bare metal training_07_spi_flash
PPTX
Bare metal training_06_I2C
PPTX
Glesk worshop
PPTX
Bare metal training_05_uart
PPTX
Bare metal training_04_adc_temp_sensor
PPTX
Bare metal training_03_timers_pwm
PPTX
Bare metal training_02_le_ds_and_buttons
PPTX
Bare metal training_01_hello_world
PPTX
Bare metal training_00_prerequisites
PPTX
C language lect_23_advanced
PPTX
C language lect_22_advanced
PPTX
C language lect_21_advanced
PPTX
подготовка рабочего окружения
PPTX
C language lect_20_advanced
PPTX
C language lect_19_basics
Individual task Networking
Networking essentials lect3
Gl embedded starterkit_ethernet
Networking essentials lect2
Networking essentials lect1
Bare metal training_07_spi_flash
Bare metal training_06_I2C
Glesk worshop
Bare metal training_05_uart
Bare metal training_04_adc_temp_sensor
Bare metal training_03_timers_pwm
Bare metal training_02_le_ds_and_buttons
Bare metal training_01_hello_world
Bare metal training_00_prerequisites
C language lect_23_advanced
C language lect_22_advanced
C language lect_21_advanced
подготовка рабочего окружения
C language lect_20_advanced
C language lect_19_basics

Recently uploaded (20)

PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Nekopoi APK 2025 free lastest update
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
L1 - Introduction to python Backend.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
top salesforce developer skills in 2025.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
AI in Product Development-omnex systems
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
System and Network Administraation Chapter 3
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
How to Choose the Right IT Partner for Your Business in Malaysia
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Understanding Forklifts - TECH EHS Solution
ManageIQ - Sprint 268 Review - Slide Deck
Nekopoi APK 2025 free lastest update
Navsoft: AI-Powered Business Solutions & Custom Software Development
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
L1 - Introduction to python Backend.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
top salesforce developer skills in 2025.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
AI in Product Development-omnex systems
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
How Creative Agencies Leverage Project Management Software.pdf
ISO 45001 Occupational Health and Safety Management System
System and Network Administraation Chapter 3
Which alternative to Crystal Reports is best for small or large businesses.pdf
Operating system designcfffgfgggggggvggggggggg

19 - Scala. Eliminators into dependent types (induction)

  • 1. Eliminators into dependent types Dmytro Mitin https://stepik.org/course/Introduction-to-programming- with-dependent-types-in-Scala-2294/ March 2017 Dmytro Mitin Eliminators into dependent types
  • 2. Empty type Eliminator into type C Γ C : ∗ Γ, x : 0 abortC x : C Eliminator into dependent type C Γ, u : 0 C : ∗ Γ, x : 0 abortC x : C[u ← x] ind0 ≡ abort : C:0→∗ x:0 C(x) abort(C) ≡ C Dmytro Mitin Eliminators into dependent types
  • 3. Unit type Eliminator into type C Γ c : C Γ, x : 1 case1(c)(x) : C x match { case () => c } Eliminator into dependent type C Γ, u : 1 C : ∗ Γ c : C[u ← 1] Γ, x : 1 case1(λu.C)(c)(x) : C[u ← x] ind1 ≡ case1 : C:1→∗ C(1) → x:1 C(x) case1(C, c, 1) ≡ c Dmytro Mitin Eliminators into dependent types
  • 4. Sum type Eliminator into type C Γ C : ∗ Γ, a : A c1 : C Γ, b : B c2 : C Γ, s : A + B case+(λa.c1, λb.c2)(s) : C s match { case Inl(a) => c1(a); case Inr(b) => c2(b) } Eliminator into dependent type C Γ, u : A + B C : ∗ Γ, a : A c1 : C[u ← inl a] Γ, b : B c2 : C[u ← inr b] Γ, s : A + B case+(λu.C)(λa.c1, λb.c2)(s) : C[u ← s] ind+ ≡ case+ : C:A+B→∗ a:A C(inl a) × b:B C(inr b) → s:A+B C(s) case+(C, f , g, inl a) ≡ f (a) case+(C, f , g, inr b) ≡ g(b) Dmytro Mitin Eliminators into dependent types
  • 5. Product type Eliminators into types A and B Γ p : A × B Γ fst p : A Γ p : A × B Γ snd p : B Eliminator into dependent type C Γ, u : A × B C : ∗ Γ, a : A, b : B c : C[u ← (a, b)] Γ, p : A × B c[a ← fst p, b ← snd p] ≡ case×(λu.C)(λab.c)(p) : C[u ← p] ind× ≡ case× : C:A×B→∗ a:A b:B C(a, b) → p:A×B C(p) case×(C, f , (a, b)) ≡ f (a)(b) Dmytro Mitin Eliminators into dependent types
  • 6. Function type Eliminators into type B Γ f : A → B Γ a : A Γ f a : B Higher-order eliminator[1] [2] [3] into dependent type C Γ, u : A → B C : ∗ (Γ, x : A b : B) c : C[u ← λx.b] Γ, g : A → B c : C[u ← λ(g)] Γ, f : A → B caseΠ(λu.C) λg.c (f ) : C[u ← f ] funsplit ≡ ind→ ≡ case→ : C:(A→B)→∗ g:A→B C(λx.b) → f :A→B C(f ) case→(C, h, λx.b) ≡ h(λx.b) Dmytro Mitin Eliminators into dependent types
  • 7. Dependent pair type (Σ-type) Eliminators into types A and B Γ p : x:A B Γ fst p : A Γ p : x:A B Γ snd p : B[x ← fst p] Eliminator into dependent type C Γ, u : x:A B C : ∗ Γ, a : A, b : B[u ← a] c : C[u ← (a, b)] Γ, p : x:A B c[a ← fst p, b ← snd p] ≡ caseΣ(λu.C)(λab.c)(p) : C[u ← p] split ≡ indΣ ≡ caseΣ : C: x:A B(x)→∗ a:A b:B(a) C(a, b) → p: x:A B(x) C(p) caseΣ(C, f , (a, b)) ≡ f (a)(b) Dmytro Mitin Eliminators into dependent types
  • 8. Dependent function type (Π-type) Eliminators into type B Γ f : x:A B Γ a : A Γ f a : B[x ← a] Higher-order eliminator[1] [2] [3] into dependent type C Γ, u : x:A B C : ∗ (Γ, x : A b : B) c : C[u ← λx.b] Γ, g : x:A B c : C[u ← λ(g)] Γ, f : x:A B caseΠ(λu.C) λg.c (f ) : C[u ← f ] funsplit ≡ indΠ ≡ caseΠ : C: x:A B(x)→∗ g: x:A B(x) C(λx.b) → f : x:A B(x) C(f ) caseΠ(C, h, λx.b) ≡ h(λx.b) Dmytro Mitin Eliminators into dependent types
  • 9. Boolean type Eliminator into type C Γ c1 : C Γ c2 : C Γ, x : Bool if(c1, c2)(x) : C x match { case True => c1; case False => c2 } Eliminator into dependent type C Γ, u : Bool C : ∗ Γ c1 : C[u ← true] Γ c2 : C[u ← false] Γ, x : Bool if(c1, c2)(x) caseBool(λu.C)(c1,c2)(x) : C[u ← x] indBool ≡ caseBool : C:Bool→∗ C(true) × C(false) → x:Bool C(x) caseBool(C, c1, c2, true) ≡ c1 caseBool(C, c1, c2, false) ≡ c2 Dmytro Mitin Eliminators into dependent types
  • 10. Type of natural numbers Eliminator into type C Γ c1 : C Γ, n : Nat c2 : C Γ, x : Nat caseNat(c1, λn.c2)(x) : C x match { case Zero => c1; case Suc(n) => c2(n) } Eliminator into dependent type C Γ, u : Nat C : ∗ Γ c1 : C[u ← zero] Γ, n : Nat, c : C[u ← n] c2 : C[u ← suc n] Γ, x : Nat caseNat(λu.C)(c1, λnc.c2)(x) : C[u ← x] indNat ≡ caseNat : C:Nat→∗ C(zero) × n:Nat C(n) → C(suc n) → x:Nat C(x) caseNat(C, c1, f , zero) ≡ c1 caseNat(C, c1, f , suc n) ≡ f (n)(caseNat(C, c1, f , n)) Dmytro Mitin Eliminators into dependent types
  • 11. List type Eliminator into type C Γ c1 : C Γ, h : A, t : List A c2 : C Γ, x : List A caseList(x)(c1, λht.c2) : C x match { case Nil => c1; case Cons(h, t) => c2(h, t) } Eliminator into dependent type C Γ, u : List A C : ∗ Γ c1 : C[u ← nil] Γ, h : A, t : List A, c : C[u ← t] c2 : C[u ← cons h t] Γ, x : List A caseList(λu.C)(c1, λhtc.c2)(x) : C[u ← x] indList ≡ caseList : C:List A→∗ C(nil) × h:A t:List A C(t) → C(cons h t) → x:List A C(x) caseList(C, c1, f , nil) ≡ c1 caseList(C, c1, f , cons h t) ≡ f (h, t)(caseList(C, c1, f , t)) Dmytro Mitin Eliminators into dependent types
  • 12. Type of fixed-length vectors Eliminator into dependent type C Γ, n : Nat, u : Vect n A C : ∗ Γ c1 : C[n ← zero, u ← nil] Γ, h : A, m : Nat, t : Vect m A, c : C[n ← m, u ← t] c2 : C[n ← suc m, u ← cons h t] Γ, k : Nat, x : Vect k A caseVect(λnu.C)(c1, λhmtc.c2)(k, x) : C[n ← k, u ← x] indVect ≡ caseVect : C: n:Nat (Vect n A→∗) C(zero, nil) × h:A m:Nat t:Vect m A C(m, t) → C(suc m, cons h t) → x: k:Nat Vect k A C(x) caseVect C, c1, f , (zero, nil) ≡ c1 caseVect C, c1, f , (suc m, cons h t) ≡ f (h, m, t)(caseVect(C, c1, f , (m, t))) Dmytro Mitin Eliminators into dependent types
  • 13. Identity type Eliminator into dependent type C Γ, a1 : A, a2 : A, u : a1 =A a2 C : ∗ Γ, a : A c : C[a1 ← a, a2 ← a, u ← refl a] Γ, a1 : A, a2 : A, x : a1 =A a2 caseId(λa1a2u.C)(λa.c)(λa1a2.x) : C[a1 ← a1, a2 ← a2, u ← x] J ≡ indId ≡ caseId : C: a1:A a2:A (a1=Aa2→∗) a:A C(a, a, refl a) → a1:A a2:A x:a1=Aa2 C(a1, a2, x) caseId(C, f , a, a, refl a) = f (a) Dmytro Mitin Eliminators into dependent types