[STATEMENT]
theorem existential_routing: "valid_prefixes rtbl \<Longrightarrow> is_longest_prefix_routing rtbl \<Longrightarrow> has_default_route rtbl \<Longrightarrow> unambiguous_routing rtbl \<Longrightarrow>
routing_table_semantics rtbl addr = act \<longleftrightarrow> (\<exists>rr \<in> set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and>
  (\<forall>ra \<in> set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not>prefix_match_semantics (routing_match ra) addr))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
proof(induction rtbl)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>valid_prefixes []; is_longest_prefix_routing []; has_default_route []; unambiguous_routing []\<rbrakk> \<Longrightarrow> (routing_table_semantics [] addr = act) = (\<exists>rr\<in>set []. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set []. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. \<And>a rtbl. \<lbrakk>\<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)); valid_prefixes (a # rtbl); is_longest_prefix_routing (a # rtbl); has_default_route (a # rtbl); unambiguous_routing (a # rtbl)\<rbrakk> \<Longrightarrow> (routing_table_semantics (a # rtbl) addr = act) = (\<exists>rr\<in>set (a # rtbl). prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set (a # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
valid_prefixes []
is_longest_prefix_routing []
has_default_route []
unambiguous_routing []

goal (2 subgoals):
 1. \<lbrakk>valid_prefixes []; is_longest_prefix_routing []; has_default_route []; unambiguous_routing []\<rbrakk> \<Longrightarrow> (routing_table_semantics [] addr = act) = (\<exists>rr\<in>set []. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set []. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. \<And>a rtbl. \<lbrakk>\<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)); valid_prefixes (a # rtbl); is_longest_prefix_routing (a # rtbl); has_default_route (a # rtbl); unambiguous_routing (a # rtbl)\<rbrakk> \<Longrightarrow> (routing_table_semantics (a # rtbl) addr = act) = (\<exists>rr\<in>set (a # rtbl). prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set (a # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
valid_prefixes []
is_longest_prefix_routing []
has_default_route []
unambiguous_routing []

goal (1 subgoal):
 1. (routing_table_semantics [] addr = act) = (\<exists>rr\<in>set []. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set []. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(routing_table_semantics [] addr = act) = (\<exists>rr\<in>set []. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set []. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))

goal (1 subgoal):
 1. \<And>a rtbl. \<lbrakk>\<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)); valid_prefixes (a # rtbl); is_longest_prefix_routing (a # rtbl); has_default_route (a # rtbl); unambiguous_routing (a # rtbl)\<rbrakk> \<Longrightarrow> (routing_table_semantics (a # rtbl) addr = act) = (\<exists>rr\<in>set (a # rtbl). prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set (a # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a rtbl. \<lbrakk>\<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)); valid_prefixes (a # rtbl); is_longest_prefix_routing (a # rtbl); has_default_route (a # rtbl); unambiguous_routing (a # rtbl)\<rbrakk> \<Longrightarrow> (routing_table_semantics (a # rtbl) addr = act) = (\<exists>rr\<in>set (a # rtbl). prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set (a # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
case (Cons rr rtbl)
[PROOF STATE]
proof (state)
this:
\<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
valid_prefixes (rr # rtbl)
is_longest_prefix_routing (rr # rtbl)
has_default_route (rr # rtbl)
unambiguous_routing (rr # rtbl)

goal (1 subgoal):
 1. \<And>a rtbl. \<lbrakk>\<lbrakk>valid_prefixes rtbl; is_longest_prefix_routing rtbl; has_default_route rtbl; unambiguous_routing rtbl\<rbrakk> \<Longrightarrow> (routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)); valid_prefixes (a # rtbl); is_longest_prefix_routing (a # rtbl); has_default_route (a # rtbl); unambiguous_routing (a # rtbl)\<rbrakk> \<Longrightarrow> (routing_table_semantics (a # rtbl) addr = act) = (\<exists>rr\<in>set (a # rtbl). prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set (a # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
proof(cases "prefix_match_semantics (routing_match rr) addr")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. \<not> prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> prefix_match_semantics (routing_match rr) addr

goal (2 subgoals):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. \<not> prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
hence [simp]: "routing_table_semantics (rr # rtbl) addr = routing_table_semantics (rr # rtbl) addr"
[PROOF STATE]
proof (prove)
using this:
\<not> prefix_match_semantics (routing_match rr) addr

goal (1 subgoal):
 1. routing_table_semantics (rr # rtbl) addr = routing_table_semantics (rr # rtbl) addr
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
routing_table_semantics (rr # rtbl) addr = routing_table_semantics (rr # rtbl) addr

goal (2 subgoals):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. \<not> prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
proof(cases "routing_prefix rr = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. routing_prefix rr = 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
routing_prefix rr = 0

goal (2 subgoals):
 1. routing_prefix rr = 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
text\<open>Need special treatment, rtbl won't have a default route, so the IH is not usable.\<close>
[PROOF STATE]
proof (state)
this:
routing_prefix rr = 0

goal (2 subgoals):
 1. routing_prefix rr = 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
have "valid_prefix (routing_match rr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_prefix (routing_match rr)
[PROOF STEP]
using Cons.prems valid_prefixes_split
[PROOF STATE]
proof (prove)
using this:
valid_prefixes (rr # rtbl)
is_longest_prefix_routing (rr # rtbl)
has_default_route (rr # rtbl)
unambiguous_routing (rr # rtbl)
valid_prefixes (?r # ?rs) \<Longrightarrow> valid_prefix (routing_match ?r) \<and> valid_prefixes ?rs

goal (1 subgoal):
 1. valid_prefix (routing_match rr)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
valid_prefix (routing_match rr)

goal (2 subgoals):
 1. routing_prefix rr = 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
with True False
[PROOF STATE]
proof (chain)
picking this:
routing_prefix rr = 0
\<not> prefix_match_semantics (routing_match rr) addr
valid_prefix (routing_match rr)
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
routing_prefix rr = 0
\<not> prefix_match_semantics (routing_match rr) addr
valid_prefix (routing_match rr)

goal (1 subgoal):
 1. False
[PROOF STEP]
using zero_prefix_match_all
[PROOF STATE]
proof (prove)
using this:
routing_prefix rr = 0
\<not> prefix_match_semantics (routing_match rr) addr
valid_prefix (routing_match rr)
\<lbrakk>valid_prefix ?m; pfxm_length ?m = 0\<rbrakk> \<Longrightarrow> prefix_match_semantics ?m ?ip

goal (1 subgoal):
 1. False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
False

goal (2 subgoals):
 1. routing_prefix rr = 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
 2. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))

goal (1 subgoal):
 1. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
routing_prefix rr \<noteq> 0

goal (1 subgoal):
 1. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
with Cons.prems
[PROOF STATE]
proof (chain)
picking this:
valid_prefixes (rr # rtbl)
is_longest_prefix_routing (rr # rtbl)
has_default_route (rr # rtbl)
unambiguous_routing (rr # rtbl)
routing_prefix rr \<noteq> 0
[PROOF STEP]
have mprems: "valid_prefixes rtbl" "is_longest_prefix_routing rtbl" "has_default_route rtbl" "unambiguous_routing rtbl"
[PROOF STATE]
proof (prove)
using this:
valid_prefixes (rr # rtbl)
is_longest_prefix_routing (rr # rtbl)
has_default_route (rr # rtbl)
unambiguous_routing (rr # rtbl)
routing_prefix rr \<noteq> 0

goal (1 subgoal):
 1. (valid_prefixes rtbl &&& is_longest_prefix_routing rtbl) &&& has_default_route rtbl &&& unambiguous_routing rtbl
[PROOF STEP]
by(simp_all add: valid_prefixes_split unambiguous_routing_Cons is_longest_prefix_routing_def)
[PROOF STATE]
proof (state)
this:
valid_prefixes rtbl
is_longest_prefix_routing rtbl
has_default_route rtbl
unambiguous_routing rtbl

goal (1 subgoal):
 1. routing_prefix rr \<noteq> 0 \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
using Cons.IH[OF mprems] False \<open>\<not> prefix_match_semantics (routing_match rr) addr\<close>
[PROOF STATE]
proof (prove)
using this:
(routing_table_semantics rtbl addr = act) = (\<exists>rr\<in>set rtbl. prefix_match_semantics (routing_match rr) addr \<and> routing_action rr = act \<and> (\<forall>ra\<in>set rtbl. routing_rule_sort_key ra < routing_rule_sort_key rr \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
routing_prefix rr \<noteq> 0
\<not> prefix_match_semantics (routing_match rr) addr

goal (1 subgoal):
 1. (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))

goal (1 subgoal):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
prefix_match_semantics (routing_match rr) addr

goal (1 subgoal):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
prefix_match_semantics (routing_match rr) addr
[PROOF STEP]
have [simp]: "routing_table_semantics (rr # rtbl) addr = routing_action rr"
[PROOF STATE]
proof (prove)
using this:
prefix_match_semantics (routing_match rr) addr

goal (1 subgoal):
 1. routing_table_semantics (rr # rtbl) addr = routing_action rr
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
routing_table_semantics (rr # rtbl) addr = routing_action rr

goal (1 subgoal):
 1. prefix_match_semantics (routing_match rr) addr \<Longrightarrow> (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
show ?thesis (is "?l \<longleftrightarrow> ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. routing_table_semantics (rr # rtbl) addr = act \<Longrightarrow> \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
 2. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
assume ?l
[PROOF STATE]
proof (state)
this:
routing_table_semantics (rr # rtbl) addr = act

goal (2 subgoals):
 1. routing_table_semantics (rr # rtbl) addr = act \<Longrightarrow> \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
 2. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
hence [simp]: "act = routing_action rr"
[PROOF STATE]
proof (prove)
using this:
routing_table_semantics (rr # rtbl) addr = act

goal (1 subgoal):
 1. act = routing_action rr
[PROOF STEP]
by(simp add: True)
[PROOF STATE]
proof (state)
this:
act = routing_action rr

goal (2 subgoals):
 1. routing_table_semantics (rr # rtbl) addr = act \<Longrightarrow> \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
 2. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
have *: "(\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key rr \<le> routing_rule_sort_key ra)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key rr \<le> routing_rule_sort_key ra
[PROOF STEP]
using \<open>is_longest_prefix_routing (rr # rtbl)\<close>
[PROOF STATE]
proof (prove)
using this:
is_longest_prefix_routing (rr # rtbl)

goal (1 subgoal):
 1. \<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key rr \<le> routing_rule_sort_key ra
[PROOF STEP]
by(clarsimp simp: is_longest_prefix_routing_def)
[PROOF STATE]
proof (state)
this:
\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key rr \<le> routing_rule_sort_key ra

goal (2 subgoals):
 1. routing_table_semantics (rr # rtbl) addr = act \<Longrightarrow> \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
 2. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
thus ?r
[PROOF STATE]
proof (prove)
using this:
\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key rr \<le> routing_rule_sort_key ra

goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
[PROOF STEP]
by(fastforce simp add: True)
[PROOF STATE]
proof (state)
this:
\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
assume ?r
[PROOF STATE]
proof (state)
this:
\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
[PROOF STEP]
guess rr'
[PROOF STATE]
proof (prove)
using this:
\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. thesis
goal instantiation:
PROP ?guess \<leadsto> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
note rr' = this
[PROOF STATE]
proof (state)
this:
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
have "rr' = rr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rr' = rr
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rr' \<noteq> rr \<Longrightarrow> False
[PROOF STEP]
assume C: "rr' \<noteq> rr"
[PROOF STATE]
proof (state)
this:
rr' \<noteq> rr

goal (1 subgoal):
 1. rr' \<noteq> rr \<Longrightarrow> False
[PROOF STEP]
from C
[PROOF STATE]
proof (chain)
picking this:
rr' \<noteq> rr
[PROOF STEP]
have e: "rr' \<in> set rtbl"
[PROOF STATE]
proof (prove)
using this:
rr' \<noteq> rr

goal (1 subgoal):
 1. rr' \<in> set rtbl
[PROOF STEP]
using rr'
[PROOF STATE]
proof (prove)
using this:
rr' \<noteq> rr
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. rr' \<in> set rtbl
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rr' \<in> set rtbl

goal (1 subgoal):
 1. rr' \<noteq> rr \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> False
 2. \<not> ?P \<Longrightarrow> False
[PROOF STEP]
assume eq: "routing_match rr' = routing_match rr"
[PROOF STATE]
proof (state)
this:
routing_match rr' = routing_match rr

goal (2 subgoals):
 1. ?P \<Longrightarrow> False
 2. \<not> ?P \<Longrightarrow> False
[PROOF STEP]
with e
[PROOF STATE]
proof (chain)
picking this:
rr' \<in> set rtbl
routing_match rr' = routing_match rr
[PROOF STEP]
have "routing_rule_sort_key rr < routing_rule_sort_key rr'"
[PROOF STATE]
proof (prove)
using this:
rr' \<in> set rtbl
routing_match rr' = routing_match rr

goal (1 subgoal):
 1. routing_rule_sort_key rr < routing_rule_sort_key rr'
[PROOF STEP]
using unambigous_prefix_routing_strong_mono[OF Cons.prems(2,4) _ eq]
[PROOF STATE]
proof (prove)
using this:
rr' \<in> set rtbl
routing_match rr' = routing_match rr
rr' \<in> set rtbl \<Longrightarrow> routing_rule_sort_key rr < routing_rule_sort_key rr'

goal (1 subgoal):
 1. routing_rule_sort_key rr < routing_rule_sort_key rr'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
routing_rule_sort_key rr < routing_rule_sort_key rr'

goal (2 subgoals):
 1. ?P \<Longrightarrow> False
 2. \<not> ?P \<Longrightarrow> False
[PROOF STEP]
with True rr'
[PROOF STATE]
proof (chain)
picking this:
prefix_match_semantics (routing_match rr) addr
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
routing_rule_sort_key rr < routing_rule_sort_key rr'
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
prefix_match_semantics (routing_match rr) addr
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
routing_rule_sort_key rr < routing_rule_sort_key rr'

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
assume ne: "routing_match rr' \<noteq> routing_match rr"
[PROOF STATE]
proof (state)
this:
routing_match rr' \<noteq> routing_match rr

goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
from rr' Cons.prems
[PROOF STATE]
proof (chain)
picking this:
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
valid_prefixes (rr # rtbl)
is_longest_prefix_routing (rr # rtbl)
has_default_route (rr # rtbl)
unambiguous_routing (rr # rtbl)
[PROOF STEP]
have "valid_prefix (routing_match rr)" "valid_prefix (routing_match rr')" "prefix_match_semantics (routing_match rr') addr"
[PROOF STATE]
proof (prove)
using this:
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)
valid_prefixes (rr # rtbl)
is_longest_prefix_routing (rr # rtbl)
has_default_route (rr # rtbl)
unambiguous_routing (rr # rtbl)

goal (1 subgoal):
 1. valid_prefix (routing_match rr) &&& valid_prefix (routing_match rr') &&& prefix_match_semantics (routing_match rr') addr
[PROOF STEP]
by(auto simp add: valid_prefixes_alt_def)
[PROOF STATE]
proof (state)
this:
valid_prefix (routing_match rr)
valid_prefix (routing_match rr')
prefix_match_semantics (routing_match rr') addr

goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
note same_length_prefixes_distinct[OF this(1,2) ne[symmetric] _ True this(3)]
[PROOF STATE]
proof (state)
this:
routing_prefix rr = routing_prefix rr' \<Longrightarrow> False

goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
routing_prefix rr = routing_prefix rr' \<Longrightarrow> False

goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
have "routing_prefix rr = routing_prefix rr'" (is ?pe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. routing_prefix rr = routing_prefix rr'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. routing_prefix rr = routing_prefix rr'
[PROOF STEP]
have "routing_rule_sort_key rr < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match rr) addr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. routing_rule_sort_key rr < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match rr) addr
[PROOF STEP]
using rr'
[PROOF STATE]
proof (prove)
using this:
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. routing_rule_sort_key rr < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match rr) addr
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
routing_rule_sort_key rr < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match rr) addr

goal (1 subgoal):
 1. routing_prefix rr = routing_prefix rr'
[PROOF STEP]
with unambigous_prefix_routing_weak_mono[OF Cons.prems(2) e] True
[PROOF STATE]
proof (chain)
picking this:
routing_rule_sort_key rr \<le> routing_rule_sort_key rr'
prefix_match_semantics (routing_match rr) addr
routing_rule_sort_key rr < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match rr) addr
[PROOF STEP]
have "routing_rule_sort_key rr = routing_rule_sort_key rr'"
[PROOF STATE]
proof (prove)
using this:
routing_rule_sort_key rr \<le> routing_rule_sort_key rr'
prefix_match_semantics (routing_match rr) addr
routing_rule_sort_key rr < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match rr) addr

goal (1 subgoal):
 1. routing_rule_sort_key rr = routing_rule_sort_key rr'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
routing_rule_sort_key rr = routing_rule_sort_key rr'

goal (1 subgoal):
 1. routing_prefix rr = routing_prefix rr'
[PROOF STEP]
thus ?pe
[PROOF STATE]
proof (prove)
using this:
routing_rule_sort_key rr = routing_rule_sort_key rr'

goal (1 subgoal):
 1. routing_prefix rr = routing_prefix rr'
[PROOF STEP]
by(simp add: routing_rule_sort_key_def int_of_nat_def)
[PROOF STATE]
proof (state)
this:
routing_prefix rr = routing_prefix rr'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
routing_prefix rr = routing_prefix rr'

goal (1 subgoal):
 1. routing_match rr' \<noteq> routing_match rr \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
routing_prefix rr = routing_prefix rr' \<Longrightarrow> False
routing_prefix rr = routing_prefix rr'
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
routing_prefix rr = routing_prefix rr' \<Longrightarrow> False
routing_prefix rr = routing_prefix rr'

goal (1 subgoal):
 1. False
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rr' = rr

goal (1 subgoal):
 1. \<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr) \<Longrightarrow> routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
thus ?l
[PROOF STATE]
proof (prove)
using this:
rr' = rr

goal (1 subgoal):
 1. routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
using rr'
[PROOF STATE]
proof (prove)
using this:
rr' = rr
rr' \<in> set (rr # rtbl)
prefix_match_semantics (routing_match rr') addr \<and> routing_action rr' = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rr' \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr)

goal (1 subgoal):
 1. routing_table_semantics (rr # rtbl) addr = act
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
routing_table_semantics (rr # rtbl) addr = act

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(routing_table_semantics (rr # rtbl) addr = act) = (\<exists>rra\<in>set (rr # rtbl). prefix_match_semantics (routing_match rra) addr \<and> routing_action rra = act \<and> (\<forall>ra\<in>set (rr # rtbl). routing_rule_sort_key ra < routing_rule_sort_key rra \<longrightarrow> \<not> prefix_match_semantics (routing_match ra) addr))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_block_mat_append: "diag_block_mat (As @ Bs) =
  (let A = diag_block_mat As; B = diag_block_mat Bs
  in four_block_mat A (0\<^sub>m (dim_row A) (dim_col B)) (0\<^sub>m (dim_row B) (dim_col A)) B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (As @ Bs) = (let A = diag_block_mat As; B = diag_block_mat Bs in four_block_mat A (0\<^sub>m (dim_row A) (dim_col B)) (0\<^sub>m (dim_row B) (dim_col A)) B)
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (As @ Bs) = four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs)
[PROOF STEP]
proof (induct As)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. diag_block_mat ([] @ Bs) = four_block_mat (diag_block_mat []) (0\<^sub>m (dim_row (diag_block_mat [])) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat []))) (diag_block_mat Bs)
 2. \<And>a As. diag_block_mat (As @ Bs) = four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs) \<Longrightarrow> diag_block_mat ((a # As) @ Bs) = four_block_mat (diag_block_mat (a # As)) (0\<^sub>m (dim_row (diag_block_mat (a # As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat (a # As)))) (diag_block_mat Bs)
[PROOF STEP]
case (Cons A As)
[PROOF STATE]
proof (state)
this:
diag_block_mat (As @ Bs) = four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs)

goal (2 subgoals):
 1. diag_block_mat ([] @ Bs) = four_block_mat (diag_block_mat []) (0\<^sub>m (dim_row (diag_block_mat [])) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat []))) (diag_block_mat Bs)
 2. \<And>a As. diag_block_mat (As @ Bs) = four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs) \<Longrightarrow> diag_block_mat ((a # As) @ Bs) = four_block_mat (diag_block_mat (a # As)) (0\<^sub>m (dim_row (diag_block_mat (a # As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat (a # As)))) (diag_block_mat Bs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat ((A # As) @ Bs) = four_block_mat (diag_block_mat (A # As)) (0\<^sub>m (dim_row (diag_block_mat (A # As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat (A # As)))) (diag_block_mat Bs)
[PROOF STEP]
unfolding append.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (A # As @ Bs) = four_block_mat (diag_block_mat (A # As)) (0\<^sub>m (dim_row (diag_block_mat (A # As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat (A # As)))) (diag_block_mat Bs)
[PROOF STEP]
unfolding diag_block_mat.simps Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat (As @ Bs)))) (0\<^sub>m (dim_row (diag_block_mat (As @ Bs))) (dim_col A)) (diag_block_mat (As @ Bs)) = four_block_mat (four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat As))) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col A)) (diag_block_mat As)) (0\<^sub>m (dim_row (four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat As))) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col A)) (diag_block_mat As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat As))) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col A)) (diag_block_mat As)))) (diag_block_mat Bs)
[PROOF STEP]
unfolding Cons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m (dim_row A) (dim_col (four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs)))) (0\<^sub>m (dim_row (four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs))) (dim_col A)) (four_block_mat (diag_block_mat As) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat As))) (diag_block_mat Bs)) = four_block_mat (four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat As))) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col A)) (diag_block_mat As)) (0\<^sub>m (dim_row (four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat As))) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col A)) (diag_block_mat As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (four_block_mat A (0\<^sub>m (dim_row A) (dim_col (diag_block_mat As))) (0\<^sub>m (dim_row (diag_block_mat As)) (dim_col A)) (diag_block_mat As)))) (diag_block_mat Bs)
[PROOF STEP]
by (rule assoc_four_block_mat)
[PROOF STATE]
proof (state)
this:
diag_block_mat ((A # As) @ Bs) = four_block_mat (diag_block_mat (A # As)) (0\<^sub>m (dim_row (diag_block_mat (A # As))) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat (A # As)))) (diag_block_mat Bs)

goal (1 subgoal):
 1. diag_block_mat ([] @ Bs) = four_block_mat (diag_block_mat []) (0\<^sub>m (dim_row (diag_block_mat [])) (dim_col (diag_block_mat Bs))) (0\<^sub>m (dim_row (diag_block_mat Bs)) (dim_col (diag_block_mat []))) (diag_block_mat Bs)
[PROOF STEP]
qed auto


[STATEMENT]
lemma semigroup_mult_ow: "class.semigroup_mult = semigroup_mult_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.semigroup_mult = semigroup_mult_ow UNIV
[PROOF STEP]
unfolding
    class.semigroup_mult_def semigroup_mult_ow_def
    semigroup_mult_ow_axioms_def times_ow_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>times. \<forall>a b c. times (times a b) c = times a (times b c)) = (\<lambda>times. (\<forall>a b. a \<in> UNIV \<longrightarrow> b \<in> UNIV \<longrightarrow> times a b \<in> UNIV) \<and> (\<forall>a b c. a \<in> UNIV \<longrightarrow> b \<in> UNIV \<longrightarrow> c \<in> UNIV \<longrightarrow> times (times a b) c = times a (times b c)))
[PROOF STEP]
by simp


[STATEMENT]
lemma subset_lemma2:
 "\<lbrakk> B \<inter> A = {}; C \<subseteq> A \<rbrakk> \<Longrightarrow> C \<inter> B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<inter> A = {}; C \<subseteq> A\<rbrakk> \<Longrightarrow> C \<inter> B = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma le_ivl_nice: "[l1,h1] \<le> [l2,h2] \<longleftrightarrow>
  (if [l1,h1] = \<bottom> then True else
   if [l2,h2] = \<bottom> then False else l1 \<ge> l2 & h1 \<le> h2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([l1, h1] \<le> [l2, h2]) = (if [l1, h1] = \<bottom> then True else if [l2, h2] = \<bottom> then False else l2 \<le> l1 \<and> h1 \<le> h2)
[PROOF STEP]
unfolding bot_ivl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([l1, h1] \<le> [l2, h2]) = (if [l1, h1] = empty_ivl then True else if [l2, h2] = empty_ivl then False else l2 \<le> l1 \<and> h1 \<le> h2)
[PROOF STEP]
by transfer (simp add: le_rep_def eq_ivl_empty)


[STATEMENT]
lemma prefix_length_aux_correct: "prefix_length_aux P acc xs = prefix_length P xs + acc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix_length_aux P acc xs = prefix_length P xs + acc
[PROOF STEP]
by (induction xs arbitrary: acc) (simp_all add: prefix_length_def)


[STATEMENT]
lemma word_msb_1 [simp]: "msb (1::'a::len word) \<longleftrightarrow> LENGTH('a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. msb 1 = (LENGTH('a) = 1)
[PROOF STEP]
by (simp add: msb_word_iff_bit le_Suc_eq)


[STATEMENT]
lemma [simp]: "(n::nat) < N \<Longrightarrow> 0 \<le> 1 / N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < N \<Longrightarrow> 0 \<le> 1 / real N
[PROOF STEP]
by auto


[STATEMENT]
lemma vifunion_vball_vbex_simps[simp]:
  "\<And>A P. (\<forall>a\<in>\<^sub>\<circ>\<Union>\<^sub>\<circ>A. P a) \<longleftrightarrow> (\<forall>y\<in>\<^sub>\<circ>A. \<forall>a\<in>\<^sub>\<circ>y. P a)"
  "\<And>A P. (\<exists>a\<in>\<^sub>\<circ>\<Union>\<^sub>\<circ>A. P a) \<longleftrightarrow> (\<exists>y\<in>\<^sub>\<circ>A. \<exists>a\<in>\<^sub>\<circ>y. P a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A P. (\<forall>a\<in>elts (\<Union>\<^sub>\<circ> A). P a) = (\<forall>y\<in>elts A. \<forall>a\<in>elts y. P a)) &&& (\<And>A P. (\<exists>a\<in>elts (\<Union>\<^sub>\<circ> A). P a) = (\<exists>y\<in>elts A. \<exists>a\<in>elts y. P a))
[PROOF STEP]
using vball_vifunion vbex_vifunion
[PROOF STATE]
proof (prove)
using this:
(\<forall>z\<in>elts (\<Union>\<^sub>\<circ> (VLambda ?I ?f `\<^sub>\<circ> ?I)). ?P z) = (\<forall>x\<in>elts ?I. \<forall>z\<in>elts (?f x). ?P z)
(\<exists>z\<in>elts (\<Union>\<^sub>\<circ> (VLambda ?I ?f `\<^sub>\<circ> ?I)). ?P z) = (\<exists>x\<in>elts ?I. \<exists>z\<in>elts (?f x). ?P z)

goal (1 subgoal):
 1. (\<And>A P. (\<forall>a\<in>elts (\<Union>\<^sub>\<circ> A). P a) = (\<forall>y\<in>elts A. \<forall>a\<in>elts y. P a)) &&& (\<And>A P. (\<exists>a\<in>elts (\<Union>\<^sub>\<circ> A). P a) = (\<exists>y\<in>elts A. \<exists>a\<in>elts y. P a))
[PROOF STEP]
by auto


[STATEMENT]
lemma greaterThan_bounded_induct:
     "(!!l::nat. \<forall>m \<in> lessThan l.
                 F \<in> (A \<inter> f-`{m}) leadsTo ((A \<inter> f-`(greaterThan m)) \<union> B))
      ==> F \<in> A leadsTo ((A \<inter> (f-`(atLeast l))) \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B) \<Longrightarrow> F \<in> A \<longmapsto> A \<inter> f -` {l..} \<union> B
[PROOF STEP]
apply (rule_tac f = f and f1 = "%k. l - k"
       in wf_less_than [THEN wf_inv_image, THEN leadsTo_wf_induct])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B) \<Longrightarrow> \<forall>m. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` (inv_image less_than ((-) l))\<inverse> `` {m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (simp (no_asm) add:Image_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B) \<Longrightarrow> \<forall>m. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. (\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B) \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (case_tac "m<l")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. \<lbrakk>\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B; m < l\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
 2. \<And>m. \<lbrakk>\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B; \<not> m < l\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (blast intro: leadsTo_weaken_R diff_less_mono2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` {m<..} \<union> B; \<not> m < l\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (blast intro: not_le_imp_less subset_imp_leadsTo)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma locally_path_connected_space_discrete_topology:
   "locally_path_connected_space (discrete_topology U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_path_connected_space (discrete_topology U)
[PROOF STEP]
using locally_path_connected_space_open_path_components
[PROOF STATE]
proof (prove)
using this:
locally_path_connected_space ?X = (\<forall>U c. openin ?X U \<and> c \<in> path_components_of (subtopology ?X U) \<longrightarrow> openin ?X c)

goal (1 subgoal):
 1. locally_path_connected_space (discrete_topology U)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma left_zero [simp]:
  assumes [simp]: "a \<in> R" shows "\<zero> \<cdot> a = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
have "\<zero> \<cdot> a = (\<zero> + \<zero>) \<cdot> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero> \<cdot> a = (\<zero> + \<zero>) \<cdot> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<zero> \<cdot> a = (\<zero> + \<zero>) \<cdot> a

goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<zero> \<cdot> a = (\<zero> + \<zero>) \<cdot> a

goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
have "\<dots> = \<zero> \<cdot> a + \<zero> \<cdot> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<zero> + \<zero>) \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a
[PROOF STEP]
by (simp add: distributive del: additive.left_unit additive.right_unit)
[PROOF STATE]
proof (state)
this:
(\<zero> + \<zero>) \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a

goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a
[PROOF STEP]
have "\<zero> \<cdot> a - \<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a - \<zero> \<cdot> a"
[PROOF STATE]
proof (prove)
using this:
\<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a

goal (1 subgoal):
 1. \<zero> \<cdot> a - \<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a - \<zero> \<cdot> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<zero> \<cdot> a - \<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a - \<zero> \<cdot> a

goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<zero> \<cdot> a - \<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a - \<zero> \<cdot> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<zero> \<cdot> a - \<zero> \<cdot> a = \<zero> \<cdot> a + \<zero> \<cdot> a - \<zero> \<cdot> a

goal (1 subgoal):
 1. \<zero> \<cdot> a = \<zero>
[PROOF STEP]
by (simp add: additive.associative del: additive.invertible_left_cancel)
[PROOF STATE]
proof (state)
this:
\<zero> \<cdot> a = \<zero>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_def_alt:
  assumes "rational_preference carrier relation"
  assumes "weak_convex_pref relation"
  shows "(\<forall>x \<in> carrier. convex (at_least_as_good x carrier relation))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier. convex (at_least_as_good x carrier relation)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier \<Longrightarrow> convex (at_least_as_good x carrier relation)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier \<Longrightarrow> convex (at_least_as_good x carrier relation)
[PROOF STEP]
assume x_in: "x \<in> carrier"
[PROOF STATE]
proof (state)
this:
x \<in> carrier

goal (1 subgoal):
 1. \<And>x. x \<in> carrier \<Longrightarrow> convex (at_least_as_good x carrier relation)
[PROOF STEP]
show "convex (at_least_as_good x carrier relation)" (is "convex ?x")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (at_least_as_good x carrier relation)
[PROOF STEP]
proof (rule convexI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
fix a b :: "'a" and  \<alpha> :: "real" and \<beta> :: "real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
assume a_in: "a \<in> ?x"
[PROOF STATE]
proof (state)
this:
a \<in> at_least_as_good x carrier relation

goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
assume b_in: "b \<in> ?x"
[PROOF STATE]
proof (state)
this:
b \<in> at_least_as_good x carrier relation

goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
assume reals: " 0 \<le> \<alpha>" "0 \<le> \<beta>" "\<alpha> + \<beta> = 1"
[PROOF STATE]
proof (state)
this:
0 \<le> \<alpha>
0 \<le> \<beta>
\<alpha> + \<beta> = 1

goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
have a_g_x: "a \<succeq>[relation] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<succeq> x
[PROOF STEP]
using a_in
[PROOF STATE]
proof (prove)
using this:
a \<in> at_least_as_good x carrier relation

goal (1 subgoal):
 1. a \<succeq> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<succeq> x

goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
have b_g_x: "b \<succeq>[relation] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<succeq> x
[PROOF STEP]
using b_in
[PROOF STATE]
proof (prove)
using this:
b \<in> at_least_as_good x carrier relation

goal (1 subgoal):
 1. b \<succeq> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<succeq> x

goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
have "a \<succeq>[relation] b \<or> b \<succeq>[relation] a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<succeq> b \<or> b \<succeq> a
[PROOF STEP]
by (meson a_in at_least_as_goodD b_in preference.not_outside
          rational_preference.compl rational_preference_def assms(1))
[PROOF STATE]
proof (state)
this:
a \<succeq> b \<or> b \<succeq> a

goal (1 subgoal):
 1. \<And>xa y u v. \<lbrakk>xa \<in> at_least_as_good x carrier relation; y \<in> at_least_as_good x carrier relation; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<succeq> b \<or> b \<succeq> a
[PROOF STEP]
show "\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> ?x"
[PROOF STATE]
proof (prove)
using this:
a \<succeq> b \<or> b \<succeq> a

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
proof(rule disjE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<succeq> b \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
 2. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
assume "a \<succeq>[relation] b"
[PROOF STATE]
proof (state)
this:
a \<succeq> b

goal (2 subgoals):
 1. a \<succeq> b \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
 2. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<succeq> b
[PROOF STEP]
have "\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b  \<succeq>[relation] b"
[PROOF STATE]
proof (prove)
using this:
a \<succeq> b

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> b
[PROOF STEP]
using assms reals
[PROOF STATE]
proof (prove)
using this:
a \<succeq> b
rational_preference carrier relation
weak_convex_pref relation
0 \<le> \<alpha>
0 \<le> \<beta>
\<alpha> + \<beta> = 1

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> b

goal (2 subgoals):
 1. a \<succeq> b \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
 2. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> b
[PROOF STEP]
have "\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq>[relation] x"
[PROOF STATE]
proof (prove)
using this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> b

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x
[PROOF STEP]
by (meson b_g_x  assms(1) preference.not_outside x_in
            rational_preference.strict_is_neg_transitive
            rational_preference.strict_not_refl_weak rational_preference_def)
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x

goal (2 subgoals):
 1. a \<succeq> b \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
 2. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
by (metis (no_types, lifting) CollectI  assms(1)
            at_least_as_good_def preference_def rational_preference_def)
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation

goal (1 subgoal):
 1. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
assume as: "b \<succeq>[relation] a"
[PROOF STATE]
proof (state)
this:
b \<succeq> a

goal (1 subgoal):
 1. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<succeq> a
[PROOF STEP]
have "\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq>[relation] a"
[PROOF STATE]
proof (prove)
using this:
b \<succeq> a

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> a
[PROOF STEP]
by (metis add.commute assms(2) reals weak_convex1D)
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> a

goal (1 subgoal):
 1. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
have "\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq>[relation] a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> a
[PROOF STEP]
by (metis as add.commute  assms(2)
            reals(1,2,3) weak_convex1D)
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> a

goal (1 subgoal):
 1. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> a
[PROOF STEP]
have "\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq>[relation] x"
[PROOF STATE]
proof (prove)
using this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> a

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x
[PROOF STEP]
by (meson a_g_x assms(1) preference.indiff_trans x_in
            preference.not_outside rational_preference.axioms(1)
            rational_preference.strict_is_neg_transitive )
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x

goal (1 subgoal):
 1. b \<succeq> a \<Longrightarrow> \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
using pref_in_at_least_as
[PROOF STATE]
proof (prove)
using this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<succeq> x
?x \<succeq> ?y \<Longrightarrow> ?x \<in> at_least_as_good ?y carrier relation

goal (1 subgoal):
 1. \<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<alpha> *\<^sub>R a + \<beta> *\<^sub>R b \<in> at_least_as_good x carrier relation

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex (at_least_as_good x carrier relation)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cadjoint_eqI:
  fixes G:: \<open>'b::complex_inner \<Rightarrow> 'a::complex_inner\<close>
    and F:: \<open>'a \<Rightarrow> 'b\<close>
  assumes \<open>\<And>x y. (F x \<bullet>\<^sub>C y) = (x \<bullet>\<^sub>C G y)\<close>
  shows \<open>G\<^sup>\<dagger> = F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G\<^sup>\<dagger> = F
[PROOF STEP]
by (metis assms cadjoint_def is_cadjoint_def is_cadjoint_unique someI_ex)


[STATEMENT]
lemma dist_sup_mono:
  assumes distF: "dist_over_sup F"
  shows "mono F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono F
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>(x::'a) y::'a. x \<sqsubseteq> y \<Longrightarrow> F x \<sqsubseteq> F y
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
fix x :: 'a and y :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>(x::'a) y::'a. x \<sqsubseteq> y \<Longrightarrow> F x \<sqsubseteq> F y
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
assume "x \<sqsubseteq> y"
[PROOF STATE]
proof (state)
this:
(x::'a::refinement_lattice) \<sqsubseteq> (y::'a::refinement_lattice)

goal (1 subgoal):
 1. \<And>(x::'a) y::'a. x \<sqsubseteq> y \<Longrightarrow> F x \<sqsubseteq> F y
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x::'a::refinement_lattice) \<sqsubseteq> (y::'a::refinement_lattice)
[PROOF STEP]
have "F y = F (x \<squnion> y)"
[PROOF STATE]
proof (prove)
using this:
(x::'a::refinement_lattice) \<sqsubseteq> (y::'a::refinement_lattice)

goal (1 subgoal):
 1. F y = F (x \<squnion> y)
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: le_iff_sup)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (y::'a::refinement_lattice) = F ((x::'a::refinement_lattice) \<squnion> y)

goal (1 subgoal):
 1. \<And>(x::'a) y::'a. x \<sqsubseteq> y \<Longrightarrow> F x \<sqsubseteq> F y
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (y::'a::refinement_lattice) = F ((x::'a::refinement_lattice) \<squnion> y)

goal (1 subgoal):
 1. \<And>(x::'a) y::'a. x \<sqsubseteq> y \<Longrightarrow> F x \<sqsubseteq> F y
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "... = F x \<squnion> F y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (x \<squnion> y) = F x \<squnion> F y
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F (x \<squnion> y) = F x \<squnion> F y
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
from distF
[PROOF STATE]
proof (chain)
picking this:
dist_over_sup (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
[PROOF STEP]
have "F (\<Squnion>{x, y}) = \<Squnion>{F x, F y}"
[PROOF STATE]
proof (prove)
using this:
dist_over_sup (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. F (\<Squnion> {x, y}) = \<Squnion> {F x, F y}
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (drule_tac x = "{x, y}" in spec, simp)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (\<Squnion> {x::'a::refinement_lattice, y::'a::refinement_lattice}) = \<Squnion> {F x, F y}

goal (1 subgoal):
 1. F (x \<squnion> y) = F x \<squnion> F y
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (\<Squnion> {x::'a::refinement_lattice, y::'a::refinement_lattice}) = \<Squnion> {F x, F y}
[PROOF STEP]
show "F (x \<squnion> y) = F x \<squnion> F y"
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (\<Squnion> {x::'a::refinement_lattice, y::'a::refinement_lattice}) = \<Squnion> {F x, F y}

goal (1 subgoal):
 1. F (x \<squnion> y) = F x \<squnion> F y
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) ((x::'a::refinement_lattice) \<squnion> (y::'a::refinement_lattice)) = F x \<squnion> F y

goal:
No subgoals!
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) ((x::'a::refinement_lattice) \<squnion> (y::'a::refinement_lattice)) = F x \<squnion> F y

goal (1 subgoal):
 1. \<And>(x::'a) y::'a. x \<sqsubseteq> y \<Longrightarrow> F x \<sqsubseteq> F y
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (y::'a::refinement_lattice) = F (x::'a::refinement_lattice) \<squnion> F y
[PROOF STEP]
show "F x \<sqsubseteq> F y"
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (y::'a::refinement_lattice) = F (x::'a::refinement_lattice) \<squnion> F y

goal (1 subgoal):
 1. F x \<sqsubseteq> F y
variables:
x, y :: 'a
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis le_iff_sup)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (x::'a::refinement_lattice) \<sqsubseteq> F (y::'a::refinement_lattice)

goal:
No subgoals!
variables:
F :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma Suc_rtos_mod_r_1:"\<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; Suc (rtos r s i) < r * s; i mod s = s - Suc 0; i  div s < r - Suc 0\<rbrakk>
         \<Longrightarrow> Suc (rtos r s i) mod r = Suc (i div s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; Suc (rtos r s i) < r * s; i mod s = s - Suc 0; i div s < r - Suc 0\<rbrakk> \<Longrightarrow> Suc (rtos r s i) mod r = Suc (i div s)
[PROOF STEP]
apply (simp add:rtos_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_tangle_diagram_matrix_match:
 assumes "is_tangle_diagram (w1*ws1)"
    and "is_tangle_diagram (w2*ws2)"
 shows "rat_poly.matrix_match (blockmat w1)
                      (kauff_mat ws1) (blockmat w2) (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat w1) (kauff_mat ws1) (blockmat w2) (kauff_mat ws2)
[PROOF STEP]
unfolding rat_poly.matrix_match_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1) \<and> mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1) \<and> mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2) \<and> mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2) \<and> length (blockmat w1) = rat_poly.row_length (kauff_mat ws1) \<and> length (blockmat w2) = rat_poly.row_length (kauff_mat ws2) \<and> blockmat w1 \<noteq> [] \<and> kauff_mat ws1 \<noteq> [] \<and> blockmat w2 \<noteq> [] \<and> kauff_mat ws2 \<noteq> []
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
 1. mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1)
 2. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
 3. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 4. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 5. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 6. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 7. blockmat w1 = [] \<Longrightarrow> False
 8. kauff_mat ws1 = [] \<Longrightarrow> False
 9. blockmat w2 = [] \<Longrightarrow> False
 10. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1)
 2. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
 3. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 4. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 5. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 6. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 7. blockmat w1 = [] \<Longrightarrow> False
 8. kauff_mat ws1 = [] \<Longrightarrow> False
 9. blockmat w2 = [] \<Longrightarrow> False
 10. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
show "mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1)
[PROOF STEP]
using matrix_blockmat
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)

goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (blockmat w1)) (length (blockmat w1)) (blockmat w1)

goal (9 subgoals):
 1. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
 2. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 3. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 4. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 5. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 6. blockmat w1 = [] \<Longrightarrow> False
 7. kauff_mat ws1 = [] \<Longrightarrow> False
 8. blockmat w2 = [] \<Longrightarrow> False
 9. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
 2. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 3. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 4. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 5. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 6. blockmat w1 = [] \<Longrightarrow> False
 7. kauff_mat ws1 = [] \<Longrightarrow> False
 8. blockmat w2 = [] \<Longrightarrow> False
 9. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
have "is_tangle_diagram ws1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram ws1
[PROOF STEP]
using assms(1) is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w1 * ws1)
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram ws1
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ws1

goal (9 subgoals):
 1. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
 2. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 3. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 4. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 5. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 6. blockmat w1 = [] \<Longrightarrow> False
 7. kauff_mat ws1 = [] \<Longrightarrow> False
 8. blockmat w2 = [] \<Longrightarrow> False
 9. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ws1
[PROOF STEP]
show "mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1

goal (1 subgoal):
 1. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
[PROOF STEP]
using matrix_kauff_mat
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws) \<and> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws) \<and> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)

goal (1 subgoal):
 1. mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (kauff_mat ws1)) (length (kauff_mat ws1)) (kauff_mat ws1)

goal (8 subgoals):
 1. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 2. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 3. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 4. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 5. blockmat w1 = [] \<Longrightarrow> False
 6. kauff_mat ws1 = [] \<Longrightarrow> False
 7. blockmat w2 = [] \<Longrightarrow> False
 8. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
 2. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 3. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 4. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 5. blockmat w1 = [] \<Longrightarrow> False
 6. kauff_mat ws1 = [] \<Longrightarrow> False
 7. blockmat w2 = [] \<Longrightarrow> False
 8. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
show "mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
[PROOF STEP]
using matrix_blockmat
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)

goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (blockmat w2)) (length (blockmat w2)) (blockmat w2)

goal (7 subgoals):
 1. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 2. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 3. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 4. blockmat w1 = [] \<Longrightarrow> False
 5. kauff_mat ws1 = [] \<Longrightarrow> False
 6. blockmat w2 = [] \<Longrightarrow> False
 7. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 2. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 3. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 4. blockmat w1 = [] \<Longrightarrow> False
 5. kauff_mat ws1 = [] \<Longrightarrow> False
 6. blockmat w2 = [] \<Longrightarrow> False
 7. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
have "is_tangle_diagram ws2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram ws2
[PROOF STEP]
using assms(2) is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w2 * ws2)
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram ws2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ws2

goal (7 subgoals):
 1. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
 2. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 3. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 4. blockmat w1 = [] \<Longrightarrow> False
 5. kauff_mat ws1 = [] \<Longrightarrow> False
 6. blockmat w2 = [] \<Longrightarrow> False
 7. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ws2
[PROOF STEP]
show "mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws2

goal (1 subgoal):
 1. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
[PROOF STEP]
using matrix_kauff_mat
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws2
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws) \<and> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws) \<and> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)

goal (1 subgoal):
 1. mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (kauff_mat ws2)) (length (kauff_mat ws2)) (kauff_mat ws2)

goal (6 subgoals):
 1. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 2. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 3. blockmat w1 = [] \<Longrightarrow> False
 4. kauff_mat ws1 = [] \<Longrightarrow> False
 5. blockmat w2 = [] \<Longrightarrow> False
 6. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
 2. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 3. blockmat w1 = [] \<Longrightarrow> False
 4. kauff_mat ws1 = [] \<Longrightarrow> False
 5. blockmat w2 = [] \<Longrightarrow> False
 6. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
show "length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
[PROOF STEP]
using is_tangle_diagram_length_rowlength assms(1)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (?w * ?ws) \<Longrightarrow> length (blockmat ?w) = rat_poly.row_length (kauff_mat ?ws)
is_tangle_diagram (w1 * ws1)

goal (1 subgoal):
 1. length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (blockmat w1) = rat_poly.row_length (kauff_mat ws1)

goal (5 subgoals):
 1. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 2. blockmat w1 = [] \<Longrightarrow> False
 3. kauff_mat ws1 = [] \<Longrightarrow> False
 4. blockmat w2 = [] \<Longrightarrow> False
 5. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
 2. blockmat w1 = [] \<Longrightarrow> False
 3. kauff_mat ws1 = [] \<Longrightarrow> False
 4. blockmat w2 = [] \<Longrightarrow> False
 5. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
show  "length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
[PROOF STEP]
using is_tangle_diagram_length_rowlength assms(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (?w * ?ws) \<Longrightarrow> length (blockmat ?w) = rat_poly.row_length (kauff_mat ?ws)
is_tangle_diagram (w2 * ws2)

goal (1 subgoal):
 1. length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (blockmat w2) = rat_poly.row_length (kauff_mat ws2)

goal (4 subgoals):
 1. blockmat w1 = [] \<Longrightarrow> False
 2. kauff_mat ws1 = [] \<Longrightarrow> False
 3. blockmat w2 = [] \<Longrightarrow> False
 4. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. blockmat w1 = [] \<Longrightarrow> False
 2. kauff_mat ws1 = [] \<Longrightarrow> False
 3. blockmat w2 = [] \<Longrightarrow> False
 4. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
assume 0:"blockmat w1 = [] "
[PROOF STATE]
proof (state)
this:
blockmat w1 = []

goal (4 subgoals):
 1. blockmat w1 = [] \<Longrightarrow> False
 2. kauff_mat ws1 = [] \<Longrightarrow> False
 3. blockmat w2 = [] \<Longrightarrow> False
 4. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
blockmat w1 = []

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis blockmat_non_empty)
[PROOF STATE]
proof (state)
this:
False

goal (3 subgoals):
 1. kauff_mat ws1 = [] \<Longrightarrow> False
 2. blockmat w2 = [] \<Longrightarrow> False
 3. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. kauff_mat ws1 = [] \<Longrightarrow> False
 2. blockmat w2 = [] \<Longrightarrow> False
 3. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
assume 1:"kauff_mat ws1 = [] "
[PROOF STATE]
proof (state)
this:
kauff_mat ws1 = []

goal (3 subgoals):
 1. kauff_mat ws1 = [] \<Longrightarrow> False
 2. blockmat w2 = [] \<Longrightarrow> False
 3. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
have "is_tangle_diagram ws1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram ws1
[PROOF STEP]
using assms(1) is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w1 * ws1)
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram ws1
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ws1

goal (3 subgoals):
 1. kauff_mat ws1 = [] \<Longrightarrow> False
 2. blockmat w2 = [] \<Longrightarrow> False
 3. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ws1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1

goal (1 subgoal):
 1. False
[PROOF STEP]
using 1 kauff_mat_non_empty
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1
kauff_mat ws1 = []
is_tangle_diagram ?ws \<Longrightarrow> kauff_mat ?ws \<noteq> []

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal (2 subgoals):
 1. blockmat w2 = [] \<Longrightarrow> False
 2. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. blockmat w2 = [] \<Longrightarrow> False
 2. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
assume 0:"blockmat w2 = [] "
[PROOF STATE]
proof (state)
this:
blockmat w2 = []

goal (2 subgoals):
 1. blockmat w2 = [] \<Longrightarrow> False
 2. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
blockmat w2 = []

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis blockmat_non_empty)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
assume 1:"kauff_mat ws2 = [] "
[PROOF STATE]
proof (state)
this:
kauff_mat ws2 = []

goal (1 subgoal):
 1. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
have "is_tangle_diagram ws2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram ws2
[PROOF STEP]
using assms(2) is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w2 * ws2)
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram ws2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ws2

goal (1 subgoal):
 1. kauff_mat ws2 = [] \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ws2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws2

goal (1 subgoal):
 1. False
[PROOF STEP]
using 1 kauff_mat_non_empty
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws2
kauff_mat ws2 = []
is_tangle_diagram ?ws \<Longrightarrow> kauff_mat ?ws \<noteq> []

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l7_17_bis:
  assumes "A Midpoint P P'" and
    "B Midpoint P' P"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
by (meson Tarski_neutral_dimensionless.l7_17 Tarski_neutral_dimensionless.l7_2 Tarski_neutral_dimensionless_axioms assms(1) assms(2))