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 definition Pure sets An HF set is a set whose transitive closure is finite Transitive closure: least superset closed under elements of elements ∈ x ) We consider only wellfounded HF sets (e.g., x / All sets are well-founded in ZF set theory Gert Smolka (Saarland University) 2 / 21
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
Adjunction x . y := { x } ∪ y Similar to cons for lists Can express membership: x ∈ y ↔ x . y = y Gert Smolka (Saarland University) 4 / 21
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
HF Sets Simplify G¨ odel’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
Peano Axiomatisation of Numbers N : Type, 0 : N , S : N → N ∀ p . p 0 → ( ∀ 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
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
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
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
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
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 If x = a and x ∈ y are decidable, x ∈ a . y is decidable 2 3 If a ∈ y and x ⊆ y are decidable, a . x ⊆ y is decidable ∅ ∈ x is decidable 4 a ∈ x → Σ u . x = a . u ∧ a / ∈ u 5 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
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
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 obtainable with HF induction on x following recursive specification Gert Smolka (Saarland University) 14 / 21
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
Other Set Operations big union power set separation replacement transitive closure can be constructed similar to binary union Gert Smolka (Saarland University) 16 / 21
Cardinality Ordinals O x O ∅ O ( x . x ) Equipotence a / ∈ x b / ∈ y x ∼ y ∅ ∼ ∅ a . x ∼ b . y Cardinality relation a / ∈ x Cx α C ∅∅ 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
Categoricity Let X and Y be HF structures. Construct an isomorphism between X and Y as follows: Define inductive predicate R : X → Y → Prop Rab Rxy R ∅∅ 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
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 < s ′ t < t ′ ∅ < s . t s . t < s ′ . t ′ s . t < s . t ′ Insertion sort provides normalizer for s ≈ t Gert Smolka (Saarland University) 19 / 21
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
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
Recommend
More recommend