Heriditarily Finite Sets in Constructive Type Theory Gert Smolka - - PowerPoint PPT Presentation

heriditarily finite sets in constructive type theory
SMART_READER_LITE
LIVE PREVIEW

Heriditarily Finite Sets in Constructive Type Theory Gert Smolka - - PowerPoint PPT Presentation

Heriditarily Finite Sets in Constructive Type Theory Gert Smolka Saarland University Based on joint work with Kathrin Stark Paper at ITP 2016 (Springer LNCS 9807) HF Sets in Naive Set Theory An HF set is a finite set of HF sets Inductive


slide-1
SLIDE 1

Heriditarily Finite Sets in Constructive Type Theory

Gert Smolka

Saarland University Based on joint work with Kathrin Stark Paper at ITP 2016 (Springer LNCS 9807)

slide-2
SLIDE 2

HF Sets in Naive Set Theory

An HF set is a finite set of HF sets Inductive definition Pure sets An HF set is a set whose transitive closure is finite Transitive closure: least superset closed under elements of elements We consider only wellfounded HF sets (e.g., x / ∈ x) All sets are well-founded in ZF set theory

Gert Smolka (Saarland University) 2 / 21

slide-3
SLIDE 3

Epsilon Induction

A property p holds for all sets if ∀x. (∀z ∈ x. pz) → px Epsilon induction is valid iff all sets are well-founded

Gert Smolka (Saarland University) 3 / 21

slide-4
SLIDE 4

Adjunction

x.y := {x} ∪ y Similar to cons for lists Can express membership: x ∈ y ↔ x.y = y

Gert Smolka (Saarland University) 4 / 21

slide-5
SLIDE 5

HF Sets as Numbers (Ackermann 1937)

m ∈ n iff position m in binary representation of n is 1 Example: 21 10101 {4, 2, 0} Yields model of ZF without infinity

Gert Smolka (Saarland University) 5 / 21

slide-6
SLIDE 6

HF Sets Simplify G¨

  • del’s Incompleteness Proof

´ Swierczkowski 2003 Paulson 2015 (formalisation in Isabelle/HOL) Useful data structure for state sets of automata in HOL (Paulson 2015)

Gert Smolka (Saarland University) 6 / 21

slide-7
SLIDE 7

Peano Axiomatisation of Numbers

N : Type, 0 : N, S : N → N ∀p. p0 → (∀n.pn → p(Sn)) → ∀n.pn 0 = Sn Sm = Sn → m = n Unique model (up to isomorphism) Computationally complete if p : N → Type Can define primitive recursion operator

Gert Smolka (Saarland University) 7 / 21

slide-8
SLIDE 8

Axiomatisation of Binary Trees

T : Type, ∅ : T, . : T → T → T ∀p. p∅ → (∀xy.px → py → p(x.y)) → ∀x.px ∅ = x.y x.y = x′.y′ → x = x′ ∧ y = y′ Unique model, computationally complete Axiomatisation of lists is similar

Gert Smolka (Saarland University) 8 / 21

slide-9
SLIDE 9

Axiomatisations of HF Sets

Different from ZF Givant and Tarski 1977, Takahashi 1977 (classical)

∅, x.y, x ∈ y induction principle based on ∅ and x.y extensionality axiom

Previale 1994 (intuitionistic)

∅, x.y, x ∈ y, x ∈∗ y, x \ {y} extensionality axiom

Kirby 2009 (classical)

∅, x.y membership defined no extensionality axiom

Gert Smolka (Saarland University) 9 / 21

slide-10
SLIDE 10

Our Axiomatisation of HF Sets Agrees with Kirby’s

X : Type, ∅ : X, . : X → X → X ∀p. p∅ → (∀xy.px → py → p(x.y)) → ∀x.px ∅ = x.y x.x.y = x.y cancel x.y.z = y.x.z swap x ∈ y.z → x = y ∨ x ∈ z membership where x ∈ y := (x.y = y) p : X → Type

Gert Smolka (Saarland University) 10 / 21

slide-11
SLIDE 11

Main Contributations

Minimal constructive axiomatization Constructive proofs of extensionality and decidability Construction of operations for transitive closure and cardinality Unique model property (categoricity) Everything in constructive type theory Formalisation in Coq

Gert Smolka (Saarland University) 11 / 21

slide-12
SLIDE 12

Extensionality Shown Together with Decidability

1 x ⊆ y and y ⊆ x are decidable 2 x ∈ y and y ∈ x are decidable 3 x ⊆ y → y ⊆ x → x = y 4 x = y is decidable

Proof by nested HF induction on x and y using several lemmas:

1

∅ ⊆ x and x ⊆ ∅ and x ∈ ∅ and x = ∅ are decidable

2

If x = a and x ∈ y are decidable, x ∈ a.y is decidable

3

If a ∈ y and x ⊆ y are decidable, a.x ⊆ y is decidable

4

∅ ∈ x is decidable

5

a ∈ x → Σu. x = a.u ∧ a / ∈ u provided a ∈ z and a = z are decidable for all z Lemmas 4 and 5 follow by HF induction on x.

Gert Smolka (Saarland University) 12 / 21

slide-13
SLIDE 13

Partition Operator

∀x. x = ∅ + Σay. x = a.y ∧ a / ∈ y Can be constructed with HF induction on x using decidability of membership and equality

Gert Smolka (Saarland University) 13 / 21

slide-14
SLIDE 14

Construction of Union x ∪ y

Recursive specification ∅ ∪ y = y (a.x) ∪ y = a.(x.y) Extensional specification z ∈ x ∪ y ↔ z ∈ x ∨ z ∈ y Both have unique solution Recall: Axiomatisation doesn’t provide recursor Both are satisfied by unique function of type ∀xy Σu ∀z. z ∈ u ↔ z ∈ x ∨ z ∈ y

  • btainable with HF induction on x following recursive specification

Gert Smolka (Saarland University) 14 / 21

slide-15
SLIDE 15

Naive Recursor Dosn’t Exist

f ∅ := ∅ f (a.x) := a If f exists, all sets are equal: a = f (a.b.∅) = f (b.a.∅) = b

Gert Smolka (Saarland University) 15 / 21

slide-16
SLIDE 16

Other Set Operations

big union power set separation replacement transitive closure can be constructed similar to binary union

Gert Smolka (Saarland University) 16 / 21

slide-17
SLIDE 17

Cardinality

Ordinals O ∅ Ox O(x.x) Equipotence ∅ ∼ ∅ a / ∈ x b / ∈ y x ∼ y a.x ∼ b.y Cardinality relation C∅∅ a / ∈ x Cxα C(a.x)(α.α) Cardinality function can be obtained from cardinality relation Subtype of ordinals yields model of Peano axioms

Gert Smolka (Saarland University) 17 / 21

slide-18
SLIDE 18

Categoricity

Let X and Y be HF structures. Construct an isomorphism between X and Y as follows: Define inductive predicate R : X → Y → Prop R∅∅ Rab Rxy R(a.x)(b.y) R is total R is functional

follows with ∈-induction, extensionality, and Rxy → a ∈ x → ∃b. b ∈ y ∧ Rab

R is symmetric R yields isomorphism between X and Y

Gert Smolka (Saarland University) 18 / 21

slide-19
SLIDE 19

Two Model Constructions

1 HF sets as numbers (Ackermann’s encoding) 2 Quotient of binary tree type

s, t, u ::= ∅ | s.t s.s.t ≈ s.t cancel s.t.u ≈ t.s.u swap Quotient obtained as subtype of lexically sorted trees ∅ < s.t s < s′ s.t < s′.t′ t < t′ s.t < s.t′ Insertion sort provides normalizer for s ≈ t

Gert Smolka (Saarland University) 19 / 21

slide-20
SLIDE 20

Formalisation in Coq

2000 lines of Coq Tactic-based automation is essential for simple facts about sets Coq proofs agree with mathematical proofs Impredicative Prop (probably not essential) Inductive types only needed for model construction

Gert Smolka (Saarland University) 20 / 21

slide-21
SLIDE 21

Future Work

Dependently typed recursor HF as least fixed point of finite sets: HF := finset (HF) Non-wellfounded sets

Gert Smolka (Saarland University) 21 / 21