Cardinality of Set Partitions

Cardinality of Set Partitions

Cardinality of Set Partitions Lukas Bulwahn February 23, 2021 Abstract The theory’s main theorem states that the cardinality of set parti- tions of size k on a carrier set of size n is expressed by Stirling numbers of the second kind. In Isabelle, Stirling numbers of the second kind are defined in the AFP entry ‘Discrete Summation’ [1] through their well-known recurrence relation. The main theorem relates them to the alternative definition as cardinality of set partitions. The proof follows the simple and short explanation in Richard P. Stanley’s ‘Enumerative Combinatorics: Volume 1’ [2] and Wikipedia [3], and unravels the full details and implicit reasoning steps of these explanations. Contents 1 Set Partitions 1 1.1 Useful Additions to Main Theories ............... 2 1.2 Introduction and Elimination Rules ............... 2 1.3 Basic Facts on Set Partitions .................. 2 1.4 The Unique Part Containing an Element in a Set Partition . 4 1.5 Cardinality of Parts in a Set Partition ............. 5 1.6 Operations on Set Partitions .................. 5 2 Combinatorial Basics 6 2.1 Preliminaries ........................... 6 2.1.1 Injectivity and Disjoint Families ............ 6 2.1.2 Cardinality Theorems for Set.bind ........... 6 2.2 Third Version of Injectivity Solver ............... 7 3 Cardinality of Set Partitions 8 1 Set Partitions theory Set-Partition imports HOL−Library:Disjoint-Sets 1 HOL−Library:FuncSet begin 1.1 Useful Additions to Main Theories lemma set-eqI 0: assumes Vx: x 2 A =) x 2 B assumes Vx: x 2 B =) x 2 A shows A = B hproof i lemma comp-image: ((‘) f ◦ (‘) g) = (‘)(f o g) hproof i 1.2 Introduction and Elimination Rules The definition of partition-on is in HOL−Library:Disjoint-Sets. lemma partition-onI : assumes Vp: p 2 P =) p 6= fg assumes S P = A assumes Vp p 0: p 2 P =) p 0 2 P =) p 6= p 0 =) p \ p 0 = fg shows partition-on A P hproof i lemma partition-onE: assumes partition-on A P obtains Vp: p 2 P =) p 6= fg S P = A Vp p 0: p 2 P =) p 0 2 P =) p 6= p 0 =) p \ p 0 = fg hproof i 1.3 Basic Facts on Set Partitions lemma partition-onD4: partition-on A P =) p 2 P =) q 2 P =) x 2 p =) x 2 q =) p = q hproof i lemma partition-subset-imp-notin: assumes partition-on A P X 2 P assumes X 0 ⊂ X shows X 0 2= P hproof i lemma partition-on-Diff : assumes P: partition-on A P shows Q ⊆ P =) partition-on (A − S Q)(P − Q) hproof i 2 lemma partition-on-UN: assumes A: partition-on A B and B: Vb: b 2 B =) partition-on b (P b) shows partition-on A (S b2B: P b) hproof i lemma partition-on-notemptyI : assumes partition-on A P assumes A 6= fg shows P 6= fg hproof i lemma partition-on-disjoint: assumes partition-on A P assumes partition-on B Q assumes A \ B = fg shows P \ Q = fg hproof i lemma partition-on-eq-implies-eq-carrier: assumes partition-on A Q assumes partition-on B Q shows A = B hproof i lemma partition-on-insert: assumes partition-on A P assumes disjnt A X X 6= fg assumes A [ X = A 0 shows partition-on A 0 (insert X P) hproof i An alternative formulation of [[partition-on ?A ?P; disjnt ?A ?X; ?X 6= fg; ?A [ ?X = ?A 0]] =) partition-on ?A 0 (insert ?X ?P) lemma partition-on-insert 0: assumes partition-on (A − X) P assumes X ⊆ AX 6= fg shows partition-on A (insert X P) hproof i lemma partition-on-insert-singleton: assumes partition-on A P a 2= A insert a A = A 0 shows partition-on A 0 (insert fag P) hproof i lemma partition-on-remove-singleton: assumes partition-on A P X 2 PA − X = A 0 shows partition-on A 0 (P − fXg) hproof i 3 1.4 The Unique Part Containing an Element in a Set Parti- tion lemma partition-on-partition-on-unique: assumes partition-on A P assumes x 2 A shows 9 !X: x 2 X ^ X 2 P hproof i lemma partition-on-the-part-mem: assumes partition-on A P assumes x 2 A shows (THE X: x 2 X ^ X 2 P) 2 P hproof i lemma partition-on-in-the-unique-part: assumes partition-on A P assumes x 2 A shows x 2 (THE X: x 2 X ^ X 2 P) hproof i lemma partition-on-the-part-eq: assumes partition-on A P assumes x 2 XX 2 P shows (THE X: x 2 X ^ X 2 P) = X hproof i lemma the-unique-part-alternative-def : assumes partition-on A P assumes x 2 A shows (THE X: x 2 X ^ X 2 P) = fy: 9 X2P: x 2 X ^ y 2 Xg hproof i lemma partition-on-all-in-part-eq-part: assumes partition-on A P assumes X 0 2 P shows fx 2 A: (THE X: x 2 X ^ X 2 P) = X 0g = X 0 hproof i lemma partition-on-part-characteristic: assumes partition-on A P assumes X 2 P x 2 X shows X = fy: 9 X2P: x 2 X ^ y 2 Xg hproof i lemma partition-on-no-partition-outside-carrier: assumes partition-on A P assumes x 2= A shows fy: 9 X2P: x 2 X ^ y 2 Xg = fg 4 hproof i 1.5 Cardinality of Parts in a Set Partition lemma partition-on-le-set-elements: assumes finite A assumes partition-on A P shows card P ≤ card A hproof i 1.6 Operations on Set Partitions lemma partition-on-union: assumes A \ B = fg assumes partition-on A P assumes partition-on B Q shows partition-on (A [ B)(P [ Q) hproof i lemma partition-on-split1: assumes partition-on A (P [ Q) shows partition-on (S P) P hproof i lemma partition-on-split2: assumes partition-on A (P [ Q) shows partition-on (S Q) Q hproof i lemma partition-on-intersect-on-elements: assumes partition-on (A [ C) P assumes 8 X 2 P: 9 x: x 2 X \ C shows partition-on C ((λX: X \ C) ‘P) hproof i lemma partition-on-insert-elements: assumes A \ B = fg assumes partition-on B P assumes f 2 A !E P shows partition-on (A [ B) ((λX: X [ fx 2 A: f x = Xg) ‘P)(is partition-on - ?P) hproof i lemma partition-on-map: assumes inj-on f A assumes partition-on A P shows partition-on (f ‘ A) ((‘) f ‘ P) hproof i lemma set-of-partition-on-map: 5 assumes inj-on f A shows (‘) ((‘) f ) ‘ fP: partition-on A Pg = fP: partition-on (f ‘ A) Pg hproof i end 2 Combinatorial Basics theory Injectivity-Solver imports HOL−Library:Disjoint-Sets HOL−Library:Monad-Syntax HOL−Eisbach:Eisbach begin 2.1 Preliminaries These lemmas shall be added to the Disjoint Set theory. 2.1.1 Injectivity and Disjoint Families lemma inj-on-impl-disjoint-family-on-singleton: assumes inj-on f A shows disjoint-family-on (λx: ff xg) A hproof i 2.1.2 Cardinality Theorems for Set.bind lemma card-bind: assumes finite S assumes 8 X 2 S: finite (f X) assumes disjoint-family-on f S shows card (S >>= f ) = (P x2S: card (f x)) hproof i lemma card-bind-constant: assumes finite S assumes 8 X 2 S: finite (f X) assumes disjoint-family-on f S assumes Vx: x 2 S =) card (f x) = k shows card (S >>= f ) = card S ∗ k hproof i lemma card-bind-singleton: assumes finite S assumes inj-on f S shows card (S >>= (λx: ff xg)) = card S hproof i 6 2.2 Third Version of Injectivity Solver Here, we provide a third version of the injectivity solver. The original first version was provided in the AFP entry ‘Spivey’s Generalized Recurrence for Bell Numbers‘. From that method, I derived a second version in the AFP entry ‘Cardinality of Equivalence Relations‘. At roughly the same time, Makarius improved the injectivity solver in the development version of the first AFP entry. This third version now includes the improvements of the second version and Makarius improvements to the first, and it further extends the method to handle the new cases in the cardinality proof of this AFP entry. As the implementation of the injectivity solver only evolves in the de- velopment branch of the AFP, the submissions of the three AFP entries that employ the injectivity solver, have to create clones of the injectivity solver for the identified and needed method adjustments. Ultimately, these three clones should only remain in the stable branches of the AFP from Is- abelle2016 to Isabelle2017 to work with their corresponding release versions. In the development version, I have now consolidated the three versions here. In the next step, I will move this version of the injectivity solver in the HOL−Library:Disjoint-Sets and it will hopefully only evolve further there. lemma disjoint-family-onI : assumes Vi j: i 2 I ^ j 2 I =) i 6= j =) (A i) \ (A j) = fg shows disjoint-family-on A I hproof i lemma disjoint-bind: VS T f g: (Vs t: S s ^ T t =) f s \ g t = fg) =) (fs: S sg >>= f ) \ (ft: T tg >>= g) = fg hproof i lemma disjoint-bind 0: VS T f g: (Vs t: s 2 S ^ t 2 T =) f s \ g t = fg) =) (S >>= f ) \ (T >>= g) = fg hproof i lemma injectivity-solver-CollectE: assumes a 2 fx: P xg ^ a 0 2 fx: P 0 xg assumes (P a ^ P 0 a 0) =) W shows W hproof i lemma injectivity-solver-prep-assms-Collect: assumes x 2 fx: P xg shows P x ^ P x hproof i lemma injectivity-solver-prep-assms: x 2 A =) x 2 A ^ x 2 A hproof i 7 lemma disjoint-terminal-singleton: Vs t X Y : s 6= t =) (X = Y =) s = t) =) fXg \ fY g = fg hproof i lemma disjoint-terminal-Collect: assumes s 6= t assumes Vx x 0: S x ^ T x 0 =) x = x 0 =) s = t shows fx: S xg \ fx: T xg = fg hproof i lemma disjoint-terminal: s 6= t =) (Vx x 0: x 2 S ^ x 0 2 T =) x = x 0 =) s = t) =) S \ T = fg hproof i lemma elim-singleton: assumes x 2 fsg ^ x 0 2 ftg obtains x = s ^ x 0 = t hproof i method injectivity-solver uses rule = insert method-facts; use nothing in h ((drule injectivity-solver-prep-assms-Collect j drule injectivity-solver-prep-assms)+)?; rule disjoint-family-onI ; ((rule disjoint-bind j rule disjoint-bind 0)+)?; (erule elim-singleton)?; (erule disjoint-terminal-singleton j erule disjoint-terminal-Collect j erule dis- joint-terminal); (elim injectivity-solver-CollectE)?; rule rule; assumption+ i end 3 Cardinality of Set Partitions theory Card-Partitions imports HOL−Library:Stirling Set-Partition Injectivity-Solver begin lemma set-partition-on-insert-with-fixed-card-eq: assumes finite A assumes a 2= A shows fP: partition-on (insert a A) P ^ card

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us