A Proof-theoretic Characterization of Independence in Type Theory - - PowerPoint PPT Presentation

a proof theoretic characterization of independence in
SMART_READER_LITE
LIVE PREVIEW

A Proof-theoretic Characterization of Independence in Type Theory - - PowerPoint PPT Presentation

A Proof-theoretic Characterization of Independence in Type Theory Yuting Wang 1 Kaustuv Chaudhuri 2 1 University of Minnesota, Twin Cities, USA 2 Inria & LIX/cole polytechnique, France TLCA, July 2015, Warsaw Yuting Wang , Kaustuv Chaudhuri


slide-1
SLIDE 1

A Proof-theoretic Characterization of Independence in Type Theory

Yuting Wang 1 Kaustuv Chaudhuri 2

1University of Minnesota, Twin Cities, USA 2Inria & LIX/École polytechnique, France

TLCA, July 2015, Warsaw

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 1/14

slide-2
SLIDE 2

Motivation

Formalizing transportation of theorems and proofs about type theories in different contexts.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 2/14

slide-3
SLIDE 3

Motivation

Formalizing transportation of theorems and proofs about type theories in different contexts. Example:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 2/14

slide-4
SLIDE 4

Motivation

Formalizing transportation of theorems and proofs about type theories in different contexts. Example:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Suppose given some property P about bt we prove ∀b : bt.P(b).

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 2/14

slide-5
SLIDE 5

Motivation

Formalizing transportation of theorems and proofs about type theories in different contexts. Example:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Suppose given some property P about bt we prove ∀b : bt.P(b). Question: After adding c : nat does the theorem still hold?

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 2/14

slide-6
SLIDE 6

Motivation

Formalizing transportation of theorems and proofs about type theories in different contexts. Example:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Suppose given some property P about bt we prove ∀b : bt.P(b). Question: After adding c : nat does the theorem still hold? Answer: Yes. Because bt-terms (in normal form) cannot contain nat-terms.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 2/14

slide-7
SLIDE 7

Independence

Terms of a certain type can not depend on that of another type.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 3/14

slide-8
SLIDE 8

Independence

Terms of a certain type can not depend on that of another type. Definition (Independence) The type τ2 is independent of τ1 in the context Γ if whenever Γ, x:τ1 ⊢ t : τ2 holds for some t, the β-normal form of t does not contain x, i.e., Γ ⊢ t : τ2 holds.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 3/14

slide-9
SLIDE 9

Independence

Terms of a certain type can not depend on that of another type. Definition (Independence) The type τ2 is independent of τ1 in the context Γ if whenever Γ, x:τ1 ⊢ t : τ2 holds for some t, the β-normal form of t does not contain x, i.e., Γ ⊢ t : τ2 holds. Independence

is a derived property of the given type theory can be used to formalize transportation of theorems

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 3/14

slide-10
SLIDE 10

Independence

Terms of a certain type can not depend on that of another type. Definition (Independence) The type τ2 is independent of τ1 in the context Γ if whenever Γ, x:τ1 ⊢ t : τ2 holds for some t, the β-normal form of t does not contain x, i.e., Γ ⊢ t : τ2 holds. Independence

is a derived property of the given type theory can be used to formalize transportation of theorems

Example: bt is independent of nat in the last example.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 3/14

slide-11
SLIDE 11

Contributions (Overview)

Our contributions:

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 4/14

slide-12
SLIDE 12

Contributions (Overview)

Our contributions: A methodology for formalizing proofs of independence

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 4/14

slide-13
SLIDE 13

Contributions (Overview)

Our contributions: A methodology for formalizing proofs of independence

Encoding the type theory in a specification logic called HH Proving independence in a reasoning logic called G

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 4/14

slide-14
SLIDE 14

Contributions (Overview)

Our contributions: A methodology for formalizing proofs of independence

Encoding the type theory in a specification logic called HH Proving independence in a reasoning logic called G

An algorithm for automatically checking independence

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 4/14

slide-15
SLIDE 15

Contributions (Overview)

Our contributions: A methodology for formalizing proofs of independence

Encoding the type theory in a specification logic called HH Proving independence in a reasoning logic called G

An algorithm for automatically checking independence

Derive the independence relation from the typing context Simultaneously generate a proof of independence

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 4/14

slide-16
SLIDE 16

Contributions (Overview)

Our contributions: A methodology for formalizing proofs of independence

Encoding the type theory in a specification logic called HH Proving independence in a reasoning logic called G

An algorithm for automatically checking independence

Derive the independence relation from the typing context Simultaneously generate a proof of independence

We use the simply-typed λ-calculus (STLC) as an example.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 4/14

slide-17
SLIDE 17

Elaboration of Independence Proofs

We want to prove the following lemma by induction: ∀t, if Γ, x:τ1 ⊢ t : τ2 is derivable then so is Γ ⊢ t : τ2.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 5/14

slide-18
SLIDE 18

Elaboration of Independence Proofs

We want to prove the following lemma by induction: ∀t, if Γ, x:τ1 ⊢ t : τ2 is derivable then so is Γ ⊢ t : τ2. Considering the independence of τ2 to τ1 alone is not enough.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 5/14

slide-19
SLIDE 19

Elaboration of Independence Proofs

We want to prove the following lemma by induction: ∀t, if Γ, x:τ1 ⊢ t : τ2 is derivable then so is Γ ⊢ t : τ2. Considering the independence of τ2 to τ1 alone is not enough. Example: when t is an application t1 t2:

Γ, x:τ1 ⊢ t1 : τ → τ2 Γ, x:τ1 ⊢ t2 : τ Γ, x:τ1 ⊢ t1 t2 : τ2

Need to prove the independence of τ to τ1 for the new type τ.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 5/14

slide-20
SLIDE 20

Elaboration of Independence Proofs

We want to prove the following lemma by induction: ∀t, if Γ, x:τ1 ⊢ t : τ2 is derivable then so is Γ ⊢ t : τ2. Considering the independence of τ2 to τ1 alone is not enough. Example: when t is an application t1 t2:

Γ, x:τ1 ⊢ t1 : τ → τ2 Γ, x:τ1 ⊢ t2 : τ Γ, x:τ1 ⊢ t1 t2 : τ2

Need to prove the independence of τ to τ1 for the new type τ. Solution:

Since the context Γ is fixed, it is possible to finitely characterize the types involved in the proof Prove the independence lemmas for these types simultaneously

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 5/14

slide-21
SLIDE 21

Elaboration of Independence Proofs

We want to prove the following lemma by induction: ∀t, if Γ, x:τ1 ⊢ t : τ2 is derivable then so is Γ ⊢ t : τ2. Considering the independence of τ2 to τ1 alone is not enough. Example: when t is an application t1 t2:

Γ, x:τ1 ⊢ t1 : τ → τ2 Γ, x:τ1 ⊢ t2 : τ Γ, x:τ1 ⊢ t1 t2 : τ2

Need to prove the independence of τ to τ1 for the new type τ. Solution:

Since the context Γ is fixed, it is possible to finitely characterize the types involved in the proof Prove the independence lemmas for these types simultaneously

Realization: encode typing for the fixed context in a spec logic and do inductive proof on the encoding.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 5/14

slide-22
SLIDE 22

The Specification Logic HH

The specification logic is called the logic of higher-order hereditary Harrop formulas (HH):

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 6/14

slide-23
SLIDE 23

The Specification Logic HH

The specification logic is called the logic of higher-order hereditary Harrop formulas (HH): Provides an adequate set of devices for formalizing SOS-style rules

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 6/14

slide-24
SLIDE 24

The Specification Logic HH

The specification logic is called the logic of higher-order hereditary Harrop formulas (HH): Provides an adequate set of devices for formalizing SOS-style rules Formulas has the following normal form: F ::= ∀¯ x:¯ τ. F1 ⇒ · · · ⇒ Fn ⇒ A.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 6/14

slide-25
SLIDE 25

The Specification Logic HH

The specification logic is called the logic of higher-order hereditary Harrop formulas (HH): Provides an adequate set of devices for formalizing SOS-style rules Formulas has the following normal form: F ::= ∀¯ x:¯ τ. F1 ⇒ · · · ⇒ Fn ⇒ A. A sequent calculus for derive sequents of the form Γ ⊢ F (Γ = F1, ..., Fn) Γ is called the context and F is called the goal

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 6/14

slide-26
SLIDE 26

The Specification Logic HH

The specification logic is called the logic of higher-order hereditary Harrop formulas (HH): Provides an adequate set of devices for formalizing SOS-style rules Formulas has the following normal form: F ::= ∀¯ x:¯ τ. F1 ⇒ · · · ⇒ Fn ⇒ A. A sequent calculus for derive sequents of the form Γ ⊢ F (Γ = F1, ..., Fn) Γ is called the context and F is called the goal A derivation alternates between the following two phases:

Simplify the goal until it becomes atomic; Perform backchaining on the atomic goal.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 6/14

slide-27
SLIDE 27

An Encoding of STLC in HH

The encoding is based on types-as-predicates principle:

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 7/14

slide-28
SLIDE 28

An Encoding of STLC in HH

The encoding is based on types-as-predicates principle: Atomic types and constants are imported into HH signature

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 7/14

slide-29
SLIDE 29

An Encoding of STLC in HH

The encoding is based on types-as-predicates principle: Atomic types and constants are imported into HH signature For every atomic type b, define a predicate ˆ b : b → o

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 7/14

slide-30
SLIDE 30

An Encoding of STLC in HH

The encoding is based on types-as-predicates principle: Atomic types and constants are imported into HH signature For every atomic type b, define a predicate ˆ b : b → o Define a mapping − from STLC types τ to predicates τ → o: b = λt. ˆ b t if b is an atomic type. τ1 → τ2 = λt. ∀x:τ1. τ1 x ⇒ τ2 (t x)

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 7/14

slide-31
SLIDE 31

An Encoding of STLC in HH

The encoding is based on types-as-predicates principle: Atomic types and constants are imported into HH signature For every atomic type b, define a predicate ˆ b : b → o Define a mapping − from STLC types τ to predicates τ → o: b = λt. ˆ b t if b is an atomic type. τ1 → τ2 = λt. ∀x:τ1. τ1 x ⇒ τ2 (t x) A typing judgment Γ ⊢ t : τ is encoded as an HH sequent Γ ⊢ τ t where Γ = {τ1 x1, . . . , τn xn}

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 7/14

slide-32
SLIDE 32

Example of Encoding

Assume the following STLC signature Γ:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 8/14

slide-33
SLIDE 33

Example of Encoding

Assume the following STLC signature Γ:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Define two predicates ˆ nat : nat → o and ˆ bt : bt → o.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 8/14

slide-34
SLIDE 34

Example of Encoding

Assume the following STLC signature Γ:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Define two predicates ˆ nat : nat → o and ˆ bt : bt → o. Constants are encoded as the following clauses

ˆ nat z. ∀x. ˆ nat x ⇒ ˆ nat (s x). ∀x. (∀y. ˆ nat y ⇒ ˆ bt (x y)) ⇒ ˆ bt (leaf x). ∀x y. ˆ bt x ⇒ ˆ bt y ⇒ ˆ bt (node y x).

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 8/14

slide-35
SLIDE 35

Example of Encoding

Assume the following STLC signature Γ:

z : nat s : nat → nat leaf : (nat → bt) → bt node : bt → bt → bt

Define two predicates ˆ nat : nat → o and ˆ bt : bt → o. Constants are encoded as the following clauses

ˆ nat z. ∀x. ˆ nat x ⇒ ˆ nat (s x). ∀x. (∀y. ˆ nat y ⇒ ˆ bt (x y)) ⇒ ˆ bt (leaf x). ∀x y. ˆ bt x ⇒ ˆ bt y ⇒ ˆ bt (node y x).

Example of encoding typing judgments: Γ, x : nat → bt, y : bt ⊢ node (leaf x) y : bt is encoded as the following HH sequent: Γ, (∀y. ˆ nat y ⇒ ˆ bt (x y)), ˆ bt y ⊢ ˆ bt (node (leaf x) y)

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 8/14

slide-36
SLIDE 36

Independence as Strengthening Lemmas

Now τ2 is independent of τ1 can be stated as follows:

If Γ, τ1 x ⊢ τ2 t is derivable in HH, then so is Γ ⊢ τ2 t.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 9/14

slide-37
SLIDE 37

Independence as Strengthening Lemmas

Now τ2 is independent of τ1 can be stated as follows:

If Γ, τ1 x ⊢ τ2 t is derivable in HH, then so is Γ ⊢ τ2 t.

It is an instance of strengthening lemmas.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 9/14

slide-38
SLIDE 38

Independence as Strengthening Lemmas

Now τ2 is independent of τ1 can be stated as follows:

If Γ, τ1 x ⊢ τ2 t is derivable in HH, then so is Γ ⊢ τ2 t.

It is an instance of strengthening lemmas. Example: bt is independent of nat: If Γ, ˆ nat x ⊢ ˆ bt t is derivable, then so is Γ ⊢ ˆ bt t, where Γ is the signature in the last example.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 9/14

slide-39
SLIDE 39

Independence as Strengthening Lemmas

Now τ2 is independent of τ1 can be stated as follows:

If Γ, τ1 x ⊢ τ2 t is derivable in HH, then so is Γ ⊢ τ2 t.

It is an instance of strengthening lemmas. Example: bt is independent of nat: If Γ, ˆ nat x ⊢ ˆ bt t is derivable, then so is Γ ⊢ ˆ bt t, where Γ is the signature in the last example. Proof by Induction: the context may be dynamically extended when backchaining on:

∀x. (∀y. ˆ nat y ⇒ ˆ bt (x y)) ⇒ ˆ bt (leaf x).

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 9/14

slide-40
SLIDE 40

Independence as Strengthening Lemmas

Now τ2 is independent of τ1 can be stated as follows:

If Γ, τ1 x ⊢ τ2 t is derivable in HH, then so is Γ ⊢ τ2 t.

It is an instance of strengthening lemmas. Example: bt is independent of nat: If Γ, ˆ nat x ⊢ ˆ bt t is derivable, then so is Γ ⊢ ˆ bt t, where Γ is the signature in the last example. Proof by Induction: the context may be dynamically extended when backchaining on:

∀x. (∀y. ˆ nat y ⇒ ˆ bt (x y)) ⇒ ˆ bt (leaf x).

We prove a generalized lemma: If (Γ, ∆, ˆ nat x ⊢ ˆ bt t) is derivable, then so is (Γ, ∆ ⊢ ˆ bt t), where ∆ is the dynamic context.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 9/14

slide-41
SLIDE 41

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-42
SLIDE 42

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-43
SLIDE 43

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-44
SLIDE 44

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

We can also give them a least (greatest) fixed point reading, leading to support for (co)-inductive reasoning

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-45
SLIDE 45

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

We can also give them a least (greatest) fixed point reading, leading to support for (co)-inductive reasoning A new quantifier ∇ for variables representing names.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-46
SLIDE 46

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

We can also give them a least (greatest) fixed point reading, leading to support for (co)-inductive reasoning A new quantifier ∇ for variables representing names.

HH is encoded as a fixed-point definition for the predicate seq

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-47
SLIDE 47

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

We can also give them a least (greatest) fixed point reading, leading to support for (co)-inductive reasoning A new quantifier ∇ for variables representing names.

HH is encoded as a fixed-point definition for the predicate seq

An HH sequent L ⊢ G is encoded as seq L G

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-48
SLIDE 48

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

We can also give them a least (greatest) fixed point reading, leading to support for (co)-inductive reasoning A new quantifier ∇ for variables representing names.

HH is encoded as a fixed-point definition for the predicate seq

An HH sequent L ⊢ G is encoded as seq L G Derivation rules are encoded as definitions for seq

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-49
SLIDE 49

A Two-level Logic Approach

G is an intuitionistic logic base on Church’s STT. Atomic predicates are interpreted through fixed-point definitions Example: the definition for addition of naturals is:

add z N N ⊤; add (s N1) N2 (s N3) add N1 N2 N3

We can also give them a least (greatest) fixed point reading, leading to support for (co)-inductive reasoning A new quantifier ∇ for variables representing names.

HH is encoded as a fixed-point definition for the predicate seq

An HH sequent L ⊢ G is encoded as seq L G Derivation rules are encoded as definitions for seq We write {L ⊢ G} for seq L G.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 10/14

slide-50
SLIDE 50

Formalizing Independence in G

τ2 is independent of τ1 can be stated as follows in G

∀t. ∇x. {Γ, τ1 x ⊢ τ2 (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ τ2 t′}.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 11/14

slide-51
SLIDE 51

Formalizing Independence in G

τ2 is independent of τ1 can be stated as follows in G

∀t. ∇x. {Γ, τ1 x ⊢ τ2 (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ τ2 t′}. The possibility that t may contain x is expressed by t x

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 11/14

slide-52
SLIDE 52

Formalizing Independence in G

τ2 is independent of τ1 can be stated as follows in G

∀t. ∇x. {Γ, τ1 x ⊢ τ2 (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ τ2 t′}. The possibility that t may contain x is expressed by t x The ordering of binders t′ and y in ∃t′. t = (λy. t′) conclude that t does not contain x.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 11/14

slide-53
SLIDE 53

Formalizing Independence in G

τ2 is independent of τ1 can be stated as follows in G

∀t. ∇x. {Γ, τ1 x ⊢ τ2 (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ τ2 t′}. The possibility that t may contain x is expressed by t x The ordering of binders t′ and y in ∃t′. t = (λy. t′) conclude that t does not contain x.

Example: bt is independent of nat

∀t. ∇x. {Γ, ˆ nat x ⊢ ˆ bt (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ ˆ bt t′}

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 11/14

slide-54
SLIDE 54

Formalizing Independence in G

τ2 is independent of τ1 can be stated as follows in G

∀t. ∇x. {Γ, τ1 x ⊢ τ2 (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ τ2 t′}. The possibility that t may contain x is expressed by t x The ordering of binders t′ and y in ∃t′. t = (λy. t′) conclude that t does not contain x.

Example: bt is independent of nat

∀t. ∇x. {Γ, ˆ nat x ⊢ ˆ bt (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ ⊢ ˆ bt t′}

We prove a generalized lemma:

∀∆ t. ∇x. ctx ∆ ⊃ {Γ, ∆, ˆ nat x ⊢ ˆ bt (t x)} ⊃ ∃t′. t = (λy. t′) ∧ {Γ, ∆ ⊢ ˆ bt t′}

where ctx defines the dynamically extended context

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 11/14

slide-55
SLIDE 55

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-56
SLIDE 56

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t. Algorithm for deriving the independence relation:

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-57
SLIDE 57

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t. Algorithm for deriving the independence relation:

For every predicate a, compute the context of sequents with atomic goals of head a.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-58
SLIDE 58

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t. Algorithm for deriving the independence relation:

For every predicate a, compute the context of sequents with atomic goals of head a. By examining the context, compute a set S(a) of all predicates that a can depend on.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-59
SLIDE 59

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t. Algorithm for deriving the independence relation:

For every predicate a, compute the context of sequents with atomic goals of head a. By examining the context, compute a set S(a) of all predicates that a can depend on. For any b ∈ S(a), every predicate in S(a) is independent of b. Generate a proof for this by mutual induction.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-60
SLIDE 60

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t. Algorithm for deriving the independence relation:

For every predicate a, compute the context of sequents with atomic goals of head a. By examining the context, compute a set S(a) of all predicates that a can depend on. For any b ∈ S(a), every predicate in S(a) is independent of b. Generate a proof for this by mutual induction. Since a ∈ S(a), a is independent of b.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-61
SLIDE 61

Automatically Checking Independence

Main Idea: To prove the strengthening lemma

{Γ, a1 x ⊢ a2 t} ⊃ {Γ ⊢ a2 t}

Show a1 x is never used in the derivation of Γ, a1 x ⊢ a2 t. Algorithm for deriving the independence relation:

For every predicate a, compute the context of sequents with atomic goals of head a. By examining the context, compute a set S(a) of all predicates that a can depend on. For any b ∈ S(a), every predicate in S(a) is independent of b. Generate a proof for this by mutual induction. Since a ∈ S(a), a is independent of b.

Example: For our example, S( ˆ bt) = { ˆ bt}. Thus bt is independent of nat.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 12/14

slide-62
SLIDE 62

Related Work: Subordination

Subordination is a popular notion for characterizing dependence in type theory:

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 13/14

slide-63
SLIDE 63

Related Work: Subordination

Subordination is a popular notion for characterizing dependence in type theory:

For every (sub)type τ1 → · · · → τn → A, derive that τi is subordinate to A Subordination is closed under reflexivity and transitivity.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 13/14

slide-64
SLIDE 64

Related Work: Subordination

Subordination is a popular notion for characterizing dependence in type theory:

For every (sub)type τ1 → · · · → τn → A, derive that τi is subordinate to A Subordination is closed under reflexivity and transitivity.

Non-subordination is used to show the transportation of proofs. Example: In Canonical LF, non-subordination is used to show the adequacy of encodings.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 13/14

slide-65
SLIDE 65

Related Work: Subordination

Subordination is a popular notion for characterizing dependence in type theory:

For every (sub)type τ1 → · · · → τn → A, derive that τi is subordinate to A Subordination is closed under reflexivity and transitivity.

Non-subordination is used to show the transportation of proofs. Example: In Canonical LF, non-subordination is used to show the adequacy of encodings. Problems with subordination:

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 13/14

slide-66
SLIDE 66

Related Work: Subordination

Subordination is a popular notion for characterizing dependence in type theory:

For every (sub)type τ1 → · · · → τn → A, derive that τi is subordinate to A Subordination is closed under reflexivity and transitivity.

Non-subordination is used to show the transportation of proofs. Example: In Canonical LF, non-subordination is used to show the adequacy of encodings. Problems with subordination:

It is built into the given type theory, thus completely trusted

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 13/14

slide-67
SLIDE 67

Related Work: Subordination

Subordination is a popular notion for characterizing dependence in type theory:

For every (sub)type τ1 → · · · → τn → A, derive that τi is subordinate to A Subordination is closed under reflexivity and transitivity.

Non-subordination is used to show the transportation of proofs. Example: In Canonical LF, non-subordination is used to show the adequacy of encodings. Problems with subordination:

It is built into the given type theory, thus completely trusted (Non-)subordination is an (under)over-approximation of the (in)dependence. Example: nat is subordinate to bt by the type of leaf.

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 13/14

slide-68
SLIDE 68

Conclusion

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 14/14

slide-69
SLIDE 69

Conclusion

Developed a methodology for formalizing independence

Implementation in a framework based on proof theory Use STLC as an example

Developed an algorithm to derive and prove independence

Automatically generate the independence relation Automatically derive the proof of independence

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 14/14

slide-70
SLIDE 70

Conclusion

Developed a methodology for formalizing independence

Implementation in a framework based on proof theory Use STLC as an example

Developed an algorithm to derive and prove independence

Automatically generate the independence relation Automatically derive the proof of independence

Future Work: Using the methodology in other logical frameworks Extension to other type theories (e.g. LF).

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 14/14

slide-71
SLIDE 71

Conclusion

Developed a methodology for formalizing independence

Implementation in a framework based on proof theory Use STLC as an example

Developed an algorithm to derive and prove independence

Automatically generate the independence relation Automatically derive the proof of independence

Future Work: Using the methodology in other logical frameworks Extension to other type theories (e.g. LF). Examples in Abella: http://abella-prover.org/independence

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 14/14

slide-72
SLIDE 72

Conclusion

Developed a methodology for formalizing independence

Implementation in a framework based on proof theory Use STLC as an example

Developed an algorithm to derive and prove independence

Automatically generate the independence relation Automatically derive the proof of independence

Future Work: Using the methodology in other logical frameworks Extension to other type theories (e.g. LF). Examples in Abella: http://abella-prover.org/independence

Thank you!

Yuting Wang , Kaustuv Chaudhuri Characterization of Independence in Type Theory 14/14