theory_file
stringclasses 970
values | lemma_name
stringlengths 6
108
| lemma_command
stringlengths 15
14.6k
⌀ | lemma_object
stringlengths 6
17.2k
| template
stringlengths 7
16.1k
| symbols
listlengths 0
101
| types
listlengths 0
101
| defs
listlengths 0
83
| output_key
stringclasses 1
value | input
stringlengths 37
79.6k
| output
stringlengths 24
16.1k
|
|---|---|---|---|---|---|---|---|---|---|---|
Auth/Event
|
Event.knows_subset_knows_Says
|
lemma knows_subset_knows_Says: "knows A evs \<subseteq> knows A (Says A' B X # evs)"
|
knows ?A ?evs \<subseteq> knows ?A (Says ?A' ?B ?X # ?evs)
|
?H1 (?H2 x_1 x_2) (?H2 x_1 (?H3 (?H4 x_3 x_4 x_5) x_2))
|
[
"Event.event.Says",
"List.list.Cons",
"Event.knows",
"Set.subset_eq"
] |
[
"agent \\<Rightarrow> agent \\<Rightarrow> msg \\<Rightarrow> event",
"'a \\<Rightarrow> 'a list \\<Rightarrow> 'a list",
"agent \\<Rightarrow> event list \\<Rightarrow> msg set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool"
] |
[
"datatype\n event = Says agent agent msg\n | Gets agent msg\n | Notes agent msg",
"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 knows :: \"agent \\<Rightarrow> event list \\<Rightarrow> msg set\"\nwhere\n knows_Nil: \"knows A [] = initState A\"\n| knows_Cons:\n \"knows A (ev # evs) =\n (if A = Spy then \n (case ev of\n Says A' B X \\<Rightarrow> insert X (knows Spy evs)\n | Gets A' X \\<Rightarrow> knows Spy evs\n | Notes A' X \\<Rightarrow> \n if A' \\<in> bad then insert X (knows Spy evs) else knows Spy evs)\n else\n (case ev of\n Says A' B X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs\n | Gets A' X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs\n | Notes A' X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs))\"",
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\""
] |
template
|
###lemma
knows ?A ?evs \<subseteq> knows ?A (Says ?A' ?B ?X # ?evs)
###symbols
Event.event.Says :::: agent \<Rightarrow> agent \<Rightarrow> msg \<Rightarrow> event
List.list.Cons :::: 'a \<Rightarrow> 'a list \<Rightarrow> 'a list
Event.knows :::: agent \<Rightarrow> event list \<Rightarrow> msg set
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
###defs
datatype
event = Says agent agent msg
| Gets agent msg
| Notes agent msg
datatype (set: 'a) list =
Nil ("[]")
| Cons (hd: 'a) (tl: "'a list") (infixr "#" 65)
for
map: map
rel: list_all2
pred: list_all
where
"tl [] = []"
primrec knows :: "agent \<Rightarrow> event list \<Rightarrow> msg set"
where
knows_Nil: "knows A [] = initState A"
| knows_Cons:
"knows A (ev # evs) =
(if A = Spy then
(case ev of
Says A' B X \<Rightarrow> insert X (knows Spy evs)
| Gets A' X \<Rightarrow> knows Spy evs
| Notes A' X \<Rightarrow>
if A' \<in> bad then insert X (knows Spy evs) else knows Spy evs)
else
(case ev of
Says A' B X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Gets A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Notes A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs))"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
|
###output
?H1 (?H2 x_1 x_2) (?H2 x_1 (?H3 (?H4 x_3 x_4 x_5) x_2))###end
|
Library/Tree
|
Tree.preorder_map
|
lemma preorder_map: "preorder (map_tree f t) = map f (preorder t)"
|
preorder (map_tree ?f ?t) = map ?f (preorder ?t)
|
?H1 (?H2 x_1 x_2) = ?H3 x_1 (?H1 x_2)
|
[
"List.list.map",
"Tree.tree.map_tree",
"Tree.preorder"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a list \\<Rightarrow> 'b list",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a tree \\<Rightarrow> 'b tree",
"'a tree \\<Rightarrow> 'a 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 [] = []\"",
"datatype 'a tree =\n Leaf (\"\\<langle>\\<rangle>\") |\n Node \"'a tree\" (\"value\": 'a) \"'a tree\" (\"(1\\<langle>_,/ _,/ _\\<rangle>)\")",
"fun preorder :: \"'a tree \\<Rightarrow> 'a list\" where\n\"preorder \\<langle>\\<rangle> = []\" |\n\"preorder \\<langle>l, x, r\\<rangle> = x # preorder l @ preorder r\""
] |
template
|
###lemma
preorder (map_tree ?f ?t) = map ?f (preorder ?t)
###symbols
List.list.map :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a list \<Rightarrow> 'b list
Tree.tree.map_tree :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a tree \<Rightarrow> 'b tree
Tree.preorder :::: 'a tree \<Rightarrow> 'a list
###defs
datatype (set: 'a) list =
Nil ("[]")
| Cons (hd: 'a) (tl: "'a list") (infixr "#" 65)
for
map: map
rel: list_all2
pred: list_all
where
"tl [] = []"
datatype 'a tree =
Leaf ("\<langle>\<rangle>") |
Node "'a tree" ("value": 'a) "'a tree" ("(1\<langle>_,/ _,/ _\<rangle>)")
fun preorder :: "'a tree \<Rightarrow> 'a list" where
"preorder \<langle>\<rangle> = []" |
"preorder \<langle>l, x, r\<rangle> = x # preorder l @ preorder r"
|
###output
?H1 (?H2 x_1 x_2) = ?H3 x_1 (?H1 x_2)###end
|
Topological_Spaces
|
Topological_Spaces.continuous_on_min
|
lemma continuous_on_min [continuous_intros]:
fixes f g :: "'a::topological_space \<Rightarrow> 'b::linorder_topology"
shows "continuous_on A f \<Longrightarrow> continuous_on A g \<Longrightarrow> continuous_on A (\<lambda>x. min (f x) (g x))"
|
continuous_on ?A ?f \<Longrightarrow> continuous_on ?A ?g \<Longrightarrow> continuous_on ?A (\<lambda>x. min (?f x) (?g x))
|
\<lbrakk> ?H1 x_1 x_2; ?H1 x_1 x_3\<rbrakk> \<Longrightarrow> ?H1 x_1 (\<lambda>y_0. ?H2 (x_2 y_0) (x_3 y_0))
|
[
"Orderings.ord_class.min",
"Topological_Spaces.continuous_on"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"class ord =\n fixes less_eq :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\n and less :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin",
"definition continuous_on :: \"'a set \\<Rightarrow> ('a::topological_space \\<Rightarrow> 'b::topological_space) \\<Rightarrow> bool\"\n where \"continuous_on s f \\<longleftrightarrow> (\\<forall>x\\<in>s. (f \\<longlongrightarrow> f x) (at x within s))\""
] |
template
|
###lemma
continuous_on ?A ?f \<Longrightarrow> continuous_on ?A ?g \<Longrightarrow> continuous_on ?A (\<lambda>x. min (?f x) (?g x))
###symbols
Orderings.ord_class.min :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Topological_Spaces.continuous_on :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
class ord =
fixes less_eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
and less :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
begin
definition continuous_on :: "'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
where "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s))"
|
###output
\<lbrakk> ?H1 x_1 x_2; ?H1 x_1 x_3\<rbrakk> \<Longrightarrow> ?H1 x_1 (\<lambda>y_0. ?H2 (x_2 y_0) (x_3 y_0))###end
|
Analysis/Henstock_Kurzweil_Integration
|
Henstock_Kurzweil_Integration.fundamental_theorem_of_calculus_interior_strong
|
lemma fundamental_theorem_of_calculus_interior_strong:
fixes f :: "real \<Rightarrow> 'a::banach"
assumes "finite S"
and "a \<le> b" "\<And>x. x \<in> {a <..< b} - S \<Longrightarrow> (f has_vector_derivative f'(x)) (at x)"
and "continuous_on {a .. b} f"
shows "(f' has_integral (f b - f a)) {a .. b}"
|
finite ?S \<Longrightarrow> ?a \<le> ?b \<Longrightarrow> (\<And>x. x \<in> { ?a<..< ?b} - ?S \<Longrightarrow> (?f has_vector_derivative ?f' x) (at x)) \<Longrightarrow> continuous_on { ?a.. ?b} ?f \<Longrightarrow> (?f' has_integral ?f ?b - ?f ?a) { ?a.. ?b}
|
\<lbrakk> ?H1 x_1; x_2 \<le> x_3; \<And>y_0. y_0 \<in> ?H2 (?H3 x_2 x_3) x_1 \<Longrightarrow> ?H4 x_4 (x_5 y_0) (?H5 y_0); ?H6 (?H7 x_2 x_3) x_4\<rbrakk> \<Longrightarrow> ?H8 x_5 (?H2 (x_4 x_3) (x_4 x_2)) (?H7 x_2 x_3)
|
[
"Henstock_Kurzweil_Integration.has_integral",
"Set_Interval.ord_class.atLeastAtMost",
"Topological_Spaces.continuous_on",
"Topological_Spaces.topological_space_class.at",
"Deriv.has_vector_derivative",
"Set_Interval.ord_class.greaterThanLessThan",
"Groups.minus_class.minus",
"Finite_Set.finite"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool",
"'a \\<Rightarrow> 'a filter",
"(real \\<Rightarrow> 'a) \\<Rightarrow> 'a \\<Rightarrow> real filter \\<Rightarrow> bool",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a set",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a set \\<Rightarrow> bool"
] |
[
"definition has_integral :: \"('n::euclidean_space \\<Rightarrow> 'b::real_normed_vector) \\<Rightarrow> 'b \\<Rightarrow> 'n set \\<Rightarrow> bool\"\n (infixr \"has'_integral\" 46)\n where \"(f has_integral I) s \\<longleftrightarrow>\n (if \\<exists>a b. s = cbox a b\n then ((\\<lambda>p. \\<Sum>(x,k)\\<in>p. content k *\\<^sub>R f x) \\<longlongrightarrow> I) (division_filter s)\n else (\\<forall>e>0. \\<exists>B>0. \\<forall>a b. ball 0 B \\<subseteq> cbox a b \\<longrightarrow>\n (\\<exists>z. ((\\<lambda>p. \\<Sum>(x,k)\\<in>p. content k *\\<^sub>R (if x \\<in> s then f x else 0)) \\<longlongrightarrow> z) (division_filter (cbox a b)) \\<and>\n norm (z - I) < e)))\"",
"definition continuous_on :: \"'a set \\<Rightarrow> ('a::topological_space \\<Rightarrow> 'b::topological_space) \\<Rightarrow> bool\"\n where \"continuous_on s f \\<longleftrightarrow> (\\<forall>x\\<in>s. (f \\<longlongrightarrow> f x) (at x within s))\"",
"class topological_space = \"open\" +\n assumes open_UNIV [simp, intro]: \"open UNIV\"\n assumes open_Int [intro]: \"open S \\<Longrightarrow> open T \\<Longrightarrow> open (S \\<inter> T)\"\n assumes open_Union [intro]: \"\\<forall>S\\<in>K. open S \\<Longrightarrow> open (\\<Union>K)\"\nbegin",
"definition has_vector_derivative :: \"(real \\<Rightarrow> 'b::real_normed_vector) \\<Rightarrow> 'b \\<Rightarrow> real filter \\<Rightarrow> bool\"\n (infix \"has'_vector'_derivative\" 50)\n where \"(f has_vector_derivative f') net \\<longleftrightarrow> (f has_derivative (\\<lambda>x. x *\\<^sub>R f')) net\"",
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin"
] |
template
|
###lemma
finite ?S \<Longrightarrow> ?a \<le> ?b \<Longrightarrow> (\<And>x. x \<in> { ?a<..< ?b} - ?S \<Longrightarrow> (?f has_vector_derivative ?f' x) (at x)) \<Longrightarrow> continuous_on { ?a.. ?b} ?f \<Longrightarrow> (?f' has_integral ?f ?b - ?f ?a) { ?a.. ?b}
###symbols
Henstock_Kurzweil_Integration.has_integral :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a set \<Rightarrow> bool
Set_Interval.ord_class.atLeastAtMost :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a set
Topological_Spaces.continuous_on :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
Topological_Spaces.topological_space_class.at :::: 'a \<Rightarrow> 'a filter
Deriv.has_vector_derivative :::: (real \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> real filter \<Rightarrow> bool
Set_Interval.ord_class.greaterThanLessThan :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a set
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Finite_Set.finite :::: 'a set \<Rightarrow> bool
###defs
definition has_integral :: "('n::euclidean_space \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'b \<Rightarrow> 'n set \<Rightarrow> bool"
(infixr "has'_integral" 46)
where "(f has_integral I) s \<longleftrightarrow>
(if \<exists>a b. s = cbox a b
then ((\<lambda>p. \<Sum>(x,k)\<in>p. content k *\<^sub>R f x) \<longlongrightarrow> I) (division_filter s)
else (\<forall>e>0. \<exists>B>0. \<forall>a b. ball 0 B \<subseteq> cbox a b \<longrightarrow>
(\<exists>z. ((\<lambda>p. \<Sum>(x,k)\<in>p. content k *\<^sub>R (if x \<in> s then f x else 0)) \<longlongrightarrow> z) (division_filter (cbox a b)) \<and>
norm (z - I) < e)))"
definition continuous_on :: "'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
where "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s))"
class topological_space = "open" +
assumes open_UNIV [simp, intro]: "open UNIV"
assumes open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)"
assumes open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union>K)"
begin
definition has_vector_derivative :: "(real \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'b \<Rightarrow> real filter \<Rightarrow> bool"
(infix "has'_vector'_derivative" 50)
where "(f has_vector_derivative f') net \<longleftrightarrow> (f has_derivative (\<lambda>x. x *\<^sub>R f')) net"
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
class finite =
assumes finite_UNIV: "finite (UNIV :: 'a set)"
begin
|
###output
\<lbrakk> ?H1 x_1; x_2 \<le> x_3; \<And>y_0. y_0 \<in> ?H2 (?H3 x_2 x_3) x_1 \<Longrightarrow> ?H4 x_4 (x_5 y_0) (?H5 y_0); ?H6 (?H7 x_2 x_3) x_4\<rbrakk> \<Longrightarrow> ?H8 x_5 (?H2 (x_4 x_3) (x_4 x_2)) (?H7 x_2 x_3)###end
|
Auth/CertifiedEmail
|
CertifiedEmail.Spy_know_RPwd_iff
|
lemma Spy_know_RPwd_iff [simp]:
"evs \<in> certified_mail \<Longrightarrow> (Key (RPwd A) \<in> parts(spies evs)) = (A\<in>bad)"
|
?evs \<in> certified_mail \<Longrightarrow> (Key (RPwd ?A) \<in> parts (knows Spy ?evs)) = (?A \<in> bad)
|
x_1 \<in> ?H1 \<Longrightarrow> (?H2 (?H3 x_2) \<in> ?H4 (?H5 ?H6 x_1)) = (x_2 \<in> ?H7)
|
[
"Event.bad",
"Message.agent.Spy",
"Event.knows",
"Message.parts",
"CertifiedEmail.RPwd",
"Message.msg.Key",
"CertifiedEmail.certified_mail"
] |
[
"agent set",
"agent",
"agent \\<Rightarrow> event list \\<Rightarrow> msg set",
"msg set \\<Rightarrow> msg set",
"agent \\<Rightarrow> nat",
"nat \\<Rightarrow> msg",
"event list set"
] |
[
"consts \n bad :: \"agent set\" \\<comment> \\<open>compromised agents\\<close>",
"primrec knows :: \"agent \\<Rightarrow> event list \\<Rightarrow> msg set\"\nwhere\n knows_Nil: \"knows A [] = initState A\"\n| knows_Cons:\n \"knows A (ev # evs) =\n (if A = Spy then \n (case ev of\n Says A' B X \\<Rightarrow> insert X (knows Spy evs)\n | Gets A' X \\<Rightarrow> knows Spy evs\n | Notes A' X \\<Rightarrow> \n if A' \\<in> bad then insert X (knows Spy evs) else knows Spy evs)\n else\n (case ev of\n Says A' B X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs\n | Gets A' X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs\n | Notes A' X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs))\"",
"inductive_set\n parts :: \"msg set \\<Rightarrow> msg set\"\n for H :: \"msg set\"\n where\n Inj [intro]: \"X \\<in> H \\<Longrightarrow> X \\<in> parts H\"\n | Fst: \"\\<lbrace>X,Y\\<rbrace> \\<in> parts H \\<Longrightarrow> X \\<in> parts H\"\n | Snd: \"\\<lbrace>X,Y\\<rbrace> \\<in> parts H \\<Longrightarrow> Y \\<in> parts H\"\n | Body: \"Crypt K X \\<in> parts H \\<Longrightarrow> X \\<in> parts H\"",
"abbreviation\n RPwd :: \"agent \\<Rightarrow> key\" where\n \"RPwd == shrK\"",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"inductive_set certified_mail :: \"event list set\"\n where\n\n Nil: \\<comment> \\<open>The empty trace\\<close>\n \"[] \\<in> certified_mail\"\n\n| Fake: \\<comment> \\<open>The Spy may say anything he can say. The sender field is correct,\n but agents don't use that information.\\<close>\n \"\\<lbrakk>evsf \\<in> certified_mail; X \\<in> synth(analz(spies evsf))\\<rbrakk> \n \\<Longrightarrow> Says Spy B X # evsf \\<in> certified_mail\"\n\n| FakeSSL: \\<comment> \\<open>The Spy may open SSL sessions with TTP, who is the only agent\n equipped with the necessary credentials to serve as an SSL server.\\<close>\n \"\\<lbrakk>evsfssl \\<in> certified_mail; X \\<in> synth(analz(spies evsfssl))\\<rbrakk>\n \\<Longrightarrow> Notes TTP \\<lbrace>Agent Spy, Agent TTP, X\\<rbrace> # evsfssl \\<in> certified_mail\"\n\n| CM1: \\<comment> \\<open>The sender approaches the recipient. The message is a number.\\<close>\n \"\\<lbrakk>evs1 \\<in> certified_mail;\n Key K \\<notin> used evs1;\n K \\<in> symKeys;\n Nonce q \\<notin> used evs1;\n hs = Hash\\<lbrace>Number cleartext, Nonce q, response S R q, Crypt K (Number m)\\<rbrace>;\n S2TTP = Crypt(pubEK TTP) \\<lbrace>Agent S, Number BothAuth, Key K, Agent R, hs\\<rbrace>\\<rbrakk>\n \\<Longrightarrow> Says S R \\<lbrace>Agent S, Agent TTP, Crypt K (Number m), Number BothAuth, \n Number cleartext, Nonce q, S2TTP\\<rbrace> # evs1 \n \\<in> certified_mail\"\n\n| CM2: \\<comment> \\<open>The recipient records \\<^term>\\<open>S2TTP\\<close> while transmitting it and her\n password to \\<^term>\\<open>TTP\\<close> over an SSL channel.\\<close>\n \"\\<lbrakk>evs2 \\<in> certified_mail;\n Gets R \\<lbrace>Agent S, Agent TTP, em, Number BothAuth, Number cleartext, \n Nonce q, S2TTP\\<rbrace> \\<in> set evs2;\n TTP \\<noteq> R; \n hr = Hash \\<lbrace>Number cleartext, Nonce q, response S R q, em\\<rbrace>\\<rbrakk>\n \\<Longrightarrow> \n Notes TTP \\<lbrace>Agent R, Agent TTP, S2TTP, Key(RPwd R), hr\\<rbrace> # evs2\n \\<in> certified_mail\"\n\n| CM3: \\<comment> \\<open>\\<^term>\\<open>TTP\\<close> simultaneously reveals the key to the recipient and gives\n a receipt to the sender. The SSL channel does not authenticate \n the client (\\<^term>\\<open>R\\<close>), but \\<^term>\\<open>TTP\\<close> accepts the message only \n if the given password is that of the claimed sender, \\<^term>\\<open>R\\<close>.\n He replies over the established SSL channel.\\<close>\n \"\\<lbrakk>evs3 \\<in> certified_mail;\n Notes TTP \\<lbrace>Agent R, Agent TTP, S2TTP, Key(RPwd R), hr\\<rbrace> \\<in> set evs3;\n S2TTP = Crypt (pubEK TTP) \n \\<lbrace>Agent S, Number BothAuth, Key k, Agent R, hs\\<rbrace>;\n TTP \\<noteq> R; hs = hr; k \\<in> symKeys\\<rbrakk>\n \\<Longrightarrow> \n Notes R \\<lbrace>Agent TTP, Agent R, Key k, hr\\<rbrace> # \n Gets S (Crypt (priSK TTP) S2TTP) # \n Says TTP S (Crypt (priSK TTP) S2TTP) # evs3 \\<in> certified_mail\"\n\n| Reception:\n \"\\<lbrakk>evsr \\<in> certified_mail; Says A B X \\<in> set evsr\\<rbrakk>\n \\<Longrightarrow> Gets B X#evsr \\<in> certified_mail\""
] |
template
|
###lemma
?evs \<in> certified_mail \<Longrightarrow> (Key (RPwd ?A) \<in> parts (knows Spy ?evs)) = (?A \<in> bad)
###symbols
Event.bad :::: agent set
Message.agent.Spy :::: agent
Event.knows :::: agent \<Rightarrow> event list \<Rightarrow> msg set
Message.parts :::: msg set \<Rightarrow> msg set
CertifiedEmail.RPwd :::: agent \<Rightarrow> nat
Message.msg.Key :::: nat \<Rightarrow> msg
CertifiedEmail.certified_mail :::: event list set
###defs
consts
bad :: "agent set" \<comment> \<open>compromised agents\<close>
primrec knows :: "agent \<Rightarrow> event list \<Rightarrow> msg set"
where
knows_Nil: "knows A [] = initState A"
| knows_Cons:
"knows A (ev # evs) =
(if A = Spy then
(case ev of
Says A' B X \<Rightarrow> insert X (knows Spy evs)
| Gets A' X \<Rightarrow> knows Spy evs
| Notes A' X \<Rightarrow>
if A' \<in> bad then insert X (knows Spy evs) else knows Spy evs)
else
(case ev of
Says A' B X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Gets A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Notes A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs))"
inductive_set
parts :: "msg set \<Rightarrow> msg set"
for H :: "msg set"
where
Inj [intro]: "X \<in> H \<Longrightarrow> X \<in> parts H"
| Fst: "\<lbrace>X,Y\<rbrace> \<in> parts H \<Longrightarrow> X \<in> parts H"
| Snd: "\<lbrace>X,Y\<rbrace> \<in> parts H \<Longrightarrow> Y \<in> parts H"
| Body: "Crypt K X \<in> parts H \<Longrightarrow> X \<in> parts H"
abbreviation
RPwd :: "agent \<Rightarrow> key" where
"RPwd == shrK"
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
inductive_set certified_mail :: "event list set"
where
Nil: \<comment> \<open>The empty trace\<close>
"[] \<in> certified_mail"
| Fake: \<comment> \<open>The Spy may say anything he can say. The sender field is correct,
but agents don't use that information.\<close>
"\<lbrakk>evsf \<in> certified_mail; X \<in> synth(analz(spies evsf))\<rbrakk>
\<Longrightarrow> Says Spy B X # evsf \<in> certified_mail"
| FakeSSL: \<comment> \<open>The Spy may open SSL sessions with TTP, who is the only agent
equipped with the necessary credentials to serve as an SSL server.\<close>
"\<lbrakk>evsfssl \<in> certified_mail; X \<in> synth(analz(spies evsfssl))\<rbrakk>
\<Longrightarrow> Notes TTP \<lbrace>Agent Spy, Agent TTP, X\<rbrace> # evsfssl \<in> certified_mail"
| CM1: \<comment> \<open>The sender approaches the recipient. The message is a number.\<close>
"\<lbrakk>evs1 \<in> certified_mail;
Key K \<notin> used evs1;
K \<in> symKeys;
Nonce q \<notin> used evs1;
hs = Hash\<lbrace>Number cleartext, Nonce q, response S R q, Crypt K (Number m)\<rbrace>;
S2TTP = Crypt(pubEK TTP) \<lbrace>Agent S, Number BothAuth, Key K, Agent R, hs\<rbrace>\<rbrakk>
\<Longrightarrow> Says S R \<lbrace>Agent S, Agent TTP, Crypt K (Number m), Number BothAuth,
Number cleartext, Nonce q, S2TTP\<rbrace> # evs1
\<in> certified_mail"
| CM2: \<comment> \<open>The recipient records \<^term>\<open>S2TTP\<close> while transmitting it and her
password to \<^term>\<open>TTP\<close> over an SSL channel.\<close>
"\<lbrakk>evs2 \<in> certified_mail;
Gets R \<lbrace>Agent S, Agent TTP, em, Number BothAuth, Number cleartext,
Nonce q, S2TTP\<rbrace> \<in> set evs2;
TTP \<noteq> R;
hr = Hash \<lbrace>Number cleartext, Nonce q, response S R q, em\<rbrace>\<rbrakk>
\<Longrightarrow>
Notes TTP \<lbrace>Agent R, Agent TTP, S2TTP, Key(RPwd R), hr\<rbrace> # evs2
\<in> certified_mail"
| CM3: \<comment> \<open>\<^term>\<open>TTP\<close> simultaneously reveals the key to the recipient and gives
a receipt to the sender. The SSL channel does not authenticate
the client (\<^term>\<open>R\<close>), but \<^term>\<open>TTP\<close> accepts the message only
if the given password is that of the claimed sender, \<^term>\<open>R\<close>.
He replies over the established SSL channel.\<close>
"\<lbrakk>evs3 \<in> certified_mail;
Notes TTP \<lbrace>Agent R, Agent TTP, S2TTP, Key(RPwd R), hr\<rbrace> \<in> set evs3;
S2TTP = Crypt (pubEK TTP)
\<lbrace>Agent S, Number BothAuth, Key k, Agent R, hs\<rbrace>;
TTP \<noteq> R; hs = hr; k \<in> symKeys\<rbrakk>
\<Longrightarrow>
Notes R \<lbrace>Agent TTP, Agent R, Key k, hr\<rbrace> #
Gets S (Crypt (priSK TTP) S2TTP) #
Says TTP S (Crypt (priSK TTP) S2TTP) # evs3 \<in> certified_mail"
| Reception:
"\<lbrakk>evsr \<in> certified_mail; Says A B X \<in> set evsr\<rbrakk>
\<Longrightarrow> Gets B X#evsr \<in> certified_mail"
|
###output
x_1 \<in> ?H1 \<Longrightarrow> (?H2 (?H3 x_2) \<in> ?H4 (?H5 ?H6 x_1)) = (x_2 \<in> ?H7)###end
|
Set
|
Set.conj_mono
|
lemma conj_mono: "P1 \<longrightarrow> Q1 \<Longrightarrow> P2 \<longrightarrow> Q2 \<Longrightarrow> (P1 \<and> P2) \<longrightarrow> (Q1 \<and> Q2)"
|
?P1.0 \<longrightarrow> ?Q1.0 \<Longrightarrow> ?P2.0 \<longrightarrow> ?Q2.0 \<Longrightarrow> ?P1.0 \<and> ?P2.0 \<longrightarrow> ?Q1.0 \<and> ?Q2.0
|
\<lbrakk>x_1 \<longrightarrow> x_2; x_3 \<longrightarrow> x_4\<rbrakk> \<Longrightarrow> x_1 \<and> x_3 \<longrightarrow> x_2 \<and> x_4
|
[] |
[] |
[] |
template
|
###lemma
?P1.0 \<longrightarrow> ?Q1.0 \<Longrightarrow> ?P2.0 \<longrightarrow> ?Q2.0 \<Longrightarrow> ?P1.0 \<and> ?P2.0 \<longrightarrow> ?Q1.0 \<and> ?Q2.0
###symbols
###defs
|
###output
\<lbrakk>x_1 \<longrightarrow> x_2; x_3 \<longrightarrow> x_4\<rbrakk> \<Longrightarrow> x_1 \<and> x_3 \<longrightarrow> x_2 \<and> x_4###end
|
Analysis/Path_Connected
|
Path_Connected.path_component_of
|
lemma path_component_of:
"path_component_of X x y \<longleftrightarrow> (\<exists>T. path_connectedin X T \<and> x \<in> T \<and> y \<in> T)"
(is "?lhs = ?rhs")
|
path_component_of ?X ?x ?y = (\<exists>T. path_connectedin ?X T \<and> ?x \<in> T \<and> ?y \<in> T)
|
?H1 x_1 x_2 x_3 = (\<exists>y_0. ?H2 x_1 y_0 \<and> x_2 \<in> y_0 \<and> x_3 \<in> y_0)
|
[
"Abstract_Topology_2.path_connectedin",
"Path_Connected.path_component_of"
] |
[
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a topology \\<Rightarrow> 'a \\<Rightarrow> 'a \\<Rightarrow> bool"
] |
[
"definition path_connectedin :: \"'a topology \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"path_connectedin X S \\<equiv> S \\<subseteq> topspace X \\<and> path_connected_space(subtopology X S)\"",
"definition path_component_of\n where \"path_component_of X x y \\<equiv> \\<exists>g. pathin X g \\<and> g 0 = x \\<and> g 1 = y\""
] |
template
|
###lemma
path_component_of ?X ?x ?y = (\<exists>T. path_connectedin ?X T \<and> ?x \<in> T \<and> ?y \<in> T)
###symbols
Abstract_Topology_2.path_connectedin :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> bool
Path_Connected.path_component_of :::: 'a topology \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool
###defs
definition path_connectedin :: "'a topology \<Rightarrow> 'a set \<Rightarrow> bool"
where "path_connectedin X S \<equiv> S \<subseteq> topspace X \<and> path_connected_space(subtopology X S)"
definition path_component_of
where "path_component_of X x y \<equiv> \<exists>g. pathin X g \<and> g 0 = x \<and> g 1 = y"
|
###output
?H1 x_1 x_2 x_3 = (\<exists>y_0. ?H2 x_1 y_0 \<and> x_2 \<in> y_0 \<and> x_3 \<in> y_0)###end
|
Analysis/Infinite_Set_Sum
|
Infinite_Set_Sum.abs_summable_on_reindex_iff
|
lemma abs_summable_on_reindex_iff:
"inj_on g A \<Longrightarrow> (\<lambda>x. f (g x)) abs_summable_on A \<longleftrightarrow> f abs_summable_on (g ` A)"
|
inj_on ?g ?A \<Longrightarrow> ((\<lambda>x. ?f (?g x)) abs_summable_on ?A) = (?f abs_summable_on ?g ` ?A)
|
?H1 x_1 x_2 \<Longrightarrow> ?H2 (\<lambda>y_0. x_3 (x_1 y_0)) x_2 = ?H2 x_3 (?H3 x_1 x_2)
|
[
"Set.image",
"Infinite_Set_Sum.abs_summable_on",
"Fun.inj_on"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool"
] |
[
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"definition inj_on :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool\" \\<comment> \\<open>injective\\<close>\n where \"inj_on f A \\<longleftrightarrow> (\\<forall>x\\<in>A. \\<forall>y\\<in>A. f x = f y \\<longrightarrow> x = y)\""
] |
template
|
###lemma
inj_on ?g ?A \<Longrightarrow> ((\<lambda>x. ?f (?g x)) abs_summable_on ?A) = (?f abs_summable_on ?g ` ?A)
###symbols
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Infinite_Set_Sum.abs_summable_on :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool
Fun.inj_on :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool
###defs
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
definition inj_on :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool" \<comment> \<open>injective\<close>
where "inj_on f A \<longleftrightarrow> (\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y)"
|
###output
?H1 x_1 x_2 \<Longrightarrow> ?H2 (\<lambda>y_0. x_3 (x_1 y_0)) x_2 = ?H2 x_3 (?H3 x_1 x_2)###end
|
Analysis/Infinite_Set_Sum
|
Infinite_Set_Sum.abs_summable_on_Sigma_project1
|
lemma abs_summable_on_Sigma_project1:
assumes "(\<lambda>(x,y). f x y) abs_summable_on Sigma A B"
assumes [simp]: "countable A" and "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
shows "(\<lambda>x. infsetsum (\<lambda>y. norm (f x y)) (B x)) abs_summable_on A"
|
(\<lambda>(x, y). ?f x y) abs_summable_on Sigma ?A ?B \<Longrightarrow> countable ?A \<Longrightarrow> (\<And>x. x \<in> ?A \<Longrightarrow> countable (?B x)) \<Longrightarrow> (\<lambda>x. \<Sum>\<^sub>ay\<in> ?B x. norm (?f x y)) abs_summable_on ?A
|
\<lbrakk> ?H1 (?H2 x_1) (?H3 x_2 x_3); ?H4 x_2; \<And>y_2. y_2 \<in> x_2 \<Longrightarrow> ?H4 (x_3 y_2)\<rbrakk> \<Longrightarrow> ?H1 (\<lambda>y_3. ?H5 (\<lambda>y_4. ?H6 (x_1 y_3 y_4)) (x_3 y_3)) x_2
|
[
"Real_Vector_Spaces.norm_class.norm",
"Infinite_Set_Sum.infsetsum",
"Countable_Set.countable",
"Product_Type.Sigma",
"Product_Type.prod.case_prod",
"Infinite_Set_Sum.abs_summable_on"
] |
[
"'a \\<Rightarrow> real",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b",
"'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b set) \\<Rightarrow> ('a \\<times> 'b) set",
"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> 'a \\<times> 'b \\<Rightarrow> 'c",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool"
] |
[
"class norm =\n fixes norm :: \"'a \\<Rightarrow> real\"",
"definition countable :: \"'a set \\<Rightarrow> bool\" where\n \"countable S \\<longleftrightarrow> (\\<exists>f::'a \\<Rightarrow> nat. inj_on f S)\"",
"definition Sigma :: \"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b set) \\<Rightarrow> ('a \\<times> 'b) set\"\n where \"Sigma A B \\<equiv> \\<Union>x\\<in>A. \\<Union>y\\<in>B x. {Pair x y}\"",
"definition \"prod = {f. \\<exists>a b. f = Pair_Rep (a::'a) (b::'b)}\""
] |
template
|
###lemma
(\<lambda>(x, y). ?f x y) abs_summable_on Sigma ?A ?B \<Longrightarrow> countable ?A \<Longrightarrow> (\<And>x. x \<in> ?A \<Longrightarrow> countable (?B x)) \<Longrightarrow> (\<lambda>x. \<Sum>\<^sub>ay\<in> ?B x. norm (?f x y)) abs_summable_on ?A
###symbols
Real_Vector_Spaces.norm_class.norm :::: 'a \<Rightarrow> real
Infinite_Set_Sum.infsetsum :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b
Countable_Set.countable :::: 'a set \<Rightarrow> bool
Product_Type.Sigma :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> ('a \<times> 'b) set
Product_Type.prod.case_prod :::: ('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'a \<times> 'b \<Rightarrow> 'c
Infinite_Set_Sum.abs_summable_on :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool
###defs
class norm =
fixes norm :: "'a \<Rightarrow> real"
definition countable :: "'a set \<Rightarrow> bool" where
"countable S \<longleftrightarrow> (\<exists>f::'a \<Rightarrow> nat. inj_on f S)"
definition Sigma :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> ('a \<times> 'b) set"
where "Sigma A B \<equiv> \<Union>x\<in>A. \<Union>y\<in>B x. {Pair x y}"
definition "prod = {f. \<exists>a b. f = Pair_Rep (a::'a) (b::'b)}"
|
###output
\<lbrakk> ?H1 (?H2 x_1) (?H3 x_2 x_3); ?H4 x_2; \<And>y_2. y_2 \<in> x_2 \<Longrightarrow> ?H4 (x_3 y_2)\<rbrakk> \<Longrightarrow> ?H1 (\<lambda>y_3. ?H5 (\<lambda>y_4. ?H6 (x_1 y_3 y_4)) (x_3 y_3)) x_2###end
|
Decision_Procs/Parametric_Ferrante_Rackoff
|
Parametric_Ferrante_Rackoff.tmneg_nb
|
lemma tmneg_nb[simp]: "tmbound n t \<Longrightarrow> tmbound n (tmneg t)"
|
tmbound ?n ?t \<Longrightarrow> tmbound ?n (tmneg ?t)
|
?H1 x_1 x_2 \<Longrightarrow> ?H1 x_1 (?H2 x_2)
|
[
"Parametric_Ferrante_Rackoff.tmneg",
"Parametric_Ferrante_Rackoff.tmbound"
] |
[
"tm \\<Rightarrow> tm",
"nat \\<Rightarrow> tm \\<Rightarrow> bool"
] |
[
"definition tmneg :: \"tm \\<Rightarrow> tm\"\n where \"tmneg t \\<equiv> tmmul t (C (- 1,1))\"",
"primrec tmbound :: \"nat \\<Rightarrow> tm \\<Rightarrow> bool\" \\<comment> \\<open>a \\<open>tm\\<close> is \\<^emph>\\<open>independent\\<close> of Bound n\\<close>\n where\n \"tmbound n (CP c) = True\"\n | \"tmbound n (Bound m) = (n \\<noteq> m)\"\n | \"tmbound n (CNP m c a) = (n\\<noteq>m \\<and> tmbound n a)\"\n | \"tmbound n (Neg a) = tmbound n a\"\n | \"tmbound n (Add a b) = (tmbound n a \\<and> tmbound n b)\"\n | \"tmbound n (Sub a b) = (tmbound n a \\<and> tmbound n b)\"\n | \"tmbound n (Mul i a) = tmbound n a\""
] |
template
|
###lemma
tmbound ?n ?t \<Longrightarrow> tmbound ?n (tmneg ?t)
###symbols
Parametric_Ferrante_Rackoff.tmneg :::: tm \<Rightarrow> tm
Parametric_Ferrante_Rackoff.tmbound :::: nat \<Rightarrow> tm \<Rightarrow> bool
###defs
definition tmneg :: "tm \<Rightarrow> tm"
where "tmneg t \<equiv> tmmul t (C (- 1,1))"
primrec tmbound :: "nat \<Rightarrow> tm \<Rightarrow> bool" \<comment> \<open>a \<open>tm\<close> is \<^emph>\<open>independent\<close> of Bound n\<close>
where
"tmbound n (CP c) = True"
| "tmbound n (Bound m) = (n \<noteq> m)"
| "tmbound n (CNP m c a) = (n\<noteq>m \<and> tmbound n a)"
| "tmbound n (Neg a) = tmbound n a"
| "tmbound n (Add a b) = (tmbound n a \<and> tmbound n b)"
| "tmbound n (Sub a b) = (tmbound n a \<and> tmbound n b)"
| "tmbound n (Mul i a) = tmbound n a"
|
###output
?H1 x_1 x_2 \<Longrightarrow> ?H1 x_1 (?H2 x_2)###end
|
HOLCF/Tr
|
Transitive_Closure.converse_tranclE
| null |
(?x, ?z) \<in> ?r\<^sup>+ \<Longrightarrow> ((?x, ?z) \<in> ?r \<Longrightarrow> ?P) \<Longrightarrow> (\<And>y. (?x, y) \<in> ?r \<Longrightarrow> (y, ?z) \<in> ?r\<^sup>+ \<Longrightarrow> ?P) \<Longrightarrow> ?P
|
\<lbrakk>(x_1, x_2) \<in> ?H1 x_3; (x_1, x_2) \<in> x_3 \<Longrightarrow> x_4; \<And>y_0. \<lbrakk>(x_1, y_0) \<in> x_3; (y_0, x_2) \<in> ?H1 x_3\<rbrakk> \<Longrightarrow> x_4\<rbrakk> \<Longrightarrow> x_4
|
[
"Transitive_Closure.trancl"
] |
[
"('a \\<times> 'a) set \\<Rightarrow> ('a \\<times> 'a) set"
] |
[
"inductive_set trancl :: \"('a \\<times> 'a) set \\<Rightarrow> ('a \\<times> 'a) set\" (\"(_\\<^sup>+)\" [1000] 999)\n for r :: \"('a \\<times> 'a) set\"\n where\n r_into_trancl [intro, Pure.intro]: \"(a, b) \\<in> r \\<Longrightarrow> (a, b) \\<in> r\\<^sup>+\"\n | trancl_into_trancl [Pure.intro]: \"(a, b) \\<in> r\\<^sup>+ \\<Longrightarrow> (b, c) \\<in> r \\<Longrightarrow> (a, c) \\<in> r\\<^sup>+\""
] |
template
|
###lemma
(?x, ?z) \<in> ?r\<^sup>+ \<Longrightarrow> ((?x, ?z) \<in> ?r \<Longrightarrow> ?P) \<Longrightarrow> (\<And>y. (?x, y) \<in> ?r \<Longrightarrow> (y, ?z) \<in> ?r\<^sup>+ \<Longrightarrow> ?P) \<Longrightarrow> ?P
###symbols
Transitive_Closure.trancl :::: ('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set
###defs
inductive_set trancl :: "('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set" ("(_\<^sup>+)" [1000] 999)
for r :: "('a \<times> 'a) set"
where
r_into_trancl [intro, Pure.intro]: "(a, b) \<in> r \<Longrightarrow> (a, b) \<in> r\<^sup>+"
| trancl_into_trancl [Pure.intro]: "(a, b) \<in> r\<^sup>+ \<Longrightarrow> (b, c) \<in> r \<Longrightarrow> (a, c) \<in> r\<^sup>+"
|
###output
\<lbrakk>(x_1, x_2) \<in> ?H1 x_3; (x_1, x_2) \<in> x_3 \<Longrightarrow> x_4; \<And>y_0. \<lbrakk>(x_1, y_0) \<in> x_3; (y_0, x_2) \<in> ?H1 x_3\<rbrakk> \<Longrightarrow> x_4\<rbrakk> \<Longrightarrow> x_4###end
|
Hoare_Parallel/Mul_Gar_Coll
|
Mul_Gar_Coll.Mul_interfree_Redirect_Edge_Propagate_Black
|
lemma Mul_interfree_Redirect_Edge_Propagate_Black: "\<lbrakk>0\<le>j; j<n\<rbrakk>\<Longrightarrow>
interfree_aux (Some(Mul_Redirect_Edge j n ),{},Some (Mul_Propagate_Black n))"
|
0 \<le> ?j \<Longrightarrow> ?j < ?n \<Longrightarrow> interfree_aux (Some (Mul_Redirect_Edge ?j ?n), {}, Some (Mul_Propagate_Black ?n))
|
\<lbrakk> ?H1 \<le> x_1; x_1 < x_2\<rbrakk> \<Longrightarrow> ?H2 (?H3 (?H4 x_1 x_2), ?H5, ?H3 (?H6 x_2))
|
[
"Mul_Gar_Coll.Mul_Propagate_Black",
"Set.empty",
"Mul_Gar_Coll.Mul_Redirect_Edge",
"Option.option.Some",
"OG_Hoare.interfree_aux",
"Groups.zero_class.zero"
] |
[
"nat \\<Rightarrow> mul_gar_coll_state ann_com",
"'a set",
"nat \\<Rightarrow> nat \\<Rightarrow> mul_gar_coll_state ann_com",
"'a \\<Rightarrow> 'a option",
"'a ann_com option \\<times> 'a set \\<times> 'a ann_com option \\<Rightarrow> bool",
"'a"
] |
[
"definition Mul_Propagate_Black :: \"nat \\<Rightarrow> mul_gar_coll_state ann_com\" where\n \"Mul_Propagate_Black n \\<equiv>\n \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> (\\<acute>Safe \\<or> \\<acute>l\\<le>\\<acute>Queue \\<or> \\<acute>obc\\<subset>Blacks \\<acute>M)\\<rbrace>\n \\<acute>ind:=0;;\n \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> Blacks \\<acute>M\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> (\\<acute>Safe \\<or> \\<acute>l\\<le>\\<acute>Queue \\<or> \\<acute>obc\\<subset>Blacks \\<acute>M) \\<and> \\<acute>ind=0\\<rbrace>\n WHILE \\<acute>ind<length \\<acute>E\n INV \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>Mul_PBInv \\<and> \\<acute>ind\\<le>length \\<acute>E\\<rbrace>\n DO \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>Mul_PBInv \\<and> \\<acute>ind<length \\<acute>E\\<rbrace>\n IF \\<acute>M!(fst (\\<acute>E!\\<acute>ind))=Black THEN\n \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>Mul_PBInv \\<and> (\\<acute>M!fst(\\<acute>E!\\<acute>ind))=Black \\<and> \\<acute>ind<length \\<acute>E\\<rbrace>\n \\<acute>k:=snd(\\<acute>E!\\<acute>ind);;\n \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> (\\<acute>Safe \\<or> \\<acute>obc\\<subset>Blacks \\<acute>M \\<or> \\<acute>l<\\<acute>Queue \\<or> (\\<forall>i<\\<acute>ind. \\<not>BtoW(\\<acute>E!i,\\<acute>M))\n \\<and> \\<acute>l\\<le>\\<acute>Queue \\<and> \\<acute>Mul_Auxk ) \\<and> \\<acute>k<length \\<acute>M \\<and> \\<acute>M!fst(\\<acute>E!\\<acute>ind)=Black\n \\<and> \\<acute>ind<length \\<acute>E\\<rbrace>\n \\<langle>\\<acute>M:=\\<acute>M[\\<acute>k:=Black],,\\<acute>ind:=\\<acute>ind+1\\<rangle>\n ELSE \\<lbrace>\\<acute>Mul_Proper n \\<and> Roots\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>obc\\<subseteq>Blacks \\<acute>M \\<and> \\<acute>bc\\<subseteq>Blacks \\<acute>M\n \\<and> \\<acute>Mul_PBInv \\<and> \\<acute>ind<length \\<acute>E\\<rbrace>\n \\<langle>IF \\<acute>M!(fst (\\<acute>E!\\<acute>ind))\\<noteq>Black THEN \\<acute>ind:=\\<acute>ind+1 FI\\<rangle> FI\n OD\"",
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"definition Mul_Redirect_Edge :: \"nat \\<Rightarrow> nat \\<Rightarrow> mul_gar_coll_state ann_com\" where\n \"Mul_Redirect_Edge j n \\<equiv>\n \\<lbrace>\\<acute>Mul_mut_init n \\<and> Z (\\<acute>Muts!j)\\<rbrace>\n \\<langle>IF T(\\<acute>Muts!j) \\<in> Reach \\<acute>E THEN\n \\<acute>E:= \\<acute>E[R (\\<acute>Muts!j):= (fst (\\<acute>E!R(\\<acute>Muts!j)), T (\\<acute>Muts!j))] FI,,\n \\<acute>Muts:= \\<acute>Muts[j:= (\\<acute>Muts!j) \\<lparr>Z:=False\\<rparr>]\\<rangle>\"",
"datatype 'a option =\n None\n | Some (the: 'a)",
"definition interfree_aux :: \"('a ann_com_op \\<times> 'a assn \\<times> 'a ann_com_op) \\<Rightarrow> bool\" where\n \"interfree_aux \\<equiv> \\<lambda>(co, q, co'). co'= None \\<or>\n (\\<forall>(r,a) \\<in> atomics (the co'). \\<parallel>= (q \\<inter> r) a q \\<and>\n (co = None \\<or> (\\<forall>p \\<in> assertions (the co). \\<parallel>= (p \\<inter> r) a p)))\"",
"class zero =\n fixes zero :: 'a (\"0\")"
] |
template
|
###lemma
0 \<le> ?j \<Longrightarrow> ?j < ?n \<Longrightarrow> interfree_aux (Some (Mul_Redirect_Edge ?j ?n), {}, Some (Mul_Propagate_Black ?n))
###symbols
Mul_Gar_Coll.Mul_Propagate_Black :::: nat \<Rightarrow> mul_gar_coll_state ann_com
Set.empty :::: 'a set
Mul_Gar_Coll.Mul_Redirect_Edge :::: nat \<Rightarrow> nat \<Rightarrow> mul_gar_coll_state ann_com
Option.option.Some :::: 'a \<Rightarrow> 'a option
OG_Hoare.interfree_aux :::: 'a ann_com option \<times> 'a set \<times> 'a ann_com option \<Rightarrow> bool
Groups.zero_class.zero :::: 'a
###defs
definition Mul_Propagate_Black :: "nat \<Rightarrow> mul_gar_coll_state ann_com" where
"Mul_Propagate_Black n \<equiv>
\<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M \<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> (\<acute>Safe \<or> \<acute>l\<le>\<acute>Queue \<or> \<acute>obc\<subset>Blacks \<acute>M)\<rbrace>
\<acute>ind:=0;;
\<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M
\<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> Blacks \<acute>M\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> (\<acute>Safe \<or> \<acute>l\<le>\<acute>Queue \<or> \<acute>obc\<subset>Blacks \<acute>M) \<and> \<acute>ind=0\<rbrace>
WHILE \<acute>ind<length \<acute>E
INV \<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M
\<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> \<acute>Mul_PBInv \<and> \<acute>ind\<le>length \<acute>E\<rbrace>
DO \<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M
\<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> \<acute>Mul_PBInv \<and> \<acute>ind<length \<acute>E\<rbrace>
IF \<acute>M!(fst (\<acute>E!\<acute>ind))=Black THEN
\<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M
\<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> \<acute>Mul_PBInv \<and> (\<acute>M!fst(\<acute>E!\<acute>ind))=Black \<and> \<acute>ind<length \<acute>E\<rbrace>
\<acute>k:=snd(\<acute>E!\<acute>ind);;
\<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M
\<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> (\<acute>Safe \<or> \<acute>obc\<subset>Blacks \<acute>M \<or> \<acute>l<\<acute>Queue \<or> (\<forall>i<\<acute>ind. \<not>BtoW(\<acute>E!i,\<acute>M))
\<and> \<acute>l\<le>\<acute>Queue \<and> \<acute>Mul_Auxk ) \<and> \<acute>k<length \<acute>M \<and> \<acute>M!fst(\<acute>E!\<acute>ind)=Black
\<and> \<acute>ind<length \<acute>E\<rbrace>
\<langle>\<acute>M:=\<acute>M[\<acute>k:=Black],,\<acute>ind:=\<acute>ind+1\<rangle>
ELSE \<lbrace>\<acute>Mul_Proper n \<and> Roots\<subseteq>Blacks \<acute>M
\<and> \<acute>obc\<subseteq>Blacks \<acute>M \<and> \<acute>bc\<subseteq>Blacks \<acute>M
\<and> \<acute>Mul_PBInv \<and> \<acute>ind<length \<acute>E\<rbrace>
\<langle>IF \<acute>M!(fst (\<acute>E!\<acute>ind))\<noteq>Black THEN \<acute>ind:=\<acute>ind+1 FI\<rangle> FI
OD"
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
definition Mul_Redirect_Edge :: "nat \<Rightarrow> nat \<Rightarrow> mul_gar_coll_state ann_com" where
"Mul_Redirect_Edge j n \<equiv>
\<lbrace>\<acute>Mul_mut_init n \<and> Z (\<acute>Muts!j)\<rbrace>
\<langle>IF T(\<acute>Muts!j) \<in> Reach \<acute>E THEN
\<acute>E:= \<acute>E[R (\<acute>Muts!j):= (fst (\<acute>E!R(\<acute>Muts!j)), T (\<acute>Muts!j))] FI,,
\<acute>Muts:= \<acute>Muts[j:= (\<acute>Muts!j) \<lparr>Z:=False\<rparr>]\<rangle>"
datatype 'a option =
None
| Some (the: 'a)
definition interfree_aux :: "('a ann_com_op \<times> 'a assn \<times> 'a ann_com_op) \<Rightarrow> bool" where
"interfree_aux \<equiv> \<lambda>(co, q, co'). co'= None \<or>
(\<forall>(r,a) \<in> atomics (the co'). \<parallel>= (q \<inter> r) a q \<and>
(co = None \<or> (\<forall>p \<in> assertions (the co). \<parallel>= (p \<inter> r) a p)))"
class zero =
fixes zero :: 'a ("0")
|
###output
\<lbrakk> ?H1 \<le> x_1; x_1 < x_2\<rbrakk> \<Longrightarrow> ?H2 (?H3 (?H4 x_1 x_2), ?H5, ?H3 (?H6 x_2))###end
|
Analysis/Infinite_Set_Sum
|
Infinite_Set_Sum.count_space_PiM_finite
|
lemma count_space_PiM_finite:
fixes B :: "'a \<Rightarrow> 'b set"
assumes "finite A" "\<And>i. countable (B i)"
shows "PiM A (\<lambda>i. count_space (B i)) = count_space (PiE A B)"
|
finite ?A \<Longrightarrow> (\<And>i. countable (?B i)) \<Longrightarrow> Pi\<^sub>M ?A (\<lambda>i. count_space (?B i)) = count_space (Pi\<^sub>E ?A ?B)
|
\<lbrakk> ?H1 x_1; \<And>y_0. ?H2 (x_2 y_0)\<rbrakk> \<Longrightarrow> ?H3 x_1 (\<lambda>y_1. ?H4 (x_2 y_1)) = ?H4 (?H5 x_1 x_2)
|
[
"FuncSet.Pi\\<^sub>E",
"Sigma_Algebra.count_space",
"Finite_Product_Measure.Pi\\<^sub>M",
"Countable_Set.countable",
"Finite_Set.finite"
] |
[
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b set) \\<Rightarrow> ('a \\<Rightarrow> 'b) set",
"'a set \\<Rightarrow> 'a measure",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b measure) \\<Rightarrow> ('a \\<Rightarrow> 'b) measure",
"'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> bool"
] |
[
"abbreviation \"Pi\\<^sub>E A B \\<equiv> PiE A B\"",
"abbreviation\n \"Pi\\<^sub>M I M \\<equiv> PiM I M\"",
"definition countable :: \"'a set \\<Rightarrow> bool\" where\n \"countable S \\<longleftrightarrow> (\\<exists>f::'a \\<Rightarrow> nat. inj_on f S)\"",
"class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin"
] |
template
|
###lemma
finite ?A \<Longrightarrow> (\<And>i. countable (?B i)) \<Longrightarrow> Pi\<^sub>M ?A (\<lambda>i. count_space (?B i)) = count_space (Pi\<^sub>E ?A ?B)
###symbols
FuncSet.Pi\<^sub>E :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> ('a \<Rightarrow> 'b) set
Sigma_Algebra.count_space :::: 'a set \<Rightarrow> 'a measure
Finite_Product_Measure.Pi\<^sub>M :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b measure) \<Rightarrow> ('a \<Rightarrow> 'b) measure
Countable_Set.countable :::: 'a set \<Rightarrow> bool
Finite_Set.finite :::: 'a set \<Rightarrow> bool
###defs
abbreviation "Pi\<^sub>E A B \<equiv> PiE A B"
abbreviation
"Pi\<^sub>M I M \<equiv> PiM I M"
definition countable :: "'a set \<Rightarrow> bool" where
"countable S \<longleftrightarrow> (\<exists>f::'a \<Rightarrow> nat. inj_on f S)"
class finite =
assumes finite_UNIV: "finite (UNIV :: 'a set)"
begin
|
###output
\<lbrakk> ?H1 x_1; \<And>y_0. ?H2 (x_2 y_0)\<rbrakk> \<Longrightarrow> ?H3 x_1 (\<lambda>y_1. ?H4 (x_2 y_1)) = ?H4 (?H5 x_1 x_2)###end
|
SPARK/Examples/RIPEMD-160/F
|
Finite_Set.card_eq_UNIV_imp_eq_UNIV
| null |
finite UNIV \<Longrightarrow> card ?A = CARD(?'a) \<Longrightarrow> ?A = UNIV
|
\<lbrakk> ?H1 ?H2; ?H3 x_1 = ?H3 ?H2\<rbrakk> \<Longrightarrow> x_1 = ?H2
|
[
"Finite_Set.card",
"Set.UNIV",
"Finite_Set.finite"
] |
[
"'a set \\<Rightarrow> nat",
"'a set",
"'a set \\<Rightarrow> bool"
] |
[
"abbreviation UNIV :: \"'a set\"\n where \"UNIV \\<equiv> top\"",
"class finite =\n assumes finite_UNIV: \"finite (UNIV :: 'a set)\"\nbegin"
] |
template
|
###lemma
finite UNIV \<Longrightarrow> card ?A = CARD(?'a) \<Longrightarrow> ?A = UNIV
###symbols
Finite_Set.card :::: 'a set \<Rightarrow> nat
Set.UNIV :::: 'a set
Finite_Set.finite :::: 'a set \<Rightarrow> bool
###defs
abbreviation UNIV :: "'a set"
where "UNIV \<equiv> top"
class finite =
assumes finite_UNIV: "finite (UNIV :: 'a set)"
begin
|
###output
\<lbrakk> ?H1 ?H2; ?H3 x_1 = ?H3 ?H2\<rbrakk> \<Longrightarrow> x_1 = ?H2###end
|
UNITY/Comp
|
Complete_Lattices.Union_SetCompr_eq
| null |
\<Union> { ?f x |x. ?P x} = {a. \<exists>x. ?P x \<and> a \<in> ?f x}
|
?H1 (?H2 (\<lambda>y_0. \<exists>y_1. y_0 = x_1 y_1 \<and> x_2 y_1)) = ?H2 (\<lambda>y_2. \<exists>y_3. x_2 y_3 \<and> y_2 \<in> x_1 y_3)
|
[
"Set.Collect",
"Complete_Lattices.Union"
] |
[
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set",
"'a set set \\<Rightarrow> 'a set"
] |
[
"abbreviation Union :: \"'a set set \\<Rightarrow> 'a set\" (\"\\<Union>\")\n where \"\\<Union>S \\<equiv> \\<Squnion>S\""
] |
template
|
###lemma
\<Union> { ?f x |x. ?P x} = {a. \<exists>x. ?P x \<and> a \<in> ?f x}
###symbols
Set.Collect :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a set
Complete_Lattices.Union :::: 'a set set \<Rightarrow> 'a set
###defs
abbreviation Union :: "'a set set \<Rightarrow> 'a set" ("\<Union>")
where "\<Union>S \<equiv> \<Squnion>S"
|
###output
?H1 (?H2 (\<lambda>y_0. \<exists>y_1. y_0 = x_1 y_1 \<and> x_2 y_1)) = ?H2 (\<lambda>y_2. \<exists>y_3. x_2 y_3 \<and> y_2 \<in> x_1 y_3)###end
|
Analysis/Path_Connected
|
Path_Connected.path_connected_space_iff_components_subset_singleton
|
lemma path_connected_space_iff_components_subset_singleton:
"path_connected_space X \<longleftrightarrow> (\<exists>a. path_components_of X \<subseteq> {a})"
|
path_connected_space ?X = (\<exists>a. path_components_of ?X \<subseteq> {a})
|
?H1 x_1 = (\<exists>y_0. ?H2 (?H3 x_1) (?H4 y_0 ?H5))
|
[
"Set.empty",
"Set.insert",
"Path_Connected.path_components_of",
"Set.subset_eq",
"Abstract_Topology_2.path_connected_space"
] |
[
"'a set",
"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a topology \\<Rightarrow> 'a set set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a topology \\<Rightarrow> bool"
] |
[
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"definition insert :: \"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set\"\n where insert_compr: \"insert a B = {x. x = a \\<or> x \\<in> B}\"",
"definition path_components_of :: \"'a topology \\<Rightarrow> 'a set set\"\n where \"path_components_of X \\<equiv> path_component_of_set X ` topspace X\"",
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\"",
"definition path_connected_space :: \"'a topology \\<Rightarrow> bool\"\n where \"path_connected_space X \\<equiv> \\<forall>x \\<in> topspace X. \\<forall> y \\<in> topspace X. \\<exists>g. pathin X g \\<and> g 0 = x \\<and> g 1 = y\""
] |
template
|
###lemma
path_connected_space ?X = (\<exists>a. path_components_of ?X \<subseteq> {a})
###symbols
Set.empty :::: 'a set
Set.insert :::: 'a \<Rightarrow> 'a set \<Rightarrow> 'a set
Path_Connected.path_components_of :::: 'a topology \<Rightarrow> 'a set set
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
Abstract_Topology_2.path_connected_space :::: 'a topology \<Rightarrow> bool
###defs
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
definition insert :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set"
where insert_compr: "insert a B = {x. x = a \<or> x \<in> B}"
definition path_components_of :: "'a topology \<Rightarrow> 'a set set"
where "path_components_of X \<equiv> path_component_of_set X ` topspace X"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
definition path_connected_space :: "'a topology \<Rightarrow> bool"
where "path_connected_space X \<equiv> \<forall>x \<in> topspace X. \<forall> y \<in> topspace X. \<exists>g. pathin X g \<and> g 0 = x \<and> g 1 = y"
|
###output
?H1 x_1 = (\<exists>y_0. ?H2 (?H3 x_1) (?H4 y_0 ?H5))###end
|
Metis_Examples/Message
|
Message.Friend_image_eq
|
lemma Friend_image_eq [simp]: "(Friend x \<in> Friend`A) = (x\<in>A)"
|
(Friend ?x \<in> Friend ` ?A) = (?x \<in> ?A)
|
(?H1 x_1 \<in> ?H2 ?H1 x_2) = (x_1 \<in> x_2)
|
[
"Set.image",
"Message.agent.Friend"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"nat \\<Rightarrow> agent"
] |
[
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\""
] |
template
|
###lemma
(Friend ?x \<in> Friend ` ?A) = (?x \<in> ?A)
###symbols
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Message.agent.Friend :::: nat \<Rightarrow> agent
###defs
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
|
###output
(?H1 x_1 \<in> ?H2 ?H1 x_2) = (x_1 \<in> x_2)###end
|
Nat
|
Nat.mono_iff_le_Suc
|
lemma mono_iff_le_Suc: "mono f \<longleftrightarrow> (\<forall>n. f n \<le> f (Suc n))"
|
mono ?f = (\<forall>n. ?f n \<le> ?f (Suc n))
|
?H1 x_1 = (\<forall>y_0. x_1 y_0 \<le> x_1 (?H2 y_0))
|
[
"Nat.Suc",
"Fun.order_class.mono"
] |
[
"nat \\<Rightarrow> nat",
"('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"definition Suc :: \"nat \\<Rightarrow> nat\"\n where \"Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))\""
] |
template
|
###lemma
mono ?f = (\<forall>n. ?f n \<le> ?f (Suc n))
###symbols
Nat.Suc :::: nat \<Rightarrow> nat
Fun.order_class.mono :::: ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
definition Suc :: "nat \<Rightarrow> nat"
where "Suc n = Abs_Nat (Suc_Rep (Rep_Nat n))"
|
###output
?H1 x_1 = (\<forall>y_0. x_1 y_0 \<le> x_1 (?H2 y_0))###end
|
Analysis/Borel_Space
|
Borel_Space.borel_measurable_restrict_space_iff_ennreal
|
lemma borel_measurable_restrict_space_iff_ennreal:
fixes f :: "'a \<Rightarrow> ennreal"
assumes \<Omega>[measurable, simp]: "\<Omega> \<inter> space M \<in> sets M"
shows "f \<in> borel_measurable (restrict_space M \<Omega>) \<longleftrightarrow>
(\<lambda>x. f x * indicator \<Omega> x) \<in> borel_measurable M"
|
?\<Omega> \<inter> space ?M \<in> sets ?M \<Longrightarrow> (?f \<in> borel_measurable (restrict_space ?M ?\<Omega>)) = ((\<lambda>x. ?f x * indicator ?\<Omega> x) \<in> borel_measurable ?M)
|
?H1 x_1 (?H2 x_2) \<in> ?H3 x_2 \<Longrightarrow> (x_3 \<in> ?H4 (?H5 x_2 x_1)) = ((\<lambda>y_0. ?H6 (x_3 y_0) (?H7 x_1 y_0)) \<in> ?H4 x_2)
|
[
"Indicator_Function.indicator",
"Groups.times_class.times",
"Sigma_Algebra.restrict_space",
"Borel_Space.borel_measurable",
"Sigma_Algebra.sets",
"Sigma_Algebra.space",
"Set.inter"
] |
[
"'a set \\<Rightarrow> 'a \\<Rightarrow> 'b",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a measure \\<Rightarrow> 'a set \\<Rightarrow> 'a measure",
"'a measure \\<Rightarrow> ('a \\<Rightarrow> 'b) set",
"'a measure \\<Rightarrow> 'a set set",
"'a measure \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set"
] |
[
"definition \"indicator S x = of_bool (x \\<in> S)\"",
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"definition restrict_space :: \"'a measure \\<Rightarrow> 'a set \\<Rightarrow> 'a measure\" where\n \"restrict_space M \\<Omega> = measure_of (\\<Omega> \\<inter> space M) (((\\<inter>) \\<Omega>) ` sets M) (emeasure M)\"",
"abbreviation \"borel_measurable M \\<equiv> measurable M borel\"",
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\""
] |
template
|
###lemma
?\<Omega> \<inter> space ?M \<in> sets ?M \<Longrightarrow> (?f \<in> borel_measurable (restrict_space ?M ?\<Omega>)) = ((\<lambda>x. ?f x * indicator ?\<Omega> x) \<in> borel_measurable ?M)
###symbols
Indicator_Function.indicator :::: 'a set \<Rightarrow> 'a \<Rightarrow> 'b
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Sigma_Algebra.restrict_space :::: 'a measure \<Rightarrow> 'a set \<Rightarrow> 'a measure
Borel_Space.borel_measurable :::: 'a measure \<Rightarrow> ('a \<Rightarrow> 'b) set
Sigma_Algebra.sets :::: 'a measure \<Rightarrow> 'a set set
Sigma_Algebra.space :::: 'a measure \<Rightarrow> 'a set
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
###defs
definition "indicator S x = of_bool (x \<in> S)"
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
definition restrict_space :: "'a measure \<Rightarrow> 'a set \<Rightarrow> 'a measure" where
"restrict_space M \<Omega> = measure_of (\<Omega> \<inter> space M) (((\<inter>) \<Omega>) ` sets M) (emeasure M)"
abbreviation "borel_measurable M \<equiv> measurable M borel"
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
|
###output
?H1 x_1 (?H2 x_2) \<in> ?H3 x_2 \<Longrightarrow> (x_3 \<in> ?H4 (?H5 x_2 x_1)) = ((\<lambda>y_0. ?H6 (x_3 y_0) (?H7 x_1 y_0)) \<in> ?H4 x_2)###end
|
Set_Interval
|
Set_Interval.atMost_eq_iff
|
lemma atMost_eq_iff [iff]: "(atMost x = atMost y) = (x = (y::'a::order))"
|
({.. ?x} = {.. ?y}) = (?x = ?y)
|
(?H1 x_1 = ?H1 x_2) = (x_1 = x_2)
|
[
"Set_Interval.ord_class.atMost"
] |
[
"'a \\<Rightarrow> 'a set"
] |
[] |
template
|
###lemma
({.. ?x} = {.. ?y}) = (?x = ?y)
###symbols
Set_Interval.ord_class.atMost :::: 'a \<Rightarrow> 'a set
###defs
|
###output
(?H1 x_1 = ?H1 x_2) = (x_1 = x_2)###end
|
Homology/Homology_Groups
|
Homology_Groups.trivial_homology_group_empty
|
lemma trivial_homology_group_empty:
"topspace X = {} \<Longrightarrow> trivial_group(homology_group p X)"
|
topspace ?X = {} \<Longrightarrow> trivial_group (homology_group ?p ?X)
|
?H1 x_1 = ?H2 \<Longrightarrow> ?H3 (?H4 x_2 x_1)
|
[
"Homology_Groups.homology_group",
"Elementary_Groups.trivial_group",
"Set.empty",
"Abstract_Topology.topspace"
] |
[
"int \\<Rightarrow> 'a topology \\<Rightarrow> (((nat \\<Rightarrow> real) \\<Rightarrow> 'a) \\<Rightarrow>\\<^sub>0 int) set monoid",
"('a, 'b) monoid_scheme \\<Rightarrow> bool",
"'a set",
"'a topology \\<Rightarrow> 'a set"
] |
[
"abbreviation homology_group\n where \"homology_group p X \\<equiv> relative_homology_group p X {}\"",
"definition trivial_group :: \"('a, 'b) monoid_scheme \\<Rightarrow> bool\"\n where \"trivial_group G \\<equiv> group G \\<and> carrier G = {one G}\"",
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"definition \"topspace T = \\<Union>{S. openin T S}\""
] |
template
|
###lemma
topspace ?X = {} \<Longrightarrow> trivial_group (homology_group ?p ?X)
###symbols
Homology_Groups.homology_group :::: int \<Rightarrow> 'a topology \<Rightarrow> (((nat \<Rightarrow> real) \<Rightarrow> 'a) \<Rightarrow>\<^sub>0 int) set monoid
Elementary_Groups.trivial_group :::: ('a, 'b) monoid_scheme \<Rightarrow> bool
Set.empty :::: 'a set
Abstract_Topology.topspace :::: 'a topology \<Rightarrow> 'a set
###defs
abbreviation homology_group
where "homology_group p X \<equiv> relative_homology_group p X {}"
definition trivial_group :: "('a, 'b) monoid_scheme \<Rightarrow> bool"
where "trivial_group G \<equiv> group G \<and> carrier G = {one G}"
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
definition "topspace T = \<Union>{S. openin T S}"
|
###output
?H1 x_1 = ?H2 \<Longrightarrow> ?H3 (?H4 x_2 x_1)###end
|
Auth/Kerberos_BAN_Gets
|
Kerberos_BAN_Gets.used_evs_rev
|
lemma used_evs_rev: "used evs = used (rev evs)"
|
used ?evs = used (rev ?evs)
|
?H1 x_1 = ?H1 (?H2 x_1)
|
[
"List.rev",
"Event.used"
] |
[
"'a list \\<Rightarrow> 'a list",
"event list \\<Rightarrow> msg set"
] |
[
"primrec rev :: \"'a list \\<Rightarrow> 'a list\" where\n\"rev [] = []\" |\n\"rev (x # xs) = rev xs @ [x]\"",
"primrec used :: \"event list \\<Rightarrow> msg set\"\nwhere\n used_Nil: \"used [] = (UN B. parts (initState B))\"\n| used_Cons: \"used (ev # evs) =\n (case ev of\n Says A B X \\<Rightarrow> parts {X} \\<union> used evs\n | Gets A X \\<Rightarrow> used evs\n | Notes A X \\<Rightarrow> parts {X} \\<union> used evs)\"\n \\<comment> \\<open>The case for \\<^term>\\<open>Gets\\<close> seems anomalous, but \\<^term>\\<open>Gets\\<close> always\n follows \\<^term>\\<open>Says\\<close> in real protocols. Seems difficult to change.\n See \\<open>Gets_correct\\<close> in theory \\<open>Guard/Extensions.thy\\<close>.\\<close>"
] |
template
|
###lemma
used ?evs = used (rev ?evs)
###symbols
List.rev :::: 'a list \<Rightarrow> 'a list
Event.used :::: event list \<Rightarrow> msg set
###defs
primrec rev :: "'a list \<Rightarrow> 'a list" where
"rev [] = []" |
"rev (x # xs) = rev xs @ [x]"
primrec used :: "event list \<Rightarrow> msg set"
where
used_Nil: "used [] = (UN B. parts (initState B))"
| used_Cons: "used (ev # evs) =
(case ev of
Says A B X \<Rightarrow> parts {X} \<union> used evs
| Gets A X \<Rightarrow> used evs
| Notes A X \<Rightarrow> parts {X} \<union> used evs)"
\<comment> \<open>The case for \<^term>\<open>Gets\<close> seems anomalous, but \<^term>\<open>Gets\<close> always
follows \<^term>\<open>Says\<close> in real protocols. Seems difficult to change.
See \<open>Gets_correct\<close> in theory \<open>Guard/Extensions.thy\<close>.\<close>
|
###output
?H1 x_1 = ?H1 (?H2 x_1)###end
|
HOLCF/Lift
|
Lifting.apply_rsp''
| null |
Quotient ?R ?Abs ?Rep ?T \<Longrightarrow> rel_fun ?R ?S ?f ?f \<Longrightarrow> ?S (?f (?Rep ?x)) (?f (?Rep ?x))
|
\<lbrakk> ?H1 x_1 x_2 x_3 x_4; ?H2 x_1 x_5 x_6 x_6\<rbrakk> \<Longrightarrow> x_5 (x_6 (x_3 x_7)) (x_6 (x_3 x_7))
|
[
"BNF_Def.rel_fun",
"Lifting.Quotient"
] |
[
"('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> ('c \\<Rightarrow> 'd \\<Rightarrow> bool) \\<Rightarrow> ('a \\<Rightarrow> 'c) \\<Rightarrow> ('b \\<Rightarrow> 'd) \\<Rightarrow> bool",
"('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> ('b \\<Rightarrow> 'a) \\<Rightarrow> ('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> bool"
] |
[
"definition\n rel_fun :: \"('a \\<Rightarrow> 'c \\<Rightarrow> bool) \\<Rightarrow> ('b \\<Rightarrow> 'd \\<Rightarrow> bool) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> ('c \\<Rightarrow> 'd) \\<Rightarrow> bool\"\nwhere\n \"rel_fun A B = (\\<lambda>f g. \\<forall>x y. A x y \\<longrightarrow> B (f x) (g y))\"",
"definition\n \"Quotient R Abs Rep T \\<longleftrightarrow>\n (\\<forall>a. Abs (Rep a) = a) \\<and>\n (\\<forall>a. R (Rep a) (Rep a)) \\<and>\n (\\<forall>r s. R r s \\<longleftrightarrow> R r r \\<and> R s s \\<and> Abs r = Abs s) \\<and>\n T = (\\<lambda>x y. R x x \\<and> Abs x = y)\""
] |
template
|
###lemma
Quotient ?R ?Abs ?Rep ?T \<Longrightarrow> rel_fun ?R ?S ?f ?f \<Longrightarrow> ?S (?f (?Rep ?x)) (?f (?Rep ?x))
###symbols
BNF_Def.rel_fun :::: ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('c \<Rightarrow> 'd \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'c) \<Rightarrow> ('b \<Rightarrow> 'd) \<Rightarrow> bool
Lifting.Quotient :::: ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> bool
###defs
definition
rel_fun :: "('a \<Rightarrow> 'c \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'd \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('c \<Rightarrow> 'd) \<Rightarrow> bool"
where
"rel_fun A B = (\<lambda>f g. \<forall>x y. A x y \<longrightarrow> B (f x) (g y))"
definition
"Quotient R Abs Rep T \<longleftrightarrow>
(\<forall>a. Abs (Rep a) = a) \<and>
(\<forall>a. R (Rep a) (Rep a)) \<and>
(\<forall>r s. R r s \<longleftrightarrow> R r r \<and> R s s \<and> Abs r = Abs s) \<and>
T = (\<lambda>x y. R x x \<and> Abs x = y)"
|
###output
\<lbrakk> ?H1 x_1 x_2 x_3 x_4; ?H2 x_1 x_5 x_6 x_6\<rbrakk> \<Longrightarrow> x_5 (x_6 (x_3 x_7)) (x_6 (x_3 x_7))###end
|
Library/Countable_Set
|
Countable_Set.all_countable_subset_image_inj
|
lemma all_countable_subset_image_inj:
"(\<forall>T. countable T \<and> T \<subseteq> f ` S \<longrightarrow> P T) \<longleftrightarrow> (\<forall>T. countable T \<and> T \<subseteq> S \<and> inj_on f T \<longrightarrow>P(f ` T))"
|
(\<forall>T. countable T \<and> T \<subseteq> ?f ` ?S \<longrightarrow> ?P T) = (\<forall>T. countable T \<and> T \<subseteq> ?S \<and> inj_on ?f T \<longrightarrow> ?P (?f ` T))
|
(\<forall>y_0. ?H1 y_0 \<and> ?H2 y_0 (?H3 x_1 x_2) \<longrightarrow> x_3 y_0) = (\<forall>y_1. ?H1 y_1 \<and> ?H2 y_1 x_2 \<and> ?H4 x_1 y_1 \<longrightarrow> x_3 (?H3 x_1 y_1))
|
[
"Fun.inj_on",
"Set.image",
"Set.subset_eq",
"Countable_Set.countable"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> bool"
] |
[
"definition inj_on :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> bool\" \\<comment> \\<open>injective\\<close>\n where \"inj_on f A \\<longleftrightarrow> (\\<forall>x\\<in>A. \\<forall>y\\<in>A. f x = f y \\<longrightarrow> x = y)\"",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\"",
"definition countable :: \"'a set \\<Rightarrow> bool\" where\n \"countable S \\<longleftrightarrow> (\\<exists>f::'a \\<Rightarrow> nat. inj_on f S)\""
] |
template
|
###lemma
(\<forall>T. countable T \<and> T \<subseteq> ?f ` ?S \<longrightarrow> ?P T) = (\<forall>T. countable T \<and> T \<subseteq> ?S \<and> inj_on ?f T \<longrightarrow> ?P (?f ` T))
###symbols
Fun.inj_on :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
Countable_Set.countable :::: 'a set \<Rightarrow> bool
###defs
definition inj_on :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> bool" \<comment> \<open>injective\<close>
where "inj_on f A \<longleftrightarrow> (\<forall>x\<in>A. \<forall>y\<in>A. f x = f y \<longrightarrow> x = y)"
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
definition countable :: "'a set \<Rightarrow> bool" where
"countable S \<longleftrightarrow> (\<exists>f::'a \<Rightarrow> nat. inj_on f S)"
|
###output
(\<forall>y_0. ?H1 y_0 \<and> ?H2 y_0 (?H3 x_1 x_2) \<longrightarrow> x_3 y_0) = (\<forall>y_1. ?H1 y_1 \<and> ?H2 y_1 x_2 \<and> ?H4 x_1 y_1 \<longrightarrow> x_3 (?H3 x_1 y_1))###end
|
Nominal/Examples/W
|
Wellfounded.accp_subset
| null |
?R1.0 \<le> ?R2.0 \<Longrightarrow> Wellfounded.accp ?R2.0 \<le> Wellfounded.accp ?R1.0
|
x_1 \<le> x_2 \<Longrightarrow> ?H1 x_2 \<le> ?H1 x_1
|
[
"Wellfounded.accp"
] |
[
"('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> 'a \\<Rightarrow> bool"
] |
[] |
template
|
###lemma
?R1.0 \<le> ?R2.0 \<Longrightarrow> Wellfounded.accp ?R2.0 \<le> Wellfounded.accp ?R1.0
###symbols
Wellfounded.accp :::: ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool
###defs
|
###output
x_1 \<le> x_2 \<Longrightarrow> ?H1 x_2 \<le> ?H1 x_1###end
|
Analysis/Abstract_Topology
|
Abstract_Topology.connected_spaceD
|
lemma connected_spaceD:
"\<lbrakk>connected_space X;
openin X U; openin X V; topspace X \<subseteq> U \<union> V; U \<inter> V = {}; U \<noteq> {}; V \<noteq> {}\<rbrakk> \<Longrightarrow> False"
|
connected_space ?X \<Longrightarrow> openin ?X ?U \<Longrightarrow> openin ?X ?V \<Longrightarrow> topspace ?X \<subseteq> ?U \<union> ?V \<Longrightarrow> ?U \<inter> ?V = {} \<Longrightarrow> ?U \<noteq> {} \<Longrightarrow> ?V \<noteq> {} \<Longrightarrow> False
|
\<lbrakk> ?H1 x_1; ?H2 x_1 x_2; ?H2 x_1 x_3; ?H3 (?H4 x_1) (?H5 x_2 x_3); ?H6 x_2 x_3 = ?H7; x_2 \<noteq> ?H7; x_3 \<noteq> ?H7\<rbrakk> \<Longrightarrow> False
|
[
"Set.empty",
"Set.inter",
"Set.union",
"Abstract_Topology.topspace",
"Set.subset_eq",
"Abstract_Topology.topology.openin",
"Abstract_Topology.connected_space"
] |
[
"'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a topology \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a topology \\<Rightarrow> bool"
] |
[
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\"",
"abbreviation union :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<union>\" 65)\n where \"union \\<equiv> sup\"",
"definition \"topspace T = \\<Union>{S. openin T S}\"",
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\"",
"definition connected_space :: \"'a topology \\<Rightarrow> bool\" where\n \"connected_space X \\<equiv>\n \\<not>(\\<exists>E1 E2. openin X E1 \\<and> openin X E2 \\<and>\n topspace X \\<subseteq> E1 \\<union> E2 \\<and> E1 \\<inter> E2 = {} \\<and> E1 \\<noteq> {} \\<and> E2 \\<noteq> {})\""
] |
template
|
###lemma
connected_space ?X \<Longrightarrow> openin ?X ?U \<Longrightarrow> openin ?X ?V \<Longrightarrow> topspace ?X \<subseteq> ?U \<union> ?V \<Longrightarrow> ?U \<inter> ?V = {} \<Longrightarrow> ?U \<noteq> {} \<Longrightarrow> ?V \<noteq> {} \<Longrightarrow> False
###symbols
Set.empty :::: 'a set
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
Set.union :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
Abstract_Topology.topspace :::: 'a topology \<Rightarrow> 'a set
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
Abstract_Topology.topology.openin :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> bool
Abstract_Topology.connected_space :::: 'a topology \<Rightarrow> bool
###defs
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
abbreviation union :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<union>" 65)
where "union \<equiv> sup"
definition "topspace T = \<Union>{S. openin T S}"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
definition connected_space :: "'a topology \<Rightarrow> bool" where
"connected_space X \<equiv>
\<not>(\<exists>E1 E2. openin X E1 \<and> openin X E2 \<and>
topspace X \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})"
|
###output
\<lbrakk> ?H1 x_1; ?H2 x_1 x_2; ?H2 x_1 x_3; ?H3 (?H4 x_1) (?H5 x_2 x_3); ?H6 x_2 x_3 = ?H7; x_2 \<noteq> ?H7; x_3 \<noteq> ?H7\<rbrakk> \<Longrightarrow> False###end
|
Library/Sublist
|
Sublist.prefixE
|
lemma prefixE [elim?]:
assumes "prefix xs ys"
obtains zs where "ys = xs @ zs"
|
prefix ?xs ?ys \<Longrightarrow> (\<And>zs. ?ys = ?xs @ zs \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
|
\<lbrakk> ?H1 x_1 x_2; \<And>y_0. x_2 = ?H2 x_1 y_0 \<Longrightarrow> x_3\<rbrakk> \<Longrightarrow> x_3
|
[
"List.append",
"Sublist.prefix"
] |
[
"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list",
"'a list \\<Rightarrow> 'a list \\<Rightarrow> bool"
] |
[
"primrec append :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> 'a list\" (infixr \"@\" 65) where\nappend_Nil: \"[] @ ys = ys\" |\nappend_Cons: \"(x#xs) @ ys = x # xs @ ys\"",
"definition prefix :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> bool\"\n where \"prefix xs ys \\<longleftrightarrow> (\\<exists>zs. ys = xs @ zs)\""
] |
template
|
###lemma
prefix ?xs ?ys \<Longrightarrow> (\<And>zs. ?ys = ?xs @ zs \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
###symbols
List.append :::: 'a list \<Rightarrow> 'a list \<Rightarrow> 'a list
Sublist.prefix :::: 'a list \<Rightarrow> 'a list \<Rightarrow> bool
###defs
primrec append :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list" (infixr "@" 65) where
append_Nil: "[] @ ys = ys" |
append_Cons: "(x#xs) @ ys = x # xs @ ys"
definition prefix :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool"
where "prefix xs ys \<longleftrightarrow> (\<exists>zs. ys = xs @ zs)"
|
###output
\<lbrakk> ?H1 x_1 x_2; \<And>y_0. x_2 = ?H2 x_1 y_0 \<Longrightarrow> x_3\<rbrakk> \<Longrightarrow> x_3###end
|
Deriv
|
Deriv.has_field_derivative_at_within
|
lemma has_field_derivative_at_within:
"(f has_field_derivative f') (at x) \<Longrightarrow> (f has_field_derivative f') (at x within s)"
|
(?f has_field_derivative ?f') (at ?x) \<Longrightarrow> (?f has_field_derivative ?f') (at ?x within ?s)
|
?H1 x_1 x_2 (?H2 x_3) \<Longrightarrow> ?H1 x_1 x_2 (?H3 x_3 x_4)
|
[
"Topological_Spaces.topological_space_class.at_within",
"Topological_Spaces.topological_space_class.at",
"Deriv.has_field_derivative"
] |
[
"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a filter",
"'a \\<Rightarrow> 'a filter",
"('a \\<Rightarrow> 'a) \\<Rightarrow> 'a \\<Rightarrow> 'a filter \\<Rightarrow> bool"
] |
[
"class topological_space = \"open\" +\n assumes open_UNIV [simp, intro]: \"open UNIV\"\n assumes open_Int [intro]: \"open S \\<Longrightarrow> open T \\<Longrightarrow> open (S \\<inter> T)\"\n assumes open_Union [intro]: \"\\<forall>S\\<in>K. open S \\<Longrightarrow> open (\\<Union>K)\"\nbegin",
"class topological_space = \"open\" +\n assumes open_UNIV [simp, intro]: \"open UNIV\"\n assumes open_Int [intro]: \"open S \\<Longrightarrow> open T \\<Longrightarrow> open (S \\<inter> T)\"\n assumes open_Union [intro]: \"\\<forall>S\\<in>K. open S \\<Longrightarrow> open (\\<Union>K)\"\nbegin",
"definition has_field_derivative :: \"('a::real_normed_field \\<Rightarrow> 'a) \\<Rightarrow> 'a \\<Rightarrow> 'a filter \\<Rightarrow> bool\"\n (infix \"(has'_field'_derivative)\" 50)\n where \"(f has_field_derivative D) F \\<longleftrightarrow> (f has_derivative (*) D) F\""
] |
template
|
###lemma
(?f has_field_derivative ?f') (at ?x) \<Longrightarrow> (?f has_field_derivative ?f') (at ?x within ?s)
###symbols
Topological_Spaces.topological_space_class.at_within :::: 'a \<Rightarrow> 'a set \<Rightarrow> 'a filter
Topological_Spaces.topological_space_class.at :::: 'a \<Rightarrow> 'a filter
Deriv.has_field_derivative :::: ('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a filter \<Rightarrow> bool
###defs
class topological_space = "open" +
assumes open_UNIV [simp, intro]: "open UNIV"
assumes open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)"
assumes open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union>K)"
begin
class topological_space = "open" +
assumes open_UNIV [simp, intro]: "open UNIV"
assumes open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)"
assumes open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union>K)"
begin
definition has_field_derivative :: "('a::real_normed_field \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a filter \<Rightarrow> bool"
(infix "(has'_field'_derivative)" 50)
where "(f has_field_derivative D) F \<longleftrightarrow> (f has_derivative (*) D) F"
|
###output
?H1 x_1 x_2 (?H2 x_3) \<Longrightarrow> ?H1 x_1 x_2 (?H3 x_3 x_4)###end
|
SET_Protocol/Cardholder_Registration
|
Cardholder_Registration.analz_insert_pan
|
lemma analz_insert_pan:
"[| evs \<in> set_cr; K \<notin> invKey ` pubEK ` range CA |] ==>
(Pan P \<in> analz (insert (Key K) (knows Spy evs))) =
(Pan P \<in> analz (knows Spy evs))"
|
?evs \<in> set_cr \<Longrightarrow> ?K \<notin> invKey ` pubEK ` range CA \<Longrightarrow> (Pan ?P \<in> analz (insert (Key ?K) (knows Spy ?evs))) = (Pan ?P \<in> analz (knows Spy ?evs))
|
\<lbrakk>x_1 \<in> ?H1; ?H2 x_2 (?H3 ?H4 (?H3 ?H5 (?H6 ?H7)))\<rbrakk> \<Longrightarrow> (?H8 x_3 \<in> ?H9 (?H10 (?H11 x_2) (?H12 ?H13 x_1))) = (?H8 x_3 \<in> ?H9 (?H12 ?H13 x_1))
|
[
"Message_SET.agent.Spy",
"Event_SET.knows",
"Message_SET.msg.Key",
"Set.insert",
"Message_SET.analz",
"Message_SET.msg.Pan",
"Message_SET.agent.CA",
"Set.range",
"Public_SET.pubEK",
"Message_SET.invKey",
"Set.image",
"Set.not_member",
"Cardholder_Registration.set_cr"
] |
[
"agent",
"agent \\<Rightarrow> event list \\<Rightarrow> msg set",
"nat \\<Rightarrow> msg",
"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"msg set \\<Rightarrow> msg set",
"nat \\<Rightarrow> msg",
"nat \\<Rightarrow> agent",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set",
"agent \\<Rightarrow> nat",
"nat \\<Rightarrow> nat",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a \\<Rightarrow> 'a set \\<Rightarrow> bool",
"event list set"
] |
[
"datatype\n agent = CA nat | Cardholder nat | Merchant nat | PG nat | Spy",
"primrec knows :: \"[agent, event list] \\<Rightarrow> msg set\"\nwhere\n knows_Nil:\n \"knows A [] = initState A\"\n| knows_Cons:\n \"knows A (ev # evs) =\n (if A = Spy then\n (case ev of\n Says A' B X \\<Rightarrow> insert X (knows Spy evs)\n | Gets A' X \\<Rightarrow> knows Spy evs\n | Notes A' X \\<Rightarrow>\n if A' \\<in> bad then insert X (knows Spy evs) else knows Spy evs)\n else\n (case ev of\n Says A' B X \\<Rightarrow>\n if A'=A then insert X (knows A evs) else knows A evs\n | Gets A' X \\<Rightarrow>\n if A'=A then insert X (knows A evs) else knows A evs\n | Notes A' X \\<Rightarrow>\n if A'=A then insert X (knows A evs) else knows A evs))\"",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Pan nat \\<comment> \\<open>Unguessable Primary Account Numbers (??)\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"definition insert :: \"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set\"\n where insert_compr: \"insert a B = {x. x = a \\<or> x \\<in> B}\"",
"inductive_set\n analz :: \"msg set => msg set\"\n for H :: \"msg set\"\n where\n Inj [intro,simp] : \"X \\<in> H ==> X \\<in> analz H\"\n | Fst: \"\\<lbrace>X,Y\\<rbrace> \\<in> analz H ==> X \\<in> analz H\"\n | Snd: \"\\<lbrace>X,Y\\<rbrace> \\<in> analz H ==> Y \\<in> analz H\"\n | Decrypt [dest]:\n \"[|Crypt K X \\<in> analz H; Key(invKey K) \\<in> analz H|] ==> X \\<in> analz H\"",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Pan nat \\<comment> \\<open>Unguessable Primary Account Numbers (??)\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"datatype\n agent = CA nat | Cardholder nat | Merchant nat | PG nat | Spy",
"abbreviation range :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set\" \\<comment> \\<open>of function\\<close>\n where \"range f \\<equiv> f ` UNIV\"",
"abbreviation \"pubEK == publicKey False\"",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"abbreviation not_member\n where \"not_member x A \\<equiv> \\<not> (x \\<in> A)\" \\<comment> \\<open>non-membership\\<close>",
"inductive_set\n set_cr :: \"event list set\"\nwhere\n\n Nil: \\<comment> \\<open>Initial trace is empty\\<close>\n \"[] \\<in> set_cr\"\n\n| Fake: \\<comment> \\<open>The spy MAY say anything he CAN say.\\<close>\n \"[| evsf \\<in> set_cr; X \\<in> synth (analz (knows Spy evsf)) |]\n ==> Says Spy B X # evsf \\<in> set_cr\"\n\n| Reception: \\<comment> \\<open>If A sends a message X to B, then B might receive it\\<close>\n \"[| evsr \\<in> set_cr; Says A B X \\<in> set evsr |]\n ==> Gets B X # evsr \\<in> set_cr\"\n\n| SET_CR1: \\<comment> \\<open>CardCInitReq: C initiates a run, sending a nonce to CCA\\<close>\n \"[| evs1 \\<in> set_cr; C = Cardholder k; Nonce NC1 \\<notin> used evs1 |]\n ==> Says C (CA i) \\<lbrace>Agent C, Nonce NC1\\<rbrace> # evs1 \\<in> set_cr\"\n\n| SET_CR2: \\<comment> \\<open>CardCInitRes: CA responds sending NC1 and its certificates\\<close>\n \"[| evs2 \\<in> set_cr;\n Gets (CA i) \\<lbrace>Agent C, Nonce NC1\\<rbrace> \\<in> set evs2 |]\n ==> Says (CA i) C\n \\<lbrace>sign (priSK (CA i)) \\<lbrace>Agent C, Nonce NC1\\<rbrace>,\n cert (CA i) (pubEK (CA i)) onlyEnc (priSK RCA),\n cert (CA i) (pubSK (CA i)) onlySig (priSK RCA)\\<rbrace>\n # evs2 \\<in> set_cr\"\n\n| SET_CR3:\n \\<comment> \\<open>RegFormReq: C sends his PAN and a new nonce to CA.\n C verifies that\n - nonce received is the same as that sent;\n - certificates are signed by RCA;\n - certificates are an encryption certificate (flag is onlyEnc) and a\n signature certificate (flag is onlySig);\n - certificates pertain to the CA that C contacted (this is done by\n checking the signature).\n C generates a fresh symmetric key KC1.\n The point of encrypting \\<^term>\\<open>\\<lbrace>Agent C, Nonce NC2, Hash (Pan(pan C))\\<rbrace>\\<close>\n is not clear.\\<close>\n\"[| evs3 \\<in> set_cr; C = Cardholder k;\n Nonce NC2 \\<notin> used evs3;\n Key KC1 \\<notin> used evs3; KC1 \\<in> symKeys;\n Gets C \\<lbrace>sign (invKey SKi) \\<lbrace>Agent X, Nonce NC1\\<rbrace>,\n cert (CA i) EKi onlyEnc (priSK RCA),\n cert (CA i) SKi onlySig (priSK RCA)\\<rbrace>\n \\<in> set evs3;\n Says C (CA i) \\<lbrace>Agent C, Nonce NC1\\<rbrace> \\<in> set evs3|]\n ==> Says C (CA i) (EXHcrypt KC1 EKi \\<lbrace>Agent C, Nonce NC2\\<rbrace> (Pan(pan C)))\n # Notes C \\<lbrace>Key KC1, Agent (CA i)\\<rbrace>\n # evs3 \\<in> set_cr\"\n\n| SET_CR4:\n \\<comment> \\<open>RegFormRes:\n CA responds sending NC2 back with a new nonce NCA, after checking that\n - the digital envelope is correctly encrypted by \\<^term>\\<open>pubEK (CA i)\\<close>\n - the entire message is encrypted with the same key found inside the\n envelope (here, KC1)\\<close>\n\"[| evs4 \\<in> set_cr;\n Nonce NCA \\<notin> used evs4; KC1 \\<in> symKeys;\n Gets (CA i) (EXHcrypt KC1 EKi \\<lbrace>Agent C, Nonce NC2\\<rbrace> (Pan(pan X)))\n \\<in> set evs4 |]\n ==> Says (CA i) C\n \\<lbrace>sign (priSK (CA i)) \\<lbrace>Agent C, Nonce NC2, Nonce NCA\\<rbrace>,\n cert (CA i) (pubEK (CA i)) onlyEnc (priSK RCA),\n cert (CA i) (pubSK (CA i)) onlySig (priSK RCA)\\<rbrace>\n # evs4 \\<in> set_cr\"\n\n| SET_CR5:\n \\<comment> \\<open>CertReq: C sends his PAN, a new nonce, its proposed public signature key\n and its half of the secret value to CA.\n We now assume that C has a fixed key pair, and he submits (pubSK C).\n The protocol does not require this key to be fresh.\n The encryption below is actually EncX.\\<close>\n\"[| evs5 \\<in> set_cr; C = Cardholder k;\n Nonce NC3 \\<notin> used evs5; Nonce CardSecret \\<notin> used evs5; NC3\\<noteq>CardSecret;\n Key KC2 \\<notin> used evs5; KC2 \\<in> symKeys;\n Key KC3 \\<notin> used evs5; KC3 \\<in> symKeys; KC2\\<noteq>KC3;\n Gets C \\<lbrace>sign (invKey SKi) \\<lbrace>Agent C, Nonce NC2, Nonce NCA\\<rbrace>,\n cert (CA i) EKi onlyEnc (priSK RCA),\n cert (CA i) SKi onlySig (priSK RCA) \\<rbrace>\n \\<in> set evs5;\n Says C (CA i) (EXHcrypt KC1 EKi \\<lbrace>Agent C, Nonce NC2\\<rbrace> (Pan(pan C)))\n \\<in> set evs5 |]\n==> Says C (CA i)\n \\<lbrace>Crypt KC3\n \\<lbrace>Agent C, Nonce NC3, Key KC2, Key (pubSK C),\n Crypt (priSK C)\n (Hash \\<lbrace>Agent C, Nonce NC3, Key KC2,\n Key (pubSK C), Pan (pan C), Nonce CardSecret\\<rbrace>)\\<rbrace>,\n Crypt EKi \\<lbrace>Key KC3, Pan (pan C), Nonce CardSecret\\<rbrace> \\<rbrace>\n # Notes C \\<lbrace>Key KC2, Agent (CA i)\\<rbrace>\n # Notes C \\<lbrace>Key KC3, Agent (CA i)\\<rbrace>\n # evs5 \\<in> set_cr\"\n\n\n \\<comment> \\<open>CertRes: CA responds sending NC3 back with its half of the secret value,\n its signature certificate and the new cardholder signature\n certificate. CA checks to have never certified the key proposed by C.\n NOTE: In Merchant Registration, the corresponding rule (4)\n uses the \"sign\" primitive. The encryption below is actually \\<^term>\\<open>EncK\\<close>, \n which is just \\<^term>\\<open>Crypt K (sign SK X)\\<close>.\\<close>\n\n| SET_CR6:\n\"[| evs6 \\<in> set_cr;\n Nonce NonceCCA \\<notin> used evs6;\n KC2 \\<in> symKeys; KC3 \\<in> symKeys; cardSK \\<notin> symKeys;\n Notes (CA i) (Key cardSK) \\<notin> set evs6;\n Gets (CA i)\n \\<lbrace>Crypt KC3 \\<lbrace>Agent C, Nonce NC3, Key KC2, Key cardSK,\n Crypt (invKey cardSK)\n (Hash \\<lbrace>Agent C, Nonce NC3, Key KC2,\n Key cardSK, Pan (pan C), Nonce CardSecret\\<rbrace>)\\<rbrace>,\n Crypt (pubEK (CA i)) \\<lbrace>Key KC3, Pan (pan C), Nonce CardSecret\\<rbrace> \\<rbrace>\n \\<in> set evs6 |]\n==> Says (CA i) C\n (Crypt KC2\n \\<lbrace>sign (priSK (CA i))\n \\<lbrace>Agent C, Nonce NC3, Agent(CA i), Nonce NonceCCA\\<rbrace>,\n certC (pan C) cardSK (XOR(CardSecret,NonceCCA)) onlySig (priSK (CA i)),\n cert (CA i) (pubSK (CA i)) onlySig (priSK RCA)\\<rbrace>)\n # Notes (CA i) (Key cardSK)\n # evs6 \\<in> set_cr\""
] |
template
|
###lemma
?evs \<in> set_cr \<Longrightarrow> ?K \<notin> invKey ` pubEK ` range CA \<Longrightarrow> (Pan ?P \<in> analz (insert (Key ?K) (knows Spy ?evs))) = (Pan ?P \<in> analz (knows Spy ?evs))
###symbols
Message_SET.agent.Spy :::: agent
Event_SET.knows :::: agent \<Rightarrow> event list \<Rightarrow> msg set
Message_SET.msg.Key :::: nat \<Rightarrow> msg
Set.insert :::: 'a \<Rightarrow> 'a set \<Rightarrow> 'a set
Message_SET.analz :::: msg set \<Rightarrow> msg set
Message_SET.msg.Pan :::: nat \<Rightarrow> msg
Message_SET.agent.CA :::: nat \<Rightarrow> agent
Set.range :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b set
Public_SET.pubEK :::: agent \<Rightarrow> nat
Message_SET.invKey :::: nat \<Rightarrow> nat
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Set.not_member :::: 'a \<Rightarrow> 'a set \<Rightarrow> bool
Cardholder_Registration.set_cr :::: event list set
###defs
datatype
agent = CA nat | Cardholder nat | Merchant nat | PG nat | Spy
primrec knows :: "[agent, event list] \<Rightarrow> msg set"
where
knows_Nil:
"knows A [] = initState A"
| knows_Cons:
"knows A (ev # evs) =
(if A = Spy then
(case ev of
Says A' B X \<Rightarrow> insert X (knows Spy evs)
| Gets A' X \<Rightarrow> knows Spy evs
| Notes A' X \<Rightarrow>
if A' \<in> bad then insert X (knows Spy evs) else knows Spy evs)
else
(case ev of
Says A' B X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Gets A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Notes A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs))"
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Pan nat \<comment> \<open>Unguessable Primary Account Numbers (??)\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
definition insert :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set"
where insert_compr: "insert a B = {x. x = a \<or> x \<in> B}"
inductive_set
analz :: "msg set => msg set"
for H :: "msg set"
where
Inj [intro,simp] : "X \<in> H ==> X \<in> analz H"
| Fst: "\<lbrace>X,Y\<rbrace> \<in> analz H ==> X \<in> analz H"
| Snd: "\<lbrace>X,Y\<rbrace> \<in> analz H ==> Y \<in> analz H"
| Decrypt [dest]:
"[|Crypt K X \<in> analz H; Key(invKey K) \<in> analz H|] ==> X \<in> analz H"
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Pan nat \<comment> \<open>Unguessable Primary Account Numbers (??)\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
datatype
agent = CA nat | Cardholder nat | Merchant nat | PG nat | Spy
abbreviation range :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b set" \<comment> \<open>of function\<close>
where "range f \<equiv> f ` UNIV"
abbreviation "pubEK == publicKey False"
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
abbreviation not_member
where "not_member x A \<equiv> \<not> (x \<in> A)" \<comment> \<open>non-membership\<close>
inductive_set
set_cr :: "event list set"
where
Nil: \<comment> \<open>Initial trace is empty\<close>
"[] \<in> set_cr"
| Fake: \<comment> \<open>The spy MAY say anything he CAN say.\<close>
"[| evsf \<in> set_cr; X \<in> synth (analz (knows Spy evsf)) |]
==> Says Spy B X # evsf \<in> set_cr"
| Reception: \<comment> \<open>If A sends a message X to B, then B might receive it\<close>
"[| evsr \<in> set_cr; Says A B X \<in> set evsr |]
==> Gets B X # evsr \<in> set_cr"
| SET_CR1: \<comment> \<open>CardCInitReq: C initiates a run, sending a nonce to CCA\<close>
"[| evs1 \<in> set_cr; C = Cardholder k; Nonce NC1 \<notin> used evs1 |]
==> Says C (CA i) \<lbrace>Agent C, Nonce NC1\<rbrace> # evs1 \<in> set_cr"
| SET_CR2: \<comment> \<open>CardCInitRes: CA responds sending NC1 and its certificates\<close>
"[| evs2 \<in> set_cr;
Gets (CA i) \<lbrace>Agent C, Nonce NC1\<rbrace> \<in> set evs2 |]
==> Says (CA i) C
\<lbrace>sign (priSK (CA i)) \<lbrace>Agent C, Nonce NC1\<rbrace>,
cert (CA i) (pubEK (CA i)) onlyEnc (priSK RCA),
cert (CA i) (pubSK (CA i)) onlySig (priSK RCA)\<rbrace>
# evs2 \<in> set_cr"
| SET_CR3:
\<comment> \<open>RegFormReq: C sends his PAN and a new nonce to CA.
C verifies that
- nonce received is the same as that sent;
- certificates are signed by RCA;
- certificates are an encryption certificate (flag is onlyEnc) and a
signature certificate (flag is onlySig);
- certificates pertain to the CA that C contacted (this is done by
checking the signature).
C generates a fresh symmetric key KC1.
The point of encrypting \<^term>\<open>\<lbrace>Agent C, Nonce NC2, Hash (Pan(pan C))\<rbrace>\<close>
is not clear.\<close>
"[| evs3 \<in> set_cr; C = Cardholder k;
Nonce NC2 \<notin> used evs3;
Key KC1 \<notin> used evs3; KC1 \<in> symKeys;
Gets C \<lbrace>sign (invKey SKi) \<lbrace>Agent X, Nonce NC1\<rbrace>,
cert (CA i) EKi onlyEnc (priSK RCA),
cert (CA i) SKi onlySig (priSK RCA)\<rbrace>
\<in> set evs3;
Says C (CA i) \<lbrace>Agent C, Nonce NC1\<rbrace> \<in> set evs3|]
==> Says C (CA i) (EXHcrypt KC1 EKi \<lbrace>Agent C, Nonce NC2\<rbrace> (Pan(pan C)))
# Notes C \<lbrace>Key KC1, Agent (CA i)\<rbrace>
# evs3 \<in> set_cr"
| SET_CR4:
\<comment> \<open>RegFormRes:
CA responds sending NC2 back with a new nonce NCA, after checking that
- the digital envelope is correctly encrypted by \<^term>\<open>pubEK (CA i)\<close>
- the entire message is encrypted with the same key found inside the
envelope (here, KC1)\<close>
"[| evs4 \<in> set_cr;
Nonce NCA \<notin> used evs4; KC1 \<in> symKeys;
Gets (CA i) (EXHcrypt KC1 EKi \<lbrace>Agent C, Nonce NC2\<rbrace> (Pan(pan X)))
\<in> set evs4 |]
==> Says (CA i) C
\<lbrace>sign (priSK (CA i)) \<lbrace>Agent C, Nonce NC2, Nonce NCA\<rbrace>,
cert (CA i) (pubEK (CA i)) onlyEnc (priSK RCA),
cert (CA i) (pubSK (CA i)) onlySig (priSK RCA)\<rbrace>
# evs4 \<in> set_cr"
| SET_CR5:
\<comment> \<open>CertReq: C sends his PAN, a new nonce, its proposed public signature key
and its half of the secret value to CA.
We now assume that C has a fixed key pair, and he submits (pubSK C).
The protocol does not require this key to be fresh.
The encryption below is actually EncX.\<close>
"[| evs5 \<in> set_cr; C = Cardholder k;
Nonce NC3 \<notin> used evs5; Nonce CardSecret \<notin> used evs5; NC3\<noteq>CardSecret;
Key KC2 \<notin> used evs5; KC2 \<in> symKeys;
Key KC3 \<notin> used evs5; KC3 \<in> symKeys; KC2\<noteq>KC3;
Gets C \<lbrace>sign (invKey SKi) \<lbrace>Agent C, Nonce NC2, Nonce NCA\<rbrace>,
cert (CA i) EKi onlyEnc (priSK RCA),
cert (CA i) SKi onlySig (priSK RCA) \<rbrace>
\<in> set evs5;
Says C (CA i) (EXHcrypt KC1 EKi \<lbrace>Agent C, Nonce NC2\<rbrace> (Pan(pan C)))
\<in> set evs5 |]
==> Says C (CA i)
\<lbrace>Crypt KC3
\<lbrace>Agent C, Nonce NC3, Key KC2, Key (pubSK C),
Crypt (priSK C)
(Hash \<lbrace>Agent C, Nonce NC3, Key KC2,
Key (pubSK C), Pan (pan C), Nonce CardSecret\<rbrace>)\<rbrace>,
Crypt EKi \<lbrace>Key KC3, Pan (pan C), Nonce CardSecret\<rbrace> \<rbrace>
# Notes C \<lbrace>Key KC2, Agent (CA i)\<rbrace>
# Notes C \<lbrace>Key KC3, Agent (CA i)\<rbrace>
# evs5 \<in> set_cr"
\<comment> \<open>CertRes: CA responds sending NC3 back with its half of the secret value,
its signature certificate and the new cardholder signature
certificate. CA checks to have never certified the key proposed by C.
NOTE: In Merchant Registration, the corresponding rule (4)
uses the "sign" primitive. The encryption below is actually \<^term>\<open>EncK\<close>,
which is just \<^term>\<open>Crypt K (sign SK X)\<close>.\<close>
| SET_CR6:
"[| evs6 \<in> set_cr;
Nonce NonceCCA \<notin> used evs6;
KC2 \<in> symKeys; KC3 \<in> symKeys; cardSK \<notin> symKeys;
Notes (CA i) (Key cardSK) \<notin> set evs6;
Gets (CA i)
\<lbrace>Crypt KC3 \<lbrace>Agent C, Nonce NC3, Key KC2, Key cardSK,
Crypt (invKey cardSK)
(Hash \<lbrace>Agent C, Nonce NC3, Key KC2,
Key cardSK, Pan (pan C), Nonce CardSecret\<rbrace>)\<rbrace>,
Crypt (pubEK (CA i)) \<lbrace>Key KC3, Pan (pan C), Nonce CardSecret\<rbrace> \<rbrace>
\<in> set evs6 |]
==> Says (CA i) C
(Crypt KC2
\<lbrace>sign (priSK (CA i))
\<lbrace>Agent C, Nonce NC3, Agent(CA i), Nonce NonceCCA\<rbrace>,
certC (pan C) cardSK (XOR(CardSecret,NonceCCA)) onlySig (priSK (CA i)),
cert (CA i) (pubSK (CA i)) onlySig (priSK RCA)\<rbrace>)
# Notes (CA i) (Key cardSK)
# evs6 \<in> set_cr"
|
###output
\<lbrakk>x_1 \<in> ?H1; ?H2 x_2 (?H3 ?H4 (?H3 ?H5 (?H6 ?H7)))\<rbrakk> \<Longrightarrow> (?H8 x_3 \<in> ?H9 (?H10 (?H11 x_2) (?H12 ?H13 x_1))) = (?H8 x_3 \<in> ?H9 (?H12 ?H13 x_1))###end
|
Bali/WellType
|
WellType.is_acc_class_is_accessible
|
lemma is_acc_class_is_accessible:
"is_acc_class G P C \<Longrightarrow> G\<turnstile>(Class C) accessible_in P"
|
is_acc_class ?G ?P ?C \<Longrightarrow> ?G \<turnstile> Class ?C accessible_in ?P
|
?H1 x_1 x_2 x_3 \<Longrightarrow> ?H2 x_1 (?H3 x_3) x_2
|
[
"Type.Class",
"DeclConcepts.accessible_in",
"DeclConcepts.is_acc_class"
] |
[
"qtname \\<Rightarrow> ty",
"prog \\<Rightarrow> ty \\<Rightarrow> pname \\<Rightarrow> bool",
"prog \\<Rightarrow> pname \\<Rightarrow> qtname \\<Rightarrow> bool"
] |
[
"abbreviation \"Class C == RefT (ClassT C)\"",
"primrec\n accessible_in :: \"prog \\<Rightarrow> ty \\<Rightarrow> pname \\<Rightarrow> bool\" (\"_ \\<turnstile> _ accessible'_in _\" [61,61,61] 60) and\n rt_accessible_in :: \"prog \\<Rightarrow> ref_ty \\<Rightarrow> pname \\<Rightarrow> bool\" (\"_ \\<turnstile> _ accessible'_in'' _\" [61,61,61] 60)\nwhere\n \"G\\<turnstile>(PrimT p) accessible_in pack = True\"\n| accessible_in_RefT_simp:\n \"G\\<turnstile>(RefT r) accessible_in pack = G\\<turnstile>r accessible_in' pack\"\n| \"G\\<turnstile>(NullT) accessible_in' pack = True\"\n| \"G\\<turnstile>(IfaceT I) accessible_in' pack = ((pid I = pack) \\<or> is_public G I)\"\n| \"G\\<turnstile>(ClassT C) accessible_in' pack = ((pid C = pack) \\<or> is_public G C)\"\n| \"G\\<turnstile>(ArrayT ty) accessible_in' pack = G\\<turnstile>ty accessible_in pack\"",
"definition\n is_acc_class :: \"prog \\<Rightarrow> pname \\<Rightarrow> qtname \\<Rightarrow> bool\"\n where \"is_acc_class G P C = (is_class G C \\<and> G\\<turnstile>(Class C) accessible_in P)\""
] |
template
|
###lemma
is_acc_class ?G ?P ?C \<Longrightarrow> ?G \<turnstile> Class ?C accessible_in ?P
###symbols
Type.Class :::: qtname \<Rightarrow> ty
DeclConcepts.accessible_in :::: prog \<Rightarrow> ty \<Rightarrow> pname \<Rightarrow> bool
DeclConcepts.is_acc_class :::: prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> bool
###defs
abbreviation "Class C == RefT (ClassT C)"
primrec
accessible_in :: "prog \<Rightarrow> ty \<Rightarrow> pname \<Rightarrow> bool" ("_ \<turnstile> _ accessible'_in _" [61,61,61] 60) and
rt_accessible_in :: "prog \<Rightarrow> ref_ty \<Rightarrow> pname \<Rightarrow> bool" ("_ \<turnstile> _ accessible'_in'' _" [61,61,61] 60)
where
"G\<turnstile>(PrimT p) accessible_in pack = True"
| accessible_in_RefT_simp:
"G\<turnstile>(RefT r) accessible_in pack = G\<turnstile>r accessible_in' pack"
| "G\<turnstile>(NullT) accessible_in' pack = True"
| "G\<turnstile>(IfaceT I) accessible_in' pack = ((pid I = pack) \<or> is_public G I)"
| "G\<turnstile>(ClassT C) accessible_in' pack = ((pid C = pack) \<or> is_public G C)"
| "G\<turnstile>(ArrayT ty) accessible_in' pack = G\<turnstile>ty accessible_in pack"
definition
is_acc_class :: "prog \<Rightarrow> pname \<Rightarrow> qtname \<Rightarrow> bool"
where "is_acc_class G P C = (is_class G C \<and> G\<turnstile>(Class C) accessible_in P)"
|
###output
?H1 x_1 x_2 x_3 \<Longrightarrow> ?H2 x_1 (?H3 x_3) x_2###end
|
Analysis/Linear_Algebra
|
Linear_Algebra.abs_triangle_half_r
|
lemma abs_triangle_half_r:
fixes y :: "'a::linordered_field"
shows "abs (y - x1) < e/2 \<Longrightarrow> abs (y - x2) < e/2 \<Longrightarrow> abs (x1 - x2) < e"
|
\<bar> ?y - ?x1.0\<bar> < ?e / (2:: ?'a) \<Longrightarrow> \<bar> ?y - ?x2.0\<bar> < ?e / (2:: ?'a) \<Longrightarrow> \<bar> ?x1.0 - ?x2.0\<bar> < ?e
|
\<lbrakk> ?H1 (?H2 x_1 x_2) < ?H3 x_3 (?H4 (?H5 ?H6)); ?H1 (?H2 x_1 x_4) < ?H3 x_3 (?H4 (?H5 ?H6))\<rbrakk> \<Longrightarrow> ?H1 (?H2 x_2 x_4) < x_3
|
[
"Num.num.One",
"Num.num.Bit0",
"Num.numeral_class.numeral",
"Fields.inverse_class.inverse_divide",
"Groups.minus_class.minus",
"Groups.abs_class.abs"
] |
[
"num",
"num \\<Rightarrow> num",
"num \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a"
] |
[
"datatype num = One | Bit0 num | Bit1 num",
"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 inverse = divide +\n fixes inverse :: \"'a \\<Rightarrow> 'a\"\nbegin",
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"class abs =\n fixes abs :: \"'a \\<Rightarrow> 'a\" (\"\\<bar>_\\<bar>\")"
] |
template
|
###lemma
\<bar> ?y - ?x1.0\<bar> < ?e / (2:: ?'a) \<Longrightarrow> \<bar> ?y - ?x2.0\<bar> < ?e / (2:: ?'a) \<Longrightarrow> \<bar> ?x1.0 - ?x2.0\<bar> < ?e
###symbols
Num.num.One :::: num
Num.num.Bit0 :::: num \<Rightarrow> num
Num.numeral_class.numeral :::: num \<Rightarrow> 'a
Fields.inverse_class.inverse_divide :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Groups.abs_class.abs :::: 'a \<Rightarrow> 'a
###defs
datatype num = One | Bit0 num | Bit1 num
datatype num = One | Bit0 num | Bit1 num
primrec numeral :: "num \<Rightarrow> 'a"
where
numeral_One: "numeral One = 1"
| numeral_Bit0: "numeral (Bit0 n) = numeral n + numeral n"
| numeral_Bit1: "numeral (Bit1 n) = numeral n + numeral n + 1"
class inverse = divide +
fixes inverse :: "'a \<Rightarrow> 'a"
begin
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
class abs =
fixes abs :: "'a \<Rightarrow> 'a" ("\<bar>_\<bar>")
|
###output
\<lbrakk> ?H1 (?H2 x_1 x_2) < ?H3 x_3 (?H4 (?H5 ?H6)); ?H1 (?H2 x_1 x_4) < ?H3 x_3 (?H4 (?H5 ?H6))\<rbrakk> \<Longrightarrow> ?H1 (?H2 x_2 x_4) < x_3###end
|
Homology/Homology_Groups
|
Homology_Groups.singular_relboundary_ss
|
lemma singular_relboundary_ss:
"singular_relboundary p X S x \<Longrightarrow> Poly_Mapping.keys x \<subseteq> singular_simplex_set p X"
|
singular_relboundary ?p ?X ?S ?x \<Longrightarrow> Poly_Mapping.keys ?x \<subseteq> singular_simplex_set ?p ?X
|
?H1 x_1 x_2 x_3 x_4 \<Longrightarrow> ?H2 (?H3 x_4) (?H4 x_1 x_2)
|
[
"Simplices.singular_simplex_set",
"Poly_Mapping.keys",
"Set.subset_eq",
"Simplices.singular_relboundary"
] |
[
"nat \\<Rightarrow> 'a topology \\<Rightarrow> ((nat \\<Rightarrow> real) \\<Rightarrow> 'a) set",
"('a \\<Rightarrow>\\<^sub>0 'b) \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool",
"nat \\<Rightarrow> 'a topology \\<Rightarrow> 'a set \\<Rightarrow> (((nat \\<Rightarrow> real) \\<Rightarrow> 'a) \\<Rightarrow>\\<^sub>0 int) \\<Rightarrow> bool"
] |
[
"abbreviation singular_simplex_set :: \"nat \\<Rightarrow> 'a topology \\<Rightarrow> ((nat \\<Rightarrow> real) \\<Rightarrow> 'a) set\" where\n \"singular_simplex_set p X \\<equiv> Collect (singular_simplex p X)\"",
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\"",
"definition singular_relboundary :: \"nat \\<Rightarrow> 'a topology \\<Rightarrow> 'a set \\<Rightarrow> ('a chain) \\<Rightarrow> bool\"\n where\n \"singular_relboundary p X S \\<equiv>\n \\<lambda>c. \\<exists>d. singular_chain (Suc p) X d \\<and> (chain_boundary (Suc p) d, c) \\<in> (mod_subset p (subtopology X S))\""
] |
template
|
###lemma
singular_relboundary ?p ?X ?S ?x \<Longrightarrow> Poly_Mapping.keys ?x \<subseteq> singular_simplex_set ?p ?X
###symbols
Simplices.singular_simplex_set :::: nat \<Rightarrow> 'a topology \<Rightarrow> ((nat \<Rightarrow> real) \<Rightarrow> 'a) set
Poly_Mapping.keys :::: ('a \<Rightarrow>\<^sub>0 'b) \<Rightarrow> 'a set
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
Simplices.singular_relboundary :::: nat \<Rightarrow> 'a topology \<Rightarrow> 'a set \<Rightarrow> (((nat \<Rightarrow> real) \<Rightarrow> 'a) \<Rightarrow>\<^sub>0 int) \<Rightarrow> bool
###defs
abbreviation singular_simplex_set :: "nat \<Rightarrow> 'a topology \<Rightarrow> ((nat \<Rightarrow> real) \<Rightarrow> 'a) set" where
"singular_simplex_set p X \<equiv> Collect (singular_simplex p X)"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
definition singular_relboundary :: "nat \<Rightarrow> 'a topology \<Rightarrow> 'a set \<Rightarrow> ('a chain) \<Rightarrow> bool"
where
"singular_relboundary p X S \<equiv>
\<lambda>c. \<exists>d. singular_chain (Suc p) X d \<and> (chain_boundary (Suc p) d, c) \<in> (mod_subset p (subtopology X S))"
|
###output
?H1 x_1 x_2 x_3 x_4 \<Longrightarrow> ?H2 (?H3 x_4) (?H4 x_1 x_2)###end
|
Probability/Probability
|
Probability_Measure.subdensity_real
| null |
?T \<in> ?P \<rightarrow>\<^sub>M ?Q \<Longrightarrow> distributed ?M ?P ?X (\<lambda>x. ennreal (?f x)) \<Longrightarrow> distributed ?M ?Q ?Y (\<lambda>x. ennreal (?g x)) \<Longrightarrow> ?Y = ?T \<circ> ?X \<Longrightarrow> AE x in ?P. 0 \<le> ?g (?T x) \<Longrightarrow> AE x in ?P. 0 \<le> ?f x \<Longrightarrow> AE x in ?P. ?g (?T x) = 0 \<longrightarrow> ?f x = 0
|
\<lbrakk>x_1 \<in> ?H1 x_2 x_3; ?H2 x_4 x_2 x_5 (\<lambda>y_0. ?H3 (x_6 y_0)); ?H2 x_4 x_3 x_7 (\<lambda>y_1. ?H3 (x_8 y_1)); x_7 = ?H4 x_1 x_5; ?H5 x_2 (\<lambda>y_2. ?H6 \<le> x_8 (x_1 y_2)); ?H5 x_2 (\<lambda>y_3. ?H6 \<le> x_6 y_3)\<rbrakk> \<Longrightarrow> ?H5 x_2 (\<lambda>y_4. x_8 (x_1 y_4) = ?H6 \<longrightarrow> x_6 y_4 = ?H6)
|
[
"Groups.zero_class.zero",
"Measure_Space.almost_everywhere",
"Fun.comp",
"Extended_Nonnegative_Real.ennreal",
"Probability_Measure.distributed",
"Sigma_Algebra.measurable"
] |
[
"'a",
"'a measure \\<Rightarrow> ('a \\<Rightarrow> bool) \\<Rightarrow> bool",
"('a \\<Rightarrow> 'b) \\<Rightarrow> ('c \\<Rightarrow> 'a) \\<Rightarrow> 'c \\<Rightarrow> 'b",
"real \\<Rightarrow> ennreal",
"'a measure \\<Rightarrow> 'b measure \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> ('b \\<Rightarrow> ennreal) \\<Rightarrow> bool",
"'a measure \\<Rightarrow> 'b measure \\<Rightarrow> ('a \\<Rightarrow> 'b) set"
] |
[
"class zero =\n fixes zero :: 'a (\"0\")",
"abbreviation almost_everywhere :: \"'a measure \\<Rightarrow> ('a \\<Rightarrow> bool) \\<Rightarrow> bool\" where\n \"almost_everywhere M P \\<equiv> eventually P (ae_filter M)\"",
"definition comp :: \"('b \\<Rightarrow> 'c) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> 'a \\<Rightarrow> 'c\" (infixl \"\\<circ>\" 55)\n where \"f \\<circ> g = (\\<lambda>x. f (g x))\"",
"typedef ennreal = \"{x :: ereal. 0 \\<le> x}\"\n morphisms enn2ereal e2ennreal'",
"definition distributed :: \"'a measure \\<Rightarrow> 'b measure \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> ('b \\<Rightarrow> ennreal) \\<Rightarrow> bool\"\nwhere\n \"distributed M N X f \\<longleftrightarrow>\n distr M N X = density N f \\<and> f \\<in> borel_measurable N \\<and> X \\<in> measurable M N\""
] |
template
|
###lemma
?T \<in> ?P \<rightarrow>\<^sub>M ?Q \<Longrightarrow> distributed ?M ?P ?X (\<lambda>x. ennreal (?f x)) \<Longrightarrow> distributed ?M ?Q ?Y (\<lambda>x. ennreal (?g x)) \<Longrightarrow> ?Y = ?T \<circ> ?X \<Longrightarrow> AE x in ?P. 0 \<le> ?g (?T x) \<Longrightarrow> AE x in ?P. 0 \<le> ?f x \<Longrightarrow> AE x in ?P. ?g (?T x) = 0 \<longrightarrow> ?f x = 0
###symbols
Groups.zero_class.zero :::: 'a
Measure_Space.almost_everywhere :::: 'a measure \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool
Fun.comp :::: ('a \<Rightarrow> 'b) \<Rightarrow> ('c \<Rightarrow> 'a) \<Rightarrow> 'c \<Rightarrow> 'b
Extended_Nonnegative_Real.ennreal :::: real \<Rightarrow> ennreal
Probability_Measure.distributed :::: 'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> ennreal) \<Rightarrow> bool
Sigma_Algebra.measurable :::: 'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) set
###defs
class zero =
fixes zero :: 'a ("0")
abbreviation almost_everywhere :: "'a measure \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where
"almost_everywhere M P \<equiv> eventually P (ae_filter M)"
definition comp :: "('b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "\<circ>" 55)
where "f \<circ> g = (\<lambda>x. f (g x))"
typedef ennreal = "{x :: ereal. 0 \<le> x}"
morphisms enn2ereal e2ennreal'
definition distributed :: "'a measure \<Rightarrow> 'b measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> ennreal) \<Rightarrow> bool"
where
"distributed M N X f \<longleftrightarrow>
distr M N X = density N f \<and> f \<in> borel_measurable N \<and> X \<in> measurable M N"
|
###output
\<lbrakk>x_1 \<in> ?H1 x_2 x_3; ?H2 x_4 x_2 x_5 (\<lambda>y_0. ?H3 (x_6 y_0)); ?H2 x_4 x_3 x_7 (\<lambda>y_1. ?H3 (x_8 y_1)); x_7 = ?H4 x_1 x_5; ?H5 x_2 (\<lambda>y_2. ?H6 \<le> x_8 (x_1 y_2)); ?H5 x_2 (\<lambda>y_3. ?H6 \<le> x_6 y_3)\<rbrakk> \<Longrightarrow> ?H5 x_2 (\<lambda>y_4. x_8 (x_1 y_4) = ?H6 \<longrightarrow> x_6 y_4 = ?H6)###end
|
HOLCF/FOCUS/Buffer_adm
|
Buffer_adm.adm_BufAC
|
lemma adm_BufAC: "f \<in> BufEq \<Longrightarrow> adm (\<lambda>s. s \<in> BufAC_Asm \<longrightarrow> (s, f\<cdot>s) \<in> BufAC_Cmt)"
|
?f \<in> BufEq \<Longrightarrow> adm (\<lambda>s. s \<in> BufAC_Asm \<longrightarrow> (s, ?f\<cdot>s) \<in> BufAC_Cmt)
|
x_1 \<in> ?H1 \<Longrightarrow> ?H2 (\<lambda>y_0. y_0 \<in> ?H3 \<longrightarrow> (y_0, ?H4 x_1 y_0) \<in> ?H5)
|
[
"Buffer.BufAC_Cmt",
"Cfun.cfun.Rep_cfun",
"Buffer.BufAC_Asm",
"Adm.adm",
"Buffer.BufEq"
] |
[
"(M lift stream \\<times> D lift stream) set",
"('a \\<rightarrow> 'b) \\<Rightarrow> 'a \\<Rightarrow> 'b",
"M lift stream set",
"('a \\<Rightarrow> bool) \\<Rightarrow> bool",
"(M lift stream \\<rightarrow> D lift stream) set"
] |
[
"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))\""
] |
template
|
###lemma
?f \<in> BufEq \<Longrightarrow> adm (\<lambda>s. s \<in> BufAC_Asm \<longrightarrow> (s, ?f\<cdot>s) \<in> BufAC_Cmt)
###symbols
Buffer.BufAC_Cmt :::: (M lift stream \<times> D lift stream) set
Cfun.cfun.Rep_cfun :::: ('a \<rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b
Buffer.BufAC_Asm :::: M lift stream set
Adm.adm :::: ('a \<Rightarrow> bool) \<Rightarrow> bool
Buffer.BufEq :::: (M lift stream \<rightarrow> D lift stream) set
###defs
definition adm :: "('a::cpo \<Rightarrow> bool) \<Rightarrow> bool"
where "adm P \<longleftrightarrow> (\<forall>Y. chain Y \<longrightarrow> (\<forall>i. P (Y i)) \<longrightarrow> P (\<Squnion>i. Y i))"
|
###output
x_1 \<in> ?H1 \<Longrightarrow> ?H2 (\<lambda>y_0. y_0 \<in> ?H3 \<longrightarrow> (y_0, ?H4 x_1 y_0) \<in> ?H5)###end
|
Algebra/Algebra
|
Algebraic_Closure.union_ring_carrier
| null |
carrier (union_ring ?C) = \<Union> (carrier ` ?C)
|
?H1 (?H2 x_1) = ?H3 (?H4 ?H1 x_1)
|
[
"Set.image",
"Complete_Lattices.Union",
"Algebraic_Closure.union_ring",
"Congruence.partial_object.carrier"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a set set \\<Rightarrow> 'a set",
"('a, 'b) ring_scheme set \\<Rightarrow> 'a ring",
"('a, 'b) partial_object_scheme \\<Rightarrow> 'a set"
] |
[
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"abbreviation Union :: \"'a set set \\<Rightarrow> 'a set\" (\"\\<Union>\")\n where \"\\<Union>S \\<equiv> \\<Squnion>S\"",
"definition union_ring :: \"(('a, 'c) ring_scheme) set \\<Rightarrow> 'a ring\"\n where \"union_ring C = \n \\<lparr> carrier = (\\<Union>(carrier ` C)),\n monoid.mult = (\\<lambda>a b. (monoid.mult (SOME R. R \\<in> C \\<and> a \\<in> carrier R \\<and> b \\<in> carrier R) a b)),\n one = one (SOME R. R \\<in> C),\n zero = zero (SOME R. R \\<in> C),\n add = (\\<lambda>a b. (add (SOME R. R \\<in> C \\<and> a \\<in> carrier R \\<and> b \\<in> carrier R) a b)) \\<rparr>\""
] |
template
|
###lemma
carrier (union_ring ?C) = \<Union> (carrier ` ?C)
###symbols
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Complete_Lattices.Union :::: 'a set set \<Rightarrow> 'a set
Algebraic_Closure.union_ring :::: ('a, 'b) ring_scheme set \<Rightarrow> 'a ring
Congruence.partial_object.carrier :::: ('a, 'b) partial_object_scheme \<Rightarrow> 'a set
###defs
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
abbreviation Union :: "'a set set \<Rightarrow> 'a set" ("\<Union>")
where "\<Union>S \<equiv> \<Squnion>S"
definition union_ring :: "(('a, 'c) ring_scheme) set \<Rightarrow> 'a ring"
where "union_ring C =
\<lparr> carrier = (\<Union>(carrier ` C)),
monoid.mult = (\<lambda>a b. (monoid.mult (SOME R. R \<in> C \<and> a \<in> carrier R \<and> b \<in> carrier R) a b)),
one = one (SOME R. R \<in> C),
zero = zero (SOME R. R \<in> C),
add = (\<lambda>a b. (add (SOME R. R \<in> C \<and> a \<in> carrier R \<and> b \<in> carrier R) a b)) \<rparr>"
|
###output
?H1 (?H2 x_1) = ?H3 (?H4 ?H1 x_1)###end
|
SPARK/Examples/RIPEMD-160/F
|
Filter.eventually_filtercomap
| null |
eventually ?P (filtercomap ?f ?F) = (\<exists>Q. eventually Q ?F \<and> (\<forall>x. Q (?f x) \<longrightarrow> ?P x))
|
?H1 x_1 (?H2 x_2 x_3) = (\<exists>y_0. ?H1 y_0 x_3 \<and> (\<forall>y_1. y_0 (x_2 y_1) \<longrightarrow> x_1 y_1))
|
[
"Filter.filtercomap",
"Filter.eventually"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b filter \\<Rightarrow> 'a filter",
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a filter \\<Rightarrow> bool"
] |
[
"definition filtercomap :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b filter \\<Rightarrow> 'a filter\" where\n \"filtercomap f F = Abs_filter (\\<lambda>P. \\<exists>Q. eventually Q F \\<and> (\\<forall>x. Q (f x) \\<longrightarrow> P x))\"",
"definition eventually :: \"('a \\<Rightarrow> bool) \\<Rightarrow> 'a filter \\<Rightarrow> bool\"\n where \"eventually P F \\<longleftrightarrow> Rep_filter F P\""
] |
template
|
###lemma
eventually ?P (filtercomap ?f ?F) = (\<exists>Q. eventually Q ?F \<and> (\<forall>x. Q (?f x) \<longrightarrow> ?P x))
###symbols
Filter.filtercomap :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b filter \<Rightarrow> 'a filter
Filter.eventually :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a filter \<Rightarrow> bool
###defs
definition filtercomap :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b filter \<Rightarrow> 'a filter" where
"filtercomap f F = Abs_filter (\<lambda>P. \<exists>Q. eventually Q F \<and> (\<forall>x. Q (f x) \<longrightarrow> P x))"
definition eventually :: "('a \<Rightarrow> bool) \<Rightarrow> 'a filter \<Rightarrow> bool"
where "eventually P F \<longleftrightarrow> Rep_filter F P"
|
###output
?H1 x_1 (?H2 x_2 x_3) = (\<exists>y_0. ?H1 y_0 x_3 \<and> (\<forall>y_1. y_0 (x_2 y_1) \<longrightarrow> x_1 y_1))###end
|
Nonstandard_Analysis/Star
|
Star.STAR_starfun_rabs_add_minus
|
lemma STAR_starfun_rabs_add_minus:
"*s* {x. \<bar>f x + - y\<bar> < r} = {x. \<bar>( *f* f) x + -star_of y\<bar> < star_of r}"
|
*s* {x. \<bar> ?f x + - ?y\<bar> < ?r} = {x. \<bar>(*f* ?f) x + - star_of ?y\<bar> < star_of ?r}
|
?H1 (?H2 (\<lambda>y_0. ?H3 (?H4 (x_1 y_0) (?H5 x_2)) < x_3)) = ?H2 (\<lambda>y_1. ?H3 (?H4 (?H6 x_1 y_1) (?H5 (?H7 x_2))) < ?H7 x_3)
|
[
"StarDef.star_of",
"StarDef.starfun",
"Groups.uminus_class.uminus",
"Groups.plus_class.plus",
"Groups.abs_class.abs",
"Set.Collect",
"StarDef.starset"
] |
[
"'a \\<Rightarrow> 'a star",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a star \\<Rightarrow> 'b star",
"'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a",
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a star set"
] |
[
"definition star_of :: \"'a \\<Rightarrow> 'a star\"\n where \"star_of x \\<equiv> star_n (\\<lambda>n. x)\"",
"definition starfun :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a star \\<Rightarrow> 'b star\" (\\<open>*f* _\\<close> [80] 80)\n where \"starfun f \\<equiv> \\<lambda>x. star_of f \\<star> x\"",
"class uminus =\n fixes uminus :: \"'a \\<Rightarrow> 'a\" (\"- _\" [81] 80)",
"class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)",
"class abs =\n fixes abs :: \"'a \\<Rightarrow> 'a\" (\"\\<bar>_\\<bar>\")",
"definition starset :: \"'a set \\<Rightarrow> 'a star set\" (\\<open>*s* _\\<close> [80] 80)\n where \"starset A = Iset (star_of A)\""
] |
template
|
###lemma
*s* {x. \<bar> ?f x + - ?y\<bar> < ?r} = {x. \<bar>(*f* ?f) x + - star_of ?y\<bar> < star_of ?r}
###symbols
StarDef.star_of :::: 'a \<Rightarrow> 'a star
StarDef.starfun :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a star \<Rightarrow> 'b star
Groups.uminus_class.uminus :::: 'a \<Rightarrow> 'a
Groups.plus_class.plus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Groups.abs_class.abs :::: 'a \<Rightarrow> 'a
Set.Collect :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a set
StarDef.starset :::: 'a set \<Rightarrow> 'a star set
###defs
definition star_of :: "'a \<Rightarrow> 'a star"
where "star_of x \<equiv> star_n (\<lambda>n. x)"
definition starfun :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a star \<Rightarrow> 'b star" (\<open>*f* _\<close> [80] 80)
where "starfun f \<equiv> \<lambda>x. star_of f \<star> x"
class uminus =
fixes uminus :: "'a \<Rightarrow> 'a" ("- _" [81] 80)
class plus =
fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "+" 65)
class abs =
fixes abs :: "'a \<Rightarrow> 'a" ("\<bar>_\<bar>")
definition starset :: "'a set \<Rightarrow> 'a star set" (\<open>*s* _\<close> [80] 80)
where "starset A = Iset (star_of A)"
|
###output
?H1 (?H2 (\<lambda>y_0. ?H3 (?H4 (x_1 y_0) (?H5 x_2)) < x_3)) = ?H2 (\<lambda>y_1. ?H3 (?H4 (?H6 x_1 y_1) (?H5 (?H7 x_2))) < ?H7 x_3)###end
|
Probability/SPMF
|
SPMF.emeasure_restrict_spmf
|
lemma emeasure_restrict_spmf [simp]: "emeasure (measure_spmf (p \<upharpoonleft> A)) X = emeasure (measure_spmf p) (X \<inter> A)"
|
emeasure (measure_spmf (?p \<upharpoonleft> ?A)) ?X = emeasure (measure_spmf ?p) (?X \<inter> ?A)
|
?H1 (?H2 (?H3 x_1 x_2)) x_3 = ?H1 (?H2 x_1) (?H4 x_3 x_2)
|
[
"Set.inter",
"SPMF.restrict_spmf",
"SPMF.measure_spmf",
"Sigma_Algebra.emeasure"
] |
[
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a spmf \\<Rightarrow> 'a set \\<Rightarrow> 'a spmf",
"'a spmf \\<Rightarrow> 'a measure",
"'a measure \\<Rightarrow> 'a set \\<Rightarrow> ennreal"
] |
[
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\"",
"definition restrict_spmf :: \"'a spmf \\<Rightarrow> 'a set \\<Rightarrow> 'a spmf\" (infixl \"\\<upharpoonleft>\" 110)\n where \"p \\<upharpoonleft> A = map_pmf (\\<lambda>x. x \\<bind> (\\<lambda>y. if y \\<in> A then Some y else None)) p\"",
"definition measure_spmf :: \"'a spmf \\<Rightarrow> 'a measure\"\n where \"measure_spmf p = distr (restrict_space (measure_pmf p) (range Some)) (count_space UNIV) the\""
] |
template
|
###lemma
emeasure (measure_spmf (?p \<upharpoonleft> ?A)) ?X = emeasure (measure_spmf ?p) (?X \<inter> ?A)
###symbols
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
SPMF.restrict_spmf :::: 'a spmf \<Rightarrow> 'a set \<Rightarrow> 'a spmf
SPMF.measure_spmf :::: 'a spmf \<Rightarrow> 'a measure
Sigma_Algebra.emeasure :::: 'a measure \<Rightarrow> 'a set \<Rightarrow> ennreal
###defs
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
definition restrict_spmf :: "'a spmf \<Rightarrow> 'a set \<Rightarrow> 'a spmf" (infixl "\<upharpoonleft>" 110)
where "p \<upharpoonleft> A = map_pmf (\<lambda>x. x \<bind> (\<lambda>y. if y \<in> A then Some y else None)) p"
definition measure_spmf :: "'a spmf \<Rightarrow> 'a measure"
where "measure_spmf p = distr (restrict_space (measure_pmf p) (range Some)) (count_space UNIV) the"
|
###output
?H1 (?H2 (?H3 x_1 x_2)) x_3 = ?H1 (?H2 x_1) (?H4 x_3 x_2)###end
|
Decision_Procs/Parametric_Ferrante_Rackoff
|
Parametric_Ferrante_Rackoff.simptm_nb
|
lemma simptm_nb[simp]: "tmbound n t \<Longrightarrow> tmbound n (simptm t)"
|
tmbound ?n ?t \<Longrightarrow> tmbound ?n (simptm ?t)
|
?H1 x_1 x_2 \<Longrightarrow> ?H1 x_1 (?H2 x_2)
|
[
"Parametric_Ferrante_Rackoff.simptm",
"Parametric_Ferrante_Rackoff.tmbound"
] |
[
"tm \\<Rightarrow> tm",
"nat \\<Rightarrow> tm \\<Rightarrow> bool"
] |
[
"fun simptm :: \"tm \\<Rightarrow> tm\"\n where\n \"simptm (CP j) = CP (polynate j)\"\n | \"simptm (Bound n) = CNP n (1)\\<^sub>p (CP 0\\<^sub>p)\"\n | \"simptm (Neg t) = tmneg (simptm t)\"\n | \"simptm (Add t s) = tmadd (simptm t) (simptm s)\"\n | \"simptm (Sub t s) = tmsub (simptm t) (simptm s)\"\n | \"simptm (Mul i t) =\n (let i' = polynate i in if i' = 0\\<^sub>p then CP 0\\<^sub>p else tmmul (simptm t) i')\"\n | \"simptm (CNP n c t) =\n (let c' = polynate c in if c' = 0\\<^sub>p then simptm t else tmadd (CNP n c' (CP 0\\<^sub>p)) (simptm t))\"",
"primrec tmbound :: \"nat \\<Rightarrow> tm \\<Rightarrow> bool\" \\<comment> \\<open>a \\<open>tm\\<close> is \\<^emph>\\<open>independent\\<close> of Bound n\\<close>\n where\n \"tmbound n (CP c) = True\"\n | \"tmbound n (Bound m) = (n \\<noteq> m)\"\n | \"tmbound n (CNP m c a) = (n\\<noteq>m \\<and> tmbound n a)\"\n | \"tmbound n (Neg a) = tmbound n a\"\n | \"tmbound n (Add a b) = (tmbound n a \\<and> tmbound n b)\"\n | \"tmbound n (Sub a b) = (tmbound n a \\<and> tmbound n b)\"\n | \"tmbound n (Mul i a) = tmbound n a\""
] |
template
|
###lemma
tmbound ?n ?t \<Longrightarrow> tmbound ?n (simptm ?t)
###symbols
Parametric_Ferrante_Rackoff.simptm :::: tm \<Rightarrow> tm
Parametric_Ferrante_Rackoff.tmbound :::: nat \<Rightarrow> tm \<Rightarrow> bool
###defs
fun simptm :: "tm \<Rightarrow> tm"
where
"simptm (CP j) = CP (polynate j)"
| "simptm (Bound n) = CNP n (1)\<^sub>p (CP 0\<^sub>p)"
| "simptm (Neg t) = tmneg (simptm t)"
| "simptm (Add t s) = tmadd (simptm t) (simptm s)"
| "simptm (Sub t s) = tmsub (simptm t) (simptm s)"
| "simptm (Mul i t) =
(let i' = polynate i in if i' = 0\<^sub>p then CP 0\<^sub>p else tmmul (simptm t) i')"
| "simptm (CNP n c t) =
(let c' = polynate c in if c' = 0\<^sub>p then simptm t else tmadd (CNP n c' (CP 0\<^sub>p)) (simptm t))"
primrec tmbound :: "nat \<Rightarrow> tm \<Rightarrow> bool" \<comment> \<open>a \<open>tm\<close> is \<^emph>\<open>independent\<close> of Bound n\<close>
where
"tmbound n (CP c) = True"
| "tmbound n (Bound m) = (n \<noteq> m)"
| "tmbound n (CNP m c a) = (n\<noteq>m \<and> tmbound n a)"
| "tmbound n (Neg a) = tmbound n a"
| "tmbound n (Add a b) = (tmbound n a \<and> tmbound n b)"
| "tmbound n (Sub a b) = (tmbound n a \<and> tmbound n b)"
| "tmbound n (Mul i a) = tmbound n a"
|
###output
?H1 x_1 x_2 \<Longrightarrow> ?H1 x_1 (?H2 x_2)###end
|
Library/Word
|
Word.word_and_le2
| null |
and ?a ?y \<le> ?a
|
?H1 x_1 x_2 \<le> x_1
|
[
"Bit_Operations.semiring_bit_operations_class.and"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a"
] |
[
"class semiring_bit_operations = semiring_bits +\n fixes \"and\" :: \\<open>'a \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close> (infixr \\<open>AND\\<close> 64)\n and or :: \\<open>'a \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close> (infixr \\<open>OR\\<close> 59)\n and xor :: \\<open>'a \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close> (infixr \\<open>XOR\\<close> 59)\n and mask :: \\<open>nat \\<Rightarrow> 'a\\<close>\n and set_bit :: \\<open>nat \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close>\n and unset_bit :: \\<open>nat \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close>\n and flip_bit :: \\<open>nat \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close>\n and push_bit :: \\<open>nat \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close>\n and drop_bit :: \\<open>nat \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close>\n and take_bit :: \\<open>nat \\<Rightarrow> 'a \\<Rightarrow> 'a\\<close>\n assumes and_rec: \\<open>a AND b = of_bool (odd a \\<and> odd b) + 2 * ((a div 2) AND (b div 2))\\<close>\n and or_rec: \\<open>a OR b = of_bool (odd a \\<or> odd b) + 2 * ((a div 2) OR (b div 2))\\<close>\n and xor_rec: \\<open>a XOR b = of_bool (odd a \\<noteq> odd b) + 2 * ((a div 2) XOR (b div 2))\\<close>\n and mask_eq_exp_minus_1: \\<open>mask n = 2 ^ n - 1\\<close>\n and set_bit_eq_or: \\<open>set_bit n a = a OR push_bit n 1\\<close>\n and unset_bit_eq_or_xor: \\<open>unset_bit n a = (a OR push_bit n 1) XOR push_bit n 1\\<close>\n and flip_bit_eq_xor: \\<open>flip_bit n a = a XOR push_bit n 1\\<close>\n and push_bit_eq_mult: \\<open>push_bit n a = a * 2 ^ n\\<close>\n and drop_bit_eq_div: \\<open>drop_bit n a = a div 2 ^ n\\<close>\n and take_bit_eq_mod: \\<open>take_bit n a = a mod 2 ^ n\\<close>\nbegin"
] |
template
|
###lemma
and ?a ?y \<le> ?a
###symbols
Bit_Operations.semiring_bit_operations_class.and :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
###defs
class semiring_bit_operations = semiring_bits +
fixes "and" :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixr \<open>AND\<close> 64)
and or :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixr \<open>OR\<close> 59)
and xor :: \<open>'a \<Rightarrow> 'a \<Rightarrow> 'a\<close> (infixr \<open>XOR\<close> 59)
and mask :: \<open>nat \<Rightarrow> 'a\<close>
and set_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
and unset_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
and flip_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
and push_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
and drop_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
and take_bit :: \<open>nat \<Rightarrow> 'a \<Rightarrow> 'a\<close>
assumes and_rec: \<open>a AND b = of_bool (odd a \<and> odd b) + 2 * ((a div 2) AND (b div 2))\<close>
and or_rec: \<open>a OR b = of_bool (odd a \<or> odd b) + 2 * ((a div 2) OR (b div 2))\<close>
and xor_rec: \<open>a XOR b = of_bool (odd a \<noteq> odd b) + 2 * ((a div 2) XOR (b div 2))\<close>
and mask_eq_exp_minus_1: \<open>mask n = 2 ^ n - 1\<close>
and set_bit_eq_or: \<open>set_bit n a = a OR push_bit n 1\<close>
and unset_bit_eq_or_xor: \<open>unset_bit n a = (a OR push_bit n 1) XOR push_bit n 1\<close>
and flip_bit_eq_xor: \<open>flip_bit n a = a XOR push_bit n 1\<close>
and push_bit_eq_mult: \<open>push_bit n a = a * 2 ^ n\<close>
and drop_bit_eq_div: \<open>drop_bit n a = a div 2 ^ n\<close>
and take_bit_eq_mod: \<open>take_bit n a = a mod 2 ^ n\<close>
begin
|
###output
?H1 x_1 x_2 \<le> x_1###end
|
UNITY/Rename
|
Rename.rename_image_preserves
|
lemma rename_image_preserves:
"bij h ==> rename h ` preserves v = preserves (v o inv h)"
|
bij ?h \<Longrightarrow> rename ?h ` preserves ?v = preserves (?v \<circ> inv ?h)
|
?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1) (?H4 x_2) = ?H4 (?H5 x_2 (?H6 x_1))
|
[
"Hilbert_Choice.inv",
"Fun.comp",
"Comp.preserves",
"Rename.rename",
"Set.image",
"Fun.bij"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b \\<Rightarrow> 'a",
"('a \\<Rightarrow> 'b) \\<Rightarrow> ('c \\<Rightarrow> 'a) \\<Rightarrow> 'c \\<Rightarrow> 'b",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a program set",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a program \\<Rightarrow> 'b program",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"abbreviation inv :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> ('b \\<Rightarrow> 'a)\" where\n\"inv \\<equiv> inv_into UNIV\"",
"definition comp :: \"('b \\<Rightarrow> 'c) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> 'a \\<Rightarrow> 'c\" (infixl \"\\<circ>\" 55)\n where \"f \\<circ> g = (\\<lambda>x. f (g x))\"",
"definition preserves :: \"('a=>'b) => 'a program set\"\n where \"preserves v == \\<Inter>z. stable {s. v s = z}\"",
"definition rename :: \"['a => 'b, 'a program] => 'b program\" where\n \"rename h == extend (%(x,u::unit). h x)\"",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"abbreviation bij :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> bool\"\n where \"bij f \\<equiv> bij_betw f UNIV UNIV\""
] |
template
|
###lemma
bij ?h \<Longrightarrow> rename ?h ` preserves ?v = preserves (?v \<circ> inv ?h)
###symbols
Hilbert_Choice.inv :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a
Fun.comp :::: ('a \<Rightarrow> 'b) \<Rightarrow> ('c \<Rightarrow> 'a) \<Rightarrow> 'c \<Rightarrow> 'b
Comp.preserves :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a program set
Rename.rename :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a program \<Rightarrow> 'b program
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Fun.bij :::: ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
abbreviation inv :: "('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a)" where
"inv \<equiv> inv_into UNIV"
definition comp :: "('b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "\<circ>" 55)
where "f \<circ> g = (\<lambda>x. f (g x))"
definition preserves :: "('a=>'b) => 'a program set"
where "preserves v == \<Inter>z. stable {s. v s = z}"
definition rename :: "['a => 'b, 'a program] => 'b program" where
"rename h == extend (%(x,u::unit). h x)"
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
abbreviation bij :: "('a \<Rightarrow> 'b) \<Rightarrow> bool"
where "bij f \<equiv> bij_betw f UNIV UNIV"
|
###output
?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1) (?H4 x_2) = ?H4 (?H5 x_2 (?H6 x_1))###end
|
Computational_Algebra/Formal_Laurent_Series
|
Formal_Laurent_Series.fls_const_nonzero
|
lemma fls_const_nonzero: "c \<noteq> 0 \<Longrightarrow> fls_const c \<noteq> 0"
|
?c \<noteq> (0:: ?'a) \<Longrightarrow> fls_const ?c \<noteq> 0
|
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 x_1 \<noteq> ?H1
|
[
"Formal_Laurent_Series.fls_const",
"Groups.zero_class.zero"
] |
[
"'a \\<Rightarrow> 'a fls",
"'a"
] |
[
"definition fls_const :: \"'a::zero \\<Rightarrow> 'a fls\"\n where \"fls_const c \\<equiv> Abs_fls (\\<lambda>n. if n = 0 then c else 0)\"",
"class zero =\n fixes zero :: 'a (\"0\")"
] |
template
|
###lemma
?c \<noteq> (0:: ?'a) \<Longrightarrow> fls_const ?c \<noteq> 0
###symbols
Formal_Laurent_Series.fls_const :::: 'a \<Rightarrow> 'a fls
Groups.zero_class.zero :::: 'a
###defs
definition fls_const :: "'a::zero \<Rightarrow> 'a fls"
where "fls_const c \<equiv> Abs_fls (\<lambda>n. if n = 0 then c else 0)"
class zero =
fixes zero :: 'a ("0")
|
###output
x_1 \<noteq> ?H1 \<Longrightarrow> ?H2 x_1 \<noteq> ?H1###end
|
Bali/WellForm
|
WellForm.wf_mdeclE
|
lemma wf_mdeclE [consumes 1]:
"\<lbrakk>wf_mdecl G C (sig,m);
\<lbrakk>wf_mhead G (pid C) sig (mhead m); unique (lcls (mbody m));
\<forall>pn\<in>set (pars m). table_of (lcls (mbody m)) pn = None;
\<forall>(vn,T)\<in>set (lcls (mbody m)). is_acc_type G (pid C) T;
jumpNestingOkS {Ret} (stmt (mbody m));
is_class G C;
\<lparr>prg=G,cls=C,lcl=callee_lcl C sig m\<rparr>\<turnstile>(stmt (mbody m))\<Colon>\<surd>;
(\<exists> A. \<lparr>prg=G,cls=C,lcl=callee_lcl C sig m\<rparr>\<turnstile> parameters m \<guillemotright>\<langle>stmt (mbody m)\<rangle>\<guillemotright> A
\<and> Result \<in> nrm A)
\<rbrakk> \<Longrightarrow> P
\<rbrakk> \<Longrightarrow> P"
|
wf_mdecl ?G ?C (?sig, ?m) \<Longrightarrow> (wf_mhead ?G (pid ?C) ?sig (mhead ?m) \<Longrightarrow> unique (lcls (mbody ?m)) \<Longrightarrow> \<forall>pn\<in>set (pars ?m). table_of (lcls (mbody ?m)) pn = None \<Longrightarrow> \<forall>(vn, T)\<in>set (lcls (mbody ?m)). is_acc_type ?G (pid ?C) T \<Longrightarrow> jumpNestingOkS {Ret} (stmt (mbody ?m)) \<Longrightarrow> is_class ?G ?C \<Longrightarrow> \<lparr>prg = ?G, cls = ?C, lcl = callee_lcl ?C ?sig ?m\<rparr>\<turnstile>stmt (mbody ?m)\<Colon>\<surd> \<Longrightarrow> \<exists>A. \<lparr>prg = ?G, cls = ?C, lcl = callee_lcl ?C ?sig ?m\<rparr>\<turnstile> parameters ?m \<guillemotright>\<langle>stmt (mbody ?m)\<rangle>\<guillemotright> A \<and> Result \<in> nrm A \<Longrightarrow> ?P) \<Longrightarrow> ?P
|
\<lbrakk> ?H1 x_1 x_2 (x_3, x_4); \<lbrakk> ?H2 x_1 (?H3 x_2) x_3 (?H4 x_4); ?H5 (?H6 (?H7 x_4)); \<forall>y_0\<in> ?H8 (?H9 x_4). ?H10 (?H6 (?H7 x_4)) y_0 = ?H11; Ball (?H8 (?H6 (?H7 x_4))) (?H12 (\<lambda>y_1. ?H13 x_1 (?H3 x_2))); ?H14 (?H15 ?H16 ?H17) (?H18 (?H7 x_4)); ?H19 x_1 x_2; ?H20 (?H21 x_1 x_2 (?H22 x_2 x_3 x_4) ?H23) (?H18 (?H7 x_4)); \<exists>y_3. ?H24 (?H21 x_1 x_2 (?H22 x_2 x_3 x_4) ?H23) (?H25 x_4) (?H26 (?H18 (?H7 x_4))) y_3 \<and> ?H27 \<in> ?H28 y_3\<rbrakk> \<Longrightarrow> x_5\<rbrakk> \<Longrightarrow> x_5
|
[
"DefiniteAssignment.assigned.nrm",
"Name.Result",
"Term.inj_term_class.inj_term",
"WellForm.parameters",
"DefiniteAssignment.da",
"Product_Type.Unity",
"WellForm.callee_lcl",
"WellType.env.env_ext",
"WellType.wt_stmt_syntax",
"Decl.is_class",
"Decl.mbody.stmt",
"Set.empty",
"Term.jump.Ret",
"Set.insert",
"DefiniteAssignment.jumpNestingOkS",
"DeclConcepts.is_acc_type",
"Product_Type.prod.case_prod",
"Option.option.None",
"Table.table_of",
"Decl.mhead.pars",
"List.list.set",
"Decl.methd.mbody",
"Decl.mbody.lcls",
"Basis.unique",
"Decl.mhead",
"Name.qtname.pid",
"WellForm.wf_mhead",
"WellForm.wf_mdecl"
] |
[
"'a assigned_scheme \\<Rightarrow> lname set",
"lname",
"'a \\<Rightarrow> Term.term",
"methd \\<Rightarrow> lname set",
"env \\<Rightarrow> lname set \\<Rightarrow> Term.term \\<Rightarrow> assigned \\<Rightarrow> bool",
"unit",
"qtname \\<Rightarrow> sig \\<Rightarrow> methd \\<Rightarrow> lenv",
"prog \\<Rightarrow> qtname \\<Rightarrow> lenv \\<Rightarrow> 'a \\<Rightarrow> 'a env_scheme",
"env \\<Rightarrow> stmt \\<Rightarrow> bool",
"prog \\<Rightarrow> qtname \\<Rightarrow> bool",
"'a mbody_scheme \\<Rightarrow> stmt",
"'a set",
"jump",
"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"jump set \\<Rightarrow> stmt \\<Rightarrow> bool",
"prog \\<Rightarrow> pname \\<Rightarrow> ty \\<Rightarrow> bool",
"('a \\<Rightarrow> 'b \\<Rightarrow> 'c) \\<Rightarrow> 'a \\<times> 'b \\<Rightarrow> 'c",
"'a option",
"('a \\<times> 'b) list \\<Rightarrow> 'a \\<Rightarrow> 'b option",
"'a mhead_scheme \\<Rightarrow> vname list",
"'a list \\<Rightarrow> 'a set",
"'a methd_scheme \\<Rightarrow> mbody",
"'a mbody_scheme \\<Rightarrow> (vname \\<times> ty) list",
"('a \\<times> 'b) list \\<Rightarrow> bool",
"methd \\<Rightarrow> mhead",
"'a qtname_scheme \\<Rightarrow> pname",
"prog \\<Rightarrow> pname \\<Rightarrow> sig \\<Rightarrow> mhead \\<Rightarrow> bool",
"prog \\<Rightarrow> qtname \\<Rightarrow> mdecl \\<Rightarrow> bool"
] |
[
"record assigned = \n nrm :: \"lname set\" \\<comment> \\<open>Definetly assigned variables \n for normal completion\\<close>\n brk :: \"breakass\" \\<comment> \\<open>Definetly assigned variables for \n abrupt completion with a break\\<close>",
"abbreviation Result :: lname\n where \"Result == EName Res\"",
"class inj_term =\n fixes inj_term:: \"'a \\<Rightarrow> term\" (\"\\<langle>_\\<rangle>\" 1000)",
"definition\n parameters :: \"methd \\<Rightarrow> lname set\" where\n \"parameters m = set (map (EName \\<circ> VNam) (pars m)) \\<union> (if (static m) then {} else {This})\"",
"inductive\n da :: \"env \\<Rightarrow> lname set \\<Rightarrow> term \\<Rightarrow> assigned \\<Rightarrow> bool\" (\"_\\<turnstile> _ \\<guillemotright>_\\<guillemotright> _\" [65,65,65,65] 71)\nwhere\n Skip: \"Env\\<turnstile> B \\<guillemotright>\\<langle>Skip\\<rangle>\\<guillemotright> \\<lparr>nrm=B,brk=\\<lambda> l. UNIV\\<rparr>\"\n\n| Expr: \"Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>Expr e\\<rangle>\\<guillemotright> A\"\n| Lab: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>c\\<rangle>\\<guillemotright> C; nrm A = nrm C \\<inter> (brk C) l; brk A = rmlab l (brk C)\\<rbrakk>\n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>Break l\\<bullet> c\\<rangle>\\<guillemotright> A\" \n\n| Comp: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>c1\\<rangle>\\<guillemotright> C1; Env\\<turnstile> nrm C1 \\<guillemotright>\\<langle>c2\\<rangle>\\<guillemotright> C2; \n nrm A = nrm C2; brk A = (brk C1) \\<Rightarrow>\\<inter> (brk C2)\\<rbrakk> \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>c1;; c2\\<rangle>\\<guillemotright> A\"\n\n| If: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> E;\n Env\\<turnstile> (B \\<union> assigns_if True e) \\<guillemotright>\\<langle>c1\\<rangle>\\<guillemotright> C1;\n Env\\<turnstile> (B \\<union> assigns_if False e) \\<guillemotright>\\<langle>c2\\<rangle>\\<guillemotright> C2;\n nrm A = nrm C1 \\<inter> nrm C2;\n brk A = brk C1 \\<Rightarrow>\\<inter> brk C2 \\<rbrakk> \n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>If(e) c1 Else c2\\<rangle>\\<guillemotright> A\"\n\n\\<comment> \\<open>Note that \\<^term>\\<open>E\\<close> is not further used, because we take the specialized\n sets that also consider if the expression evaluates to True or False. \n Inside of \\<^term>\\<open>e\\<close> there is no {\\tt break} or {\\tt finally}, so the break\n map of \\<^term>\\<open>E\\<close> will be the trivial one. So \n \\<^term>\\<open>Env\\<turnstile>B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> E\\<close> is just used to ensure the definite assignment in\n expression \\<^term>\\<open>e\\<close>.\n Notice the implicit analysis of a constant boolean expression \\<^term>\\<open>e\\<close>\n in this rule. For example, if \\<^term>\\<open>e\\<close> is constantly \\<^term>\\<open>True\\<close> then \n \\<^term>\\<open>assigns_if False e = UNIV\\<close> and therefor \\<^term>\\<open>nrm C2=UNIV\\<close>.\n So finally \\<^term>\\<open>nrm A = nrm C1\\<close>. For the break maps this trick \n workd too, because the trivial break map will map all labels to \n \\<^term>\\<open>UNIV\\<close>. In the example, if no break occurs in \\<^term>\\<open>c2\\<close> the break\n maps will trivially map to \\<^term>\\<open>UNIV\\<close> and if a break occurs it will map\n to \\<^term>\\<open>UNIV\\<close> too, because \\<^term>\\<open>assigns_if False e = UNIV\\<close>. So\n in the intersection of the break maps the path \\<^term>\\<open>c2\\<close> will have no\n contribution.\\<close>\n\n| Loop: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> E; \n Env\\<turnstile> (B \\<union> assigns_if True e) \\<guillemotright>\\<langle>c\\<rangle>\\<guillemotright> C;\n nrm A = nrm C \\<inter> (B \\<union> assigns_if False e);\n brk A = brk C\\<rbrakk> \n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>l\\<bullet> While(e) c\\<rangle>\\<guillemotright> A\"\n\\<comment> \\<open>The \\<open>Loop\\<close> rule resembles some of the ideas of the \\<open>If\\<close> rule.\n For the \\<^term>\\<open>nrm A\\<close> the set \\<^term>\\<open>B \\<union> assigns_if False e\\<close> \n will be \\<^term>\\<open>UNIV\\<close> if the condition is constantly True. To normally exit\n the while loop, we must consider the body \\<^term>\\<open>c\\<close> to be completed \n normally (\\<^term>\\<open>nrm C\\<close>) or with a break. But in this model, \n the label \\<^term>\\<open>l\\<close> of the loop\n only handles continue labels, not break labels. The break label will be\n handled by an enclosing \\<^term>\\<open>Lab\\<close> statement. So we don't have to\n handle the breaks specially.\\<close>\n\n| Jmp: \"\\<lbrakk>jump=Ret \\<longrightarrow> Result \\<in> B;\n nrm A = UNIV;\n brk A = (case jump of\n Break l \\<Rightarrow> \\<lambda> k. if k=l then B else UNIV \n | Cont l \\<Rightarrow> \\<lambda> k. UNIV\n | Ret \\<Rightarrow> \\<lambda> k. UNIV)\\<rbrakk> \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>Jmp jump\\<rangle>\\<guillemotright> A\"\n\\<comment> \\<open>In case of a break to label \\<^term>\\<open>l\\<close> the corresponding break set is all\n variables assigned before the break. The assigned variables for normal\n completion of the \\<^term>\\<open>Jmp\\<close> is \\<^term>\\<open>UNIV\\<close>, because the statement will\n never complete normally. For continue and return the break map is the \n trivial one. In case of a return we enshure that the result value is\n assigned.\\<close>\n\n| Throw: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> E; nrm A = UNIV; brk A = (\\<lambda> l. UNIV)\\<rbrakk> \n \\<Longrightarrow> Env\\<turnstile> B \\<guillemotright>\\<langle>Throw e\\<rangle>\\<guillemotright> A\"\n\n| Try: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>c1\\<rangle>\\<guillemotright> C1; \n Env\\<lparr>lcl := (lcl Env)(VName vn\\<mapsto>Class C)\\<rparr>\\<turnstile> (B \\<union> {VName vn}) \\<guillemotright>\\<langle>c2\\<rangle>\\<guillemotright> C2; \n nrm A = nrm C1 \\<inter> nrm C2;\n brk A = brk C1 \\<Rightarrow>\\<inter> brk C2\\<rbrakk> \n \\<Longrightarrow> Env\\<turnstile> B \\<guillemotright>\\<langle>Try c1 Catch(C vn) c2\\<rangle>\\<guillemotright> A\"\n\n| Fin: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>c1\\<rangle>\\<guillemotright> C1;\n Env\\<turnstile> B \\<guillemotright>\\<langle>c2\\<rangle>\\<guillemotright> C2;\n nrm A = nrm C1 \\<union> nrm C2;\n brk A = ((brk C1) \\<Rightarrow>\\<union>\\<^sub>\\<forall> (nrm C2)) \\<Rightarrow>\\<inter> (brk C2)\\<rbrakk> \n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>c1 Finally c2\\<rangle>\\<guillemotright> A\" \n\\<comment> \\<open>The set of assigned variables before execution \\<^term>\\<open>c2\\<close> are the same\n as before execution \\<^term>\\<open>c1\\<close>, because \\<^term>\\<open>c1\\<close> could throw an exception\n and so we can't guarantee that any variable will be assigned in \\<^term>\\<open>c1\\<close>.\n The \\<open>Finally\\<close> statement completes\n normally if both \\<^term>\\<open>c1\\<close> and \\<^term>\\<open>c2\\<close> complete normally. If \\<^term>\\<open>c1\\<close>\n completes abruptly with a break, then \\<^term>\\<open>c2\\<close> also will be executed \n and may terminate normally or with a break. The overall break map then is\n the intersection of the maps of both paths. If \\<^term>\\<open>c2\\<close> terminates \n normally we have to extend all break sets in \\<^term>\\<open>brk C1\\<close> with \n \\<^term>\\<open>nrm C2\\<close> (\\<open>\\<Rightarrow>\\<union>\\<^sub>\\<forall>\\<close>). If \\<^term>\\<open>c2\\<close> exits with a break this\n break will appear in the overall result state. We don't know if \n \\<^term>\\<open>c1\\<close> completed normally or abruptly (maybe with an exception not only\n a break) so \\<^term>\\<open>c1\\<close> has no contribution to the break map following this\n path.\\<close>\n\n\\<comment> \\<open>Evaluation of expressions and the break sets of definite assignment:\n Thinking of a Java expression we assume that we can never have\n a break statement inside of a expression. So for all expressions the\n break sets could be set to the trivial one: \\<^term>\\<open>\\<lambda> l. UNIV\\<close>. \n But we can't\n trivially proof, that evaluating an expression will never result in a \n break, allthough Java expressions allready syntactically don't allow\n nested stetements in them. The reason are the nested class initialzation \n statements which are inserted by the evaluation rules. So to proof the\n absence of a break we need to ensure, that the initialization statements\n will never end up in a break. In a wellfromed initialization statement, \n of course, were breaks are nested correctly inside of \\<^term>\\<open>Lab\\<close> \n or \\<^term>\\<open>Loop\\<close> statements evaluation of the whole initialization \n statement will never result in a break, because this break will be \n handled inside of the statement. But for simplicity we haven't added\n the analysis of the correct nesting of breaks in the typing judgments \n right now. So we have decided to adjust the rules of definite assignment\n to fit to these circumstances. If an initialization is involved during\n evaluation of the expression (evaluation rules \\<open>FVar\\<close>, \\<open>NewC\\<close> \n and \\<open>NewA\\<close>\\<close>\n\n| Init: \"Env\\<turnstile> B \\<guillemotright>\\<langle>Init C\\<rangle>\\<guillemotright> \\<lparr>nrm=B,brk=\\<lambda> l. UNIV\\<rparr>\"\n\\<comment> \\<open>Wellformedness of a program will ensure, that every static initialiser \n is definetly assigned and the jumps are nested correctly. The case here\n for \\<^term>\\<open>Init\\<close> is just for convenience, to get a proper precondition \n for the induction hypothesis in various proofs, so that we don't have to\n expand the initialisation on every point where it is triggerred by the\n evaluation rules.\\<close> \n| NewC: \"Env\\<turnstile> B \\<guillemotright>\\<langle>NewC C\\<rangle>\\<guillemotright> \\<lparr>nrm=B,brk=\\<lambda> l. UNIV\\<rparr>\" \n\n| NewA: \"Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A \n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>New T[e]\\<rangle>\\<guillemotright> A\"\n\n| Cast: \"Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>Cast T e\\<rangle>\\<guillemotright> A\"\n\n| Inst: \"Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>e InstOf T\\<rangle>\\<guillemotright> A\"\n\n| Lit: \"Env\\<turnstile> B \\<guillemotright>\\<langle>Lit v\\<rangle>\\<guillemotright> \\<lparr>nrm=B,brk=\\<lambda> l. UNIV\\<rparr>\"\n\n| UnOp: \"Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A\n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>UnOp unop e\\<rangle>\\<guillemotright> A\"\n\n| CondAnd: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e1\\<rangle>\\<guillemotright> E1; Env\\<turnstile> (B \\<union> assigns_if True e1) \\<guillemotright>\\<langle>e2\\<rangle>\\<guillemotright> E2; \n nrm A = B \\<union> (assigns_if True (BinOp CondAnd e1 e2) \\<inter> \n assigns_if False (BinOp CondAnd e1 e2));\n brk A = (\\<lambda> l. UNIV) \\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>BinOp CondAnd e1 e2\\<rangle>\\<guillemotright> A\"\n\n| CondOr: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e1\\<rangle>\\<guillemotright> E1; Env\\<turnstile> (B \\<union> assigns_if False e1) \\<guillemotright>\\<langle>e2\\<rangle>\\<guillemotright> E2; \n nrm A = B \\<union> (assigns_if True (BinOp CondOr e1 e2) \\<inter> \n assigns_if False (BinOp CondOr e1 e2));\n brk A = (\\<lambda> l. UNIV) \\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>BinOp CondOr e1 e2\\<rangle>\\<guillemotright> A\"\n\n| BinOp: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e1\\<rangle>\\<guillemotright> E1; Env\\<turnstile> nrm E1 \\<guillemotright>\\<langle>e2\\<rangle>\\<guillemotright> A; \n binop \\<noteq> CondAnd; binop \\<noteq> CondOr\\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>BinOp binop e1 e2\\<rangle>\\<guillemotright> A\"\n\n| Super: \"This \\<in> B \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>Super\\<rangle>\\<guillemotright> \\<lparr>nrm=B,brk=\\<lambda> l. UNIV\\<rparr>\"\n\n| AccLVar: \"\\<lbrakk>vn \\<in> B;\n nrm A = B; brk A = (\\<lambda> k. UNIV)\\<rbrakk> \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>Acc (LVar vn)\\<rangle>\\<guillemotright> A\"\n\\<comment> \\<open>To properly access a local variable we have to test the definite \n assignment here. The variable must occur in the set \\<^term>\\<open>B\\<close>\\<close>\n\n| Acc: \"\\<lbrakk>\\<forall> vn. v \\<noteq> LVar vn;\n Env\\<turnstile> B \\<guillemotright>\\<langle>v\\<rangle>\\<guillemotright> A\\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>Acc v\\<rangle>\\<guillemotright> A\"\n\n| AssLVar: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> E; nrm A = nrm E \\<union> {vn}; brk A = brk E\\<rbrakk> \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>(LVar vn) := e\\<rangle>\\<guillemotright> A\"\n\n| Ass: \"\\<lbrakk>\\<forall> vn. v \\<noteq> LVar vn; Env\\<turnstile> B \\<guillemotright>\\<langle>v\\<rangle>\\<guillemotright> V; Env\\<turnstile> nrm V \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A\\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>v := e\\<rangle>\\<guillemotright> A\"\n\n| CondBool: \"\\<lbrakk>Env\\<turnstile>(c ? e1 : e2)\\<Colon>-(PrimT Boolean);\n Env\\<turnstile> B \\<guillemotright>\\<langle>c\\<rangle>\\<guillemotright> C;\n Env\\<turnstile> (B \\<union> assigns_if True c) \\<guillemotright>\\<langle>e1\\<rangle>\\<guillemotright> E1;\n Env\\<turnstile> (B \\<union> assigns_if False c) \\<guillemotright>\\<langle>e2\\<rangle>\\<guillemotright> E2;\n nrm A = B \\<union> (assigns_if True (c ? e1 : e2) \\<inter> \n assigns_if False (c ? e1 : e2));\n brk A = (\\<lambda> l. UNIV)\\<rbrakk>\n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>c ? e1 : e2\\<rangle>\\<guillemotright> A\" \n\n| Cond: \"\\<lbrakk>\\<not> Env\\<turnstile>(c ? e1 : e2)\\<Colon>-(PrimT Boolean);\n Env\\<turnstile> B \\<guillemotright>\\<langle>c\\<rangle>\\<guillemotright> C;\n Env\\<turnstile> (B \\<union> assigns_if True c) \\<guillemotright>\\<langle>e1\\<rangle>\\<guillemotright> E1;\n Env\\<turnstile> (B \\<union> assigns_if False c) \\<guillemotright>\\<langle>e2\\<rangle>\\<guillemotright> E2;\n nrm A = nrm E1 \\<inter> nrm E2; brk A = (\\<lambda> l. UNIV)\\<rbrakk>\n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>c ? e1 : e2\\<rangle>\\<guillemotright> A\" \n\n| Call: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> E; Env\\<turnstile> nrm E \\<guillemotright>\\<langle>args\\<rangle>\\<guillemotright> A\\<rbrakk> \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>{accC,statT,mode}e\\<cdot>mn({pTs}args)\\<rangle>\\<guillemotright> A\"\n\n\\<comment> \\<open>The interplay of \\<^term>\\<open>Call\\<close>, \\<^term>\\<open>Methd\\<close> and \\<^term>\\<open>Body\\<close>:\n Why rules for \\<^term>\\<open>Methd\\<close> and \\<^term>\\<open>Body\\<close> at all? Note that a\n Java source program will not include bare \\<^term>\\<open>Methd\\<close> or \\<^term>\\<open>Body\\<close>\n terms. These terms are just introduced during evaluation. So definite\n assignment of \\<^term>\\<open>Call\\<close> does not consider \\<^term>\\<open>Methd\\<close> or \n \\<^term>\\<open>Body\\<close> at all. So for definite assignment alone we could omit the\n rules for \\<^term>\\<open>Methd\\<close> and \\<^term>\\<open>Body\\<close>. \n But since evaluation of the method invocation is\n split up into three rules we must ensure that we have enough information\n about the call even in the \\<^term>\\<open>Body\\<close> term to make sure that we can\n proof type safety. Also we must be able transport this information \n from \\<^term>\\<open>Call\\<close> to \\<^term>\\<open>Methd\\<close> and then further to \\<^term>\\<open>Body\\<close> \n during evaluation to establish the definite assignment of \\<^term>\\<open>Methd\\<close>\n during evaluation of \\<^term>\\<open>Call\\<close>, and of \\<^term>\\<open>Body\\<close> during evaluation\n of \\<^term>\\<open>Methd\\<close>. This is necessary since definite assignment will be\n a precondition for each induction hypothesis coming out of the evaluation\n rules, and therefor we have to establish the definite assignment of the\n sub-evaluation during the type-safety proof. Note that well-typedness is\n also a precondition for type-safety and so we can omit some assertion \n that are already ensured by well-typedness.\\<close>\n| Methd: \"\\<lbrakk>methd (prg Env) D sig = Some m;\n Env\\<turnstile> B \\<guillemotright>\\<langle>Body (declclass m) (stmt (mbody (mthd m)))\\<rangle>\\<guillemotright> A\n \\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>Methd D sig\\<rangle>\\<guillemotright> A\" \n\n| Body: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>c\\<rangle>\\<guillemotright> C; jumpNestingOkS {Ret} c; Result \\<in> nrm C;\n nrm A = B; brk A = (\\<lambda> l. UNIV)\\<rbrakk>\n \\<Longrightarrow>\n Env\\<turnstile> B \\<guillemotright>\\<langle>Body D c\\<rangle>\\<guillemotright> A\"\n\\<comment> \\<open>Note that \\<^term>\\<open>A\\<close> is not correlated to \\<^term>\\<open>C\\<close>. If the body\n statement returns abruptly with return, evaluation of \\<^term>\\<open>Body\\<close>\n will absorb this return and complete normally. So we cannot trivially\n get the assigned variables of the body statement since it has not \n completed normally or with a break.\n If the body completes normally we guarantee that the result variable\n is set with this rule. But if the body completes abruptly with a return\n we can't guarantee that the result variable is set here, since \n definite assignment only talks about normal completion and breaks. So\n for a return the \\<^term>\\<open>Jump\\<close> rule ensures that the result variable is\n set and then this information must be carried over to the \\<^term>\\<open>Body\\<close>\n rule by the conformance predicate of the state.\\<close>\n| LVar: \"Env\\<turnstile> B \\<guillemotright>\\<langle>LVar vn\\<rangle>\\<guillemotright> \\<lparr>nrm=B, brk=\\<lambda> l. UNIV\\<rparr>\" \n\n| FVar: \"Env\\<turnstile> B \\<guillemotright>\\<langle>e\\<rangle>\\<guillemotright> A \n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>{accC,statDeclC,stat}e..fn\\<rangle>\\<guillemotright> A\" \n\n| AVar: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e1\\<rangle>\\<guillemotright> E1; Env\\<turnstile> nrm E1 \\<guillemotright>\\<langle>e2\\<rangle>\\<guillemotright> A\\<rbrakk>\n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>e1.[e2]\\<rangle>\\<guillemotright> A\" \n\n| Nil: \"Env\\<turnstile> B \\<guillemotright>\\<langle>[]::expr list\\<rangle>\\<guillemotright> \\<lparr>nrm=B, brk=\\<lambda> l. UNIV\\<rparr>\" \n\n| Cons: \"\\<lbrakk>Env\\<turnstile> B \\<guillemotright>\\<langle>e::expr\\<rangle>\\<guillemotright> E; Env\\<turnstile> nrm E \\<guillemotright>\\<langle>es\\<rangle>\\<guillemotright> A\\<rbrakk>\n \\<Longrightarrow> \n Env\\<turnstile> B \\<guillemotright>\\<langle>e#es\\<rangle>\\<guillemotright> A\"",
"definition Unity :: unit (\"'(')\")\n where \"() = Abs_unit True\"",
"definition\n callee_lcl :: \"qtname \\<Rightarrow> sig \\<Rightarrow> methd \\<Rightarrow> lenv\" where\n \"callee_lcl C sig m =\n (\\<lambda>k. (case k of\n EName e \n \\<Rightarrow> (case e of \n VNam v \n \\<Rightarrow>((table_of (lcls (mbody m)))(pars m [\\<mapsto>] parTs sig)) v\n | Res \\<Rightarrow> Some (resTy m))\n | This \\<Rightarrow> if is_static m then None else Some (Class C)))\"",
"record env = \n prg:: \"prog\" \\<comment> \\<open>program\\<close>\n cls:: \"qtname\" \\<comment> \\<open>current package and class name\\<close>\n lcl:: \"lenv\" \\<comment> \\<open>local environment\\<close>",
"abbreviation\n wt_stmt_syntax :: \"env \\<Rightarrow> stmt \\<Rightarrow> bool\" (\"_\\<turnstile>_\\<Colon>\\<surd>\" [51,51 ] 50)\n where \"E\\<turnstile>s\\<Colon>\\<surd> == E\\<turnstile>In1r s \\<Colon> Inl (PrimT Void)\"",
"abbreviation\n is_class :: \"prog \\<Rightarrow> qtname \\<Rightarrow> bool\"\n where \"is_class G C == class G C \\<noteq> None\"",
"record mbody = (* method body *)\n lcls:: \"(vname \\<times> ty) list\" (* local variables *)\n stmt:: stmt",
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"datatype jump\n = Break label \\<comment> \\<open>break\\<close>\n | Cont label \\<comment> \\<open>continue\\<close>\n | Ret \\<comment> \\<open>return from method\\<close>",
"definition insert :: \"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set\"\n where insert_compr: \"insert a B = {x. x = a \\<or> x \\<in> B}\"",
"primrec jumpNestingOkS :: \"jump set \\<Rightarrow> stmt \\<Rightarrow> bool\"\nwhere\n \"jumpNestingOkS jmps (Skip) = True\"\n| \"jumpNestingOkS jmps (Expr e) = True\"\n| \"jumpNestingOkS jmps (j\\<bullet> s) = jumpNestingOkS ({j} \\<union> jmps) s\"\n| \"jumpNestingOkS jmps (c1;;c2) = (jumpNestingOkS jmps c1 \\<and> \n jumpNestingOkS jmps c2)\"\n| \"jumpNestingOkS jmps (If(e) c1 Else c2) = (jumpNestingOkS jmps c1 \\<and> \n jumpNestingOkS jmps c2)\"\n| \"jumpNestingOkS jmps (l\\<bullet> While(e) c) = jumpNestingOkS ({Cont l} \\<union> jmps) c\"\n\\<comment> \\<open>The label of the while loop only handles continue jumps. Breaks are only\n handled by \\<^term>\\<open>Lab\\<close>\\<close>\n| \"jumpNestingOkS jmps (Jmp j) = (j \\<in> jmps)\"\n| \"jumpNestingOkS jmps (Throw e) = True\"\n| \"jumpNestingOkS jmps (Try c1 Catch(C vn) c2) = (jumpNestingOkS jmps c1 \\<and> \n jumpNestingOkS jmps c2)\"\n| \"jumpNestingOkS jmps (c1 Finally c2) = (jumpNestingOkS jmps c1 \\<and> \n jumpNestingOkS jmps c2)\"\n| \"jumpNestingOkS jmps (Init C) = True\" \n \\<comment> \\<open>wellformedness of the program must enshure that for all initializers \n jumpNestingOkS {} holds\\<close> \n\\<comment> \\<open>Dummy analysis for intermediate smallstep term \\<^term>\\<open>FinA\\<close>\\<close>\n| \"jumpNestingOkS jmps (FinA a c) = False\"",
"definition\n is_acc_type :: \"prog \\<Rightarrow> pname \\<Rightarrow> ty \\<Rightarrow> bool\"\n where \"is_acc_type G P T = (is_type G T \\<and> G\\<turnstile>T accessible_in P)\"",
"definition \"prod = {f. \\<exists>a b. f = Pair_Rep (a::'a) (b::'b)}\"",
"datatype 'a option =\n None\n | Some (the: 'a)",
"abbreviation\n table_of :: \"('a \\<times> 'b) list \\<Rightarrow> ('a, 'b) table\" \\<comment> \\<open>concrete table\\<close>\n where \"table_of \\<equiv> map_of\"",
"definition\n mhead :: \"methd \\<Rightarrow> mhead\"\n where \"mhead m = \\<lparr>access=access m, static=static m, pars=pars m, resT=resT m\\<rparr>\"",
"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 [] = []\"",
"record methd = mhead + (* method in a class *)\n mbody::mbody",
"record mbody = (* method body *)\n lcls:: \"(vname \\<times> ty) list\" (* local variables *)\n stmt:: stmt",
"definition unique :: \"('a \\<times> 'b) list \\<Rightarrow> bool\"\n where \"unique = distinct \\<circ> map fst\"",
"definition\n mhead :: \"methd \\<Rightarrow> mhead\"\n where \"mhead m = \\<lparr>access=access m, static=static m, pars=pars m, resT=resT m\\<rparr>\"",
"record qtname = \\<comment> \\<open>qualified tname cf. 6.5.3, 6.5.4\\<close>\n pid :: pname \n tid :: tname",
"definition\n wf_mhead :: \"prog \\<Rightarrow> pname \\<Rightarrow> sig \\<Rightarrow> mhead \\<Rightarrow> bool\" where\n \"wf_mhead G P = (\\<lambda> sig mh. length (parTs sig) = length (pars mh) \\<and>\n ( \\<forall>T\\<in>set (parTs sig). is_acc_type G P T) \\<and> \n is_acc_type G P (resTy mh) \\<and>\n distinct (pars mh))\"",
"definition\n wf_mdecl :: \"prog \\<Rightarrow> qtname \\<Rightarrow> mdecl \\<Rightarrow> bool\" where\n \"wf_mdecl G C =\n (\\<lambda>(sig,m).\n wf_mhead G (pid C) sig (mhead m) \\<and> \n unique (lcls (mbody m)) \\<and> \n (\\<forall>(vn,T)\\<in>set (lcls (mbody m)). is_acc_type G (pid C) T) \\<and> \n (\\<forall>pn\\<in>set (pars m). table_of (lcls (mbody m)) pn = None) \\<and>\n jumpNestingOkS {Ret} (stmt (mbody m)) \\<and> \n is_class G C \\<and>\n \\<lparr>prg=G,cls=C,lcl=callee_lcl C sig m\\<rparr>\\<turnstile>(stmt (mbody m))\\<Colon>\\<surd> \\<and>\n (\\<exists> A. \\<lparr>prg=G,cls=C,lcl=callee_lcl C sig m\\<rparr> \n \\<turnstile> parameters m \\<guillemotright>\\<langle>stmt (mbody m)\\<rangle>\\<guillemotright> A \n \\<and> Result \\<in> nrm A))\""
] |
template
|
###lemma
wf_mdecl ?G ?C (?sig, ?m) \<Longrightarrow> (wf_mhead ?G (pid ?C) ?sig (mhead ?m) \<Longrightarrow> unique (lcls (mbody ?m)) \<Longrightarrow> \<forall>pn\<in>set (pars ?m). table_of (lcls (mbody ?m)) pn = None \<Longrightarrow> \<forall>(vn, T)\<in>set (lcls (mbody ?m)). is_acc_type ?G (pid ?C) T \<Longrightarrow> jumpNestingOkS {Ret} (stmt (mbody ?m)) \<Longrightarrow> is_class ?G ?C \<Longrightarrow> \<lparr>prg = ?G, cls = ?C, lcl = callee_lcl ?C ?sig ?m\<rparr>\<turnstile>stmt (mbody ?m)\<Colon>\<surd> \<Longrightarrow> \<exists>A. \<lparr>prg = ?G, cls = ?C, lcl = callee_lcl ?C ?sig ?m\<rparr>\<turnstile> parameters ?m \<guillemotright>\<langle>stmt (mbody ?m)\<rangle>\<guillemotright> A \<and> Result \<in> nrm A \<Longrightarrow> ?P) \<Longrightarrow> ?P
###symbols
DefiniteAssignment.assigned.nrm :::: 'a assigned_scheme \<Rightarrow> lname set
Name.Result :::: lname
Term.inj_term_class.inj_term :::: 'a \<Rightarrow> Term.term
WellForm.parameters :::: methd \<Rightarrow> lname set
DefiniteAssignment.da :::: env \<Rightarrow> lname set \<Rightarrow> Term.term \<Rightarrow> assigned \<Rightarrow> bool
Product_Type.Unity :::: unit
WellForm.callee_lcl :::: qtname \<Rightarrow> sig \<Rightarrow> methd \<Rightarrow> lenv
WellType.env.env_ext :::: prog \<Rightarrow> qtname \<Rightarrow> lenv \<Rightarrow> 'a \<Rightarrow> 'a env_scheme
WellType.wt_stmt_syntax :::: env \<Rightarrow> stmt \<Rightarrow> bool
Decl.is_class :::: prog \<Rightarrow> qtname \<Rightarrow> bool
Decl.mbody.stmt :::: 'a mbody_scheme \<Rightarrow> stmt
Set.empty :::: 'a set
Term.jump.Ret :::: jump
Set.insert :::: 'a \<Rightarrow> 'a set \<Rightarrow> 'a set
DefiniteAssignment.jumpNestingOkS :::: jump set \<Rightarrow> stmt \<Rightarrow> bool
DeclConcepts.is_acc_type :::: prog \<Rightarrow> pname \<Rightarrow> ty \<Rightarrow> bool
Product_Type.prod.case_prod :::: ('a \<Rightarrow> 'b \<Rightarrow> 'c) \<Rightarrow> 'a \<times> 'b \<Rightarrow> 'c
Option.option.None :::: 'a option
Table.table_of :::: ('a \<times> 'b) list \<Rightarrow> 'a \<Rightarrow> 'b option
Decl.mhead.pars :::: 'a mhead_scheme \<Rightarrow> vname list
List.list.set :::: 'a list \<Rightarrow> 'a set
Decl.methd.mbody :::: 'a methd_scheme \<Rightarrow> mbody
Decl.mbody.lcls :::: 'a mbody_scheme \<Rightarrow> (vname \<times> ty) list
Basis.unique :::: ('a \<times> 'b) list \<Rightarrow> bool
Decl.mhead :::: methd \<Rightarrow> mhead
Name.qtname.pid :::: 'a qtname_scheme \<Rightarrow> pname
WellForm.wf_mhead :::: prog \<Rightarrow> pname \<Rightarrow> sig \<Rightarrow> mhead \<Rightarrow> bool
WellForm.wf_mdecl :::: prog \<Rightarrow> qtname \<Rightarrow> mdecl \<Rightarrow> bool
###defs
record assigned =
nrm :: "lname set" \<comment> \<open>Definetly assigned variables
for normal completion\<close>
brk :: "breakass" \<comment> \<open>Definetly assigned variables for
abrupt completion with a break\<close>
abbreviation Result :: lname
where "Result == EName Res"
class inj_term =
fixes inj_term:: "'a \<Rightarrow> term" ("\<langle>_\<rangle>" 1000)
definition
parameters :: "methd \<Rightarrow> lname set" where
"parameters m = set (map (EName \<circ> VNam) (pars m)) \<union> (if (static m) then {} else {This})"
inductive
da :: "env \<Rightarrow> lname set \<Rightarrow> term \<Rightarrow> assigned \<Rightarrow> bool" ("_\<turnstile> _ \<guillemotright>_\<guillemotright> _" [65,65,65,65] 71)
where
Skip: "Env\<turnstile> B \<guillemotright>\<langle>Skip\<rangle>\<guillemotright> \<lparr>nrm=B,brk=\<lambda> l. UNIV\<rparr>"
| Expr: "Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> A
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Expr e\<rangle>\<guillemotright> A"
| Lab: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>c\<rangle>\<guillemotright> C; nrm A = nrm C \<inter> (brk C) l; brk A = rmlab l (brk C)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Break l\<bullet> c\<rangle>\<guillemotright> A"
| Comp: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>c1\<rangle>\<guillemotright> C1; Env\<turnstile> nrm C1 \<guillemotright>\<langle>c2\<rangle>\<guillemotright> C2;
nrm A = nrm C2; brk A = (brk C1) \<Rightarrow>\<inter> (brk C2)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>c1;; c2\<rangle>\<guillemotright> A"
| If: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> E;
Env\<turnstile> (B \<union> assigns_if True e) \<guillemotright>\<langle>c1\<rangle>\<guillemotright> C1;
Env\<turnstile> (B \<union> assigns_if False e) \<guillemotright>\<langle>c2\<rangle>\<guillemotright> C2;
nrm A = nrm C1 \<inter> nrm C2;
brk A = brk C1 \<Rightarrow>\<inter> brk C2 \<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>If(e) c1 Else c2\<rangle>\<guillemotright> A"
\<comment> \<open>Note that \<^term>\<open>E\<close> is not further used, because we take the specialized
sets that also consider if the expression evaluates to True or False.
Inside of \<^term>\<open>e\<close> there is no {\tt break} or {\tt finally}, so the break
map of \<^term>\<open>E\<close> will be the trivial one. So
\<^term>\<open>Env\<turnstile>B \<guillemotright>\<langle>e\<rangle>\<guillemotright> E\<close> is just used to ensure the definite assignment in
expression \<^term>\<open>e\<close>.
Notice the implicit analysis of a constant boolean expression \<^term>\<open>e\<close>
in this rule. For example, if \<^term>\<open>e\<close> is constantly \<^term>\<open>True\<close> then
\<^term>\<open>assigns_if False e = UNIV\<close> and therefor \<^term>\<open>nrm C2=UNIV\<close>.
So finally \<^term>\<open>nrm A = nrm C1\<close>. For the break maps this trick
workd too, because the trivial break map will map all labels to
\<^term>\<open>UNIV\<close>. In the example, if no break occurs in \<^term>\<open>c2\<close> the break
maps will trivially map to \<^term>\<open>UNIV\<close> and if a break occurs it will map
to \<^term>\<open>UNIV\<close> too, because \<^term>\<open>assigns_if False e = UNIV\<close>. So
in the intersection of the break maps the path \<^term>\<open>c2\<close> will have no
contribution.\<close>
| Loop: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> E;
Env\<turnstile> (B \<union> assigns_if True e) \<guillemotright>\<langle>c\<rangle>\<guillemotright> C;
nrm A = nrm C \<inter> (B \<union> assigns_if False e);
brk A = brk C\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>l\<bullet> While(e) c\<rangle>\<guillemotright> A"
\<comment> \<open>The \<open>Loop\<close> rule resembles some of the ideas of the \<open>If\<close> rule.
For the \<^term>\<open>nrm A\<close> the set \<^term>\<open>B \<union> assigns_if False e\<close>
will be \<^term>\<open>UNIV\<close> if the condition is constantly True. To normally exit
the while loop, we must consider the body \<^term>\<open>c\<close> to be completed
normally (\<^term>\<open>nrm C\<close>) or with a break. But in this model,
the label \<^term>\<open>l\<close> of the loop
only handles continue labels, not break labels. The break label will be
handled by an enclosing \<^term>\<open>Lab\<close> statement. So we don't have to
handle the breaks specially.\<close>
| Jmp: "\<lbrakk>jump=Ret \<longrightarrow> Result \<in> B;
nrm A = UNIV;
brk A = (case jump of
Break l \<Rightarrow> \<lambda> k. if k=l then B else UNIV
| Cont l \<Rightarrow> \<lambda> k. UNIV
| Ret \<Rightarrow> \<lambda> k. UNIV)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Jmp jump\<rangle>\<guillemotright> A"
\<comment> \<open>In case of a break to label \<^term>\<open>l\<close> the corresponding break set is all
variables assigned before the break. The assigned variables for normal
completion of the \<^term>\<open>Jmp\<close> is \<^term>\<open>UNIV\<close>, because the statement will
never complete normally. For continue and return the break map is the
trivial one. In case of a return we enshure that the result value is
assigned.\<close>
| Throw: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> E; nrm A = UNIV; brk A = (\<lambda> l. UNIV)\<rbrakk>
\<Longrightarrow> Env\<turnstile> B \<guillemotright>\<langle>Throw e\<rangle>\<guillemotright> A"
| Try: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>c1\<rangle>\<guillemotright> C1;
Env\<lparr>lcl := (lcl Env)(VName vn\<mapsto>Class C)\<rparr>\<turnstile> (B \<union> {VName vn}) \<guillemotright>\<langle>c2\<rangle>\<guillemotright> C2;
nrm A = nrm C1 \<inter> nrm C2;
brk A = brk C1 \<Rightarrow>\<inter> brk C2\<rbrakk>
\<Longrightarrow> Env\<turnstile> B \<guillemotright>\<langle>Try c1 Catch(C vn) c2\<rangle>\<guillemotright> A"
| Fin: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>c1\<rangle>\<guillemotright> C1;
Env\<turnstile> B \<guillemotright>\<langle>c2\<rangle>\<guillemotright> C2;
nrm A = nrm C1 \<union> nrm C2;
brk A = ((brk C1) \<Rightarrow>\<union>\<^sub>\<forall> (nrm C2)) \<Rightarrow>\<inter> (brk C2)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>c1 Finally c2\<rangle>\<guillemotright> A"
\<comment> \<open>The set of assigned variables before execution \<^term>\<open>c2\<close> are the same
as before execution \<^term>\<open>c1\<close>, because \<^term>\<open>c1\<close> could throw an exception
and so we can't guarantee that any variable will be assigned in \<^term>\<open>c1\<close>.
The \<open>Finally\<close> statement completes
normally if both \<^term>\<open>c1\<close> and \<^term>\<open>c2\<close> complete normally. If \<^term>\<open>c1\<close>
completes abruptly with a break, then \<^term>\<open>c2\<close> also will be executed
and may terminate normally or with a break. The overall break map then is
the intersection of the maps of both paths. If \<^term>\<open>c2\<close> terminates
normally we have to extend all break sets in \<^term>\<open>brk C1\<close> with
\<^term>\<open>nrm C2\<close> (\<open>\<Rightarrow>\<union>\<^sub>\<forall>\<close>). If \<^term>\<open>c2\<close> exits with a break this
break will appear in the overall result state. We don't know if
\<^term>\<open>c1\<close> completed normally or abruptly (maybe with an exception not only
a break) so \<^term>\<open>c1\<close> has no contribution to the break map following this
path.\<close>
\<comment> \<open>Evaluation of expressions and the break sets of definite assignment:
Thinking of a Java expression we assume that we can never have
a break statement inside of a expression. So for all expressions the
break sets could be set to the trivial one: \<^term>\<open>\<lambda> l. UNIV\<close>.
But we can't
trivially proof, that evaluating an expression will never result in a
break, allthough Java expressions allready syntactically don't allow
nested stetements in them. The reason are the nested class initialzation
statements which are inserted by the evaluation rules. So to proof the
absence of a break we need to ensure, that the initialization statements
will never end up in a break. In a wellfromed initialization statement,
of course, were breaks are nested correctly inside of \<^term>\<open>Lab\<close>
or \<^term>\<open>Loop\<close> statements evaluation of the whole initialization
statement will never result in a break, because this break will be
handled inside of the statement. But for simplicity we haven't added
the analysis of the correct nesting of breaks in the typing judgments
right now. So we have decided to adjust the rules of definite assignment
to fit to these circumstances. If an initialization is involved during
evaluation of the expression (evaluation rules \<open>FVar\<close>, \<open>NewC\<close>
and \<open>NewA\<close>\<close>
| Init: "Env\<turnstile> B \<guillemotright>\<langle>Init C\<rangle>\<guillemotright> \<lparr>nrm=B,brk=\<lambda> l. UNIV\<rparr>"
\<comment> \<open>Wellformedness of a program will ensure, that every static initialiser
is definetly assigned and the jumps are nested correctly. The case here
for \<^term>\<open>Init\<close> is just for convenience, to get a proper precondition
for the induction hypothesis in various proofs, so that we don't have to
expand the initialisation on every point where it is triggerred by the
evaluation rules.\<close>
| NewC: "Env\<turnstile> B \<guillemotright>\<langle>NewC C\<rangle>\<guillemotright> \<lparr>nrm=B,brk=\<lambda> l. UNIV\<rparr>"
| NewA: "Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> A
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>New T[e]\<rangle>\<guillemotright> A"
| Cast: "Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> A
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Cast T e\<rangle>\<guillemotright> A"
| Inst: "Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> A
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>e InstOf T\<rangle>\<guillemotright> A"
| Lit: "Env\<turnstile> B \<guillemotright>\<langle>Lit v\<rangle>\<guillemotright> \<lparr>nrm=B,brk=\<lambda> l. UNIV\<rparr>"
| UnOp: "Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> A
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>UnOp unop e\<rangle>\<guillemotright> A"
| CondAnd: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e1\<rangle>\<guillemotright> E1; Env\<turnstile> (B \<union> assigns_if True e1) \<guillemotright>\<langle>e2\<rangle>\<guillemotright> E2;
nrm A = B \<union> (assigns_if True (BinOp CondAnd e1 e2) \<inter>
assigns_if False (BinOp CondAnd e1 e2));
brk A = (\<lambda> l. UNIV) \<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>BinOp CondAnd e1 e2\<rangle>\<guillemotright> A"
| CondOr: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e1\<rangle>\<guillemotright> E1; Env\<turnstile> (B \<union> assigns_if False e1) \<guillemotright>\<langle>e2\<rangle>\<guillemotright> E2;
nrm A = B \<union> (assigns_if True (BinOp CondOr e1 e2) \<inter>
assigns_if False (BinOp CondOr e1 e2));
brk A = (\<lambda> l. UNIV) \<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>BinOp CondOr e1 e2\<rangle>\<guillemotright> A"
| BinOp: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e1\<rangle>\<guillemotright> E1; Env\<turnstile> nrm E1 \<guillemotright>\<langle>e2\<rangle>\<guillemotright> A;
binop \<noteq> CondAnd; binop \<noteq> CondOr\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>BinOp binop e1 e2\<rangle>\<guillemotright> A"
| Super: "This \<in> B
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Super\<rangle>\<guillemotright> \<lparr>nrm=B,brk=\<lambda> l. UNIV\<rparr>"
| AccLVar: "\<lbrakk>vn \<in> B;
nrm A = B; brk A = (\<lambda> k. UNIV)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Acc (LVar vn)\<rangle>\<guillemotright> A"
\<comment> \<open>To properly access a local variable we have to test the definite
assignment here. The variable must occur in the set \<^term>\<open>B\<close>\<close>
| Acc: "\<lbrakk>\<forall> vn. v \<noteq> LVar vn;
Env\<turnstile> B \<guillemotright>\<langle>v\<rangle>\<guillemotright> A\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Acc v\<rangle>\<guillemotright> A"
| AssLVar: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> E; nrm A = nrm E \<union> {vn}; brk A = brk E\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>(LVar vn) := e\<rangle>\<guillemotright> A"
| Ass: "\<lbrakk>\<forall> vn. v \<noteq> LVar vn; Env\<turnstile> B \<guillemotright>\<langle>v\<rangle>\<guillemotright> V; Env\<turnstile> nrm V \<guillemotright>\<langle>e\<rangle>\<guillemotright> A\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>v := e\<rangle>\<guillemotright> A"
| CondBool: "\<lbrakk>Env\<turnstile>(c ? e1 : e2)\<Colon>-(PrimT Boolean);
Env\<turnstile> B \<guillemotright>\<langle>c\<rangle>\<guillemotright> C;
Env\<turnstile> (B \<union> assigns_if True c) \<guillemotright>\<langle>e1\<rangle>\<guillemotright> E1;
Env\<turnstile> (B \<union> assigns_if False c) \<guillemotright>\<langle>e2\<rangle>\<guillemotright> E2;
nrm A = B \<union> (assigns_if True (c ? e1 : e2) \<inter>
assigns_if False (c ? e1 : e2));
brk A = (\<lambda> l. UNIV)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>c ? e1 : e2\<rangle>\<guillemotright> A"
| Cond: "\<lbrakk>\<not> Env\<turnstile>(c ? e1 : e2)\<Colon>-(PrimT Boolean);
Env\<turnstile> B \<guillemotright>\<langle>c\<rangle>\<guillemotright> C;
Env\<turnstile> (B \<union> assigns_if True c) \<guillemotright>\<langle>e1\<rangle>\<guillemotright> E1;
Env\<turnstile> (B \<union> assigns_if False c) \<guillemotright>\<langle>e2\<rangle>\<guillemotright> E2;
nrm A = nrm E1 \<inter> nrm E2; brk A = (\<lambda> l. UNIV)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>c ? e1 : e2\<rangle>\<guillemotright> A"
| Call: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> E; Env\<turnstile> nrm E \<guillemotright>\<langle>args\<rangle>\<guillemotright> A\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>{accC,statT,mode}e\<cdot>mn({pTs}args)\<rangle>\<guillemotright> A"
\<comment> \<open>The interplay of \<^term>\<open>Call\<close>, \<^term>\<open>Methd\<close> and \<^term>\<open>Body\<close>:
Why rules for \<^term>\<open>Methd\<close> and \<^term>\<open>Body\<close> at all? Note that a
Java source program will not include bare \<^term>\<open>Methd\<close> or \<^term>\<open>Body\<close>
terms. These terms are just introduced during evaluation. So definite
assignment of \<^term>\<open>Call\<close> does not consider \<^term>\<open>Methd\<close> or
\<^term>\<open>Body\<close> at all. So for definite assignment alone we could omit the
rules for \<^term>\<open>Methd\<close> and \<^term>\<open>Body\<close>.
But since evaluation of the method invocation is
split up into three rules we must ensure that we have enough information
about the call even in the \<^term>\<open>Body\<close> term to make sure that we can
proof type safety. Also we must be able transport this information
from \<^term>\<open>Call\<close> to \<^term>\<open>Methd\<close> and then further to \<^term>\<open>Body\<close>
during evaluation to establish the definite assignment of \<^term>\<open>Methd\<close>
during evaluation of \<^term>\<open>Call\<close>, and of \<^term>\<open>Body\<close> during evaluation
of \<^term>\<open>Methd\<close>. This is necessary since definite assignment will be
a precondition for each induction hypothesis coming out of the evaluation
rules, and therefor we have to establish the definite assignment of the
sub-evaluation during the type-safety proof. Note that well-typedness is
also a precondition for type-safety and so we can omit some assertion
that are already ensured by well-typedness.\<close>
| Methd: "\<lbrakk>methd (prg Env) D sig = Some m;
Env\<turnstile> B \<guillemotright>\<langle>Body (declclass m) (stmt (mbody (mthd m)))\<rangle>\<guillemotright> A
\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Methd D sig\<rangle>\<guillemotright> A"
| Body: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>c\<rangle>\<guillemotright> C; jumpNestingOkS {Ret} c; Result \<in> nrm C;
nrm A = B; brk A = (\<lambda> l. UNIV)\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>Body D c\<rangle>\<guillemotright> A"
\<comment> \<open>Note that \<^term>\<open>A\<close> is not correlated to \<^term>\<open>C\<close>. If the body
statement returns abruptly with return, evaluation of \<^term>\<open>Body\<close>
will absorb this return and complete normally. So we cannot trivially
get the assigned variables of the body statement since it has not
completed normally or with a break.
If the body completes normally we guarantee that the result variable
is set with this rule. But if the body completes abruptly with a return
we can't guarantee that the result variable is set here, since
definite assignment only talks about normal completion and breaks. So
for a return the \<^term>\<open>Jump\<close> rule ensures that the result variable is
set and then this information must be carried over to the \<^term>\<open>Body\<close>
rule by the conformance predicate of the state.\<close>
| LVar: "Env\<turnstile> B \<guillemotright>\<langle>LVar vn\<rangle>\<guillemotright> \<lparr>nrm=B, brk=\<lambda> l. UNIV\<rparr>"
| FVar: "Env\<turnstile> B \<guillemotright>\<langle>e\<rangle>\<guillemotright> A
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>{accC,statDeclC,stat}e..fn\<rangle>\<guillemotright> A"
| AVar: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e1\<rangle>\<guillemotright> E1; Env\<turnstile> nrm E1 \<guillemotright>\<langle>e2\<rangle>\<guillemotright> A\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>e1.[e2]\<rangle>\<guillemotright> A"
| Nil: "Env\<turnstile> B \<guillemotright>\<langle>[]::expr list\<rangle>\<guillemotright> \<lparr>nrm=B, brk=\<lambda> l. UNIV\<rparr>"
| Cons: "\<lbrakk>Env\<turnstile> B \<guillemotright>\<langle>e::expr\<rangle>\<guillemotright> E; Env\<turnstile> nrm E \<guillemotright>\<langle>es\<rangle>\<guillemotright> A\<rbrakk>
\<Longrightarrow>
Env\<turnstile> B \<guillemotright>\<langle>e#es\<rangle>\<guillemotright> A"
definition Unity :: unit ("'(')")
where "() = Abs_unit True"
definition
callee_lcl :: "qtname \<Rightarrow> sig \<Rightarrow> methd \<Rightarrow> lenv" where
"callee_lcl C sig m =
(\<lambda>k. (case k of
EName e
\<Rightarrow> (case e of
VNam v
\<Rightarrow>((table_of (lcls (mbody m)))(pars m [\<mapsto>] parTs sig)) v
| Res \<Rightarrow> Some (resTy m))
| This \<Rightarrow> if is_static m then None else Some (Class C)))"
record env =
prg:: "prog" \<comment> \<open>program\<close>
cls:: "qtname" \<comment> \<open>current package and class name\<close>
lcl:: "lenv" \<comment> \<open>local environment\<close>
abbreviation
wt_stmt_syntax :: "env \<Rightarrow> stmt \<Rightarrow> bool" ("_\<turnstile>_\<Colon>\<surd>" [51,51 ] 50)
where "E\<turnstile>s\<Colon>\<surd> == E\<turnstile>In1r s \<Colon> Inl (PrimT Void)"
abbreviation
is_class :: "prog \<Rightarrow> qtname \<Rightarrow> bool"
where "is_class G C == class G C \<noteq> None"
record mbody = (* method body *)
lcls:: "(vname \<times> ty) list" (* local variables *)
stmt:: stmt
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
datatype jump
= Break label \<comment> \<open>break\<close>
| Cont label \<comment> \<open>continue\<close>
| Ret \<comment> \<open>return from method\<close>
definition insert :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set"
where insert_compr: "insert a B = {x. x = a \<or> x \<in> B}"
primrec jumpNestingOkS :: "jump set \<Rightarrow> stmt \<Rightarrow> bool"
where
"jumpNestingOkS jmps (Skip) = True"
| "jumpNestingOkS jmps (Expr e) = True"
| "jumpNestingOkS jmps (j\<bullet> s) = jumpNestingOkS ({j} \<union> jmps) s"
| "jumpNestingOkS jmps (c1;;c2) = (jumpNestingOkS jmps c1 \<and>
jumpNestingOkS jmps c2)"
| "jumpNestingOkS jmps (If(e) c1 Else c2) = (jumpNestingOkS jmps c1 \<and>
jumpNestingOkS jmps c2)"
| "jumpNestingOkS jmps (l\<bullet> While(e) c) = jumpNestingOkS ({Cont l} \<union> jmps) c"
\<comment> \<open>The label of the while loop only handles continue jumps. Breaks are only
handled by \<^term>\<open>Lab\<close>\<close>
| "jumpNestingOkS jmps (Jmp j) = (j \<in> jmps)"
| "jumpNestingOkS jmps (Throw e) = True"
| "jumpNestingOkS jmps (Try c1 Catch(C vn) c2) = (jumpNestingOkS jmps c1 \<and>
jumpNestingOkS jmps c2)"
| "jumpNestingOkS jmps (c1 Finally c2) = (jumpNestingOkS jmps c1 \<and>
jumpNestingOkS jmps c2)"
| "jumpNestingOkS jmps (Init C) = True"
\<comment> \<open>wellformedness of the program must enshure that for all initializers
jumpNestingOkS {} holds\<close>
\<comment> \<open>Dummy analysis for intermediate smallstep term \<^term>\<open>FinA\<close>\<close>
| "jumpNestingOkS jmps (FinA a c) = False"
definition
is_acc_type :: "prog \<Rightarrow> pname \<Rightarrow> ty \<Rightarrow> bool"
where "is_acc_type G P T = (is_type G T \<and> G\<turnstile>T accessible_in P)"
definition "prod = {f. \<exists>a b. f = Pair_Rep (a::'a) (b::'b)}"
datatype 'a option =
None
| Some (the: 'a)
abbreviation
table_of :: "('a \<times> 'b) list \<Rightarrow> ('a, 'b) table" \<comment> \<open>concrete table\<close>
where "table_of \<equiv> map_of"
definition
mhead :: "methd \<Rightarrow> mhead"
where "mhead m = \<lparr>access=access m, static=static m, pars=pars m, resT=resT m\<rparr>"
datatype (set: 'a) list =
Nil ("[]")
| Cons (hd: 'a) (tl: "'a list") (infixr "#" 65)
for
map: map
rel: list_all2
pred: list_all
where
"tl [] = []"
record methd = mhead + (* method in a class *)
mbody::mbody
record mbody = (* method body *)
lcls:: "(vname \<times> ty) list" (* local variables *)
stmt:: stmt
definition unique :: "('a \<times> 'b) list \<Rightarrow> bool"
where "unique = distinct \<circ> map fst"
definition
mhead :: "methd \<Rightarrow> mhead"
where "mhead m = \<lparr>access=access m, static=static m, pars=pars m, resT=resT m\<rparr>"
record qtname = \<comment> \<open>qualified tname cf. 6.5.3, 6.5.4\<close>
pid :: pname
tid :: tname
definition
wf_mhead :: "prog \<Rightarrow> pname \<Rightarrow> sig \<Rightarrow> mhead \<Rightarrow> bool" where
"wf_mhead G P = (\<lambda> sig mh. length (parTs sig) = length (pars mh) \<and>
( \<forall>T\<in>set (parTs sig). is_acc_type G P T) \<and>
is_acc_type G P (resTy mh) \<and>
distinct (pars mh))"
definition
wf_mdecl :: "prog \<Rightarrow> qtname \<Rightarrow> mdecl \<Rightarrow> bool" where
"wf_mdecl G C =
(\<lambda>(sig,m).
wf_mhead G (pid C) sig (mhead m) \<and>
unique (lcls (mbody m)) \<and>
(\<forall>(vn,T)\<in>set (lcls (mbody m)). is_acc_type G (pid C) T) \<and>
(\<forall>pn\<in>set (pars m). table_of (lcls (mbody m)) pn = None) \<and>
jumpNestingOkS {Ret} (stmt (mbody m)) \<and>
is_class G C \<and>
\<lparr>prg=G,cls=C,lcl=callee_lcl C sig m\<rparr>\<turnstile>(stmt (mbody m))\<Colon>\<surd> \<and>
(\<exists> A. \<lparr>prg=G,cls=C,lcl=callee_lcl C sig m\<rparr>
\<turnstile> parameters m \<guillemotright>\<langle>stmt (mbody m)\<rangle>\<guillemotright> A
\<and> Result \<in> nrm A))"
|
###output
\<lbrakk> ?H1 x_1 x_2 (x_3, x_4); \<lbrakk> ?H2 x_1 (?H3 x_2) x_3 (?H4 x_4); ?H5 (?H6 (?H7 x_4)); \<forall>y_0\<in> ?H8 (?H9 x_4). ?H10 (?H6 (?H7 x_4)) y_0 = ?H11; Ball (?H8 (?H6 (?H7 x_4))) (?H12 (\<lambda>y_1. ?H13 x_1 (?H3 x_2))); ?H14 (?H15 ?H16 ?H17) (?H18 (?H7 x_4)); ?H19 x_1 x_2; ?H20 (?H21 x_1 x_2 (?H22 x_2 x_3 x_4) ?H23) (?H18 (?H7 x_4)); \<exists>y_3. ?H24 (?H21 x_1 x_2 (?H22 x_2 x_3 x_4) ?H23) (?H25 x_4) (?H26 (?H18 (?H7 x_4))) y_3 \<and> ?H27 \<in> ?H28 y_3\<rbrakk> \<Longrightarrow> x_5\<rbrakk> \<Longrightarrow> x_5###end
|
Nonstandard_Analysis/Star
|
Star.starfun_const_fun
|
lemma starfun_const_fun [simp]: "\<And>x. ( *f* (\<lambda>x. k)) x = star_of k"
|
(*f* (\<lambda>x. ?k)) ?x = star_of ?k
|
?H1 (\<lambda>y_0. x_1) x_2 = ?H2 x_1
|
[
"StarDef.star_of",
"StarDef.starfun"
] |
[
"'a \\<Rightarrow> 'a star",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a star \\<Rightarrow> 'b star"
] |
[
"definition star_of :: \"'a \\<Rightarrow> 'a star\"\n where \"star_of x \\<equiv> star_n (\\<lambda>n. x)\"",
"definition starfun :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a star \\<Rightarrow> 'b star\" (\\<open>*f* _\\<close> [80] 80)\n where \"starfun f \\<equiv> \\<lambda>x. star_of f \\<star> x\""
] |
template
|
###lemma
(*f* (\<lambda>x. ?k)) ?x = star_of ?k
###symbols
StarDef.star_of :::: 'a \<Rightarrow> 'a star
StarDef.starfun :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a star \<Rightarrow> 'b star
###defs
definition star_of :: "'a \<Rightarrow> 'a star"
where "star_of x \<equiv> star_n (\<lambda>n. x)"
definition starfun :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a star \<Rightarrow> 'b star" (\<open>*f* _\<close> [80] 80)
where "starfun f \<equiv> \<lambda>x. star_of f \<star> x"
|
###output
?H1 (\<lambda>y_0. x_1) x_2 = ?H2 x_1###end
|
Library/Extended
|
Extended.max_extended_simps(1)
|
lemma max_extended_simps[simp]:
"max (Fin x) (Fin y) = Fin(max x y)"
"max xx Pinf = Pinf"
"max xx Minf = xx"
"max Pinf yy = Pinf"
"max Minf yy = yy"
|
max (Fin ?x) (Fin ?y) = Fin (max ?x ?y)
|
?H1 (?H2 x_1) (?H2 x_2) = ?H2 (?H1 x_1 x_2)
|
[
"Extended.extended.Fin",
"Orderings.ord_class.max"
] |
[
"'a \\<Rightarrow> 'a extended",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a"
] |
[
"datatype 'a extended = Fin 'a | Pinf (\"\\<infinity>\") | Minf (\"-\\<infinity>\")",
"class ord =\n fixes less_eq :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\n and less :: \"'a \\<Rightarrow> 'a \\<Rightarrow> bool\"\nbegin"
] |
template
|
###lemma
max (Fin ?x) (Fin ?y) = Fin (max ?x ?y)
###symbols
Extended.extended.Fin :::: 'a \<Rightarrow> 'a extended
Orderings.ord_class.max :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
###defs
datatype 'a extended = Fin 'a | Pinf ("\<infinity>") | Minf ("-\<infinity>")
class ord =
fixes less_eq :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
and less :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
begin
|
###output
?H1 (?H2 x_1) (?H2 x_2) = ?H2 (?H1 x_1 x_2)###end
|
Probability/Probability_Mass_Function
|
Probability_Mass_Function.measure_Ici
| null |
rel_pmf ?R ?p ?q \<Longrightarrow> reflp ?R \<Longrightarrow> transp ?R \<Longrightarrow> measure_pmf.prob ?p {y. ?R ?x y} \<le> measure_pmf.prob ?q {y. ?R ?x y}
|
\<lbrakk> ?H1 x_1 x_2 x_3; ?H2 x_1; ?H3 x_1\<rbrakk> \<Longrightarrow> ?H4 x_2 (?H5 (x_1 x_4)) \<le> ?H4 x_3 (?H5 (x_1 x_4))
|
[
"Set.Collect",
"Probability_Mass_Function.measure_pmf.prob",
"Relation.transp",
"Relation.reflp",
"Probability_Mass_Function.rel_pmf"
] |
[
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set",
"'a pmf \\<Rightarrow> 'a set \\<Rightarrow> real",
"('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> bool",
"('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> bool",
"('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> 'a pmf \\<Rightarrow> 'b pmf \\<Rightarrow> bool"
] |
[
"abbreviation transp :: \"('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> bool\" where\n \"transp \\<equiv> transp_on UNIV\"",
"abbreviation reflp :: \"('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> bool\"\n where \"reflp \\<equiv> reflp_on UNIV\"",
"inductive rel_pmf :: \"('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> 'a pmf \\<Rightarrow> 'b pmf \\<Rightarrow> bool\"\nfor R p q\nwhere\n \"\\<lbrakk> \\<And>x y. (x, y) \\<in> set_pmf pq \\<Longrightarrow> R x y;\n map_pmf fst pq = p; map_pmf snd pq = q \\<rbrakk>\n \\<Longrightarrow> rel_pmf R p q\""
] |
template
|
###lemma
rel_pmf ?R ?p ?q \<Longrightarrow> reflp ?R \<Longrightarrow> transp ?R \<Longrightarrow> measure_pmf.prob ?p {y. ?R ?x y} \<le> measure_pmf.prob ?q {y. ?R ?x y}
###symbols
Set.Collect :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a set
Probability_Mass_Function.measure_pmf.prob :::: 'a pmf \<Rightarrow> 'a set \<Rightarrow> real
Relation.transp :::: ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool
Relation.reflp :::: ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool
Probability_Mass_Function.rel_pmf :::: ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a pmf \<Rightarrow> 'b pmf \<Rightarrow> bool
###defs
abbreviation transp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" where
"transp \<equiv> transp_on UNIV"
abbreviation reflp :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool"
where "reflp \<equiv> reflp_on UNIV"
inductive rel_pmf :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> 'a pmf \<Rightarrow> 'b pmf \<Rightarrow> bool"
for R p q
where
"\<lbrakk> \<And>x y. (x, y) \<in> set_pmf pq \<Longrightarrow> R x y;
map_pmf fst pq = p; map_pmf snd pq = q \<rbrakk>
\<Longrightarrow> rel_pmf R p q"
|
###output
\<lbrakk> ?H1 x_1 x_2 x_3; ?H2 x_1; ?H3 x_1\<rbrakk> \<Longrightarrow> ?H4 x_2 (?H5 (x_1 x_4)) \<le> ?H4 x_3 (?H5 (x_1 x_4))###end
|
Matrix_LP/ComputeNumeral
|
ComputeNumeral.compute_div_mod(221)
| null |
Parity.adjust_mod ?l ?r = (if ?r = 0 then 0 else numeral ?l - ?r)
|
?H1 x_1 x_2 = (if x_2 = ?H2 then ?H2 else ?H3 (?H4 x_1) x_2)
|
[
"Num.numeral_class.numeral",
"Groups.minus_class.minus",
"Groups.zero_class.zero",
"Parity.adjust_mod"
] |
[
"num \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a",
"num \\<Rightarrow> int \\<Rightarrow> int"
] |
[
"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 minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"class zero =\n fixes zero :: 'a (\"0\")",
"definition adjust_mod :: \"num \\<Rightarrow> int \\<Rightarrow> int\"\nwhere\n [simp]: \"adjust_mod l r = (if r = 0 then 0 else numeral l - r)\""
] |
template
|
###lemma
Parity.adjust_mod ?l ?r = (if ?r = 0 then 0 else numeral ?l - ?r)
###symbols
Num.numeral_class.numeral :::: num \<Rightarrow> 'a
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Groups.zero_class.zero :::: 'a
Parity.adjust_mod :::: num \<Rightarrow> int \<Rightarrow> int
###defs
primrec numeral :: "num \<Rightarrow> 'a"
where
numeral_One: "numeral One = 1"
| numeral_Bit0: "numeral (Bit0 n) = numeral n + numeral n"
| numeral_Bit1: "numeral (Bit1 n) = numeral n + numeral n + 1"
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
class zero =
fixes zero :: 'a ("0")
definition adjust_mod :: "num \<Rightarrow> int \<Rightarrow> int"
where
[simp]: "adjust_mod l r = (if r = 0 then 0 else numeral l - r)"
|
###output
?H1 x_1 x_2 = (if x_2 = ?H2 then ?H2 else ?H3 (?H4 x_1) x_2)###end
|
Analysis/Starlike
|
Starlike.affine_hull_2_alt
|
lemma affine_hull_2_alt:
fixes a b :: "'a::real_vector"
shows "affine hull {a,b} = range (\<lambda>u. a + u *\<^sub>R (b - a))"
|
affine hull { ?a, ?b} = range (\<lambda>u. ?a + u *\<^sub>R (?b - ?a))
|
?H1 ?H2 (?H3 x_1 (?H3 x_2 ?H4)) = ?H5 (\<lambda>y_0. ?H6 x_1 (?H7 y_0 (?H8 x_2 x_1)))
|
[
"Groups.minus_class.minus",
"Real_Vector_Spaces.scaleR_class.scaleR",
"Groups.plus_class.plus",
"Set.range",
"Set.empty",
"Set.insert",
"Affine.affine",
"Hull.hull"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"real \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set",
"'a set",
"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> bool",
"('a set \\<Rightarrow> bool) \\<Rightarrow> 'a set \\<Rightarrow> 'a set"
] |
[
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"class scaleR =\n fixes scaleR :: \"real \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixr \"*\\<^sub>R\" 75)\nbegin",
"class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)",
"abbreviation range :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set\" \\<comment> \\<open>of function\\<close>\n where \"range f \\<equiv> f ` UNIV\"",
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"definition insert :: \"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set\"\n where insert_compr: \"insert a B = {x. x = a \\<or> x \\<in> B}\"",
"definition hull :: \"('a set \\<Rightarrow> bool) \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"hull\" 75)\n where \"S hull s = \\<Inter>{t. S t \\<and> s \\<subseteq> t}\""
] |
template
|
###lemma
affine hull { ?a, ?b} = range (\<lambda>u. ?a + u *\<^sub>R (?b - ?a))
###symbols
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Real_Vector_Spaces.scaleR_class.scaleR :::: real \<Rightarrow> 'a \<Rightarrow> 'a
Groups.plus_class.plus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Set.range :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b set
Set.empty :::: 'a set
Set.insert :::: 'a \<Rightarrow> 'a set \<Rightarrow> 'a set
Affine.affine :::: 'a set \<Rightarrow> bool
Hull.hull :::: ('a set \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set
###defs
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
class scaleR =
fixes scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a" (infixr "*\<^sub>R" 75)
begin
class plus =
fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "+" 65)
abbreviation range :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b set" \<comment> \<open>of function\<close>
where "range f \<equiv> f ` UNIV"
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
definition insert :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set"
where insert_compr: "insert a B = {x. x = a \<or> x \<in> B}"
definition hull :: "('a set \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "hull" 75)
where "S hull s = \<Inter>{t. S t \<and> s \<subseteq> t}"
|
###output
?H1 ?H2 (?H3 x_1 (?H3 x_2 ?H4)) = ?H5 (\<lambda>y_0. ?H6 x_1 (?H7 y_0 (?H8 x_2 x_1)))###end
|
Set
|
Set.member_filter
|
lemma member_filter [simp]: "x \<in> Set.filter P A \<longleftrightarrow> x \<in> A \<and> P x"
|
(?x \<in> Set.filter ?P ?A) = (?x \<in> ?A \<and> ?P ?x)
|
(x_1 \<in> ?H1 x_2 x_3) = (x_1 \<in> x_3 \<and> x_2 x_1)
|
[
"Set.filter"
] |
[
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set \\<Rightarrow> 'a set"
] |
[
"definition filter :: \"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set \\<Rightarrow> 'a set\"\n where [code_abbrev]: \"filter P A = {a \\<in> A. P a}\""
] |
template
|
###lemma
(?x \<in> Set.filter ?P ?A) = (?x \<in> ?A \<and> ?P ?x)
###symbols
Set.filter :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set
###defs
definition filter :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set"
where [code_abbrev]: "filter P A = {a \<in> A. P a}"
|
###output
(x_1 \<in> ?H1 x_2 x_3) = (x_1 \<in> x_3 \<and> x_2 x_1)###end
|
Nominal/Examples/SOS
|
SOS.Vs_reduce_to_themselves
|
lemma Vs_reduce_to_themselves:
assumes a: "v \<in> V T"
shows "v \<Down> v"
|
?v \<in> V ?T \<Longrightarrow> ?v \<Down> ?v
|
x_1 \<in> ?H1 x_2 \<Longrightarrow> ?H2 x_1 x_1
|
[
"SOS.big",
"SOS.V"
] |
[
"trm \\<Rightarrow> trm \\<Rightarrow> bool",
"ty \\<Rightarrow> trm set"
] |
[] |
template
|
###lemma
?v \<in> V ?T \<Longrightarrow> ?v \<Down> ?v
###symbols
SOS.big :::: trm \<Rightarrow> trm \<Rightarrow> bool
SOS.V :::: ty \<Rightarrow> trm set
###defs
|
###output
x_1 \<in> ?H1 x_2 \<Longrightarrow> ?H2 x_1 x_1###end
|
Proofs/Lambda/NormalForm
|
NormalForm.Abs_NF
|
lemma Abs_NF:
assumes NF: "NF (Abs t \<degree>\<degree> ts)"
shows "ts = []"
|
NF (Abs ?t \<degree>\<degree> ?ts) \<Longrightarrow> ?ts = []
|
?H1 (?H2 (?H3 x_1) x_2) \<Longrightarrow> x_2 = ?H4
|
[
"List.list.Nil",
"Lambda.dB.Abs",
"ListApplication.list_application",
"NormalForm.NF"
] |
[
"'a list",
"dB \\<Rightarrow> dB",
"dB \\<Rightarrow> dB list \\<Rightarrow> dB",
"dB \\<Rightarrow> bool"
] |
[
"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 dB =\n Var nat\n | App dB dB (infixl \"\\<degree>\" 200)\n | Abs dB"
] |
template
|
###lemma
NF (Abs ?t \<degree>\<degree> ?ts) \<Longrightarrow> ?ts = []
###symbols
List.list.Nil :::: 'a list
Lambda.dB.Abs :::: dB \<Rightarrow> dB
ListApplication.list_application :::: dB \<Rightarrow> dB list \<Rightarrow> dB
NormalForm.NF :::: dB \<Rightarrow> bool
###defs
datatype (set: 'a) list =
Nil ("[]")
| Cons (hd: 'a) (tl: "'a list") (infixr "#" 65)
for
map: map
rel: list_all2
pred: list_all
where
"tl [] = []"
datatype dB =
Var nat
| App dB dB (infixl "\<degree>" 200)
| Abs dB
|
###output
?H1 (?H2 (?H3 x_1) x_2) \<Longrightarrow> x_2 = ?H4###end
|
Decision_Procs/Parametric_Ferrante_Rackoff
|
Parametric_Ferrante_Rackoff.simptm_ci
|
lemma simptm_ci[simp]: "Itm vs bs (simptm t) = Itm vs bs t"
|
Itm ?vs ?bs (simptm ?t) = Itm ?vs ?bs ?t
|
?H1 x_1 x_2 (?H2 x_3) = ?H1 x_1 x_2 x_3
|
[
"Parametric_Ferrante_Rackoff.simptm",
"Parametric_Ferrante_Rackoff.Itm"
] |
[
"tm \\<Rightarrow> tm",
"'a list \\<Rightarrow> 'a list \\<Rightarrow> tm \\<Rightarrow> 'a"
] |
[
"fun simptm :: \"tm \\<Rightarrow> tm\"\n where\n \"simptm (CP j) = CP (polynate j)\"\n | \"simptm (Bound n) = CNP n (1)\\<^sub>p (CP 0\\<^sub>p)\"\n | \"simptm (Neg t) = tmneg (simptm t)\"\n | \"simptm (Add t s) = tmadd (simptm t) (simptm s)\"\n | \"simptm (Sub t s) = tmsub (simptm t) (simptm s)\"\n | \"simptm (Mul i t) =\n (let i' = polynate i in if i' = 0\\<^sub>p then CP 0\\<^sub>p else tmmul (simptm t) i')\"\n | \"simptm (CNP n c t) =\n (let c' = polynate c in if c' = 0\\<^sub>p then simptm t else tmadd (CNP n c' (CP 0\\<^sub>p)) (simptm t))\"",
"primrec Itm :: \"'a::field_char_0 list \\<Rightarrow> 'a list \\<Rightarrow> tm \\<Rightarrow> 'a\"\n where\n \"Itm vs bs (CP c) = (Ipoly vs c)\"\n | \"Itm vs bs (Bound n) = bs!n\"\n | \"Itm vs bs (Neg a) = -(Itm vs bs a)\"\n | \"Itm vs bs (Add a b) = Itm vs bs a + Itm vs bs b\"\n | \"Itm vs bs (Sub a b) = Itm vs bs a - Itm vs bs b\"\n | \"Itm vs bs (Mul c a) = (Ipoly vs c) * Itm vs bs a\"\n | \"Itm vs bs (CNP n c t) = (Ipoly vs c)*(bs!n) + Itm vs bs t\""
] |
template
|
###lemma
Itm ?vs ?bs (simptm ?t) = Itm ?vs ?bs ?t
###symbols
Parametric_Ferrante_Rackoff.simptm :::: tm \<Rightarrow> tm
Parametric_Ferrante_Rackoff.Itm :::: 'a list \<Rightarrow> 'a list \<Rightarrow> tm \<Rightarrow> 'a
###defs
fun simptm :: "tm \<Rightarrow> tm"
where
"simptm (CP j) = CP (polynate j)"
| "simptm (Bound n) = CNP n (1)\<^sub>p (CP 0\<^sub>p)"
| "simptm (Neg t) = tmneg (simptm t)"
| "simptm (Add t s) = tmadd (simptm t) (simptm s)"
| "simptm (Sub t s) = tmsub (simptm t) (simptm s)"
| "simptm (Mul i t) =
(let i' = polynate i in if i' = 0\<^sub>p then CP 0\<^sub>p else tmmul (simptm t) i')"
| "simptm (CNP n c t) =
(let c' = polynate c in if c' = 0\<^sub>p then simptm t else tmadd (CNP n c' (CP 0\<^sub>p)) (simptm t))"
primrec Itm :: "'a::field_char_0 list \<Rightarrow> 'a list \<Rightarrow> tm \<Rightarrow> 'a"
where
"Itm vs bs (CP c) = (Ipoly vs c)"
| "Itm vs bs (Bound n) = bs!n"
| "Itm vs bs (Neg a) = -(Itm vs bs a)"
| "Itm vs bs (Add a b) = Itm vs bs a + Itm vs bs b"
| "Itm vs bs (Sub a b) = Itm vs bs a - Itm vs bs b"
| "Itm vs bs (Mul c a) = (Ipoly vs c) * Itm vs bs a"
| "Itm vs bs (CNP n c t) = (Ipoly vs c)*(bs!n) + Itm vs bs t"
|
###output
?H1 x_1 x_2 (?H2 x_3) = ?H1 x_1 x_2 x_3###end
|
Orderings
|
Orderings.predicate2D
|
lemma predicate2D:
"P \<le> Q \<Longrightarrow> P x y \<Longrightarrow> Q x y"
|
?P \<le> ?Q \<Longrightarrow> ?P ?x ?y \<Longrightarrow> ?Q ?x ?y
|
\<lbrakk>x_1 \<le> x_2; x_1 x_3 x_4\<rbrakk> \<Longrightarrow> x_2 x_3 x_4
|
[] |
[] |
[] |
template
|
###lemma
?P \<le> ?Q \<Longrightarrow> ?P ?x ?y \<Longrightarrow> ?Q ?x ?y
###symbols
###defs
|
###output
\<lbrakk>x_1 \<le> x_2; x_1 x_3 x_4\<rbrakk> \<Longrightarrow> x_2 x_3 x_4###end
|
Auth/Yahalom2
|
Yahalom2.B_trusts_YM4_shrK
|
lemma B_trusts_YM4_shrK:
"\<lbrakk>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key K, Nonce NB\<rbrace>
\<in> parts (knows Spy evs);
B \<notin> bad; evs \<in> yahalom\<rbrakk>
\<Longrightarrow> \<exists>NA. Says Server A
\<lbrace>Nonce NB,
Crypt (shrK A) \<lbrace>Agent B, Key K, Nonce NA\<rbrace>,
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key K, Nonce NB\<rbrace>\<rbrace>
\<in> set evs"
|
Crypt (shrK ?B) \<lbrace>Agent ?A, Agent ?B, Key ?K, Nonce ?NB\<rbrace> \<in> parts (knows Spy ?evs) \<Longrightarrow> ?B \<notin> bad \<Longrightarrow> ?evs \<in> yahalom \<Longrightarrow> \<exists>NA. Says Server ?A \<lbrace>Nonce ?NB, Crypt (shrK ?A) \<lbrace>Agent ?B, Key ?K, Nonce NA\<rbrace>, Crypt (shrK ?B) \<lbrace>Agent ?A, Agent ?B, Key ?K, Nonce ?NB\<rbrace>\<rbrace> \<in> set ?evs
|
\<lbrakk> ?H1 (?H2 x_1) (?H3 (?H4 x_2) (?H3 (?H4 x_1) (?H3 (?H5 x_3) (?H6 x_4)))) \<in> ?H7 (?H8 ?H9 x_5); ?H10 x_1 ?H11; x_5 \<in> ?H12\<rbrakk> \<Longrightarrow> \<exists>y_0. ?H13 ?H14 x_2 (?H3 (?H6 x_4) (?H3 (?H1 (?H2 x_2) (?H3 (?H4 x_1) (?H3 (?H5 x_3) (?H6 y_0)))) (?H1 (?H2 x_1) (?H3 (?H4 x_2) (?H3 (?H4 x_1) (?H3 (?H5 x_3) (?H6 x_4))))))) \<in> ?H15 x_5
|
[
"List.list.set",
"Message.agent.Server",
"Event.event.Says",
"Yahalom2.yahalom",
"Event.bad",
"Set.not_member",
"Message.agent.Spy",
"Event.knows",
"Message.parts",
"Message.msg.Nonce",
"Message.msg.Key",
"Message.msg.Agent",
"Message.msg.MPair",
"Public.shrK",
"Message.msg.Crypt"
] |
[
"'a list \\<Rightarrow> 'a set",
"agent",
"agent \\<Rightarrow> agent \\<Rightarrow> msg \\<Rightarrow> event",
"event list set",
"agent set",
"'a \\<Rightarrow> 'a set \\<Rightarrow> bool",
"agent",
"agent \\<Rightarrow> event list \\<Rightarrow> msg set",
"msg set \\<Rightarrow> msg set",
"nat \\<Rightarrow> msg",
"nat \\<Rightarrow> msg",
"agent \\<Rightarrow> msg",
"msg \\<Rightarrow> msg \\<Rightarrow> msg",
"agent \\<Rightarrow> nat",
"nat \\<Rightarrow> msg \\<Rightarrow> msg"
] |
[
"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\n event = Says agent agent msg\n | Gets agent msg\n | Notes agent msg",
"inductive_set yahalom :: \"event list set\"\n where\n (*Initial trace is empty*)\n Nil: \"[] \\<in> yahalom\"\n\n (*The spy MAY say anything he CAN say. We do not expect him to\n invent new nonces here, but he can also use NS1. Common to\n all similar protocols.*)\n | Fake: \"\\<lbrakk>evsf \\<in> yahalom; X \\<in> synth (analz (knows Spy evsf))\\<rbrakk>\n \\<Longrightarrow> Says Spy B X # evsf \\<in> yahalom\"\n\n (*A message that has been sent can be received by the\n intended recipient.*)\n | Reception: \"\\<lbrakk>evsr \\<in> yahalom; Says A B X \\<in> set evsr\\<rbrakk>\n \\<Longrightarrow> Gets B X # evsr \\<in> yahalom\"\n\n (*Alice initiates a protocol run*)\n | YM1: \"\\<lbrakk>evs1 \\<in> yahalom; Nonce NA \\<notin> used evs1\\<rbrakk>\n \\<Longrightarrow> Says A B \\<lbrace>Agent A, Nonce NA\\<rbrace> # evs1 \\<in> yahalom\"\n\n (*Bob's response to Alice's message.*)\n | YM2: \"\\<lbrakk>evs2 \\<in> yahalom; Nonce NB \\<notin> used evs2;\n Gets B \\<lbrace>Agent A, Nonce NA\\<rbrace> \\<in> set evs2\\<rbrakk>\n \\<Longrightarrow> Says B Server\n \\<lbrace>Agent B, Nonce NB, Crypt (shrK B) \\<lbrace>Agent A, Nonce NA\\<rbrace>\\<rbrace>\n # evs2 \\<in> yahalom\"\n\n (*The Server receives Bob's message. He responds by sending a\n new session key to Alice, with a certificate for forwarding to Bob.\n Both agents are quoted in the 2nd certificate to prevent attacks!*)\n | YM3: \"\\<lbrakk>evs3 \\<in> yahalom; Key KAB \\<notin> used evs3;\n Gets Server \\<lbrace>Agent B, Nonce NB,\n Crypt (shrK B) \\<lbrace>Agent A, Nonce NA\\<rbrace>\\<rbrace>\n \\<in> set evs3\\<rbrakk>\n \\<Longrightarrow> Says Server A\n \\<lbrace>Nonce NB,\n Crypt (shrK A) \\<lbrace>Agent B, Key KAB, Nonce NA\\<rbrace>,\n Crypt (shrK B) \\<lbrace>Agent A, Agent B, Key KAB, Nonce NB\\<rbrace>\\<rbrace>\n # evs3 \\<in> yahalom\"\n\n (*Alice receives the Server's (?) message, checks her Nonce, and\n uses the new session key to send Bob his Nonce.*)\n | YM4: \"\\<lbrakk>evs4 \\<in> yahalom;\n Gets A \\<lbrace>Nonce NB, Crypt (shrK A) \\<lbrace>Agent B, Key K, Nonce NA\\<rbrace>,\n X\\<rbrace> \\<in> set evs4;\n Says A B \\<lbrace>Agent A, Nonce NA\\<rbrace> \\<in> set evs4\\<rbrakk>\n \\<Longrightarrow> Says A B \\<lbrace>X, Crypt K (Nonce NB)\\<rbrace> # evs4 \\<in> yahalom\"\n\n (*This message models possible leaks of session keys. The nonces\n identify the protocol run. Quoting Server here ensures they are\n correct. *)\n | Oops: \"\\<lbrakk>evso \\<in> yahalom;\n Says Server A \\<lbrace>Nonce NB,\n Crypt (shrK A) \\<lbrace>Agent B, Key K, Nonce NA\\<rbrace>,\n X\\<rbrace> \\<in> set evso\\<rbrakk>\n \\<Longrightarrow> Notes Spy \\<lbrace>Nonce NA, Nonce NB, Key K\\<rbrace> # evso \\<in> yahalom\"",
"consts \n bad :: \"agent set\" \\<comment> \\<open>compromised agents\\<close>",
"abbreviation not_member\n where \"not_member x A \\<equiv> \\<not> (x \\<in> A)\" \\<comment> \\<open>non-membership\\<close>",
"primrec knows :: \"agent \\<Rightarrow> event list \\<Rightarrow> msg set\"\nwhere\n knows_Nil: \"knows A [] = initState A\"\n| knows_Cons:\n \"knows A (ev # evs) =\n (if A = Spy then \n (case ev of\n Says A' B X \\<Rightarrow> insert X (knows Spy evs)\n | Gets A' X \\<Rightarrow> knows Spy evs\n | Notes A' X \\<Rightarrow> \n if A' \\<in> bad then insert X (knows Spy evs) else knows Spy evs)\n else\n (case ev of\n Says A' B X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs\n | Gets A' X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs\n | Notes A' X \\<Rightarrow> \n if A'=A then insert X (knows A evs) else knows A evs))\"",
"inductive_set\n parts :: \"msg set \\<Rightarrow> msg set\"\n for H :: \"msg set\"\n where\n Inj [intro]: \"X \\<in> H \\<Longrightarrow> X \\<in> parts H\"\n | Fst: \"\\<lbrace>X,Y\\<rbrace> \\<in> parts H \\<Longrightarrow> X \\<in> parts H\"\n | Snd: \"\\<lbrace>X,Y\\<rbrace> \\<in> parts H \\<Longrightarrow> Y \\<in> parts H\"\n | Body: \"Crypt K X \\<in> parts H \\<Longrightarrow> X \\<in> parts H\"",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>",
"consts\n shrK :: \"agent => key\" \\<comment> \\<open>long-term shared keys\\<close>",
"datatype\n msg = Agent agent \\<comment> \\<open>Agent names\\<close>\n | Number nat \\<comment> \\<open>Ordinary integers, timestamps, ...\\<close>\n | Nonce nat \\<comment> \\<open>Unguessable nonces\\<close>\n | Key key \\<comment> \\<open>Crypto keys\\<close>\n | Hash msg \\<comment> \\<open>Hashing\\<close>\n | MPair msg msg \\<comment> \\<open>Compound messages\\<close>\n | Crypt key msg \\<comment> \\<open>Encryption, public- or shared-key\\<close>"
] |
template
|
###lemma
Crypt (shrK ?B) \<lbrace>Agent ?A, Agent ?B, Key ?K, Nonce ?NB\<rbrace> \<in> parts (knows Spy ?evs) \<Longrightarrow> ?B \<notin> bad \<Longrightarrow> ?evs \<in> yahalom \<Longrightarrow> \<exists>NA. Says Server ?A \<lbrace>Nonce ?NB, Crypt (shrK ?A) \<lbrace>Agent ?B, Key ?K, Nonce NA\<rbrace>, Crypt (shrK ?B) \<lbrace>Agent ?A, Agent ?B, Key ?K, Nonce ?NB\<rbrace>\<rbrace> \<in> set ?evs
###symbols
List.list.set :::: 'a list \<Rightarrow> 'a set
Message.agent.Server :::: agent
Event.event.Says :::: agent \<Rightarrow> agent \<Rightarrow> msg \<Rightarrow> event
Yahalom2.yahalom :::: event list set
Event.bad :::: agent set
Set.not_member :::: 'a \<Rightarrow> 'a set \<Rightarrow> bool
Message.agent.Spy :::: agent
Event.knows :::: agent \<Rightarrow> event list \<Rightarrow> msg set
Message.parts :::: msg set \<Rightarrow> msg set
Message.msg.Nonce :::: nat \<Rightarrow> msg
Message.msg.Key :::: nat \<Rightarrow> msg
Message.msg.Agent :::: agent \<Rightarrow> msg
Message.msg.MPair :::: msg \<Rightarrow> msg \<Rightarrow> msg
Public.shrK :::: agent \<Rightarrow> nat
Message.msg.Crypt :::: nat \<Rightarrow> msg \<Rightarrow> msg
###defs
datatype (set: 'a) list =
Nil ("[]")
| Cons (hd: 'a) (tl: "'a list") (infixr "#" 65)
for
map: map
rel: list_all2
pred: list_all
where
"tl [] = []"
datatype
event = Says agent agent msg
| Gets agent msg
| Notes agent msg
inductive_set yahalom :: "event list set"
where
(*Initial trace is empty*)
Nil: "[] \<in> yahalom"
(*The spy MAY say anything he CAN say. We do not expect him to
invent new nonces here, but he can also use NS1. Common to
all similar protocols.*)
| Fake: "\<lbrakk>evsf \<in> yahalom; X \<in> synth (analz (knows Spy evsf))\<rbrakk>
\<Longrightarrow> Says Spy B X # evsf \<in> yahalom"
(*A message that has been sent can be received by the
intended recipient.*)
| Reception: "\<lbrakk>evsr \<in> yahalom; Says A B X \<in> set evsr\<rbrakk>
\<Longrightarrow> Gets B X # evsr \<in> yahalom"
(*Alice initiates a protocol run*)
| YM1: "\<lbrakk>evs1 \<in> yahalom; Nonce NA \<notin> used evs1\<rbrakk>
\<Longrightarrow> Says A B \<lbrace>Agent A, Nonce NA\<rbrace> # evs1 \<in> yahalom"
(*Bob's response to Alice's message.*)
| YM2: "\<lbrakk>evs2 \<in> yahalom; Nonce NB \<notin> used evs2;
Gets B \<lbrace>Agent A, Nonce NA\<rbrace> \<in> set evs2\<rbrakk>
\<Longrightarrow> Says B Server
\<lbrace>Agent B, Nonce NB, Crypt (shrK B) \<lbrace>Agent A, Nonce NA\<rbrace>\<rbrace>
# evs2 \<in> yahalom"
(*The Server receives Bob's message. He responds by sending a
new session key to Alice, with a certificate for forwarding to Bob.
Both agents are quoted in the 2nd certificate to prevent attacks!*)
| YM3: "\<lbrakk>evs3 \<in> yahalom; Key KAB \<notin> used evs3;
Gets Server \<lbrace>Agent B, Nonce NB,
Crypt (shrK B) \<lbrace>Agent A, Nonce NA\<rbrace>\<rbrace>
\<in> set evs3\<rbrakk>
\<Longrightarrow> Says Server A
\<lbrace>Nonce NB,
Crypt (shrK A) \<lbrace>Agent B, Key KAB, Nonce NA\<rbrace>,
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key KAB, Nonce NB\<rbrace>\<rbrace>
# evs3 \<in> yahalom"
(*Alice receives the Server's (?) message, checks her Nonce, and
uses the new session key to send Bob his Nonce.*)
| YM4: "\<lbrakk>evs4 \<in> yahalom;
Gets A \<lbrace>Nonce NB, Crypt (shrK A) \<lbrace>Agent B, Key K, Nonce NA\<rbrace>,
X\<rbrace> \<in> set evs4;
Says A B \<lbrace>Agent A, Nonce NA\<rbrace> \<in> set evs4\<rbrakk>
\<Longrightarrow> Says A B \<lbrace>X, Crypt K (Nonce NB)\<rbrace> # evs4 \<in> yahalom"
(*This message models possible leaks of session keys. The nonces
identify the protocol run. Quoting Server here ensures they are
correct. *)
| Oops: "\<lbrakk>evso \<in> yahalom;
Says Server A \<lbrace>Nonce NB,
Crypt (shrK A) \<lbrace>Agent B, Key K, Nonce NA\<rbrace>,
X\<rbrace> \<in> set evso\<rbrakk>
\<Longrightarrow> Notes Spy \<lbrace>Nonce NA, Nonce NB, Key K\<rbrace> # evso \<in> yahalom"
consts
bad :: "agent set" \<comment> \<open>compromised agents\<close>
abbreviation not_member
where "not_member x A \<equiv> \<not> (x \<in> A)" \<comment> \<open>non-membership\<close>
primrec knows :: "agent \<Rightarrow> event list \<Rightarrow> msg set"
where
knows_Nil: "knows A [] = initState A"
| knows_Cons:
"knows A (ev # evs) =
(if A = Spy then
(case ev of
Says A' B X \<Rightarrow> insert X (knows Spy evs)
| Gets A' X \<Rightarrow> knows Spy evs
| Notes A' X \<Rightarrow>
if A' \<in> bad then insert X (knows Spy evs) else knows Spy evs)
else
(case ev of
Says A' B X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Gets A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs
| Notes A' X \<Rightarrow>
if A'=A then insert X (knows A evs) else knows A evs))"
inductive_set
parts :: "msg set \<Rightarrow> msg set"
for H :: "msg set"
where
Inj [intro]: "X \<in> H \<Longrightarrow> X \<in> parts H"
| Fst: "\<lbrace>X,Y\<rbrace> \<in> parts H \<Longrightarrow> X \<in> parts H"
| Snd: "\<lbrace>X,Y\<rbrace> \<in> parts H \<Longrightarrow> Y \<in> parts H"
| Body: "Crypt K X \<in> parts H \<Longrightarrow> X \<in> parts H"
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
consts
shrK :: "agent => key" \<comment> \<open>long-term shared keys\<close>
datatype
msg = Agent agent \<comment> \<open>Agent names\<close>
| Number nat \<comment> \<open>Ordinary integers, timestamps, ...\<close>
| Nonce nat \<comment> \<open>Unguessable nonces\<close>
| Key key \<comment> \<open>Crypto keys\<close>
| Hash msg \<comment> \<open>Hashing\<close>
| MPair msg msg \<comment> \<open>Compound messages\<close>
| Crypt key msg \<comment> \<open>Encryption, public- or shared-key\<close>
|
###output
\<lbrakk> ?H1 (?H2 x_1) (?H3 (?H4 x_2) (?H3 (?H4 x_1) (?H3 (?H5 x_3) (?H6 x_4)))) \<in> ?H7 (?H8 ?H9 x_5); ?H10 x_1 ?H11; x_5 \<in> ?H12\<rbrakk> \<Longrightarrow> \<exists>y_0. ?H13 ?H14 x_2 (?H3 (?H6 x_4) (?H3 (?H1 (?H2 x_2) (?H3 (?H4 x_1) (?H3 (?H5 x_3) (?H6 y_0)))) (?H1 (?H2 x_1) (?H3 (?H4 x_2) (?H3 (?H4 x_1) (?H3 (?H5 x_3) (?H6 x_4))))))) \<in> ?H15 x_5###end
|
Analysis/Borel_Space
|
Borel_Space.borel_measurable_power
|
lemma borel_measurable_power [measurable (raw)]:
fixes f :: "_ \<Rightarrow> 'b::{power,real_normed_algebra}"
assumes f: "f \<in> borel_measurable M"
shows "(\<lambda>x. (f x) ^ n) \<in> borel_measurable M"
|
?f \<in> borel_measurable ?M \<Longrightarrow> (\<lambda>x. ?f x ^ ?n) \<in> borel_measurable ?M
|
x_1 \<in> ?H1 x_2 \<Longrightarrow> (\<lambda>y_0. ?H2 (x_1 y_0) x_3) \<in> ?H1 x_2
|
[
"Power.power_class.power",
"Borel_Space.borel_measurable"
] |
[
"'a \\<Rightarrow> nat \\<Rightarrow> 'a",
"'a measure \\<Rightarrow> ('a \\<Rightarrow> 'b) set"
] |
[
"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\"",
"abbreviation \"borel_measurable M \\<equiv> measurable M borel\""
] |
template
|
###lemma
?f \<in> borel_measurable ?M \<Longrightarrow> (\<lambda>x. ?f x ^ ?n) \<in> borel_measurable ?M
###symbols
Power.power_class.power :::: 'a \<Rightarrow> nat \<Rightarrow> 'a
Borel_Space.borel_measurable :::: 'a measure \<Rightarrow> ('a \<Rightarrow> 'b) set
###defs
primrec power :: "'a \<Rightarrow> nat \<Rightarrow> 'a" (infixr "^" 80)
where
power_0: "a ^ 0 = 1"
| power_Suc: "a ^ Suc n = a * a ^ n"
abbreviation "borel_measurable M \<equiv> measurable M borel"
|
###output
x_1 \<in> ?H1 x_2 \<Longrightarrow> (\<lambda>y_0. ?H2 (x_1 y_0) x_3) \<in> ?H1 x_2###end
|
UNITY/Simple/Lift
|
Lift.E_thm01
|
lemma E_thm01: "Lift \<in> (stopped \<inter> atFloor n) LeadsTo (opened \<inter> atFloor n)"
|
Lift \<in> stopped \<inter> atFloor ?n \<longmapsto>w opened \<inter> atFloor ?n
|
?H1 \<in> ?H2 (?H3 ?H4 (?H5 x_1)) (?H3 ?H6 (?H5 x_1))
|
[
"Lift.opened",
"Lift.atFloor",
"Lift.stopped",
"Set.inter",
"SubstAx.LeadsTo",
"Lift.Lift"
] |
[
"state set",
"int \\<Rightarrow> state set",
"state set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a program set",
"state program"
] |
[
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\"",
"definition LeadsTo :: \"['a set, 'a set] => 'a program set\" (infixl \"LeadsTo\" 60) where\n \"A LeadsTo B == {F. F \\<in> (reachable F \\<inter> A) leadsTo B}\""
] |
template
|
###lemma
Lift \<in> stopped \<inter> atFloor ?n \<longmapsto>w opened \<inter> atFloor ?n
###symbols
Lift.opened :::: state set
Lift.atFloor :::: int \<Rightarrow> state set
Lift.stopped :::: state set
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
SubstAx.LeadsTo :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a program set
Lift.Lift :::: state program
###defs
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
definition LeadsTo :: "['a set, 'a set] => 'a program set" (infixl "LeadsTo" 60) where
"A LeadsTo B == {F. F \<in> (reachable F \<inter> A) leadsTo B}"
|
###output
?H1 \<in> ?H2 (?H3 ?H4 (?H5 x_1)) (?H3 ?H6 (?H5 x_1))###end
|
Complex_Analysis/Contour_Integration
|
Contour_Integration.has_contour_integral_eq
|
lemma has_contour_integral_eq:
"\<lbrakk>(f has_contour_integral y) p; \<And>x. x \<in> path_image p \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> (g has_contour_integral y) p"
|
(?f has_contour_integral ?y) ?p \<Longrightarrow> (\<And>x. x \<in> path_image ?p \<Longrightarrow> ?f x = ?g x) \<Longrightarrow> (?g has_contour_integral ?y) ?p
|
\<lbrakk> ?H1 x_1 x_2 x_3; \<And>y_0. y_0 \<in> ?H2 x_3 \<Longrightarrow> x_1 y_0 = x_4 y_0\<rbrakk> \<Longrightarrow> ?H1 x_4 x_2 x_3
|
[
"Path_Connected.path_image",
"Contour_Integration.has_contour_integral"
] |
[
"(real \\<Rightarrow> 'a) \\<Rightarrow> 'a set",
"(complex \\<Rightarrow> complex) \\<Rightarrow> complex \\<Rightarrow> (real \\<Rightarrow> complex) \\<Rightarrow> bool"
] |
[] |
template
|
###lemma
(?f has_contour_integral ?y) ?p \<Longrightarrow> (\<And>x. x \<in> path_image ?p \<Longrightarrow> ?f x = ?g x) \<Longrightarrow> (?g has_contour_integral ?y) ?p
###symbols
Path_Connected.path_image :::: (real \<Rightarrow> 'a) \<Rightarrow> 'a set
Contour_Integration.has_contour_integral :::: (complex \<Rightarrow> complex) \<Rightarrow> complex \<Rightarrow> (real \<Rightarrow> complex) \<Rightarrow> bool
###defs
|
###output
\<lbrakk> ?H1 x_1 x_2 x_3; \<And>y_0. y_0 \<in> ?H2 x_3 \<Longrightarrow> x_1 y_0 = x_4 y_0\<rbrakk> \<Longrightarrow> ?H1 x_4 x_2 x_3###end
|
Analysis/Abstract_Topology
|
Abstract_Topology.continuous_closedin_preimage_gen
|
lemma continuous_closedin_preimage_gen:
assumes "continuous_on S f" "f \<in> S \<rightarrow> T" "closedin (top_of_set T) U"
shows "closedin (top_of_set S) (S \<inter> f -` U)"
|
continuous_on ?S ?f \<Longrightarrow> ?f \<in> ?S \<rightarrow> ?T \<Longrightarrow> closedin (top_of_set ?T) ?U \<Longrightarrow> closedin (top_of_set ?S) (?S \<inter> ?f -` ?U)
|
\<lbrakk> ?H1 x_1 x_2; x_2 \<in> ?H2 x_1 x_3; ?H3 (?H4 x_3) x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 x_1) (?H5 x_1 (?H6 x_2 x_4))
|
[
"Set.vimage",
"Set.inter",
"Abstract_Topology.top_of_set",
"Abstract_Topology.closedin",
"FuncSet.funcset",
"Topological_Spaces.continuous_on"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a topology",
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> 'b set \\<Rightarrow> ('a \\<Rightarrow> 'b) set",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"definition vimage :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set \\<Rightarrow> 'a set\" (infixr \"-`\" 90)\n where \"f -` B \\<equiv> {x. f x \\<in> B}\"",
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\"",
"abbreviation top_of_set :: \"'a::topological_space set \\<Rightarrow> 'a topology\"\n where \"top_of_set \\<equiv> subtopology (topology open)\"",
"abbreviation funcset :: \"'a set \\<Rightarrow> 'b set \\<Rightarrow> ('a \\<Rightarrow> 'b) set\" (infixr \"\\<rightarrow>\" 60)\n where \"A \\<rightarrow> B \\<equiv> Pi A (\\<lambda>_. B)\"",
"definition continuous_on :: \"'a set \\<Rightarrow> ('a::topological_space \\<Rightarrow> 'b::topological_space) \\<Rightarrow> bool\"\n where \"continuous_on s f \\<longleftrightarrow> (\\<forall>x\\<in>s. (f \\<longlongrightarrow> f x) (at x within s))\""
] |
template
|
###lemma
continuous_on ?S ?f \<Longrightarrow> ?f \<in> ?S \<rightarrow> ?T \<Longrightarrow> closedin (top_of_set ?T) ?U \<Longrightarrow> closedin (top_of_set ?S) (?S \<inter> ?f -` ?U)
###symbols
Set.vimage :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b set \<Rightarrow> 'a set
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
Abstract_Topology.top_of_set :::: 'a set \<Rightarrow> 'a topology
Abstract_Topology.closedin :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> bool
FuncSet.funcset :::: 'a set \<Rightarrow> 'b set \<Rightarrow> ('a \<Rightarrow> 'b) set
Topological_Spaces.continuous_on :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
definition vimage :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b set \<Rightarrow> 'a set" (infixr "-`" 90)
where "f -` B \<equiv> {x. f x \<in> B}"
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
abbreviation top_of_set :: "'a::topological_space set \<Rightarrow> 'a topology"
where "top_of_set \<equiv> subtopology (topology open)"
abbreviation funcset :: "'a set \<Rightarrow> 'b set \<Rightarrow> ('a \<Rightarrow> 'b) set" (infixr "\<rightarrow>" 60)
where "A \<rightarrow> B \<equiv> Pi A (\<lambda>_. B)"
definition continuous_on :: "'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
where "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s))"
|
###output
\<lbrakk> ?H1 x_1 x_2; x_2 \<in> ?H2 x_1 x_3; ?H3 (?H4 x_3) x_4\<rbrakk> \<Longrightarrow> ?H3 (?H4 x_1) (?H5 x_1 (?H6 x_2 x_4))###end
|
Complex_Analysis/Riemann_Mapping
|
Riemann_Mapping.Riemann_mapping_theorem
|
theorem Riemann_mapping_theorem:
"open S \<and> simply_connected S \<longleftrightarrow>
S = {} \<or> S = UNIV \<or>
(\<exists>f g. f holomorphic_on S \<and> g holomorphic_on ball 0 1 \<and>
(\<forall>z \<in> S. f z \<in> ball 0 1 \<and> g(f z) = z) \<and>
(\<forall>z \<in> ball 0 1. g z \<in> S \<and> f(g z) = z))"
(is "_ = ?rhs")
|
(open ?S \<and> simply_connected ?S) = (?S = {} \<or> ?S = UNIV \<or> (\<exists>f g. f holomorphic_on ?S \<and> g holomorphic_on ball 0 1 \<and> (\<forall>z\<in> ?S. f z \<in> ball 0 1 \<and> g (f z) = z) \<and> (\<forall>z\<in>ball 0 1. g z \<in> ?S \<and> f (g z) = z)))
|
(?H1 x_1 \<and> ?H2 x_1) = (x_1 = ?H3 \<or> x_1 = ?H4 \<or> (\<exists>y_0 y_1. ?H5 y_0 x_1 \<and> ?H5 y_1 (?H6 ?H7 ?H8) \<and> (\<forall>y_2\<in>x_1. y_0 y_2 \<in> ?H6 ?H7 ?H8 \<and> y_1 (y_0 y_2) = y_2) \<and> (\<forall>y_3\<in> ?H6 ?H7 ?H8. y_1 y_3 \<in> x_1 \<and> y_0 (y_1 y_3) = y_3)))
|
[
"Groups.one_class.one",
"Groups.zero_class.zero",
"Elementary_Metric_Spaces.ball",
"Complex_Analysis_Basics.holomorphic_on",
"Set.UNIV",
"Set.empty",
"Homotopy.simply_connected",
"Topological_Spaces.open_class.open"
] |
[
"'a",
"'a",
"'a \\<Rightarrow> real \\<Rightarrow> 'a set",
"(complex \\<Rightarrow> complex) \\<Rightarrow> complex set \\<Rightarrow> bool",
"'a set",
"'a set",
"'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> bool"
] |
[
"class one =\n fixes one :: 'a (\"1\")",
"class zero =\n fixes zero :: 'a (\"0\")",
"abbreviation UNIV :: \"'a set\"\n where \"UNIV \\<equiv> top\"",
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"class \"open\" =\n fixes \"open\" :: \"'a set \\<Rightarrow> bool\""
] |
template
|
###lemma
(open ?S \<and> simply_connected ?S) = (?S = {} \<or> ?S = UNIV \<or> (\<exists>f g. f holomorphic_on ?S \<and> g holomorphic_on ball 0 1 \<and> (\<forall>z\<in> ?S. f z \<in> ball 0 1 \<and> g (f z) = z) \<and> (\<forall>z\<in>ball 0 1. g z \<in> ?S \<and> f (g z) = z)))
###symbols
Groups.one_class.one :::: 'a
Groups.zero_class.zero :::: 'a
Elementary_Metric_Spaces.ball :::: 'a \<Rightarrow> real \<Rightarrow> 'a set
Complex_Analysis_Basics.holomorphic_on :::: (complex \<Rightarrow> complex) \<Rightarrow> complex set \<Rightarrow> bool
Set.UNIV :::: 'a set
Set.empty :::: 'a set
Homotopy.simply_connected :::: 'a set \<Rightarrow> bool
Topological_Spaces.open_class.open :::: 'a set \<Rightarrow> bool
###defs
class one =
fixes one :: 'a ("1")
class zero =
fixes zero :: 'a ("0")
abbreviation UNIV :: "'a set"
where "UNIV \<equiv> top"
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
class "open" =
fixes "open" :: "'a set \<Rightarrow> bool"
|
###output
(?H1 x_1 \<and> ?H2 x_1) = (x_1 = ?H3 \<or> x_1 = ?H4 \<or> (\<exists>y_0 y_1. ?H5 y_0 x_1 \<and> ?H5 y_1 (?H6 ?H7 ?H8) \<and> (\<forall>y_2\<in>x_1. y_0 y_2 \<in> ?H6 ?H7 ?H8 \<and> y_1 (y_0 y_2) = y_2) \<and> (\<forall>y_3\<in> ?H6 ?H7 ?H8. y_1 y_3 \<in> x_1 \<and> y_0 (y_1 y_3) = y_3)))###end
|
Matrix_LP/SparseMatrix
|
SparseMatrix.nprt_move_matrix
|
lemma nprt_move_matrix: "nprt (move_matrix (A::('a::lattice_ring) matrix) j i) = move_matrix (nprt A) j i"
|
nprt (move_matrix ?A ?j ?i) = move_matrix (nprt ?A) ?j ?i
|
?H1 (?H2 x_1 x_2 x_3) = ?H2 (?H1 x_1) x_2 x_3
|
[
"Matrix.move_matrix",
"Lattice_Algebras.lattice_ab_group_add_class.nprt"
] |
[
"'a matrix \\<Rightarrow> int \\<Rightarrow> int \\<Rightarrow> 'a matrix",
"'a \\<Rightarrow> 'a"
] |
[
"definition move_matrix :: \"('a::zero) matrix \\<Rightarrow> int \\<Rightarrow> int \\<Rightarrow> 'a matrix\" where\n \"move_matrix A y x == Abs_matrix(% j i. if (((int j)-y) < 0) | (((int i)-x) < 0) then 0 else Rep_matrix A (nat ((int j)-y)) (nat ((int i)-x)))\"",
"class lattice_ab_group_add = ordered_ab_group_add + lattice\nbegin"
] |
template
|
###lemma
nprt (move_matrix ?A ?j ?i) = move_matrix (nprt ?A) ?j ?i
###symbols
Matrix.move_matrix :::: 'a matrix \<Rightarrow> int \<Rightarrow> int \<Rightarrow> 'a matrix
Lattice_Algebras.lattice_ab_group_add_class.nprt :::: 'a \<Rightarrow> 'a
###defs
definition move_matrix :: "('a::zero) matrix \<Rightarrow> int \<Rightarrow> int \<Rightarrow> 'a matrix" where
"move_matrix A y x == Abs_matrix(% j i. if (((int j)-y) < 0) | (((int i)-x) < 0) then 0 else Rep_matrix A (nat ((int j)-y)) (nat ((int i)-x)))"
class lattice_ab_group_add = ordered_ab_group_add + lattice
begin
|
###output
?H1 (?H2 x_1 x_2 x_3) = ?H2 (?H1 x_1) x_2 x_3###end
|
ex/Tree23
|
Tree23.bal_exec
|
lemma bal_exec: "bal t \<Longrightarrow> bal (exec as t)"
|
bal ?t \<Longrightarrow> bal (exec ?as ?t)
|
?H1 x_1 \<Longrightarrow> ?H1 (?H2 x_2 x_1)
|
[
"Tree23.exec",
"Tree23.bal"
] |
[
"'a act list \\<Rightarrow> 'a tree23 \\<Rightarrow> 'a tree23",
"'a tree23 \\<Rightarrow> bool"
] |
[
"fun exec where\n\"exec [] t = t\" |\n\"exec (Add k x # as) t = exec as (add0 k x t)\" |\n\"exec (Del k # as) t = exec as (del0 k t)\"",
"fun bal :: \"'a tree23 \\<Rightarrow> bool\" where\n\"bal Empty = True\" |\n\"bal (Branch2 l _ r) = (bal l & bal r & height l = height r)\" |\n\"bal (Branch3 l _ m _ r) = (bal l & bal m & bal r & height l = height m & height m = height r)\""
] |
template
|
###lemma
bal ?t \<Longrightarrow> bal (exec ?as ?t)
###symbols
Tree23.exec :::: 'a act list \<Rightarrow> 'a tree23 \<Rightarrow> 'a tree23
Tree23.bal :::: 'a tree23 \<Rightarrow> bool
###defs
fun exec where
"exec [] t = t" |
"exec (Add k x # as) t = exec as (add0 k x t)" |
"exec (Del k # as) t = exec as (del0 k t)"
fun bal :: "'a tree23 \<Rightarrow> bool" where
"bal Empty = True" |
"bal (Branch2 l _ r) = (bal l & bal r & height l = height r)" |
"bal (Branch3 l _ m _ r) = (bal l & bal m & bal r & height l = height m & height m = height r)"
|
###output
?H1 x_1 \<Longrightarrow> ?H1 (?H2 x_2 x_1)###end
|
Analysis/Abstract_Topology
|
Abstract_Topology.separated_eq_distinguishable
|
lemma separated_eq_distinguishable:
"separatedin X {x} {y} \<longleftrightarrow>
x \<in> topspace X \<and> y \<in> topspace X \<and>
(\<exists>U. openin X U \<and> x \<in> U \<and> (y \<notin> U)) \<and>
(\<exists>v. openin X v \<and> y \<in> v \<and> (x \<notin> v))"
|
separatedin ?X { ?x} { ?y} = (?x \<in> topspace ?X \<and> ?y \<in> topspace ?X \<and> (\<exists>U. openin ?X U \<and> ?x \<in> U \<and> ?y \<notin> U) \<and> (\<exists>v. openin ?X v \<and> ?y \<in> v \<and> ?x \<notin> v))
|
?H1 x_1 (?H2 x_2 ?H3) (?H2 x_3 ?H3) = (x_2 \<in> ?H4 x_1 \<and> x_3 \<in> ?H4 x_1 \<and> (\<exists>y_0. ?H5 x_1 y_0 \<and> x_2 \<in> y_0 \<and> ?H6 x_3 y_0) \<and> (\<exists>y_1. ?H5 x_1 y_1 \<and> x_3 \<in> y_1 \<and> ?H6 x_2 y_1))
|
[
"Set.not_member",
"Abstract_Topology.topology.openin",
"Abstract_Topology.topspace",
"Set.empty",
"Set.insert",
"Abstract_Topology.separatedin"
] |
[
"'a \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a topology \\<Rightarrow> 'a set",
"'a set",
"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> 'a set \\<Rightarrow> bool"
] |
[
"abbreviation not_member\n where \"not_member x A \\<equiv> \\<not> (x \\<in> A)\" \\<comment> \\<open>non-membership\\<close>",
"definition \"topspace T = \\<Union>{S. openin T S}\"",
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"definition insert :: \"'a \\<Rightarrow> 'a set \\<Rightarrow> 'a set\"\n where insert_compr: \"insert a B = {x. x = a \\<or> x \\<in> B}\"",
"definition separatedin :: \"'a topology \\<Rightarrow> 'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"separatedin X S T \\<equiv>\n S \\<subseteq> topspace X \\<and> T \\<subseteq> topspace X \\<and>\n S \\<inter> X closure_of T = {} \\<and> T \\<inter> X closure_of S = {}\""
] |
template
|
###lemma
separatedin ?X { ?x} { ?y} = (?x \<in> topspace ?X \<and> ?y \<in> topspace ?X \<and> (\<exists>U. openin ?X U \<and> ?x \<in> U \<and> ?y \<notin> U) \<and> (\<exists>v. openin ?X v \<and> ?y \<in> v \<and> ?x \<notin> v))
###symbols
Set.not_member :::: 'a \<Rightarrow> 'a set \<Rightarrow> bool
Abstract_Topology.topology.openin :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> bool
Abstract_Topology.topspace :::: 'a topology \<Rightarrow> 'a set
Set.empty :::: 'a set
Set.insert :::: 'a \<Rightarrow> 'a set \<Rightarrow> 'a set
Abstract_Topology.separatedin :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> 'a set \<Rightarrow> bool
###defs
abbreviation not_member
where "not_member x A \<equiv> \<not> (x \<in> A)" \<comment> \<open>non-membership\<close>
definition "topspace T = \<Union>{S. openin T S}"
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
definition insert :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set"
where insert_compr: "insert a B = {x. x = a \<or> x \<in> B}"
definition separatedin :: "'a topology \<Rightarrow> 'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "separatedin X S T \<equiv>
S \<subseteq> topspace X \<and> T \<subseteq> topspace X \<and>
S \<inter> X closure_of T = {} \<and> T \<inter> X closure_of S = {}"
|
###output
?H1 x_1 (?H2 x_2 ?H3) (?H2 x_3 ?H3) = (x_2 \<in> ?H4 x_1 \<and> x_3 \<in> ?H4 x_1 \<and> (\<exists>y_0. ?H5 x_1 y_0 \<and> x_2 \<in> y_0 \<and> ?H6 x_3 y_0) \<and> (\<exists>y_1. ?H5 x_1 y_1 \<and> x_3 \<in> y_1 \<and> ?H6 x_2 y_1))###end
|
Analysis/Abstract_Topological_Spaces
|
Abstract_Topological_Spaces.retraction_maps_Kolmogorov_quotient
|
lemma retraction_maps_Kolmogorov_quotient:
"retraction_maps X
(subtopology X (Kolmogorov_quotient X ` topspace X))
(Kolmogorov_quotient X) id"
|
retraction_maps ?X (subtopology ?X (Kolmogorov_quotient ?X ` topspace ?X)) (Kolmogorov_quotient ?X) id
|
?H1 x_1 (?H2 x_1 (?H3 (?H4 x_1) (?H5 x_1))) (?H4 x_1) ?H6
|
[
"Fun.id",
"Abstract_Topology.topspace",
"Abstract_Topological_Spaces.Kolmogorov_quotient",
"Set.image",
"Abstract_Topology.subtopology",
"Abstract_Topology.retraction_maps"
] |
[
"'a \\<Rightarrow> 'a",
"'a topology \\<Rightarrow> 'a set",
"'a topology \\<Rightarrow> 'a \\<Rightarrow> 'a",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> 'a topology",
"'a topology \\<Rightarrow> 'b topology \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> ('b \\<Rightarrow> 'a) \\<Rightarrow> bool"
] |
[
"definition id :: \"'a \\<Rightarrow> 'a\"\n where \"id = (\\<lambda>x. x)\"",
"definition \"topspace T = \\<Union>{S. openin T S}\"",
"definition Kolmogorov_quotient \n where \"Kolmogorov_quotient X \\<equiv> \\<lambda>x. @y. \\<forall>U. openin X U \\<longrightarrow> (y \\<in> U \\<longleftrightarrow> x \\<in> U)\"",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"definition retraction_maps :: \"'a topology \\<Rightarrow> 'b topology \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> ('b \\<Rightarrow> 'a) \\<Rightarrow> bool\"\n where \"retraction_maps X Y f g \\<equiv>\n continuous_map X Y f \\<and> continuous_map Y X g \\<and> (\\<forall>x \\<in> topspace Y. f(g x) = x)\""
] |
template
|
###lemma
retraction_maps ?X (subtopology ?X (Kolmogorov_quotient ?X ` topspace ?X)) (Kolmogorov_quotient ?X) id
###symbols
Fun.id :::: 'a \<Rightarrow> 'a
Abstract_Topology.topspace :::: 'a topology \<Rightarrow> 'a set
Abstract_Topological_Spaces.Kolmogorov_quotient :::: 'a topology \<Rightarrow> 'a \<Rightarrow> 'a
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Abstract_Topology.subtopology :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> 'a topology
Abstract_Topology.retraction_maps :::: 'a topology \<Rightarrow> 'b topology \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> bool
###defs
definition id :: "'a \<Rightarrow> 'a"
where "id = (\<lambda>x. x)"
definition "topspace T = \<Union>{S. openin T S}"
definition Kolmogorov_quotient
where "Kolmogorov_quotient X \<equiv> \<lambda>x. @y. \<forall>U. openin X U \<longrightarrow> (y \<in> U \<longleftrightarrow> x \<in> U)"
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
definition retraction_maps :: "'a topology \<Rightarrow> 'b topology \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('b \<Rightarrow> 'a) \<Rightarrow> bool"
where "retraction_maps X Y f g \<equiv>
continuous_map X Y f \<and> continuous_map Y X g \<and> (\<forall>x \<in> topspace Y. f(g x) = x)"
|
###output
?H1 x_1 (?H2 x_1 (?H3 (?H4 x_1) (?H5 x_1))) (?H4 x_1) ?H6###end
|
Induct/Com
|
Complete_Lattices.Collect_ex_eq
| null |
{x. \<exists>y. ?P x y} = (\<Union>y. {x. ?P x y})
|
?H1 (\<lambda>y_0. \<exists>y_1. x_1 y_0 y_1) = ?H2 (?H3 (\<lambda>y_2. ?H1 (\<lambda>y_3. x_1 y_3 y_2)))
|
[
"Set.range",
"Complete_Lattices.Union",
"Set.Collect"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set",
"'a set set \\<Rightarrow> 'a set",
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set"
] |
[
"abbreviation range :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'b set\" \\<comment> \\<open>of function\\<close>\n where \"range f \\<equiv> f ` UNIV\"",
"abbreviation Union :: \"'a set set \\<Rightarrow> 'a set\" (\"\\<Union>\")\n where \"\\<Union>S \\<equiv> \\<Squnion>S\""
] |
template
|
###lemma
{x. \<exists>y. ?P x y} = (\<Union>y. {x. ?P x y})
###symbols
Set.range :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'b set
Complete_Lattices.Union :::: 'a set set \<Rightarrow> 'a set
Set.Collect :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a set
###defs
abbreviation range :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b set" \<comment> \<open>of function\<close>
where "range f \<equiv> f ` UNIV"
abbreviation Union :: "'a set set \<Rightarrow> 'a set" ("\<Union>")
where "\<Union>S \<equiv> \<Squnion>S"
|
###output
?H1 (\<lambda>y_0. \<exists>y_1. x_1 y_0 y_1) = ?H2 (?H3 (\<lambda>y_2. ?H1 (\<lambda>y_3. x_1 y_3 y_2)))###end
|
UNITY/WFair
|
WFair.leadsTo_UN
|
lemma leadsTo_UN:
"(!!i. i \<in> I ==> F \<in> (A i) leadsTo B) ==> F \<in> (\<Union>i \<in> I. A i) leadsTo B"
|
(\<And>i. i \<in> ?I \<Longrightarrow> ?F \<in> ?A i \<longmapsto> ?B) \<Longrightarrow> ?F \<in> \<Union> (?A ` ?I) \<longmapsto> ?B
|
(\<And>y_0. y_0 \<in> x_1 \<Longrightarrow> x_2 \<in> ?H1 (x_3 y_0) x_4) \<Longrightarrow> x_2 \<in> ?H1 (?H2 (?H3 x_3 x_1)) x_4
|
[
"Set.image",
"Complete_Lattices.Union",
"WFair.leadsTo"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a set set \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a program set"
] |
[
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"abbreviation Union :: \"'a set set \\<Rightarrow> 'a set\" (\"\\<Union>\")\n where \"\\<Union>S \\<equiv> \\<Squnion>S\"",
"definition leadsTo :: \"['a set, 'a set] => 'a program set\" (infixl \"leadsTo\" 60) where\n \\<comment> \\<open>visible version of the LEADS-TO relation\\<close>\n \"A leadsTo B == {F. (A,B) \\<in> leads F}\""
] |
template
|
###lemma
(\<And>i. i \<in> ?I \<Longrightarrow> ?F \<in> ?A i \<longmapsto> ?B) \<Longrightarrow> ?F \<in> \<Union> (?A ` ?I) \<longmapsto> ?B
###symbols
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Complete_Lattices.Union :::: 'a set set \<Rightarrow> 'a set
WFair.leadsTo :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a program set
###defs
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
abbreviation Union :: "'a set set \<Rightarrow> 'a set" ("\<Union>")
where "\<Union>S \<equiv> \<Squnion>S"
definition leadsTo :: "['a set, 'a set] => 'a program set" (infixl "leadsTo" 60) where
\<comment> \<open>visible version of the LEADS-TO relation\<close>
"A leadsTo B == {F. (A,B) \<in> leads F}"
|
###output
(\<And>y_0. y_0 \<in> x_1 \<Longrightarrow> x_2 \<in> ?H1 (x_3 y_0) x_4) \<Longrightarrow> x_2 \<in> ?H1 (?H2 (?H3 x_3 x_1)) x_4###end
|
Analysis/Measure_Space
|
Measure_Space.measure_Un2
|
lemma measure_Un2:
"A \<in> fmeasurable M \<Longrightarrow> B \<in> fmeasurable M \<Longrightarrow> measure M (A \<union> B) = measure M A + measure M (B - A)"
|
?A \<in> fmeasurable ?M \<Longrightarrow> ?B \<in> fmeasurable ?M \<Longrightarrow> Sigma_Algebra.measure ?M (?A \<union> ?B) = Sigma_Algebra.measure ?M ?A + Sigma_Algebra.measure ?M (?B - ?A)
|
\<lbrakk>x_1 \<in> ?H1 x_2; x_3 \<in> ?H1 x_2\<rbrakk> \<Longrightarrow> ?H2 x_2 (?H3 x_1 x_3) = ?H4 (?H2 x_2 x_1) (?H2 x_2 (?H5 x_3 x_1))
|
[
"Groups.minus_class.minus",
"Groups.plus_class.plus",
"Set.union",
"Sigma_Algebra.measure",
"Measure_Space.fmeasurable"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set",
"'a measure \\<Rightarrow> 'a set \\<Rightarrow> real",
"'a measure \\<Rightarrow> 'a set set"
] |
[
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"class plus =\n fixes plus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"+\" 65)",
"abbreviation union :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<union>\" 65)\n where \"union \\<equiv> sup\""
] |
template
|
###lemma
?A \<in> fmeasurable ?M \<Longrightarrow> ?B \<in> fmeasurable ?M \<Longrightarrow> Sigma_Algebra.measure ?M (?A \<union> ?B) = Sigma_Algebra.measure ?M ?A + Sigma_Algebra.measure ?M (?B - ?A)
###symbols
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Groups.plus_class.plus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Set.union :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
Sigma_Algebra.measure :::: 'a measure \<Rightarrow> 'a set \<Rightarrow> real
Measure_Space.fmeasurable :::: 'a measure \<Rightarrow> 'a set set
###defs
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
class plus =
fixes plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "+" 65)
abbreviation union :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<union>" 65)
where "union \<equiv> sup"
|
###output
\<lbrakk>x_1 \<in> ?H1 x_2; x_3 \<in> ?H1 x_2\<rbrakk> \<Longrightarrow> ?H2 x_2 (?H3 x_1 x_3) = ?H4 (?H2 x_2 x_1) (?H2 x_2 (?H5 x_3 x_1))###end
|
Analysis/Finite_Cartesian_Product
|
Finite_Cartesian_Product.sum_cmul
|
lemma sum_cmul:
fixes f:: "'c \<Rightarrow> ('a::semiring_1)^'n"
shows "sum (\<lambda>x. c *s f x) S = c *s sum f S"
|
(\<Sum>x\<in> ?S. ?c *s ?f x) = ?c *s sum ?f ?S
|
?H1 (\<lambda>y_0. ?H2 x_1 (x_2 y_0)) x_3 = ?H2 x_1 (?H1 x_2 x_3)
|
[
"Finite_Cartesian_Product.vector_scalar_mult",
"Groups_Big.comm_monoid_add_class.sum"
] |
[
"'a \\<Rightarrow> ('a, 'b) vec \\<Rightarrow> ('a, 'b) vec",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b"
] |
[
"definition vector_scalar_mult:: \"'a::times \\<Rightarrow> 'a ^ 'n \\<Rightarrow> 'a ^ 'n\" (infixl \"*s\" 70)\n where \"c *s x = (\\<chi> i. c * (x$i))\""
] |
template
|
###lemma
(\<Sum>x\<in> ?S. ?c *s ?f x) = ?c *s sum ?f ?S
###symbols
Finite_Cartesian_Product.vector_scalar_mult :::: 'a \<Rightarrow> ('a, 'b) vec \<Rightarrow> ('a, 'b) vec
Groups_Big.comm_monoid_add_class.sum :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b
###defs
definition vector_scalar_mult:: "'a::times \<Rightarrow> 'a ^ 'n \<Rightarrow> 'a ^ 'n" (infixl "*s" 70)
where "c *s x = (\<chi> i. c * (x$i))"
|
###output
?H1 (\<lambda>y_0. ?H2 x_1 (x_2 y_0)) x_3 = ?H2 x_1 (?H1 x_2 x_3)###end
|
Library/Countable_Set_Type
|
Countable_Set_Type.cpsubsetD
| null |
csubset ?A ?B \<Longrightarrow> cin ?c ?A \<Longrightarrow> cin ?c ?B
|
\<lbrakk> ?H1 x_1 x_2; ?H2 x_3 x_1\<rbrakk> \<Longrightarrow> ?H2 x_3 x_2
|
[
"Countable_Set_Type.cin",
"Countable_Set_Type.csubset"
] |
[
"'a \\<Rightarrow> 'a cset \\<Rightarrow> bool",
"'a cset \\<Rightarrow> 'a cset \\<Rightarrow> bool"
] |
[
"abbreviation csubset :: \"'a cset \\<Rightarrow> 'a cset \\<Rightarrow> bool\" where \"csubset xs ys \\<equiv> xs < ys\""
] |
template
|
###lemma
csubset ?A ?B \<Longrightarrow> cin ?c ?A \<Longrightarrow> cin ?c ?B
###symbols
Countable_Set_Type.cin :::: 'a \<Rightarrow> 'a cset \<Rightarrow> bool
Countable_Set_Type.csubset :::: 'a cset \<Rightarrow> 'a cset \<Rightarrow> bool
###defs
abbreviation csubset :: "'a cset \<Rightarrow> 'a cset \<Rightarrow> bool" where "csubset xs ys \<equiv> xs < ys"
|
###output
\<lbrakk> ?H1 x_1 x_2; ?H2 x_3 x_1\<rbrakk> \<Longrightarrow> ?H2 x_3 x_2###end
|
Analysis/Complex_Transcendental
|
Complex_Transcendental.has_field_derivative_Arcsin
|
lemma has_field_derivative_Arcsin:
assumes "Im z = 0 \<Longrightarrow> \<bar>Re z\<bar> < 1"
shows "(Arcsin has_field_derivative inverse(cos(Arcsin z))) (at z)"
|
(Im ?z = 0 \<Longrightarrow> \<bar>Re ?z\<bar> < 1) \<Longrightarrow> (Arcsin has_field_derivative inverse (cos (Arcsin ?z))) (at ?z)
|
(?H1 x_1 = ?H2 \<Longrightarrow> ?H3 (?H4 x_1) < ?H5) \<Longrightarrow> ?H6 ?H7 (?H8 (?H9 (?H7 x_1))) (?H10 x_1)
|
[
"Topological_Spaces.topological_space_class.at",
"Transcendental.cos",
"Fields.inverse_class.inverse",
"Complex_Transcendental.Arcsin",
"Deriv.has_field_derivative",
"Groups.one_class.one",
"Complex.complex.Re",
"Groups.abs_class.abs",
"Groups.zero_class.zero",
"Complex.complex.Im"
] |
[
"'a \\<Rightarrow> 'a filter",
"'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a",
"complex \\<Rightarrow> complex",
"('a \\<Rightarrow> 'a) \\<Rightarrow> 'a \\<Rightarrow> 'a filter \\<Rightarrow> bool",
"'a",
"complex \\<Rightarrow> real",
"'a \\<Rightarrow> 'a",
"'a",
"complex \\<Rightarrow> real"
] |
[
"class topological_space = \"open\" +\n assumes open_UNIV [simp, intro]: \"open UNIV\"\n assumes open_Int [intro]: \"open S \\<Longrightarrow> open T \\<Longrightarrow> open (S \\<inter> T)\"\n assumes open_Union [intro]: \"\\<forall>S\\<in>K. open S \\<Longrightarrow> open (\\<Union>K)\"\nbegin",
"definition cos :: \"'a \\<Rightarrow> 'a::{real_normed_algebra_1,banach}\"\n where \"cos = (\\<lambda>x. \\<Sum>n. cos_coeff n *\\<^sub>R x^n)\"",
"class inverse = divide +\n fixes inverse :: \"'a \\<Rightarrow> 'a\"\nbegin",
"definition has_field_derivative :: \"('a::real_normed_field \\<Rightarrow> 'a) \\<Rightarrow> 'a \\<Rightarrow> 'a filter \\<Rightarrow> bool\"\n (infix \"(has'_field'_derivative)\" 50)\n where \"(f has_field_derivative D) F \\<longleftrightarrow> (f has_derivative (*) D) F\"",
"class one =\n fixes one :: 'a (\"1\")",
"codatatype complex = Complex (Re: real) (Im: real)",
"class abs =\n fixes abs :: \"'a \\<Rightarrow> 'a\" (\"\\<bar>_\\<bar>\")",
"class zero =\n fixes zero :: 'a (\"0\")",
"codatatype complex = Complex (Re: real) (Im: real)"
] |
template
|
###lemma
(Im ?z = 0 \<Longrightarrow> \<bar>Re ?z\<bar> < 1) \<Longrightarrow> (Arcsin has_field_derivative inverse (cos (Arcsin ?z))) (at ?z)
###symbols
Topological_Spaces.topological_space_class.at :::: 'a \<Rightarrow> 'a filter
Transcendental.cos :::: 'a \<Rightarrow> 'a
Fields.inverse_class.inverse :::: 'a \<Rightarrow> 'a
Complex_Transcendental.Arcsin :::: complex \<Rightarrow> complex
Deriv.has_field_derivative :::: ('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a filter \<Rightarrow> bool
Groups.one_class.one :::: 'a
Complex.complex.Re :::: complex \<Rightarrow> real
Groups.abs_class.abs :::: 'a \<Rightarrow> 'a
Groups.zero_class.zero :::: 'a
Complex.complex.Im :::: complex \<Rightarrow> real
###defs
class topological_space = "open" +
assumes open_UNIV [simp, intro]: "open UNIV"
assumes open_Int [intro]: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<inter> T)"
assumes open_Union [intro]: "\<forall>S\<in>K. open S \<Longrightarrow> open (\<Union>K)"
begin
definition cos :: "'a \<Rightarrow> 'a::{real_normed_algebra_1,banach}"
where "cos = (\<lambda>x. \<Sum>n. cos_coeff n *\<^sub>R x^n)"
class inverse = divide +
fixes inverse :: "'a \<Rightarrow> 'a"
begin
definition has_field_derivative :: "('a::real_normed_field \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a filter \<Rightarrow> bool"
(infix "(has'_field'_derivative)" 50)
where "(f has_field_derivative D) F \<longleftrightarrow> (f has_derivative (*) D) F"
class one =
fixes one :: 'a ("1")
codatatype complex = Complex (Re: real) (Im: real)
class abs =
fixes abs :: "'a \<Rightarrow> 'a" ("\<bar>_\<bar>")
class zero =
fixes zero :: 'a ("0")
codatatype complex = Complex (Re: real) (Im: real)
|
###output
(?H1 x_1 = ?H2 \<Longrightarrow> ?H3 (?H4 x_1) < ?H5) \<Longrightarrow> ?H6 ?H7 (?H8 (?H9 (?H7 x_1))) (?H10 x_1)###end
|
Analysis/Homotopy
|
Homotopy.continuous_on_components_gen
|
lemma continuous_on_components_gen:
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
assumes "\<And>C. C \<in> components S \<Longrightarrow>
openin (top_of_set S) C \<and> continuous_on C f"
shows "continuous_on S f"
|
(\<And>C. C \<in> components ?S \<Longrightarrow> openin (top_of_set ?S) C \<and> continuous_on C ?f) \<Longrightarrow> continuous_on ?S ?f
|
(\<And>y_0. y_0 \<in> ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1) y_0 \<and> ?H4 y_0 x_2) \<Longrightarrow> ?H4 x_1 x_2
|
[
"Topological_Spaces.continuous_on",
"Abstract_Topology.top_of_set",
"Abstract_Topology.topology.openin",
"Connected.components"
] |
[
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool",
"'a set \\<Rightarrow> 'a topology",
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> 'a set set"
] |
[
"definition continuous_on :: \"'a set \\<Rightarrow> ('a::topological_space \\<Rightarrow> 'b::topological_space) \\<Rightarrow> bool\"\n where \"continuous_on s f \\<longleftrightarrow> (\\<forall>x\\<in>s. (f \\<longlongrightarrow> f x) (at x within s))\"",
"abbreviation top_of_set :: \"'a::topological_space set \\<Rightarrow> 'a topology\"\n where \"top_of_set \\<equiv> subtopology (topology open)\""
] |
template
|
###lemma
(\<And>C. C \<in> components ?S \<Longrightarrow> openin (top_of_set ?S) C \<and> continuous_on C ?f) \<Longrightarrow> continuous_on ?S ?f
###symbols
Topological_Spaces.continuous_on :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
Abstract_Topology.top_of_set :::: 'a set \<Rightarrow> 'a topology
Abstract_Topology.topology.openin :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> bool
Connected.components :::: 'a set \<Rightarrow> 'a set set
###defs
definition continuous_on :: "'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
where "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s))"
abbreviation top_of_set :: "'a::topological_space set \<Rightarrow> 'a topology"
where "top_of_set \<equiv> subtopology (topology open)"
|
###output
(\<And>y_0. y_0 \<in> ?H1 x_1 \<Longrightarrow> ?H2 (?H3 x_1) y_0 \<and> ?H4 y_0 x_2) \<Longrightarrow> ?H4 x_1 x_2###end
|
Homology/Homology_Groups
|
Homology_Groups.hom_relboundary
|
lemma hom_relboundary:
"hom_relboundary p X S T c \<in> carrier (relative_homology_group (p-1) (subtopology X S) T)"
|
hom_relboundary ?p ?X ?S ?T ?c \<in> carrier (relative_homology_group (?p - 1) (subtopology ?X ?S) ?T)
|
?H1 x_1 x_2 x_3 x_4 x_5 \<in> ?H2 (?H3 (?H4 x_1 ?H5) (?H6 x_2 x_3) x_4)
|
[
"Abstract_Topology.subtopology",
"Groups.one_class.one",
"Groups.minus_class.minus",
"Homology_Groups.relative_homology_group",
"Congruence.partial_object.carrier",
"Homology_Groups.hom_relboundary"
] |
[
"'a topology \\<Rightarrow> 'a set \\<Rightarrow> 'a topology",
"'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"int \\<Rightarrow> 'a topology \\<Rightarrow> 'a set \\<Rightarrow> (((nat \\<Rightarrow> real) \\<Rightarrow> 'a) \\<Rightarrow>\\<^sub>0 int) set monoid",
"('a, 'b) partial_object_scheme \\<Rightarrow> 'a set",
"int \\<Rightarrow> 'a topology \\<Rightarrow> 'a set \\<Rightarrow> 'a set \\<Rightarrow> (((nat \\<Rightarrow> real) \\<Rightarrow> 'a) \\<Rightarrow>\\<^sub>0 int) set \\<Rightarrow> (((nat \\<Rightarrow> real) \\<Rightarrow> 'a) \\<Rightarrow>\\<^sub>0 int) set"
] |
[
"class one =\n fixes one :: 'a (\"1\")",
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)",
"definition relative_homology_group :: \"int \\<Rightarrow> 'a topology \\<Rightarrow> 'a set \\<Rightarrow> ('a chain) set monoid\"\n where\n \"relative_homology_group p X S \\<equiv>\n if p < 0 then singleton_group undefined else\n (relcycle_group (nat p) X S) Mod (singular_relboundary_set (nat p) X S)\"",
"definition hom_relboundary :: \"[int,'a topology,'a set,'a set,'a chain set] \\<Rightarrow> 'a chain set\"\n where\n \"hom_relboundary p X S T =\n hom_induced (p-1) (subtopology X S) {} (subtopology X S) T id \\<circ>\n hom_boundary p X S\""
] |
template
|
###lemma
hom_relboundary ?p ?X ?S ?T ?c \<in> carrier (relative_homology_group (?p - 1) (subtopology ?X ?S) ?T)
###symbols
Abstract_Topology.subtopology :::: 'a topology \<Rightarrow> 'a set \<Rightarrow> 'a topology
Groups.one_class.one :::: 'a
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Homology_Groups.relative_homology_group :::: int \<Rightarrow> 'a topology \<Rightarrow> 'a set \<Rightarrow> (((nat \<Rightarrow> real) \<Rightarrow> 'a) \<Rightarrow>\<^sub>0 int) set monoid
Congruence.partial_object.carrier :::: ('a, 'b) partial_object_scheme \<Rightarrow> 'a set
Homology_Groups.hom_relboundary :::: int \<Rightarrow> 'a topology \<Rightarrow> 'a set \<Rightarrow> 'a set \<Rightarrow> (((nat \<Rightarrow> real) \<Rightarrow> 'a) \<Rightarrow>\<^sub>0 int) set \<Rightarrow> (((nat \<Rightarrow> real) \<Rightarrow> 'a) \<Rightarrow>\<^sub>0 int) set
###defs
class one =
fixes one :: 'a ("1")
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
definition relative_homology_group :: "int \<Rightarrow> 'a topology \<Rightarrow> 'a set \<Rightarrow> ('a chain) set monoid"
where
"relative_homology_group p X S \<equiv>
if p < 0 then singleton_group undefined else
(relcycle_group (nat p) X S) Mod (singular_relboundary_set (nat p) X S)"
definition hom_relboundary :: "[int,'a topology,'a set,'a set,'a chain set] \<Rightarrow> 'a chain set"
where
"hom_relboundary p X S T =
hom_induced (p-1) (subtopology X S) {} (subtopology X S) T id \<circ>
hom_boundary p X S"
|
###output
?H1 x_1 x_2 x_3 x_4 x_5 \<in> ?H2 (?H3 (?H4 x_1 ?H5) (?H6 x_2 x_3) x_4)###end
|
IMP/Compiler2
|
Compiler2.succs_shift
|
lemma succs_shift:
"(p - n \<in> succs P 0) = (p \<in> succs P n)"
|
(?p - ?n \<in> succs ?P 0) = (?p \<in> succs ?P ?n)
|
(?H1 x_1 x_2 \<in> ?H2 x_3 ?H3) = (x_1 \<in> ?H2 x_3 x_2)
|
[
"Groups.zero_class.zero",
"Compiler2.succs",
"Groups.minus_class.minus"
] |
[
"'a",
"instr list \\<Rightarrow> int \\<Rightarrow> int set",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a"
] |
[
"class zero =\n fixes zero :: 'a (\"0\")",
"definition succs :: \"instr list \\<Rightarrow> int \\<Rightarrow> int set\" where\n\"succs P n = {s. \\<exists>i::int. 0 \\<le> i \\<and> i < size P \\<and> s \\<in> isuccs (P!!i) (n+i)}\"",
"class minus =\n fixes minus :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"-\" 65)"
] |
template
|
###lemma
(?p - ?n \<in> succs ?P 0) = (?p \<in> succs ?P ?n)
###symbols
Groups.zero_class.zero :::: 'a
Compiler2.succs :::: instr list \<Rightarrow> int \<Rightarrow> int set
Groups.minus_class.minus :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
###defs
class zero =
fixes zero :: 'a ("0")
definition succs :: "instr list \<Rightarrow> int \<Rightarrow> int set" where
"succs P n = {s. \<exists>i::int. 0 \<le> i \<and> i < size P \<and> s \<in> isuccs (P!!i) (n+i)}"
class minus =
fixes minus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "-" 65)
|
###output
(?H1 x_1 x_2 \<in> ?H2 x_3 ?H3) = (x_1 \<in> ?H2 x_3 x_2)###end
|
Library/AList
|
AList.clearjunk_restrict
|
lemma clearjunk_restrict: "clearjunk (restrict A al) = restrict A (clearjunk al)"
|
AList.clearjunk (AList.restrict ?A ?al) = AList.restrict ?A (AList.clearjunk ?al)
|
?H1 (?H2 x_1 x_2) = ?H2 x_1 (?H1 x_2)
|
[
"AList.restrict",
"AList.clearjunk"
] |
[
"'a set \\<Rightarrow> ('a \\<times> 'b) list \\<Rightarrow> ('a \\<times> 'b) list",
"('a \\<times> 'b) list \\<Rightarrow> ('a \\<times> 'b) list"
] |
[
"definition restrict :: \"'key set \\<Rightarrow> ('key \\<times> 'val) list \\<Rightarrow> ('key \\<times> 'val) list\"\n where restrict_eq: \"restrict A = filter (\\<lambda>(k, v). k \\<in> A)\"",
"function clearjunk :: \"('key \\<times> 'val) list \\<Rightarrow> ('key \\<times> 'val) list\"\n where\n \"clearjunk [] = []\"\n | \"clearjunk (p#ps) = p # clearjunk (delete (fst p) ps)\""
] |
template
|
###lemma
AList.clearjunk (AList.restrict ?A ?al) = AList.restrict ?A (AList.clearjunk ?al)
###symbols
AList.restrict :::: 'a set \<Rightarrow> ('a \<times> 'b) list \<Rightarrow> ('a \<times> 'b) list
AList.clearjunk :::: ('a \<times> 'b) list \<Rightarrow> ('a \<times> 'b) list
###defs
definition restrict :: "'key set \<Rightarrow> ('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
where restrict_eq: "restrict A = filter (\<lambda>(k, v). k \<in> A)"
function clearjunk :: "('key \<times> 'val) list \<Rightarrow> ('key \<times> 'val) list"
where
"clearjunk [] = []"
| "clearjunk (p#ps) = p # clearjunk (delete (fst p) ps)"
|
###output
?H1 (?H2 x_1 x_2) = ?H2 x_1 (?H1 x_2)###end
|
Computational_Algebra/Formal_Power_Series
|
Formal_Power_Series.fps_mult_left_const_nth
|
lemma fps_mult_left_const_nth [simp]:
"(fps_const (c::'a::{comm_monoid_add,mult_zero}) * f)$n = c* f$n"
|
fps_nth (fps_const ?c * ?f) ?n = ?c * fps_nth ?f ?n
|
?H1 (?H2 (?H3 x_1) x_2) x_3 = ?H2 x_1 (?H1 x_2 x_3)
|
[
"Formal_Power_Series.fps_const",
"Groups.times_class.times",
"Formal_Power_Series.fps.fps_nth"
] |
[
"'a \\<Rightarrow> 'a fps",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a fps \\<Rightarrow> nat \\<Rightarrow> 'a"
] |
[
"definition \"fps_const c = Abs_fps (\\<lambda>n. if n = 0 then c else 0)\"",
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)"
] |
template
|
###lemma
fps_nth (fps_const ?c * ?f) ?n = ?c * fps_nth ?f ?n
###symbols
Formal_Power_Series.fps_const :::: 'a \<Rightarrow> 'a fps
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Formal_Power_Series.fps.fps_nth :::: 'a fps \<Rightarrow> nat \<Rightarrow> 'a
###defs
definition "fps_const c = Abs_fps (\<lambda>n. if n = 0 then c else 0)"
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
|
###output
?H1 (?H2 (?H3 x_1) x_2) x_3 = ?H2 x_1 (?H1 x_2 x_3)###end
|
Metis_Examples/Binary_Tree
|
Binary_Tree.depth_bt_map
|
lemma depth_bt_map [simp]: "depth (bt_map f t) = depth t"
|
depth (bt_map ?f ?t) = depth ?t
|
?H1 (?H2 x_1 x_2) = ?H1 x_2
|
[
"Binary_Tree.bt_map",
"Binary_Tree.depth"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a bt \\<Rightarrow> 'b bt",
"'a bt \\<Rightarrow> nat"
] |
[
"primrec bt_map :: \"('a => 'b) => ('a bt => 'b bt)\" where\n \"bt_map f Lf = Lf\"\n| \"bt_map f (Br a t1 t2) = Br (f a) (bt_map f t1) (bt_map f t2)\"",
"primrec depth :: \"'a bt => nat\" where\n \"depth Lf = 0\"\n| \"depth (Br a t1 t2) = Suc (max (depth t1) (depth t2))\""
] |
template
|
###lemma
depth (bt_map ?f ?t) = depth ?t
###symbols
Binary_Tree.bt_map :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a bt \<Rightarrow> 'b bt
Binary_Tree.depth :::: 'a bt \<Rightarrow> nat
###defs
primrec bt_map :: "('a => 'b) => ('a bt => 'b bt)" where
"bt_map f Lf = Lf"
| "bt_map f (Br a t1 t2) = Br (f a) (bt_map f t1) (bt_map f t2)"
primrec depth :: "'a bt => nat" where
"depth Lf = 0"
| "depth (Br a t1 t2) = Suc (max (depth t1) (depth t2))"
|
###output
?H1 (?H2 x_1 x_2) = ?H1 x_2###end
|
Homology/Simplices
|
Simplices.simplicial_chain_sum
|
lemma simplicial_chain_sum:
"(\<And>i. i \<in> I \<Longrightarrow> simplicial_chain p S (f i)) \<Longrightarrow> simplicial_chain p S (sum f I)"
|
(\<And>i. i \<in> ?I \<Longrightarrow> simplicial_chain ?p ?S (?f i)) \<Longrightarrow> simplicial_chain ?p ?S (sum ?f ?I)
|
(\<And>y_0. y_0 \<in> x_1 \<Longrightarrow> ?H1 x_2 x_3 (x_4 y_0)) \<Longrightarrow> ?H1 x_2 x_3 (?H2 x_4 x_1)
|
[
"Groups_Big.comm_monoid_add_class.sum",
"Simplices.simplicial_chain"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b",
"nat \\<Rightarrow> ('a \\<Rightarrow> real) set \\<Rightarrow> (((nat \\<Rightarrow> real) \\<Rightarrow> 'a \\<Rightarrow> real) \\<Rightarrow>\\<^sub>0 'b) \\<Rightarrow> bool"
] |
[
"definition simplicial_chain\n where \"simplicial_chain p S c \\<equiv> Poly_Mapping.keys c \\<subseteq> Collect (simplicial_simplex p S)\""
] |
template
|
###lemma
(\<And>i. i \<in> ?I \<Longrightarrow> simplicial_chain ?p ?S (?f i)) \<Longrightarrow> simplicial_chain ?p ?S (sum ?f ?I)
###symbols
Groups_Big.comm_monoid_add_class.sum :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b
Simplices.simplicial_chain :::: nat \<Rightarrow> ('a \<Rightarrow> real) set \<Rightarrow> (((nat \<Rightarrow> real) \<Rightarrow> 'a \<Rightarrow> real) \<Rightarrow>\<^sub>0 'b) \<Rightarrow> bool
###defs
definition simplicial_chain
where "simplicial_chain p S c \<equiv> Poly_Mapping.keys c \<subseteq> Collect (simplicial_simplex p S)"
|
###output
(\<And>y_0. y_0 \<in> x_1 \<Longrightarrow> ?H1 x_2 x_3 (x_4 y_0)) \<Longrightarrow> ?H1 x_2 x_3 (?H2 x_4 x_1)###end
|
Nominal/Examples/SN
|
SN.fresh_ty
|
lemma fresh_ty:
fixes a ::"name"
and \<tau> ::"ty"
shows "a\<sharp>\<tau>"
|
?a \<sharp> ?\<tau>
|
?H1 x_1 x_2
|
[
"Nominal.fresh"
] |
[
"'a \\<Rightarrow> 'b \\<Rightarrow> bool"
] |
[
"definition fresh :: \"'x \\<Rightarrow> 'a \\<Rightarrow> bool\" (\\<open>_ \\<sharp> _\\<close> [80,80] 80) where\n \"a \\<sharp> x \\<longleftrightarrow> a \\<notin> supp x\""
] |
template
|
###lemma
?a \<sharp> ?\<tau>
###symbols
Nominal.fresh :::: 'a \<Rightarrow> 'b \<Rightarrow> bool
###defs
definition fresh :: "'x \<Rightarrow> 'a \<Rightarrow> bool" (\<open>_ \<sharp> _\<close> [80,80] 80) where
"a \<sharp> x \<longleftrightarrow> a \<notin> supp x"
|
###output
?H1 x_1 x_2###end
|
Fun
|
Fun.monotone_on_empty
|
lemma monotone_on_empty[simp]: "monotone_on {} orda ordb f"
|
monotone_on {} ?orda ?ordb ?f
|
?H1 ?H2 x_1 x_2 x_3
|
[
"Set.empty",
"Fun.monotone_on"
] |
[
"'a set",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> ('b \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"abbreviation empty :: \"'a set\" (\"{}\")\n where \"{} \\<equiv> bot\"",
"definition monotone_on :: \"'a set \\<Rightarrow> ('a \\<Rightarrow> 'a \\<Rightarrow> bool) \\<Rightarrow> ('b \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool\"\n where \"monotone_on A orda ordb f \\<longleftrightarrow> (\\<forall>x\\<in>A. \\<forall>y\\<in>A. orda x y \\<longrightarrow> ordb (f x) (f y))\""
] |
template
|
###lemma
monotone_on {} ?orda ?ordb ?f
###symbols
Set.empty :::: 'a set
Fun.monotone_on :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
abbreviation empty :: "'a set" ("{}")
where "{} \<equiv> bot"
definition monotone_on :: "'a set \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool"
where "monotone_on A orda ordb f \<longleftrightarrow> (\<forall>x\<in>A. \<forall>y\<in>A. orda x y \<longrightarrow> ordb (f x) (f y))"
|
###output
?H1 ?H2 x_1 x_2 x_3###end
|
Quotient_Examples/Lift_FSet
|
Lift_FSet.abs_fset_eq_iff
|
lemma abs_fset_eq_iff: "abs_fset xs = abs_fset ys \<longleftrightarrow> list_eq xs ys"
|
(abs_fset ?xs = abs_fset ?ys) = list_eq ?xs ?ys
|
(?H1 x_1 = ?H1 x_2) = ?H2 x_1 x_2
|
[
"Lift_FSet.list_eq",
"Lift_FSet.abs_fset"
] |
[
"'a list \\<Rightarrow> 'a list \\<Rightarrow> bool",
"'a list \\<Rightarrow> 'a fset"
] |
[
"definition list_eq :: \"'a list \\<Rightarrow> 'a list \\<Rightarrow> bool\"\n where [simp]: \"list_eq xs ys \\<longleftrightarrow> set xs = set ys\""
] |
template
|
###lemma
(abs_fset ?xs = abs_fset ?ys) = list_eq ?xs ?ys
###symbols
Lift_FSet.list_eq :::: 'a list \<Rightarrow> 'a list \<Rightarrow> bool
Lift_FSet.abs_fset :::: 'a list \<Rightarrow> 'a fset
###defs
definition list_eq :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool"
where [simp]: "list_eq xs ys \<longleftrightarrow> set xs = set ys"
|
###output
(?H1 x_1 = ?H1 x_2) = ?H2 x_1 x_2###end
|
Bali/DefiniteAssignmentCorrect
|
DefiniteAssignmentCorrect.Body_no_jump
|
lemma Body_no_jump:
assumes eval: "G\<turnstile>s0 \<midarrow>Body D c-\<succ>v\<rightarrow>s1" and
jump: "abrupt s0 \<noteq> Some (Jump j)"
shows "abrupt s1 \<noteq> Some (Jump j)"
|
?G\<turnstile> ?s0.0 \<midarrow>Body ?D ?c-\<succ> ?v\<rightarrow> ?s1.0 \<Longrightarrow> fst ?s0.0 \<noteq> Some (Jump ?j) \<Longrightarrow> fst ?s1.0 \<noteq> Some (Jump ?j)
|
\<lbrakk> ?H1 x_1 x_2 (?H2 x_3 x_4) x_5 x_6; ?H3 x_2 \<noteq> ?H4 (?H5 x_7)\<rbrakk> \<Longrightarrow> ?H3 x_6 \<noteq> ?H4 (?H5 x_7)
|
[
"Term.abrupt.Jump",
"Option.option.Some",
"Product_Type.prod.fst",
"Term.expr.Body",
"Eval.eval'"
] |
[
"jump \\<Rightarrow> abrupt",
"'a \\<Rightarrow> 'a option",
"'a \\<times> 'b \\<Rightarrow> 'a",
"qtname \\<Rightarrow> stmt \\<Rightarrow> expr",
"prog \\<Rightarrow> state \\<Rightarrow> expr \\<Rightarrow> val \\<Rightarrow> state \\<Rightarrow> bool"
] |
[
"datatype abrupt \\<comment> \\<open>abrupt completion\\<close> \n = Xcpt xcpt \\<comment> \\<open>exception\\<close>\n | Jump jump \\<comment> \\<open>break, continue, return\\<close>\n | Error error \\<comment> \\<open>runtime errors, we wan't to detect and proof absent\n in welltyped programms\\<close>",
"datatype 'a option =\n None\n | Some (the: 'a)",
"definition \"prod = {f. \\<exists>a b. f = Pair_Rep (a::'a) (b::'b)}\""
] |
template
|
###lemma
?G\<turnstile> ?s0.0 \<midarrow>Body ?D ?c-\<succ> ?v\<rightarrow> ?s1.0 \<Longrightarrow> fst ?s0.0 \<noteq> Some (Jump ?j) \<Longrightarrow> fst ?s1.0 \<noteq> Some (Jump ?j)
###symbols
Term.abrupt.Jump :::: jump \<Rightarrow> abrupt
Option.option.Some :::: 'a \<Rightarrow> 'a option
Product_Type.prod.fst :::: 'a \<times> 'b \<Rightarrow> 'a
Term.expr.Body :::: qtname \<Rightarrow> stmt \<Rightarrow> expr
Eval.eval' :::: prog \<Rightarrow> state \<Rightarrow> expr \<Rightarrow> val \<Rightarrow> state \<Rightarrow> bool
###defs
datatype abrupt \<comment> \<open>abrupt completion\<close>
= Xcpt xcpt \<comment> \<open>exception\<close>
| Jump jump \<comment> \<open>break, continue, return\<close>
| Error error \<comment> \<open>runtime errors, we wan't to detect and proof absent
in welltyped programms\<close>
datatype 'a option =
None
| Some (the: 'a)
definition "prod = {f. \<exists>a b. f = Pair_Rep (a::'a) (b::'b)}"
|
###output
\<lbrakk> ?H1 x_1 x_2 (?H2 x_3 x_4) x_5 x_6; ?H3 x_2 \<noteq> ?H4 (?H5 x_7)\<rbrakk> \<Longrightarrow> ?H3 x_6 \<noteq> ?H4 (?H5 x_7)###end
|
Library/Word
|
Word.unat_mod_distrib
|
lemma unat_mod_distrib:
\<open>unat (v mod w) = unat v mod unat w\<close>
|
unat (?v mod ?w) = unat ?v mod unat ?w
|
?H1 (?H2 x_1 x_2) = ?H2 (?H1 x_1) (?H1 x_2)
|
[
"Rings.modulo_class.modulo",
"Word.unat"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a word \\<Rightarrow> nat"
] |
[
"class modulo = dvd + divide +\n fixes modulo :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"mod\" 70)",
"abbreviation unat :: \\<open>'a::len word \\<Rightarrow> nat\\<close>\n where \\<open>unat \\<equiv> unsigned\\<close>"
] |
template
|
###lemma
unat (?v mod ?w) = unat ?v mod unat ?w
###symbols
Rings.modulo_class.modulo :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Word.unat :::: 'a word \<Rightarrow> nat
###defs
class modulo = dvd + divide +
fixes modulo :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "mod" 70)
abbreviation unat :: \<open>'a::len word \<Rightarrow> nat\<close>
where \<open>unat \<equiv> unsigned\<close>
|
###output
?H1 (?H2 x_1 x_2) = ?H2 (?H1 x_1) (?H1 x_2)###end
|
Bali/WellForm
|
WellForm.wf_prog_hidesD
|
lemma wf_prog_hidesD:
assumes hides: "G \<turnstile>new hides old" and wf: "wf_prog G"
shows
"accmodi old \<le> accmodi new \<and>
is_static old"
|
?G\<turnstile> ?new hides ?old \<Longrightarrow> wf_prog ?G \<Longrightarrow> accmodi ?old \<le> accmodi ?new \<and> is_static ?old
|
\<lbrakk> ?H1 x_1 x_2 x_3; ?H2 x_1\<rbrakk> \<Longrightarrow> ?H3 x_3 \<le> ?H3 x_2 \<and> ?H4 x_3
|
[
"DeclConcepts.has_static_class.is_static",
"DeclConcepts.has_accmodi_class.accmodi",
"WellForm.wf_prog",
"DeclConcepts.hides"
] |
[
"'a \\<Rightarrow> bool",
"'a \\<Rightarrow> acc_modi",
"prog \\<Rightarrow> bool",
"prog \\<Rightarrow> qtname \\<times> mdecl \\<Rightarrow> qtname \\<times> mdecl \\<Rightarrow> bool"
] |
[
"class has_static =\n fixes is_static :: \"'a \\<Rightarrow> bool\"",
"class has_accmodi =\n fixes accmodi:: \"'a \\<Rightarrow> acc_modi\"",
"definition\n wf_prog :: \"prog \\<Rightarrow> bool\" where\n \"wf_prog G = (let is = ifaces G; cs = classes G in\n ObjectC \\<in> set cs \\<and> \n (\\<forall> m\\<in>set Object_mdecls. accmodi m \\<noteq> Package) \\<and>\n (\\<forall>xn. SXcptC xn \\<in> set cs) \\<and>\n (\\<forall>i\\<in>set is. wf_idecl G i) \\<and> unique is \\<and>\n (\\<forall>c\\<in>set cs. wf_cdecl G c) \\<and> unique cs)\"",
"definition\n hides :: \"prog \\<Rightarrow> (qtname \\<times> mdecl) \\<Rightarrow> (qtname \\<times> mdecl) \\<Rightarrow> bool\" (\"_\\<turnstile> _ hides _\" [61,61,61] 60)\nwhere \n \"G\\<turnstile>new hides old =\n (is_static new \\<and> msig new = msig old \\<and>\n G\\<turnstile>(declclass new) \\<prec>\\<^sub>C (declclass old) \\<and>\n G\\<turnstile>Method new declared_in (declclass new) \\<and>\n G\\<turnstile>Method old declared_in (declclass old) \\<and> \n G\\<turnstile>Method old inheritable_in pid (declclass new))\""
] |
template
|
###lemma
?G\<turnstile> ?new hides ?old \<Longrightarrow> wf_prog ?G \<Longrightarrow> accmodi ?old \<le> accmodi ?new \<and> is_static ?old
###symbols
DeclConcepts.has_static_class.is_static :::: 'a \<Rightarrow> bool
DeclConcepts.has_accmodi_class.accmodi :::: 'a \<Rightarrow> acc_modi
WellForm.wf_prog :::: prog \<Rightarrow> bool
DeclConcepts.hides :::: prog \<Rightarrow> qtname \<times> mdecl \<Rightarrow> qtname \<times> mdecl \<Rightarrow> bool
###defs
class has_static =
fixes is_static :: "'a \<Rightarrow> bool"
class has_accmodi =
fixes accmodi:: "'a \<Rightarrow> acc_modi"
definition
wf_prog :: "prog \<Rightarrow> bool" where
"wf_prog G = (let is = ifaces G; cs = classes G in
ObjectC \<in> set cs \<and>
(\<forall> m\<in>set Object_mdecls. accmodi m \<noteq> Package) \<and>
(\<forall>xn. SXcptC xn \<in> set cs) \<and>
(\<forall>i\<in>set is. wf_idecl G i) \<and> unique is \<and>
(\<forall>c\<in>set cs. wf_cdecl G c) \<and> unique cs)"
definition
hides :: "prog \<Rightarrow> (qtname \<times> mdecl) \<Rightarrow> (qtname \<times> mdecl) \<Rightarrow> bool" ("_\<turnstile> _ hides _" [61,61,61] 60)
where
"G\<turnstile>new hides old =
(is_static new \<and> msig new = msig old \<and>
G\<turnstile>(declclass new) \<prec>\<^sub>C (declclass old) \<and>
G\<turnstile>Method new declared_in (declclass new) \<and>
G\<turnstile>Method old declared_in (declclass old) \<and>
G\<turnstile>Method old inheritable_in pid (declclass new))"
|
###output
\<lbrakk> ?H1 x_1 x_2 x_3; ?H2 x_1\<rbrakk> \<Longrightarrow> ?H3 x_3 \<le> ?H3 x_2 \<and> ?H4 x_3###end
|
Analysis/Uniform_Limit
|
Uniform_Limit.uniform_lim_mult
|
lemma uniform_lim_mult:
fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_algebra"
assumes f: "uniform_limit S f l F"
and g: "uniform_limit S g m F"
and l: "bounded (l ` S)"
and m: "bounded (m ` S)"
shows "uniform_limit S (\<lambda>a b. f a b * g a b) (\<lambda>a. l a * m a) F"
|
uniform_limit ?S ?f ?l ?F \<Longrightarrow> uniform_limit ?S ?g ?m ?F \<Longrightarrow> bounded (?l ` ?S) \<Longrightarrow> bounded (?m ` ?S) \<Longrightarrow> uniform_limit ?S (\<lambda>a b. ?f a b * ?g a b) (\<lambda>a. ?l a * ?m a) ?F
|
\<lbrakk> ?H1 x_1 x_2 x_3 x_4; ?H1 x_1 x_5 x_6 x_4; ?H2 (?H3 x_3 x_1); ?H2 (?H3 x_6 x_1)\<rbrakk> \<Longrightarrow> ?H1 x_1 (\<lambda>y_0 y_1. ?H4 (x_2 y_0 y_1) (x_5 y_0 y_1)) (\<lambda>y_2. ?H4 (x_3 y_2) (x_6 y_2)) x_4
|
[
"Groups.times_class.times",
"Set.image",
"Elementary_Metric_Spaces.metric_space_class.bounded",
"Uniform_Limit.uniform_limit"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a set \\<Rightarrow> bool",
"'a set \\<Rightarrow> ('b \\<Rightarrow> 'a \\<Rightarrow> 'c) \\<Rightarrow> ('a \\<Rightarrow> 'c) \\<Rightarrow> 'b filter \\<Rightarrow> bool"
] |
[
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\""
] |
template
|
###lemma
uniform_limit ?S ?f ?l ?F \<Longrightarrow> uniform_limit ?S ?g ?m ?F \<Longrightarrow> bounded (?l ` ?S) \<Longrightarrow> bounded (?m ` ?S) \<Longrightarrow> uniform_limit ?S (\<lambda>a b. ?f a b * ?g a b) (\<lambda>a. ?l a * ?m a) ?F
###symbols
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Elementary_Metric_Spaces.metric_space_class.bounded :::: 'a set \<Rightarrow> bool
Uniform_Limit.uniform_limit :::: 'a set \<Rightarrow> ('b \<Rightarrow> 'a \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'c) \<Rightarrow> 'b filter \<Rightarrow> bool
###defs
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
|
###output
\<lbrakk> ?H1 x_1 x_2 x_3 x_4; ?H1 x_1 x_5 x_6 x_4; ?H2 (?H3 x_3 x_1); ?H2 (?H3 x_6 x_1)\<rbrakk> \<Longrightarrow> ?H1 x_1 (\<lambda>y_0 y_1. ?H4 (x_2 y_0 y_1) (x_5 y_0 y_1)) (\<lambda>y_2. ?H4 (x_3 y_2) (x_6 y_2)) x_4###end
|
Analysis/Elementary_Normed_Spaces
|
Elementary_Normed_Spaces.complete_isometric_image
|
lemma complete_isometric_image:
assumes "0 < e"
and s: "subspace s"
and f: "bounded_linear f"
and normf: "\<forall>x\<in>s. norm(f x) \<ge> e * norm(x)"
and cs: "complete s"
shows "complete (f ` s)"
|
0 < ?e \<Longrightarrow> subspace ?s \<Longrightarrow> bounded_linear ?f \<Longrightarrow> \<forall>x\<in> ?s. ?e * norm x \<le> norm (?f x) \<Longrightarrow> complete ?s \<Longrightarrow> complete (?f ` ?s)
|
\<lbrakk> ?H1 < x_1; ?H2 x_2; ?H3 x_3; \<forall>y_0\<in>x_2. ?H4 x_1 (?H5 y_0) \<le> ?H5 (x_3 y_0); ?H6 x_2\<rbrakk> \<Longrightarrow> ?H6 (?H7 x_3 x_2)
|
[
"Set.image",
"Topological_Spaces.uniform_space_class.complete",
"Real_Vector_Spaces.norm_class.norm",
"Groups.times_class.times",
"Real_Vector_Spaces.bounded_linear",
"Real_Vector_Spaces.subspace",
"Groups.zero_class.zero"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a set \\<Rightarrow> bool",
"'a \\<Rightarrow> real",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"('a \\<Rightarrow> 'b) \\<Rightarrow> bool",
"'a set \\<Rightarrow> bool",
"'a"
] |
[
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"class uniform_space = open_uniformity +\n assumes uniformity_refl: \"eventually E uniformity \\<Longrightarrow> E (x, x)\"\n and uniformity_sym: \"eventually E uniformity \\<Longrightarrow> eventually (\\<lambda>(x, y). E (y, x)) uniformity\"\n and uniformity_trans:\n \"eventually E uniformity \\<Longrightarrow>\n \\<exists>D. eventually D uniformity \\<and> (\\<forall>x y z. D (x, y) \\<longrightarrow> D (y, z) \\<longrightarrow> E (x, z))\"\nbegin",
"class norm =\n fixes norm :: \"'a \\<Rightarrow> real\"",
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"class zero =\n fixes zero :: 'a (\"0\")"
] |
template
|
###lemma
0 < ?e \<Longrightarrow> subspace ?s \<Longrightarrow> bounded_linear ?f \<Longrightarrow> \<forall>x\<in> ?s. ?e * norm x \<le> norm (?f x) \<Longrightarrow> complete ?s \<Longrightarrow> complete (?f ` ?s)
###symbols
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Topological_Spaces.uniform_space_class.complete :::: 'a set \<Rightarrow> bool
Real_Vector_Spaces.norm_class.norm :::: 'a \<Rightarrow> real
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Real_Vector_Spaces.bounded_linear :::: ('a \<Rightarrow> 'b) \<Rightarrow> bool
Real_Vector_Spaces.subspace :::: 'a set \<Rightarrow> bool
Groups.zero_class.zero :::: 'a
###defs
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
class uniform_space = open_uniformity +
assumes uniformity_refl: "eventually E uniformity \<Longrightarrow> E (x, x)"
and uniformity_sym: "eventually E uniformity \<Longrightarrow> eventually (\<lambda>(x, y). E (y, x)) uniformity"
and uniformity_trans:
"eventually E uniformity \<Longrightarrow>
\<exists>D. eventually D uniformity \<and> (\<forall>x y z. D (x, y) \<longrightarrow> D (y, z) \<longrightarrow> E (x, z))"
begin
class norm =
fixes norm :: "'a \<Rightarrow> real"
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
class zero =
fixes zero :: 'a ("0")
|
###output
\<lbrakk> ?H1 < x_1; ?H2 x_2; ?H3 x_3; \<forall>y_0\<in>x_2. ?H4 x_1 (?H5 y_0) \<le> ?H5 (x_3 y_0); ?H6 x_2\<rbrakk> \<Longrightarrow> ?H6 (?H7 x_3 x_2)###end
|
Analysis/Bochner_Integration
|
Bochner_Integration.integrable_zero
|
lemma integrable_zero[simp, intro]: "integrable M (\<lambda>x. 0)"
|
integrable ?M (\<lambda>x. 0:: ?'b)
|
?H1 x_1 (\<lambda>y_0. ?H2)
|
[
"Groups.zero_class.zero",
"Bochner_Integration.integrable"
] |
[
"'a",
"'a measure \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"class zero =\n fixes zero :: 'a (\"0\")",
"inductive integrable for M f where\n \"has_bochner_integral M f x \\<Longrightarrow> integrable M f\""
] |
template
|
###lemma
integrable ?M (\<lambda>x. 0:: ?'b)
###symbols
Groups.zero_class.zero :::: 'a
Bochner_Integration.integrable :::: 'a measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
class zero =
fixes zero :: 'a ("0")
inductive integrable for M f where
"has_bochner_integral M f x \<Longrightarrow> integrable M f"
|
###output
?H1 x_1 (\<lambda>y_0. ?H2)###end
|
Analysis/Bochner_Integration
|
Bochner_Integration.integral_mono
|
lemma integral_mono:
fixes f :: "'a \<Rightarrow> real"
shows "integrable M f \<Longrightarrow> integrable M g \<Longrightarrow> (\<And>x. x \<in> space M \<Longrightarrow> f x \<le> g x) \<Longrightarrow>
integral\<^sup>L M f \<le> integral\<^sup>L M g"
|
integrable ?M ?f \<Longrightarrow> integrable ?M ?g \<Longrightarrow> (\<And>x. x \<in> space ?M \<Longrightarrow> ?f x \<le> ?g x) \<Longrightarrow> integral\<^sup>L ?M ?f \<le> integral\<^sup>L ?M ?g
|
\<lbrakk> ?H1 x_1 x_2; ?H1 x_1 x_3; \<And>y_0. y_0 \<in> ?H2 x_1 \<Longrightarrow> x_2 y_0 \<le> x_3 y_0\<rbrakk> \<Longrightarrow> ?H3 x_1 x_2 \<le> ?H3 x_1 x_3
|
[
"Bochner_Integration.lebesgue_integral",
"Sigma_Algebra.space",
"Bochner_Integration.integrable"
] |
[
"'a measure \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> 'b",
"'a measure \\<Rightarrow> 'a set",
"'a measure \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool"
] |
[
"inductive integrable for M f where\n \"has_bochner_integral M f x \\<Longrightarrow> integrable M f\""
] |
template
|
###lemma
integrable ?M ?f \<Longrightarrow> integrable ?M ?g \<Longrightarrow> (\<And>x. x \<in> space ?M \<Longrightarrow> ?f x \<le> ?g x) \<Longrightarrow> integral\<^sup>L ?M ?f \<le> integral\<^sup>L ?M ?g
###symbols
Bochner_Integration.lebesgue_integral :::: 'a measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'b
Sigma_Algebra.space :::: 'a measure \<Rightarrow> 'a set
Bochner_Integration.integrable :::: 'a measure \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
###defs
inductive integrable for M f where
"has_bochner_integral M f x \<Longrightarrow> integrable M f"
|
###output
\<lbrakk> ?H1 x_1 x_2; ?H1 x_1 x_3; \<And>y_0. y_0 \<in> ?H2 x_1 \<Longrightarrow> x_2 y_0 \<le> x_3 y_0\<rbrakk> \<Longrightarrow> ?H3 x_1 x_2 \<le> ?H3 x_1 x_3###end
|
Data_Structures/Braun_Tree
|
Braun_Tree.even_of_intvl_intvl
|
lemma even_of_intvl_intvl:
fixes S :: "nat set"
assumes "S = {m..n} \<inter> {i. even i}"
shows "\<exists>m' n'. S = (\<lambda>i. i * 2) ` {m'..n'}"
|
?S = { ?m.. ?n} \<inter> Collect even \<Longrightarrow> \<exists>m' n'. ?S = (\<lambda>i. i * 2) ` {m'..n'}
|
x_1 = ?H1 (?H2 x_2 x_3) (?H3 ?H4) \<Longrightarrow> \<exists>y_0 y_1. x_1 = ?H5 (\<lambda>y_2. ?H6 y_2 (?H7 (?H8 ?H9))) (?H2 y_0 y_1)
|
[
"Num.num.One",
"Num.num.Bit0",
"Num.numeral_class.numeral",
"Groups.times_class.times",
"Set.image",
"Parity.semiring_parity_class.even",
"Set.Collect",
"Set_Interval.ord_class.atLeastAtMost",
"Set.inter"
] |
[
"num",
"num \\<Rightarrow> num",
"num \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set",
"'a \\<Rightarrow> bool",
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a set",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set"
] |
[
"datatype num = One | Bit0 num | Bit1 num",
"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 times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\"",
"class semiring_parity = comm_semiring_1 + semiring_modulo +\n assumes mod_2_eq_odd: \\<open>a mod 2 = of_bool (\\<not> 2 dvd a)\\<close>\n and odd_one [simp]: \\<open>\\<not> 2 dvd 1\\<close>\n and even_half_succ_eq [simp]: \\<open>2 dvd a \\<Longrightarrow> (1 + a) div 2 = a div 2\\<close>\nbegin",
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\""
] |
template
|
###lemma
?S = { ?m.. ?n} \<inter> Collect even \<Longrightarrow> \<exists>m' n'. ?S = (\<lambda>i. i * 2) ` {m'..n'}
###symbols
Num.num.One :::: num
Num.num.Bit0 :::: num \<Rightarrow> num
Num.numeral_class.numeral :::: num \<Rightarrow> 'a
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
Parity.semiring_parity_class.even :::: 'a \<Rightarrow> bool
Set.Collect :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a set
Set_Interval.ord_class.atLeastAtMost :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a set
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
###defs
datatype num = One | Bit0 num | Bit1 num
datatype num = One | Bit0 num | Bit1 num
primrec numeral :: "num \<Rightarrow> 'a"
where
numeral_One: "numeral One = 1"
| numeral_Bit0: "numeral (Bit0 n) = numeral n + numeral n"
| numeral_Bit1: "numeral (Bit1 n) = numeral n + numeral n + 1"
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
class semiring_parity = comm_semiring_1 + semiring_modulo +
assumes mod_2_eq_odd: \<open>a mod 2 = of_bool (\<not> 2 dvd a)\<close>
and odd_one [simp]: \<open>\<not> 2 dvd 1\<close>
and even_half_succ_eq [simp]: \<open>2 dvd a \<Longrightarrow> (1 + a) div 2 = a div 2\<close>
begin
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
|
###output
x_1 = ?H1 (?H2 x_2 x_3) (?H3 ?H4) \<Longrightarrow> \<exists>y_0 y_1. x_1 = ?H5 (\<lambda>y_2. ?H6 y_2 (?H7 (?H8 ?H9))) (?H2 y_0 y_1)###end
|
Analysis/Measure_Space
|
Measure_Space.emeasure_restrict_space
|
lemma emeasure_restrict_space:
assumes "\<Omega> \<inter> space M \<in> sets M" "A \<subseteq> \<Omega>"
shows "emeasure (restrict_space M \<Omega>) A = emeasure M A"
|
?\<Omega> \<inter> space ?M \<in> sets ?M \<Longrightarrow> ?A \<subseteq> ?\<Omega> \<Longrightarrow> emeasure (restrict_space ?M ?\<Omega>) ?A = emeasure ?M ?A
|
\<lbrakk> ?H1 x_1 (?H2 x_2) \<in> ?H3 x_2; ?H4 x_3 x_1\<rbrakk> \<Longrightarrow> ?H5 (?H6 x_2 x_1) x_3 = ?H5 x_2 x_3
|
[
"Sigma_Algebra.restrict_space",
"Sigma_Algebra.emeasure",
"Set.subset_eq",
"Sigma_Algebra.sets",
"Sigma_Algebra.space",
"Set.inter"
] |
[
"'a measure \\<Rightarrow> 'a set \\<Rightarrow> 'a measure",
"'a measure \\<Rightarrow> 'a set \\<Rightarrow> ennreal",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool",
"'a measure \\<Rightarrow> 'a set set",
"'a measure \\<Rightarrow> 'a set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set"
] |
[
"definition restrict_space :: \"'a measure \\<Rightarrow> 'a set \\<Rightarrow> 'a measure\" where\n \"restrict_space M \\<Omega> = measure_of (\\<Omega> \\<inter> space M) (((\\<inter>) \\<Omega>) ` sets M) (emeasure M)\"",
"abbreviation subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\"",
"abbreviation inter :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> 'a set\" (infixl \"\\<inter>\" 70)\n where \"(\\<inter>) \\<equiv> inf\""
] |
template
|
###lemma
?\<Omega> \<inter> space ?M \<in> sets ?M \<Longrightarrow> ?A \<subseteq> ?\<Omega> \<Longrightarrow> emeasure (restrict_space ?M ?\<Omega>) ?A = emeasure ?M ?A
###symbols
Sigma_Algebra.restrict_space :::: 'a measure \<Rightarrow> 'a set \<Rightarrow> 'a measure
Sigma_Algebra.emeasure :::: 'a measure \<Rightarrow> 'a set \<Rightarrow> ennreal
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
Sigma_Algebra.sets :::: 'a measure \<Rightarrow> 'a set set
Sigma_Algebra.space :::: 'a measure \<Rightarrow> 'a set
Set.inter :::: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set
###defs
definition restrict_space :: "'a measure \<Rightarrow> 'a set \<Rightarrow> 'a measure" where
"restrict_space M \<Omega> = measure_of (\<Omega> \<inter> space M) (((\<inter>) \<Omega>) ` sets M) (emeasure M)"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "\<inter>" 70)
where "(\<inter>) \<equiv> inf"
|
###output
\<lbrakk> ?H1 x_1 (?H2 x_2) \<in> ?H3 x_2; ?H4 x_3 x_1\<rbrakk> \<Longrightarrow> ?H5 (?H6 x_2 x_1) x_3 = ?H5 x_2 x_3###end
|
NanoJava/Example
|
Example.init_locs_Nat_add
|
lemma init_locs_Nat_add [simp]: "init_locs Nat add s = s"
|
init_locs Nat add ?s = ?s
|
?H1 ?H2 ?H3 x_1 = x_1
|
[
"Example.add",
"Example.N",
"State.init_locs"
] |
[
"mname",
"cname",
"cname \\<Rightarrow> mname \\<Rightarrow> state \\<Rightarrow> state"
] |
[
"definition init_locs :: \"cname => mname => state => state\" where\n \"init_locs C m s \\<equiv> s (| locals := locals s ++ \n init_vars (map_of (lcl (the (method C m)))) |)\""
] |
template
|
###lemma
init_locs Nat add ?s = ?s
###symbols
Example.add :::: mname
Example.N :::: cname
State.init_locs :::: cname \<Rightarrow> mname \<Rightarrow> state \<Rightarrow> state
###defs
definition init_locs :: "cname => mname => state => state" where
"init_locs C m s \<equiv> s (| locals := locals s ++
init_vars (map_of (lcl (the (method C m)))) |)"
|
###output
?H1 ?H2 ?H3 x_1 = x_1###end
|
Transfer
|
Transfer.right_unique_OO
|
lemma right_unique_OO:
"\<lbrakk>right_unique A; right_unique B\<rbrakk> \<Longrightarrow> right_unique (A OO B)"
|
right_unique ?A \<Longrightarrow> right_unique ?B \<Longrightarrow> right_unique (?A OO ?B)
|
\<lbrakk> ?H1 x_1; ?H1 x_2\<rbrakk> \<Longrightarrow> ?H1 (?H2 x_1 x_2)
|
[
"Relation.relcompp",
"Transfer.right_unique"
] |
[
"('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> ('b \\<Rightarrow> 'c \\<Rightarrow> bool) \\<Rightarrow> 'a \\<Rightarrow> 'c \\<Rightarrow> bool",
"('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> bool"
] |
[
"definition right_unique :: \"('a \\<Rightarrow> 'b \\<Rightarrow> bool) \\<Rightarrow> bool\"\n where \"right_unique R \\<longleftrightarrow> (\\<forall>x y z. R x y \\<longrightarrow> R x z \\<longrightarrow> y = z)\""
] |
template
|
###lemma
right_unique ?A \<Longrightarrow> right_unique ?B \<Longrightarrow> right_unique (?A OO ?B)
###symbols
Relation.relcompp :::: ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'c \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> 'c \<Rightarrow> bool
Transfer.right_unique :::: ('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> bool
###defs
definition right_unique :: "('a \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> bool"
where "right_unique R \<longleftrightarrow> (\<forall>x y z. R x y \<longrightarrow> R x z \<longrightarrow> y = z)"
|
###output
\<lbrakk> ?H1 x_1; ?H1 x_2\<rbrakk> \<Longrightarrow> ?H1 (?H2 x_1 x_2)###end
|
Auth/Smartcard/EventSC
|
EventSC.knows_subset_knows_Says
|
lemma knows_subset_knows_Says: "knows A evs \<subseteq> knows A (Says A' B X # evs)"
|
knows ?A ?evs \<subseteq> knows ?A (Says ?A' ?B ?X # ?evs)
|
?H1 (?H2 x_1 x_2) (?H2 x_1 (?H3 (?H4 x_3 x_4 x_5) x_2))
|
[
"EventSC.event.Says",
"List.list.Cons",
"EventSC.knows",
"Set.subset_eq"
] |
[
"agent \\<Rightarrow> agent \\<Rightarrow> msg \\<Rightarrow> event",
"'a \\<Rightarrow> 'a list \\<Rightarrow> 'a list",
"agent \\<Rightarrow> event list \\<Rightarrow> msg set",
"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool"
] |
[
"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 subset_eq :: \"'a set \\<Rightarrow> 'a set \\<Rightarrow> bool\"\n where \"subset_eq \\<equiv> less_eq\""
] |
template
|
###lemma
knows ?A ?evs \<subseteq> knows ?A (Says ?A' ?B ?X # ?evs)
###symbols
EventSC.event.Says :::: agent \<Rightarrow> agent \<Rightarrow> msg \<Rightarrow> event
List.list.Cons :::: 'a \<Rightarrow> 'a list \<Rightarrow> 'a list
EventSC.knows :::: agent \<Rightarrow> event list \<Rightarrow> msg set
Set.subset_eq :::: 'a set \<Rightarrow> 'a set \<Rightarrow> bool
###defs
datatype (set: 'a) list =
Nil ("[]")
| Cons (hd: 'a) (tl: "'a list") (infixr "#" 65)
for
map: map
rel: list_all2
pred: list_all
where
"tl [] = []"
abbreviation subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
where "subset_eq \<equiv> less_eq"
|
###output
?H1 (?H2 x_1 x_2) (?H2 x_1 (?H3 (?H4 x_3 x_4 x_5) x_2))###end
|
Filter
|
Filter.eventually_frequently_simps(1)
| null |
(\<exists>\<^sub>F x in ?F. ?P x \<and> ?C) = (frequently ?P ?F \<and> ?C)
|
?H1 (\<lambda>y_0. x_1 y_0 \<and> x_2) x_3 = (?H1 x_1 x_3 \<and> x_2)
|
[
"Filter.frequently"
] |
[
"('a \\<Rightarrow> bool) \\<Rightarrow> 'a filter \\<Rightarrow> bool"
] |
[
"definition frequently :: \"('a \\<Rightarrow> bool) \\<Rightarrow> 'a filter \\<Rightarrow> bool\"\n where \"frequently P F \\<longleftrightarrow> \\<not> eventually (\\<lambda>x. \\<not> P x) F\""
] |
template
|
###lemma
(\<exists>\<^sub>F x in ?F. ?P x \<and> ?C) = (frequently ?P ?F \<and> ?C)
###symbols
Filter.frequently :::: ('a \<Rightarrow> bool) \<Rightarrow> 'a filter \<Rightarrow> bool
###defs
definition frequently :: "('a \<Rightarrow> bool) \<Rightarrow> 'a filter \<Rightarrow> bool"
where "frequently P F \<longleftrightarrow> \<not> eventually (\<lambda>x. \<not> P x) F"
|
###output
?H1 (\<lambda>y_0. x_1 y_0 \<and> x_2) x_3 = (?H1 x_1 x_3 \<and> x_2)###end
|
HOLCF/Cfun
|
Cfun.ch2ch_Rep_cfun
|
lemma ch2ch_Rep_cfun [simp]: "chain F \<Longrightarrow> chain Y \<Longrightarrow> chain (\<lambda>i. (F i)\<cdot>(Y i))"
|
chain ?F \<Longrightarrow> chain ?Y \<Longrightarrow> chain (\<lambda>i. ?F i\<cdot>(?Y i))
|
\<lbrakk> ?H1 x_1; ?H1 x_2\<rbrakk> \<Longrightarrow> ?H1 (\<lambda>y_0. ?H2 (x_1 y_0) (x_2 y_0))
|
[
"Cfun.cfun.Rep_cfun",
"Porder.po_class.chain"
] |
[
"('a \\<rightarrow> 'b) \\<Rightarrow> 'a \\<Rightarrow> 'b",
"(nat \\<Rightarrow> 'a) \\<Rightarrow> bool"
] |
[
"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"
] |
template
|
###lemma
chain ?F \<Longrightarrow> chain ?Y \<Longrightarrow> chain (\<lambda>i. ?F i\<cdot>(?Y i))
###symbols
Cfun.cfun.Rep_cfun :::: ('a \<rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b
Porder.po_class.chain :::: (nat \<Rightarrow> 'a) \<Rightarrow> bool
###defs
class po = below +
assumes below_refl [iff]: "x \<sqsubseteq> x"
assumes below_trans: "x \<sqsubseteq> y \<Longrightarrow> y \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> z"
assumes below_antisym: "x \<sqsubseteq> y \<Longrightarrow> y \<sqsubseteq> x \<Longrightarrow> x = y"
begin
|
###output
\<lbrakk> ?H1 x_1; ?H1 x_2\<rbrakk> \<Longrightarrow> ?H1 (\<lambda>y_0. ?H2 (x_1 y_0) (x_2 y_0))###end
|
Set
|
Set_Interval.image_int_atLeastAtMost
| null |
int ` { ?a.. ?b} = {int ?a..int ?b}
|
?H1 ?H2 (?H3 x_1 x_2) = ?H3 (?H2 x_1) (?H2 x_2)
|
[
"Set_Interval.ord_class.atLeastAtMost",
"Int.int",
"Set.image"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a set",
"nat \\<Rightarrow> int",
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set"
] |
[
"abbreviation int :: \"nat \\<Rightarrow> int\"\n where \"int \\<equiv> of_nat\"",
"definition image :: \"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b set\" (infixr \"`\" 90)\n where \"f ` A = {y. \\<exists>x\\<in>A. y = f x}\""
] |
template
|
###lemma
int ` { ?a.. ?b} = {int ?a..int ?b}
###symbols
Set_Interval.ord_class.atLeastAtMost :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a set
Int.int :::: nat \<Rightarrow> int
Set.image :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set
###defs
abbreviation int :: "nat \<Rightarrow> int"
where "int \<equiv> of_nat"
definition image :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b set" (infixr "`" 90)
where "f ` A = {y. \<exists>x\<in>A. y = f x}"
|
###output
?H1 ?H2 (?H3 x_1 x_2) = ?H3 (?H2 x_1) (?H2 x_2)###end
|
Library/Extended_Real
|
Extended_Real.continuous_on_iff_real
|
lemma continuous_on_iff_real:
fixes f :: "'a::t2_space \<Rightarrow> ereal"
assumes "\<And>x. x \<in> A \<Longrightarrow> \<bar>f x\<bar> \<noteq> \<infinity>"
shows "continuous_on A f \<longleftrightarrow> continuous_on A (real_of_ereal \<circ> f)"
|
(\<And>x. x \<in> ?A \<Longrightarrow> \<bar> ?f x\<bar> \<noteq> \<infinity>) \<Longrightarrow> continuous_on ?A ?f = continuous_on ?A (real_of_ereal \<circ> ?f)
|
(\<And>y_0. y_0 \<in> x_1 \<Longrightarrow> ?H1 (x_2 y_0) \<noteq> ?H2) \<Longrightarrow> ?H3 x_1 x_2 = ?H3 x_1 (?H4 ?H5 x_2)
|
[
"Extended_Real.real_of_ereal",
"Fun.comp",
"Topological_Spaces.continuous_on",
"Extended_Nat.infinity_class.infinity",
"Groups.abs_class.abs"
] |
[
"ereal \\<Rightarrow> real",
"('a \\<Rightarrow> 'b) \\<Rightarrow> ('c \\<Rightarrow> 'a) \\<Rightarrow> 'c \\<Rightarrow> 'b",
"'a set \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> bool",
"'a",
"'a \\<Rightarrow> 'a"
] |
[
"function real_of_ereal :: \"ereal \\<Rightarrow> real\" where\n \"real_of_ereal (ereal r) = r\"\n| \"real_of_ereal \\<infinity> = 0\"\n| \"real_of_ereal (-\\<infinity>) = 0\"",
"definition comp :: \"('b \\<Rightarrow> 'c) \\<Rightarrow> ('a \\<Rightarrow> 'b) \\<Rightarrow> 'a \\<Rightarrow> 'c\" (infixl \"\\<circ>\" 55)\n where \"f \\<circ> g = (\\<lambda>x. f (g x))\"",
"definition continuous_on :: \"'a set \\<Rightarrow> ('a::topological_space \\<Rightarrow> 'b::topological_space) \\<Rightarrow> bool\"\n where \"continuous_on s f \\<longleftrightarrow> (\\<forall>x\\<in>s. (f \\<longlongrightarrow> f x) (at x within s))\"",
"class infinity =\n fixes infinity :: \"'a\" (\"\\<infinity>\")",
"class abs =\n fixes abs :: \"'a \\<Rightarrow> 'a\" (\"\\<bar>_\\<bar>\")"
] |
template
|
###lemma
(\<And>x. x \<in> ?A \<Longrightarrow> \<bar> ?f x\<bar> \<noteq> \<infinity>) \<Longrightarrow> continuous_on ?A ?f = continuous_on ?A (real_of_ereal \<circ> ?f)
###symbols
Extended_Real.real_of_ereal :::: ereal \<Rightarrow> real
Fun.comp :::: ('a \<Rightarrow> 'b) \<Rightarrow> ('c \<Rightarrow> 'a) \<Rightarrow> 'c \<Rightarrow> 'b
Topological_Spaces.continuous_on :::: 'a set \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool
Extended_Nat.infinity_class.infinity :::: 'a
Groups.abs_class.abs :::: 'a \<Rightarrow> 'a
###defs
function real_of_ereal :: "ereal \<Rightarrow> real" where
"real_of_ereal (ereal r) = r"
| "real_of_ereal \<infinity> = 0"
| "real_of_ereal (-\<infinity>) = 0"
definition comp :: "('b \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'c" (infixl "\<circ>" 55)
where "f \<circ> g = (\<lambda>x. f (g x))"
definition continuous_on :: "'a set \<Rightarrow> ('a::topological_space \<Rightarrow> 'b::topological_space) \<Rightarrow> bool"
where "continuous_on s f \<longleftrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s))"
class infinity =
fixes infinity :: "'a" ("\<infinity>")
class abs =
fixes abs :: "'a \<Rightarrow> 'a" ("\<bar>_\<bar>")
|
###output
(\<And>y_0. y_0 \<in> x_1 \<Longrightarrow> ?H1 (x_2 y_0) \<noteq> ?H2) \<Longrightarrow> ?H3 x_1 x_2 = ?H3 x_1 (?H4 ?H5 x_2)###end
|
Library/Finite_Map
|
Finite_Map.fmfilter_subset
|
lemma fmfilter_subset[simp]: "fmfilter P m \<subseteq>\<^sub>f m"
|
fmfilter ?P ?m \<subseteq>\<^sub>f ?m
|
?H1 (?H2 x_1 x_2) x_2
|
[
"Finite_Map.fmfilter",
"Finite_Map.fmsubset"
] |
[
"('a \\<Rightarrow> bool) \\<Rightarrow> ('a, 'b) fmap \\<Rightarrow> ('a, 'b) fmap",
"('a, 'b) fmap \\<Rightarrow> ('a, 'b) fmap \\<Rightarrow> bool"
] |
[] |
template
|
###lemma
fmfilter ?P ?m \<subseteq>\<^sub>f ?m
###symbols
Finite_Map.fmfilter :::: ('a \<Rightarrow> bool) \<Rightarrow> ('a, 'b) fmap \<Rightarrow> ('a, 'b) fmap
Finite_Map.fmsubset :::: ('a, 'b) fmap \<Rightarrow> ('a, 'b) fmap \<Rightarrow> bool
###defs
|
###output
?H1 (?H2 x_1 x_2) x_2###end
|
Analysis/Affine
|
Affine.sum_delta_notmem(3)
|
lemma sum_delta_notmem:
assumes "x \<notin> s"
shows "sum (\<lambda>y. if (y = x) then P x else Q y) s = sum Q s"
and "sum (\<lambda>y. if (x = y) then P x else Q y) s = sum Q s"
and "sum (\<lambda>y. if (y = x) then P y else Q y) s = sum Q s"
and "sum (\<lambda>y. if (x = y) then P y else Q y) s = sum Q s"
|
?x \<notin> ?s \<Longrightarrow> (\<Sum>y\<in> ?s. if y = ?x then ?P y else ?Q y) = sum ?Q ?s
|
?H1 x_1 x_2 \<Longrightarrow> ?H2 (\<lambda>y_0. if y_0 = x_1 then x_3 y_0 else x_4 y_0) x_2 = ?H2 x_4 x_2
|
[
"Groups_Big.comm_monoid_add_class.sum",
"Set.not_member"
] |
[
"('a \\<Rightarrow> 'b) \\<Rightarrow> 'a set \\<Rightarrow> 'b",
"'a \\<Rightarrow> 'a set \\<Rightarrow> bool"
] |
[
"abbreviation not_member\n where \"not_member x A \\<equiv> \\<not> (x \\<in> A)\" \\<comment> \\<open>non-membership\\<close>"
] |
template
|
###lemma
?x \<notin> ?s \<Longrightarrow> (\<Sum>y\<in> ?s. if y = ?x then ?P y else ?Q y) = sum ?Q ?s
###symbols
Groups_Big.comm_monoid_add_class.sum :::: ('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b
Set.not_member :::: 'a \<Rightarrow> 'a set \<Rightarrow> bool
###defs
abbreviation not_member
where "not_member x A \<equiv> \<not> (x \<in> A)" \<comment> \<open>non-membership\<close>
|
###output
?H1 x_1 x_2 \<Longrightarrow> ?H2 (\<lambda>y_0. if y_0 = x_1 then x_3 y_0 else x_4 y_0) x_2 = ?H2 x_4 x_2###end
|
Real_Asymp/Multiseries_Expansion
|
Multiseries_Expansion.lcoeff_gbinomial_series
|
lemma lcoeff_gbinomial_series [simp]:
"lcoeff (gbinomial_series abort x) n = (x gchoose n)"
|
lcoeff (gbinomial_series ?abort ?x) ?n = ?x gchoose ?n
|
?H1 (?H2 x_1 x_2) x_3 = ?H3 x_2 x_3
|
[
"Binomial.gbinomial",
"Multiseries_Expansion.gbinomial_series",
"Multiseries_Expansion.lcoeff"
] |
[
"'a \\<Rightarrow> nat \\<Rightarrow> 'a",
"bool \\<Rightarrow> real \\<Rightarrow> real msllist",
"'a msllist \\<Rightarrow> nat \\<Rightarrow> 'a"
] |
[
"definition gbinomial :: \"'a::{semidom_divide,semiring_char_0} \\<Rightarrow> nat \\<Rightarrow> 'a\" (infixl \"gchoose\" 65)\n where gbinomial_prod_rev: \"a gchoose k = prod (\\<lambda>i. a - of_nat i) {0..<k} div fact k\"",
"definition gbinomial_series :: \"bool \\<Rightarrow> real \\<Rightarrow> real msllist\" where\n \"gbinomial_series abort x = gbinomial_series_aux abort x 0 1\"",
"fun lcoeff where\n \"lcoeff MSLNil n = 0\"\n| \"lcoeff (MSLCons x xs) 0 = x\"\n| \"lcoeff (MSLCons x xs) (Suc n) = lcoeff xs n\""
] |
template
|
###lemma
lcoeff (gbinomial_series ?abort ?x) ?n = ?x gchoose ?n
###symbols
Binomial.gbinomial :::: 'a \<Rightarrow> nat \<Rightarrow> 'a
Multiseries_Expansion.gbinomial_series :::: bool \<Rightarrow> real \<Rightarrow> real msllist
Multiseries_Expansion.lcoeff :::: 'a msllist \<Rightarrow> nat \<Rightarrow> 'a
###defs
definition gbinomial :: "'a::{semidom_divide,semiring_char_0} \<Rightarrow> nat \<Rightarrow> 'a" (infixl "gchoose" 65)
where gbinomial_prod_rev: "a gchoose k = prod (\<lambda>i. a - of_nat i) {0..<k} div fact k"
definition gbinomial_series :: "bool \<Rightarrow> real \<Rightarrow> real msllist" where
"gbinomial_series abort x = gbinomial_series_aux abort x 0 1"
fun lcoeff where
"lcoeff MSLNil n = 0"
| "lcoeff (MSLCons x xs) 0 = x"
| "lcoeff (MSLCons x xs) (Suc n) = lcoeff xs n"
|
###output
?H1 (?H2 x_1 x_2) x_3 = ?H3 x_2 x_3###end
|
Isar_Examples/Group
|
Groups.field_simps(41)
| null |
?c < (0:: ?'a) \<Longrightarrow> (?a \<le> - (?b / ?c)) = (- ?b \<le> ?a * ?c)
|
x_1 < ?H1 \<Longrightarrow> (x_2 \<le> ?H2 (?H3 x_3 x_1)) = (?H2 x_3 \<le> ?H4 x_2 x_1)
|
[
"Groups.times_class.times",
"Fields.inverse_class.inverse_divide",
"Groups.uminus_class.uminus",
"Groups.zero_class.zero"
] |
[
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a",
"'a"
] |
[
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"class inverse = divide +\n fixes inverse :: \"'a \\<Rightarrow> 'a\"\nbegin",
"class uminus =\n fixes uminus :: \"'a \\<Rightarrow> 'a\" (\"- _\" [81] 80)",
"class zero =\n fixes zero :: 'a (\"0\")"
] |
template
|
###lemma
?c < (0:: ?'a) \<Longrightarrow> (?a \<le> - (?b / ?c)) = (- ?b \<le> ?a * ?c)
###symbols
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Fields.inverse_class.inverse_divide :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Groups.uminus_class.uminus :::: 'a \<Rightarrow> 'a
Groups.zero_class.zero :::: 'a
###defs
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
class inverse = divide +
fixes inverse :: "'a \<Rightarrow> 'a"
begin
class uminus =
fixes uminus :: "'a \<Rightarrow> 'a" ("- _" [81] 80)
class zero =
fixes zero :: 'a ("0")
|
###output
x_1 < ?H1 \<Longrightarrow> (x_2 \<le> ?H2 (?H3 x_3 x_1)) = (?H2 x_3 \<le> ?H4 x_2 x_1)###end
|
Number_Theory/Cong
|
Cong.cong_square
|
lemma cong_square:
"prime p \<Longrightarrow> 0 < a \<Longrightarrow> [a * a = 1] (mod p) \<Longrightarrow> [a = 1] (mod p) \<or> [a = - 1] (mod p)"
for a p :: "'a :: {normalization_semidom, linordered_idom, unique_euclidean_ring}"
|
prime ?p \<Longrightarrow> (0:: ?'a) < ?a \<Longrightarrow> [ ?a * ?a = 1:: ?'a] (mod ?p) \<Longrightarrow> [ ?a = 1:: ?'a] (mod ?p) \<or> [ ?a = - (1:: ?'a)] (mod ?p)
|
\<lbrakk> ?H1 x_1; ?H2 < x_2; ?H3 (?H4 x_2 x_2) ?H5 x_1\<rbrakk> \<Longrightarrow> ?H3 x_2 ?H5 x_1 \<or> ?H3 x_2 (?H6 ?H5) x_1
|
[
"Groups.uminus_class.uminus",
"Groups.one_class.one",
"Groups.times_class.times",
"Cong.unique_euclidean_semiring_class.cong",
"Groups.zero_class.zero",
"Factorial_Ring.normalization_semidom_class.prime"
] |
[
"'a \\<Rightarrow> 'a",
"'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a",
"'a \\<Rightarrow> 'a \\<Rightarrow> 'a \\<Rightarrow> bool",
"'a",
"'a \\<Rightarrow> bool"
] |
[
"class uminus =\n fixes uminus :: \"'a \\<Rightarrow> 'a\" (\"- _\" [81] 80)",
"class one =\n fixes one :: 'a (\"1\")",
"class times =\n fixes times :: \"'a \\<Rightarrow> 'a \\<Rightarrow> 'a\" (infixl \"*\" 70)",
"class zero =\n fixes zero :: 'a (\"0\")"
] |
template
|
###lemma
prime ?p \<Longrightarrow> (0:: ?'a) < ?a \<Longrightarrow> [ ?a * ?a = 1:: ?'a] (mod ?p) \<Longrightarrow> [ ?a = 1:: ?'a] (mod ?p) \<or> [ ?a = - (1:: ?'a)] (mod ?p)
###symbols
Groups.uminus_class.uminus :::: 'a \<Rightarrow> 'a
Groups.one_class.one :::: 'a
Groups.times_class.times :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a
Cong.unique_euclidean_semiring_class.cong :::: 'a \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool
Groups.zero_class.zero :::: 'a
Factorial_Ring.normalization_semidom_class.prime :::: 'a \<Rightarrow> bool
###defs
class uminus =
fixes uminus :: "'a \<Rightarrow> 'a" ("- _" [81] 80)
class one =
fixes one :: 'a ("1")
class times =
fixes times :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "*" 70)
class zero =
fixes zero :: 'a ("0")
|
###output
\<lbrakk> ?H1 x_1; ?H2 < x_2; ?H3 (?H4 x_2 x_2) ?H5 x_1\<rbrakk> \<Longrightarrow> ?H3 x_2 ?H5 x_1 \<or> ?H3 x_2 (?H6 ?H5) x_1###end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.