[STATEMENT]
lemma padic_val_a_inv:
  assumes "prime p"
  assumes "a \<in> carrier (padic_int p)"
  shows "padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
proof(cases "a = \<zero>\<^bsub>padic_int p\<^esub>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
 2. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = \<zero>\<^bsub>padic_int p\<^esub>

goal (2 subgoals):
 1. a = \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
 2. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = \<zero>\<^bsub>padic_int p\<^esub>

goal (1 subgoal):
 1. padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
by (metis abelian_group.a_inv_closed abelian_group.r_neg abelian_groupE(5) assms(1) assms(2) padic_is_abelian_group)
[PROOF STATE]
proof (state)
this:
padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> \<zero>\<^bsub>padic_int p\<^esub>

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
have 0: "\<And> n. (a n) = \<zero>\<^bsub>residue_ring (p^n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) n = \<zero>\<^bsub>residue_ring (p^n)\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. a n = \<zero>\<^bsub>residue_ring (p ^ n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) n = \<zero>\<^bsub>residue_ring (p ^ n)\<^esub>
[PROOF STEP]
using padic_a_inv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?p; ?a \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>padic_int ?p\<^esub> ?a = (\<lambda>n. \<ominus>\<^bsub>residue_ring (?p ^ n)\<^esub> ?a n)

goal (1 subgoal):
 1. \<And>n. a n = \<zero>\<^bsub>residue_ring (p ^ n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) n = \<zero>\<^bsub>residue_ring (p ^ n)\<^esub>
[PROOF STEP]
by (metis (no_types, lifting) assms(1) assms(2) cring.cring_simprules(22) power_0 residue_1_prop residues.cring residues_n)
[PROOF STATE]
proof (state)
this:
a ?n = \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) ?n = \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub>

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
have 1: "\<And> n. (a n) \<noteq> \<zero>\<^bsub>residue_ring (p^n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) n \<noteq> \<zero>\<^bsub>residue_ring (p^n)\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. a n \<noteq> \<zero>\<^bsub>residue_ring (p ^ n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) n \<noteq> \<zero>\<^bsub>residue_ring (p ^ n)\<^esub>
[PROOF STEP]
using padic_a_inv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?p; ?a \<in> carrier (padic_int ?p)\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>padic_int ?p\<^esub> ?a = (\<lambda>n. \<ominus>\<^bsub>residue_ring (?p ^ n)\<^esub> ?a n)

goal (1 subgoal):
 1. \<And>n. a n \<noteq> \<zero>\<^bsub>residue_ring (p ^ n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) n \<noteq> \<zero>\<^bsub>residue_ring (p ^ n)\<^esub>
[PROOF STEP]
by (metis (no_types, lifting) abelian_group.a_inv_closed abelian_group.minus_minus assms(1)
        assms(2) cring.cring_simprules(22) padic_int_simps(5) padic_is_abelian_group padic_set_zero_res
        residues.cring residues_n)
[PROOF STATE]
proof (state)
this:
a ?n \<noteq> \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) ?n \<noteq> \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub>

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
have A:"padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<ge> (padic_val p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
have "\<not> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < (padic_val p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
assume "padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a"
[PROOF STATE]
proof (state)
this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
let ?n = "padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
let ?m = " padic_val p a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
have "(\<ominus>\<^bsub>padic_int p\<^esub> a)  \<noteq> (padic_zero p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus>\<^bsub>padic_int p\<^esub> a \<noteq> padic_zero p
[PROOF STEP]
by (metis False abelian_group.l_neg assms(1) assms(2) padic_add_zero padic_int_simps(2) padic_is_abelian_group)
[PROOF STATE]
proof (state)
this:
\<ominus>\<^bsub>padic_int p\<^esub> a \<noteq> padic_zero p

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<ominus>\<^bsub>padic_int p\<^esub> a \<noteq> padic_zero p
[PROOF STEP]
have P0: "?n \<ge>0"
[PROOF STATE]
proof (prove)
using this:
\<ominus>\<^bsub>padic_int p\<^esub> a \<noteq> padic_zero p

goal (1 subgoal):
 1. 0 \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
by (simp add: padic_val_def)
[PROOF STATE]
proof (state)
this:
0 \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
have P1: "?m \<ge>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> padic_val p a
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>\<^bsub>padic_int p\<^esub>

goal (1 subgoal):
 1. 0 \<le> padic_val p a
[PROOF STEP]
using \<open>0 \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)\<close>
          \<open>padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>\<^bsub>padic_int p\<^esub>
0 \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a

goal (1 subgoal):
 1. 0 \<le> padic_val p a
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 \<le> padic_val p a

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
have "(Suc (nat ?n)) < Suc (nat (padic_val p a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))) < Suc (nat (padic_val p a))
[PROOF STEP]
using P0 P1  \<open>padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
0 \<le> padic_val p a
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a

goal (1 subgoal):
 1. Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))) < Suc (nat (padic_val p a))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))) < Suc (nat (padic_val p a))

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))) < Suc (nat (padic_val p a))
[PROOF STEP]
have "int (Suc (nat ?n)) \<le> (padic_val p a)"
[PROOF STATE]
proof (prove)
using this:
Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))) < Suc (nat (padic_val p a))

goal (1 subgoal):
 1. int (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) \<le> padic_val p a
[PROOF STEP]
using of_nat_less_iff
[PROOF STATE]
proof (prove)
using this:
Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))) < Suc (nat (padic_val p a))
(of_nat ?m < of_nat ?n) = (?m < ?n)

goal (1 subgoal):
 1. int (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) \<le> padic_val p a
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
int (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) \<le> padic_val p a

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) \<le> padic_val p a
[PROOF STEP]
have "a (Suc (nat ?n)) =  \<zero>\<^bsub>residue_ring (p ^ ((Suc (nat ?n))))\<^esub>"
[PROOF STATE]
proof (prove)
using this:
int (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) \<le> padic_val p a

goal (1 subgoal):
 1. a (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
[PROOF STEP]
using assms(1) assms(2) zero_below_val residue_ring_def
[PROOF STATE]
proof (prove)
using this:
int (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) \<le> padic_val p a
prime p
a \<in> carrier (padic_int p)
\<lbrakk>prime ?p; ?x \<in> padic_set ?p; int ?n \<le> padic_val ?p ?x\<rbrakk> \<Longrightarrow> ?x ?n = \<zero>\<^bsub>residue_ring (?p ^ ?n)\<^esub>
\<lbrakk>prime ?p; ?x \<in> padic_set ?p; int ?n \<le> padic_val ?p ?x\<rbrakk> \<Longrightarrow> ?x ?n = 0
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>

goal (1 subgoal):
 1. a (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
[PROOF STEP]
by(auto simp: padic_int_def)
[PROOF STATE]
proof (state)
this:
a (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
[PROOF STEP]
have "(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat ?n)) =  \<zero>\<^bsub>residue_ring (p ^ ((Suc (nat ?n))))\<^esub>"
[PROOF STATE]
proof (prove)
using this:
a (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>

goal (1 subgoal):
 1. (\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
a (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
a ?n = \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) ?n = \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub>

goal (1 subgoal):
 1. (\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>

goal (1 subgoal):
 1. False
[PROOF STEP]
using below_val_zero assms
[PROOF STATE]
proof (prove)
using this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)))) = \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a))))\<^esub>
\<lbrakk>prime ?p; ?x \<in> padic_set ?p; ?x (Suc ?n) \<noteq> \<zero>\<^bsub>residue_ring (?p ^ Suc ?n)\<^esub>\<rbrakk> \<Longrightarrow> padic_val ?p ?x \<le> int ?n
prime p
a \<in> carrier (padic_int p)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis Suc_eq_plus1 \<open>\<ominus>\<^bsub>padic_int p\<^esub> a \<noteq> padic_zero p\<close> abelian_group.a_inv_closed
            padic_int_simps(5) padic_is_abelian_group val_of_nonzero(1))
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a

goal (1 subgoal):
 1. padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) < padic_val p a

goal (1 subgoal):
 1. padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
have B: "padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> (padic_val p a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
let ?n = "nat (padic_val p a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
have "a (Suc ?n) \<noteq> \<zero>\<^bsub>residue_ring (p^(Suc ?n))\<^esub> "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
[PROOF STEP]
using False assms(2) val_of_nonzero(1)
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>\<^bsub>padic_int p\<^esub>
a \<in> carrier (padic_int p)
\<lbrakk>?f \<in> padic_set ?p; ?f \<noteq> padic_zero ?p; prime ?p\<rbrakk> \<Longrightarrow> ?f (nat (padic_val ?p ?f) + 1) \<noteq> \<zero>\<^bsub>residue_ring (?p ^ (nat (padic_val ?p ?f) + 1))\<^esub>

goal (1 subgoal):
 1. a (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
[PROOF STEP]
by (metis padic_int_simps(2,5) Suc_eq_plus1 assms(1))
[PROOF STATE]
proof (state)
this:
a (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
[PROOF STEP]
have "(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc ?n) \<noteq> \<zero>\<^bsub>residue_ring (p^(Suc ?n))\<^esub> "
[PROOF STATE]
proof (prove)
using this:
a (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>

goal (1 subgoal):
 1. (\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
a (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
a ?n \<noteq> \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub> \<Longrightarrow> (\<ominus>\<^bsub>padic_int p\<^esub> a) ?n \<noteq> \<zero>\<^bsub>residue_ring (p ^ ?n)\<^esub>

goal (1 subgoal):
 1. (\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
[PROOF STEP]
have  "padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int ?n"
[PROOF STATE]
proof (prove)
using this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int (nat (padic_val p a))
[PROOF STEP]
using assms(1) assms(2) below_val_zero
[PROOF STATE]
proof (prove)
using this:
(\<ominus>\<^bsub>padic_int p\<^esub> a) (Suc (nat (padic_val p a))) \<noteq> \<zero>\<^bsub>residue_ring (p ^ Suc (nat (padic_val p a)))\<^esub>
prime p
a \<in> carrier (padic_int p)
\<lbrakk>prime ?p; ?x \<in> padic_set ?p; ?x (Suc ?n) \<noteq> \<zero>\<^bsub>residue_ring (?p ^ Suc ?n)\<^esub>\<rbrakk> \<Longrightarrow> padic_val ?p ?x \<le> int ?n

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int (nat (padic_val p a))
[PROOF STEP]
by (metis padic_int_simps(5) abelian_group.a_inv_closed padic_is_abelian_group)
[PROOF STATE]
proof (state)
this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int (nat (padic_val p a))

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int (nat (padic_val p a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int (nat (padic_val p a))

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
using False padic_val_def padic_int_simps
[PROOF STATE]
proof (prove)
using this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> int (nat (padic_val p a))
a \<noteq> \<zero>\<^bsub>padic_int p\<^esub>
padic_val ?p ?f \<equiv> if ?f = padic_zero ?p then - 1 else int (LEAST k. ?f (Suc k) \<noteq> \<zero>\<^bsub>residue_ring (?p ^ Suc k)\<^esub>)
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p
(\<oplus>\<^bsub>padic_int ?p\<^esub>) = padic_add ?p
(\<otimes>\<^bsub>padic_int ?p\<^esub>) = padic_mult ?p
carrier (padic_int ?p) = padic_set ?p

goal (1 subgoal):
 1. padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a

goal (1 subgoal):
 1. a \<noteq> \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a

goal (1 subgoal):
 1. padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a
padic_val p a \<le> padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a) \<le> padic_val p a

goal (1 subgoal):
 1. padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
padic_val p a = padic_val p (\<ominus>\<^bsub>padic_int p\<^esub> a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_minus: "summable f \<Longrightarrow> (\<Sum>n. - f n) = - (\<Sum>n. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<Sum>n. - f n) = - (\<Sum>n. f n)
[PROOF STEP]
by (intro sums_unique [symmetric] sums_minus summable_sums)


[STATEMENT]
lemma map_index_cong:
  "\<forall>p < length xs. f p (xs ! p) = g p (xs ! p) \<Longrightarrow> map_index f xs = map_index g xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p<length xs. f p (xs ! p) = g p (xs ! p) \<Longrightarrow> map_index f xs = map_index g xs
[PROOF STEP]
unfolding map_index
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p<length xs. f p (xs ! p) = g p (xs ! p) \<Longrightarrow> map2 f [0..<length xs] xs = map2 g [0..<length xs] xs
[PROOF STEP]
by (auto simp: set_zip)


[STATEMENT]
lemma elementary_Inter:
  assumes "finite f"
    and "f \<noteq> {}"
    and "\<forall>s\<in>f. \<exists>p. p division_of (s::('a::euclidean_space) set)"
  shows "\<exists>p. p division_of (\<Inter>f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite f
f \<noteq> {}
\<forall>s\<in>f. \<exists>p. p division_of s

goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> f
[PROOF STEP]
proof (induct f rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>{} \<noteq> {}; \<forall>s\<in>{}. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>s\<in>F. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> F; insert x F \<noteq> {}; \<forall>s\<in>insert x F. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x F)
[PROOF STEP]
case (insert x f)
[PROOF STATE]
proof (state)
this:
finite f
x \<notin> f
\<lbrakk>f \<noteq> {}; \<forall>s\<in>f. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> f
insert x f \<noteq> {}
\<forall>s\<in>insert x f. \<exists>p. p division_of s

goal (2 subgoals):
 1. \<lbrakk>{} \<noteq> {}; \<forall>s\<in>{}. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<noteq> {}; \<forall>s\<in>F. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> F; insert x F \<noteq> {}; \<forall>s\<in>insert x F. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
proof (cases "f = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
 2. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f = {}

goal (2 subgoals):
 1. f = {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
 2. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f = {}

goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
using this:
{} = {}

goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> {x}
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
{} = {}
finite f
x \<notin> f
\<lbrakk>f \<noteq> {}; \<forall>s\<in>f. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> f
insert x f \<noteq> {}
\<forall>s\<in>insert x f. \<exists>p. p division_of s

goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>p. p division_of \<Inter> (insert x f)

goal (1 subgoal):
 1. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<noteq> {}

goal (1 subgoal):
 1. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
obtain p where "p division_of \<Inter>f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. p division_of \<Inter> f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using insert(3)[OF False insert(5)[unfolded ball_simps,THEN conjunct2]]
[PROOF STATE]
proof (prove)
using this:
\<exists>p. p division_of \<Inter> f

goal (1 subgoal):
 1. (\<And>p. p division_of \<Inter> f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
p division_of \<Inter> f

goal (1 subgoal):
 1. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p division_of \<Inter> f

goal (1 subgoal):
 1. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
obtain px where "px division_of x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>px. px division_of x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using insert(5)[rule_format,OF insertI1]
[PROOF STATE]
proof (prove)
using this:
\<exists>p. p division_of x

goal (1 subgoal):
 1. (\<And>px. px division_of x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
px division_of x

goal (1 subgoal):
 1. f \<noteq> {} \<Longrightarrow> \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p division_of \<Inter> f
px division_of x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p division_of \<Inter> f
px division_of x

goal (1 subgoal):
 1. \<exists>p. p division_of \<Inter> (insert x f)
[PROOF STEP]
by (simp add: elementary_Int Inter_insert)
[PROOF STATE]
proof (state)
this:
\<exists>p. p division_of \<Inter> (insert x f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>p. p division_of \<Inter> (insert x f)

goal (1 subgoal):
 1. \<lbrakk>{} \<noteq> {}; \<forall>s\<in>{}. \<exists>p. p division_of s\<rbrakk> \<Longrightarrow> \<exists>p. p division_of \<Inter> {}
[PROOF STEP]
qed auto


[STATEMENT]
lemma unifiers_Pairs:
  assumes
    "finite AAA" and
    "\<forall>AA \<in> AAA. finite AA"
  shows "unifiers (set (Pairs AAA)) = {\<sigma>. is_unifiers \<sigma> AAA}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unifiers (set (Pairs AAA)) = {\<sigma>. is_unifiers \<sigma> AAA}
[PROOF STEP]
proof (rule; rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> unifiers (set (Pairs AAA)) \<Longrightarrow> x \<in> {\<sigma>. is_unifiers \<sigma> AAA}
 2. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
fix \<sigma> :: "('a, 'b) subst"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> unifiers (set (Pairs AAA)) \<Longrightarrow> x \<in> {\<sigma>. is_unifiers \<sigma> AAA}
 2. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
assume asm: "\<sigma> \<in> unifiers (set (Pairs AAA))"
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> unifiers (set (Pairs AAA))

goal (2 subgoals):
 1. \<And>x. x \<in> unifiers (set (Pairs AAA)) \<Longrightarrow> x \<in> {\<sigma>. is_unifiers \<sigma> AAA}
 2. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
have "\<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
fix AA :: "('a, 'b) term set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
assume asm': "AA \<in> AAA"
[PROOF STATE]
proof (state)
this:
AA \<in> AAA

goal (1 subgoal):
 1. \<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AA \<in> AAA
[PROOF STEP]
have "\<forall>p \<in> set (pairs (compare_linorder.sorted_list_of_set AA)).
      subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>"
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA

goal (1 subgoal):
 1. \<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>
[PROOF STEP]
using assms asm
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> unifiers (set (Pairs AAA))

goal (1 subgoal):
 1. \<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>
[PROOF STEP]
unfolding Pairs_def
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> unifiers (set (concat (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))))

goal (1 subgoal):
 1. \<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>

goal (1 subgoal):
 1. \<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>
[PROOF STEP]
have "\<forall>A \<in> AA. \<forall>B \<in> AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>"
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>

goal (1 subgoal):
 1. \<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
using assms asm'
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set (pairs (compare_linorder.sorted_list_of_set AA)). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>
finite AAA
\<forall>AA\<in>AAA. finite AA
AA \<in> AAA

goal (1 subgoal):
 1. \<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
unfolding unifies_all_pairs_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (compare_linorder.sorted_list_of_set AA). \<forall>b\<in>set (compare_linorder.sorted_list_of_set AA). subst_atm_abbrev a \<sigma> = subst_atm_abbrev b \<sigma>
finite AAA
\<forall>AA\<in>AAA. finite AA
AA \<in> AAA

goal (1 subgoal):
 1. \<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
using compare_linorder.sorted_list_of_set
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (compare_linorder.sorted_list_of_set AA). \<forall>b\<in>set (compare_linorder.sorted_list_of_set AA). subst_atm_abbrev a \<sigma> = subst_atm_abbrev b \<sigma>
finite AAA
\<forall>AA\<in>AAA. finite AA
AA \<in> AAA
finite ?A \<Longrightarrow> set (compare_linorder.sorted_list_of_set ?A) = ?A
compare_linorder.sorted (compare_linorder.sorted_list_of_set ?A)
distinct (compare_linorder.sorted_list_of_set ?A)

goal (1 subgoal):
 1. \<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>

goal (1 subgoal):
 1. \<And>AA. AA \<in> AAA \<Longrightarrow> card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
show "card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>A\<in>AA. \<forall>B\<in>AA. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
by (smt imageE card.empty card_Suc_eq card_mono finite.intros(1) finite_insert le_SucI
           singletonI subsetI)
[PROOF STATE]
proof (state)
this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?AA1 \<in> AAA \<Longrightarrow> card (?AA1 \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (2 subgoals):
 1. \<And>x. x \<in> unifiers (set (Pairs AAA)) \<Longrightarrow> x \<in> {\<sigma>. is_unifiers \<sigma> AAA}
 2. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?AA1 \<in> AAA \<Longrightarrow> card (?AA1 \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
show "\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}"
[PROOF STATE]
proof (prove)
using this:
?AA1 \<in> AAA \<Longrightarrow> card (?AA1 \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. \<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?AA1 \<in> AAA \<Longrightarrow> card (?AA1 \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
finite AAA
\<forall>AA\<in>AAA. finite AA

goal (1 subgoal):
 1. \<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
[PROOF STEP]
by (auto simp: is_unifiers_def is_unifier_def subst_atms_def)
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
fix \<sigma> :: "('a, 'b) subst"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
assume asm: "\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}"
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
fix AB_pairs A B
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
assume
      "AB_pairs \<in> set (compare_linorder.sorted_list_of_set
         ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))" and
      "(A, B) \<in> set AB_pairs"
[PROOF STATE]
proof (state)
this:
AB_pairs \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))
(A, B) \<in> set AB_pairs

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AB_pairs \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))
(A, B) \<in> set AB_pairs
[PROOF STEP]
have "\<exists>AA. AA \<in> AAA \<and> A \<in> AA \<and> B \<in> AA"
[PROOF STATE]
proof (prove)
using this:
AB_pairs \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))
(A, B) \<in> set AB_pairs

goal (1 subgoal):
 1. \<exists>AA. AA \<in> AAA \<and> A \<in> AA \<and> B \<in> AA
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
AB_pairs \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))
(A, B) \<in> set AB_pairs
finite AAA
\<forall>AA\<in>AAA. finite AA

goal (1 subgoal):
 1. \<exists>AA. AA \<in> AAA \<and> A \<in> AA \<and> B \<in> AA
[PROOF STEP]
by (simp add: in_pairs_sorted_list_of_set_in_set)
[PROOF STATE]
proof (state)
this:
\<exists>AA. AA \<in> AAA \<and> A \<in> AA \<and> B \<in> AA

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>AA. AA \<in> AAA \<and> A \<in> AA \<and> B \<in> AA
[PROOF STEP]
obtain AA where
     a: "AA \<in> AAA" "A \<in> AA" "B \<in> AA"
[PROOF STATE]
proof (prove)
using this:
\<exists>AA. AA \<in> AAA \<and> A \<in> AA \<and> B \<in> AA

goal (1 subgoal):
 1. (\<And>AA. \<lbrakk>AA \<in> AAA; A \<in> AA; B \<in> AA\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
AA \<in> AAA
A \<in> AA
B \<in> AA

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
from a assms asm
[PROOF STATE]
proof (chain)
picking this:
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
[PROOF STEP]
have card_AA_\<sigma>: "card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0"
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
unfolding is_unifiers_def is_unifier_def subst_atms_def
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. \<forall>AA\<in>AAA. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> 1}

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
have "subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
proof (cases "card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
 2. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0

goal (2 subgoals):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
 2. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0

goal (2 subgoals):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
 2. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
have "subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
[PROOF STEP]
using a assms asm card_AA_\<sigma>
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>

goal (2 subgoals):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
 2. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>

goal (2 subgoals):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
 2. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
have "subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
[PROOF STEP]
using a assms asm card_AA_\<sigma>
[PROOF STATE]
proof (prove)
using this:
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>

goal (2 subgoals):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
 2. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0
subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0
subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>

goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
using a assms asm card_AA_\<sigma>
[PROOF STATE]
proof (prove)
using this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = Suc 0
subst_atm_abbrev A \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
subst_atm_abbrev B \<sigma> \<in> AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
by (metis (no_types, lifting) card_Suc_eq singletonD)
[PROOF STATE]
proof (state)
this:
subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0
[PROOF STEP]
have "card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0"
[PROOF STATE]
proof (prove)
using this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0
[PROOF STEP]
using a assms asm card_AA_\<sigma>
[PROOF STATE]
proof (prove)
using this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0

goal (1 subgoal):
 1. card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<noteq> Suc 0 \<Longrightarrow> subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0

goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
using a assms asm card_AA_\<sigma>
[PROOF STATE]
proof (prove)
using this:
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) = 0
AA \<in> AAA
A \<in> AA
B \<in> AA
finite AAA
\<forall>AA\<in>AAA. finite AA
\<sigma> \<in> {\<sigma>. is_unifiers \<sigma> AAA}
card (AA \<cdot>\<^sub>s\<^sub>e\<^sub>t \<sigma>) \<le> Suc 0

goal (1 subgoal):
 1. subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subst_atm_abbrev A \<sigma> = subst_atm_abbrev B \<sigma>

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?AB_pairs3 \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA)); (?A3, ?B3) \<in> set ?AB_pairs3\<rbrakk> \<Longrightarrow> subst_atm_abbrev ?A3 \<sigma> = subst_atm_abbrev ?B3 \<sigma>

goal (1 subgoal):
 1. \<And>x. x \<in> {\<sigma>. is_unifiers \<sigma> AAA} \<Longrightarrow> x \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?AB_pairs3 \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA)); (?A3, ?B3) \<in> set ?AB_pairs3\<rbrakk> \<Longrightarrow> subst_atm_abbrev ?A3 \<sigma> = subst_atm_abbrev ?B3 \<sigma>
[PROOF STEP]
show "\<sigma> \<in> unifiers (set (Pairs AAA))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?AB_pairs3 \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA)); (?A3, ?B3) \<in> set ?AB_pairs3\<rbrakk> \<Longrightarrow> subst_atm_abbrev ?A3 \<sigma> = subst_atm_abbrev ?B3 \<sigma>

goal (1 subgoal):
 1. \<sigma> \<in> unifiers (set (Pairs AAA))
[PROOF STEP]
unfolding Pairs_def unifiers_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?AB_pairs3 \<in> set (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA)); (?A3, ?B3) \<in> set ?AB_pairs3\<rbrakk> \<Longrightarrow> subst_atm_abbrev ?A3 \<sigma> = subst_atm_abbrev ?B3 \<sigma>

goal (1 subgoal):
 1. \<sigma> \<in> {\<sigma>. \<forall>p\<in>set (concat (compare_linorder.sorted_list_of_set ((pairs \<circ> compare_linorder.sorted_list_of_set) ` AAA))). subst_atm_abbrev (fst p) \<sigma> = subst_atm_abbrev (snd p) \<sigma>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> unifiers (set (Pairs AAA))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_pdevs_of_list_eq:
  "(\<And>x. x \<in> set xs \<Longrightarrow> x \<noteq> 0) \<Longrightarrow> degree (pdevs_of_list xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> x \<noteq> (0::'a)) \<Longrightarrow> degree (pdevs_of_list xs) = length xs
[PROOF STEP]
by (cases xs) (auto simp add: pdevs_apply_pdevs_of_list nth_Cons
    intro!: degree_eqI
    split: nat.split)


[STATEMENT]
lemma flat_ang:
  assumes "Bet A B C" and
    "Bet A' B' C'" and
    "A B C Ang a1" and
    "A' B' C' Ang a2"
  shows "a1  = a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a1 = a2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a1 = a2
[PROOF STEP]
have "A B C Ang a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
have "A' B' C' Ang a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' B' C' Ang a2
[PROOF STEP]
by (simp add: assms(4))
[PROOF STATE]
proof (state)
this:
A' B' C' Ang a2

goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A' B' C' Ang a2

goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
have "A' B' C' CongA A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' B' C' CongA A B C
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) calculation conga_line is_ang_distinct)
[PROOF STATE]
proof (state)
this:
A' B' C' CongA A B C

goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A' B' C' Ang a2
A' B' C' CongA A B C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A' B' C' Ang a2
A' B' C' CongA A B C

goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
using is_ang_conga_is_ang
[PROOF STATE]
proof (prove)
using this:
A' B' C' Ang a2
A' B' C' CongA A B C
\<lbrakk>?A ?B ?C Ang ?a; ?A ?B ?C CongA ?A' ?B' ?C'\<rbrakk> \<Longrightarrow> ?A' ?B' ?C' Ang ?a

goal (1 subgoal):
 1. A B C Ang a2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A B C Ang a2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A B C Ang a2

goal (1 subgoal):
 1. a1 = a2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A B C Ang a2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A B C Ang a2

goal (1 subgoal):
 1. a1 = a2
[PROOF STEP]
using assms(3) all_eqa
[PROOF STATE]
proof (prove)
using this:
A B C Ang a2
A B C Ang a1
\<lbrakk>?A ?B ?C Ang ?a1.0; ?A ?B ?C Ang ?a2.0\<rbrakk> \<Longrightarrow> ?a1.0 = ?a2.0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monom_one_Suc2:
  "monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. monom P \<one> (Suc 0) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> 0
 2. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. monom P \<one> (Suc 0) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> 0
 2. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> (Suc 0) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc 0) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> 0

goal (1 subgoal):
 1. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc n_) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n_

goal (1 subgoal):
 1. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc n_) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n_

goal (1 subgoal):
 1. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
fix k:: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
assume hypo: "monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k"
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k

goal (1 subgoal):
 1. \<And>n. monom P \<one> (Suc n) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> n \<Longrightarrow> monom P \<one> (Suc (Suc n)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k
[PROOF STEP]
show "monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)"
[PROOF STATE]
proof (prove)
using this:
monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k

goal (1 subgoal):
 1. monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<Longrightarrow> monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
have lhs: "monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
unfolding monom_one_Suc [of "Suc k"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> (Suc k) \<otimes>\<^bsub>P\<^esub> monom P \<one> 1 = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
unfolding hypo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1 = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1

goal (1 subgoal):
 1. monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<Longrightarrow> monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
note cl = monom_closed [OF R.one_closed, of 1]
[PROOF STATE]
proof (state)
this:
monom P \<one> 1 \<in> carrier P

goal (1 subgoal):
 1. monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<Longrightarrow> monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
note clk = monom_closed [OF R.one_closed, of k]
[PROOF STATE]
proof (state)
this:
monom P \<one> k \<in> carrier P

goal (1 subgoal):
 1. monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<Longrightarrow> monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
have rhs: "monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
unfolding monom_one_Suc [of k]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> (monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
unfolding sym [OF m_assoc  [OF cl clk cl]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1 = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1

goal (1 subgoal):
 1. monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<Longrightarrow> monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
from lhs rhs
[PROOF STATE]
proof (chain)
picking this:
monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1
monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> k \<otimes>\<^bsub>P\<^esub> monom P \<one> 1

goal (1 subgoal):
 1. monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc (Suc k)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc k)

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
monom P \<one> (Suc ?k2) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> ?k2 \<Longrightarrow> monom P \<one> (Suc (Suc ?k2)) = monom P \<one> 1 \<otimes>\<^bsub>P\<^esub> monom P \<one> (Suc ?k2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux3_digit_gen_sum_repr:
  assumes "d < b^r" and "b > 1"
  shows "nth_digit (a*b^r + d) r b = nth_digit (a*b^r) r b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit (a * b ^ r + d) r b = nth_digit (a * b ^ r) r b
[PROOF STEP]
using \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < b

goal (1 subgoal):
 1. nth_digit (a * b ^ r + d) r b = nth_digit (a * b ^ r) r b
[PROOF STEP]
by (auto simp: nth_digit_def assms)


[STATEMENT]
lemma lt_trans: "lt\<cdot>x\<cdot>y = TT \<Longrightarrow> lt\<cdot>y\<cdot>z = TT \<Longrightarrow> lt\<cdot>x\<cdot>z = TT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lt\<cdot>x\<cdot>y = TT; lt\<cdot>y\<cdot>z = TT\<rbrakk> \<Longrightarrow> lt\<cdot>x\<cdot>z = TT
[PROOF STEP]
unfolding lt_eq_TT_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compare\<cdot>x\<cdot>y = LT; compare\<cdot>y\<cdot>z = LT\<rbrakk> \<Longrightarrow> compare\<cdot>x\<cdot>z = LT
[PROOF STEP]
by (rule compare_LT_trans)


[STATEMENT]
lemma permutations_of_multiset_nonempty:
  assumes nonempty: "A \<noteq> {#}"
  shows   "permutations_of_multiset A =
             (\<Union>x\<in>set_mset A. ((#) x) ` permutations_of_multiset (A - {#x#}))" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_multiset A = (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
fix xs
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
assume "xs \<in> permutations_of_multiset A"
[PROOF STATE]
proof (state)
this:
xs \<in> permutations_of_multiset A

goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
hence mset_xs: "mset xs = A"
[PROOF STATE]
proof (prove)
using this:
xs \<in> permutations_of_multiset A

goal (1 subgoal):
 1. mset xs = A
[PROOF STEP]
by (simp add: permutations_of_multiset_def)
[PROOF STATE]
proof (state)
this:
mset xs = A

goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
hence "xs \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
mset xs = A

goal (1 subgoal):
 1. xs \<noteq> []
[PROOF STEP]
by (auto simp: nonempty)
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
obtain x xs' where xs: "xs = x # xs'"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. (\<And>x xs'. xs = x # xs' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases xs) simp_all
[PROOF STATE]
proof (state)
this:
xs = x # xs'

goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
with mset_xs
[PROOF STATE]
proof (chain)
picking this:
mset xs = A
xs = x # xs'
[PROOF STEP]
have "x \<in> set_mset A" "xs' \<in> permutations_of_multiset (A - {#x#})"
[PROOF STATE]
proof (prove)
using this:
mset xs = A
xs = x # xs'

goal (1 subgoal):
 1. x \<in># A &&& xs' \<in> permutations_of_multiset (A - {#x#})
[PROOF STEP]
by (auto simp: permutations_of_multiset_def)
[PROOF STATE]
proof (state)
this:
x \<in># A
xs' \<in> permutations_of_multiset (A - {#x#})

goal (2 subgoals):
 1. \<And>x. x \<in> permutations_of_multiset A \<Longrightarrow> x \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
 2. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
with xs
[PROOF STATE]
proof (chain)
picking this:
xs = x # xs'
x \<in># A
xs' \<in> permutations_of_multiset (A - {#x#})
[PROOF STEP]
show "xs \<in> ?rhs"
[PROOF STATE]
proof (prove)
using this:
xs = x # xs'
x \<in># A
xs' \<in> permutations_of_multiset (A - {#x#})

goal (1 subgoal):
 1. xs \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<in> (\<Union>x\<in>set_mset A. (#) x ` permutations_of_multiset (A - {#x#}))

goal (1 subgoal):
 1. \<And>x xa xb. \<lbrakk>xa \<in># A; xb \<in> permutations_of_multiset (A - {#xa#})\<rbrakk> \<Longrightarrow> xa # xb \<in> permutations_of_multiset A
[PROOF STEP]
qed (auto simp: permutations_of_multiset_def)


[STATEMENT]
lemma word_upto_eq_upto: "s \<le> e \<Longrightarrow> e \<le> unat (max_word :: 'l word) \<Longrightarrow>
       word_upto ((of_nat :: nat \<Rightarrow> ('l :: len) word) s) (of_nat e) = map of_nat (upt s (Suc e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<le> e; e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]
[PROOF STEP]
proof(induction e)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>s \<le> 0; 0 \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat 0) = map word_of_nat [s..<Suc 0]
 2. \<And>e. \<lbrakk>\<lbrakk>s \<le> e; e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]; s \<le> Suc e; Suc e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
let ?mwon = "of_nat :: nat \<Rightarrow> 'l word"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>s \<le> 0; 0 \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat 0) = map word_of_nat [s..<Suc 0]
 2. \<And>e. \<lbrakk>\<lbrakk>s \<le> e; e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]; s \<le> Suc e; Suc e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
let ?mmw = "max_word :: 'l word"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>s \<le> 0; 0 \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat 0) = map word_of_nat [s..<Suc 0]
 2. \<And>e. \<lbrakk>\<lbrakk>s \<le> e; e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]; s \<le> Suc e; Suc e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
case (Suc e)
[PROOF STATE]
proof (state)
this:
\<lbrakk>s \<le> e; e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]
s \<le> Suc e
Suc e \<le> unat max_word

goal (2 subgoals):
 1. \<lbrakk>s \<le> 0; 0 \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat 0) = map word_of_nat [s..<Suc 0]
 2. \<And>e. \<lbrakk>\<lbrakk>s \<le> e; e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]; s \<le> Suc e; Suc e \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
proof(cases "?mwon s = ?mwon (Suc e)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. word_of_nat s = word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
 2. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
word_of_nat s = word_of_nat (Suc e)

goal (2 subgoals):
 1. word_of_nat s = word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
 2. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
have "s = Suc e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = Suc e
[PROOF STEP]
using le_unat_uoi Suc.prems True
[PROOF STATE]
proof (prove)
using this:
?y \<le> unat ?z \<Longrightarrow> unat (word_of_nat ?y) = ?y
s \<le> Suc e
Suc e \<le> unat max_word
word_of_nat s = word_of_nat (Suc e)

goal (1 subgoal):
 1. s = Suc e
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
s = Suc e

goal (2 subgoals):
 1. word_of_nat s = word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
 2. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
word_of_nat s = word_of_nat (Suc e)
s = Suc e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
word_of_nat s = word_of_nat (Suc e)
s = Suc e

goal (1 subgoal):
 1. word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
by(subst word_upto.simps) (simp)
[PROOF STATE]
proof (state)
this:
word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]

goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
word_of_nat s \<noteq> word_of_nat (Suc e)

goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
hence le: "s \<le> e"
[PROOF STATE]
proof (prove)
using this:
word_of_nat s \<noteq> word_of_nat (Suc e)

goal (1 subgoal):
 1. s \<le> e
[PROOF STEP]
using le_SucE Suc.prems
[PROOF STATE]
proof (prove)
using this:
word_of_nat s \<noteq> word_of_nat (Suc e)
\<lbrakk>?m \<le> Suc ?n; ?m \<le> ?n \<Longrightarrow> ?R; ?m = Suc ?n \<Longrightarrow> ?R\<rbrakk> \<Longrightarrow> ?R
s \<le> Suc e
Suc e \<le> unat max_word

goal (1 subgoal):
 1. s \<le> e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s \<le> e

goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
have lm: "e \<le> unat ?mmw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<le> unat max_word
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
s \<le> Suc e
Suc e \<le> unat max_word

goal (1 subgoal):
 1. e \<le> unat max_word
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e \<le> unat max_word

goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
have sucm: "(of_nat :: nat \<Rightarrow> ('l :: len) word) (Suc e) - 1 = of_nat e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_of_nat (Suc e) - 1 = word_of_nat e
[PROOF STEP]
using Suc.prems(2)
[PROOF STATE]
proof (prove)
using this:
Suc e \<le> unat max_word

goal (1 subgoal):
 1. word_of_nat (Suc e) - 1 = word_of_nat e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
word_of_nat (Suc e) - 1 = word_of_nat e

goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
note mIH = Suc.IH[OF le lm]
[PROOF STATE]
proof (state)
this:
word_upto (word_of_nat s) (word_of_nat e) = map word_of_nat [s..<Suc e]

goal (1 subgoal):
 1. word_of_nat s \<noteq> word_of_nat (Suc e) \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]
[PROOF STEP]
by(subst word_upto.simps) (simp add: False[simplified] Suc.prems mIH sucm)
[PROOF STATE]
proof (state)
this:
word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
word_upto (word_of_nat s) (word_of_nat (Suc e)) = map word_of_nat [s..<Suc (Suc e)]

goal (1 subgoal):
 1. \<lbrakk>s \<le> 0; 0 \<le> unat max_word\<rbrakk> \<Longrightarrow> word_upto (word_of_nat s) (word_of_nat 0) = map word_of_nat [s..<Suc 0]
[PROOF STEP]
qed(simp add: word_upto.simps)


[STATEMENT]
lemma pos_meas_set_union:
  assumes "pos_meas_set A"
    and "pos_meas_set B"
  shows "pos_meas_set (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
define C where "C = B - A"
[PROOF STATE]
proof (state)
this:
C = B - A

goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
have "A\<union> C = A\<union> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> C = A \<union> B
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> (B - A) = A \<union> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> C = A \<union> B

goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<union> C = A \<union> B

goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
have "pos_meas_set (A\<union> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set (A \<union> C)
[PROOF STEP]
proof (rule pos_meas_disj_union)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. pos_meas_set A
 2. pos_meas_set C
 3. A \<inter> C = {}
[PROOF STEP]
show "pos_meas_set C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set C
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set (B - A)
[PROOF STEP]
by (meson Diff_subset assms(1) assms(2) sets.Diff
          signed_measure_space.pos_meas_set_def
          signed_measure_space.pos_meas_subset signed_measure_space_axioms)
[PROOF STATE]
proof (state)
this:
pos_meas_set C

goal (2 subgoals):
 1. pos_meas_set A
 2. A \<inter> C = {}
[PROOF STEP]
show "pos_meas_set A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pos_meas_set A
pos_meas_set B

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

goal (1 subgoal):
 1. A \<inter> C = {}
[PROOF STEP]
show "A \<inter> C = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> C = {}
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> (B - A) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<inter> C = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pos_meas_set (A \<union> C)

goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<union> C = A \<union> B
pos_meas_set (A \<union> C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<union> C = A \<union> B
pos_meas_set (A \<union> C)

goal (1 subgoal):
 1. pos_meas_set (A \<union> B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pos_meas_set (A \<union> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_arrows_sym:
       shows "inverse_arrows f g \<longleftrightarrow> inverse_arrows g f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_arrows f g = inverse_arrows g f
[PROOF STEP]
using inverse_arrows_def
[PROOF STATE]
proof (prove)
using this:
inverse_arrows ?f ?g \<equiv> ide (?g \<cdot> ?f) \<and> ide (?f \<cdot> ?g)

goal (1 subgoal):
 1. inverse_arrows f g = inverse_arrows g f
[PROOF STEP]
by auto


[STATEMENT]
lemma path_inf_priorities_at_least_min_prio:
  assumes P: "valid_path P" and a: "a \<in> path_inf_priorities P"
  shows "Min (\<omega> ` V) \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (\<omega> ` V) \<le> a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Min (\<omega> ` V) \<le> a
[PROOF STEP]
have "a \<in> lset (ldropn 0 (lmap \<omega> P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> lset (ldropn 0 (lmap \<omega> P))
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> path_inf_priorities P

goal (1 subgoal):
 1. a \<in> lset (ldropn 0 (lmap \<omega> P))
[PROOF STEP]
unfolding path_inf_priorities_def
[PROOF STATE]
proof (prove)
using this:
a \<in> {k. \<forall>n. k \<in> lset (ldropn n (lmap \<omega> P))}

goal (1 subgoal):
 1. a \<in> lset (ldropn 0 (lmap \<omega> P))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> lset (ldropn 0 (lmap \<omega> P))

goal (1 subgoal):
 1. Min (\<omega> ` V) \<le> a
[PROOF STEP]
hence "a \<in> \<omega> ` lset P"
[PROOF STATE]
proof (prove)
using this:
a \<in> lset (ldropn 0 (lmap \<omega> P))

goal (1 subgoal):
 1. a \<in> \<omega> ` lset P
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<in> \<omega> ` lset P

goal (1 subgoal):
 1. Min (\<omega> ` V) \<le> a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> \<omega> ` lset P

goal (1 subgoal):
 1. Min (\<omega> ` V) \<le> a
[PROOF STEP]
using P valid_path_in_V priorities_finite Min_le
[PROOF STATE]
proof (prove)
using this:
a \<in> \<omega> ` lset P
valid_path P
valid_path ?P \<Longrightarrow> lset ?P \<subseteq> V
finite (\<omega> ` V)
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> Min ?A \<le> ?x

goal (1 subgoal):
 1. Min (\<omega> ` V) \<le> a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Min (\<omega> ` V) \<le> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma psize_eq_0_iff [simp]: "psize p = 0 \<longleftrightarrow> p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (psize p = 0) = (p = 0)
[PROOF STEP]
unfolding psize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if p = 0 then 0 else Suc (degree p)) = 0) = (p = 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma subterms_singleton:
  assumes "(\<exists>v. t = Var v) \<or> (\<exists>f. t = Fun f [])"
  shows "subterms t = {t}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subterms t = {t}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<exists>v. t = Var v) \<or> (\<exists>f. t = Fun f [])

goal (1 subgoal):
 1. subterms t = {t}
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma valid_lineI:
  assumes "\<And> i. i < length l \<Longrightarrow> valid_point l i"
  shows "valid_line l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_line l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i < length l \<Longrightarrow> valid_point l ?i

goal (1 subgoal):
 1. valid_line l
[PROOF STEP]
unfolding valid_line_def
[PROOF STATE]
proof (prove)
using this:
?i < length l \<Longrightarrow> valid_point l ?i

goal (1 subgoal):
 1. \<forall>i<length l. valid_point l i
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_partJoin[simp]:
assumes "finite P" and "finite Q"
shows "finite (partJoin P Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (partJoin P Q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite P
finite Q

goal (1 subgoal):
 1. finite (partJoin P Q)
[PROOF STEP]
unfolding partJoin_def
[PROOF STATE]
proof (prove)
using this:
finite P
finite Q

goal (1 subgoal):
 1. finite (partGen (P \<union> Q))
[PROOF STEP]
by auto


[STATEMENT]
lemma zero_less_one_type2: "(0::2) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
have "Mod_Type.from_nat 0 = (0::2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.from_nat 0 = 0
[PROOF STEP]
by (simp add: from_nat_0)
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat 0 = 0

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat 0 = 0

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
have "Mod_Type.from_nat 1 = (1::2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.from_nat 1 = 1
[PROOF STEP]
using from_nat_1
[PROOF STATE]
proof (prove)
using this:
mod_type_class.from_nat 1 = (1::?'a)

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

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat 1 = 1

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
have "(Mod_Type.from_nat 0::2) < Mod_Type.from_nat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.from_nat 0 < mod_type_class.from_nat 1
[PROOF STEP]
by (rule from_nat_mono, auto)
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat 0 < mod_type_class.from_nat 1

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mod_type_class.from_nat 0 = 0
mod_type_class.from_nat 1 = 1
mod_type_class.from_nat 0 < mod_type_class.from_nat 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mod_type_class.from_nat 0 = 0
mod_type_class.from_nat 1 = 1
mod_type_class.from_nat 0 < mod_type_class.from_nat 1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma EntryPath_butlast_less_last:
    assumes "EntryPath g ns" "z \<in> set (butlast ns)"
    shows "shortestPath g z < shortestPath g (last ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shortestPath g z < shortestPath g (last ns)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
EntryPath g ns
z \<in> set (butlast ns)

goal (1 subgoal):
 1. shortestPath g z < shortestPath g (last ns)
[PROOF STEP]
proof (induction)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>g n. z \<in> set (butlast [n]) \<Longrightarrow> shortestPath g z < shortestPath g (last [n])
 2. \<And>g ns m. \<lbrakk>EntryPath g ns; z \<in> set (butlast ns) \<Longrightarrow> shortestPath g z < shortestPath g (last ns); shortestPath g m = Suc (shortestPath g (last ns)); z \<in> set (butlast (ns @ [m]))\<rbrakk> \<Longrightarrow> shortestPath g z < shortestPath g (last (ns @ [m]))
[PROOF STEP]
case (EntryPath_snoc g ns m)
[PROOF STATE]
proof (state)
this:
EntryPath g ns
shortestPath g m = Suc (shortestPath g (last ns))
z \<in> set (butlast ns) \<Longrightarrow> shortestPath g z < shortestPath g (last ns)
z \<in> set (butlast (ns @ [m]))

goal (2 subgoals):
 1. \<And>g n. z \<in> set (butlast [n]) \<Longrightarrow> shortestPath g z < shortestPath g (last [n])
 2. \<And>g ns m. \<lbrakk>EntryPath g ns; z \<in> set (butlast ns) \<Longrightarrow> shortestPath g z < shortestPath g (last ns); shortestPath g m = Suc (shortestPath g (last ns)); z \<in> set (butlast (ns @ [m]))\<rbrakk> \<Longrightarrow> shortestPath g z < shortestPath g (last (ns @ [m]))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
EntryPath g ns
shortestPath g m = Suc (shortestPath g (last ns))
z \<in> set (butlast ns) \<Longrightarrow> shortestPath g z < shortestPath g (last ns)
z \<in> set (butlast (ns @ [m]))

goal (1 subgoal):
 1. shortestPath g z < shortestPath g (last (ns @ [m]))
[PROOF STEP]
by (cases "z \<in> set (butlast ns)", auto dest: not_in_butlast)
[PROOF STATE]
proof (state)
this:
shortestPath g z < shortestPath g (last (ns @ [m]))

goal (1 subgoal):
 1. \<And>g n. z \<in> set (butlast [n]) \<Longrightarrow> shortestPath g z < shortestPath g (last [n])
[PROOF STEP]
qed simp