theory_file stringlengths 5 95 | lemma_name stringlengths 5 250 | lemma_command stringlengths 17 21.3k ⌀ | lemma_object stringlengths 5 62.8k | template stringlengths 7 63.6k | symbols sequencelengths 0 85 | defs sequencelengths 0 60 |
|---|---|---|---|---|---|---|
Combinatorial_Enumeration_Algorithms/n_Sequences | n_Sequences.n_sequences_card | theorem n_sequences_card:
assumes "finite A"
shows "card (n_sequences A n) = card A ^ n" | finite ?A \<Longrightarrow> card (n_sequences ?A ?n) = card ?A ^ ?n | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1 x_2) = ?H4 (?H5 x_1) x_2 | [
"Power.power_class.power",
"n_Sequences.n_sequences",
"Finite_Set.card",
"Finite_Set.finite"
] | [
"primrec power :: \"'a \\<Rightarrow> nat \\<Rightarrow> 'a\" (infixr \"^\" 80)\n where\n power_0: \"a ^ 0 = 1\"\n | power_Suc: \"a ^ Suc n = a * a ^ n\"",
"definition n_sequences :: \"'a set \\<Rightarrow> nat \\<Rightarrow> 'a list set\" where\n \"n_sequences A n = {xs. set xs \\<subseteq> A \\<and> leng... |
Combinatorial_Enumeration_Algorithms/n_Sequences | n_Sequences.n_sequence_enum_correct | theorem n_sequence_enum_correct:
"set (n_sequence_enum xs n) = n_sequences (set xs) n" | set (n_sequence_enum ?xs ?n) = n_sequences (set ?xs) ?n | ?H1 (?H2 x_1 x_2) = ?H3 (?H4 x_1) x_2 | [
"n_Sequences.n_sequences",
"n_Sequences.n_sequence_enum",
"List.list.set"
] | [
"definition n_sequences :: \"'a set \\<Rightarrow> nat \\<Rightarrow> 'a list set\" where\n \"n_sequences A n = {xs. set xs \\<subseteq> A \\<and> length xs = n}\"",
"fun n_sequence_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_sequence_enum xs 0 = [[]]\"\n| \"n_sequence_enum xs... |
Combinatorial_Enumeration_Algorithms/n_Sequences | n_Sequences.n_sequence_enum_length | lemma n_sequence_enum_length:
"length (n_sequence_enum xs n) = (length xs) ^ n " | length (n_sequence_enum ?xs ?n) = length ?xs ^ ?n | ?H1 (?H2 x_1 x_2) = ?H3 (?H4 x_1) x_2 | [
"Power.power_class.power",
"n_Sequences.n_sequence_enum",
"List.length"
] | [
"primrec power :: \"'a \\<Rightarrow> nat \\<Rightarrow> 'a\" (infixr \"^\" 80)\n where\n power_0: \"a ^ 0 = 1\"\n | power_Suc: \"a ^ Suc n = a * a ^ n\"",
"fun n_sequence_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_sequence_enum xs 0 = [[]]\"\n| \"n_sequence_enum xs (Suc... |
Combinatorial_Enumeration_Algorithms/n_Sequences | n_Sequences.n_sequence_enum_distinct | theorem n_sequence_enum_distinct:
"distinct xs \<Longrightarrow> distinct (n_sequence_enum xs n)" | distinct ?xs \<Longrightarrow> distinct (n_sequence_enum ?xs ?n) | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1 x_2) | [
"n_Sequences.n_sequence_enum",
"List.distinct"
] | [
"fun n_sequence_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_sequence_enum xs 0 = [[]]\"\n| \"n_sequence_enum xs (Suc n) = [x#r . x \\<leftarrow> xs, r \\<leftarrow> n_sequence_enum xs n]\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftri... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_correct_aux1 | lemma derangement_enum_correct_aux1:
"\<lbrakk>distinct zs;length ys = length zs; length ys = length xs; set ys = set zs; no_overlap xs zs\<rbrakk>
\<Longrightarrow> zs \<in> set (derangement_enum_aux xs ys)" | distinct ?zs \<Longrightarrow> length ?ys = length ?zs \<Longrightarrow> length ?ys = length ?xs \<Longrightarrow> set ?ys = set ?zs \<Longrightarrow> no_overlap ?xs ?zs \<Longrightarrow> ?zs \<in> set (derangement_enum_aux ?xs ?ys) | \<lbrakk>?H1 x_1; ?H2 x_2 = ?H2 x_1; ?H2 x_2 = ?H2 x_3; ?H3 x_2 = ?H3 x_1; ?H4 x_3 x_1\<rbrakk> \<Longrightarrow> x_1 \<in> ?H5 (?H6 x_3 x_2) | [
"Derangements_Enum.derangement_enum_aux",
"Derangements_Enum.no_overlap",
"List.list.set",
"List.length",
"List.distinct"
] | [
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> derangement_enum_aux xs (remove1 y ys), y \\<noteq> x]\"",
"fun no_overlap :: \"'a list \\<Rig... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.nth_no_overlap | lemma nth_no_overlap: "length xs = length ys \<Longrightarrow> \<forall> i < length xs. xs ! i \<noteq> ys ! i \<Longrightarrow> no_overlap xs ys" | length ?xs = length ?ys \<Longrightarrow> \<forall>i<length ?xs. ?xs ! i \<noteq> ?ys ! i \<Longrightarrow> no_overlap ?xs ?ys | \<lbrakk>?H1 x_1 = ?H1 x_2; \<forall>y_0<?H1 x_1. ?H2 x_1 y_0 \<noteq> ?H2 x_2 y_0\<rbrakk> \<Longrightarrow> ?H3 x_1 x_2 | [
"Derangements_Enum.no_overlap",
"List.nth",
"List.length"
] | [
"fun no_overlap :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> bool\" where\n \"no_overlap _ [] = True\"\n| \"no_overlap [] _ = True\"\n| \"no_overlap (x#xs) (y#ys) = (x \\<noteq> y \\<and> no_overlap xs ys)\"",
"primrec (nonexhaustive) nth :: \"'a list => nat => 'a\" (infixl \"!\" 100) where\nnth_Cons: \"(x... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.no_overlap_nth | lemma no_overlap_nth: "length xs = length ys \<Longrightarrow> i < length xs \<Longrightarrow> no_overlap xs ys \<Longrightarrow> xs ! i \<noteq> ys ! i" | length ?xs = length ?ys \<Longrightarrow> ?i < length ?xs \<Longrightarrow> no_overlap ?xs ?ys \<Longrightarrow> ?xs ! ?i \<noteq> ?ys ! ?i | \<lbrakk>?H1 x_1 = ?H1 x_2; x_3 < ?H1 x_1; ?H2 x_1 x_2\<rbrakk> \<Longrightarrow> ?H3 x_1 x_3 \<noteq> ?H3 x_2 x_3 | [
"List.nth",
"Derangements_Enum.no_overlap",
"List.length"
] | [
"primrec (nonexhaustive) nth :: \"'a list => nat => 'a\" (infixl \"!\" 100) where\nnth_Cons: \"(x # xs) ! n = (case n of 0 \\<Rightarrow> x | Suc k \\<Rightarrow> xs ! k)\"\n \\<comment> \\<open>Warning: simpset does not contain this definition, but separate\n theorems for \\<open>n = 0\\<close> and \\<open>... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_set | lemma derangement_enum_aux_set:
"length xs = length ys \<Longrightarrow> zs \<in> set (derangement_enum_aux xs ys) \<Longrightarrow> set zs = set ys" | length ?xs = length ?ys \<Longrightarrow> ?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> set ?zs = set ?ys | \<lbrakk>?H1 x_1 = ?H1 x_2; x_3 \<in> ?H2 (?H3 x_1 x_2)\<rbrakk> \<Longrightarrow> ?H4 x_3 = ?H4 x_2 | [
"Derangements_Enum.derangement_enum_aux",
"List.list.set",
"List.length"
] | [
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> derangement_enum_aux xs (remove1 y ys), y \\<noteq> x]\"",
"datatype (set: 'a) list =\n Nil... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_not_in | lemma derangement_enum_aux_not_in: "y \<notin> set ys \<Longrightarrow> zs \<in> set (derangement_enum_aux xs ys) \<Longrightarrow> y \<notin> set zs" | ?y \<notin> set ?ys \<Longrightarrow> ?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> ?y \<notin> set ?zs | \<lbrakk>?H1 x_1 (?H2 x_2); x_3 \<in> ?H3 (?H4 x_4 x_2)\<rbrakk> \<Longrightarrow> ?H1 x_1 (?H2 x_3) | [
"Derangements_Enum.derangement_enum_aux",
"List.list.set",
"Set.not_member"
] | [
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> derangement_enum_aux xs (remove1 y ys), y \\<noteq> x]\"",
"datatype (set: 'a) list =\n Nil... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_in | lemma derangement_enum_aux_in: "y \<in> set zs \<Longrightarrow> zs \<in> set (derangement_enum_aux xs ys) \<Longrightarrow> y \<in> set ys" | ?y \<in> set ?zs \<Longrightarrow> ?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> ?y \<in> set ?ys | \<lbrakk>x_1 \<in> ?H1 x_2; x_2 \<in> ?H2 (?H3 x_3 x_4)\<rbrakk> \<Longrightarrow> x_1 \<in> ?H1 x_4 | [
"Derangements_Enum.derangement_enum_aux",
"List.list.set"
] | [
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> derangement_enum_aux xs (remove1 y ys), y \\<noteq> x]\"",
"datatype (set: 'a) list =\n Nil... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_distinct_elem | lemma derangement_enum_aux_distinct_elem: "distinct ys \<Longrightarrow> zs \<in> set (derangement_enum_aux xs ys) \<Longrightarrow> distinct zs" | distinct ?ys \<Longrightarrow> ?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> distinct ?zs | \<lbrakk>?H1 x_1; x_2 \<in> ?H2 (?H3 x_3 x_1)\<rbrakk> \<Longrightarrow> ?H1 x_2 | [
"Derangements_Enum.derangement_enum_aux",
"List.list.set",
"List.distinct"
] | [
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> derangement_enum_aux xs (remove1 y ys), y \\<noteq> x]\"",
"datatype (set: 'a) list =\n Nil... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_elem_length | lemma derangement_enum_aux_elem_length: "zs \<in> set (derangement_enum_aux xs ys) \<Longrightarrow> length xs = length zs" | ?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> length ?xs = length ?zs | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_2 = ?H3 x_1 | [
"List.length",
"Derangements_Enum.derangement_enum_aux",
"List.list.set"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> dera... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_no_overlap | lemma derangement_enum_aux_no_overlap: "zs \<in> set (derangement_enum_aux xs ys) \<Longrightarrow> no_overlap xs zs" | ?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> no_overlap ?xs ?zs | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_2 x_1 | [
"Derangements_Enum.no_overlap",
"Derangements_Enum.derangement_enum_aux",
"List.list.set"
] | [
"fun no_overlap :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> bool\" where\n \"no_overlap _ [] = True\"\n| \"no_overlap [] _ = True\"\n| \"no_overlap (x#xs) (y#ys) = (x \\<noteq> y \\<and> no_overlap xs ys)\"",
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_correct | theorem derangement_enum_correct: "distinct xs \<Longrightarrow> derangements xs = set (derangement_enum xs)" | distinct ?xs \<Longrightarrow> derangements ?xs = set (derangement_enum ?xs) | ?H1 x_1 \<Longrightarrow> ?H2 x_1 = ?H3 (?H4 x_1) | [
"Derangements_Enum.derangement_enum",
"List.list.set",
"Derangements_Enum.derangements",
"List.distinct"
] | [
"fun derangement_enum :: \"'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum xs = derangement_enum_aux xs xs\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_aux_distinct | lemma derangement_enum_aux_distinct: "distinct ys \<Longrightarrow> distinct (derangement_enum_aux xs ys)" | distinct ?ys \<Longrightarrow> distinct (derangement_enum_aux ?xs ?ys) | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_2 x_1) | [
"Derangements_Enum.derangement_enum_aux",
"List.distinct"
] | [
"fun derangement_enum_aux :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum_aux [] ys = [[]]\"\n| \"derangement_enum_aux (x#xs) ys = [y#r . y \\<leftarrow> ys, r \\<leftarrow> derangement_enum_aux xs (remove1 y ys), y \\<noteq> x]\"",
"primrec distinct :: \"'a list \\<R... |
Combinatorial_Enumeration_Algorithms/Derangements_Enum | Derangements_Enum.derangement_enum_distinct | theorem derangement_enum_distinct: "distinct xs \<Longrightarrow> distinct (derangement_enum xs)" | distinct ?xs \<Longrightarrow> distinct (derangement_enum ?xs) | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1) | [
"Derangements_Enum.derangement_enum",
"List.distinct"
] | [
"fun derangement_enum :: \"'a list \\<Rightarrow> 'a list list\" where\n \"derangement_enum xs = derangement_enum_aux xs xs\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftrightarrow> True\" |\n\"distinct (x # xs) \\<longleftrightarrow> x \\<notin> set xs \\<and> distinct... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_distinct_concat_map_function_filter | lemma inj2_distinct_concat_map_function_filter:
assumes "inj2 f"
shows"\<lbrakk>\<forall> x \<in> set xs. distinct (g x); distinct xs\<rbrakk> \<Longrightarrow> distinct [f x y. x \<leftarrow> xs, y \<leftarrow> g x, h x]" | inj2 ?f \<Longrightarrow> \<forall>x\<in>set ?xs. distinct (?g x) \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. concat (map (\<lambda>y. if ?h x then [?f x y] else []) (?g x))) ?xs)) | \<lbrakk>?H1 x_1; \<forall>y_0\<in>?H2 x_2. ?H3 (x_3 y_0); ?H4 x_2\<rbrakk> \<Longrightarrow> ?H5 (?H6 (?H7 (\<lambda>y_1. ?H6 (?H8 (\<lambda>y_2. if x_4 y_1 then ?H9 (x_1 y_1 y_2) ?H10 else ?H10) (x_3 y_1))) x_2)) | [
"List.list.Nil",
"List.list.Cons",
"List.list.map",
"List.concat",
"List.distinct",
"List.list.set",
"Common_Lemmas.inj2"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.length_concat_map_function_sum_list | lemma length_concat_map_function_sum_list:
assumes "\<And> x. x \<in> set xs \<Longrightarrow> length (g x) = h x"
shows "length [f x r . x \<leftarrow> xs, r \<leftarrow> g x] = sum_list (map h xs)" | (\<And>x. x \<in> set ?xs \<Longrightarrow> length (?g x) = ?h x) \<Longrightarrow> length (concat (map (\<lambda>x. map (?f x) (?g x)) ?xs)) = sum_list (map ?h ?xs) | (\<And>y_0. y_0 \<in> ?H1 x_1 \<Longrightarrow> ?H2 (x_2 y_0) = x_3 y_0) \<Longrightarrow> ?H3 (?H4 (?H5 (\<lambda>y_1. ?H6 (x_4 y_1) (x_2 y_1)) x_1)) = ?H7 (?H8 x_3 x_1) | [
"Groups_List.monoid_add_class.sum_list",
"List.list.map",
"List.concat",
"List.length",
"List.list.set"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec concat:: \"'a list list \\<Rightarrow> 'a list\" where\n\"concat [] = []\" |\n\"concat (x # xs) = x @ concat xs\"",
"abbr... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_distinct_concat_map_function | lemma inj2_distinct_concat_map_function:
assumes "inj2 f"
shows"\<lbrakk>\<forall> x \<in> set xs. distinct (g x); distinct xs\<rbrakk> \<Longrightarrow> distinct [f x y. x \<leftarrow> xs, y \<leftarrow> g x]" | inj2 ?f \<Longrightarrow> \<forall>x\<in>set ?xs. distinct (?g x) \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map (?f x) (?g x)) ?xs)) | \<lbrakk>?H1 x_1; \<forall>y_0\<in>?H2 x_2. ?H3 (x_3 y_0); ?H4 x_2\<rbrakk> \<Longrightarrow> ?H5 (?H6 (?H7 (\<lambda>y_1. ?H8 (x_1 y_1) (x_3 y_1)) x_2)) | [
"List.list.map",
"List.concat",
"List.distinct",
"List.list.set",
"Common_Lemmas.inj2"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec concat:: \"'a list list \\<Rightarrow> 'a list\" where\n\"concat [] = []\" |\n\"concat (x # xs) = x @ concat xs\"",
"prim... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_on_distinct_concat_map | lemma inj2_on_distinct_concat_map:
assumes "inj2_on f (set xs) (set ys)"
shows "\<lbrakk>distinct ys; distinct xs\<rbrakk> \<Longrightarrow> distinct [f x y. x \<leftarrow> xs, y \<leftarrow> ys]" | inj2_on ?f (set ?xs) (set ?ys) \<Longrightarrow> distinct ?ys \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map (?f x) ?ys) ?xs)) | \<lbrakk>?H1 x_1 (?H2 x_2) (?H3 x_3); ?H4 x_3; ?H5 x_2\<rbrakk> \<Longrightarrow> ?H6 (?H7 (?H8 (\<lambda>y_0. ?H9 (x_1 y_0) x_3) x_2)) | [
"List.list.map",
"List.concat",
"List.distinct",
"List.list.set",
"Common_Lemmas.inj2_on"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec concat:: \"'a list list \\<Rightarrow> 'a list\" where\n\"concat [] = []\" |\n\"concat (x # xs) = x @ concat xs\"",
"prim... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Cons_Suc_distinct_concat_map_function | lemma Cons_Suc_distinct_concat_map_function:
"\<lbrakk>\<forall> x \<in> set xs. distinct (g x) ; distinct xs\<rbrakk> \<Longrightarrow> distinct [Suc x # y. x \<leftarrow> xs, y \<leftarrow> g x]" | \<forall>x\<in>set ?xs. distinct (?g x) \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map ((#) (Suc x)) (?g x)) ?xs)) | \<lbrakk>\<forall>y_0\<in>?H1 x_1. ?H2 (x_2 y_0); ?H3 x_1\<rbrakk> \<Longrightarrow> ?H2 (?H4 (?H5 (\<lambda>y_1. ?H6 (?H7 (?H8 y_1)) (x_2 y_1)) x_1)) | [
"Nat.Suc",
"List.list.Cons",
"List.list.map",
"List.concat",
"List.distinct",
"List.list.set"
] | [
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n ... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_distinct_concat_map | lemma inj2_distinct_concat_map:
assumes "inj2 f"
shows "\<lbrakk>distinct ys; distinct xs\<rbrakk> \<Longrightarrow> distinct [f x y. x \<leftarrow> xs, y \<leftarrow> ys]" | inj2 ?f \<Longrightarrow> distinct ?ys \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map (?f x) ?ys) ?xs)) | \<lbrakk>?H1 x_1; ?H2 x_2; ?H3 x_3\<rbrakk> \<Longrightarrow> ?H4 (?H5 (?H6 (\<lambda>y_0. ?H7 (x_1 y_0) x_2) x_3)) | [
"List.list.map",
"List.concat",
"List.distinct",
"Common_Lemmas.inj2"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec concat:: \"'a list list \\<Rightarrow> 'a list\" where\n\"concat [] = []\" |\n\"concat (x # xs) = x @ concat xs\"",
"prim... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Cons_distinct_concat_map_function | lemma Cons_distinct_concat_map_function:
"\<lbrakk>\<forall> x \<in> set xs. distinct (g x) ; distinct xs\<rbrakk> \<Longrightarrow> distinct [x # y. x \<leftarrow> xs, y \<leftarrow> g x]" | \<forall>x\<in>set ?xs. distinct (?g x) \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map ((#) x) (?g x)) ?xs)) | \<lbrakk>\<forall>y_0\<in>?H1 x_1. ?H2 (x_2 y_0); ?H3 x_1\<rbrakk> \<Longrightarrow> ?H2 (?H4 (?H5 (\<lambda>y_1. ?H6 (?H7 y_1) (x_2 y_1)) x_1)) | [
"List.list.Cons",
"List.list.map",
"List.concat",
"List.distinct",
"List.list.set"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Cons_distinct_concat_map_function_distinct_on_all | lemma Cons_distinct_concat_map_function_distinct_on_all:
"\<lbrakk>\<forall> x. distinct (g x) ; distinct xs\<rbrakk> \<Longrightarrow> distinct [x # y. x \<leftarrow> xs, y \<leftarrow> g x]" | \<forall>x. distinct (?g x) \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map ((#) x) (?g x)) ?xs)) | \<lbrakk>\<forall>y_0. ?H1 (x_1 y_0); ?H2 x_2\<rbrakk> \<Longrightarrow> ?H1 (?H3 (?H4 (\<lambda>y_1. ?H5 (?H6 y_1) (x_1 y_1)) x_2)) | [
"List.list.Cons",
"List.list.map",
"List.concat",
"List.distinct"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.sum_list_extract_last | lemma sum_list_extract_last: "(\<Sum>x\<leftarrow>[0..<Suc n]. f x) = (\<Sum>x\<leftarrow>[0..<n]. f x) + f n" | sum_list (map ?f [0..<Suc ?n]) = sum_list (map ?f [0..<?n]) + ?f ?n | ?H1 (?H2 x_1 (?H3 ?H4 (?H5 x_2))) = ?H6 (?H1 (?H2 x_1 (?H3 ?H4 x_2))) (x_1 x_2) | [
"Groups.plus_class.plus",
"Nat.Suc",
"Groups.zero_class.zero",
"List.upt",
"List.list.map",
"Groups_List.monoid_add_class.sum_list"
] | [
"class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)",
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"",
"class zero =\n fixes zero :: 'a (\"0\")",
"primrec upt :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list\" (\"(... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Node_right_distinct_concat_map | lemma Node_right_distinct_concat_map:
"\<lbrakk>distinct ys; distinct xs\<rbrakk> \<Longrightarrow> distinct [Node x e y. x \<leftarrow> xs, y \<leftarrow> ys]" | distinct ?ys \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map (Node x ?e) ?ys) ?xs)) | \<lbrakk>?H1 x_1; ?H1 x_2\<rbrakk> \<Longrightarrow> ?H1 (?H2 (?H3 (\<lambda>y_0. ?H4 (?H5 y_0 x_3) x_1) x_2)) | [
"Tree.tree.Node",
"List.list.map",
"List.concat",
"List.distinct"
] | [
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"t... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Cons_distinct_concat_map | lemma Cons_distinct_concat_map: "\<lbrakk>distinct ys; distinct xs\<rbrakk> \<Longrightarrow> distinct [x#y. x \<leftarrow> xs, y \<leftarrow> ys]" | distinct ?ys \<Longrightarrow> distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>x. map ((#) x) ?ys) ?xs)) | \<lbrakk>?H1 x_1; ?H2 x_2\<rbrakk> \<Longrightarrow> ?H1 (?H3 (?H4 (\<lambda>y_0. ?H5 (?H6 y_0) x_1) x_2)) | [
"List.list.Cons",
"List.list.map",
"List.concat",
"List.distinct"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_on_distinct_map | lemma inj2_on_distinct_map:
assumes "inj2_on f {x} (set xs)"
shows "distinct xs = distinct (map (f x) xs)" | inj2_on ?f {?x} (set ?xs) \<Longrightarrow> distinct ?xs = distinct (map (?f ?x) ?xs) | ?H1 x_1 (?H2 x_2 ?H3) (?H4 x_3) \<Longrightarrow> ?H5 x_3 = ?H6 (?H7 (x_1 x_2) x_3) | [
"List.list.map",
"List.distinct",
"List.list.set",
"Set.empty",
"Set.insert",
"Common_Lemmas.inj2_on"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftrightarrow> True\" |\n\"distinct (x # xs) \\<lo... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.length_concat_map | lemma length_concat_map: "length [f x r . x \<leftarrow> xs, r \<leftarrow> ys] = length ys * length xs" | length (concat (map (\<lambda>x. map (?f x) ?ys) ?xs)) = length ?ys * length ?xs | ?H1 (?H2 (?H3 (\<lambda>y_0. ?H4 (x_1 y_0) x_2) x_3)) = ?H5 (?H6 x_2) (?H7 x_3) | [
"Groups.times_class.times",
"List.list.map",
"List.concat",
"List.length"
] | [
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec concat:: \"'a list list ... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.leq_sum_to_sum_list | lemma leq_sum_to_sum_list: "(\<Sum>x \<le> n. f x) = (\<Sum>x\<leftarrow>[0..<Suc n]. f x)" | sum ?f {..?n} = sum_list (map ?f [0..<Suc ?n]) | ?H1 x_1 (?H2 x_2) = ?H3 (?H4 x_1 (?H5 ?H6 (?H7 x_2))) | [
"Nat.Suc",
"Groups.zero_class.zero",
"List.upt",
"List.list.map",
"Groups_List.monoid_add_class.sum_list",
"Set_Interval.ord_class.atMost",
"Groups_Big.comm_monoid_add_class.sum"
] | [
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"",
"class zero =\n fixes zero :: 'a (\"0\")",
"primrec upt :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list\" (\"(1[_..</_'])\") where\nupt_0: \"[i..<0] = []\" |\nupt_Suc: \"[i..<(Suc j)] = (if i \\<le> j then [... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.less_sum_to_sum_list | lemma less_sum_to_sum_list: "(\<Sum>x < n. f x) = (\<Sum>x\<leftarrow>[0..< n]. f x)" | sum ?f {..<?n} = sum_list (map ?f [0..<?n]) | ?H1 x_1 (?H2 x_2) = ?H3 (?H4 x_1 (?H5 ?H6 x_2)) | [
"Groups.zero_class.zero",
"List.upt",
"List.list.map",
"Groups_List.monoid_add_class.sum_list",
"Set_Interval.ord_class.lessThan",
"Groups_Big.comm_monoid_add_class.sum"
] | [
"class zero =\n fixes zero :: 'a (\"0\")",
"primrec upt :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list\" (\"(1[_..</_'])\") where\nupt_0: \"[i..<0] = []\" |\nupt_Suc: \"[i..<(Suc j)] = (if i \\<le> j then [i..<j] @ [j] else [])\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Suc_length_remove1 | lemma Suc_length_remove1: "x \<in> set xs \<Longrightarrow> Suc (length (remove1 x xs)) = length xs" | ?x \<in> set ?xs \<Longrightarrow> Suc (length (remove1 ?x ?xs)) = length ?xs | x_1 \<in> ?H1 x_2 \<Longrightarrow> ?H2 (?H3 (?H4 x_1 x_2)) = ?H3 x_2 | [
"List.remove1",
"List.length",
"Nat.Suc",
"List.list.set"
] | [
"primrec remove1 :: \"'a \\<Rightarrow> 'a list \\<Rightarrow> 'a list\" where\n\"remove1 x [] = []\" |\n\"remove1 x (y # xs) = (if x = y then xs else y # remove1 x xs)\"",
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"definition Suc :: \"nat \\<Rightarrow> nat\"\n ... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_distinct_map | lemma inj2_distinct_map:
assumes "inj2 f"
shows "distinct xs = distinct (map (f x) xs)" | inj2 ?f \<Longrightarrow> distinct ?xs = distinct (map (?f ?x) ?xs) | ?H1 x_1 \<Longrightarrow> ?H2 x_2 = ?H3 (?H4 (x_1 x_3) x_2) | [
"List.list.map",
"List.distinct",
"Common_Lemmas.inj2"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftrightarrow> True\" |\n\"distinct (x # xs) \\<lo... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.count_list_full_elem | lemma count_list_full_elem: "count_list xs y = length xs \<longleftrightarrow> (\<forall>x \<in> set xs. x = y)" | (count_list ?xs ?y = length ?xs) = (\<forall>x\<in>set ?xs. x = ?y) | (?H1 x_1 x_2 = ?H2 x_1) = (\<forall>y_0\<in>?H3 x_1. y_0 = x_2) | [
"List.list.set",
"List.length",
"List.count_list"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"primrec count_list :: \"'a list \\<Righ... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.count_list_length_replicate | lemma count_list_length_replicate: "count_list xs y = length xs \<longleftrightarrow> xs = replicate (length xs) y" | (count_list ?xs ?y = length ?xs) = (?xs = replicate (length ?xs) ?y) | (?H1 x_1 x_2 = ?H2 x_1) = (x_1 = ?H3 (?H2 x_1) x_2) | [
"List.replicate",
"List.length",
"List.count_list"
] | [
"primrec replicate :: \"nat \\<Rightarrow> 'a \\<Rightarrow> 'a list\" where\nreplicate_0: \"replicate 0 x = []\" |\nreplicate_Suc: \"replicate (Suc n) x = x # replicate n x\"",
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"primrec count_list :: \"'a list \\<Rightarr... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_inj_second_flipped | lemma inj2_inj_second_flipped: "inj2 f \<Longrightarrow> inj (\<lambda>x. f x y)" | inj2 ?f \<Longrightarrow> inj (\<lambda>x. ?f x ?y) | ?H1 x_1 \<Longrightarrow> ?H2 (\<lambda>y_0. x_1 y_0 x_2) | [
"Fun.inj",
"Common_Lemmas.inj2"
] | [
"abbreviation inj :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> bool\"\n where \"inj f \\<equiv> inj_on f UNIV\"",
"abbreviation inj2 :: \"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> bool\" where\n \"inj2 f \\<equiv> inj2_on f UNIV UNIV\""
] |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_curried | lemma inj2_curried: "inj2_on (curry f) A B \<longleftrightarrow> inj_on f (A\<times>B)" | inj2_on (curry ?f) ?A ?B = inj_on ?f (?A \<times> ?B) | ?H1 (?H2 x_1) x_2 x_3 = ?H3 x_1 (?H4 x_2 x_3) | [
"Product_Type.Times",
"Fun.inj_on",
"Product_Type.curry",
"Common_Lemmas.inj2_on"
] | [
"abbreviation Times :: \"'a set \\<Rightarrow> 'b set \\<Rightarrow> ('a \\<times> 'b) set\" (infixr \"\\<times>\" 80)\n where \"A \\<times> B \\<equiv> Sigma A (\\<lambda>_. B)\"",
"definition inj_on :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool\" \\<comment> \\<open>injective\\<close>... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.count_list_zero_not_elem | lemma count_list_zero_not_elem: "count_list xs x = 0 \<longleftrightarrow> x \<notin> set xs" | (count_list ?xs ?x = 0) = (?x \<notin> set ?xs) | (?H1 x_1 x_2 = ?H2) = ?H3 x_2 (?H4 x_1) | [
"List.list.set",
"Set.not_member",
"Groups.zero_class.zero",
"List.count_list"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"abbreviation not_member\n where \"not_member x A \\<equiv> \\<not> (x \\<in> A)\" \\<comment> \\<open>non-membership\\<close>",
... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Node_left_distinct_map | lemma Node_left_distinct_map: "distinct xs = distinct (map (\<lambda>l. \<langle>l, (), r\<rangle>) xs)" | distinct ?xs = distinct (map (\<lambda>l. \<langle>l, (), ?r\<rangle>) ?xs) | ?H1 x_1 = ?H1 (?H2 (\<lambda>y_0. ?H3 y_0 ?H4 x_2) x_1) | [
"Product_Type.Unity",
"Tree.tree.Node",
"List.list.map",
"List.distinct"
] | [
"definition Unity :: unit (\"'(')\")\n where \"() = Abs_unit True\"",
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_inj_second | lemma inj2_inj_second: "inj2 f \<Longrightarrow> inj (f x)" | inj2 ?f \<Longrightarrow> inj (?f ?x) | ?H1 x_1 \<Longrightarrow> ?H2 (x_1 x_2) | [
"Fun.inj",
"Common_Lemmas.inj2"
] | [
"abbreviation inj :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> bool\"\n where \"inj f \\<equiv> inj_on f UNIV\"",
"abbreviation inj2 :: \"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> bool\" where\n \"inj2 f \\<equiv> inj2_on f UNIV UNIV\""
] |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_on_all | lemma inj2_on_all: "inj2 f \<Longrightarrow> inj2_on f A B" | inj2 ?f \<Longrightarrow> inj2_on ?f ?A ?B | ?H1 x_1 \<Longrightarrow> ?H2 x_1 x_2 x_3 | [
"Common_Lemmas.inj2_on",
"Common_Lemmas.inj2"
] | [
"definition inj2_on :: \"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> 'a set \\<Rightarrow> 'b set \\<Rightarrow> bool\" where\n \"inj2_on f A B \\<longleftrightarrow> (\\<forall>x1\\<in>A. \\<forall>x2\\<in>A. \\<forall>y1\\<in>B. \\<forall>y2\\<in>B. f x1 y1 = f x2 y2 \\<longrightarrow> x1 = x2 \\<and... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.count_list_True_False | lemma count_list_True_False: "count_list xs True + count_list xs False = length xs" | count_list ?xs True + count_list ?xs False = length ?xs | ?H1 (?H2 x_1 True) (?H2 x_1 False) = ?H3 x_1 | [
"List.length",
"List.count_list",
"Groups.plus_class.plus"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=y then count_list xs y + 1 else count_list xs y)\"",
"class plus =\n fixes plus :: \"... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.inj2_inj_first | lemma inj2_inj_first: "inj2 f \<Longrightarrow> inj f" | inj2 ?f \<Longrightarrow> inj ?f | ?H1 x_1 \<Longrightarrow> ?H2 x_1 | [
"Fun.inj",
"Common_Lemmas.inj2"
] | [
"abbreviation inj :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> bool\"\n where \"inj f \\<equiv> inj_on f UNIV\"",
"abbreviation inj2 :: \"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> bool\" where\n \"inj2 f \\<equiv> inj2_on f UNIV UNIV\""
] |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Node_right_inj2 | lemma Node_right_inj2: "inj2 (\<lambda>l r. Node l e r)" | inj2 (\<lambda>l. Node l ?e) | ?H1 (\<lambda>y_0. ?H2 y_0 x_1) | [
"Tree.tree.Node",
"Common_Lemmas.inj2"
] | [
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")",
"abbreviation inj2 :: \"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> bool\" where\n \"inj2 f \\<equiv> inj2_on f UNIV UNIV\""
] |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.Node_left_inj2 | lemma Node_left_inj2: "inj2 (\<lambda>r l. Node l e r)" | inj2 (\<lambda>r l. \<langle>l, ?e, r\<rangle>) | ?H1 (\<lambda>y_0 y_1. ?H2 y_1 x_1 y_0) | [
"Tree.tree.Node",
"Common_Lemmas.inj2"
] | [
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")",
"abbreviation inj2 :: \"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> bool\" where\n \"inj2 f \\<equiv> inj2_on f UNIV UNIV\""
] |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.count_list_replicate | lemma count_list_replicate: "count_list (replicate x y) y = x" | count_list (replicate ?x ?y) ?y = ?x | ?H1 (?H2 x_1 x_2) x_2 = x_1 | [
"List.replicate",
"List.count_list"
] | [
"primrec replicate :: \"nat \\<Rightarrow> 'a \\<Rightarrow> 'a list\" where\nreplicate_0: \"replicate 0 x = []\" |\nreplicate_Suc: \"replicate (Suc n) x = x # replicate n x\"",
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=... |
Combinatorial_Enumeration_Algorithms/Common_Lemmas | Common_Lemmas.distinct_concat_Nil | lemma distinct_concat_Nil: "distinct (concat (map (\<lambda>y. []) xs))" | distinct (concat (map (\<lambda>y. []) ?xs)) | ?H1 (?H2 (?H3 (\<lambda>y_0. ?H4) x_1)) | [
"List.list.Nil",
"List.list.map",
"List.concat",
"List.distinct"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.distinct_concat_aux | lemma distinct_concat_aux: "distinct xs \<Longrightarrow> distinct (concat (map (\<lambda>xs. [False # xs, True # xs]) xs))" | distinct ?xs \<Longrightarrow> distinct (concat (map (\<lambda>xs. [False # xs, True # xs]) ?xs)) | ?H1 x_1 \<Longrightarrow> ?H1 (?H2 (?H3 (\<lambda>y_0. ?H4 (?H5 False y_0) (?H4 (?H5 True y_0) ?H6)) x_1)) | [
"List.list.Nil",
"List.list.Cons",
"List.list.map",
"List.concat",
"List.distinct"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.powerset_enum_distinct_elem | theorem powerset_enum_distinct_elem: "distinct xs \<Longrightarrow> ys \<in> set (powerset_enum xs) \<Longrightarrow> distinct ys" | distinct ?xs \<Longrightarrow> ?ys \<in> set (powerset_enum ?xs) \<Longrightarrow> distinct ?ys | \<lbrakk>?H1 x_1; x_2 \<in> ?H2 (?H3 x_1)\<rbrakk> \<Longrightarrow> ?H1 x_2 | [
"Powerset.powerset_enum",
"List.list.set",
"List.distinct"
] | [
"fun powerset_enum where\n \"powerset_enum xs = [(filter_bool_list x xs) . x \\<leftarrow> all_bool_lists (length xs)]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"primr... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.all_bool_lists_correct | lemma all_bool_lists_correct: "set (all_bool_lists x) = {xs. length xs = x}" | set (all_bool_lists ?x) = {xs. length xs = ?x} | ?H1 (?H2 x_1) = ?H3 (\<lambda>y_0. ?H4 y_0 = x_1) | [
"List.length",
"Set.Collect",
"Powerset.all_bool_lists",
"List.list.set"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun all_bool_lists :: \"nat \\<Rightarrow> bool list list\" where\n \"all_bool_lists 0 = [[]]\"\n| \"all_bool_lists (Suc x) = concat [[False#xs, True#xs] . xs \\<leftarrow> all_bool_lists x]\"",
"datatype (set: 'a) list ... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.powerset_enum_correct | theorem powerset_enum_correct: "set (map set (powerset_enum xs)) = Pow (set xs)" | set (map set (powerset_enum ?xs)) = Pow (set ?xs) | ?H1 (?H2 ?H3 (?H4 x_1)) = ?H5 (?H3 x_1) | [
"Set.Pow",
"Powerset.powerset_enum",
"List.list.map",
"List.list.set"
] | [
"definition Pow :: \"'a set \\<Rightarrow> 'a set set\"\n where Pow_def: \"Pow A = {B. B \\<subseteq> A}\"",
"fun powerset_enum where\n \"powerset_enum xs = [(filter_bool_list x xs) . x \\<leftarrow> all_bool_lists (length xs)]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a lis... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.powerset_enum_distinct | theorem powerset_enum_distinct: "distinct xs \<Longrightarrow> distinct (powerset_enum xs)" | distinct ?xs \<Longrightarrow> distinct (powerset_enum ?xs) | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1) | [
"Powerset.powerset_enum",
"List.distinct"
] | [
"fun powerset_enum where\n \"powerset_enum xs = [(filter_bool_list x xs) . x \\<leftarrow> all_bool_lists (length xs)]\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftrightarrow> True\" |\n\"distinct (x # xs) \\<longleftrightarrow> x \\<notin> set xs \\<and> distinct xs\"... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.all_bool_lists2_correct | lemma all_bool_lists2_correct: "set (all_bool_lists n) = set (all_bool_lists2 n)" | set (all_bool_lists ?n) = set (all_bool_lists2 ?n) | ?H1 (?H2 x_1) = ?H1 (?H3 x_1) | [
"Powerset.all_bool_lists2",
"Powerset.all_bool_lists",
"List.list.set"
] | [
"fun all_bool_lists2 :: \"nat \\<Rightarrow> bool list list\" where\n \"all_bool_lists2 n = n_sequence_enum [True, False] n\"",
"fun all_bool_lists :: \"nat \\<Rightarrow> bool list list\" where\n \"all_bool_lists 0 = [[]]\"\n| \"all_bool_lists (Suc x) = concat [[False#xs, True#xs] . xs \\<leftarrow> all_bool_l... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.all_bool_lists2_distinct | lemma all_bool_lists2_distinct: "distinct (all_bool_lists2 n)" | distinct (all_bool_lists2 ?n) | ?H1 (?H2 x_1) | [
"Powerset.all_bool_lists2",
"List.distinct"
] | [
"fun all_bool_lists2 :: \"nat \\<Rightarrow> bool list list\" where\n \"all_bool_lists2 n = n_sequence_enum [True, False] n\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftrightarrow> True\" |\n\"distinct (x # xs) \\<longleftrightarrow> x \\<notin> set xs \\<and> distinct... |
Combinatorial_Enumeration_Algorithms/Powerset | Powerset.distinct_all_bool_lists | lemma distinct_all_bool_lists : "distinct (all_bool_lists x)" | distinct (all_bool_lists ?x) | ?H1 (?H2 x_1) | [
"Powerset.all_bool_lists",
"List.distinct"
] | [
"fun all_bool_lists :: \"nat \\<Rightarrow> bool list list\" where\n \"all_bool_lists 0 = [[]]\"\n| \"all_bool_lists (Suc x) = concat [[False#xs, True#xs] . xs \\<leftarrow> all_bool_lists x]\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct [] \\<longleftrightarrow> True\" |\n\"distinct... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_enum_elem_distinct | lemma n_permutation_enum_elem_distinct: "distinct xs \<Longrightarrow> ys \<in> set (n_permutation_enum xs n) \<Longrightarrow> distinct ys" | distinct ?xs \<Longrightarrow> ?ys \<in> set (n_permutation_enum ?xs ?n) \<Longrightarrow> distinct ?ys | \<lbrakk>?H1 x_1; x_2 \<in> ?H2 (?H3 x_1 x_3)\<rbrakk> \<Longrightarrow> ?H1 x_2 | [
"n_Permutations.n_permutation_enum",
"List.list.set",
"List.distinct"
] | [
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 = [[]]\"\n| \"n_permutation_enum xs (Suc n) = [x#r . x \\<leftarrow> xs, r \\<leftarrow> n_permutation_enum (remove1 x xs) n]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_enum_correct2 | lemma n_permutation_enum_correct2: "ys \<in> n_permutations (set xs) n \<Longrightarrow> ys \<in> set (n_permutation_enum xs n)" | ?ys \<in> n_permutations (set ?xs) ?n \<Longrightarrow> ?ys \<in> set (n_permutation_enum ?xs ?n) | x_1 \<in> ?H1 (?H2 x_2) x_3 \<Longrightarrow> x_1 \<in> ?H3 (?H4 x_2 x_3) | [
"n_Permutations.n_permutation_enum",
"List.list.set",
"n_Permutations.n_permutations"
] | [
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 = [[]]\"\n| \"n_permutation_enum xs (Suc n) = [x#r . x \\<leftarrow> xs, r \\<leftarrow> n_permutation_enum (remove1 x xs) n]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_multiset_permutation_enum_correct1 | lemma n_multiset_permutation_enum_correct1:
"mset ys \<subseteq># mset xs \<Longrightarrow> ys \<in> set (n_permutation_enum xs (length ys))" | mset ?ys \<subseteq># mset ?xs \<Longrightarrow> ?ys \<in> set (n_permutation_enum ?xs (length ?ys)) | ?H1 (?H2 x_1) (?H2 x_2) \<Longrightarrow> x_1 \<in> ?H3 (?H4 x_2 (?H5 x_1)) | [
"List.length",
"n_Permutations.n_permutation_enum",
"List.list.set",
"Multiset.mset",
"Multiset.subseteq_mset"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 = [[]]\"\n| \"n_permutation_enum xs (Suc n) = [x#r . x \\<leftarrow> xs, r \\<leftarrow> n_permutation_... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_enum_subset | lemma n_permutation_enum_subset: "ys \<in> set (n_permutation_enum xs n) \<Longrightarrow> set ys \<subseteq> set xs " | ?ys \<in> set (n_permutation_enum ?xs ?n) \<Longrightarrow> set ?ys \<subseteq> set ?xs | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 (?H4 x_1) (?H4 x_2) | [
"Set.subset_eq",
"n_Permutations.n_permutation_enum",
"List.list.set"
] | [
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\"",
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 = [[]]\"\n| \"n_permutation_enum xs (Suc n) = [x#r . x \\<leftarrow> x... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_multiset_permutation_enum_correct2 | lemma n_multiset_permutation_enum_correct2:
"ys \<in> set (n_permutation_enum xs n) \<Longrightarrow> mset ys \<subseteq># mset xs" | ?ys \<in> set (n_permutation_enum ?xs ?n) \<Longrightarrow> mset ?ys \<subseteq># mset ?xs | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 (?H4 x_1) (?H4 x_2) | [
"Multiset.mset",
"Multiset.subseteq_mset",
"n_Permutations.n_permutation_enum",
"List.list.set"
] | [
"primrec mset :: \"'a list \\<Rightarrow> 'a multiset\" where\n \"mset [] = {#}\" |\n \"mset (a # x) = add_mset a (mset x)\"",
"definition subseteq_mset :: \"'a multiset \\<Rightarrow> 'a multiset \\<Rightarrow> bool\" (infix \"\\<subseteq>#\" 50)\n where \"A \\<subseteq># B \\<longleftrightarrow> (\\<forall>... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_enum_correct1 | lemma n_permutation_enum_correct1: "distinct xs \<Longrightarrow> set (n_permutation_enum xs n) \<subseteq> n_permutations (set xs) n" | distinct ?xs \<Longrightarrow> set (n_permutation_enum ?xs ?n) \<subseteq> n_permutations (set ?xs) ?n | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 (?H4 x_1 x_2)) (?H5 (?H6 x_1) x_2) | [
"n_Permutations.n_permutations",
"n_Permutations.n_permutation_enum",
"List.list.set",
"Set.subset_eq",
"List.distinct"
] | [
"definition n_permutations :: \"'a set \\<Rightarrow> nat \\<Rightarrow> 'a list set\" where\n \"n_permutations A n = {xs. set xs \\<subseteq> A \\<and> distinct xs \\<and> length xs = n}\"",
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 ... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_enum_correct | theorem n_permutation_enum_correct: "distinct xs \<Longrightarrow> set (n_permutation_enum xs n) = n_permutations (set xs) n" | distinct ?xs \<Longrightarrow> set (n_permutation_enum ?xs ?n) = n_permutations (set ?xs) ?n | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1 x_2) = ?H4 (?H5 x_1) x_2 | [
"n_Permutations.n_permutations",
"n_Permutations.n_permutation_enum",
"List.list.set",
"List.distinct"
] | [
"definition n_permutations :: \"'a set \\<Rightarrow> nat \\<Rightarrow> 'a list set\" where\n \"n_permutations A n = {xs. set xs \\<subseteq> A \\<and> distinct xs \\<and> length xs = n}\"",
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 ... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_enum_length | lemma n_permutation_enum_length: "ys \<in> set (n_permutation_enum xs n) \<Longrightarrow> length ys = n" | ?ys \<in> set (n_permutation_enum ?xs ?n) \<Longrightarrow> length ?ys = ?n | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_1 = x_3 | [
"List.length",
"n_Permutations.n_permutation_enum",
"List.list.set"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 = [[]]\"\n| \"n_permutation_enum xs (Suc n) = [x#r . x \\<leftarrow> xs, r \\<leftarrow> n_permutation_... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_multiset_permutation_enum_correct | lemma n_multiset_permutation_enum_correct:
"set (n_multiset_permutation_enum xs n) = n_multiset_permutations (mset xs) n" | set (n_multiset_permutation_enum ?xs ?n) = n_multiset_permutations (mset ?xs) ?n | ?H1 (?H2 x_1 x_2) = ?H3 (?H4 x_1) x_2 | [
"Multiset.mset",
"n_Permutations.n_multiset_permutations",
"n_Permutations.n_multiset_permutation_enum",
"List.list.set"
] | [
"primrec mset :: \"'a list \\<Rightarrow> 'a multiset\" where\n \"mset [] = {#}\" |\n \"mset (a # x) = add_mset a (mset x)\"",
"definition n_multiset_permutations :: \"'a multiset \\<Rightarrow> nat \\<Rightarrow> 'a list set\" where\n \"n_multiset_permutations A n = {xs. mset xs \\<subseteq># A \\<and> length... |
Combinatorial_Enumeration_Algorithms/n_Permutations | n_Permutations.n_permutation_distinct | theorem n_permutation_distinct: "distinct xs \<Longrightarrow> distinct (n_permutation_enum xs n)" | distinct ?xs \<Longrightarrow> distinct (n_permutation_enum ?xs ?n) | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1 x_2) | [
"n_Permutations.n_permutation_enum",
"List.distinct"
] | [
"fun n_permutation_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_permutation_enum xs 0 = [[]]\"\n| \"n_permutation_enum xs (Suc n) = [x#r . x \\<leftarrow> xs, r \\<leftarrow> n_permutation_enum (remove1 x xs) n]\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"d... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.concat_map_Node_not_equal | lemma concat_map_Node_not_equal:
"xs \<noteq> [] \<Longrightarrow> xs2 \<noteq> [] \<Longrightarrow> ys \<noteq> [] \<Longrightarrow> ys2 \<noteq> [] \<Longrightarrow>
\<forall> x\<in> set xs. \<forall> y \<in> set ys . x \<noteq> y \<Longrightarrow>
[\<langle>l, (), r\<rangle>. l \<leftarrow> xs2, r \<leftarro... | ?xs \<noteq> [] \<Longrightarrow> ?xs2.0 \<noteq> [] \<Longrightarrow> ?ys \<noteq> [] \<Longrightarrow> ?ys2.0 \<noteq> [] \<Longrightarrow> \<forall>x\<in>set ?xs. \<forall>y\<in>set ?ys. x \<noteq> y \<Longrightarrow> concat (map (\<lambda>l. map (Node l ()) ?xs) ?xs2.0) \<noteq> ... | \<lbrakk>x_1 \<noteq> ?H1; x_2 \<noteq> ?H1; x_3 \<noteq> ?H1; x_4 \<noteq> ?H1; \<forall>y_0\<in>?H2 x_1. \<forall>y_1\<in>?H2 x_3. y_0 \<noteq> y_1\<rbrakk> \<Longrightarrow> ?H3 (?H4 (\<lambda>y_2. ?H5 (?H6 y_2 ?H7) x_1) x_2) \<noteq> ?H3 (?H4 (\<lambda>y_4. ?H5 (?H6 y... | [
"Product_Type.Unity",
"Tree.tree.Node",
"List.list.map",
"List.concat",
"List.list.set",
"List.list.Nil"
] | [
"definition Unity :: unit (\"'(')\")\n where \"() = Abs_unit True\"",
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_distinct_aux_outer | lemma tree_enum_distinct_aux_outer:
assumes "\<forall>i \<le> n. distinct (tree_enum i)"
and "distinct xs"
and "\<forall> i \<in> set xs. i < n"
and "sorted_wrt (<) xs"
shows "distinct (map (\<lambda>i. [\<langle>l, (), r\<rangle>. l \<leftarrow> tree_enum i, r \<leftarrow> tree_enum (n-i)]) xs)" | \<forall>i\<le>?n. distinct (tree_enum i) \<Longrightarrow> distinct ?xs \<Longrightarrow> \<forall>i\<in>set ?xs. i < ?n \<Longrightarrow> sorted_wrt (<) ?xs \<Longrightarrow> distinct (map (\<lambda>i. concat (map (\<lambda>l. map (Node l ()) (tree_enum (?n - i))) ... | \<lbrakk>\<forall>y_0\<le>x_1. ?H1 (?H2 y_0); ?H3 x_2; \<forall>y_1\<in>?H4 x_2. y_1 < x_1; ?H5 (<) x_2\<rbrakk> \<Longrightarrow> ?H6 (?H7 (\<lambda>y_2. ?H8 (?H9 (\<lambda>y_3. ?H10 (?H11 y_3 ?H12) (?H2 (?H13 x_1 y_2))) (?H2 y_2))) ... | [
"Groups.minus_class.minus",
"Product_Type.Unity",
"Tree.tree.Node",
"List.concat",
"List.list.map",
"List.sorted_wrt",
"List.list.set",
"Trees.tree_enum",
"List.distinct"
] | [
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"definition Unity :: unit (\"'(')\")\n where \"() = Abs_unit True\"",
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_distinct_aux_left | lemma tree_enum_distinct_aux_left:
"\<forall> i < n. distinct (tree_enum i) \<Longrightarrow> distinct ([\<langle>l, (), r\<rangle>. i \<leftarrow> [0..< n], l \<leftarrow> tree_enum i])" | \<forall>i<?n. distinct (tree_enum i) \<Longrightarrow> distinct (concat (map (\<lambda>i. map (\<lambda>l. \<langle>l, (), ?r\<rangle>) (tree_enum i)) [0..<?n])) | \<forall>y_0<x_1. ?H1 (?H2 y_0) \<Longrightarrow> ?H1 (?H3 (?H4 (\<lambda>y_1. ?H5 (\<lambda>y_2. ?H6 y_2 ?H7 x_2) (?H2 y_1)) (?H8 ?H9 x_1))) | [
"Groups.zero_class.zero",
"List.upt",
"Product_Type.Unity",
"Tree.tree.Node",
"List.list.map",
"List.concat",
"Trees.tree_enum",
"List.distinct"
] | [
"class zero =\n fixes zero :: 'a (\"0\")",
"primrec upt :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list\" (\"(1[_..</_'])\") where\nupt_0: \"[i..<0] = []\" |\nupt_Suc: \"[i..<(Suc j)] = (if i \\<le> j then [i..<j] @ [j] else [])\"",
"definition Unity :: unit (\"'(')\")\n where \"() = Abs_unit True\"",
... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_elem_injective | lemma tree_enum_elem_injective: "n \<noteq> m \<Longrightarrow> x \<in> set (tree_enum n) \<Longrightarrow> y \<in> set (tree_enum m) \<Longrightarrow> x \<noteq> y" | ?n \<noteq> ?m \<Longrightarrow> ?x \<in> set (tree_enum ?n) \<Longrightarrow> ?y \<in> set (tree_enum ?m) \<Longrightarrow> ?x \<noteq> ?y | \<lbrakk>x_1 \<noteq> x_2; x_3 \<in> ?H1 (?H2 x_1); x_4 \<in> ?H1 (?H2 x_2)\<rbrakk> \<Longrightarrow> x_3 \<noteq> x_4 | [
"Trees.tree_enum",
"List.list.set"
] | [
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 \\<leftarrow> tree_enum i, t2 \\<leftarrow> tree_enum (n-i)]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_elem_injective2 | lemma tree_enum_elem_injective2: "x \<in> set (tree_enum n) \<Longrightarrow> y \<in> set (tree_enum m) \<Longrightarrow> x = y \<Longrightarrow> n = m" | ?x \<in> set (tree_enum ?n) \<Longrightarrow> ?y \<in> set (tree_enum ?m) \<Longrightarrow> ?x = ?y \<Longrightarrow> ?n = ?m | \<lbrakk>x_1 \<in> ?H1 (?H2 x_2); x_3 \<in> ?H1 (?H2 x_4); x_1 = x_3\<rbrakk> \<Longrightarrow> x_2 = x_4 | [
"Trees.tree_enum",
"List.list.set"
] | [
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 \\<leftarrow> tree_enum i, t2 \\<leftarrow> tree_enum (n-i)]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.length_tree_enum | lemma length_tree_enum:
"length (tree_enum(Suc n)) = (\<Sum>i\<le>n. length(tree_enum i) * length(tree_enum (n - i)))" | length (tree_enum (Suc ?n)) = (\<Sum>i\<le>?n. length (tree_enum i) * length (tree_enum (?n - i))) | ?H1 (?H2 (?H3 x_1)) = ?H4 (\<lambda>y_0. ?H5 (?H1 (?H2 y_0)) (?H1 (?H2 (?H6 x_1 y_0)))) (?H7 x_1) | [
"Set_Interval.ord_class.atMost",
"Groups.minus_class.minus",
"Groups.times_class.times",
"Groups_Big.comm_monoid_add_class.sum",
"Nat.Suc",
"Trees.tree_enum",
"List.length"
] | [
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"",
"fun tree_enum ::... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_correct1 | lemma tree_enum_correct1: "t \<in> set (tree_enum n) \<Longrightarrow> size t = n" | ?t \<in> set (tree_enum ?n) \<Longrightarrow> size ?t = ?n | x_1 \<in> ?H1 (?H2 x_2) \<Longrightarrow> ?H3 x_1 = x_2 | [
"Nat.size_class.size",
"Trees.tree_enum",
"List.list.set"
] | [
"class size =\n fixes size :: \"'a \\<Rightarrow> nat\" \\<comment> \\<open>see further theory \\<open>Wellfounded\\<close>\\<close>",
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 ... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_correct2 | lemma tree_enum_correct2: "n = size t \<Longrightarrow> t \<in> set (tree_enum n)" | ?n = size ?t \<Longrightarrow> ?t \<in> set (tree_enum ?n) | x_1 = ?H1 x_2 \<Longrightarrow> x_2 \<in> ?H2 (?H3 x_1) | [
"Trees.tree_enum",
"List.list.set",
"Nat.size_class.size"
] | [
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 \\<leftarrow> tree_enum i, t2 \\<leftarrow> tree_enum (n-i)]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_Leaf | lemma tree_enum_Leaf: "\<langle>\<rangle> \<in> set (tree_enum n) \<longleftrightarrow> (n = 0)" | (\<langle>\<rangle> \<in> set (tree_enum ?n)) = (?n = 0) | (?H1 \<in> ?H2 (?H3 x_1)) = (x_1 = ?H4) | [
"Groups.zero_class.zero",
"Trees.tree_enum",
"List.list.set",
"Tree.tree.Leaf"
] | [
"class zero =\n fixes zero :: 'a (\"0\")",
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 \\<leftarrow> tree_enum i, t2 \\<leftarrow> tree_enum (n-i)]\"",
"datatype (set: 'a) list... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_correct | theorem tree_enum_correct: "set(tree_enum n) = trees n" | set (tree_enum ?n) = trees ?n | ?H1 (?H2 x_1) = ?H3 x_1 | [
"Trees.trees",
"Trees.tree_enum",
"List.list.set"
] | [
"definition trees :: \"nat \\<Rightarrow> unit tree set\" where\n \"trees n = {t. size t = n}\"",
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 \\<leftarrow> tree_enum i, t2 \\<left... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_not_empty | lemma tree_enum_not_empty: "tree_enum n \<noteq> []" | tree_enum ?n \<noteq> [] | ?H1 x_1 \<noteq> ?H2 | [
"List.list.Nil",
"Trees.tree_enum"
] | [
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n rel: list_all2\n pred: list_all\nwhere\n \"tl [] = []\"",
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), ... |
Combinatorial_Enumeration_Algorithms/Trees | Trees.tree_enum_distinct | theorem tree_enum_distinct: "distinct(tree_enum n)" | distinct (tree_enum ?n) | ?H1 (?H2 x_1) | [
"Trees.tree_enum",
"List.distinct"
] | [
"fun tree_enum :: \"nat \\<Rightarrow> unit tree list\" where\n\"tree_enum 0 = [Leaf]\" |\n\"tree_enum (Suc n) = [\\<langle>t1, (), t2\\<rangle>. i \\<leftarrow> [0..<Suc n], t1 \\<leftarrow> tree_enum i, t2 \\<leftarrow> tree_enum (n-i)]\"",
"primrec distinct :: \"'a list \\<Rightarrow> bool\" where\n\"distinct ... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_head | lemma weak_integer_composition_enum_head:
assumes "xs \<in> set (weak_integer_composition_enum (sum_list xs) (length xs))"
shows "x # xs \<in> set (weak_integer_composition_enum (x + sum_list xs) (Suc (length xs)))" | ?xs \<in> set (weak_integer_composition_enum (sum_list ?xs) (length ?xs)) \<Longrightarrow> ?x # ?xs \<in> set (weak_integer_composition_enum (?x + sum_list ?xs) (Suc (length ?xs))) | x_1 \<in> ?H1 (?H2 (?H3 x_1) (?H4 x_1)) \<Longrightarrow> ?H5 x_2 x_1 \<in> ?H1 (?H2 (?H6 x_2 (?H3 x_1)) (?H7 (?H4 x_1))) | [
"Nat.Suc",
"Groups.plus_class.plus",
"List.list.Cons",
"List.length",
"Groups_List.monoid_add_class.sum_list",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.list.set"
] | [
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"",
"class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.a_choose_equivalence | lemma a_choose_equivalence: "Suc (\<Sum>x\<leftarrow>[0..<k]. n + (k - x) choose (k - x)) = Suc (n + k) choose k" | Suc (\<Sum>x\<leftarrow>[0..<?k]. ?n + (?k - x) choose (?k - x)) = Suc (?n + ?k) choose ?k | ?H1 (?H2 (?H3 (\<lambda>y_0. ?H4 (?H5 x_1 (?H6 x_2 y_0)) (?H6 x_2 y_0)) (?H7 ?H8 x_2))) = ?H4 (?H1 (?H5 x_1 x_2)) x_2 | [
"Groups.zero_class.zero",
"List.upt",
"Groups.minus_class.minus",
"Groups.plus_class.plus",
"Binomial.binomial",
"List.list.map",
"Groups_List.monoid_add_class.sum_list",
"Nat.Suc"
] | [
"class zero =\n fixes zero :: 'a (\"0\")",
"primrec upt :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list\" (\"(1[_..</_'])\") where\nupt_0: \"[i..<0] = []\" |\nupt_Suc: \"[i..<(Suc j)] = (if i \\<le> j then [i..<j] @ [j] else [])\"",
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_length | lemma weak_integer_composition_enum_length:
"xs \<in> set (weak_integer_composition_enum i l) \<Longrightarrow> length xs = l" | ?xs \<in> set (weak_integer_composition_enum ?i ?l) \<Longrightarrow> length ?xs = ?l | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_1 = x_3 | [
"List.length",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.list.set"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_composition_enum i 0 = (if i = 0 then [[]] else [])\"\n| \"weak_integer_composition_enum i (Suc 0) = [[i]]... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_sum_list | lemma weak_integer_composition_enum_sum_list:
"xs \<in> set (weak_integer_composition_enum i l) \<Longrightarrow> sum_list xs = i" | ?xs \<in> set (weak_integer_composition_enum ?i ?l) \<Longrightarrow> sum_list ?xs = ?i | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_1 = x_2 | [
"Groups_List.monoid_add_class.sum_list",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.list.set"
] | [
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_composition_enum i 0 = (if i = 0 then [[]] else [])\"\n| \"weak_integer_composition_enum i (Suc 0) = [[i]]\"\n| \"weak_integer_composition_enum i l =\n [h#r . h \\<leftarrow> [0..< Suc i], r \\<lef... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_correct_aux | lemma weak_integer_composition_enum_correct_aux:
"xs \<in> set (weak_integer_composition_enum (sum_list xs) (length xs))" | ?xs \<in> set (weak_integer_composition_enum (sum_list ?xs) (length ?xs)) | x_1 \<in> ?H1 (?H2 (?H3 x_1) (?H4 x_1)) | [
"List.length",
"Groups_List.monoid_add_class.sum_list",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.list.set"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_composition_enum i 0 = (if i = 0 then [[]] else [])\"\n| \"weak_integer_composition_enum i (Suc 0) = [[i]]... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_correct | theorem weak_integer_composition_enum_correct:
"set (weak_integer_composition_enum i l) = weak_integer_compositions i l" | set (weak_integer_composition_enum ?i ?l) = weak_integer_compositions ?i ?l | ?H1 (?H2 x_1 x_2) = ?H3 x_1 x_2 | [
"Weak_Integer_Compositions.weak_integer_compositions",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.list.set"
] | [
"definition weak_integer_compositions :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list set\" where\n \"weak_integer_compositions i l = {xs. length xs = l \\<and> sum_list xs = i}\"",
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_compositi... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.composition_enum_length | lemma composition_enum_length: "length (weak_integer_composition_enum i n) = n multichoose i" | length (weak_integer_composition_enum ?i ?n) = ?n multichoose ?i | ?H1 (?H2 x_1 x_2) = ?H3 x_2 x_1 | [
"Weak_Integer_Compositions.multichoose",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.length"
] | [
"definition multichoose:: \"nat \\<Rightarrow> nat \\<Rightarrow> nat\" (infixl \"multichoose\" 65) where\n \"n multichoose k = (n + k -1) choose k\"",
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_composition_enum i 0 = (if i = 0 then [[]] ... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_compositions_cardinality | theorem weak_integer_compositions_cardinality: "card (weak_integer_compositions n k) = k multichoose n" | card (weak_integer_compositions ?n ?k) = ?k multichoose ?n | ?H1 (?H2 x_1 x_2) = ?H3 x_2 x_1 | [
"Weak_Integer_Compositions.multichoose",
"Weak_Integer_Compositions.weak_integer_compositions",
"Finite_Set.card"
] | [
"definition multichoose:: \"nat \\<Rightarrow> nat \\<Rightarrow> nat\" (infixl \"multichoose\" 65) where\n \"n multichoose k = (n + k -1) choose k\"",
"definition weak_integer_compositions :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list set\" where\n \"weak_integer_compositions i l = {xs. length xs = l \\<... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_zero | lemma weak_integer_composition_enum_zero: "length (weak_integer_composition_enum 0 (Suc n)) = 1" | length (weak_integer_composition_enum 0 (Suc ?n)) = 1 | ?H1 (?H2 ?H3 (?H4 x_1)) = ?H5 | [
"Groups.one_class.one",
"Nat.Suc",
"Groups.zero_class.zero",
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.length"
] | [
"class one =\n fixes one :: 'a (\"1\")",
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"",
"class zero =\n fixes zero :: 'a (\"0\")",
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_comp... |
Combinatorial_Enumeration_Algorithms/Weak_Integer_Compositions | Weak_Integer_Compositions.weak_integer_composition_enum_distinct | theorem weak_integer_composition_enum_distinct: "distinct (weak_integer_composition_enum i l)" | distinct (weak_integer_composition_enum ?i ?l) | ?H1 (?H2 x_1 x_2) | [
"Weak_Integer_Compositions.weak_integer_composition_enum",
"List.distinct"
] | [
"fun weak_integer_composition_enum :: \"nat \\<Rightarrow> nat \\<Rightarrow> nat list list\" where\n \"weak_integer_composition_enum i 0 = (if i = 0 then [[]] else [])\"\n| \"weak_integer_composition_enum i (Suc 0) = [[i]]\"\n| \"weak_integer_composition_enum i l =\n [h#r . h \\<leftarrow> [0..< Suc i], r \\<lef... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.count_mset_replicate_aux1 | lemma count_mset_replicate_aux1:
"\<lbrakk>\<not> x < n; mset ys = mset (replicate n True) + mset (replicate (x - n) False)\<rbrakk>
\<Longrightarrow> count (mset ys) True = n" | \<not> ?x < ?n \<Longrightarrow> mset ?ys = mset (replicate ?n True) + mset (replicate (?x - ?n) False) \<Longrightarrow> count (mset ?ys) True = ?n | \<lbrakk>\<not> x_1 < x_2; ?H1 x_3 = ?H2 (?H1 (?H3 x_2 True)) (?H1 (?H3 (?H4 x_1 x_2) False))\<rbrakk> \<Longrightarrow> ?H5 (?H1 x_3) True = x_2 | [
"Multiset.multiset.count",
"Groups.minus_class.minus",
"List.replicate",
"Groups.plus_class.plus",
"Multiset.mset"
] | [
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"primrec replicate :: \"nat \\<Rightarrow> 'a \\<Rightarrow> 'a list\" where\nreplicate_0: \"replicate 0 x = []\" |\nreplicate_Suc: \"replicate (Suc n) x = x # replicate n x\"",
"class plus =\n fixes plus :: \"'a \... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.count_mset_replicate_aux2 | lemma count_mset_replicate_aux2:
assumes "\<not> length xs < count_list xs True"
shows "mset xs = mset (replicate (count_list xs True) True) + mset (replicate (length xs - count_list xs True) False)" | \<not> length ?xs < count_list ?xs True \<Longrightarrow> mset ?xs = mset (replicate (count_list ?xs True) True) + mset (replicate (length ?xs - count_list ?xs True) False) | \<not> ?H1 x_1 < ?H2 x_1 True \<Longrightarrow> ?H3 x_1 = ?H4 (?H3 (?H5 (?H2 x_1 True) True)) (?H3 (?H5 (?H6 (?H1 x_1) (?H2 x_1 True)) False)) | [
"Groups.minus_class.minus",
"List.replicate",
"Groups.plus_class.plus",
"Multiset.mset",
"List.count_list",
"List.length"
] | [
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"primrec replicate :: \"nat \\<Rightarrow> 'a \\<Rightarrow> 'a list\" where\nreplicate_0: \"replicate 0 x = []\" |\nreplicate_Suc: \"replicate (Suc n) x = x # replicate n x\"",
"class plus =\n fixes plus :: \"'a \... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_subset_enum_correct_aux1 | lemma n_subset_enum_correct_aux1:
"\<lbrakk>distinct xs; length ys = length xs\<rbrakk>
\<Longrightarrow> set (filter_bool_list ys xs) \<in> n_subsets (set xs) (count_list ys True)" | distinct ?xs \<Longrightarrow> length ?ys = length ?xs \<Longrightarrow> set (filter_bool_list ?ys ?xs) \<in> n_subsets (set ?xs) (count_list ?ys True) | \<lbrakk>?H1 x_1; ?H2 x_2 = ?H3 x_1\<rbrakk> \<Longrightarrow> ?H4 (?H5 x_2 x_1) \<in> ?H6 (?H4 x_1) (?H7 x_2 True) | [
"List.count_list",
"n_Subsets.n_subsets",
"Filter_Bool_List.filter_bool_list",
"List.list.set",
"List.length",
"List.distinct"
] | [
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=y then count_list xs y + 1 else count_list xs y)\"",
"definition n_subsets :: \"'a set \\<Rightarrow> nat \\<Rightarrow> 'a set set\" where\n \"n_subsets A n = {B. B \\<subseteq... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_bool_lists_correct_aux | lemma n_bool_lists_correct_aux:
"length xs = x \<Longrightarrow> count_list xs True = n \<Longrightarrow> xs \<in> set (n_bool_lists n x)" | length ?xs = ?x \<Longrightarrow> count_list ?xs True = ?n \<Longrightarrow> ?xs \<in> set (n_bool_lists ?n ?x) | \<lbrakk>?H1 x_1 = x_2; ?H2 x_1 True = x_3\<rbrakk> \<Longrightarrow> x_1 \<in> ?H3 (?H4 x_3 x_2) | [
"n_Subsets.n_bool_lists",
"List.list.set",
"List.count_list",
"List.length"
] | [
"fun n_bool_lists :: \"nat \\<Rightarrow> nat \\<Rightarrow> bool list list\" where\n \"n_bool_lists n 0 = (if n > 0 then [] else [[]])\"\n| \"n_bool_lists n (Suc x) = (if n = 0 then [replicate (Suc x) False]\n else if n = Suc x then [replicate (Suc x) True]\n else if n > x then []\n else [False#xs . xs \... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_bool_lists_correct | lemma n_bool_lists_correct: "set (n_bool_lists n x) = {xs. length xs = x \<and> count_list xs True = n}" | set (n_bool_lists ?n ?x) = {xs. length xs = ?x \<and> count_list xs True = ?n} | ?H1 (?H2 x_1 x_2) = ?H3 (\<lambda>y_0. ?H4 y_0 = x_2 \<and> ?H5 y_0 True = x_1) | [
"List.count_list",
"List.length",
"Set.Collect",
"n_Subsets.n_bool_lists",
"List.list.set"
] | [
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=y then count_list xs y + 1 else count_list xs y)\"",
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun n_bool_lists :: \"nat \\<Rig... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_subset_enum_correct_aux2 | lemma n_subset_enum_correct_aux2:
"distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))" | distinct ?xs \<Longrightarrow> n_subsets (set ?xs) ?n \<subseteq> set (map set (n_subset_enum ?xs ?n)) | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 (?H4 x_1) x_2) (?H5 (?H6 ?H4 (?H7 x_1 x_2))) | [
"n_Subsets.n_subset_enum",
"List.list.map",
"List.list.set",
"n_Subsets.n_subsets",
"Set.subset_eq",
"List.distinct"
] | [
"fun n_subset_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_subset_enum xs n = [(filter_bool_list bs xs) . bs \\<leftarrow> (n_bool_lists n (length xs))]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n ... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_subset_enum_correct | theorem n_subset_enum_correct:
"distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) = n_subsets (set xs) n" | distinct ?xs \<Longrightarrow> set (map set (n_subset_enum ?xs ?n)) = n_subsets (set ?xs) ?n | ?H1 x_1 \<Longrightarrow> ?H2 (?H3 ?H4 (?H5 x_1 x_2)) = ?H6 (?H4 x_1) x_2 | [
"n_Subsets.n_subsets",
"n_Subsets.n_subset_enum",
"List.list.map",
"List.list.set",
"List.distinct"
] | [
"definition n_subsets :: \"'a set \\<Rightarrow> nat \\<Rightarrow> 'a set set\" where\n \"n_subsets A n = {B. B \\<subseteq> A \\<and> card B = n}\"",
"fun n_subset_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_subset_enum xs n = [(filter_bool_list bs xs) . bs \\<leftarrow> (n_... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_subset_enum_distinct_elem | theorem n_subset_enum_distinct_elem:
"distinct xs \<Longrightarrow> ys \<in> set (n_subset_enum xs n) \<Longrightarrow> distinct ys" | distinct ?xs \<Longrightarrow> ?ys \<in> set (n_subset_enum ?xs ?n) \<Longrightarrow> distinct ?ys | \<lbrakk>?H1 x_1; x_2 \<in> ?H2 (?H3 x_1 x_3)\<rbrakk> \<Longrightarrow> ?H1 x_2 | [
"n_Subsets.n_subset_enum",
"List.list.set",
"List.distinct"
] | [
"fun n_subset_enum :: \"'a list \\<Rightarrow> nat \\<Rightarrow> 'a list list\" where\n \"n_subset_enum xs n = [(filter_bool_list bs xs) . bs \\<leftarrow> (n_bool_lists n (length xs))]\"",
"datatype (set: 'a) list =\n Nil (\"[]\")\n | Cons (hd: 'a) (tl: \"'a list\") (infixr \"#\" 65)\nfor\n map: map\n ... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_bool_lists_True_count | lemma n_bool_lists_True_count: "xs \<in> set (n_bool_lists n x) \<Longrightarrow> count_list xs True = n" | ?xs \<in> set (n_bool_lists ?n ?x) \<Longrightarrow> count_list ?xs True = ?n | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_1 True = x_2 | [
"List.count_list",
"n_Subsets.n_bool_lists",
"List.list.set"
] | [
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=y then count_list xs y + 1 else count_list xs y)\"",
"fun n_bool_lists :: \"nat \\<Rightarrow> nat \\<Rightarrow> bool list list\" where\n \"n_bool_lists n 0 = (if n > 0 then []... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.count_mset_count_list | lemma count_mset_count_list: "count (mset ys) T = n \<Longrightarrow> count_list ys T = n" | count (mset ?ys) ?T = ?n \<Longrightarrow> count_list ?ys ?T = ?n | ?H1 (?H2 x_1) x_2 = x_3 \<Longrightarrow> ?H3 x_1 x_2 = x_3 | [
"List.count_list",
"Multiset.mset",
"Multiset.multiset.count"
] | [
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=y then count_list xs y + 1 else count_list xs y)\"",
"primrec mset :: \"'a list \\<Rightarrow> 'a multiset\" where\n \"mset [] = {#}\" |\n \"mset (a # x) = add_mset a (mset x)\... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.count_list_count_mset | lemma count_list_count_mset: "count_list ys T = n \<Longrightarrow> count (mset ys) T = n" | count_list ?ys ?T = ?n \<Longrightarrow> count (mset ?ys) ?T = ?n | ?H1 x_1 x_2 = x_3 \<Longrightarrow> ?H2 (?H3 x_1) x_2 = x_3 | [
"Multiset.mset",
"Multiset.multiset.count",
"List.count_list"
] | [
"primrec mset :: \"'a list \\<Rightarrow> 'a multiset\" where\n \"mset [] = {#}\" |\n \"mset (a # x) = add_mset a (mset x)\"",
"primrec count_list :: \"'a list \\<Rightarrow> 'a \\<Rightarrow> nat\" where\n\"count_list [] y = 0\" |\n\"count_list (x#xs) y = (if x=y then count_list xs y + 1 else count_list xs y)\... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.n_bool_lists_length | lemma n_bool_lists_length: "xs \<in> set (n_bool_lists n x) \<Longrightarrow> length xs = x" | ?xs \<in> set (n_bool_lists ?n ?x) \<Longrightarrow> length ?xs = ?x | x_1 \<in> ?H1 (?H2 x_2 x_3) \<Longrightarrow> ?H3 x_1 = x_3 | [
"List.length",
"n_Subsets.n_bool_lists",
"List.list.set"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"fun n_bool_lists :: \"nat \\<Rightarrow> nat \\<Rightarrow> bool list list\" where\n \"n_bool_lists n 0 = (if n > 0 then [] else [[]])\"\n| \"n_bool_lists n (Suc x) = (if n = 0 then [replicate (Suc x) False]\n else if n... |
Combinatorial_Enumeration_Algorithms/n_Subsets | n_Subsets.replicate_True_not_False | lemma replicate_True_not_False: "count_list ys True = 0 \<longleftrightarrow> ys = replicate (length ys) False" | (count_list ?ys True = 0) = (?ys = replicate (length ?ys) False) | (?H1 x_1 True = ?H2) = (x_1 = ?H3 (?H4 x_1) False) | [
"List.length",
"List.replicate",
"Groups.zero_class.zero",
"List.count_list"
] | [
"abbreviation length :: \"'a list \\<Rightarrow> nat\" where\n\"length \\<equiv> size\"",
"primrec replicate :: \"nat \\<Rightarrow> 'a \\<Rightarrow> 'a list\" where\nreplicate_0: \"replicate 0 x = []\" |\nreplicate_Suc: \"replicate (Suc n) x = x # replicate n x\"",
"class zero =\n fixes zero :: 'a (\"0\")",... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4