Realizability and Strong Normalization for Heyting ... fileFederico Aschieri (joint work S. Berardi,...

45
Realizability and Strong Normalization for Heyting Arithmetic with EM 1 Federico Aschieri (joint work S. Berardi, G. Birolo) Equipe Plume, LIP ENS de Lyon Toulouse, 24 Avril 2013 Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with

Transcript of Realizability and Strong Normalization for Heyting ... fileFederico Aschieri (joint work S. Berardi,...

Realizability and Strong Normalization forHeyting Arithmetic with EM1

Federico Aschieri(joint work S. Berardi, G. Birolo)

Equipe Plume, LIPENS de Lyon

Toulouse, 24 Avril 2013

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms

Variables: for terms x , y , z, . . . , for individuals α, β, . . .

Functions (→):λx u | tu

Pairs (∧):〈u, v〉 | π0u | π1u

Sums (∨):ι0(u) | ι1(u) | u[x .v1, y .v2]

Products (∀):λα u | tn (n individual)

Co-Products (∃):

(n, t) | u[(α, x).v ] (n individual)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms

Variables: for terms x , y , z, . . . , for individuals α, β, . . .Functions (→):

λx u | tu

Pairs (∧):〈u, v〉 | π0u | π1u

Sums (∨):ι0(u) | ι1(u) | u[x .v1, y .v2]

Products (∀):λα u | tn (n individual)

Co-Products (∃):

(n, t) | u[(α, x).v ] (n individual)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms

Variables: for terms x , y , z, . . . , for individuals α, β, . . .Functions (→):

λx u | tu

Pairs (∧):〈u, v〉 | π0u | π1u

Sums (∨):ι0(u) | ι1(u) | u[x .v1, y .v2]

Products (∀):λα u | tn (n individual)

Co-Products (∃):

(n, t) | u[(α, x).v ] (n individual)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms

Variables: for terms x , y , z, . . . , for individuals α, β, . . .Functions (→):

λx u | tu

Pairs (∧):〈u, v〉 | π0u | π1u

Sums (∨):ι0(u) | ι1(u) | u[x .v1, y .v2]

Products (∀):λα u | tn (n individual)

Co-Products (∃):

(n, t) | u[(α, x).v ] (n individual)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms

Variables: for terms x , y , z, . . . , for individuals α, β, . . .Functions (→):

λx u | tu

Pairs (∧):〈u, v〉 | π0u | π1u

Sums (∨):ι0(u) | ι1(u) | u[x .v1, y .v2]

Products (∀):λα u | tn (n individual)

Co-Products (∃):

(n, t) | u[(α, x).v ] (n individual)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms

Variables: for terms x , y , z, . . . , for individuals α, β, . . .Functions (→):

λx u | tu

Pairs (∧):〈u, v〉 | π0u | π1u

Sums (∨):ι0(u) | ι1(u) | u[x .v1, y .v2]

Products (∀):λα u | tn (n individual)

Co-Products (∃):

(n, t) | u[(α, x).v ] (n individual)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms(2)

Numerals:0,S0,SS0, . . .

Recursion (Induction):

rec u v t

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms(2)

Numerals:0,S0,SS0, . . .

Recursion (Induction):

rec u v t

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (3)

(EM1):u ‖a v

Permutations:(u ‖a v)w 7→ uw ‖a vw

πi(u ‖a v) 7→ πiu ‖a πiv

(u ‖a v)[x .w1, y .w2] 7→ u[x .w1, y .w2] ‖a v [x .w1, y .w2]

(u ‖a v)[(α, x).w ] 7→ u[(α, x).w ] ‖a v [(α, x).w ]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (3)

(EM1):u ‖a v

Permutations:(u ‖a v)w 7→ uw ‖a vw

πi(u ‖a v) 7→ πiu ‖a πiv

(u ‖a v)[x .w1, y .w2] 7→ u[x .w1, y .w2] ‖a v [x .w1, y .w2]

(u ‖a v)[(α, x).w ] 7→ u[(α, x).w ] ‖a v [(α, x).w ]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (3)

(EM1):u ‖a v

Permutations:(u ‖a v)w 7→ uw ‖a vw

πi(u ‖a v) 7→ πiu ‖a πiv

(u ‖a v)[x .w1, y .w2] 7→ u[x .w1, y .w2] ‖a v [x .w1, y .w2]

(u ‖a v)[(α, x).w ] 7→ u[(α, x).w ] ‖a v [(α, x).w ]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (3)

(EM1):u ‖a v

Permutations:(u ‖a v)w 7→ uw ‖a vw

πi(u ‖a v) 7→ πiu ‖a πiv

(u ‖a v)[x .w1, y .w2] 7→ u[x .w1, y .w2] ‖a v [x .w1, y .w2]

(u ‖a v)[(α, x).w ] 7→ u[(α, x).w ] ‖a v [(α, x).w ]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (3)

(EM1):u ‖a v

Permutations:(u ‖a v)w 7→ uw ‖a vw

πi(u ‖a v) 7→ πiu ‖a πiv

(u ‖a v)[x .w1, y .w2] 7→ u[x .w1, y .w2] ‖a v [x .w1, y .w2]

(u ‖a v)[(α, x).w ] 7→ u[(α, x).w ] ‖a v [(α, x).w ]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u,

(if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n]

:= v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Proof Terms (4)

(EM1):u ‖a v

H∀αPa

W∃α¬Pa

Exceptions:

(H∀αPa )n 7→ True, if P[n/α] = True

u ‖a v 7→ u, (if a does not occur free in u)

u ‖a v 7→ v [a := n] := v [W∃α¬Pa := (n,True)]

(if H∀αPa n occurs in u and P[n/α] = False)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Typing Rules

Γ,a : ∀αNP ` u : C Γ,a : ∃αN¬P ` v : CΓ ` u ‖a v : C

P atomic

Γ,a : ∀αNP ` H∀αPa : ∀αNP

Γ,a : ∃αN¬P ` W∃α¬Pa : ∃αN¬P

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Typing Rules

Γ,a : ∀αNP ` u : C Γ,a : ∃αN¬P ` v : CΓ ` u ‖a v : C

P atomic

Γ,a : ∀αNP ` H∀αPa : ∀αNP

Γ,a : ∃αN¬P ` W∃α¬Pa : ∃αN¬P

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Typing Rules

Γ,a : ∀αNP ` u : C Γ,a : ∃αN¬P ` v : CΓ ` u ‖a v : C

P atomic

Γ,a : ∀αNP ` H∀αPa : ∀αNP

Γ,a : ∃αN¬P ` W∃α¬Pa : ∃αN¬P

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Logical Interpretation

∀αPP[n/α]

...

∀αPP[m/α]

...

∀αP...

C

∃α¬P...C

C

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Logical Interpretation (2)

∀αPP[n/α]

...

∀αPP[m/α]

...C

∃α¬P...C

C

Converts to:

Π0

P[n/α]

...

Π1

P[m/α]

...C

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Logical Interpretation (3)

∀αPP[n/α] = False

...

∀αPP[m/α]

...C

∃α¬P...C

C

Converts to:

Π¬P[n/α]

∃α¬P...C

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability

t A

t may contain free hypotheses H∀αPa

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability

t A

t may contain free hypotheses H∀αPa

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (2)

t A → B if and only if for all u, if u A, then tu B

t A ∧ B if and only if π0t A and π1t B

t ∀αNA if and only if for every numeral n, tn A[n/α]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (2)

t A → B if and only if for all u, if u A, then tu B

t A ∧ B if and only if π0t A and π1t B

t ∀αNA if and only if for every numeral n, tn A[n/α]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (2)

t A → B if and only if for all u, if u A, then tu B

t A ∧ B if and only if π0t A and π1t B

t ∀αNA if and only if for every numeral n, tn A[n/α]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (3)

t A ∨ B if and only if one of the following holds:

i) t = ι0(u) and u A or t = ι1(u) and u B;

ii) t = u ‖a v and u A ∨ B and v [a := m] A ∨ B forevery numeral m;(v [a := m] = v [W∃α¬P

a := (m,H∀α.α=0a S0)] if m is not a

witness for P)

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ A ∨ B.

t ∃αNA if and only if one of the following holds:

i) t = (n,u) for some numeral n and u A[n/α];

ii) t = u ‖a v and u ∃αNA and v [a := m] ∃αNA forevery numeral m

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ ∃αNA.

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (3)

t A ∨ B if and only if one of the following holds:

i) t = ι0(u) and u A or t = ι1(u) and u B;

ii) t = u ‖a v and u A ∨ B and v [a := m] A ∨ B forevery numeral m;(v [a := m] = v [W∃α¬P

a := (m,H∀α.α=0a S0)] if m is not a

witness for P)

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ A ∨ B.

t ∃αNA if and only if one of the following holds:

i) t = (n,u) for some numeral n and u A[n/α];

ii) t = u ‖a v and u ∃αNA and v [a := m] ∃αNA forevery numeral m

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ ∃αNA.

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (3)

t A ∨ B if and only if one of the following holds:

i) t = ι0(u) and u A or t = ι1(u) and u B;

ii) t = u ‖a v and u A ∨ B and v [a := m] A ∨ B forevery numeral m;(v [a := m] = v [W∃α¬P

a := (m,H∀α.α=0a S0)] if m is not a

witness for P)

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ A ∨ B.

t ∃αNA if and only if one of the following holds:

i) t = (n,u) for some numeral n and u A[n/α];

ii) t = u ‖a v and u ∃αNA and v [a := m] ∃αNA forevery numeral m

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ ∃αNA.

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (3)

t A ∨ B if and only if one of the following holds:

i) t = ι0(u) and u A or t = ι1(u) and u B;

ii) t = u ‖a v and u A ∨ B and v [a := m] A ∨ B forevery numeral m;(v [a := m] = v [W∃α¬P

a := (m,H∀α.α=0a S0)] if m is not a

witness for P)

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ A ∨ B.

t ∃αNA if and only if one of the following holds:

i) t = (n,u) for some numeral n and u A[n/α];

ii) t = u ‖a v and u ∃αNA and v [a := m] ∃αNA forevery numeral m

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ ∃αNA.

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (3)

t A ∨ B if and only if one of the following holds:

i) t = ι0(u) and u A or t = ι1(u) and u B;

ii) t = u ‖a v and u A ∨ B and v [a := m] A ∨ B forevery numeral m;(v [a := m] = v [W∃α¬P

a := (m,H∀α.α=0a S0)] if m is not a

witness for P)

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ A ∨ B.

t ∃αNA if and only if one of the following holds:

i) t = (n,u) for some numeral n and u A[n/α];

ii) t = u ‖a v and u ∃αNA and v [a := m] ∃αNA forevery numeral m

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ ∃αNA.

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (4)

t P if and only if one of the following holds:

i) t ∈ NF and P = False implies t contains a subterm H∀αQa n

with Q[n/α] = False;

ii) t = u ‖a v and u P and v [a := m] P for every numeralm;

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ P

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (4)

t P if and only if one of the following holds:

i) t ∈ NF and P = False implies t contains a subterm H∀αQa n

with Q[n/α] = False;

ii) t = u ‖a v and u P and v [a := m] P for every numeralm;

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ P

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Realizability (4)

t P if and only if one of the following holds:

i) t ∈ NF and P = False implies t contains a subterm H∀αQa n

with Q[n/α] = False;

ii) t = u ‖a v and u P and v [a := m] P for every numeralm;

iii) t /∈ NF is neutral and for all t ′, t 7→ t ′ implies t ′ P

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Soundness, Strong Normalization, Witness Extraction

HA + EM1 ` t : A =⇒ t A

t A =⇒ t ∈ SN

t ∃αP =⇒ t 7→∗ (n,u) ∧ P[n/α]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Soundness, Strong Normalization, Witness Extraction

HA + EM1 ` t : A =⇒ t A

t A =⇒ t ∈ SN

t ∃αP =⇒ t 7→∗ (n,u) ∧ P[n/α]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Soundness, Strong Normalization, Witness Extraction

HA + EM1 ` t : A =⇒ t A

t A =⇒ t ∈ SN

t ∃αP =⇒ t 7→∗ (n,u) ∧ P[n/α]

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1

Disjunction Property and Existence Property

EM−1 ( Q atomic) :

Γ,a : ∀αNP ` u : ∃βQ Γ,a : ∃αN¬P ` v : ∃βQΓ ` u ‖a v : ∃βQ

HA + EM−1 ` A ∨ B =⇒ HA + EM−1 ` A or HA + EM−1 ` B

HA + EM−1 ` ∃αA =⇒ HA + EM−1 ` A(n)

Federico Aschieri (joint work S. Berardi, G. Birolo) Realizability and Strong Normalization for Heyting Arithmetic with EM1