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
listlengths
0
89
defs
listlengths
0
63
Stream-Fusion/StreamFusion
StreamFusion.zipWithS_cong
lemma zipWithS_cong: "f = f' \<Longrightarrow> a \<approx> a' \<Longrightarrow> b \<approx> b' \<Longrightarrow> zipWithS\<cdot>f\<cdot>a\<cdot>b \<approx> zipWithS\<cdot>f\<cdot>a'\<cdot>b'"
?f = ?f' \<Longrightarrow> ?a \<approx> ?a' \<Longrightarrow> ?b \<approx> ?b' \<Longrightarrow> zipWithS\<cdot>?f\<cdot>?a\<cdot>?b \<approx> zipWithS\<cdot>?f\<cdot>?a'\<cdot>?b'
\<lbrakk>x_1 = x_2; ?H1 x_3 x_4; ?H2 x_5 x_6\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 (?H6 ?H7 x_1) x_3) x_5) (?H8 (?H9 (?H10 ?H11 x_1) x_4) x_6)
[ "StreamFusion.Either.is_Left", "StreamFusion.mapS", "Groups.zero_class.zero", "StreamFusion.zipWithS", "Stream.bisimilar", "Cfun.cfun.Rep_cfun", "StreamFusion.Both.Both_case" ]
[ "class zero =\n fixes zero :: 'a (\"0\")", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/StreamFusion
StreamFusion.foldrS_cong
lemma foldrS_cong: fixes a :: "('a, 's) Stream" fixes b :: "('a, 't) Stream" shows "f = g \<Longrightarrow> z = w \<Longrightarrow> a \<approx> b \<Longrightarrow> foldrS\<cdot>f\<cdot>z\<cdot>a = foldrS\<cdot>g\<cdot>w\<cdot>b"
?f = ?g \<Longrightarrow> ?z = ?w \<Longrightarrow> ?a \<approx> ?b \<Longrightarrow> foldrS\<cdot>?f\<cdot>?z\<cdot>?a = foldrS\<cdot>?g\<cdot>?w\<cdot>?b
\<lbrakk>x_1 = x_2; x_3 = x_4; ?H1 x_5 x_6\<rbrakk> \<Longrightarrow> ?H2 (?H3 (?H4 ?H5 x_1) x_3) x_5 = ?H6 (?H7 (?H8 ?H9 x_2) x_4) x_6
[ "Cfun.cfun.Rep_cfun", "Stream.bisimilar", "StreamFusion.foldrS", "StreamFusion.Both_bisim" ]
[ "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToStep_simps'(1)
lemma enumFromToStep_simps' [simp]: "x \<le> y \<Longrightarrow> enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>(up\<cdot>x)) = Yield\<cdot>(up\<cdot>x)\<cdot>(up\<cdot>(up\<cdot>(x+1)))" "\<not> x \<le> y \<Longrightarrow> enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>(up\<cdot>x)) = Done"
?x \<le> ?y \<Longrightarrow> enumFromToStep\<cdot>(up\<cdot>?y)\<cdot>(up\<cdot>(up\<cdot>?x)) = Yield\<cdot>(up\<cdot>?x)\<cdot>(up\<cdot>(up\<cdot>(?x + 1)))
x_1 \<le> x_2 \<Longrightarrow> ?H1 (?H2 ?H3 (?H4 ?H5 x_2)) (?H6 ?H7 (?H4 ?H5 x_1)) = ?H1 (?H2 ?H8 (?H4 ?H5 x_1)) (?H6 ?H7 (?H4 ?H5 (?H9 x_1 ?H10)))
[ "Groups.plus_class.plus", "Stream.Step.Yield", "Groups.one_class.one", "StreamFusion.enumFromToStep", "Up.up", "Cfun.cfun.Rep_cfun" ]
[ "class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)", "class one =\n fixes one :: 'a (\"1\")", "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"" ]
Stream-Fusion/StreamFusion
StreamFusion.unstream_appendS
lemma unstream_appendS: "a \<noteq> \<bottom> \<Longrightarrow> b \<noteq> \<bottom> \<Longrightarrow> unstream\<cdot>(appendS\<cdot>a\<cdot>b) = appendL\<cdot>(unstream\<cdot>a)\<cdot>(unstream\<cdot>b)"
?a \<noteq> \<bottom> \<Longrightarrow> ?b \<noteq> \<bottom> \<Longrightarrow> unstream\<cdot>(appendS\<cdot>?a\<cdot>?b) = appendL\<cdot>(unstream\<cdot>?a)\<cdot>(unstream\<cdot>?b)
\<lbrakk>x_1 \<noteq> ?H1; x_2 \<noteq> ?H2\<rbrakk> \<Longrightarrow> ?H3 ?H4 (?H5 (?H6 ?H7 x_1) x_2) = ?H8 (?H9 ?H10 (?H11 ?H12 x_1)) (?H13 ?H14 x_2)
[ "Cfun.cfun.Rep_cfun", "Pcpo.pcpo_class.bottom", "StreamFusion.Maybe.match_Just", "LazyList.appendL", "StreamFusion.appendS", "Stream.unstream" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.unfold_foldrS
lemma unfold_foldrS: assumes "s \<noteq> \<bottom>" shows "foldrS\<cdot>f\<cdot>z\<cdot>(Stream\<cdot>h\<cdot>s) = foldrL\<cdot>f\<cdot>z\<cdot>(unfold\<cdot>h\<cdot>s)"
?s \<noteq> \<bottom> \<Longrightarrow> foldrS\<cdot>?f\<cdot>?z\<cdot>(Stream\<cdot>?h\<cdot>?s) = foldrL\<cdot>?f\<cdot>?z\<cdot>(unfold\<cdot>?h\<cdot>?s)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 (?H3 (?H4 ?H5 x_2) x_3) (?H6 (?H7 ?H8 x_4) x_1) = ?H9 (?H10 (?H11 ?H12 x_2) x_3) (?H13 (?H14 ?H15 x_4) x_1)
[ "Stream.Stream.Stream", "Stream.unfold", "StreamFusion.foldrS", "LazyList.foldrL", "Cfun.cfun.Rep_cfun", "Pcpo.pcpo_class.bottom" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.unfold_mapStep
lemma unfold_mapStep: fixes f :: "'a \<rightarrow> 'b" and h :: "'s \<rightarrow> ('a, 's) Step" assumes "s \<noteq> \<bottom>" shows "unfold\<cdot>(mapStep\<cdot>f\<cdot>h)\<cdot>s = mapL\<cdot>f\<cdot>(unfold\<cdot>h\<cdot>s)"
?s \<noteq> \<bottom> \<Longrightarrow> unfold\<cdot>(mapStep\<cdot>?f\<cdot>?h)\<cdot>?s = mapL\<cdot>?f\<cdot>(unfold\<cdot>?h\<cdot>?s)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 (?H3 ?H4 (?H5 (?H6 ?H7 x_2) x_3)) x_1 = ?H8 (?H9 ?H10 x_2) (?H11 (?H12 ?H13 x_3) x_1)
[ "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "StreamFusion.mapStep", "StreamFusion.Both_take", "LazyList.mapL", "Stream.unfold" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.unfold_filterStep
lemma unfold_filterStep: fixes p :: "'a \<rightarrow> tr" and h :: "'s \<rightarrow> ('a, 's) Step" assumes "s \<noteq> \<bottom>" shows "unfold\<cdot>(filterStep\<cdot>p\<cdot>h)\<cdot>s = filterL\<cdot>p\<cdot>(unfold\<cdot>h\<cdot>s)"
?s \<noteq> \<bottom> \<Longrightarrow> unfold\<cdot>(filterStep\<cdot>?p\<cdot>?h)\<cdot>?s = filterL\<cdot>?p\<cdot>(unfold\<cdot>?h\<cdot>?s)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 (?H3 ?H4 (?H5 (?H6 ?H7 x_2) x_3)) x_1 = ?H8 (?H9 ?H10 x_2) (?H2 (?H3 ?H4 x_3) x_1)
[ "StreamFusion.filterStep", "Cfun.cfun.Rep_cfun", "Stream.unfold", "Adm.compact", "LazyList.filterL", "StreamFusion.Either.match_Right", "Orderings.ord_class.min", "Pcpo.pcpo_class.bottom" ]
[ "definition compact :: \"'a::cpo \\<Rightarrow> bool\"\n where \"compact k = adm (\\<lambda>x. k \\<notsqsubseteq> x)\"", "class ord =\n fixes less_eq :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\n and less :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.unstream_foldrS
lemma unstream_foldrS: "a \<noteq> \<bottom> \<Longrightarrow> foldrS\<cdot>f\<cdot>z\<cdot>a = foldrL\<cdot>f\<cdot>z\<cdot>(unstream\<cdot>a)"
?a \<noteq> \<bottom> \<Longrightarrow> foldrS\<cdot>?f\<cdot>?z\<cdot>?a = foldrL\<cdot>?f\<cdot>?z\<cdot>(unstream\<cdot>?a)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 (?H3 (?H4 ?H5 x_2) x_3) x_1 = ?H6 (?H7 (?H8 ?H9 x_2) x_3) (?H10 ?H11 x_1)
[ "Domain.defl_set", "LazyList.appendL", "Cfun.cfun.Rep_cfun", "StreamFusion.Both.Both_case", "LazyList.LList.LCons", "Stream.unstream", "Pcpo.pcpo_class.bottom", "StreamFusion.foldrS", "LazyList.foldrL" ]
[ "definition defl_set :: \"'a::bifinite defl \\<Rightarrow> 'a set\"\nwhere \"defl_set A = {x. cast\\<cdot>A\\<cdot>x = x}\"", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.appendS_cong
lemma appendS_cong: fixes f :: "'a \<rightarrow> 'b" fixes a :: "('a, 's) Stream" fixes b :: "('a, 't) Stream" shows "a \<approx> a' \<Longrightarrow> b \<approx> b' \<Longrightarrow> appendS\<cdot>a\<cdot>b \<approx> appendS\<cdot>a'\<cdot>b'"
?a \<approx> ?a' \<Longrightarrow> ?b \<approx> ?b' \<Longrightarrow> appendS\<cdot>?a\<cdot>?b \<approx> appendS\<cdot>?a'\<cdot>?b'
\<lbrakk>?H1 x_1 x_2; ?H2 x_3 x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_3) (?H7 (?H8 ?H9 x_2) x_4)
[ "Stream.bisimilar", "StreamFusion.appendS", "StreamFusion.Both.Abs_Both", "Cfun.cfun.Rep_cfun", "StreamFusion.Either_abs", "Cfun.cfcomp_syn", "StreamFusion.zipWithStep" ]
[ "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"" ]
Stream-Fusion/StreamFusion
StreamFusion.filterS_cong
lemma filterS_cong: fixes p :: "'a \<rightarrow> tr" fixes a :: "('a, 's) Stream" fixes b :: "('a, 't) Stream" shows "p = q \<Longrightarrow> a \<approx> b \<Longrightarrow> filterS\<cdot>p\<cdot>a \<approx> filterS\<cdot>q\<cdot>b"
?p = ?q \<Longrightarrow> ?a \<approx> ?b \<Longrightarrow> filterS\<cdot>?p\<cdot>?a \<approx> filterS\<cdot>?q\<cdot>?b
\<lbrakk>x_1 = x_2; ?H1 x_3 x_4\<rbrakk> \<Longrightarrow> ?H1 (?H2 (?H3 ?H4 x_1) x_3) (?H5 (?H6 ?H7 x_2) x_4)
[ "Stream.bisimilar", "StreamFusion.filterS", "Cfun.cfun.Rep_cfun", "StreamFusion.mapS" ]
[ "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/StreamFusion
StreamFusion.mapS_cong
lemma mapS_cong: fixes f :: "'a \<rightarrow> 'b" fixes a :: "('a, 's) Stream" fixes b :: "('a, 't) Stream" shows "f = g \<Longrightarrow> a \<approx> b \<Longrightarrow> mapS\<cdot>f\<cdot>a \<approx> mapS\<cdot>g\<cdot>b"
?f = ?g \<Longrightarrow> ?a \<approx> ?b \<Longrightarrow> mapS\<cdot>?f\<cdot>?a \<approx> mapS\<cdot>?g\<cdot>?b
\<lbrakk>x_1 = x_2; ?H1 x_3 x_4\<rbrakk> \<Longrightarrow> ?H2 (?H3 (?H4 ?H5 x_1) x_3) (?H6 (?H7 ?H8 x_2) x_4)
[ "Cfun.cfun.Rep_cfun", "StreamFusion.mapS", "Fixrec.run", "Stream.bisimilar", "Porder.below_class.below", "StreamFusion.Either_finite", "Product_Type.prod.fst" ]
[ "definition\n run :: \"'a match \\<rightarrow> 'a::pcpo\" where\n \"run = (\\<Lambda> m. sscase\\<cdot>\\<bottom>\\<cdot>(fup\\<cdot>ID)\\<cdot>(Rep_match m))\"", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"", "class below =\n fixes below :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin", "definition \"prod = {f. \\<exists>a b. f = Pair_Rep (a::'a) (b::'b)}\"" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToS_cong
lemma enumFromToS_cong: "x = x' \<Longrightarrow> y = y' \<Longrightarrow> enumFromToS\<cdot>x\<cdot>y \<approx> enumFromToS\<cdot>x'\<cdot>y'"
?x = ?x' \<Longrightarrow> ?y = ?y' \<Longrightarrow> enumFromToS\<cdot>?x\<cdot>?y \<approx> enumFromToS\<cdot>?x'\<cdot>?y'
\<lbrakk>x_1 = x_2; x_3 = x_4\<rbrakk> \<Longrightarrow> ?H1 (?H2 (?H3 ?H4 x_1) x_3) (?H2 (?H3 ?H4 x_2) x_4)
[ "StreamFusion.enumFromToS", "Cfun.cfun.Rep_cfun", "Stream.bisimilar", "StreamFusion.L.L" ]
[ "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/StreamFusion
StreamFusion.isodefl_Either
null
isodefl ?fa ?da \<Longrightarrow> isodefl ?fb ?db \<Longrightarrow> isodefl (Either_map\<cdot>?fa\<cdot>?fb) (Either_defl\<cdot>?da\<cdot>?db)
\<lbrakk>?H1 x_1 x_2; ?H2 x_3 x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_3) (?H7 (?H8 ?H9 x_2) x_4)
[ "Domain.isodefl", "StreamFusion.Switch.is_S2", "StreamFusion.Either_map", "Cfun.cfun.Rep_cfun", "StreamFusion.Either_defl", "Fixrec.fail", "StreamFusion.Both_rep" ]
[ "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"", "definition\n fail :: \"'a match\" where\n \"fail = Abs_match (sinl\\<cdot>ONE)\"" ]
Stream-Fusion/StreamFusion
StreamFusion.isodefl_Both
null
isodefl ?fa ?da \<Longrightarrow> isodefl ?fb ?db \<Longrightarrow> isodefl (Both_map\<cdot>?fa\<cdot>?fb) (Both_defl\<cdot>?da\<cdot>?db)
\<lbrakk>?H1 x_1 x_2; ?H2 x_3 x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_3) (?H7 (?H8 ?H9 x_2) x_4)
[ "StreamFusion.Both_defl", "Domain.isodefl", "StreamFusion.appendStep", "StreamFusion.Both_map", "Porder.po_class.Lub", "Cfun.cfun.Rep_cfun", "StreamFusion.L.Abs_L" ]
[ "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"", "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.unstream_mapS
lemma unstream_mapS: fixes f :: "'a \<rightarrow> 'b" and a :: "('a, 's) Stream" shows "a \<noteq> \<bottom> \<Longrightarrow> unstream\<cdot>(mapS\<cdot>f\<cdot>a) = mapL\<cdot>f\<cdot>(unstream\<cdot>a)"
?a \<noteq> \<bottom> \<Longrightarrow> unstream\<cdot>(mapS\<cdot>?f\<cdot>?a) = mapL\<cdot>?f\<cdot>(unstream\<cdot>?a)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 ?H3 (?H4 (?H5 ?H6 x_2) x_1) = ?H7 (?H8 ?H9 x_2) (?H10 ?H11 x_1)
[ "Pcpo.pcpo_class.bottom", "StreamFusion.mapS", "Cfun.cfun.Rep_cfun", "StreamFusion.Switch_rep", "Map_Functions.u_map", "LazyList.mapL", "LazyList.appendL", "Stream.unstream", "StreamFusion.Switch.is_S1" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "definition u_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> 'a u \\<rightarrow> 'b u\"\n where \"u_map = (\\<Lambda> f. fup\\<cdot>(up oo f))\"" ]
Stream-Fusion/StreamFusion
StreamFusion.unstream_filterS
lemma unstream_filterS: "a \<noteq> \<bottom> \<Longrightarrow> unstream\<cdot>(filterS\<cdot>p\<cdot>a) = filterL\<cdot>p\<cdot>(unstream\<cdot>a)"
?a \<noteq> \<bottom> \<Longrightarrow> unstream\<cdot>(filterS\<cdot>?p\<cdot>?a) = filterL\<cdot>?p\<cdot>(unstream\<cdot>?a)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 ?H3 (?H4 (?H5 ?H6 x_2) x_1) = ?H7 (?H8 ?H9 x_2) (?H2 ?H3 x_1)
[ "Cfun.cfun.Rep_cfun", "Porder.po_class.chain", "Stream.unstream", "Pcpo.pcpo_class.bottom", "LazyList.filterL", "StreamFusion.filterS" ]
[ "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.zipWithL_eq
lemma zipWithL_eq: "zipWithL\<cdot>f\<cdot>xs\<cdot>ys = unstream\<cdot>(zipWithS\<cdot>f\<cdot>(stream\<cdot>xs)\<cdot>(stream\<cdot>ys))"
zipWithL\<cdot>?f\<cdot>?xs\<cdot>?ys = unstream\<cdot>(zipWithS\<cdot>?f\<cdot>(stream\<cdot>?xs)\<cdot>(stream\<cdot>?ys))
?H1 (?H2 (?H3 ?H4 x_1) x_2) x_3 = ?H5 ?H6 (?H7 (?H8 (?H9 ?H10 x_1) (?H11 ?H12 x_2)) (?H13 ?H14 x_3))
[ "LazyList.zipWithL", "Cfun.ID", "StreamFusion.zipWithS", "Stream.stream", "LazyList.filterL", "Stream.unstream", "Cfun.cfun.Rep_cfun" ]
[ "definition ID :: \"'a \\<rightarrow> 'a\"\n where \"ID = (\\<Lambda> x. x)\"", "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToStep_simps'(2)
lemma enumFromToStep_simps' [simp]: "x \<le> y \<Longrightarrow> enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>(up\<cdot>x)) = Yield\<cdot>(up\<cdot>x)\<cdot>(up\<cdot>(up\<cdot>(x+1)))" "\<not> x \<le> y \<Longrightarrow> enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>(up\<cdot>x)) = Done"
\<not> ?x \<le> ?y \<Longrightarrow> enumFromToStep\<cdot>(up\<cdot>?y)\<cdot>(up\<cdot>(up\<cdot>?x)) = Done
\<not> x_1 \<le> x_2 \<Longrightarrow> ?H1 (?H2 ?H3 (?H4 ?H5 x_2)) (?H6 ?H7 (?H4 ?H5 x_1)) = ?H8
[ "Stream.Step.Done", "Cfun.cfun.Rep_cfun", "Porder.po_class.chain", "Up.up", "StreamFusion.enumFromToStep", "Porder.po_class.Lub" ]
[ "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin", "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"", "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.oo_LAM
lemma oo_LAM [simp]: "cont g \<Longrightarrow> f oo (\<Lambda> x. g x) = (\<Lambda> x. f\<cdot>(g x))"
cont ?g \<Longrightarrow> ?f oo (\<Lambda> x. ?g x) = (\<Lambda> x. ?f\<cdot>(?g x))
?H1 x_1 \<Longrightarrow> ?H2 x_2 (?H3 x_1) = ?H4 (\<lambda>y_1. ?H5 x_2 (x_1 y_1))
[ "Cfun.cfun.Rep_cfun", "StreamFusion.enumFromToStep", "Cfun.cfun.Abs_cfun", "Cont.cont", "Deflation.deflation", "Cfun.cfcomp_syn", "StreamFusion.Switch.is_S1", "StreamFusion.Switch.Abs_Switch" ]
[ "definition cont :: \"('a::cpo \\<Rightarrow> 'b::cpo) \\<Rightarrow> bool\"\n where \"cont f = (\\<forall>Y. chain Y \\<longrightarrow> range (\\<lambda>i. f (Y i)) <<| f (\\<Squnion>i. Y i))\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"" ]
Stream-Fusion/StreamFusion
StreamFusion.unfold_enumFromToStep
lemma unfold_enumFromToStep: "unfold\<cdot>(enumFromToStep\<cdot>(up\<cdot>y))\<cdot>(up\<cdot>n) = enumFromToL\<cdot>n\<cdot>(up\<cdot>y)"
unfold\<cdot>(enumFromToStep\<cdot>(up\<cdot>?y))\<cdot>(up\<cdot>?n) = enumFromToL\<cdot>?n\<cdot>(up\<cdot>?y)
?H1 (?H2 ?H3 (?H4 ?H5 (?H6 ?H7 x_1))) (?H8 ?H9 x_2) = ?H10 (?H11 ?H12 x_2) (?H6 ?H7 x_1)
[ "StreamFusion.Switch.Switch_case", "LazyList.concatMapL", "LazyList.enumFromToL", "StreamFusion.enumFromToStep", "Up.up", "Porder.po_class.Lub", "Stream.unfold", "Cfun.cfun.Rep_cfun" ]
[ "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"", "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.unstream_concatMapS
lemma unstream_concatMapS: "unstream\<cdot>(concatMapS\<cdot>f\<cdot>a) = concatMapL\<cdot>(unstream oo f)\<cdot>(unstream\<cdot>a)"
unstream\<cdot>(concatMapS\<cdot>?f\<cdot>?a) = concatMapL\<cdot>(unstream oo ?f)\<cdot>(unstream\<cdot>?a)
?H1 ?H2 (?H3 (?H4 ?H5 x_1) x_2) = ?H6 (?H7 ?H8 (?H9 ?H10 x_1)) (?H11 ?H12 x_2)
[ "Cfun.cfcomp_syn", "LazyList.zipWithL", "Fixrec.run", "Stream.unstream", "LazyList.concatMapL", "StreamFusion.concatMapS", "Cfun.cfun.Rep_cfun", "Fixrec.match_up" ]
[ "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition\n run :: \"'a match \\<rightarrow> 'a::pcpo\" where\n \"run = (\\<Lambda> m. sscase\\<cdot>\\<bottom>\\<cdot>(fup\\<cdot>ID)\\<cdot>(Rep_match m))\"", "definition\n match_up :: \"'a::cpo u \\<rightarrow> ('a \\<rightarrow> 'c match) \\<rightarrow> 'c match\"\nwhere\n \"match_up = (\\<Lambda> x k. fup\\<cdot>k\\<cdot>x)\"" ]
Stream-Fusion/StreamFusion
StreamFusion.concatMapL_eq
lemma concatMapL_eq: "concatMapL\<cdot>f\<cdot>xs = unstream\<cdot>(concatMapS\<cdot>(stream oo f)\<cdot>(stream\<cdot>xs))"
concatMapL\<cdot>?f\<cdot>?xs = unstream\<cdot>(concatMapS\<cdot>(stream oo ?f)\<cdot>(stream\<cdot>?xs))
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 ?H8 (?H9 ?H10 x_1)) (?H11 ?H12 x_2))
[ "Stream.stream", "Stream.unstream", "StreamFusion.Switch.S2", "StreamFusion.concatMapS", "LazyList.concatMapL", "Cfun.cfcomp_syn", "Cfun.cfun.Rep_cfun", "StreamFusion.Maybe_map" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"" ]
Stream-Fusion/StreamFusion
StreamFusion.Either_map_unfold
null
Either_map\<cdot>?a\<cdot>?b = Either_abs oo ssum_map\<cdot>?a\<cdot>?b oo Either_rep
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 (?H8 ?H9 x_1) x_2) ?H10)
[ "StreamFusion.Either_map", "Cfun.cfun.Rep_cfun", "StreamFusion.Maybe.is_Nothing", "StreamFusion.Either_rep", "Cfun.cfcomp_syn", "Map_Functions.ssum_map", "StreamFusion.Either_abs", "StreamFusion.Maybe_bisim" ]
[ "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition ssum_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<oplus> 'c \\<rightarrow> 'b \\<oplus> 'd\"\n where \"ssum_map = (\\<Lambda> f g. sscase\\<cdot>(sinl oo f)\\<cdot>(sinr oo g))\"" ]
Stream-Fusion/StreamFusion
StreamFusion.Both_map_unfold
null
Both_map\<cdot>?a\<cdot>?b = Both_abs oo sprod_map\<cdot>?a\<cdot>?b oo Both_rep
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 (?H8 ?H9 x_1) x_2) ?H10)
[ "Cfun.cfun.Rep_cfun", "Map_Functions.ssum_map", "Cfun.cfcomp_syn", "StreamFusion.Both_abs", "Map_Functions.sprod_map", "StreamFusion.Both.Abs_Both", "StreamFusion.Both_rep", "StreamFusion.Both_map", "Stream.unfold" ]
[ "definition ssum_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<oplus> 'c \\<rightarrow> 'b \\<oplus> 'd\"\n where \"ssum_map = (\\<Lambda> f g. sscase\\<cdot>(sinl oo f)\\<cdot>(sinr oo g))\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition sprod_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<otimes> 'c \\<rightarrow> 'b \\<otimes> 'd\"\n where \"sprod_map = (\\<Lambda> f g. ssplit\\<cdot>(\\<Lambda> x y. (:f\\<cdot>x, g\\<cdot>y:)))\"" ]
Stream-Fusion/StreamFusion
StreamFusion.appendL_eq
lemma appendL_eq: "appendL\<cdot>xs\<cdot>ys = unstream\<cdot>(appendS\<cdot>(stream\<cdot>xs)\<cdot>(stream\<cdot>ys))"
appendL\<cdot>?xs\<cdot>?ys = unstream\<cdot>(appendS\<cdot>(stream\<cdot>?xs)\<cdot>(stream\<cdot>?ys))
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 ?H8 (?H9 ?H10 x_1)) (?H9 ?H10 x_2))
[ "Cfun.cfun.Rep_cfun", "StreamFusion.L_abs", "LazyList.appendL", "Stream.stream", "StreamFusion.Switch.Switch_case", "StreamFusion.Both.Both_case", "Stream.unstream", "StreamFusion.appendS" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/StreamFusion
StreamFusion.Maybe_map_unfold
null
Maybe_map\<cdot>?a = Maybe_abs oo ssum_map\<cdot>ID\<cdot>?a oo Maybe_rep
?H1 ?H2 x_1 = ?H3 ?H4 (?H5 (?H6 (?H7 ?H8 ?H9) x_1) ?H10)
[ "Cfun.ID", "StreamFusion.Maybe_map", "StreamFusion.Both_bisim", "StreamFusion.Maybe_abs", "StreamFusion.Maybe_rep", "Cfun.cfcomp_syn", "StreamFusion.Switch_bisim", "Cfun.cfun.Rep_cfun", "Map_Functions.ssum_map" ]
[ "definition ID :: \"'a \\<rightarrow> 'a\"\n where \"ID = (\\<Lambda> x. x)\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition ssum_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<oplus> 'c \\<rightarrow> 'b \\<oplus> 'd\"\n where \"ssum_map = (\\<Lambda> f g. sscase\\<cdot>(sinl oo f)\\<cdot>(sinr oo g))\"" ]
Stream-Fusion/StreamFusion
StreamFusion.foldrL_eq
lemma foldrL_eq: "foldrL\<cdot>f\<cdot>z\<cdot>xs = foldrS\<cdot>f\<cdot>z\<cdot>(stream\<cdot>xs)"
foldrL\<cdot>?f\<cdot>?z\<cdot>?xs = foldrS\<cdot>?f\<cdot>?z\<cdot>(stream\<cdot>?xs)
?H1 (?H2 (?H3 ?H4 x_1) x_2) x_3 = ?H5 (?H6 (?H7 ?H8 x_1) x_2) (?H9 ?H10 x_3)
[ "StreamFusion.Either_abs", "Stream.stream", "StreamFusion.Switch.match_S2", "StreamFusion.Maybe.Maybe_case", "StreamFusion.foldrS", "Tr.cifte_syn", "Cfun.cfun.Rep_cfun", "LazyList.foldrL" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2", "abbreviation cifte_syn :: \"[tr, 'c, 'c] \\<Rightarrow> 'c\" (\"(If (_)/ then (_)/ else (_))\" [0, 0, 60] 60)\n where \"If b then e1 else e2 \\<equiv> tr_case\\<cdot>e1\\<cdot>e2\\<cdot>b\"" ]
Stream-Fusion/StreamFusion
StreamFusion.mapL_eq
lemma mapL_eq: "mapL\<cdot>f\<cdot>xs = unstream\<cdot>(mapS\<cdot>f\<cdot>(stream\<cdot>xs))"
mapL\<cdot>?f\<cdot>?xs = unstream\<cdot>(mapS\<cdot>?f\<cdot>(stream\<cdot>?xs))
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 ?H8 x_1) (?H9 ?H10 x_2))
[ "Stream.stream", "Stream.unstream", "StreamFusion.mapS", "LazyList.mapL", "Cfun.cfun.Rep_cfun" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/StreamFusion
StreamFusion.filterL_eq
lemma filterL_eq: "filterL\<cdot>p\<cdot>xs = unstream\<cdot>(filterS\<cdot>p\<cdot>(stream\<cdot>xs))"
filterL\<cdot>?p\<cdot>?xs = unstream\<cdot>(filterS\<cdot>?p\<cdot>(stream\<cdot>?xs))
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 ?H8 x_1) (?H9 ?H10 x_2))
[ "LazyList.filterL", "StreamFusion.Either.Right", "Stream.stream", "Cfun.cfun.Rep_cfun", "StreamFusion.L_bisim", "StreamFusion.filterS", "Stream.unstream" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/StreamFusion
StreamFusion.L_map_unfold
null
L_map\<cdot>?a = L_abs oo u_map\<cdot>?a oo L_rep
?H1 ?H2 x_1 = ?H3 ?H4 (?H5 (?H6 ?H7 x_1) ?H8)
[ "Cfun.cfun.Rep_cfun", "Map_Functions.u_map", "StreamFusion.L_rep", "StreamFusion.L_abs", "Cfun.cfcomp_syn", "StreamFusion.L_map" ]
[ "definition u_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> 'a u \\<rightarrow> 'b u\"\n where \"u_map = (\\<Lambda> f. fup\\<cdot>(up oo f))\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"" ]
Stream-Fusion/StreamFusion
StreamFusion.deflation_Either_map
null
deflation ?a \<Longrightarrow> deflation ?b \<Longrightarrow> deflation (Either_map\<cdot>?a\<cdot>?b)
\<lbrakk>?H1 x_1; ?H2 x_2\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_2)
[ "Representable.domain_class.defl", "StreamFusion.Switch.S1", "Cfun.cfun.Rep_cfun", "Stream.stream", "StreamFusion.Either.match_Left", "Deflation.deflation", "StreamFusion.Either_map" ]
[ "class \"domain\" = predomain_syn + pcpo +\n fixes emb :: \"'a \\<rightarrow> udom\"\n fixes prj :: \"udom \\<rightarrow> 'a\"\n fixes defl :: \"'a itself \\<Rightarrow> udom defl\"\n assumes ep_pair_emb_prj: \"ep_pair emb prj\"\n assumes cast_DEFL: \"cast\\<cdot>(defl TYPE('a)) = emb oo prj\"\n assumes liftemb_eq: \"liftemb = u_map\\<cdot>emb\"\n assumes liftprj_eq: \"liftprj = u_map\\<cdot>prj\"\n assumes liftdefl_eq: \"liftdefl TYPE('a) = liftdefl_of\\<cdot>(defl TYPE('a))\"", "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/StreamFusion
StreamFusion.deflation_Both_map
null
deflation ?a \<Longrightarrow> deflation ?b \<Longrightarrow> deflation (Both_map\<cdot>?a\<cdot>?b)
\<lbrakk>?H1 x_1; ?H2 x_2\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_2)
[ "StreamFusion.Both_map", "Fixrec.match_up", "Deflation.deflation", "Cfun.cfun.Rep_cfun", "StreamFusion.enumFromToStep" ]
[ "definition\n match_up :: \"'a::cpo u \\<rightarrow> ('a \\<rightarrow> 'c match) \\<rightarrow> 'c match\"\nwhere\n \"match_up = (\\<Lambda> x k. fup\\<cdot>k\\<cdot>x)\"" ]
Stream-Fusion/StreamFusion
StreamFusion.unstream_enumFromToS
lemma unstream_enumFromToS: "unstream\<cdot>(enumFromToS\<cdot>x\<cdot>y) = enumFromToL\<cdot>x\<cdot>y"
unstream\<cdot>(enumFromToS\<cdot>?x\<cdot>?y) = enumFromToL\<cdot>?x\<cdot>?y
?H1 ?H2 (?H3 (?H4 ?H5 x_1) x_2) = ?H6 (?H7 ?H8 x_1) x_2
[ "StreamFusion.appendStep", "StreamFusion.Maybe.match_Nothing", "Stream.unstream", "LazyList.enumFromToL", "StreamFusion.enumFromToS", "Cfun.cfun.Rep_cfun", "Porder.below_class.below" ]
[ "class below =\n fixes below :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToL_eq
lemma enumFromToL_eq: "enumFromToL\<cdot>x\<cdot>y = unstream\<cdot>(enumFromToS\<cdot>x\<cdot>y)"
enumFromToL\<cdot>?x\<cdot>?y = unstream\<cdot>(enumFromToS\<cdot>?x\<cdot>?y)
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 ?H8 x_1) x_2)
[ "Porder.below_class.not_below", "LazyList.enumFromToL", "Fixrec.succeed", "Stream.unstream", "StreamFusion.enumFromToS", "Cfun.cfun.Rep_cfun" ]
[ "class below =\n fixes below :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin", "definition\n succeed :: \"'a \\<rightarrow> 'a match\" where\n \"succeed = (\\<Lambda> x. Abs_match (sinr\\<cdot>(up\\<cdot>x)))\"" ]
Stream-Fusion/StreamFusion
StreamFusion.stream_congs(3)
null
?a \<approx> ?b \<Longrightarrow> stream\<cdot>(unstream\<cdot>?a) \<approx> ?b
?H1 x_1 x_2 \<Longrightarrow> ?H2 (?H3 ?H4 (?H5 ?H6 x_1)) x_2
[ "StreamFusion.Either_defl", "Stream.bisimilar", "StreamFusion.Maybe.match_Nothing", "Stream.unstream", "Cfun.cfun.Rep_cfun", "Stream.stream" ]
[ "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"", "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/StreamFusion
StreamFusion.stream_congs(1)
null
?a \<approx> ?b \<Longrightarrow> unstream\<cdot>?a = unstream\<cdot>?b
?H1 x_1 x_2 \<Longrightarrow> ?H2 ?H3 x_1 = ?H4 ?H5 x_2
[ "Cont.cont", "Stream.unstream", "StreamFusion.Switch_defl", "StreamFusion.enumFromToS", "Stream.bisimilar", "Cfun.cfun.Rep_cfun" ]
[ "definition cont :: \"('a::cpo \\<Rightarrow> 'b::cpo) \\<Rightarrow> bool\"\n where \"cont f = (\\<forall>Y. chain Y \\<longrightarrow> range (\\<lambda>i. f (Y i)) <<| f (\\<Squnion>i. Y i))\"", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/StreamFusion
StreamFusion.stream_congs(2)
null
?xs = ?ys \<Longrightarrow> stream\<cdot>?xs \<approx> stream\<cdot>?ys
x_1 = x_2 \<Longrightarrow> ?H1 (?H2 ?H3 x_1) (?H2 ?H3 x_2)
[ "StreamFusion.filterStep", "StreamFusion.filterS", "StreamFusion.Maybe_finite", "Stream.stream", "Cfun.cfun.Rep_cfun", "Stream.Step.Skip", "Stream.bisimilar" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/StreamFusion
StreamFusion.isodefl_Maybe
null
isodefl ?fa ?da \<Longrightarrow> isodefl (Maybe_map\<cdot>?fa) (Maybe_defl\<cdot>?da)
?H1 x_1 x_2 \<Longrightarrow> ?H2 (?H3 ?H4 x_1) (?H5 ?H6 x_2)
[ "StreamFusion.Maybe_defl", "StreamFusion.Switch.is_S1", "StreamFusion.Maybe_map", "Domain.isodefl", "StreamFusion.L_bisim", "StreamFusion.appendS", "Cfun.cfun.Rep_cfun" ]
[ "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"" ]
Stream-Fusion/StreamFusion
StreamFusion.isodefl_L
null
isodefl ?fa ?da \<Longrightarrow> isodefl (L_map\<cdot>?fa) (L_defl\<cdot>?da)
?H1 x_1 x_2 \<Longrightarrow> ?H2 (?H3 ?H4 x_1) (?H5 ?H6 x_2)
[ "Cfun.cfun.Rep_cfun", "StreamFusion.L_defl", "StreamFusion.L_map", "Domain.isodefl" ]
[ "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToStep_strict(3)
lemma enumFromToStep_strict [simp]: "enumFromToStep\<cdot>\<bottom>\<cdot>x'' = \<bottom>" "enumFromToStep\<cdot>(up\<cdot>y)\<cdot>\<bottom> = \<bottom>" "enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>\<bottom>) = \<bottom>"
enumFromToStep\<cdot>(up\<cdot>?y)\<cdot>(up\<cdot>\<bottom>) = \<bottom>
?H1 (?H2 ?H3 (?H4 ?H5 x_1)) (?H6 ?H7 ?H8) = ?H9
[ "Up.up", "Pcpo.pcpo_class.bottom", "StreamFusion.enumFromToStep", "Cfun.cfun.Rep_cfun" ]
[ "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.appendStep_strict
lemma appendStep_strict [simp]: "appendStep\<cdot>ha\<cdot>hb\<cdot>sb0\<cdot>\<bottom> = \<bottom>"
appendStep\<cdot>?ha\<cdot>?hb\<cdot>?sb0.0\<cdot>\<bottom> = \<bottom>
?H1 (?H2 (?H3 (?H4 ?H5 x_1) x_2) x_3) ?H6 = ?H7
[ "Cfun.cfun.Rep_cfun", "Cfun.cfun.Abs_cfun", "LazyList.filterL", "Pcpo.pcpo_class.bottom", "StreamFusion.appendStep", "StreamFusion.Either_rep", "StreamFusion.Both_map" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.zipWithStep_strict
lemma zipWithStep_strict [simp]: "zipWithStep\<cdot>f\<cdot>ha\<cdot>hb\<cdot>\<bottom> = \<bottom>"
zipWithStep\<cdot>?f\<cdot>?ha\<cdot>?hb\<cdot>\<bottom> = \<bottom>
?H1 (?H2 (?H3 (?H4 ?H5 x_1) x_2) x_3) ?H6 = ?H7
[ "Cfun.cfun.Rep_cfun", "StreamFusion.zipWithStep", "Pcpo.pcpo_class.bottom" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToStep_strict(2)
lemma enumFromToStep_strict [simp]: "enumFromToStep\<cdot>\<bottom>\<cdot>x'' = \<bottom>" "enumFromToStep\<cdot>(up\<cdot>y)\<cdot>\<bottom> = \<bottom>" "enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>\<bottom>) = \<bottom>"
enumFromToStep\<cdot>(up\<cdot>?y)\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 (?H4 ?H5 x_1)) ?H6 = ?H7
[ "Deflation.deflation", "StreamFusion.enumFromToStep", "Stream.unfold", "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "Up.up" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"" ]
Stream-Fusion/StreamFusion
StreamFusion.concatMapStep_strict
lemma concatMapStep_strict [simp]: "concatMapStep\<cdot>f\<cdot>ha\<cdot>\<bottom> = \<bottom>"
concatMapStep\<cdot>?f\<cdot>?ha\<cdot>\<bottom> = \<bottom>
?H1 (?H2 (?H3 ?H4 x_1) x_2) ?H5 = ?H6
[ "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "StreamFusion.concatMapStep" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.deflation_Maybe_map
null
deflation ?a \<Longrightarrow> deflation (Maybe_map\<cdot>?a)
?H1 x_1 \<Longrightarrow> ?H2 (?H3 ?H4 x_1)
[ "Stream.unfold", "StreamFusion.Maybe_map", "Deflation.deflation", "Cfun.cfun.Rep_cfun" ]
[]
Stream-Fusion/StreamFusion
StreamFusion.deflation_L_map
null
deflation ?a \<Longrightarrow> deflation (L_map\<cdot>?a)
?H1 x_1 \<Longrightarrow> ?H2 (?H3 ?H4 x_1)
[ "StreamFusion.Either.Either_case", "StreamFusion.L_map", "Deflation.deflation", "StreamFusion.Switch_rep", "Cfun.cfun.Rep_cfun", "Stream.unstream", "Stream.Step.Step_case" ]
[]
Stream-Fusion/StreamFusion
StreamFusion.concatMapS_strict
lemma concatMapS_strict [simp]: "concatMapS\<cdot>f\<cdot>\<bottom> = \<bottom>"
concatMapS\<cdot>?f\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 x_1) ?H4 = ?H5
[ "StreamFusion.Maybe_finite", "Porder.po_class.chain", "StreamFusion.concatMapS", "Cfun.cfun.Rep_cfun", "Pcpo.pcpo_class.bottom", "StreamFusion.Maybe_rep", "StreamFusion.Both_bisim" ]
[ "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/StreamFusion
StreamFusion.enumFromToStep_strict(1)
lemma enumFromToStep_strict [simp]: "enumFromToStep\<cdot>\<bottom>\<cdot>x'' = \<bottom>" "enumFromToStep\<cdot>(up\<cdot>y)\<cdot>\<bottom> = \<bottom>" "enumFromToStep\<cdot>(up\<cdot>y)\<cdot>(up\<cdot>\<bottom>) = \<bottom>"
enumFromToStep\<cdot>\<bottom>\<cdot>?x'' = \<bottom>
?H1 (?H2 ?H3 ?H4) x_1 = ?H5
[ "Stream.stream", "StreamFusion.enumFromToStep", "StreamFusion.Either_map", "Cfun.cfun.Rep_cfun", "Pcpo.pcpo_class.bottom", "StreamFusion.Maybe_finite" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/LazyList
LazyList.enumFromToL_simps'(1)
lemma enumFromToL_simps' [simp]: "x \<le> y \<Longrightarrow> enumFromToL\<cdot>(up\<cdot>x)\<cdot>(up\<cdot>y) = LCons\<cdot>(up\<cdot>x)\<cdot>(enumFromToL\<cdot>(up\<cdot>(x+1))\<cdot>(up\<cdot>y))" "\<not> x \<le> y \<Longrightarrow> enumFromToL\<cdot>(up\<cdot>x)\<cdot>(up\<cdot>y) = LNil"
?x \<le> ?y \<Longrightarrow> enumFromToL\<cdot>(up\<cdot>?x)\<cdot>(up\<cdot>?y) = LCons\<cdot>(up\<cdot>?x)\<cdot>(enumFromToL\<cdot>(up\<cdot>(?x + 1))\<cdot>(up\<cdot>?y))
x_1 \<le> x_2 \<Longrightarrow> ?H1 (?H2 ?H3 (?H4 ?H5 x_1)) (?H4 ?H5 x_2) = ?H6 (?H7 ?H8 (?H4 ?H5 x_1)) (?H1 (?H2 ?H3 (?H4 ?H5 (?H9 x_1 ?H10))) (?H4 ?H5 x_2))
[ "LazyList.LList_bisim", "Groups.plus_class.plus", "Cfun.cfun.Rep_cfun", "LazyList.enumFromToL", "Fixrec.run", "Domain.defl_set", "LazyList.LList.LCons", "Groups.one_class.one", "Tr.FF", "Up.up" ]
[ "class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)", "definition\n run :: \"'a match \\<rightarrow> 'a::pcpo\" where\n \"run = (\\<Lambda> m. sscase\\<cdot>\\<bottom>\\<cdot>(fup\\<cdot>ID)\\<cdot>(Rep_match m))\"", "definition defl_set :: \"'a::bifinite defl \\<Rightarrow> 'a set\"\nwhere \"defl_set A = {x. cast\\<cdot>A\\<cdot>x = x}\"", "class one =\n fixes one :: 'a (\"1\")", "definition FF :: \"tr\"\n where \"FF = Def False\"", "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"" ]
Stream-Fusion/LazyList
LazyList.LList_map_unfold
null
LList_map\<cdot>?a = LList_abs oo ssum_map\<cdot>ID\<cdot>(sprod_map\<cdot>(u_map\<cdot>?a)\<cdot>(u_map\<cdot>(LList_map\<cdot>?a))) oo LList_rep
?H1 ?H2 x_1 = ?H3 ?H4 (?H5 (?H6 (?H7 ?H8 ?H9) (?H10 (?H11 ?H12 (?H13 ?H14 x_1)) (?H15 ?H16 (?H1 ?H2 x_1)))) ?H17)
[ "LazyList.LList_map", "Cfun.ID", "Map_Functions.sprod_map", "LazyList.appendL", "Cfun.cfcomp_syn", "Map_Functions.u_map", "Map_Functions.ssum_map", "LazyList.LList_rep", "LazyList.LList.Rep_LList", "Cfun.cfun.Rep_cfun", "LazyList.LList_abs", "Tr.TT" ]
[ "definition ID :: \"'a \\<rightarrow> 'a\"\n where \"ID = (\\<Lambda> x. x)\"", "definition sprod_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<otimes> 'c \\<rightarrow> 'b \\<otimes> 'd\"\n where \"sprod_map = (\\<Lambda> f g. ssplit\\<cdot>(\\<Lambda> x y. (:f\\<cdot>x, g\\<cdot>y:)))\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition u_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> 'a u \\<rightarrow> 'b u\"\n where \"u_map = (\\<Lambda> f. fup\\<cdot>(up oo f))\"", "definition ssum_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<oplus> 'c \\<rightarrow> 'b \\<oplus> 'd\"\n where \"ssum_map = (\\<Lambda> f g. sscase\\<cdot>(sinl oo f)\\<cdot>(sinr oo g))\"", "definition TT :: \"tr\"\n where \"TT = Def True\"" ]
Stream-Fusion/LazyList
LazyList.enumFromToL_simps'(2)
lemma enumFromToL_simps' [simp]: "x \<le> y \<Longrightarrow> enumFromToL\<cdot>(up\<cdot>x)\<cdot>(up\<cdot>y) = LCons\<cdot>(up\<cdot>x)\<cdot>(enumFromToL\<cdot>(up\<cdot>(x+1))\<cdot>(up\<cdot>y))" "\<not> x \<le> y \<Longrightarrow> enumFromToL\<cdot>(up\<cdot>x)\<cdot>(up\<cdot>y) = LNil"
\<not> ?x \<le> ?y \<Longrightarrow> enumFromToL\<cdot>(up\<cdot>?x)\<cdot>(up\<cdot>?y) = LNil
\<not> x_1 \<le> x_2 \<Longrightarrow> ?H1 (?H2 ?H3 (?H4 ?H5 x_1)) (?H4 ?H5 x_2) = ?H6
[ "LazyList.LList_map", "LazyList.enumFromToL", "LazyList.LList.LNil", "Up.up", "Cfun.cfun.Rep_cfun" ]
[ "definition up :: \"'a \\<rightarrow> 'a u\"\n where \"up = (\\<Lambda> x. Iup x)\"" ]
Stream-Fusion/LazyList
LazyList.zipWithL_strict(2)
lemma zipWithL_strict [simp]: "zipWithL\<cdot>f\<cdot>\<bottom>\<cdot>ys = \<bottom>" "zipWithL\<cdot>f\<cdot>(LCons\<cdot>x\<cdot>xs)\<cdot>\<bottom> = \<bottom>"
zipWithL\<cdot>?f\<cdot>(LCons\<cdot>?x\<cdot>?xs)\<cdot>\<bottom> = \<bottom>
?H1 (?H2 (?H3 ?H4 x_1) (?H5 (?H6 ?H7 x_2) x_3)) ?H8 = ?H9
[ "LazyList.zipWithL", "Cfun.cfun.Rep_cfun", "LazyList.LList_take", "Tr.TT", "LazyList.LList.LCons", "Pcpo.pcpo_class.bottom" ]
[ "definition TT :: \"tr\"\n where \"TT = Def True\"", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/LazyList
LazyList.isodefl_LList
null
isodefl ?fa ?da \<Longrightarrow> isodefl (LList_map\<cdot>?fa) (LList_defl\<cdot>?da)
?H1 x_1 x_2 \<Longrightarrow> ?H2 (?H3 ?H4 x_1) (?H5 ?H6 x_2)
[ "Fixrec.mplus_syn", "Cfun.cfun.Rep_cfun", "LazyList.LList_defl", "Domain.isodefl", "LazyList.LList_map" ]
[ "abbreviation\n mplus_syn :: \"['a match, 'a match] \\<Rightarrow> 'a match\" (infixr \"+++\" 65) where\n \"m1 +++ m2 == mplus\\<cdot>m1\\<cdot>m2\"", "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"" ]
Stream-Fusion/LazyList
LazyList.zipWithL_strict(1)
lemma zipWithL_strict [simp]: "zipWithL\<cdot>f\<cdot>\<bottom>\<cdot>ys = \<bottom>" "zipWithL\<cdot>f\<cdot>(LCons\<cdot>x\<cdot>xs)\<cdot>\<bottom> = \<bottom>"
zipWithL\<cdot>?f\<cdot>\<bottom>\<cdot>?ys = \<bottom>
?H1 (?H2 (?H3 ?H4 x_1) ?H5) x_2 = ?H6
[ "Porder.below_class.below", "Cfun.cfun.Rep_cfun", "LazyList.zipWithL", "Pcpo.pcpo_class.bottom" ]
[ "class below =\n fixes below :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/LazyList
LazyList.foldrL_strict
lemma foldrL_strict [simp]: "foldrL\<cdot>f\<cdot>z\<cdot>\<bottom> = \<bottom>"
foldrL\<cdot>?f\<cdot>?z\<cdot>\<bottom> = \<bottom>
?H1 (?H2 (?H3 ?H4 x_1) x_2) ?H5 = ?H6
[ "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "LazyList.foldrL", "LazyList.LList.LList_case", "Groups.plus_class.plus" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)" ]
Stream-Fusion/LazyList
LazyList.deflation_LList_map
null
deflation ?a \<Longrightarrow> deflation (LList_map\<cdot>?a)
?H1 x_1 \<Longrightarrow> ?H2 (?H3 ?H4 x_1)
[ "LazyList.LList_map", "LazyList.LList_defl", "Cfun.cfun.Rep_cfun", "Deflation.deflation" ]
[]
Stream-Fusion/LazyList
LazyList.enumFromToL_strict(2)
lemma enumFromToL_strict [simp]: "enumFromToL\<cdot>\<bottom>\<cdot>y = \<bottom>" "enumFromToL\<cdot>x\<cdot>\<bottom> = \<bottom>"
enumFromToL\<cdot>?x\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 x_1) ?H4 = ?H5
[ "Groups.plus_class.plus", "Pcpo.pcpo_class.bottom", "LazyList.LList.match_LCons", "LazyList.LList_map", "Cfun.cfun.Rep_cfun", "LazyList.enumFromToL" ]
[ "class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/LazyList
LazyList.enumFromToL_strict(1)
lemma enumFromToL_strict [simp]: "enumFromToL\<cdot>\<bottom>\<cdot>y = \<bottom>" "enumFromToL\<cdot>x\<cdot>\<bottom> = \<bottom>"
enumFromToL\<cdot>\<bottom>\<cdot>?y = \<bottom>
?H1 (?H2 ?H3 ?H4) x_1 = ?H5
[ "LazyList.LList_map", "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "Porder.below_class.below", "Groups.one_class.one", "LazyList.enumFromToL" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "class below =\n fixes below :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin", "class one =\n fixes one :: 'a (\"1\")" ]
Stream-Fusion/LazyList
LazyList.concatMapL_strict
lemma concatMapL_strict [simp]: "concatMapL\<cdot>f\<cdot>\<bottom> = \<bottom>"
concatMapL\<cdot>?f\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 x_1) ?H4 = ?H5
[ "LazyList.concatMapL", "Cfun.cfun.Rep_cfun", "Porder.po_class.Lub", "Pcpo.pcpo_class.bottom", "Cfun.cfcomp_syn", "LazyList.LList_defl", "LazyList.LList.LNil" ]
[ "class po = below +\n assumes below_refl [iff]: \"x \\<sqsubseteq> x\"\n assumes below_trans: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> z \\<Longrightarrow> x \\<sqsubseteq> z\"\n assumes below_antisym: \"x \\<sqsubseteq> y \\<Longrightarrow> y \\<sqsubseteq> x \\<Longrightarrow> x = y\"\nbegin", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"" ]
Stream-Fusion/LazyList
LazyList.mapL_strict
lemma mapL_strict [simp]: "mapL\<cdot>f\<cdot>\<bottom> = \<bottom>"
mapL\<cdot>?f\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 x_1) ?H4 = ?H5
[ "LazyList.mapL", "Fixrec.fail", "LazyList.LList_defl", "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "Cfun.ID" ]
[ "definition\n fail :: \"'a match\" where\n \"fail = Abs_match (sinl\\<cdot>ONE)\"", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "definition ID :: \"'a \\<rightarrow> 'a\"\n where \"ID = (\\<Lambda> x. x)\"" ]
Stream-Fusion/LazyList
LazyList.appendL_LNil_right
lemma appendL_LNil_right: "appendL\<cdot>xs\<cdot>LNil = xs"
appendL\<cdot>?xs\<cdot>LNil = ?xs
?H1 (?H2 ?H3 x_1) ?H4 = x_1
[ "LazyList.appendL", "LazyList.LList.LNil", "LazyList.foldrL", "Fixrec.match_up", "Porder.below_class.not_below", "Cfun.cfun.Rep_cfun" ]
[ "definition\n match_up :: \"'a::cpo u \\<rightarrow> ('a \\<rightarrow> 'c match) \\<rightarrow> 'c match\"\nwhere\n \"match_up = (\\<Lambda> x k. fup\\<cdot>k\\<cdot>x)\"", "class below =\n fixes below :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin" ]
Stream-Fusion/LazyList
LazyList.appendL_strict
lemma appendL_strict [simp]: "appendL\<cdot>\<bottom>\<cdot>ys = \<bottom>"
appendL\<cdot>\<bottom>\<cdot>?ys = \<bottom>
?H1 (?H2 ?H3 ?H4) x_1 = ?H4
[ "Pcpo.pcpo_class.bottom", "LazyList.appendL", "Cfun.cfun.Rep_cfun" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/LazyList
LazyList.filterL_strict
lemma filterL_strict [simp]: "filterL\<cdot>p\<cdot>\<bottom> = \<bottom>"
filterL\<cdot>?p\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 x_1) ?H4 = ?H4
[ "Cfun.cfun.Rep_cfun", "Pcpo.pcpo_class.bottom", "LazyList.filterL" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/Stream
Stream.Stream_map_unfold
null
Stream_map\<cdot>?a\<cdot>?s = Stream_abs oo sprod_map\<cdot>(u_map\<cdot>(cfun_map\<cdot>?s\<cdot>(Step_map\<cdot>?a\<cdot>?s)))\<cdot>?s oo Stream_rep
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 (?H8 ?H9 (?H10 ?H11 (?H12 (?H13 ?H14 x_2) (?H15 (?H16 ?H17 x_1) x_2)))) x_2) ?H18)
[ "Stream.Step_map", "Map_Functions.sprod_map", "Cfun.cfcomp_syn", "Map_Functions.u_map", "Stream.Stream_map", "Map_Functions.cfun_map", "Stream.Stream_abs", "Cfun.cfun.Rep_cfun", "Stream.Stream_rep" ]
[ "definition sprod_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<otimes> 'c \\<rightarrow> 'b \\<otimes> 'd\"\n where \"sprod_map = (\\<Lambda> f g. ssplit\\<cdot>(\\<Lambda> x y. (:f\\<cdot>x, g\\<cdot>y:)))\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition u_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> 'a u \\<rightarrow> 'b u\"\n where \"u_map = (\\<Lambda> f. fup\\<cdot>(up oo f))\"", "definition cfun_map :: \"('b \\<rightarrow> 'a) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> ('a \\<rightarrow> 'c) \\<rightarrow> ('b \\<rightarrow> 'd)\"\n where \"cfun_map = (\\<Lambda> a b f x. b\\<cdot>(f\\<cdot>(a\\<cdot>x)))\"" ]
Stream-Fusion/Stream
Stream.Step_map_unfold
null
Step_map\<cdot>?a\<cdot>?s = Step_abs oo ssum_map\<cdot>ID\<cdot>(ssum_map\<cdot>?s\<cdot>(sprod_map\<cdot>(u_map\<cdot>?a)\<cdot>?s)) oo Step_rep
?H1 (?H2 ?H3 x_1) x_2 = ?H4 ?H5 (?H6 (?H7 (?H8 ?H9 ?H10) (?H11 (?H12 ?H13 x_2) (?H14 (?H15 ?H16 (?H17 ?H18 x_1)) x_2))) ?H19)
[ "Stream.Step_rep", "Stream.Step_map", "Map_Functions.u_map", "Map_Functions.sprod_map", "LazyList.LList.match_LNil", "Cfun.cfcomp_syn", "Fixrec.fail", "Map_Functions.ssum_map", "Cfun.ID", "Cfun.cfun.Rep_cfun", "Stream.Stream.is_Stream", "Stream.Step_abs" ]
[ "definition u_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> 'a u \\<rightarrow> 'b u\"\n where \"u_map = (\\<Lambda> f. fup\\<cdot>(up oo f))\"", "definition sprod_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<otimes> 'c \\<rightarrow> 'b \\<otimes> 'd\"\n where \"sprod_map = (\\<Lambda> f g. ssplit\\<cdot>(\\<Lambda> x y. (:f\\<cdot>x, g\\<cdot>y:)))\"", "abbreviation cfcomp_syn :: \"['b \\<rightarrow> 'c, 'a \\<rightarrow> 'b] \\<Rightarrow> 'a \\<rightarrow> 'c\" (infixr \"oo\" 100)\n where \"f oo g == cfcomp\\<cdot>f\\<cdot>g\"", "definition\n fail :: \"'a match\" where\n \"fail = Abs_match (sinl\\<cdot>ONE)\"", "definition ssum_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> ('c \\<rightarrow> 'd) \\<rightarrow> 'a \\<oplus> 'c \\<rightarrow> 'b \\<oplus> 'd\"\n where \"ssum_map = (\\<Lambda> f g. sscase\\<cdot>(sinl oo f)\\<cdot>(sinr oo g))\"", "definition ID :: \"'a \\<rightarrow> 'a\"\n where \"ID = (\\<Lambda> x. x)\"" ]
Stream-Fusion/Stream
Stream.unfold_ind
lemma unfold_ind: fixes P :: "('s \<rightarrow> 'a LList) \<Rightarrow> bool" assumes "adm P" and "P \<bottom>" and "\<And>u. P u \<Longrightarrow> P (unfoldF\<cdot>h\<cdot>u)" shows "P (unfold\<cdot>h)"
adm ?P \<Longrightarrow> ?P \<bottom> \<Longrightarrow> (\<And>u. ?P u \<Longrightarrow> ?P (unfoldF\<cdot>?h\<cdot>u)) \<Longrightarrow> ?P (unfold\<cdot>?h)
\<lbrakk>?H1 x_1; x_1 ?H2; \<And>y_0. x_1 y_0 \<Longrightarrow> x_1 (?H3 (?H4 ?H5 x_2) y_0)\<rbrakk> \<Longrightarrow> x_1 (?H6 ?H7 x_2)
[ "Fixrec.match_up", "Stream.Step.Yield", "Orderings.ord_class.min", "Adm.adm", "Stream.unfoldF", "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "Cfun.cfun.Abs_cfun", "Stream.unfold" ]
[ "definition\n match_up :: \"'a::cpo u \\<rightarrow> ('a \\<rightarrow> 'c match) \\<rightarrow> 'c match\"\nwhere\n \"match_up = (\\<Lambda> x k. fup\\<cdot>k\\<cdot>x)\"", "class ord =\n fixes less_eq :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\n and less :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin", "definition adm :: \"('a::cpo \\<Rightarrow> bool) \\<Rightarrow> bool\"\n where \"adm P \\<longleftrightarrow> (\\<forall>Y. chain Y \\<longrightarrow> (\\<forall>i. P (Y i)) \\<longrightarrow> P (\\<Squnion>i. Y i))\"", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/Stream
Stream.isodefl_Stream
null
isodefl ?fa ?da \<Longrightarrow> isodefl ?fs ?ds \<Longrightarrow> isodefl (Stream_map\<cdot>?fa\<cdot>?fs) (Stream_defl\<cdot>?da\<cdot>?ds)
\<lbrakk>?H1 x_1 x_2; ?H2 x_3 x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_3) (?H7 (?H8 ?H9 x_2) x_4)
[ "Domain.isodefl", "Stream.Step.is_Skip", "Deflation.deflation", "Stream.Stream_defl", "Cfun.cfun.Rep_cfun", "Stream.Stream_map" ]
[ "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"" ]
Stream-Fusion/Stream
Stream.isodefl_Step
null
isodefl ?fa ?da \<Longrightarrow> isodefl ?fs ?ds \<Longrightarrow> isodefl (Step_map\<cdot>?fa\<cdot>?fs) (Step_defl\<cdot>?da\<cdot>?ds)
\<lbrakk>?H1 x_1 x_2; ?H2 x_3 x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_3) (?H7 (?H8 ?H9 x_2) x_4)
[ "Stream.Step_defl", "Cfun.cfun.Rep_cfun", "Stream.Stream.Stream", "Domain.isodefl", "Stream.Step_map", "Stream.Stream.is_Stream" ]
[ "definition isodefl :: \"('a \\<rightarrow> 'a) \\<Rightarrow> udom defl \\<Rightarrow> bool\"\n where \"isodefl d t \\<longleftrightarrow> cast\\<cdot>t = emb oo d oo prj\"" ]
Stream-Fusion/Stream
Stream.unfoldF
lemma unfoldF: "s \<noteq> \<bottom> \<Longrightarrow> unfoldF\<cdot>h\<cdot>u\<cdot>s = unfold2\<cdot>u\<cdot>(h\<cdot>s)"
?s \<noteq> \<bottom> \<Longrightarrow> unfoldF\<cdot>?h\<cdot>?u\<cdot>?s = unfold2\<cdot>?u\<cdot>(?h\<cdot>?s)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 (?H3 (?H4 ?H5 x_2) x_3) x_1 = ?H6 (?H7 ?H8 x_3) (?H9 x_2 x_1)
[ "Stream.Stream_abs", "Stream.unfoldF", "Fixrec.run", "Cfun.cfun.Rep_cfun", "Stream.unfold2", "Pcpo.pcpo_class.bottom" ]
[ "definition\n run :: \"'a match \\<rightarrow> 'a::pcpo\" where\n \"run = (\\<Lambda> m. sscase\\<cdot>\\<bottom>\\<cdot>(fup\\<cdot>ID)\\<cdot>(Rep_match m))\"", "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Stream-Fusion/Stream
Stream.unfold
lemma unfold: "s \<noteq> \<bottom> \<Longrightarrow> unfold\<cdot>h\<cdot>s = unfold2\<cdot>(unfold\<cdot>h)\<cdot>(h\<cdot>s)"
?s \<noteq> \<bottom> \<Longrightarrow> unfold\<cdot>?h\<cdot>?s = unfold2\<cdot>(unfold\<cdot>?h)\<cdot>(?h\<cdot>?s)
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 (?H3 ?H4 x_2) x_1 = ?H5 (?H6 ?H7 (?H3 ?H4 x_2)) (?H8 x_2 x_1)
[ "Stream.Stream_finite", "Pcpo.pcpo_class.bottom", "Cfun.cfun.Rep_cfun", "Stream.bisimilar", "Stream.Stream.Stream_case", "Stream.Stream.is_Stream", "Stream.unfold2", "Stream.unfold" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/Stream
Stream.deflation_Stream_map
null
deflation ?a \<Longrightarrow> deflation ?s \<Longrightarrow> deflation (Stream_map\<cdot>?a\<cdot>?s)
\<lbrakk>?H1 x_1; ?H2 x_2\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_2)
[ "Deflation.deflation", "Stream.Stream_map", "Cfun.cfun.Rep_cfun" ]
[]
Stream-Fusion/Stream
Stream.deflation_Step_map
null
deflation ?a \<Longrightarrow> deflation ?s \<Longrightarrow> deflation (Step_map\<cdot>?a\<cdot>?s)
\<lbrakk>?H1 x_1; ?H2 x_2\<rbrakk> \<Longrightarrow> ?H3 (?H4 (?H5 ?H6 x_1) x_2)
[ "Deflation.deflation", "Tr.TT", "Fixrec.succeed", "Cfun.cfun.Rep_cfun", "Stream.Step_map", "Map_Functions.u_map", "Stream.Step_defl" ]
[ "definition TT :: \"tr\"\n where \"TT = Def True\"", "definition\n succeed :: \"'a \\<rightarrow> 'a match\" where\n \"succeed = (\\<Lambda> x. Abs_match (sinr\\<cdot>(up\\<cdot>x)))\"", "definition u_map :: \"('a \\<rightarrow> 'b) \\<rightarrow> 'a u \\<rightarrow> 'b u\"\n where \"u_map = (\\<Lambda> f. fup\\<cdot>(up oo f))\"" ]
Stream-Fusion/Stream
Stream.stream_unstream_cong
lemma stream_unstream_cong: "a \<approx> b \<Longrightarrow> stream\<cdot>(unstream\<cdot>a) \<approx> b"
?a \<approx> ?b \<Longrightarrow> stream\<cdot>(unstream\<cdot>?a) \<approx> ?b
?H1 x_1 x_2 \<Longrightarrow> ?H2 (?H3 ?H4 (?H5 ?H6 x_1)) x_2
[ "Stream.unstream", "Stream.Step_rep", "Fixrec.mplus_syn", "Stream.Stream.Rep_Stream", "Cfun.cfun.Rep_cfun", "Stream.bisimilar", "Stream.stream" ]
[ "abbreviation\n mplus_syn :: \"['a match, 'a match] \\<Rightarrow> 'a match\" (infixr \"+++\" 65) where\n \"m1 +++ m2 == mplus\\<cdot>m1\\<cdot>m2\"", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"", "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/Stream
Stream.unstream_cong
lemma unstream_cong: "a \<approx> b \<Longrightarrow> unstream\<cdot>a = unstream\<cdot>b"
?a \<approx> ?b \<Longrightarrow> unstream\<cdot>?a = unstream\<cdot>?b
?H1 x_1 x_2 \<Longrightarrow> ?H2 ?H3 x_1 = ?H4 ?H5 x_2
[ "Fixrec.succeed", "Stream.bisimilar", "Stream.unfoldF", "Stream.unstream", "Cfun.cfun.Rep_cfun", "Domain.defl_set" ]
[ "definition\n succeed :: \"'a \\<rightarrow> 'a match\" where\n \"succeed = (\\<Lambda> x. Abs_match (sinr\\<cdot>(up\\<cdot>x)))\"", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"", "definition defl_set :: \"'a::bifinite defl \\<Rightarrow> 'a set\"\nwhere \"defl_set A = {x. cast\\<cdot>A\\<cdot>x = x}\"" ]
Stream-Fusion/Stream
Stream.stream_cong
lemma stream_cong: "xs = ys \<Longrightarrow> stream\<cdot>xs \<approx> stream\<cdot>ys"
?xs = ?ys \<Longrightarrow> stream\<cdot>?xs \<approx> stream\<cdot>?ys
x_1 = x_2 \<Longrightarrow> ?H1 (?H2 ?H3 x_1) (?H2 ?H3 x_2)
[ "Stream.stream", "Cfun.cfun.Rep_cfun", "Stream.bisimilar" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2", "definition\n bisimilar :: \"('a, 's) Stream \\<Rightarrow> ('a, 't) Stream \\<Rightarrow> bool\" (infix \"\\<approx>\" 50)\nwhere\n \"a \\<approx> b \\<longleftrightarrow> unstream\\<cdot>a = unstream\\<cdot>b \\<and> a \\<noteq> \\<bottom> \\<and> b \\<noteq> \\<bottom>\"" ]
Stream-Fusion/Stream
Stream.unfold_eq_fix
lemma unfold_eq_fix: "unfold\<cdot>h = fix\<cdot>(unfoldF\<cdot>h)"
unfold\<cdot>?h = fix\<cdot>(unfoldF\<cdot>?h)
?H1 ?H2 x_1 = ?H3 ?H4 (?H5 ?H6 x_1)
[ "Cfun.cfun.Rep_cfun", "Stream.Stream.match_Stream", "Fix.fix", "Stream.unfoldF", "Stream.unfold" ]
[ "definition \"fix\" :: \"('a \\<rightarrow> 'a) \\<rightarrow> 'a\"\n where \"fix = (\\<Lambda> F. \\<Squnion>i. iterate i\\<cdot>F\\<cdot>\\<bottom>)\"" ]
Stream-Fusion/Stream
Stream.unstream_stream
lemma unstream_stream [simp]: fixes xs :: "'a LList" shows "unstream\<cdot>(stream\<cdot>xs) = xs"
unstream\<cdot>(stream\<cdot>?xs) = ?xs
?H1 ?H2 (?H3 ?H4 x_1) = x_1
[ "Cfun.cfun.Rep_cfun", "Stream.stream", "Cfun.cfun.Abs_cfun", "Stream.Step.match_Skip", "Stream.Step_abs", "Stream.unstream" ]
[ "codatatype (sset: 'a) stream =\n SCons (shd: 'a) (stl: \"'a stream\") (infixr \\<open>##\\<close> 65)\nfor\n map: smap\n rel: stream_all2" ]
Stream-Fusion/Stream
Stream.unfold2_strict
lemma unfold2_strict [simp]: "unfold2\<cdot>u\<cdot>\<bottom> = \<bottom>"
unfold2\<cdot>?u\<cdot>\<bottom> = \<bottom>
?H1 (?H2 ?H3 x_1) ?H4 = ?H5
[ "Pcpo.pcpo_class.bottom", "Stream.unfold2", "Cfun.cfun.Rep_cfun" ]
[ "class pcpo = cpo +\n assumes least: \"\\<exists>x. \\<forall>y. x \\<sqsubseteq> y\"\nbegin" ]
Zeckendorf/Zeckendorf
Zeckendorf.zeckendorf_unique
theorem zeckendorf_unique: assumes "n > 0" assumes "n = (\<Sum> i=0..k. fib (c i))" "inc_seq_on c {0..k-1}" "\<forall>i\<in>{0..k}. c i \<ge> 2" assumes "n = (\<Sum> i=0..k'. fib (c' i))" "inc_seq_on c' {0..k'-1}" "\<forall>i\<in>{0..k'}. c' i \<ge> 2" shows "k = k' \<and> (\<forall> i \<in> {0..k}. c i = c' i)"
0 < ?n \<Longrightarrow> ?n = (\<Sum>i = 0..?k. fib (?c i)) \<Longrightarrow> inc_seq_on ?c {0..?k - 1} \<Longrightarrow> \<forall>i\<in>{0..?k}. 2 \<le> ?c i \<Longrightarrow> ?n = (\<Sum>i = 0..?k'. fib (?c' i)) \<Longrightarrow> inc_seq_on ?c' {0..?k' - 1} \<Longrightarrow> \<forall>i\<in>{0..?k'}. 2 \<le> ?c' i \<Longrightarrow> ?k = ?k' \<and> (\<forall>i\<in>{0..?k}. ?c i = ?c' i)
\<lbrakk>?H1 < x_1; x_1 = ?H2 (\<lambda>y_0. ?H3 (x_2 y_0)) (?H4 ?H1 x_3); ?H5 x_2 (?H4 ?H1 (?H6 x_3 ?H7)); \<forall>y_1\<in>?H4 ?H1 x_3. ?H8 (?H9 ?H10) \<le> x_2 y_1; x_1 = ?H2 (\<lambda>y_2. ?H3 (x_4 y_2)) (?H4 ?H1 x_5); ?H5 x_4 (?H4 ?H1 (?H6 x_5 ?H7)); \<forall>y_3\<in>?H4 ?H1 x_5. ?H8 (?H9 ?H10) \<le> x_4 y_3\<rbrakk> \<Longrightarrow> x_3 = x_5 \<and> (\<forall>y_4\<in>?H4 ?H1 x_3. x_2 y_4 = x_4 y_4)
[ "Fib.fib", "Groups.zero_class.zero", "Set_Interval.ord_class.atLeastAtMost", "Num.num.One", "Num.numeral_class.numeral", "Groups_Big.comm_monoid_add_class.sum", "Groups.one_class.one", "Zeckendorf.inc_seq_on", "Groups.minus_class.minus", "Num.num.Bit0" ]
[ "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "class zero =\n fixes zero :: 'a (\"0\")", "datatype num = One | Bit0 num | Bit1 num", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "class one =\n fixes one :: 'a (\"1\")", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "datatype num = One | Bit0 num | Bit1 num" ]
Zeckendorf/Zeckendorf
Zeckendorf.last_fib_sum_index_constraint
lemma last_fib_sum_index_constraint: assumes "n \<ge> 2" "n = (\<Sum> i=0..k. fib (c i))" "inc_seq_on c {0..k-1}" assumes "\<forall>i\<in>{0..k}. c i \<ge> 2" "fib i \<le> n" "fib(Suc i) > n" shows "c k = i"
2 \<le> ?n \<Longrightarrow> ?n = (\<Sum>i = 0..?k. fib (?c i)) \<Longrightarrow> inc_seq_on ?c {0..?k - 1} \<Longrightarrow> \<forall>i\<in>{0..?k}. 2 \<le> ?c i \<Longrightarrow> fib ?i \<le> ?n \<Longrightarrow> ?n < fib (Suc ?i) \<Longrightarrow> ?c ?k = ?i
\<lbrakk>?H1 (?H2 ?H3) \<le> x_1; x_1 = ?H4 (\<lambda>y_0. ?H5 (x_2 y_0)) (?H6 ?H7 x_3); ?H8 x_2 (?H6 ?H7 (?H9 x_3 ?H10)); \<forall>y_1\<in>?H6 ?H7 x_3. ?H1 (?H2 ?H3) \<le> x_2 y_1; ?H5 x_4 \<le> x_1; x_1 < ?H5 (?H11 x_4)\<rbrakk> \<Longrightarrow> x_2 x_3 = x_4
[ "Nat.Suc", "Num.num.One", "Groups.one_class.one", "Fib.fib", "Set_Interval.ord_class.atLeastAtMost", "Groups.zero_class.zero", "Groups.minus_class.minus", "Num.numeral_class.numeral", "Groups_Big.comm_monoid_add_class.sum", "Zeckendorf.inc_seq_on", "Num.num.Bit0" ]
[ "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "datatype num = One | Bit0 num | Bit1 num", "class one =\n fixes one :: 'a (\"1\")", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "class zero =\n fixes zero :: 'a (\"0\")", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "datatype num = One | Bit0 num | Bit1 num" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_unique_fib_sum
lemma fib_unique_fib_sum: fixes k :: nat assumes "n \<ge> 2" "inc_seq_on c {0..k-1}" "\<forall>i\<in>{0..k}. c i \<ge> 2" assumes "n = fib i" shows "n = (\<Sum>i=0..k. fib (c i)) \<longleftrightarrow> k = 0 \<and> c 0 = i"
2 \<le> ?n \<Longrightarrow> inc_seq_on ?c {0..?k - 1} \<Longrightarrow> \<forall>i\<in>{0..?k}. 2 \<le> ?c i \<Longrightarrow> ?n = fib ?i \<Longrightarrow> (?n = (\<Sum>i = 0..?k. fib (?c i))) = (?k = 0 \<and> ?c 0 = ?i)
\<lbrakk>?H1 (?H2 ?H3) \<le> x_1; ?H4 x_2 (?H5 ?H6 (?H7 x_3 ?H8)); \<forall>y_0\<in>?H5 ?H6 x_3. ?H1 (?H2 ?H3) \<le> x_2 y_0; x_1 = ?H9 x_4\<rbrakk> \<Longrightarrow> (x_1 = ?H10 (\<lambda>y_1. ?H9 (x_2 y_1)) (?H5 ?H6 x_3)) = (x_3 = ?H6 \<and> x_2 ?H6 = x_4)
[ "Groups.minus_class.minus", "Num.num.One", "Groups.one_class.one", "Zeckendorf.inc_seq_on", "Groups.zero_class.zero", "Fib.fib", "Finite_Set.finite", "Groups_Big.comm_monoid_add_class.sum", "Num.num.Bit0", "Num.numeral_class.numeral", "Set_Interval.ord_class.atLeastAtMost" ]
[ "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "datatype num = One | Bit0 num | Bit1 num", "class one =\n fixes one :: 'a (\"1\")", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "class zero =\n fixes zero :: 'a (\"0\")", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin", "datatype num = One | Bit0 num | Bit1 num", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.inc_seq_on_aux
lemma inc_seq_on_aux: "inc_seq_on c {0..k - 1} \<Longrightarrow> n - fib i < fib (i-1) \<Longrightarrow> fib (c k) < fib i \<Longrightarrow> (n - fib i) = (\<Sum> i=0..k. fib (c i)) \<Longrightarrow> Suc (c k) < i"
inc_seq_on ?c {0..?k - 1} \<Longrightarrow> ?n - fib ?i < fib (?i - 1) \<Longrightarrow> fib (?c ?k) < fib ?i \<Longrightarrow> ?n - fib ?i = (\<Sum>i = 0..?k. fib (?c i)) \<Longrightarrow> Suc (?c ?k) < ?i
\<lbrakk>?H1 x_1 (?H2 ?H3 (?H4 x_2 ?H5)); ?H4 x_3 (?H6 x_4) < ?H6 (?H4 x_4 ?H5); ?H6 (x_1 x_2) < ?H6 x_4; ?H4 x_3 (?H6 x_4) = ?H7 (\<lambda>y_0. ?H6 (x_1 y_0)) (?H2 ?H3 x_2)\<rbrakk> \<Longrightarrow> ?H8 (x_1 x_2) < x_4
[ "Fib.fib", "Zeckendorf.inc_seq_on", "Nat.Suc", "Set_Interval.ord_class.atLeastAtMost", "Groups.minus_class.minus", "Groups.zero_class.zero", "Groups_Big.comm_monoid_add_class.sum", "Groups.one_class.one" ]
[ "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "class zero =\n fixes zero :: 'a (\"0\")", "class one =\n fixes one :: 'a (\"1\")" ]
Zeckendorf/Zeckendorf
Zeckendorf.one_unique_fib_sum
lemma one_unique_fib_sum: "inc_seq_on c {0..k-1} \<Longrightarrow> \<forall>i\<in>{0..k}. c i \<ge> 2 \<Longrightarrow> (\<Sum> i=0..k. fib (c i)) = 1 \<longleftrightarrow> k = 0 \<and> c 0 = 2"
inc_seq_on ?c {0..?k - 1} \<Longrightarrow> \<forall>i\<in>{0..?k}. 2 \<le> ?c i \<Longrightarrow> ((\<Sum>i = 0..?k. fib (?c i)) = 1) = (?k = 0 \<and> ?c 0 = 2)
\<lbrakk>?H1 x_1 (?H2 ?H3 (?H4 x_2 ?H5)); \<forall>y_0\<in>?H2 ?H3 x_2. ?H6 (?H7 ?H8) \<le> x_1 y_0\<rbrakk> \<Longrightarrow> (?H9 (\<lambda>y_1. ?H10 (x_1 y_1)) (?H2 ?H3 x_2) = ?H5) = (x_2 = ?H3 \<and> x_1 ?H3 = ?H6 (?H7 ?H8))
[ "Zeckendorf.inc_seq_on", "Num.num.One", "Num.numeral_class.numeral", "Groups.zero_class.zero", "Fib.fib", "Set_Interval.ord_class.atLeastAtMost", "Num.num.Bit0", "Set.Collect", "Groups.minus_class.minus", "Groups.one_class.one", "Groups_Big.comm_monoid_add_class.sum" ]
[ "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "datatype num = One | Bit0 num | Bit1 num", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "class zero =\n fixes zero :: 'a (\"0\")", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "class one =\n fixes one :: 'a (\"1\")" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_implies_zeckendorf
lemma fib_implies_zeckendorf: assumes "is_fib n" "n > 0" shows "\<exists> c k. n = (\<Sum> i=0..k. fib(c i)) \<and> inc_seq_on c {0..k-1} \<and> (\<forall> i\<in>{0..k}. c i \<ge> 2)"
is_fib ?n \<Longrightarrow> 0 < ?n \<Longrightarrow> \<exists>c k. ?n = (\<Sum>i = 0..k. fib (c i)) \<and> inc_seq_on c {0..k - 1} \<and> (\<forall>i\<in>{0..k}. 2 \<le> c i)
\<lbrakk>?H1 x_1; ?H2 < x_1\<rbrakk> \<Longrightarrow> \<exists>y_0 y_1. x_1 = ?H3 (\<lambda>y_2. ?H4 (y_0 y_2)) (?H5 ?H2 y_1) \<and> ?H6 y_0 (?H5 ?H2 (?H7 y_1 ?H8)) \<and> (\<forall>y_3\<in>?H5 ?H2 y_1. ?H9 (?H10 ?H11) \<le> y_0 y_3)
[ "Set.empty", "Set.Collect", "Set_Interval.ord_class.atLeastAtMost", "Groups_Big.comm_monoid_add_class.sum", "Num.num.Bit0", "Zeckendorf.inc_seq_on", "Num.numeral_class.numeral", "Zeckendorf.is_fib", "Fib.fib", "Num.num.One", "Groups.zero_class.zero", "Groups.one_class.one", "Groups.minus_class.minus" ]
[ "abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"", "datatype num = One | Bit0 num | Bit1 num", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num", "class zero =\n fixes zero :: 'a (\"0\")", "class one =\n fixes one :: 'a (\"1\")", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)" ]
Zeckendorf/Zeckendorf
Zeckendorf.zeckendorf_existence
theorem zeckendorf_existence: assumes "n > 0" shows "\<exists> c k. n = (\<Sum> i=0..k. fib (c i)) \<and> inc_seq_on c {0..k-1} \<and> (\<forall>i\<in>{0..k}. c i \<ge> 2)"
0 < ?n \<Longrightarrow> \<exists>c k. ?n = (\<Sum>i = 0..k. fib (c i)) \<and> inc_seq_on c {0..k - 1} \<and> (\<forall>i\<in>{0..k}. 2 \<le> c i)
?H1 < x_1 \<Longrightarrow> \<exists>y_0 y_1. x_1 = ?H2 (\<lambda>y_2. ?H3 (y_0 y_2)) (?H4 ?H1 y_1) \<and> ?H5 y_0 (?H4 ?H1 (?H6 y_1 ?H7)) \<and> (\<forall>y_3\<in>?H4 ?H1 y_1. ?H8 (?H9 ?H10) \<le> y_0 y_3)
[ "Num.numeral_class.numeral", "Num.num.One", "Groups_Big.comm_monoid_add_class.sum", "Groups.zero_class.zero", "Zeckendorf.is_fib", "Fib.fib", "Finite_Set.finite", "Groups.one_class.one", "Zeckendorf.inc_seq_on", "Set_Interval.ord_class.atLeastAtMost", "Num.num.Bit0", "Groups.minus_class.minus" ]
[ "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "datatype num = One | Bit0 num | Bit1 num", "class zero =\n fixes zero :: 'a (\"0\")", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin", "class one =\n fixes one :: 'a (\"1\")", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "datatype num = One | Bit0 num | Bit1 num", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_sum_upper_bound
lemma fib_sum_upper_bound: assumes "inc_seq_on c {0..k-1}" "\<forall>i\<in>{0..k}. c i \<ge> 2" shows "(\<Sum> i=0..k. fib (c i)) < fib (Suc (c k))"
inc_seq_on ?c {0..?k - 1} \<Longrightarrow> \<forall>i\<in>{0..?k}. 2 \<le> ?c i \<Longrightarrow> (\<Sum>i = 0..?k. fib (?c i)) < fib (Suc (?c ?k))
\<lbrakk>?H1 x_1 (?H2 ?H3 (?H4 x_2 ?H5)); \<forall>y_0\<in>?H2 ?H3 x_2. ?H6 (?H7 ?H8) \<le> x_1 y_0\<rbrakk> \<Longrightarrow> ?H9 (\<lambda>y_1. ?H10 (x_1 y_1)) (?H2 ?H3 x_2) < ?H10 (?H11 (x_1 x_2))
[ "Nat.Suc", "Set.empty", "Groups.minus_class.minus", "Num.num.Bit0", "Num.num.One", "Zeckendorf.is_fib", "Groups_Big.comm_monoid_add_class.sum", "Fib.fib", "Zeckendorf.inc_seq_on", "Groups.zero_class.zero", "Num.numeral_class.numeral", "Groups.one_class.one", "Set.Collect", "Set_Interval.ord_class.atLeastAtMost" ]
[ "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "datatype num = One | Bit0 num | Bit1 num", "datatype num = One | Bit0 num | Bit1 num", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "class zero =\n fixes zero :: 'a (\"0\")", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "class one =\n fixes one :: 'a (\"1\")" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_idx_ge_two_fib_sum_not_zero
lemma fib_idx_ge_two_fib_sum_not_zero: "n \<le> m \<Longrightarrow> \<forall>i\<in>{n..m::nat}. c i \<ge> 2 \<Longrightarrow> \<not> (\<Sum> i=n..m. fib (c i)) = 0"
?n \<le> ?m \<Longrightarrow> \<forall>i\<in>{?n..?m}. 2 \<le> ?c i \<Longrightarrow> (\<Sum>i = ?n..?m. fib (?c i)) \<noteq> 0
\<lbrakk>x_1 \<le> x_2; \<forall>y_0\<in>?H1 x_1 x_2. ?H2 (?H3 ?H4) \<le> x_3 y_0\<rbrakk> \<Longrightarrow> ?H5 (\<lambda>y_1. ?H6 (x_3 y_1)) (?H1 x_1 x_2) \<noteq> ?H7
[ "Num.numeral_class.numeral", "Groups.zero_class.zero", "Groups_Big.comm_monoid_add_class.sum", "Num.num.One", "Zeckendorf.is_fib", "Num.num.Bit0", "Set_Interval.ord_class.atLeastAtMost", "Fib.fib" ]
[ "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "class zero =\n fixes zero :: 'a (\"0\")", "datatype num = One | Bit0 num | Bit1 num", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "datatype num = One | Bit0 num | Bit1 num", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.nat_ge_2_fib_idx_bound
lemma nat_ge_2_fib_idx_bound: "2 \<le> n \<Longrightarrow> fib i \<le> n \<Longrightarrow> n < fib (Suc i) \<Longrightarrow> 2 \<le> i"
2 \<le> ?n \<Longrightarrow> fib ?i \<le> ?n \<Longrightarrow> ?n < fib (Suc ?i) \<Longrightarrow> 2 \<le> ?i
\<lbrakk>?H1 (?H2 ?H3) \<le> x_1; ?H4 x_2 \<le> x_1; x_1 < ?H4 (?H5 x_2)\<rbrakk> \<Longrightarrow> ?H1 (?H2 ?H3) \<le> x_2
[ "Groups.zero_class.zero", "Num.numeral_class.numeral", "Fib.fib", "Num.num.One", "Nat.Suc", "Groups.minus_class.minus", "Num.num.Bit0", "Finite_Set.finite" ]
[ "class zero =\n fixes zero :: 'a (\"0\")", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num", "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "datatype num = One | Bit0 num | Bit1 num", "class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin" ]
Zeckendorf/Zeckendorf
Zeckendorf.ge_two_eq_fib_implies_eq_idx
lemma ge_two_eq_fib_implies_eq_idx: "n \<ge> 2 \<Longrightarrow> n = fib i \<Longrightarrow> n = fib j \<Longrightarrow> i = j"
2 \<le> ?n \<Longrightarrow> ?n = fib ?i \<Longrightarrow> ?n = fib ?j \<Longrightarrow> ?i = ?j
\<lbrakk>?H1 (?H2 ?H3) \<le> x_1; x_1 = ?H4 x_2; x_1 = ?H4 x_3\<rbrakk> \<Longrightarrow> x_2 = x_3
[ "Num.numeral_class.numeral", "Zeckendorf.inc_seq_on", "Fib.fib", "Num.num.One", "Nat.Suc", "Zeckendorf.is_fib", "Num.num.Bit0", "Groups.zero_class.zero" ]
[ "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num", "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "datatype num = One | Bit0 num | Bit1 num", "class zero =\n fixes zero :: 'a (\"0\")" ]
Zeckendorf/Zeckendorf
Zeckendorf.pos_fib_has_idx_ge_two
lemma pos_fib_has_idx_ge_two: "n > 0 \<Longrightarrow> is_fib n \<Longrightarrow> (\<exists> i. i \<ge> 2 \<and> fib i = n)"
0 < ?n \<Longrightarrow> is_fib ?n \<Longrightarrow> \<exists>i\<ge>2. fib i = ?n
\<lbrakk>?H1 < x_1; ?H2 x_1\<rbrakk> \<Longrightarrow> \<exists>y_0\<ge>?H3 (?H4 ?H5). ?H6 y_0 = x_1
[ "Num.num.One", "Groups.minus_class.minus", "Groups.zero_class.zero", "Set.empty", "Num.numeral_class.numeral", "Zeckendorf.is_fib", "Num.num.Bit0", "Fib.fib", "Set.Collect" ]
[ "datatype num = One | Bit0 num | Bit1 num", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "class zero =\n fixes zero :: 'a (\"0\")", "abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "datatype num = One | Bit0 num | Bit1 num", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_sum_zero_equiv
lemma fib_sum_zero_equiv: "(\<Sum> i=n..m::nat . fib (c i)) = 0 \<longleftrightarrow> (\<forall> i\<in>{n..m}. c i = 0)"
((\<Sum>i = ?n..?m. fib (?c i)) = 0) = (\<forall>i\<in>{?n..?m}. ?c i = 0)
(?H1 (\<lambda>y_0. ?H2 (x_1 y_0)) (?H3 x_2 x_3) = ?H4) = (\<forall>y_1\<in>?H3 x_2 x_3. x_1 y_1 = ?H4)
[ "Zeckendorf.is_fib", "Groups.zero_class.zero", "Groups_Big.comm_monoid_add_class.sum", "Fib.fib", "Set_Interval.ord_class.atLeastAtMost", "Groups.one_class.one" ]
[ "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "class zero =\n fixes zero :: 'a (\"0\")", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "class one =\n fixes one :: 'a (\"1\")" ]
Zeckendorf/Zeckendorf
Zeckendorf.inc_seq_zero_at_start
lemma inc_seq_zero_at_start: "inc_seq_on c {0..k-1} \<Longrightarrow> c k = 0 \<Longrightarrow> k = 0"
inc_seq_on ?c {0..?k - 1} \<Longrightarrow> ?c ?k = 0 \<Longrightarrow> ?k = 0
\<lbrakk>?H1 x_1 (?H2 ?H3 (?H4 x_2 ?H5)); x_1 x_2 = ?H3\<rbrakk> \<Longrightarrow> x_2 = ?H3
[ "Fib.fib", "Set.empty", "Set_Interval.ord_class.atLeastAtMost", "Groups.one_class.one", "Zeckendorf.is_fib", "Zeckendorf.inc_seq_on", "Groups.zero_class.zero", "Groups.minus_class.minus" ]
[ "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"", "class one =\n fixes one :: 'a (\"1\")", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "class zero =\n fixes zero :: 'a (\"0\")", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)" ]
Zeckendorf/Zeckendorf
Zeckendorf.ge_two_fib_unique_idx
lemma ge_two_fib_unique_idx: "fib i \<ge> 2 \<Longrightarrow> fib i = fib j \<Longrightarrow> i = j"
2 \<le> fib ?i \<Longrightarrow> fib ?i = fib ?j \<Longrightarrow> ?i = ?j
\<lbrakk>?H1 (?H2 ?H3) \<le> ?H4 x_1; ?H4 x_1 = ?H4 x_2\<rbrakk> \<Longrightarrow> x_1 = x_2
[ "Zeckendorf.inc_seq_on", "Fib.fib", "Num.numeral_class.numeral", "Num.num.One", "Num.num.Bit0", "Nat.Suc" ]
[ "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "datatype num = One | Bit0 num | Bit1 num", "datatype num = One | Bit0 num | Bit1 num", "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_index_strict_mono
lemma fib_index_strict_mono : "i \<ge> 2 \<Longrightarrow> j > i \<Longrightarrow> fib j > fib i"
2 \<le> ?i \<Longrightarrow> ?i < ?j \<Longrightarrow> fib ?i < fib ?j
\<lbrakk>?H1 (?H2 ?H3) \<le> x_1; x_1 < x_2\<rbrakk> \<Longrightarrow> ?H4 x_1 < ?H4 x_2
[ "Groups_Big.comm_monoid_add_class.sum", "Zeckendorf.inc_seq_on", "Fib.fib", "Num.num.One", "Num.numeral_class.numeral", "Groups.one_class.one", "Num.num.Bit0" ]
[ "definition inc_seq_on :: \"(nat \\<Rightarrow> nat) \\<Rightarrow> nat set \\<Rightarrow> bool\" where\n \"inc_seq_on f I = (\\<forall> n \\<in> I. f(Suc n) > Suc(f n))\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "class one =\n fixes one :: 'a (\"1\")", "datatype num = One | Bit0 num | Bit1 num" ]
Zeckendorf/Zeckendorf
Zeckendorf.one_fib_idxs
lemma one_fib_idxs: "fib i = Suc 0 \<Longrightarrow> i = Suc 0 \<or> i = Suc(Suc 0)"
fib ?i = Suc 0 \<Longrightarrow> ?i = Suc 0 \<or> ?i = Suc (Suc 0)
?H1 x_1 = ?H2 ?H3 \<Longrightarrow> x_1 = ?H2 ?H3 \<or> x_1 = ?H2 (?H2 ?H3)
[ "Nat.Suc", "Groups.zero_class.zero", "Groups.minus_class.minus", "Fib.fib" ]
[ "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "class zero =\n fixes zero :: 'a (\"0\")", "class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.no_fib_betw_fibs
lemma no_fib_betw_fibs: assumes "\<not> is_fib n" shows "\<exists> i. fib i < n \<and> n < fib (Suc i)"
\<not> is_fib ?n \<Longrightarrow> \<exists>i. fib i < ?n \<and> ?n < fib (Suc i)
\<not> ?H1 x_1 \<Longrightarrow> \<exists>y_0. ?H2 y_0 < x_1 \<and> x_1 < ?H2 (?H3 y_0)
[ "Nat.Suc", "Fib.fib", "Zeckendorf.is_fib" ]
[ "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.zero_fib_unique_idx
lemma zero_fib_unique_idx: "n = fib i \<Longrightarrow> n = fib 0 \<Longrightarrow> i = 0"
?n = fib ?i \<Longrightarrow> ?n = fib 0 \<Longrightarrow> ?i = 0
\<lbrakk>x_1 = ?H1 x_2; x_1 = ?H1 ?H2\<rbrakk> \<Longrightarrow> x_2 = ?H2
[ "Fib.fib", "Zeckendorf.is_fib", "Groups.zero_class.zero", "Finite_Set.finite" ]
[ "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "class zero =\n fixes zero :: 'a (\"0\")", "class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin" ]
Zeckendorf/Zeckendorf
Zeckendorf.finite_fib_ge_two_idx
lemma finite_fib_ge_two_idx: "n \<ge> 2 \<Longrightarrow> finite({i. fib i = n})"
2 \<le> ?n \<Longrightarrow> finite {i. fib i = ?n}
?H1 (?H2 ?H3) \<le> x_1 \<Longrightarrow> ?H4 (?H5 (\<lambda>y_0. ?H6 y_0 = x_1))
[ "Set.Collect", "Num.num.One", "Num.num.Bit0", "Set_Interval.ord_class.atLeastAtMost", "Groups.one_class.one", "Finite_Set.finite", "Fib.fib", "Groups_Big.comm_monoid_add_class.sum", "Groups.zero_class.zero", "Num.numeral_class.numeral" ]
[ "datatype num = One | Bit0 num | Bit1 num", "datatype num = One | Bit0 num | Bit1 num", "class one =\n fixes one :: 'a (\"1\")", "class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "class zero =\n fixes zero :: 'a (\"0\")", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"" ]
Zeckendorf/Zeckendorf
Zeckendorf.no_fib_implies_le_fib_idx_set
lemma no_fib_implies_le_fib_idx_set: "\<not> is_fib n \<Longrightarrow> {i. fib i < n} \<noteq> {}"
\<not> is_fib ?n \<Longrightarrow> {i. fib i < ?n} \<noteq> {}
\<not> ?H1 x_1 \<Longrightarrow> ?H2 (\<lambda>y_0. ?H3 y_0 < x_1) \<noteq> ?H4
[ "Nat.Suc", "Finite_Set.finite", "Groups.zero_class.zero", "Set.empty", "Zeckendorf.is_fib", "Fib.fib", "Num.num.One", "Set.Collect" ]
[ "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin", "class zero =\n fixes zero :: 'a (\"0\")", "abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"", "definition is_fib :: \"nat \\<Rightarrow> bool\" where\n \"is_fib n = (\\<exists> i. n = fib i)\"", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num" ]
Zeckendorf/Zeckendorf
Zeckendorf.fib_strict_mono
lemma fib_strict_mono: "i \<ge> 2 \<Longrightarrow> fib i < fib (Suc i)"
2 \<le> ?i \<Longrightarrow> fib ?i < fib (Suc ?i)
?H1 (?H2 ?H3) \<le> x_1 \<Longrightarrow> ?H4 x_1 < ?H4 (?H5 x_1)
[ "Nat.Suc", "Groups.zero_class.zero", "Fib.fib", "Num.num.Bit0", "Num.numeral_class.numeral", "Num.num.One" ]
[ "definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\"", "class zero =\n fixes zero :: 'a (\"0\")", "fun fib :: \"nat \\<Rightarrow> nat\"\n where\n fib0: \"fib 0 = 0\"\n | fib1: \"fib (Suc 0) = 1\"\n | fib2: \"fib (Suc (Suc n)) = fib (Suc n) + fib n\"", "datatype num = One | Bit0 num | Bit1 num", "primrec numeral :: \"num \\<Rightarrow> 'a\"\n where\n numeral_One: \"numeral One = 1\"\n | numeral_Bit0: \"numeral (Bit0 n) = numeral n + numeral n\"\n | numeral_Bit1: \"numeral (Bit1 n) = numeral n + numeral n + 1\"", "datatype num = One | Bit0 num | Bit1 num" ]