[STATEMENT]
lemma eq_swap_rev:
      assumes "w\<^sub>1 =\<^sub>S w\<^sub>2"
      shows "rev w\<^sub>1 =\<^sub>S rev w\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev w\<^sub>1 =\<^sub>S rev w\<^sub>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 =\<^sub>S w\<^sub>2

goal (1 subgoal):
 1. rev w\<^sub>1 =\<^sub>S rev w\<^sub>2
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
case (swap a b u v)
[PROOF STATE]
proof (state)
this:
ind a b

goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
have 1: "rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u
[PROOF STEP]
using swap
[PROOF STATE]
proof (prove)
using this:
ind a b

goal (1 subgoal):
 1. rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u

goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
have 2: "rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u
[PROOF STEP]
using 1 eq_swap_sym
[PROOF STATE]
proof (prove)
using this:
rev v @ [a] @ [b] @ rev u =\<^sub>S rev v @ [b] @ [a] @ rev u
?v =\<^sub>S ?w \<Longrightarrow> ?w =\<^sub>S ?v

goal (1 subgoal):
 1. rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u

goal (1 subgoal):
 1. \<And>a b u v. ind a b \<Longrightarrow> rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
rev v @ [b] @ [a] @ rev u =\<^sub>S rev v @ [a] @ [b] @ rev u

goal (1 subgoal):
 1. rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rev (u @ [a] @ [b] @ v) =\<^sub>S rev (u @ [b] @ [a] @ v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l6_4_1:
  assumes "P Out A B" and
    "Col A P B"
  shows "\<not> Bet A P B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Bet A P B
[PROOF STEP]
using Out_def assms(1) between_equality between_symmetry
[PROOF STATE]
proof (prove)
using this:
?P Out ?A ?B \<equiv> ?A \<noteq> ?P \<and> ?B \<noteq> ?P \<and> (Bet ?P ?A ?B \<or> Bet ?P ?B ?A)
P Out A B
\<lbrakk>Bet ?A ?B ?C; Bet ?B ?A ?C\<rbrakk> \<Longrightarrow> ?A = ?B
Bet ?A ?B ?C \<Longrightarrow> Bet ?C ?B ?A

goal (1 subgoal):
 1. \<not> Bet A P B
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Abs_Rep_map:
     "(\<And>x. f(x)\<in> sexp) ==>
        Abs_map g (Rep_map f xs) = map (\<lambda>t. g(f(t))) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. f x \<in> sexp) \<Longrightarrow> Abs_map g (Rep_map f xs) = SList.map (\<lambda>t. g (f t)) xs
[PROOF STEP]
apply (induct xs rule: list_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>x. f x \<in> sexp) \<Longrightarrow> Abs_map g (Rep_map f []) = SList.map (\<lambda>t. g (f t)) []
 2. \<And>x xs. \<lbrakk>(\<And>x. f x \<in> sexp) \<Longrightarrow> Abs_map g (Rep_map f xs) = SList.map (\<lambda>t. g (f t)) xs; \<And>x. f x \<in> sexp\<rbrakk> \<Longrightarrow> Abs_map g (Rep_map f (x # xs)) = SList.map (\<lambda>t. g (f t)) (x # xs)
[PROOF STEP]
apply (simp_all add: Rep_map_type list_sexp [THEN subsetD])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma basis_rev_commute[reversal_rule]: "\<BB> (rev ` G) = rev ` (\<BB> G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> rev ` G = rev ` \<BB> G
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<BB> rev ` G \<subseteq> rev ` \<BB> G
 2. rev ` \<BB> G \<subseteq> \<BB> rev ` G
[PROOF STEP]
have "\<langle>rev ` \<BB> G\<rangle> = \<langle>rev ` G\<rangle>" and *: "\<langle>rev ` \<BB> (rev ` G)\<rangle> = \<langle>rev ` rev `G\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>rev ` \<BB> G\<rangle> = \<langle>rev ` G\<rangle> &&& \<langle>rev ` \<BB> rev ` G\<rangle> = \<langle>rev ` rev ` G\<rangle>
[PROOF STEP]
unfolding rev_hull[symmetric] basis_gen_hull
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` \<langle>G\<rangle> = rev ` \<langle>G\<rangle> &&& rev ` rev ` \<langle>G\<rangle> = rev ` rev ` \<langle>G\<rangle>
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
\<langle>rev ` \<BB> G\<rangle> = \<langle>rev ` G\<rangle>
\<langle>rev ` \<BB> rev ` G\<rangle> = \<langle>rev ` rev ` G\<rangle>

goal (2 subgoals):
 1. \<BB> rev ` G \<subseteq> rev ` \<BB> G
 2. rev ` \<BB> G \<subseteq> \<BB> rev ` G
[PROOF STEP]
from basis_sub_gen[OF this(1)]
[PROOF STATE]
proof (chain)
picking this:
\<BB> rev ` G \<subseteq> rev ` \<BB> G
[PROOF STEP]
show "\<BB> (rev ` G) \<subseteq> rev ` \<BB> G"
[PROOF STATE]
proof (prove)
using this:
\<BB> rev ` G \<subseteq> rev ` \<BB> G

goal (1 subgoal):
 1. \<BB> rev ` G \<subseteq> rev ` \<BB> G
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<BB> rev ` G \<subseteq> rev ` \<BB> G

goal (1 subgoal):
 1. rev ` \<BB> G \<subseteq> \<BB> rev ` G
[PROOF STEP]
from image_mono[OF basis_sub_gen[OF *], of rev]
[PROOF STATE]
proof (chain)
picking this:
rev ` \<BB> rev ` rev ` G \<subseteq> rev ` rev ` \<BB> rev ` G
[PROOF STEP]
show "rev ` (\<BB> G) \<subseteq> \<BB> (rev ` G)"
[PROOF STATE]
proof (prove)
using this:
rev ` \<BB> rev ` rev ` G \<subseteq> rev ` rev ` \<BB> rev ` G

goal (1 subgoal):
 1. rev ` \<BB> G \<subseteq> \<BB> rev ` G
[PROOF STEP]
unfolding rev_rev_image_eq
[PROOF STATE]
proof (prove)
using this:
rev ` \<BB> G \<subseteq> \<BB> rev ` G

goal (1 subgoal):
 1. rev ` \<BB> G \<subseteq> \<BB> rev ` G
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rev ` \<BB> G \<subseteq> \<BB> rev ` G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_CURRY_conv: "(f,g) \<in> CURRY R \<longleftrightarrow> (uncurry f, uncurry g) \<in> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f, g) \<in> CURRY R) = ((uncurry f, uncurry g) \<in> R)
[PROOF STEP]
unfolding CURRY_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f, g) \<in> {(f, g). (uncurry f, uncurry g) \<in> R}) = ((uncurry f, uncurry g) \<in> R)
[PROOF STEP]
by auto


[STATEMENT]
lemma rel_mset_replicate_mset_right:
  assumes "\<And>x. x \<in># A \<Longrightarrow> R x y" "size A = n"
  shows   "rel_mset R A (replicate_mset n y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_mset R A (replicate_mset n y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_mset R A (replicate_mset n y)
[PROOF STEP]
obtain xs where [simp]: "A = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs. A = mset xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ex_mset)
[PROOF STATE]
proof (state)
this:
A = mset xs

goal (1 subgoal):
 1. rel_mset R A (replicate_mset n y)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
?x \<in># A \<Longrightarrow> R ?x y
size A = n
[PROOF STEP]
have "\<forall>x\<in>set xs. R x y"
[PROOF STATE]
proof (prove)
using this:
?x \<in># A \<Longrightarrow> R ?x y
size A = n

goal (1 subgoal):
 1. \<forall>x\<in>set xs. R x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set xs. R x y

goal (1 subgoal):
 1. rel_mset R A (replicate_mset n y)
[PROOF STEP]
hence "list_all2 R xs (replicate (length xs) y)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set xs. R x y

goal (1 subgoal):
 1. list_all2 R xs (replicate (length xs) y)
[PROOF STEP]
by (induction xs) auto
[PROOF STATE]
proof (state)
this:
list_all2 R xs (replicate (length xs) y)

goal (1 subgoal):
 1. rel_mset R A (replicate_mset n y)
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
size A = n
list_all2 R xs (replicate (length xs) y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
size A = n
list_all2 R xs (replicate (length xs) y)

goal (1 subgoal):
 1. rel_mset R A (replicate_mset n y)
[PROOF STEP]
by (intro rel_msetI[of R xs "replicate n y"]) auto
[PROOF STATE]
proof (state)
this:
rel_mset R A (replicate_mset n y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_int_poly[simp]: "dvd_int_poly q p = (q dvd p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dvd_int_poly q p = (q dvd p)
[PROOF STEP]
unfolding dvd_def dvd_int_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if q = 0 then p = 0 else div_int_poly p q \<noteq> None) = (\<exists>k. p = q * k)
[PROOF STEP]
using div_int_poly[of p q]
[PROOF STATE]
proof (prove)
using this:
(div_int_poly p q = Some ?r) = (q \<noteq> 0 \<and> p = ?r * q)

goal (1 subgoal):
 1. (if q = 0 then p = 0 else div_int_poly p q \<noteq> None) = (\<exists>k. p = q * k)
[PROOF STEP]
by (cases "q = 0", auto)


[STATEMENT]
lemma rep_upd_unit:
  assumes "x = (zeroes n)[i := a]"
  shows "\<forall>j < length x. (j \<noteq> i \<longrightarrow> x ! j = 0) \<and> (j = i \<longrightarrow> x ! j = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j<length x. (j \<noteq> i \<longrightarrow> x ! j = 0) \<and> (j = i \<longrightarrow> x ! j = a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = (zeroes n)[i := a]

goal (1 subgoal):
 1. \<forall>j<length x. (j \<noteq> i \<longrightarrow> x ! j = 0) \<and> (j = i \<longrightarrow> x ! j = a)
[PROOF STEP]
by simp


[STATEMENT]
lemma lta__nlea:
  assumes "A B C LtA D E F"
  shows "\<not> D E F LeA A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> D E F LeA A B C
[PROOF STEP]
using assms lea__nlta
[PROOF STATE]
proof (prove)
using this:
A B C LtA D E F
?A ?B ?C LeA ?D ?E ?F \<Longrightarrow> \<not> ?D ?E ?F LtA ?A ?B ?C

goal (1 subgoal):
 1. \<not> D E F LeA A B C
[PROOF STEP]
by blast


[STATEMENT]
lemma prod_mset_prime_factorization:
  assumes "x \<noteq> 0"
  shows   "prod_mset (prime_factorization x) = normalize x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>\<^sub># (prime_factorization x) = normalize x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<Prod>\<^sub># (prime_factorization x) = normalize x
[PROOF STEP]
by (induction x rule: prime_divisors_induct)
     (simp_all add: prime_factorization_unit prime_factorization_times_prime
                    is_unit_normalize normalize_mult)


[STATEMENT]
lemma reachable_nodes_step':
  assumes "u \<in> reachable_nodes g r" "(u, v) \<in> edges g"
  shows "v\<in>reachable_nodes g r" "(u, v) \<in> edges (component_of g r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> reachable_nodes g r &&& (u, v) \<in> edges (component_of g r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> reachable_nodes g r
 2. (u, v) \<in> edges (component_of g r)
[PROOF STEP]
show "v \<in> reachable_nodes g r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> reachable_nodes g r
[PROOF STEP]
by (meson ImageI assms(1) assms(2) reachable_nodes_step rev_subsetD)
[PROOF STATE]
proof (state)
this:
v \<in> reachable_nodes g r

goal (1 subgoal):
 1. (u, v) \<in> edges (component_of g r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> reachable_nodes g r
[PROOF STEP]
show "(u, v) \<in> edges (component_of g r)"
[PROOF STATE]
proof (prove)
using this:
v \<in> reachable_nodes g r

goal (1 subgoal):
 1. (u, v) \<in> edges (component_of g r)
[PROOF STEP]
by (simp add: assms(1) assms(2) component_of_def)
[PROOF STATE]
proof (state)
this:
(u, v) \<in> edges (component_of g r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in vectorspace) vs_zero_lin_dep:
  assumes h2: "S\<subseteq>carrier V" and h3: "lin_indpt S"
  shows "\<zero>\<^bsub>V\<^esub> \<notin> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>V\<^esub> \<notin> S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<zero>\<^bsub>V\<^esub> \<notin> S
[PROOF STEP]
have vs: "vectorspace K V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
vectorspace K V

goal (1 subgoal):
 1. \<zero>\<^bsub>V\<^esub> \<notin> S
[PROOF STEP]
from vs
[PROOF STATE]
proof (chain)
picking this:
vectorspace K V
[PROOF STEP]
have nonzero: "carrier K \<noteq>{\<zero>\<^bsub>K\<^esub>}"
[PROOF STATE]
proof (prove)
using this:
vectorspace K V

goal (1 subgoal):
 1. carrier K \<noteq> {\<zero>\<^bsub>K\<^esub>}
[PROOF STEP]
by (metis one_zeroI zero_not_one)
[PROOF STATE]
proof (state)
this:
carrier K \<noteq> {\<zero>\<^bsub>K\<^esub>}

goal (1 subgoal):
 1. \<zero>\<^bsub>V\<^esub> \<notin> S
[PROOF STEP]
from h2 h3 nonzero
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> carrier V
lin_indpt S
carrier K \<noteq> {\<zero>\<^bsub>K\<^esub>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> carrier V
lin_indpt S
carrier K \<noteq> {\<zero>\<^bsub>K\<^esub>}

goal (1 subgoal):
 1. \<zero>\<^bsub>V\<^esub> \<notin> S
[PROOF STEP]
by (rule zero_nin_lin_indpt)
[PROOF STATE]
proof (state)
this:
\<zero>\<^bsub>V\<^esub> \<notin> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quat_proj_add:
  assumes "i \<le> 3"
  shows "quat_proj (x+y) i = quat_proj x i + quat_proj y i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat_proj (x + y) i = quat_proj x i + quat_proj y i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. quat_proj (x + y) i = quat_proj x i + quat_proj y i
[PROOF STEP]
consider "i = 0" | "i = 1" | "i = 2" | "i = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = 0 \<Longrightarrow> thesis; i = 1 \<Longrightarrow> thesis; i = 2 \<Longrightarrow> thesis; i = 3 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<le> 3

goal (1 subgoal):
 1. \<lbrakk>i = 0 \<Longrightarrow> thesis; i = 1 \<Longrightarrow> thesis; i = 2 \<Longrightarrow> thesis; i = 3 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>i = 0 \<Longrightarrow> ?thesis; i = 1 \<Longrightarrow> ?thesis; i = 2 \<Longrightarrow> ?thesis; i = 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. quat_proj (x + y) i = quat_proj x i + quat_proj y i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i = 0 \<Longrightarrow> ?thesis; i = 1 \<Longrightarrow> ?thesis; i = 2 \<Longrightarrow> ?thesis; i = 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i = 0 \<Longrightarrow> ?thesis; i = 1 \<Longrightarrow> ?thesis; i = 2 \<Longrightarrow> ?thesis; i = 3 \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. quat_proj (x + y) i = quat_proj x i + quat_proj y i
[PROOF STEP]
by cases (auto simp: numeral_2_eq_2 numeral_3_eq_3)
[PROOF STATE]
proof (state)
this:
quat_proj (x + y) i = quat_proj x i + quat_proj y i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homologous_rel_singular_relcycle_1:
  assumes "homologous_rel p X S c1 c2" "singular_relcycle p X S c1"
  shows "singular_relcycle p X S c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_relcycle p X S c2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homologous_rel p X S c1 c2
singular_relcycle p X S c1

goal (1 subgoal):
 1. singular_relcycle p X S c2
[PROOF STEP]
by (metis diff_add_cancel homologous_rel_def homologous_rel_sym singular_relboundary_imp_relcycle singular_relcycle_add)


[STATEMENT]
lemma InvariantImpliedLiteralsAndFormulaFalseThenFormulaAndDecisionsAreNotSatisfiable:
  fixes M :: LiteralTrail and F :: Formula
  assumes "InvariantImpliedLiterals F M" and "formulaFalse F (elements M)"
  shows "\<not> satisfiable (F @ val2form (decisions M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
from \<open>formulaFalse F (elements M)\<close>
[PROOF STATE]
proof (chain)
picking this:
formulaFalse F (elements M)
[PROOF STEP]
have "formulaFalse (F @ val2form (decisions M)) (elements M)"
[PROOF STATE]
proof (prove)
using this:
formulaFalse F (elements M)

goal (1 subgoal):
 1. formulaFalse (F @ val2form (decisions M)) (elements M)
[PROOF STEP]
by (simp add: formulaFalseAppend)
[PROOF STATE]
proof (state)
this:
formulaFalse (F @ val2form (decisions M)) (elements M)

goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
formulaFalse (F @ val2form (decisions M)) (elements M)

goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
from \<open>InvariantImpliedLiterals F M\<close>
[PROOF STATE]
proof (chain)
picking this:
InvariantImpliedLiterals F M
[PROOF STEP]
have "formulaEntailsValuation (F @ val2form (decisions M)) (elements M)"
[PROOF STATE]
proof (prove)
using this:
InvariantImpliedLiterals F M

goal (1 subgoal):
 1. formulaEntailsValuation (F @ val2form (decisions M)) (elements M)
[PROOF STEP]
unfolding formulaEntailsValuation_def
[PROOF STATE]
proof (prove)
using this:
InvariantImpliedLiterals F M

goal (1 subgoal):
 1. \<forall>literal. literal el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisions M)) literal
[PROOF STEP]
unfolding InvariantImpliedLiterals_def
[PROOF STATE]
proof (prove)
using this:
\<forall>l. l el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisionsTo l M)) l

goal (1 subgoal):
 1. \<forall>literal. literal el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisions M)) literal
[PROOF STEP]
using InvariantImpliedLiteralsWeakerVariant[of "M" "F"]
[PROOF STATE]
proof (prove)
using this:
\<forall>l. l el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisionsTo l M)) l
\<forall>l. l el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisionsTo l M)) l \<Longrightarrow> \<forall>l. l el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisions M)) l

goal (1 subgoal):
 1. \<forall>literal. literal el elements M \<longrightarrow> formulaEntailsLiteral (F @ val2form (decisions M)) literal
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
formulaEntailsValuation (F @ val2form (decisions M)) (elements M)

goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
formulaFalse (F @ val2form (decisions M)) (elements M)
formulaEntailsValuation (F @ val2form (decisions M)) (elements M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
formulaFalse (F @ val2form (decisions M)) (elements M)
formulaEntailsValuation (F @ val2form (decisions M)) (elements M)

goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
using formulaFalseInEntailedValuationIsUnsatisfiable [of "F @ val2form (decisions M)" "elements M"]
[PROOF STATE]
proof (prove)
using this:
formulaFalse (F @ val2form (decisions M)) (elements M)
formulaEntailsValuation (F @ val2form (decisions M)) (elements M)
\<lbrakk>formulaFalse (F @ val2form (decisions M)) (elements M); formulaEntailsValuation (F @ val2form (decisions M)) (elements M)\<rbrakk> \<Longrightarrow> \<not> satisfiable (F @ val2form (decisions M))

goal (1 subgoal):
 1. \<not> satisfiable (F @ val2form (decisions M))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> satisfiable (F @ val2form (decisions M))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in jozsa) jozsa_transform_is_unitary_index_even:
  fixes i j:: nat
  assumes "i < dim_row U\<^sub>f" and "j < dim_col U\<^sub>f" and "even i"
  shows "(U\<^sub>f * U\<^sub>f) $$ (i,j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have "(U\<^sub>f * U\<^sub>f) $$ (i,j) = (\<Sum>k \<in> {i,i+1}. U\<^sub>f $$ (i,k) * U\<^sub>f $$ (k,j)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))
[PROOF STEP]
using U\<^sub>f_mult_without_empty_summands_even[of i j U\<^sub>f ] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < dim_row U\<^sub>f; j < dim_col U\<^sub>f; even i; dim_col U\<^sub>f = dim_row U\<^sub>f\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f
even i

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have "U\<^sub>f $$ (i,i) * U\<^sub>f $$ (i,j) = (1-f(i div 2)) * U\<^sub>f $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>f $$ (i, i) * U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j)
[PROOF STEP]
using assms(1,3)
[PROOF STATE]
proof (prove)
using this:
i < dim_row U\<^sub>f
even i

goal (1 subgoal):
 1. U\<^sub>f $$ (i, i) * U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, i) * U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, i) * U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have f0: "U\<^sub>f $$ (i,i+1) * U\<^sub>f $$ (i+1,j) = f(i div 2) * U\<^sub>f $$ (i+1,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>f $$ (i, i + 1) * U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)
[PROOF STEP]
by (metis One_nat_def Suc_leI add.right_neutral add_Suc_right assms(1) assms(3) diff_add_inverse2
even_add even_mult_iff jozsa_transform_coeff(3) jozsa_transform_dim le_add2 le_eq_less_or_eq odd_one
one_add_one power.simps(2))
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, i + 1) * U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))
U\<^sub>f $$ (i, i) * U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j)
U\<^sub>f $$ (i, i + 1) * U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)
[PROOF STEP]
have f1: "(U\<^sub>f * U\<^sub>f) $$ (i,j) = (1-f(i div 2)) * U\<^sub>f $$ (i,j) +  f(i div 2) * U\<^sub>f $$ (i+1,j)"
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * U\<^sub>f $$ (k, j))
U\<^sub>f $$ (i, i) * U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j)
U\<^sub>f $$ (i, i + 1) * U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
proof (induct rule: disj_four_cases)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. ?A2 \<or> ?B2 \<or> ?C2 \<or> ?D2
 2. \<lbrakk>?A2; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>?B2; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>?C2; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 5. \<lbrakk>?D2; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
show "j=i \<or> (j=i+1 \<and> odd j) \<or> (j=i-1 \<and> even j \<and> i\<ge>1) \<or> (j\<noteq>i \<and> \<not>(j=i+1 \<and> odd j) \<and> \<not> (j=i-1 \<and> even j \<and> i\<ge>1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j = i \<or> j = i + 1 \<and> odd j \<or> j = i - 1 \<and> even j \<and> 1 \<le> i \<or> j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
j = i \<or> j = i + 1 \<and> odd j \<or> j = i - 1 \<and> even j \<and> 1 \<le> i \<or> j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
assume a0:"j=i"
[PROOF STATE]
proof (state)
this:
j = i

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j = i
[PROOF STEP]
have "U\<^sub>f $$ (i,j) = (1-f(i div 2))"
[PROOF STATE]
proof (prove)
using this:
j = i

goal (1 subgoal):
 1. U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))
[PROOF STEP]
using assms(1,2) a0
[PROOF STATE]
proof (prove)
using this:
j = i
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f
j = i

goal (1 subgoal):
 1. U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have "U\<^sub>f $$ (i+1,j) = f(i div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2))
[PROOF STEP]
using assms(1,3) a0
[PROOF STATE]
proof (prove)
using this:
i < dim_row U\<^sub>f
even i
j = i

goal (1 subgoal):
 1. U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2))

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))
U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2))
[PROOF STEP]
have "(U\<^sub>f * U\<^sub>f) $$ (i,j) = (1-f(i div 2)) * (1-f(i div 2)) +  f(i div 2) * f(i div 2)"
[PROOF STATE]
proof (prove)
using this:
U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))
U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2))

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2))
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
U\<^sub>f $$ (i, j) = of_nat (1 - f (i div 2))
U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2))
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2))

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2))

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have "(1-f(i div 2)) * (1-f(i div 2)) + f(i div 2) * f(i div 2) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2) = 1
[PROOF STEP]
using f_values assms(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{i. i < 2 ^ n}. f x = 0 \<or> f x = 1
i < dim_row U\<^sub>f

goal (1 subgoal):
 1. (1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2) = 1
[PROOF STEP]
by (metis (no_types, lifting) Nat.minus_nat.diff_0 diff_add_0 diff_add_inverse jozsa_transform_dim(1)
          less_power_add_imp_div_less mem_Collect_eq mult_eq_if one_power2 power2_eq_square power_one_right)
[PROOF STATE]
proof (state)
this:
(1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2) = 1

goal (4 subgoals):
 1. \<lbrakk>j = i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 4. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2))
(1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2) = 1
[PROOF STEP]
show "(U\<^sub>f * U\<^sub>f) $$ (i,j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2))
(1 - f (i div 2)) * (1 - f (i div 2)) + f (i div 2) * f (i div 2) = 1

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
by(metis assms(2) a0 index_one_mat(1) of_nat_1)
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)

goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
assume a0: "(j=i+1 \<and> odd j)"
[PROOF STATE]
proof (state)
this:
j = i + 1 \<and> odd j

goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j = i + 1 \<and> odd j
[PROOF STEP]
have "U\<^sub>f $$ (i,j) = f(i div 2)"
[PROOF STATE]
proof (prove)
using this:
j = i + 1 \<and> odd j

goal (1 subgoal):
 1. U\<^sub>f $$ (i, j) = of_nat (f (i div 2))
[PROOF STEP]
using assms(1,2) a0
[PROOF STATE]
proof (prove)
using this:
j = i + 1 \<and> odd j
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f
j = i + 1 \<and> odd j

goal (1 subgoal):
 1. U\<^sub>f $$ (i, j) = of_nat (f (i div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, j) = of_nat (f (i div 2))

goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, j) = of_nat (f (i div 2))

goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have "U\<^sub>f $$ (i+1,j) = (1-f(i div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>f $$ (i + 1, j) = of_nat (1 - f (i div 2))
[PROOF STEP]
using assms(2,3) a0
[PROOF STATE]
proof (prove)
using this:
j < dim_col U\<^sub>f
even i
j = i + 1 \<and> odd j

goal (1 subgoal):
 1. U\<^sub>f $$ (i + 1, j) = of_nat (1 - f (i div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i + 1, j) = of_nat (1 - f (i div 2))

goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
U\<^sub>f $$ (i, j) = of_nat (f (i div 2))
U\<^sub>f $$ (i + 1, j) = of_nat (1 - f (i div 2))
[PROOF STEP]
have "(U\<^sub>f * U\<^sub>f) $$ (i,j) = (1-f(i div 2)) * f(i div 2) + f(i div 2) * (1-f(i div 2))"
[PROOF STATE]
proof (prove)
using this:
U\<^sub>f $$ (i, j) = of_nat (f (i div 2))
U\<^sub>f $$ (i + 1, j) = of_nat (1 - f (i div 2))

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * f (i div 2) + f (i div 2) * (1 - f (i div 2)))
[PROOF STEP]
using f0 f1 assms
[PROOF STATE]
proof (prove)
using this:
U\<^sub>f $$ (i, j) = of_nat (f (i div 2))
U\<^sub>f $$ (i + 1, j) = of_nat (1 - f (i div 2))
U\<^sub>f $$ (i, i + 1) * U\<^sub>f $$ (i + 1, j) = of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f
even i

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * f (i div 2) + f (i div 2) * (1 - f (i div 2)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * f (i div 2) + f (i div 2) * (1 - f (i div 2)))

goal (3 subgoals):
 1. \<lbrakk>j = i + 1 \<and> odd j; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 3. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * f (i div 2) + f (i div 2) * (1 - f (i div 2)))
[PROOF STEP]
show "(U\<^sub>f * U\<^sub>f) $$ (i,j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * f (i div 2) + f (i div 2) * (1 - f (i div 2)))

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
using assms(1,2) a0
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * f (i div 2) + f (i div 2) * (1 - f (i div 2)))
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f
j = i + 1 \<and> odd j

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)

goal (2 subgoals):
 1. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
assume "(j=i-1 \<and> even j \<and> i\<ge>1)"
[PROOF STATE]
proof (state)
this:
j = i - 1 \<and> even j \<and> 1 \<le> i

goal (2 subgoals):
 1. \<lbrakk>j = i - 1 \<and> even j \<and> 1 \<le> i; (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
 2. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j = i - 1 \<and> even j \<and> 1 \<le> i
[PROOF STEP]
show "(U\<^sub>f * U\<^sub>f) $$ (i,j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
j = i - 1 \<and> even j \<and> 1 \<le> i

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
using assms(3) dvd_diffD1 odd_one
[PROOF STATE]
proof (prove)
using this:
j = i - 1 \<and> even j \<and> 1 \<le> i
even i
\<lbrakk>?k dvd ?m - ?n; ?k dvd ?m; ?n \<le> ?m\<rbrakk> \<Longrightarrow> ?k dvd ?n
odd (1::?'a)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)

goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
assume a0:"(j\<noteq>i \<and> \<not>(j=i+1 \<and> odd j) \<and> \<not> (j=i-1 \<and> even j \<and> i\<ge>1))"
[PROOF STATE]
proof (state)
this:
j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)

goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)
[PROOF STEP]
have "U\<^sub>f $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
using this:
j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)

goal (1 subgoal):
 1. U\<^sub>f $$ (i, j) = 0
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f

goal (1 subgoal):
 1. U\<^sub>f $$ (i, j) = 0
[PROOF STEP]
by(metis index_transpose_mat(1) jozsa_transform_coeff_is_zero jozsa_transform_dim transpose_of_jozsa_transform)
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, j) = 0

goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i, j) = 0

goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
have "U\<^sub>f $$ (i+1,j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>f $$ (i + 1, j) = 0
[PROOF STEP]
using assms a0
[PROOF STATE]
proof (prove)
using this:
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f
even i
j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)

goal (1 subgoal):
 1. U\<^sub>f $$ (i + 1, j) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U\<^sub>f $$ (i + 1, j) = 0

goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
U\<^sub>f $$ (i, j) = 0
U\<^sub>f $$ (i + 1, j) = 0
[PROOF STEP]
have "(U\<^sub>f * U\<^sub>f) $$ (i,j) = (1-f(i div 2)) * 0 +  f(i div 2) * 0"
[PROOF STATE]
proof (prove)
using this:
U\<^sub>f $$ (i, j) = 0
U\<^sub>f $$ (i + 1, j) = 0

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * 0 + f (i div 2) * 0)
[PROOF STEP]
by (simp add: f1)
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * 0 + f (i div 2) * 0)

goal (1 subgoal):
 1. \<lbrakk>j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i); (U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat (1 - f (i div 2)) * U\<^sub>f $$ (i, j) + of_nat (f (i div 2)) * U\<^sub>f $$ (i + 1, j)\<rbrakk> \<Longrightarrow> (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * 0 + f (i div 2) * 0)
[PROOF STEP]
show "(U\<^sub>f * U\<^sub>f) $$ (i,j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * 0 + f (i div 2) * 0)

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
using a0 assms(1,2)
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = of_nat ((1 - f (i div 2)) * 0 + f (i div 2) * 0)
j \<noteq> i \<and> \<not> (j = i + 1 \<and> odd j) \<and> \<not> (j = i - 1 \<and> even j \<and> 1 \<le> i)
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f

goal (1 subgoal):
 1. (U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)
[PROOF STEP]
by(metis add.left_neutral index_one_mat(1) jozsa_transform_dim mult_0_right of_nat_0)
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * U\<^sub>f) $$ (i, j) = 1\<^sub>m (dim_col U\<^sub>f) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma godel_code'_nonzero[simp]: "0 < godel_code' nl n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < godel_code' nl n
[PROOF STEP]
apply(induct nl arbitrary: n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. 0 < godel_code' [] n
 2. \<And>a nl n. (\<And>n. 0 < godel_code' nl n) \<Longrightarrow> 0 < godel_code' (a # nl) n
[PROOF STEP]
apply(auto simp: godel_code'.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rel_restrictI:
  "x \<notin> R \<Longrightarrow> y \<notin> R \<Longrightarrow> (x,y) \<in> E \<Longrightarrow> (x,y) \<in> rel_restrict E R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> R; y \<notin> R; (x, y) \<in> E\<rbrakk> \<Longrightarrow> (x, y) \<in> rel_restrict E R
[PROOF STEP]
unfolding rel_restrict_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> R; y \<notin> R; (x, y) \<in> E\<rbrakk> \<Longrightarrow> (x, y) \<in> {(v, w). (v, w) \<in> E \<and> v \<notin> R \<and> w \<notin> R}
[PROOF STEP]
by auto


[STATEMENT]
lemma defined_inputs_alt_def : "defined_inputs M q = {t_input t | t . t \<in> transitions M \<and> t_source t = q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. defined_inputs M q = {t_input t |t. t \<in> FSM.transitions M \<and> t_source t = q}
[PROOF STEP]
unfolding defined_inputs_code
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t_input ` Set.filter (\<lambda>t. t_source t = q) (FSM.transitions M) = {t_input t |t. t \<in> FSM.transitions M \<and> t_source t = q}
[PROOF STEP]
by force


[STATEMENT]
lemma comp_substs_id_subst[simp]: "\<sigma>s \<odot>s replicate (length \<sigma>s) id_subst = \<sigma>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma>s \<odot>s replicate (length \<sigma>s) id_subst = \<sigma>s
[PROOF STEP]
using comp_substs_def
[PROOF STATE]
proof (prove)
using this:
?\<sigma>s \<odot>s ?\<tau>s = Map2.map2 (\<odot>) ?\<sigma>s ?\<tau>s

goal (1 subgoal):
 1. \<sigma>s \<odot>s replicate (length \<sigma>s) id_subst = \<sigma>s
[PROOF STEP]
by (induction \<sigma>s) auto


[STATEMENT]
lemma Some_those_nth:
  assumes "those ys = Some xs"
  assumes "i < length xs"
  shows "Some (xs!i) = ys!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Some (xs ! i) = ys ! i
[PROOF STEP]
using Some_those_length[OF assms(1)] assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
those ys = Some xs
i < length xs

goal (1 subgoal):
 1. Some (xs ! i) = ys ! i
[PROOF STEP]
by (induction xs ys arbitrary: i rule: list_induct2)
    (auto split: option.splits nat.splits simp: nth_Cons)


[STATEMENT]
lemma ord_term_strict_canc:
  assumes "t \<oplus> v \<prec>\<^sub>t t \<oplus> w"
  shows "v \<prec>\<^sub>t w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<prec>\<^sub>t w
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> v \<prec>\<^sub>t w \<Longrightarrow> False
[PROOF STEP]
assume "\<not> v \<prec>\<^sub>t w"
[PROOF STATE]
proof (state)
this:
\<not> v \<prec>\<^sub>t w

goal (1 subgoal):
 1. \<not> v \<prec>\<^sub>t w \<Longrightarrow> False
[PROOF STEP]
hence "w \<preceq>\<^sub>t v"
[PROOF STATE]
proof (prove)
using this:
\<not> v \<prec>\<^sub>t w

goal (1 subgoal):
 1. w \<preceq>\<^sub>t v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w \<preceq>\<^sub>t v

goal (1 subgoal):
 1. \<not> v \<prec>\<^sub>t w \<Longrightarrow> False
[PROOF STEP]
hence "t \<oplus> w \<preceq>\<^sub>t t \<oplus> v"
[PROOF STATE]
proof (prove)
using this:
w \<preceq>\<^sub>t v

goal (1 subgoal):
 1. t \<oplus> w \<preceq>\<^sub>t t \<oplus> v
[PROOF STEP]
by (rule splus_mono)
[PROOF STATE]
proof (state)
this:
t \<oplus> w \<preceq>\<^sub>t t \<oplus> v

goal (1 subgoal):
 1. \<not> v \<prec>\<^sub>t w \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
t \<oplus> v \<prec>\<^sub>t t \<oplus> w
t \<oplus> w \<preceq>\<^sub>t t \<oplus> v
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
t \<oplus> v \<prec>\<^sub>t t \<oplus> w
t \<oplus> w \<preceq>\<^sub>t t \<oplus> v

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_less_eq_aux'_trans: "\<lbrakk> A \<sqsubseteq>'' B; B \<sqsubseteq>'' C \<rbrakk> \<Longrightarrow> A \<sqsubseteq>'' C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<sqsubseteq>'' B; B \<sqsubseteq>'' C\<rbrakk> \<Longrightarrow> A \<sqsubseteq>'' C
[PROOF STEP]
by(auto simp add: set_less_eq_aux'_def del: equalityI intro: set_less_eq_aux_trans dest: set_less_eq_aux_infinite_complement_partitionD)


[STATEMENT]
lemma pequiv_trans[intro,trans]:
  "\<lbrakk> a \<simeq> b; b \<simeq> c \<rbrakk> \<Longrightarrow> a \<simeq> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<simeq> b; b \<simeq> c\<rbrakk> \<Longrightarrow> a \<simeq> c
[PROOF STEP]
unfolding pequiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>P. sound P \<longrightarrow> wp a P = wp b P; \<forall>P. sound P \<longrightarrow> wp b P = wp c P\<rbrakk> \<Longrightarrow> \<forall>P. sound P \<longrightarrow> wp a P = wp c P
[PROOF STEP]
by(auto intro!:order_trans)


[STATEMENT]
lemma funpow_dist1_le_card:
  assumes "y \<in> orbit f x" "x \<in> orbit f x"
  shows "funpow_dist1 f x y \<le> card (orbit f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. funpow_dist1 f x y \<le> card (orbit f x)
[PROOF STEP]
using funpow_dist1_le[OF assms]
[PROOF STATE]
proof (prove)
using this:
funpow_dist1 f x y \<le> funpow_dist1 f x x

goal (1 subgoal):
 1. funpow_dist1 f x y \<le> card (orbit f x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
funpow_dist1 f x y \<le> funpow_dist1 f x x
y \<in> orbit f x
x \<in> orbit f x

goal (1 subgoal):
 1. funpow_dist1 f x y \<le> card (orbit f x)
[PROOF STEP]
by (simp add: card_orbit_eq_funpow_dist1)


[STATEMENT]
lemma PPs_closed_adds:
  assumes "s \<in> .[X]" and "t adds s"
  shows "t \<in> .[X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> .[X]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<in> .[X]
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
t adds s
[PROOF STEP]
have "s - (s - t) = t"
[PROOF STATE]
proof (prove)
using this:
t adds s

goal (1 subgoal):
 1. s - (s - t) = t
[PROOF STEP]
by (metis add_minus_2 adds_minus)
[PROOF STATE]
proof (state)
this:
s - (s - t) = t

goal (1 subgoal):
 1. t \<in> .[X]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
s - (s - t) = t

goal (1 subgoal):
 1. t \<in> .[X]
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
s \<in> .[X]
[PROOF STEP]
have "s - (s - t) \<in> .[X]"
[PROOF STATE]
proof (prove)
using this:
s \<in> .[X]

goal (1 subgoal):
 1. s - (s - t) \<in> .[X]
[PROOF STEP]
by (rule PPs_closed_minus)
[PROOF STATE]
proof (state)
this:
s - (s - t) \<in> .[X]

goal (1 subgoal):
 1. t \<in> .[X]
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
s - (s - t) = t
s - (s - t) \<in> .[X]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s - (s - t) = t
s - (s - t) \<in> .[X]

goal (1 subgoal):
 1. t \<in> .[X]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
t \<in> .[X]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irbd_rbd_inv2: "Sup_pres \<phi> \<Longrightarrow> (bd\<^sub>\<R> \<circ> bd\<^sup>-\<^sub>\<R>) \<phi> = \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_pres \<phi> \<Longrightarrow> (bd\<^sub>\<R> \<circ> bd\<^sup>-\<^sub>\<R>) \<phi> = \<phi>
[PROOF STEP]
by (metis comp_apply fbd_ifbd_galois irbd_def r2f_f2r_galois rbd_def)


[STATEMENT]
lemma bddh_exists: "\<exists>n. bddh n B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. bddh n B
[PROOF STEP]
proof (induct B)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>n. bddh n (Leaf x)
 2. \<And>B1 B2. \<lbrakk>\<exists>n. bddh n B1; \<exists>n. bddh n B2\<rbrakk> \<Longrightarrow> \<exists>n. bddh n (Branch B1 B2)
[PROOF STEP]
case (Branch l r)
[PROOF STATE]
proof (state)
this:
\<exists>n. bddh n l
\<exists>n. bddh n r

goal (2 subgoals):
 1. \<And>x. \<exists>n. bddh n (Leaf x)
 2. \<And>B1 B2. \<lbrakk>\<exists>n. bddh n B1; \<exists>n. bddh n B2\<rbrakk> \<Longrightarrow> \<exists>n. bddh n (Branch B1 B2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. bddh n l
\<exists>n. bddh n r
[PROOF STEP]
obtain n m where L: "bddh n l" and R: "bddh m r"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. bddh n l
\<exists>n. bddh n r

goal (1 subgoal):
 1. (\<And>n m. \<lbrakk>bddh n l; bddh m r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bddh n l
bddh m r

goal (2 subgoals):
 1. \<And>x. \<exists>n. bddh n (Leaf x)
 2. \<And>B1 B2. \<lbrakk>\<exists>n. bddh n B1; \<exists>n. bddh n B2\<rbrakk> \<Longrightarrow> \<exists>n. bddh n (Branch B1 B2)
[PROOF STEP]
with bddh_ge[of n "max n m" l] bddh_ge[of m "max n m" r]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n \<le> max n m; bddh n l\<rbrakk> \<Longrightarrow> bddh (max n m) l
\<lbrakk>m \<le> max n m; bddh m r\<rbrakk> \<Longrightarrow> bddh (max n m) r
bddh n l
bddh m r
[PROOF STEP]
have "bddh (Suc (max n m)) (Branch l r)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n \<le> max n m; bddh n l\<rbrakk> \<Longrightarrow> bddh (max n m) l
\<lbrakk>m \<le> max n m; bddh m r\<rbrakk> \<Longrightarrow> bddh (max n m) r
bddh n l
bddh m r

goal (1 subgoal):
 1. bddh (Suc (max n m)) (Branch l r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bddh (Suc (max n m)) (Branch l r)

goal (2 subgoals):
 1. \<And>x. \<exists>n. bddh n (Leaf x)
 2. \<And>B1 B2. \<lbrakk>\<exists>n. bddh n B1; \<exists>n. bddh n B2\<rbrakk> \<Longrightarrow> \<exists>n. bddh n (Branch B1 B2)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
bddh (Suc (max n m)) (Branch l r)

goal (1 subgoal):
 1. \<exists>n. bddh n (Branch l r)
[PROOF STEP]
by (rule exI)
[PROOF STATE]
proof (state)
this:
\<exists>n. bddh n (Branch l r)

goal (1 subgoal):
 1. \<And>x. \<exists>n. bddh n (Leaf x)
[PROOF STEP]
qed simp


[STATEMENT]
lemma gcd_dvdI1: "a dvd c \<Longrightarrow> gcd a b dvd c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd c \<Longrightarrow> gcd a b dvd c
[PROOF STEP]
by (rule dvd_trans) (rule gcd_dvd1)


[STATEMENT]
lemma blinfun_apply_Pair_add2: "blinfun_apply f (0, a + b) = blinfun_apply f (0, a) + blinfun_apply f (0, b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply f (0::'b, a + b) = blinfun_apply f (0::'b, a) + blinfun_apply f (0::'b, b)
[PROOF STEP]
unfolding blinfun.bilinear_simps[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply f (0::'b, a + b) = blinfun_apply f ((0::'b, a) + (0::'b, b))
[PROOF STEP]
by simp


[STATEMENT]
lemma find_Some: "List.find P l = Some p \<Longrightarrow> p\<in>set l \<and> P p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.find P l = Some p \<Longrightarrow> p \<in> set l \<and> P p
[PROOF STEP]
by (induction l) (auto split: if_splits)