[STATEMENT]
lemma cylinder_prob:
  assumes "A \<subseteq> S_edges" "B \<subseteq> S_edges" "A \<inter> B = {}"
  shows "prob (cylinder S_edges A B) = p ^ (card A) * (1 - p) ^ (card B)" (is "_ = ?pp A B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
have "Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B"
       "\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> A \<union> x = x"
       "\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> finite x"
       "\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - x) = {}"
       "\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - x) = S_edges - x"
       "finite A" "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B &&& (\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> A \<union> x = x) &&& (\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> finite x)) &&& ((\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - x) = {}) &&& (\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - x) = S_edges - x)) &&& finite A &&& finite B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> S_edges
B \<subseteq> S_edges
A \<inter> B = {}

goal (1 subgoal):
 1. (Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B &&& (\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> A \<union> x = x) &&& (\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> finite x)) &&& ((\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - x) = {}) &&& (\<And>x. x \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - x) = S_edges - x)) &&& finite A &&& finite B
[PROOF STEP]
by (auto simp add: cylinder_def intro: finite_subset)
[PROOF STATE]
proof (state)
this:
Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B
?x1 \<in> cylinder S_edges A B \<Longrightarrow> A \<union> ?x1 = ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> finite ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - ?x1) = {}
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - ?x1) = S_edges - ?x1
finite A
finite B

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B
?x1 \<in> cylinder S_edges A B \<Longrightarrow> A \<union> ?x1 = ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> finite ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - ?x1) = {}
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - ?x1) = S_edges - ?x1
finite A
finite B
[PROOF STEP]
have "(\<Sum>T\<in>cylinder S_edges A B. ?pp T (S_edges - T))
      = (\<Sum>T \<in> cylinder S_edges A B. p^(card A + card (T - A)) * (1 - p)^(card B + card ((S_edges - B) - T)))"
[PROOF STATE]
proof (prove)
using this:
Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B
?x1 \<in> cylinder S_edges A B \<Longrightarrow> A \<union> ?x1 = ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> finite ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - ?x1) = {}
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - ?x1) = S_edges - ?x1
finite A
finite B

goal (1 subgoal):
 1. (\<Sum>T\<in>cylinder S_edges A B. p ^ card T * (1 - p) ^ card (S_edges - T)) = (\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T)))
[PROOF STEP]
using finite_edges
[PROOF STATE]
proof (prove)
using this:
Pow S_edges \<inter> cylinder S_edges A B = cylinder S_edges A B
?x1 \<in> cylinder S_edges A B \<Longrightarrow> A \<union> ?x1 = ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> finite ?x1
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<inter> (S_edges - B - ?x1) = {}
?x1 \<in> cylinder S_edges A B \<Longrightarrow> B \<union> (S_edges - B - ?x1) = S_edges - ?x1
finite A
finite B
finite S_edges

goal (1 subgoal):
 1. (\<Sum>T\<in>cylinder S_edges A B. p ^ card T * (1 - p) ^ card (S_edges - T)) = (\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T)))
[PROOF STEP]
by (simp add: card_Un_Int)
[PROOF STATE]
proof (state)
this:
(\<Sum>T\<in>cylinder S_edges A B. p ^ card T * (1 - p) ^ card (S_edges - T)) = (\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T)))

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>T\<in>cylinder S_edges A B. p ^ card T * (1 - p) ^ card (S_edges - T)) = (\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T)))

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
have "\<dots> = ?pp A B * (\<Sum>T\<in>cylinder S_edges A B. ?pp (T - A) (S_edges - B - T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T))) = p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T))
[PROOF STEP]
by (simp add: power_add sum_distrib_left ac_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T))) = p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T))

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>T\<in>cylinder S_edges A B. p ^ (card A + card (T - A)) * (1 - p) ^ (card B + card (S_edges - B - T))) = p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T))

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
have "\<dots> = ?pp A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T)) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T)) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
have "\<And>T. T \<in> cylinder S_edges A B \<Longrightarrow> S_edges - B - T = (S_edges - A) - B - (T - A)"
         "Pow (S_edges - A - B) = (\<lambda>x. x - A) ` cylinder S_edges A B"
         "inj_on (\<lambda>x. x - A) (cylinder S_edges A B)"
         "finite (S_edges - A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<And>T. T \<in> cylinder S_edges A B \<Longrightarrow> S_edges - B - T = S_edges - A - B - (T - A)) &&& Pow (S_edges - A - B) = (\<lambda>x. x - A) ` cylinder S_edges A B) &&& inj_on (\<lambda>x. x - A) (cylinder S_edges A B) &&& finite (S_edges - A - B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> S_edges
B \<subseteq> S_edges
A \<inter> B = {}

goal (1 subgoal):
 1. ((\<And>T. T \<in> cylinder S_edges A B \<Longrightarrow> S_edges - B - T = S_edges - A - B - (T - A)) &&& Pow (S_edges - A - B) = (\<lambda>x. x - A) ` cylinder S_edges A B) &&& inj_on (\<lambda>x. x - A) (cylinder S_edges A B) &&& finite (S_edges - A - B)
[PROOF STEP]
by (auto simp: cylinder_def intro!: inj_onI)
[PROOF STATE]
proof (state)
this:
?T1 \<in> cylinder S_edges A B \<Longrightarrow> S_edges - B - ?T1 = S_edges - A - B - (?T1 - A)
Pow (S_edges - A - B) = (\<lambda>x. x - A) ` cylinder S_edges A B
inj_on (\<lambda>x. x - A) (cylinder S_edges A B)
finite (S_edges - A - B)

goal (1 subgoal):
 1. p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T)) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
with full_sum[of "S_edges - A - B"]
[PROOF STATE]
proof (chain)
picking this:
finite (S_edges - A - B) \<Longrightarrow> (\<Sum>Aa\<in>Pow (S_edges - A - B). ?p ^ card Aa * (1 - ?p) ^ card (S_edges - A - B - Aa)) = 1
?T1 \<in> cylinder S_edges A B \<Longrightarrow> S_edges - B - ?T1 = S_edges - A - B - (?T1 - A)
Pow (S_edges - A - B) = (\<lambda>x. x - A) ` cylinder S_edges A B
inj_on (\<lambda>x. x - A) (cylinder S_edges A B)
finite (S_edges - A - B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (S_edges - A - B) \<Longrightarrow> (\<Sum>Aa\<in>Pow (S_edges - A - B). ?p ^ card Aa * (1 - ?p) ^ card (S_edges - A - B - Aa)) = 1
?T1 \<in> cylinder S_edges A B \<Longrightarrow> S_edges - B - ?T1 = S_edges - A - B - (?T1 - A)
Pow (S_edges - A - B) = (\<lambda>x. x - A) ` cylinder S_edges A B
inj_on (\<lambda>x. x - A) (cylinder S_edges A B)
finite (S_edges - A - B)

goal (1 subgoal):
 1. p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T)) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
by (simp add: sum.reindex)
[PROOF STATE]
proof (state)
this:
p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T)) = p ^ card A * (1 - p) ^ card B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ card A * (1 - p) ^ card B * (\<Sum>T\<in>cylinder S_edges A B. p ^ card (T - A) * (1 - p) ^ card (S_edges - B - T)) = p ^ card A * (1 - p) ^ card B

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>T\<in>cylinder S_edges A B. p ^ card T * (1 - p) ^ card (S_edges - T)) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>T\<in>cylinder S_edges A B. p ^ card T * (1 - p) ^ card (S_edges - T)) = p ^ card A * (1 - p) ^ card B

goal (1 subgoal):
 1. prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B
[PROOF STEP]
by (auto simp add: prob_eq cylinder_def)
[PROOF STATE]
proof (state)
this:
prob (cylinder S_edges A B) = p ^ card A * (1 - p) ^ card B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_zeros:
 "foldl (+) (m :: nat) (replicate n 0) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (+) m (replicate n 0) = m
[PROOF STEP]
by (induction n, simp_all)


[STATEMENT]
lemma set_map_filter:
  "set (List.map_filter g xs) = {y. \<exists>x. x \<in> set xs \<and> g x = Some y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (List.map_filter g xs) = {y. \<exists>x. x \<in> set xs \<and> g x = Some y}
[PROOF STEP]
by (induct xs) (auto simp add: List.map_filter_def set_eq_iff)


[STATEMENT]
lemma siterate_conv_of_seq: "siterate f a = of_seq (\<lambda>n. (f ^^ n) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. siterate f a = of_seq (\<lambda>n. (f ^^ n) a)
[PROOF STEP]
by transfer (rule iterates_conv_inf_llist)


[STATEMENT]
lemma sum_var_monom_var: "sum_var (var_monom x) y = (if x = y then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_var (var_monom x) y = (if x = y then 1 else 0)
[PROOF STEP]
by (transfer, auto simp: sum_var_list_def)


[STATEMENT]
lemma wbt_Node_alpha: "wbt (Node l x r) =
 ((let q = size1 l / (size1 l + size1 r)
   in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and>
  wbt l \<and> wbt r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wbt \<langle>l, x, r\<rangle> = ((let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wbt \<langle>l, x, r\<rangle> = ((let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r)
[PROOF STEP]
have "l > 0 \<Longrightarrow> r > 0 \<Longrightarrow>
    (1/(\<Delta>+1) \<le> l/(l+r) \<longleftrightarrow> r/l \<le> \<Delta>) \<and>
    (1/(\<Delta>+1) \<le> r/(l+r) \<longleftrightarrow> l/r \<le> \<Delta>) \<and>
    (l/(l+r) \<le> 1 - 1/(\<Delta>+1) \<longleftrightarrow> l/r \<le> \<Delta>) \<and>
    (r/(l+r) \<le> 1 - 1/(\<Delta>+1) \<longleftrightarrow> r/l \<le> \<Delta>)" for l r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < l; 0 < r\<rbrakk> \<Longrightarrow> (1 / (\<Delta> + 1) \<le> l / (l + r)) = (r / l \<le> \<Delta>) \<and> (1 / (\<Delta> + 1) \<le> r / (l + r)) = (l / r \<le> \<Delta>) \<and> (l / (l + r) \<le> 1 - 1 / (\<Delta> + 1)) = (l / r \<le> \<Delta>) \<and> (r / (l + r) \<le> 1 - 1 / (\<Delta> + 1)) = (r / l \<le> \<Delta>)
[PROOF STEP]
using Delta
[PROOF STATE]
proof (prove)
using this:
1 \<le> \<Delta>

goal (1 subgoal):
 1. \<lbrakk>0 < l; 0 < r\<rbrakk> \<Longrightarrow> (1 / (\<Delta> + 1) \<le> l / (l + r)) = (r / l \<le> \<Delta>) \<and> (1 / (\<Delta> + 1) \<le> r / (l + r)) = (l / r \<le> \<Delta>) \<and> (l / (l + r) \<le> 1 - 1 / (\<Delta> + 1)) = (l / r \<le> \<Delta>) \<and> (r / (l + r) \<le> 1 - 1 / (\<Delta> + 1)) = (r / l \<le> \<Delta>)
[PROOF STEP]
by (simp add: field_simps divide_le_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?l6; 0 < ?r6\<rbrakk> \<Longrightarrow> (1 / (\<Delta> + 1) \<le> ?l6 / (?l6 + ?r6)) = (?r6 / ?l6 \<le> \<Delta>) \<and> (1 / (\<Delta> + 1) \<le> ?r6 / (?l6 + ?r6)) = (?l6 / ?r6 \<le> \<Delta>) \<and> (?l6 / (?l6 + ?r6) \<le> 1 - 1 / (\<Delta> + 1)) = (?l6 / ?r6 \<le> \<Delta>) \<and> (?r6 / (?l6 + ?r6) \<le> 1 - 1 / (\<Delta> + 1)) = (?r6 / ?l6 \<le> \<Delta>)

goal (1 subgoal):
 1. wbt \<langle>l, x, r\<rangle> = ((let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?l6; 0 < ?r6\<rbrakk> \<Longrightarrow> (1 / (\<Delta> + 1) \<le> ?l6 / (?l6 + ?r6)) = (?r6 / ?l6 \<le> \<Delta>) \<and> (1 / (\<Delta> + 1) \<le> ?r6 / (?l6 + ?r6)) = (?l6 / ?r6 \<le> \<Delta>) \<and> (?l6 / (?l6 + ?r6) \<le> 1 - 1 / (\<Delta> + 1)) = (?l6 / ?r6 \<le> \<Delta>) \<and> (?r6 / (?l6 + ?r6) \<le> 1 - 1 / (\<Delta> + 1)) = (?r6 / ?l6 \<le> \<Delta>)

goal (1 subgoal):
 1. wbt \<langle>l, x, r\<rangle> = ((let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r)
[PROOF STEP]
using Delta
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?l6; 0 < ?r6\<rbrakk> \<Longrightarrow> (1 / (\<Delta> + 1) \<le> ?l6 / (?l6 + ?r6)) = (?r6 / ?l6 \<le> \<Delta>) \<and> (1 / (\<Delta> + 1) \<le> ?r6 / (?l6 + ?r6)) = (?l6 / ?r6 \<le> \<Delta>) \<and> (?l6 / (?l6 + ?r6) \<le> 1 - 1 / (\<Delta> + 1)) = (?l6 / ?r6 \<le> \<Delta>) \<and> (?r6 / (?l6 + ?r6) \<le> 1 - 1 / (\<Delta> + 1)) = (?r6 / ?l6 \<le> \<Delta>)
1 \<le> \<Delta>

goal (1 subgoal):
 1. wbt \<langle>l, x, r\<rangle> = ((let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r)
[PROOF STEP]
by(auto simp: \<alpha>_def Let_def pos_divide_le_eq add_pos_pos)
[PROOF STATE]
proof (state)
this:
wbt \<langle>l, x, r\<rangle> = ((let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_iff: "x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x = y \<longleftrightarrow> x \<sqsubseteq> y \<and> y \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x = y) = (x \<sqsubseteq> y \<and> y \<sqsubseteq> x)
[PROOF STEP]
by (auto dest: antisym simp:refl)


[STATEMENT]
lemma 36:
fixes b m j l :: nat
  assumes "b>2"
  assumes "(n = 2 * l * m + j \<or> (n = 2 * l * m - j \<and> 2 * l * m > j  \<and> j \<ge> 1)) "
  defines "v \<equiv> \<alpha> b (m+1) - \<alpha> b (m-1)"
  shows  "(\<alpha> b n) mod v = \<alpha> b j mod v \<or> (\<alpha> b n) mod v = -\<alpha> b j mod v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> b n mod v = \<alpha> b j mod v \<or> \<alpha> b n mod v = - \<alpha> b j mod v
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
n = 2 * l * m + j \<or> n = 2 * l * m - j \<and> j < 2 * l * m \<and> 1 \<le> j

goal (1 subgoal):
 1. \<alpha> b n mod v = \<alpha> b j mod v \<or> \<alpha> b n mod v = - \<alpha> b j mod v
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<alpha> b (2 * l * m + j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m + j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m + j) mod v = \<alpha> b j mod v
 2. \<lbrakk>\<alpha> b (2 * l * m - j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m - j; j < 2 * l * m; Suc 0 \<le> j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod v = \<alpha> b j mod v
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<alpha> b (2 * l * m + j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m + j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m + j) mod v = \<alpha> b j mod v
[PROOF STEP]
using 361 assms(1) v_def
[PROOF STATE]
proof (prove)
using this:
2 < ?b \<Longrightarrow> \<alpha> ?b (2 * ?l * ?m + ?j) mod (\<alpha> ?b (?m + 1) - \<alpha> ?b (?m - 1)) = (- 1) ^ ?l * \<alpha> ?b ?j mod (\<alpha> ?b (?m + 1) - \<alpha> ?b (?m - 1))
2 < b
v \<equiv> \<alpha> b (m + 1) - \<alpha> b (m - 1)

goal (1 subgoal):
 1. \<lbrakk>\<alpha> b (2 * l * m + j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m + j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m + j) mod v = \<alpha> b j mod v
[PROOF STEP]
apply(cases "even l" )
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<alpha> b (2 * l * m + j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m + j; \<And>b l m j. 2 < b \<Longrightarrow> \<alpha> b (2 * l * m + j) mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)) = (- 1) ^ l * \<alpha> b j mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)); 2 < b; v \<equiv> \<alpha> b (m + 1) - \<alpha> b (m - 1); even l\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m + j) mod v = \<alpha> b j mod v
 2. \<lbrakk>\<alpha> b (2 * l * m + j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m + j; \<And>b l m j. 2 < b \<Longrightarrow> \<alpha> b (2 * l * m + j) mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)) = (- 1) ^ l * \<alpha> b j mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)); 2 < b; v \<equiv> \<alpha> b (m + 1) - \<alpha> b (m - 1); odd l\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m + j) mod v = \<alpha> b j mod v
[PROOF STEP]
by simp+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<alpha> b (2 * l * m - j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m - j; j < 2 * l * m; Suc 0 \<le> j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod v = \<alpha> b j mod v
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<alpha> b (2 * l * m - j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m - j; j < 2 * l * m; Suc 0 \<le> j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod v = \<alpha> b j mod v
[PROOF STEP]
using 362 assms(1) v_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 < ?b; ?j < 2 * ?l * ?m; 1 \<le> ?j\<rbrakk> \<Longrightarrow> \<alpha> ?b (2 * ?l * ?m - ?j) mod (\<alpha> ?b (?m + 1) - \<alpha> ?b (?m - 1)) = - ((- 1) ^ ?l * \<alpha> ?b ?j) mod (\<alpha> ?b (?m + 1) - \<alpha> ?b (?m - 1))
2 < b
v \<equiv> \<alpha> b (m + 1) - \<alpha> b (m - 1)

goal (1 subgoal):
 1. \<lbrakk>\<alpha> b (2 * l * m - j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m - j; j < 2 * l * m; Suc 0 \<le> j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod v = \<alpha> b j mod v
[PROOF STEP]
apply(cases "even l" )
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<alpha> b (2 * l * m - j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m - j; j < 2 * l * m; Suc 0 \<le> j; \<And>b j l m. \<lbrakk>2 < b; j < 2 * l * m; 1 \<le> j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)) = - ((- 1) ^ l * \<alpha> b j) mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)); 2 < b; v \<equiv> \<alpha> b (m + 1) - \<alpha> b (m - 1); even l\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod v = \<alpha> b j mod v
 2. \<lbrakk>\<alpha> b (2 * l * m - j) mod v \<noteq> - \<alpha> b j mod v; n = 2 * l * m - j; j < 2 * l * m; Suc 0 \<le> j; \<And>b j l m. \<lbrakk>2 < b; j < 2 * l * m; 1 \<le> j\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)) = - ((- 1) ^ l * \<alpha> b j) mod (\<alpha> b (m + 1) - \<alpha> b (m - 1)); 2 < b; v \<equiv> \<alpha> b (m + 1) - \<alpha> b (m - 1); odd l\<rbrakk> \<Longrightarrow> \<alpha> b (2 * l * m - j) mod v = \<alpha> b j mod v
[PROOF STEP]
by simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pnPlus_singleton_PLUS:
  "\<lbrakk>xs \<noteq> []; sorted xs; distinct xs; \<forall>x \<in> {x} \<union> set xs. \<not>is_Zero x \<and> \<not>is_Plus x\<rbrakk> \<Longrightarrow>
  pnPlus x (PLUS xs) = (if x \<in> set xs then PLUS xs else PLUS (insort x xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; sorted xs; distinct xs; \<forall>x\<in>{x} \<union> set xs. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS xs) = (if x \<in> set xs then PLUS xs else PLUS (insort x xs))
[PROOF STEP]
proof (induct xs rule: list_singleton_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []; distinct []; \<forall>x\<in>{x} \<union> set []. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS []) = (if x \<in> set [] then PLUS [] else PLUS (insort x []))
 2. \<And>xa. \<lbrakk>[xa] \<noteq> []; sorted [xa]; distinct [xa]; \<forall>x\<in>{x} \<union> set [xa]. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS [xa]) = (if x \<in> set [xa] then PLUS [xa] else PLUS (insort x [xa]))
 3. \<And>xa y xs. \<lbrakk>\<lbrakk>y # xs \<noteq> []; sorted (y # xs); distinct (y # xs); \<forall>x\<in>{x} \<union> set (y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y # xs)) = (if x \<in> set (y # xs) then PLUS (y # xs) else PLUS (insort x (y # xs))); xa # y # xs \<noteq> []; sorted (xa # y # xs); distinct (xa # y # xs); \<forall>x\<in>{x} \<union> set (xa # y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (xa # y # xs)) = (if x \<in> set (xa # y # xs) then PLUS (xa # y # xs) else PLUS (insort x (xa # y # xs)))
[PROOF STEP]
case (single y)
[PROOF STATE]
proof (state)
this:
[y] \<noteq> []
sorted [y]
distinct [y]
\<forall>x\<in>{x} \<union> set [y]. \<not> is_Zero x \<and> \<not> is_Plus x

goal (3 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []; distinct []; \<forall>x\<in>{x} \<union> set []. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS []) = (if x \<in> set [] then PLUS [] else PLUS (insort x []))
 2. \<And>xa. \<lbrakk>[xa] \<noteq> []; sorted [xa]; distinct [xa]; \<forall>x\<in>{x} \<union> set [xa]. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS [xa]) = (if x \<in> set [xa] then PLUS [xa] else PLUS (insort x [xa]))
 3. \<And>xa y xs. \<lbrakk>\<lbrakk>y # xs \<noteq> []; sorted (y # xs); distinct (y # xs); \<forall>x\<in>{x} \<union> set (y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y # xs)) = (if x \<in> set (y # xs) then PLUS (y # xs) else PLUS (insort x (y # xs))); xa # y # xs \<noteq> []; sorted (xa # y # xs); distinct (xa # y # xs); \<forall>x\<in>{x} \<union> set (xa # y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (xa # y # xs)) = (if x \<in> set (xa # y # xs) then PLUS (xa # y # xs) else PLUS (insort x (xa # y # xs)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
[y] \<noteq> []
sorted [y]
distinct [y]
\<forall>x\<in>{x} \<union> set [y]. \<not> is_Zero x \<and> \<not> is_Plus x

goal (1 subgoal):
 1. pnPlus x (PLUS [y]) = (if x \<in> set [y] then PLUS [y] else PLUS (insort x [y]))
[PROOF STEP]
unfolding is_Zero_def is_Plus_def
[PROOF STATE]
proof (prove)
using this:
[y] \<noteq> []
sorted [y]
distinct [y]
\<forall>x\<in>{x} \<union> set [y]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)

goal (1 subgoal):
 1. pnPlus x (PLUS [y]) = (if x \<in> set [y] then PLUS [y] else PLUS (insort x [y]))
[PROOF STEP]
apply (cases x y rule: linorder_cases)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>[y] \<noteq> []; sorted [y]; distinct [y]; \<forall>x\<in>{x} \<union> set [y]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x < y\<rbrakk> \<Longrightarrow> pnPlus x (PLUS [y]) = (if x \<in> set [y] then PLUS [y] else PLUS (insort x [y]))
 2. \<lbrakk>[y] \<noteq> []; sorted [y]; distinct [y]; \<forall>x\<in>{x} \<union> set [y]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = y\<rbrakk> \<Longrightarrow> pnPlus x (PLUS [y]) = (if x \<in> set [y] then PLUS [y] else PLUS (insort x [y]))
 3. \<lbrakk>[y] \<noteq> []; sorted [y]; distinct [y]; \<forall>x\<in>{x} \<union> set [y]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); y < x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS [y]) = (if x \<in> set [y] then PLUS [y] else PLUS (insort x [y]))
[PROOF STEP]
apply (induct x y rule: pnPlus.induct)
[PROOF STATE]
proof (prove)
goal (33 subgoals):
 1. \<And>r. \<lbrakk>[r] \<noteq> []; sorted [r]; distinct [r]; \<forall>x\<in>{Zero} \<union> set [r]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Zero < r\<rbrakk> \<Longrightarrow> pnPlus Zero (PLUS [r]) = (if Zero \<in> set [r] then PLUS [r] else PLUS (insort Zero [r]))
 2. \<lbrakk>[Zero] \<noteq> []; sorted [Zero]; distinct [Zero]; \<forall>x\<in>{One} \<union> set [Zero]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); One < Zero\<rbrakk> \<Longrightarrow> pnPlus One (PLUS [Zero]) = (if One \<in> set [Zero] then PLUS [Zero] else PLUS (insort One [Zero]))
 3. \<And>v. \<lbrakk>[Zero] \<noteq> []; sorted [Zero]; distinct [Zero]; \<forall>x\<in>{Atom v} \<union> set [Zero]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Atom v < Zero\<rbrakk> \<Longrightarrow> pnPlus (Atom v) (PLUS [Zero]) = (if Atom v \<in> set [Zero] then PLUS [Zero] else PLUS (insort (Atom v) [Zero]))
 4. \<And>v va. \<lbrakk>[Zero] \<noteq> []; sorted [Zero]; distinct [Zero]; \<forall>x\<in>{Plus v va} \<union> set [Zero]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Plus v va < Zero\<rbrakk> \<Longrightarrow> pnPlus (Plus v va) (PLUS [Zero]) = (if Plus v va \<in> set [Zero] then PLUS [Zero] else PLUS (insort (Plus v va) [Zero]))
 5. \<And>v va. \<lbrakk>[Zero] \<noteq> []; sorted [Zero]; distinct [Zero]; \<forall>x\<in>{Times v va} \<union> set [Zero]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Times v va < Zero\<rbrakk> \<Longrightarrow> pnPlus (Times v va) (PLUS [Zero]) = (if Times v va \<in> set [Zero] then PLUS [Zero] else PLUS (insort (Times v va) [Zero]))
 6. \<And>v. \<lbrakk>[Zero] \<noteq> []; sorted [Zero]; distinct [Zero]; \<forall>x\<in>{Star v} \<union> set [Zero]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Star v < Zero\<rbrakk> \<Longrightarrow> pnPlus (Star v) (PLUS [Zero]) = (if Star v \<in> set [Zero] then PLUS [Zero] else PLUS (insort (Star v) [Zero]))
 7. \<And>r s. \<lbrakk>\<lbrakk>[One] \<noteq> []; sorted [One]; distinct [One]; \<forall>x\<in>{s} \<union> set [One]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); s < One\<rbrakk> \<Longrightarrow> pnPlus s (PLUS [One]) = (if s \<in> set [One] then PLUS [One] else PLUS (insort s [One])); \<lbrakk>[pnPlus s One] \<noteq> []; sorted [pnPlus s One]; distinct [pnPlus s One]; \<forall>x\<in>{r} \<union> set [pnPlus s One]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); r < pnPlus s One\<rbrakk> \<Longrightarrow> pnPlus r (PLUS [pnPlus s One]) = (if r \<in> set [pnPlus s One] then PLUS [pnPlus s One] else PLUS (insort r [pnPlus s One])); [One] \<noteq> []; sorted [One]; distinct [One]; \<forall>x\<in>{Plus r s} \<union> set [One]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Plus r s < One\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (PLUS [One]) = (if Plus r s \<in> set [One] then PLUS [One] else PLUS (insort (Plus r s) [One]))
 8. \<And>r s v. \<lbrakk>\<lbrakk>[Atom v] \<noteq> []; sorted [Atom v]; distinct [Atom v]; \<forall>x\<in>{s} \<union> set [Atom v]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); s < Atom v\<rbrakk> \<Longrightarrow> pnPlus s (PLUS [Atom v]) = (if s \<in> set [Atom v] then PLUS [Atom v] else PLUS (insort s [Atom v])); \<lbrakk>[pnPlus s (Atom v)] \<noteq> []; sorted [pnPlus s (Atom v)]; distinct [pnPlus s (Atom v)]; \<forall>x\<in>{r} \<union> set [pnPlus s (Atom v)]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); r < pnPlus s (Atom v)\<rbrakk> \<Longrightarrow> pnPlus r (PLUS [pnPlus s (Atom v)]) = (if r \<in> set [pnPlus s (Atom v)] then PLUS [pnPlus s (Atom v)] else PLUS (insort r [pnPlus s (Atom v)])); [Atom v] \<noteq> []; sorted [Atom v]; distinct [Atom v]; \<forall>x\<in>{Plus r s} \<union> set [Atom v]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Plus r s < Atom v\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (PLUS [Atom v]) = (if Plus r s \<in> set [Atom v] then PLUS [Atom v] else PLUS (insort (Plus r s) [Atom v]))
 9. \<And>r s v va. \<lbrakk>\<lbrakk>[Plus v va] \<noteq> []; sorted [Plus v va]; distinct [Plus v va]; \<forall>x\<in>{s} \<union> set [Plus v va]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); s < Plus v va\<rbrakk> \<Longrightarrow> pnPlus s (PLUS [Plus v va]) = (if s \<in> set [Plus v va] then PLUS [Plus v va] else PLUS (insort s [Plus v va])); \<lbrakk>[pnPlus s (Plus v va)] \<noteq> []; sorted [pnPlus s (Plus v va)]; distinct [pnPlus s (Plus v va)]; \<forall>x\<in>{r} \<union> set [pnPlus s (Plus v va)]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); r < pnPlus s (Plus v va)\<rbrakk> \<Longrightarrow> pnPlus r (PLUS [pnPlus s (Plus v va)]) = (if r \<in> set [pnPlus s (Plus v va)] then PLUS [pnPlus s (Plus v va)] else PLUS (insort r [pnPlus s (Plus v va)])); [Plus v va] \<noteq> []; sorted [Plus v va]; distinct [Plus v va]; \<forall>x\<in>{Plus r s} \<union> set [Plus v va]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Plus r s < Plus v va\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (PLUS [Plus v va]) = (if Plus r s \<in> set [Plus v va] then PLUS [Plus v va] else PLUS (insort (Plus r s) [Plus v va]))
 10. \<And>r s v va. \<lbrakk>\<lbrakk>[Times v va] \<noteq> []; sorted [Times v va]; distinct [Times v va]; \<forall>x\<in>{s} \<union> set [Times v va]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); s < Times v va\<rbrakk> \<Longrightarrow> pnPlus s (PLUS [Times v va]) = (if s \<in> set [Times v va] then PLUS [Times v va] else PLUS (insort s [Times v va])); \<lbrakk>[pnPlus s (Times v va)] \<noteq> []; sorted [pnPlus s (Times v va)]; distinct [pnPlus s (Times v va)]; \<forall>x\<in>{r} \<union> set [pnPlus s (Times v va)]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); r < pnPlus s (Times v va)\<rbrakk> \<Longrightarrow> pnPlus r (PLUS [pnPlus s (Times v va)]) = (if r \<in> set [pnPlus s (Times v va)] then PLUS [pnPlus s (Times v va)] else PLUS (insort r [pnPlus s (Times v va)])); [Times v va] \<noteq> []; sorted [Times v va]; distinct [Times v va]; \<forall>x\<in>{Plus r s} \<union> set [Times v va]. x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); Plus r s < Times v va\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (PLUS [Times v va]) = (if Plus r s \<in> set [Times v va] then PLUS [Times v va] else PLUS (insort (Plus r s) [Times v va]))
A total of 33 subgoals...
[PROOF STEP]
apply (auto simp: less_rexp_def less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus y y = y
 2. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus x y
 3. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; \<not> le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus y x
[PROOF STEP]
apply (cases y)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42; y = Zero\<rbrakk> \<Longrightarrow> pnPlus y y = y
 2. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42; y = One\<rbrakk> \<Longrightarrow> pnPlus y y = y
 3. \<And>x3. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42; y = Atom x3\<rbrakk> \<Longrightarrow> pnPlus y y = y
 4. \<And>x41 x42. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42; y = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus y y = y
 5. \<And>x51 x52. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42; y = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus y y = y
 6. \<And>x6. \<lbrakk>x = y; y \<noteq> Zero; \<forall>x41 x42. y \<noteq> Plus x41 x42; y = Star x6\<rbrakk> \<Longrightarrow> pnPlus y y = y
 7. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus x y
 8. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; \<not> le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus y x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus x y
 2. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; \<not> le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus y x
[PROOF STEP]
apply (induct x y rule: pnPlus.induct)
[PROOF STATE]
proof (prove)
goal (32 subgoals):
 1. \<And>r. \<lbrakk>r \<noteq> Zero; le_rexp r Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; Zero \<noteq> Zero; \<forall>x41 x42. Zero \<noteq> Plus x41 x42; le_rexp Zero r; Zero \<noteq> r\<rbrakk> \<Longrightarrow> pnPlus Zero r = Plus Zero r
 2. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero One; \<forall>x41 x42. Zero \<noteq> Plus x41 x42; One \<noteq> Zero; \<forall>x41 x42. One \<noteq> Plus x41 x42; le_rexp One Zero; One \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus One Zero = Plus One Zero
 3. \<And>v. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Atom v); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Atom v \<noteq> Zero; \<forall>x41 x42. Atom v \<noteq> Plus x41 x42; le_rexp (Atom v) Zero; Atom v \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Atom v) Zero = Plus (Atom v) Zero
 4. \<And>v va. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Plus v va); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Plus v va \<noteq> Zero; \<forall>x41 x42. Plus v va \<noteq> Plus x41 x42; le_rexp (Plus v va) Zero; Plus v va \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Plus v va) Zero = Plus (Plus v va) Zero
 5. \<And>v va. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Times v va); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Times v va \<noteq> Zero; \<forall>x41 x42. Times v va \<noteq> Plus x41 x42; le_rexp (Times v va) Zero; Times v va \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Times v va) Zero = Plus (Times v va) Zero
 6. \<And>v. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Star v); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Star v \<noteq> Zero; \<forall>x41 x42. Star v \<noteq> Plus x41 x42; le_rexp (Star v) Zero; Star v \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Star v) Zero = Plus (Star v) Zero
 7. \<And>r s. \<lbrakk>\<lbrakk>One \<noteq> Zero; le_rexp One s; \<forall>x41 x42. One \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; le_rexp s One; s \<noteq> One\<rbrakk> \<Longrightarrow> pnPlus s One = Plus s One; \<lbrakk>pnPlus s One \<noteq> Zero; le_rexp (pnPlus s One) r; \<forall>x41 x42. pnPlus s One \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; le_rexp r (pnPlus s One); r \<noteq> pnPlus s One\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s One) = Plus r (pnPlus s One); One \<noteq> Zero; le_rexp One (Plus r s); \<forall>x41 x42. One \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; le_rexp (Plus r s) One; Plus r s \<noteq> One\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) One = Plus (Plus r s) One
 8. \<And>r s v. \<lbrakk>\<lbrakk>Atom v \<noteq> Zero; le_rexp (Atom v) s; \<forall>x41 x42. Atom v \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; le_rexp s (Atom v); s \<noteq> Atom v\<rbrakk> \<Longrightarrow> pnPlus s (Atom v) = Plus s (Atom v); \<lbrakk>pnPlus s (Atom v) \<noteq> Zero; le_rexp (pnPlus s (Atom v)) r; \<forall>x41 x42. pnPlus s (Atom v) \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; le_rexp r (pnPlus s (Atom v)); r \<noteq> pnPlus s (Atom v)\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s (Atom v)) = Plus r (pnPlus s (Atom v)); Atom v \<noteq> Zero; le_rexp (Atom v) (Plus r s); \<forall>x41 x42. Atom v \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; le_rexp (Plus r s) (Atom v); Plus r s \<noteq> Atom v\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (Atom v) = Plus (Plus r s) (Atom v)
 9. \<And>r s v va. \<lbrakk>\<lbrakk>Plus v va \<noteq> Zero; le_rexp (Plus v va) s; \<forall>x41 x42. Plus v va \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; le_rexp s (Plus v va); s \<noteq> Plus v va\<rbrakk> \<Longrightarrow> pnPlus s (Plus v va) = Plus s (Plus v va); \<lbrakk>pnPlus s (Plus v va) \<noteq> Zero; le_rexp (pnPlus s (Plus v va)) r; \<forall>x41 x42. pnPlus s (Plus v va) \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; le_rexp r (pnPlus s (Plus v va)); r \<noteq> pnPlus s (Plus v va)\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s (Plus v va)) = Plus r (pnPlus s (Plus v va)); Plus v va \<noteq> Zero; le_rexp (Plus v va) (Plus r s); \<forall>x41 x42. Plus v va \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; le_rexp (Plus r s) (Plus v va); Plus r s \<noteq> Plus v va\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (Plus v va) = Plus (Plus r s) (Plus v va)
 10. \<And>r s v va. \<lbrakk>\<lbrakk>Times v va \<noteq> Zero; le_rexp (Times v va) s; \<forall>x41 x42. Times v va \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; le_rexp s (Times v va); s \<noteq> Times v va\<rbrakk> \<Longrightarrow> pnPlus s (Times v va) = Plus s (Times v va); \<lbrakk>pnPlus s (Times v va) \<noteq> Zero; le_rexp (pnPlus s (Times v va)) r; \<forall>x41 x42. pnPlus s (Times v va) \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; le_rexp r (pnPlus s (Times v va)); r \<noteq> pnPlus s (Times v va)\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s (Times v va)) = Plus r (pnPlus s (Times v va)); Times v va \<noteq> Zero; le_rexp (Times v va) (Plus r s); \<forall>x41 x42. Times v va \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; le_rexp (Plus r s) (Times v va); Plus r s \<noteq> Times v va\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (Times v va) = Plus (Plus r s) (Times v va)
A total of 32 subgoals...
[PROOF STEP]
apply (auto simp: less_rexp_def less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<noteq> Zero; le_rexp y x; \<forall>x41 x42. y \<noteq> Plus x41 x42; x \<noteq> Zero; \<forall>x41 x42. x \<noteq> Plus x41 x42; \<not> le_rexp x y; x \<noteq> y\<rbrakk> \<Longrightarrow> pnPlus x y = Plus y x
[PROOF STEP]
apply (induct x y rule: pnPlus.induct)
[PROOF STATE]
proof (prove)
goal (31 subgoals):
 1. \<And>r. \<lbrakk>r \<noteq> Zero; le_rexp r Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; Zero \<noteq> Zero; \<forall>x41 x42. Zero \<noteq> Plus x41 x42; \<not> le_rexp Zero r; Zero \<noteq> r\<rbrakk> \<Longrightarrow> pnPlus Zero r = Plus r Zero
 2. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero One; \<forall>x41 x42. Zero \<noteq> Plus x41 x42; One \<noteq> Zero; \<forall>x41 x42. One \<noteq> Plus x41 x42; \<not> le_rexp One Zero; One \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus One Zero = Plus Zero One
 3. \<And>v. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Atom v); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Atom v \<noteq> Zero; \<forall>x41 x42. Atom v \<noteq> Plus x41 x42; \<not> le_rexp (Atom v) Zero; Atom v \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Atom v) Zero = Plus Zero (Atom v)
 4. \<And>v va. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Plus v va); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Plus v va \<noteq> Zero; \<forall>x41 x42. Plus v va \<noteq> Plus x41 x42; \<not> le_rexp (Plus v va) Zero; Plus v va \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Plus v va) Zero = Plus Zero (Plus v va)
 5. \<And>v va. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Times v va); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Times v va \<noteq> Zero; \<forall>x41 x42. Times v va \<noteq> Plus x41 x42; \<not> le_rexp (Times v va) Zero; Times v va \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Times v va) Zero = Plus Zero (Times v va)
 6. \<And>v. \<lbrakk>Zero \<noteq> Zero; le_rexp Zero (Star v); \<forall>x41 x42. Zero \<noteq> Plus x41 x42; Star v \<noteq> Zero; \<forall>x41 x42. Star v \<noteq> Plus x41 x42; \<not> le_rexp (Star v) Zero; Star v \<noteq> Zero\<rbrakk> \<Longrightarrow> pnPlus (Star v) Zero = Plus Zero (Star v)
 7. \<And>r s. \<lbrakk>\<lbrakk>One \<noteq> Zero; le_rexp One s; \<forall>x41 x42. One \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; \<not> le_rexp s One; s \<noteq> One\<rbrakk> \<Longrightarrow> pnPlus s One = Plus One s; \<lbrakk>pnPlus s One \<noteq> Zero; le_rexp (pnPlus s One) r; \<forall>x41 x42. pnPlus s One \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; \<not> le_rexp r (pnPlus s One); r \<noteq> pnPlus s One\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s One) = Plus (pnPlus s One) r; One \<noteq> Zero; le_rexp One (Plus r s); \<forall>x41 x42. One \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; \<not> le_rexp (Plus r s) One; Plus r s \<noteq> One\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) One = Plus One (Plus r s)
 8. \<And>r s v. \<lbrakk>\<lbrakk>Atom v \<noteq> Zero; le_rexp (Atom v) s; \<forall>x41 x42. Atom v \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; \<not> le_rexp s (Atom v); s \<noteq> Atom v\<rbrakk> \<Longrightarrow> pnPlus s (Atom v) = Plus (Atom v) s; \<lbrakk>pnPlus s (Atom v) \<noteq> Zero; le_rexp (pnPlus s (Atom v)) r; \<forall>x41 x42. pnPlus s (Atom v) \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; \<not> le_rexp r (pnPlus s (Atom v)); r \<noteq> pnPlus s (Atom v)\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s (Atom v)) = Plus (pnPlus s (Atom v)) r; Atom v \<noteq> Zero; le_rexp (Atom v) (Plus r s); \<forall>x41 x42. Atom v \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; \<not> le_rexp (Plus r s) (Atom v); Plus r s \<noteq> Atom v\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (Atom v) = Plus (Atom v) (Plus r s)
 9. \<And>r s v va. \<lbrakk>\<lbrakk>Plus v va \<noteq> Zero; le_rexp (Plus v va) s; \<forall>x41 x42. Plus v va \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; \<not> le_rexp s (Plus v va); s \<noteq> Plus v va\<rbrakk> \<Longrightarrow> pnPlus s (Plus v va) = Plus (Plus v va) s; \<lbrakk>pnPlus s (Plus v va) \<noteq> Zero; le_rexp (pnPlus s (Plus v va)) r; \<forall>x41 x42. pnPlus s (Plus v va) \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; \<not> le_rexp r (pnPlus s (Plus v va)); r \<noteq> pnPlus s (Plus v va)\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s (Plus v va)) = Plus (pnPlus s (Plus v va)) r; Plus v va \<noteq> Zero; le_rexp (Plus v va) (Plus r s); \<forall>x41 x42. Plus v va \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; \<not> le_rexp (Plus r s) (Plus v va); Plus r s \<noteq> Plus v va\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (Plus v va) = Plus (Plus v va) (Plus r s)
 10. \<And>r s v va. \<lbrakk>\<lbrakk>Times v va \<noteq> Zero; le_rexp (Times v va) s; \<forall>x41 x42. Times v va \<noteq> Plus x41 x42; s \<noteq> Zero; \<forall>x41 x42. s \<noteq> Plus x41 x42; \<not> le_rexp s (Times v va); s \<noteq> Times v va\<rbrakk> \<Longrightarrow> pnPlus s (Times v va) = Plus (Times v va) s; \<lbrakk>pnPlus s (Times v va) \<noteq> Zero; le_rexp (pnPlus s (Times v va)) r; \<forall>x41 x42. pnPlus s (Times v va) \<noteq> Plus x41 x42; r \<noteq> Zero; \<forall>x41 x42. r \<noteq> Plus x41 x42; \<not> le_rexp r (pnPlus s (Times v va)); r \<noteq> pnPlus s (Times v va)\<rbrakk> \<Longrightarrow> pnPlus r (pnPlus s (Times v va)) = Plus (pnPlus s (Times v va)) r; Times v va \<noteq> Zero; le_rexp (Times v va) (Plus r s); \<forall>x41 x42. Times v va \<noteq> Plus x41 x42; Plus r s \<noteq> Zero; \<forall>x41 x42. Plus r s \<noteq> Plus x41 x42; \<not> le_rexp (Plus r s) (Times v va); Plus r s \<noteq> Times v va\<rbrakk> \<Longrightarrow> pnPlus (Plus r s) (Times v va) = Plus (Times v va) (Plus r s)
A total of 31 subgoals...
[PROOF STEP]
apply (auto simp: less_rexp_def less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
pnPlus x (PLUS [y]) = (if x \<in> set [y] then PLUS [y] else PLUS (insort x [y]))

goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []; distinct []; \<forall>x\<in>{x} \<union> set []. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS []) = (if x \<in> set [] then PLUS [] else PLUS (insort x []))
 2. \<And>xa y xs. \<lbrakk>\<lbrakk>y # xs \<noteq> []; sorted (y # xs); distinct (y # xs); \<forall>x\<in>{x} \<union> set (y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y # xs)) = (if x \<in> set (y # xs) then PLUS (y # xs) else PLUS (insort x (y # xs))); xa # y # xs \<noteq> []; sorted (xa # y # xs); distinct (xa # y # xs); \<forall>x\<in>{x} \<union> set (xa # y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (xa # y # xs)) = (if x \<in> set (xa # y # xs) then PLUS (xa # y # xs) else PLUS (insort x (xa # y # xs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []; distinct []; \<forall>x\<in>{x} \<union> set []. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS []) = (if x \<in> set [] then PLUS [] else PLUS (insort x []))
 2. \<And>xa y xs. \<lbrakk>\<lbrakk>y # xs \<noteq> []; sorted (y # xs); distinct (y # xs); \<forall>x\<in>{x} \<union> set (y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y # xs)) = (if x \<in> set (y # xs) then PLUS (y # xs) else PLUS (insort x (y # xs))); xa # y # xs \<noteq> []; sorted (xa # y # xs); distinct (xa # y # xs); \<forall>x\<in>{x} \<union> set (xa # y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (xa # y # xs)) = (if x \<in> set (xa # y # xs) then PLUS (xa # y # xs) else PLUS (insort x (xa # y # xs)))
[PROOF STEP]
case (cons y1 y2 ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys)))
y1 # y2 # ys \<noteq> []
sorted (y1 # y2 # ys)
distinct (y1 # y2 # ys)
\<forall>x\<in>{x} \<union> set (y1 # y2 # ys). \<not> is_Zero x \<and> \<not> is_Plus x

goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []; distinct []; \<forall>x\<in>{x} \<union> set []. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS []) = (if x \<in> set [] then PLUS [] else PLUS (insort x []))
 2. \<And>xa y xs. \<lbrakk>\<lbrakk>y # xs \<noteq> []; sorted (y # xs); distinct (y # xs); \<forall>x\<in>{x} \<union> set (y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y # xs)) = (if x \<in> set (y # xs) then PLUS (y # xs) else PLUS (insort x (y # xs))); xa # y # xs \<noteq> []; sorted (xa # y # xs); distinct (xa # y # xs); \<forall>x\<in>{x} \<union> set (xa # y # xs). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (xa # y # xs)) = (if x \<in> set (xa # y # xs) then PLUS (xa # y # xs) else PLUS (insort x (xa # y # xs)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys)))
y1 # y2 # ys \<noteq> []
sorted (y1 # y2 # ys)
distinct (y1 # y2 # ys)
\<forall>x\<in>{x} \<union> set (y1 # y2 # ys). \<not> is_Zero x \<and> \<not> is_Plus x

goal (1 subgoal):
 1. pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
unfolding is_Zero_def is_Plus_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys)))
y1 # y2 # ys \<noteq> []
sorted (y1 # y2 # ys)
distinct (y1 # y2 # ys)
\<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)

goal (1 subgoal):
 1. pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply (cases x)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Zero\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 2. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = One\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 3. \<And>x3. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Atom x3\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 4. \<And>x41 x42. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 5. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 6. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply (metis UnCI insertI1)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = One\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 2. \<And>x3. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Atom x3\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 3. \<And>x41 x42. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 4. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 5. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>pnPlus One (PLUS (y2 # ys)) = (if One = y2 \<or> One \<in> set ys then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 \<le> y2 \<and> (\<forall>x\<in>set ys. y1 \<le> x) \<and> (\<forall>x\<in>set ys. y2 \<le> x) \<and> sorted ys; y1 \<noteq> y2 \<and> y1 \<notin> set ys \<and> y2 \<notin> set ys \<and> distinct ys; y1 \<noteq> Zero \<and> (\<forall>x41 x42. y1 \<noteq> Plus x41 x42) \<and> y2 \<noteq> Zero \<and> (\<forall>x41 x42. y2 \<noteq> Plus x41 x42) \<and> (\<forall>x\<in>set ys. x \<noteq> Zero \<and> (\<forall>x41 x42. x \<noteq> Plus x41 x42)); x = One\<rbrakk> \<Longrightarrow> (One \<le> y1 \<longrightarrow> (le_rexp One y1 \<longrightarrow> One \<noteq> y1 \<longrightarrow> One \<noteq> y2 \<and> One \<notin> set ys) \<and> (\<not> le_rexp One y1 \<longrightarrow> One \<noteq> y1 \<longrightarrow> (One = y2 \<longrightarrow> pnPlus One (PLUS (One # ys)) = PLUS (One # ys)) \<and> (One = y2 \<or> One \<in> set ys))) \<and> (\<not> One \<le> y1 \<longrightarrow> (le_rexp One y1 \<longrightarrow> One \<noteq> y1 \<longrightarrow> One \<noteq> y2 \<and> One \<notin> set ys \<and> (One = y2 \<or> One \<in> set ys)) \<and> (\<not> le_rexp One y1 \<longrightarrow> One \<noteq> y1 \<longrightarrow> One = y2 \<longrightarrow> pnPlus One (PLUS (One # ys)) = PLUS (One # ys)))
 2. \<And>x3. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Atom x3\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 3. \<And>x41 x42. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 4. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 5. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply (metis antisym less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x3. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Atom x3\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 2. \<And>x41 x42. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 3. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 4. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x3. \<lbrakk>pnPlus (Atom x3) (PLUS (y2 # ys)) = (if Atom x3 = y2 \<or> Atom x3 \<in> set ys then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 \<le> y2 \<and> (\<forall>x\<in>set ys. y1 \<le> x) \<and> (\<forall>x\<in>set ys. y2 \<le> x) \<and> sorted ys; y1 \<noteq> y2 \<and> y1 \<notin> set ys \<and> y2 \<notin> set ys \<and> distinct ys; y1 \<noteq> Zero \<and> (\<forall>x41 x42. y1 \<noteq> Plus x41 x42) \<and> y2 \<noteq> Zero \<and> (\<forall>x41 x42. y2 \<noteq> Plus x41 x42) \<and> (\<forall>x\<in>set ys. x \<noteq> Zero \<and> (\<forall>x41 x42. x \<noteq> Plus x41 x42)); x = Atom x3\<rbrakk> \<Longrightarrow> (Atom x3 \<le> y1 \<longrightarrow> Atom x3 \<noteq> y1 \<longrightarrow> (le_rexp (Atom x3) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> Atom x3 \<notin> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> Atom x3 \<noteq> y2 \<and> Atom x3 \<notin> set ys)) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> Atom x3 \<notin> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> (Atom x3 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> Atom x3 \<notin> set ys))) \<and> (\<not> le_rexp (Atom x3) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Atom x3 \<in> set ys \<longrightarrow> pnPlus (Atom x3) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> Atom x3 \<in> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> Atom x3 \<noteq> y2 \<and> (Atom x3 = y2 \<or> Atom x3 \<in> set ys))) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Atom x3 \<in> set ys \<longrightarrow> pnPlus (Atom x3) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> Atom x3 \<in> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> (Atom x3 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> (Atom x3 = y2 \<or> Atom x3 \<in> set ys))))) \<and> (\<not> Atom x3 \<le> y1 \<longrightarrow> Atom x3 \<noteq> y1 \<longrightarrow> (le_rexp (Atom x3) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> y2 \<noteq> y1 \<and> (y2 \<noteq> y1 \<longrightarrow> Atom x3 \<noteq> y2 \<and> Atom x3 \<notin> set ys \<and> (Atom x3 = y2 \<or> Atom x3 \<in> set ys))) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> y2 \<noteq> y1 \<and> (y2 \<noteq> y1 \<longrightarrow> (Atom x3 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> Atom x3 \<notin> set ys \<and> (Atom x3 = y2 \<or> Atom x3 \<in> set ys)))) \<and> (\<not> le_rexp (Atom x3) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Atom x3 \<in> set ys \<longrightarrow> pnPlus (Atom x3) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> (Atom x3 \<notin> set ys \<longrightarrow> pnPlus (Atom x3) (PLUS (y1 # ys)) = PLUS (y1 # insort (Atom x3) ys))) \<and> (y2 \<noteq> y1 \<longrightarrow> Atom x3 \<noteq> y2)) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Atom x3 \<in> set ys \<longrightarrow> pnPlus (Atom x3) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> (Atom x3 \<notin> set ys \<longrightarrow> pnPlus (Atom x3) (PLUS (y1 # ys)) = PLUS (y1 # insort (Atom x3) ys))) \<and> (y2 \<noteq> y1 \<longrightarrow> Atom x3 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)))))
 2. \<And>x41 x42. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 3. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 4. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply (metis antisym less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x41 x42. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Plus x41 x42\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 2. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 3. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply (metis UnCI insertI1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x51 x52. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Times x51 x52\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
 2. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x51 x52. \<lbrakk>pnPlus (Times x51 x52) (PLUS (y2 # ys)) = (if Times x51 x52 = y2 \<or> Times x51 x52 \<in> set ys then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 \<le> y2 \<and> (\<forall>x\<in>set ys. y1 \<le> x) \<and> (\<forall>x\<in>set ys. y2 \<le> x) \<and> sorted ys; y1 \<noteq> y2 \<and> y1 \<notin> set ys \<and> y2 \<notin> set ys \<and> distinct ys; y1 \<noteq> Zero \<and> (\<forall>x41 x42. y1 \<noteq> Plus x41 x42) \<and> y2 \<noteq> Zero \<and> (\<forall>x41 x42. y2 \<noteq> Plus x41 x42) \<and> (\<forall>x\<in>set ys. x \<noteq> Zero \<and> (\<forall>x41 x42. x \<noteq> Plus x41 x42)); x = Times x51 x52\<rbrakk> \<Longrightarrow> (Times x51 x52 \<le> y1 \<longrightarrow> Times x51 x52 \<noteq> y1 \<longrightarrow> (le_rexp (Times x51 x52) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> Times x51 x52 \<notin> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> Times x51 x52 \<noteq> y2 \<and> Times x51 x52 \<notin> set ys)) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> Times x51 x52 \<notin> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> (Times x51 x52 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> Times x51 x52 \<notin> set ys))) \<and> (\<not> le_rexp (Times x51 x52) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Times x51 x52 \<in> set ys \<longrightarrow> pnPlus (Times x51 x52) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> Times x51 x52 \<in> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> Times x51 x52 \<noteq> y2 \<and> (Times x51 x52 = y2 \<or> Times x51 x52 \<in> set ys))) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Times x51 x52 \<in> set ys \<longrightarrow> pnPlus (Times x51 x52) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> Times x51 x52 \<in> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> (Times x51 x52 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> (Times x51 x52 = y2 \<or> Times x51 x52 \<in> set ys))))) \<and> (\<not> Times x51 x52 \<le> y1 \<longrightarrow> Times x51 x52 \<noteq> y1 \<longrightarrow> (le_rexp (Times x51 x52) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> y2 \<noteq> y1 \<and> (y2 \<noteq> y1 \<longrightarrow> Times x51 x52 \<noteq> y2 \<and> Times x51 x52 \<notin> set ys \<and> (Times x51 x52 = y2 \<or> Times x51 x52 \<in> set ys))) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> y2 \<noteq> y1 \<and> (y2 \<noteq> y1 \<longrightarrow> (Times x51 x52 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> Times x51 x52 \<notin> set ys \<and> (Times x51 x52 = y2 \<or> Times x51 x52 \<in> set ys)))) \<and> (\<not> le_rexp (Times x51 x52) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Times x51 x52 \<in> set ys \<longrightarrow> pnPlus (Times x51 x52) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> (Times x51 x52 \<notin> set ys \<longrightarrow> pnPlus (Times x51 x52) (PLUS (y1 # ys)) = PLUS (y1 # insort (Times x51 x52) ys))) \<and> (y2 \<noteq> y1 \<longrightarrow> Times x51 x52 \<noteq> y2)) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Times x51 x52 \<in> set ys \<longrightarrow> pnPlus (Times x51 x52) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> (Times x51 x52 \<notin> set ys \<longrightarrow> pnPlus (Times x51 x52) (PLUS (y1 # ys)) = PLUS (y1 # insort (Times x51 x52) ys))) \<and> (y2 \<noteq> y1 \<longrightarrow> Times x51 x52 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)))))
 2. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply (metis antisym less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x6. \<lbrakk>\<lbrakk>y2 # ys \<noteq> []; sorted (y2 # ys); distinct (y2 # ys); \<forall>x\<in>{x} \<union> set (y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42)\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y2 # ys)) = (if x \<in> set (y2 # ys) then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 # y2 # ys \<noteq> []; sorted (y1 # y2 # ys); distinct (y1 # y2 # ys); \<forall>x\<in>{x} \<union> set (y1 # y2 # ys). x \<noteq> Zero \<and> (\<nexists>x41 x42. x = Plus x41 x42); x = Star x6\<rbrakk> \<Longrightarrow> pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x6. \<lbrakk>pnPlus (Star x6) (PLUS (y2 # ys)) = (if Star x6 = y2 \<or> Star x6 \<in> set ys then PLUS (y2 # ys) else PLUS (insort x (y2 # ys))); y1 \<le> y2 \<and> (\<forall>x\<in>set ys. y1 \<le> x) \<and> (\<forall>x\<in>set ys. y2 \<le> x) \<and> sorted ys; y1 \<noteq> y2 \<and> y1 \<notin> set ys \<and> y2 \<notin> set ys \<and> distinct ys; y1 \<noteq> Zero \<and> (\<forall>x41 x42. y1 \<noteq> Plus x41 x42) \<and> y2 \<noteq> Zero \<and> (\<forall>x41 x42. y2 \<noteq> Plus x41 x42) \<and> (\<forall>x\<in>set ys. x \<noteq> Zero \<and> (\<forall>x41 x42. x \<noteq> Plus x41 x42)); x = Star x6\<rbrakk> \<Longrightarrow> (Star x6 \<le> y1 \<longrightarrow> Star x6 \<noteq> y1 \<longrightarrow> (le_rexp (Star x6) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> Star x6 \<notin> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> Star x6 \<noteq> y2 \<and> Star x6 \<notin> set ys)) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> Star x6 \<notin> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> (Star x6 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> Star x6 \<notin> set ys))) \<and> (\<not> le_rexp (Star x6) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Star x6 \<in> set ys \<longrightarrow> pnPlus (Star x6) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> Star x6 \<in> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> Star x6 \<noteq> y2 \<and> (Star x6 = y2 \<or> Star x6 \<in> set ys))) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Star x6 \<in> set ys \<longrightarrow> pnPlus (Star x6) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> Star x6 \<in> set ys) \<and> (y2 \<noteq> y1 \<longrightarrow> (Star x6 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> (Star x6 = y2 \<or> Star x6 \<in> set ys))))) \<and> (\<not> Star x6 \<le> y1 \<longrightarrow> Star x6 \<noteq> y1 \<longrightarrow> (le_rexp (Star x6) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> y2 \<noteq> y1 \<and> (y2 \<noteq> y1 \<longrightarrow> Star x6 \<noteq> y2 \<and> Star x6 \<notin> set ys \<and> (Star x6 = y2 \<or> Star x6 \<in> set ys))) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> y2 \<noteq> y1 \<and> (y2 \<noteq> y1 \<longrightarrow> (Star x6 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)) \<and> Star x6 \<notin> set ys \<and> (Star x6 = y2 \<or> Star x6 \<in> set ys)))) \<and> (\<not> le_rexp (Star x6) y1 \<longrightarrow> (le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Star x6 \<in> set ys \<longrightarrow> pnPlus (Star x6) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> (Star x6 \<notin> set ys \<longrightarrow> pnPlus (Star x6) (PLUS (y1 # ys)) = PLUS (y1 # insort (Star x6) ys))) \<and> (y2 \<noteq> y1 \<longrightarrow> Star x6 \<noteq> y2)) \<and> (\<not> le_rexp y2 y1 \<longrightarrow> (y2 = y1 \<longrightarrow> (Star x6 \<in> set ys \<longrightarrow> pnPlus (Star x6) (PLUS (y1 # ys)) = PLUS (y1 # ys)) \<and> (Star x6 \<notin> set ys \<longrightarrow> pnPlus (Star x6) (PLUS (y1 # ys)) = PLUS (y1 # insort (Star x6) ys))) \<and> (y2 \<noteq> y1 \<longrightarrow> Star x6 = y2 \<longrightarrow> pnPlus y2 (PLUS (y2 # ys)) = PLUS (y2 # ys)))))
[PROOF STEP]
apply (metis antisym less_eq_rexp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
pnPlus x (PLUS (y1 # y2 # ys)) = (if x \<in> set (y1 # y2 # ys) then PLUS (y1 # y2 # ys) else PLUS (insort x (y1 # y2 # ys)))

goal (1 subgoal):
 1. \<lbrakk>[] \<noteq> []; sorted []; distinct []; \<forall>x\<in>{x} \<union> set []. \<not> is_Zero x \<and> \<not> is_Plus x\<rbrakk> \<Longrightarrow> pnPlus x (PLUS []) = (if x \<in> set [] then PLUS [] else PLUS (insort x []))
[PROOF STEP]
qed simp


[STATEMENT]
lemma euclid:
  "PRE (\<lambda>s::nat store. s ''x'' = x \<and> s ''y'' = y)
   (WHILE (\<lambda>s. s ''y'' \<noteq> 0) INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
    DO
     (''z'' ::= (\<lambda>s. s ''y''));
     (''y'' ::= (\<lambda>s. s ''x'' mod s ''y''));
     (''x'' ::= (\<lambda>s. s ''z''))
    OD)
   POST (\<lambda>s. s ''x'' = gcd x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PRE (\<lambda>s. s ''x'' = x \<and> s ''y'' = y) (WHILE (\<lambda>s. s ''y'' \<noteq> 0) INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) DO (''z'' ::= (\<lambda>s. s ''y'')) ; (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ; (''x'' ::= (\<lambda>s. s ''z'')) OD) POST (\<lambda>s. s ''x'' = gcd x y)
[PROOF STEP]
apply (rule sH_while_inv)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>s. s ''x'' = x \<and> s ''y'' = y \<longrightarrow> gcd (s ''x'') (s ''y'') = gcd x y
 2. \<forall>s. gcd (s ''x'') (s ''y'') = gcd x y \<and> \<not> s ''y'' \<noteq> 0 \<longrightarrow> s ''x'' = gcd x y
 3. PRE (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. s ''y'' \<noteq> 0) (''z'' ::= (\<lambda>s. s ''y'')) ; (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ; (''x'' ::= (\<lambda>s. s ''z'')) POST (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>s. gcd (s ''x'') (s ''y'') = gcd x y \<and> s ''y'' = 0 \<longrightarrow> s ''x'' = gcd x y
 2. PRE (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. 0 < s ''y'') (''z'' ::= (\<lambda>s. s ''y'')) ; (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ; (''x'' ::= (\<lambda>s. s ''z'')) POST (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PRE (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. 0 < s ''y'') (''z'' ::= (\<lambda>s. s ''y'')) ; (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ; (''x'' ::= (\<lambda>s. s ''z'')) POST (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
[PROOF STEP]
apply (intro rel_kat.H_seq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. rel_kat.H ?r9 (''x'' ::= (\<lambda>s. s ''z'')) \<lceil>\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y\<rceil>
 2. rel_kat.H ?r10 (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ?r9
 3. rel_kat.H \<lceil>(\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. 0 < s ''y'')\<rceil> (''z'' ::= (\<lambda>s. s ''y'')) ?r10
[PROOF STEP]
apply (subst H_assign, simp)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PRE (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. 0 < s ''y'') (''z'' ::= (\<lambda>s. s ''y'')) POST (\<lambda>s. gcd ((s(''y'' := s ''x'' mod s ''y'', ''x'' := (s(''y'' := s ''x'' mod s ''y'')) ''z'')) ''x'') ((s(''y'' := s ''x'' mod s ''y'', ''x'' := (s(''y'' := s ''x'' mod s ''y'')) ''z'')) ''y'') = gcd x y)
[PROOF STEP]
apply (intro H_assign_var)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s. ((\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. 0 < s ''y'')) s \<longrightarrow> gcd ((s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'', ''x'' := (s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'')) ''z'')) ''x'') ((s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'', ''x'' := (s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'')) ''z'')) ''y'') = gcd x y
[PROOF STEP]
using gcd_red_nat
[PROOF STATE]
proof (prove)
using this:
gcd ?x ?y = gcd ?y (?x mod ?y)

goal (1 subgoal):
 1. \<forall>s. ((\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) \<sqinter> (\<lambda>s. 0 < s ''y'')) s \<longrightarrow> gcd ((s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'', ''x'' := (s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'')) ''z'')) ''x'') ((s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'', ''x'' := (s(''z'' := s ''y'', ''y'' := (s(''z'' := s ''y'')) ''x'' mod (s(''z'' := s ''y'')) ''y'')) ''z'')) ''y'') = gcd x y
[PROOF STEP]
by auto


[STATEMENT]
lemma setsum_eq_zero [simp]:
  fixes f::"nat \<Rightarrow> nat"
  shows "(\<Sum>i < n. f i) = 0 \<longleftrightarrow> (\<forall>i < n. f i = 0)"
    "(\<Sum>i \<le> n. f i) = 0 \<longleftrightarrow> (\<forall>i \<le> n. f i = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum f {..<n} = 0) = (\<forall>i<n. f i = 0) &&& (sum f {..n} = 0) = (\<forall>i\<le>n. f i = 0)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma log_nat_power: "0 < x \<Longrightarrow> log b (x^n) = real n * log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> log b (x ^ n) = real n * log b x
[PROOF STEP]
by (simp add: log_powr powr_realpow [symmetric])


[STATEMENT]
lemma pow_generator_mod: "\<^bold>g [^] (k mod order G) = \<^bold>g [^] k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
proof(cases "order G > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
 2. \<not> 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < order G

goal (2 subgoals):
 1. 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
 2. \<not> 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
obtain n where n: "k = n * order G + k mod order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. k = n * order G + k mod order G \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis div_mult_mod_eq)
[PROOF STATE]
proof (state)
this:
k = n * order G + k mod order G

goal (2 subgoals):
 1. 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
 2. \<not> 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
have "\<^bold>g [^] k = (\<^bold>g [^] order G) [^] n \<otimes> \<^bold>g [^] (k mod order G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] k = (\<^bold>g [^] order G) [^] n \<otimes> \<^bold>g [^] (k mod order G)
[PROOF STEP]
by(subst n)(simp add: nat_pow_mult nat_pow_pow mult_ac)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] k = (\<^bold>g [^] order G) [^] n \<otimes> \<^bold>g [^] (k mod order G)

goal (2 subgoals):
 1. 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
 2. \<not> 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] k = (\<^bold>g [^] order G) [^] n \<otimes> \<^bold>g [^] (k mod order G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] k = (\<^bold>g [^] order G) [^] n \<otimes> \<^bold>g [^] (k mod order G)

goal (1 subgoal):
 1. \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
by(simp add: generator_pow_order)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (k mod order G) = \<^bold>g [^] k

goal (1 subgoal):
 1. \<not> 0 < order G \<Longrightarrow> \<^bold>g [^] (k mod order G) = \<^bold>g [^] k
[PROOF STEP]
qed simp


[STATEMENT]
lemma subspace_special_hyperplane: "subspace {x. x $ k = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace {x. x $ k = (0::'a)}
[PROOF STEP]
by (simp add: subspace_def)


[STATEMENT]
lemma unat_shiftr_le_bound:
  "\<lbrakk> 2 ^ (LENGTH('a :: len) - n) - 1 \<le> bnd; 0 < n \<rbrakk>
   \<Longrightarrow> unat ((x :: 'a word) >> n) \<le> bnd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>2 ^ (LENGTH('a) - n) - 1 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> unat (x >> n) \<le> bnd
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - 1 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> (nat \<circ> take_bit LENGTH('a)) (drop_bit n (take_bit LENGTH('a) x)) \<le> bnd
[PROOF STEP]
apply (simp add: take_bit_drop_bit)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> nat (drop_bit n (take_bit LENGTH('a) x)) \<le> bnd
[PROOF STEP]
apply (simp add: drop_bit_take_bit)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> nat (take_bit (LENGTH('a) - n) (drop_bit n x)) \<le> bnd
[PROOF STEP]
apply (rule order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> nat (take_bit (LENGTH('a) - n) (drop_bit n x)) \<le> ?y185 n bnd x
 2. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> ?y185 n bnd x \<le> bnd
[PROOF STEP]
defer
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> ?y185 n bnd x \<le> bnd
 2. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> nat (take_bit (LENGTH('a) - n) (drop_bit n x)) \<le> ?y185 n bnd x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n bnd x. \<lbrakk>2 ^ (LENGTH('a) - n) - Suc 0 \<le> bnd; 0 < n\<rbrakk> \<Longrightarrow> nat (take_bit (LENGTH('a) - n) (drop_bit n x)) \<le> 2 ^ (LENGTH('a) - n) - Suc 0
[PROOF STEP]
apply (simp add: nat_le_iff of_nat_diff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Max_lessThan: "0 < n \<Longrightarrow> Max {..<n} = n - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> Max {..<n} = n - Suc 0
[PROOF STEP]
by (rule Max_equality[OF _ finite_lessThan], simp_all)


[STATEMENT]
lemma euler_liar_cong:
  assumes "[a = b] (mod p)"
  shows "euler_liar a p = euler_liar b p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_liar a p = euler_liar b p
[PROOF STEP]
by (metis assms cong_def euler_witness_mod)


[STATEMENT]
lemma int_of_uint64_minus: "int_of_uint64 (x - y) = (int_of_uint64 x - int_of_uint64 y) mod 18446744073709551616"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_uint64 (x - y) = (int_of_uint64 x - int_of_uint64 y) mod 18446744073709551616
[PROOF STEP]
by (transfer, unfold uint_word_ariths two_64, rule refl)


[STATEMENT]
lemma "x < (y::real) ==> \<not>(x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> x \<noteq> y
[PROOF STEP]
by arith


[STATEMENT]
lemma mask_eqs:
  "(a AND mask n) + b AND mask n = a + b AND mask n"
  "a + (b AND mask n) AND mask n = a + b AND mask n"
  "(a AND mask n) - b AND mask n = a - b AND mask n"
  "a - (b AND mask n) AND mask n = a - b AND mask n"
  "a * (b AND mask n) AND mask n = a * b AND mask n"
  "(b AND mask n) * a AND mask n = b * a AND mask n"
  "(a AND mask n) + (b AND mask n) AND mask n = a + b AND mask n"
  "(a AND mask n) - (b AND mask n) AND mask n = a - b AND mask n"
  "(a AND mask n) * (b AND mask n) AND mask n = a * b AND mask n"
  "- (a AND mask n) AND mask n = - a AND mask n"
  "word_succ (a AND mask n) AND mask n = word_succ a AND mask n"
  "word_pred (a AND mask n) AND mask n = word_pred a AND mask n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((a AND mask n) + b AND mask n = a + b AND mask n &&& a + (b AND mask n) AND mask n = a + b AND mask n &&& (a AND mask n) - b AND mask n = a - b AND mask n) &&& a - (b AND mask n) AND mask n = a - b AND mask n &&& a * (b AND mask n) AND mask n = a * b AND mask n &&& (b AND mask n) * a AND mask n = b * a AND mask n) &&& ((a AND mask n) + (b AND mask n) AND mask n = a + b AND mask n &&& (a AND mask n) - (b AND mask n) AND mask n = a - b AND mask n &&& (a AND mask n) * (b AND mask n) AND mask n = a * b AND mask n) &&& - (a AND mask n) AND mask n = - a AND mask n &&& word_succ (a AND mask n) AND mask n = word_succ a AND mask n &&& word_pred (a AND mask n) AND mask n = word_pred a AND mask n
[PROOF STEP]
using word_of_int_Ex [where x=a] word_of_int_Ex [where x=b]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. a = word_of_int y
\<exists>y. b = word_of_int y

goal (1 subgoal):
 1. (((a AND mask n) + b AND mask n = a + b AND mask n &&& a + (b AND mask n) AND mask n = a + b AND mask n &&& (a AND mask n) - b AND mask n = a - b AND mask n) &&& a - (b AND mask n) AND mask n = a - b AND mask n &&& a * (b AND mask n) AND mask n = a * b AND mask n &&& (b AND mask n) * a AND mask n = b * a AND mask n) &&& ((a AND mask n) + (b AND mask n) AND mask n = a + b AND mask n &&& (a AND mask n) - (b AND mask n) AND mask n = a - b AND mask n &&& (a AND mask n) * (b AND mask n) AND mask n = a * b AND mask n) &&& - (a AND mask n) AND mask n = - a AND mask n &&& word_succ (a AND mask n) AND mask n = word_succ a AND mask n &&& word_pred (a AND mask n) AND mask n = word_pred a AND mask n
[PROOF STEP]
unfolding take_bit_eq_mask [symmetric]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. a = word_of_int y
\<exists>y. b = word_of_int y

goal (1 subgoal):
 1. ((take_bit n (take_bit n a + b) = take_bit n (a + b) &&& take_bit n (a + take_bit n b) = take_bit n (a + b) &&& take_bit n (take_bit n a - b) = take_bit n (a - b)) &&& take_bit n (a - take_bit n b) = take_bit n (a - b) &&& take_bit n (a * take_bit n b) = take_bit n (a * b) &&& take_bit n (take_bit n b * a) = take_bit n (b * a)) &&& (take_bit n (take_bit n a + take_bit n b) = take_bit n (a + b) &&& take_bit n (take_bit n a - take_bit n b) = take_bit n (a - b) &&& take_bit n (take_bit n a * take_bit n b) = take_bit n (a * b)) &&& take_bit n (- take_bit n a) = take_bit n (- a) &&& take_bit n (word_succ (take_bit n a)) = take_bit n (word_succ a) &&& take_bit n (word_pred (take_bit n a)) = take_bit n (word_pred a)
[PROOF STEP]
by (transfer; simp add: take_bit_eq_mod mod_simps)+


[STATEMENT]
lemma even_word_iff [code]:
  \<open>even_word a \<longleftrightarrow> a AND 1 = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even_word a = (a AND 1 = 0)
[PROOF STEP]
by (simp add: and_one_eq even_iff_mod_2_eq_zero even_word_def)


[STATEMENT]
lemma strict_mono_cancel_le:
fixes f :: "'a::linorder \<Rightarrow> 'b::linorder"
shows "strict_mono f \<Longrightarrow> (f x \<le> f y) = (x \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdinalInduct.strict_mono f \<Longrightarrow> (f x \<le> f y) = (x \<le> y)
[PROOF STEP]
apply (auto simp add: order_le_less)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>OrdinalInduct.strict_mono f; x \<noteq> y; f x < f y\<rbrakk> \<Longrightarrow> x < y
 2. \<lbrakk>OrdinalInduct.strict_mono f; x \<noteq> y; f x = f y\<rbrakk> \<Longrightarrow> x < y
 3. \<lbrakk>OrdinalInduct.strict_mono f; f x \<noteq> f y; x < y\<rbrakk> \<Longrightarrow> f x < f y
[PROOF STEP]
apply (simp add: strict_mono_cancel_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>OrdinalInduct.strict_mono f; x \<noteq> y; f x = f y\<rbrakk> \<Longrightarrow> x < y
 2. \<lbrakk>OrdinalInduct.strict_mono f; f x \<noteq> f y; x < y\<rbrakk> \<Longrightarrow> f x < f y
[PROOF STEP]
apply (simp add: strict_mono_cancel_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>OrdinalInduct.strict_mono f; f x \<noteq> f y; x < y\<rbrakk> \<Longrightarrow> f x < f y
[PROOF STEP]
apply (simp add: strict_monoD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done