[STATEMENT]
lemma (in Ring) prime_ideal_cont1Tr:"ideal R A  \<Longrightarrow>
      \<forall>P. ((P \<in> {j. j \<le> (n::nat)} \<rightarrow> {X. prime_ideal R X}) \<and>
                   (A \<subseteq> \<Union> (P ` {j. j \<le> n}))) \<longrightarrow> (\<exists>i\<le> n. A \<subseteq> (P i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal R A \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i)
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ideal R A \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> 0} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> 0}) \<longrightarrow> (\<exists>i\<le>0. A \<subseteq> P i)
 2. \<And>n. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i)\<rbrakk> \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}) \<longrightarrow> (\<exists>i\<le>Suc n. A \<subseteq> P i)
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>P. \<lbrakk>ideal R A; P \<in> {j. j \<le> 0} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> 0})\<rbrakk> \<Longrightarrow> \<exists>i\<le>0. A \<subseteq> P i
 2. \<And>n. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i)\<rbrakk> \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}) \<longrightarrow> (\<exists>i\<le>Suc n. A \<subseteq> P i)
[PROOF STEP]
apply (erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>P. \<lbrakk>ideal R A; P \<in> {j. j \<le> 0} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> 0})\<rbrakk> \<Longrightarrow> \<exists>i\<le>0. A \<subseteq> P i
 2. \<And>n. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i)\<rbrakk> \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}) \<longrightarrow> (\<exists>i\<le>Suc n. A \<subseteq> P i)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i)\<rbrakk> \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}) \<longrightarrow> (\<exists>i\<le>Suc n. A \<subseteq> P i)
[PROOF STEP]
(** n **)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i)\<rbrakk> \<Longrightarrow> \<forall>P. P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}) \<longrightarrow> (\<exists>i\<le>Suc n. A \<subseteq> P i)
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> Suc n})\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (erule conjE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n})\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (case_tac "\<exists>i \<le> (Suc n). \<exists>j\<le> (Suc n). (i \<noteq> j \<and> P i \<subseteq> P j)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
 2. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply ((erule exE, erule conjE)+, erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P i j. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); i \<le> Suc n; j \<le> Suc n; i \<noteq> j; P i \<subseteq> P j\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
 2. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (frule_tac f = P and n = n and X = "{X. prime_ideal R X}" and
         A = A and i = i and j = j in Un_less_Un, assumption+, simp+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P i j. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); i \<le> Suc n; j \<le> Suc n; i \<noteq> j; P i \<subseteq> P j; A \<subseteq> \<Union> (compose {j. j \<le> n} P (skip i) ` {j. j \<le> n})\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
 2. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (frule mutch_aux1, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P i j. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); i \<le> Suc n; j \<le> Suc n; i \<noteq> j; P i \<subseteq> P j; A \<subseteq> \<Union> (compose {j. j \<le> n} P (skip i) ` {j. j \<le> n}); compose {j. j \<le> n} P (skip i) \<in> {j. j \<le> n} \<rightarrow> Collect (prime_ideal R)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
 2. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (frule_tac a = "compose {j. j \<le> n} P (skip i)" in forall_spec,
        simp, erule exE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P i j ia. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); i \<le> Suc n; j \<le> Suc n; i \<noteq> j; P i \<subseteq> P j; A \<subseteq> \<Union> (compose {j. j \<le> n} P (skip i) ` {j. j \<le> n}); compose {j. j \<le> n} P (skip i) \<in> {j. j \<le> n} \<rightarrow> Collect (prime_ideal R); ia \<le> n \<and> A \<subseteq> compose {j. j \<le> n} P (skip i) ia\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
 2. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (cut_tac i = i and n = n and x = ia in skip_fun_im1,
               simp+, erule conjE, simp add:compose_def,blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
(** last_step induction assumption is of no use **)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; \<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and> A \<subseteq> \<Union> (P ` {j. j \<le> n}) \<longrightarrow> (\<exists>i\<le>n. A \<subseteq> P i); P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<not> (\<exists>i\<le>Suc n. \<exists>j\<le>Suc n. i \<noteq> j \<and> P i \<subseteq> P j)\<rbrakk> \<Longrightarrow> \<exists>i\<le>Suc n. A \<subseteq> P i
[PROOF STEP]
apply (thin_tac "\<forall>P. P \<in> {j. j \<le> n} \<rightarrow> {X. prime_ideal R X} \<and>
               A \<subseteq> \<Union>(P ` {j. j \<le> n}) \<longrightarrow>
               (\<exists>i\<le>n. A \<subseteq> P i)",
       rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (cut_tac n = n and P = P in prod_prime [of A], assumption)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i\<rbrakk> \<Longrightarrow> \<forall>k\<le>Suc n. prime_ideal R (P k)
 2. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i\<rbrakk> \<Longrightarrow> \<forall>l\<le>Suc n. \<not> A \<subseteq> P l
 3. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i\<rbrakk> \<Longrightarrow> \<forall>k\<le>Suc n. \<forall>l\<le>Suc n. k = l \<or> \<not> P k \<subseteq> P l
 4. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (rule allI, rule impI,
     frule_tac f = P and A = "{j. j \<le> (Suc n)}" and B = "{X. prime_ideal R X}"
     and x = k in funcset_mem, simp, simp, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule_tac n = "Suc n" and
        f = "\<lambda>i\<in>{j. j \<le> (Suc n)}. (nprod R (ppa R P A i) n)" in
        nsum_ideal_inc[of A], rule allI, rule impI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (subgoal_tac "(nsum R (\<lambda>i\<in>{j. j \<le> (Suc n)}. nprod R (ppa R P A i) n)
        (Suc n)) \<notin> (\<Union>x\<in>{j. j \<le> (Suc n)}. P x)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> \<Union> (P ` {j. j \<le> Suc n})\<rbrakk> \<Longrightarrow> False
 2. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> \<Union> (P ` {j. j \<le> Suc n})
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> \<Union> (P ` {j. j \<le> Suc n})
[PROOF STEP]
apply (simp del:nsum_suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A\<rbrakk> \<Longrightarrow> \<forall>x\<le>Suc n. \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> P x
[PROOF STEP]
apply (rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P x. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A; x \<le> Suc n\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> P x
[PROOF STEP]
apply (rename_tac n P l)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A; l \<le> Suc n\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> P l
[PROOF STEP]
apply (frule_tac f = P and A = "{j. j \<le> (Suc n)}" and
         B = "{X. prime_ideal R X}"
         and x = l in funcset_mem, simp, simp del:nsum_suc,
         frule_tac I = "P l" in prime_ideal_ideal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l)\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<notin> P l
[PROOF STEP]
apply (rule_tac A = "P l" and n = "Suc n" and
         f = "\<lambda>i\<in>{j. j \<le> (Suc n)}. (nprod R (ppa R P A i) n)" in
         nsum_ideal_exc, simp+, rule allI, simp add:ideal_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) Suc n \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l)\<rbrakk> \<Longrightarrow> \<exists>j\<le>Suc n. (\<forall>la\<in>{i. i \<le> Suc n} - {j}. (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) la \<in> P l) \<and> (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) j \<notin> P l
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j; \<forall>i\<le>Suc n. \<not> A \<subseteq> P i; \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); \<forall>j\<le>Suc n. (\<exists>la\<in>{i. i \<le> Suc n} - {j}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<notin> P l) \<or> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A j \<in> P l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (rotate_tac -1,
         frule_tac a = l in forall_spec, simp,
         thin_tac "\<forall>j\<le>Suc n.
           (\<exists>la\<in>{i. i \<le> Suc n} - {j}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<notin> P l) \<or>
           e\<Pi>\<^bsub>R,n\<^esub> ppa R P A j \<in> P l",
         thin_tac "\<forall>i\<le>Suc n. \<forall>j\<le>Suc n. i = j \<or> \<not> P i \<subseteq> P j",
         thin_tac "\<forall>i\<le>Suc n. \<not> A \<subseteq> P i")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); (\<exists>la\<in>{i. i \<le> Suc n} - {l}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<notin> P l) \<or> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A l \<in> P l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (erule disjE, erule bexE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P l la. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); la \<in> {i. i \<le> Suc n} - {l}; e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<notin> P l\<rbrakk> \<Longrightarrow> False
 2. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); e\<Pi>\<^bsub>R,n\<^esub> ppa R P A l \<in> P l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule_tac a = la in forall_spec, simp,
         thin_tac "\<forall>i\<le>Suc n.
           e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and>
           (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and>
           e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i",
           (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n P l la. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); la \<in> {i. i \<le> Suc n} - {l}; e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<notin> P l; e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<in> A; \<forall>l\<in>{j. j \<le> Suc n} - {la}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<in> P l; e\<Pi>\<^bsub>R,n\<^esub> ppa R P A la \<notin> P la\<rbrakk> \<Longrightarrow> False
 2. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); e\<Pi>\<^bsub>R,n\<^esub> ppa R P A l \<in> P l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n P l. \<lbrakk>ideal R A; P \<in> {j. j \<le> Suc n} \<rightarrow> {X. prime_ideal R X}; A \<subseteq> \<Union> (P ` {j. j \<le> Suc n}); \<forall>i\<le>Suc n. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> A \<and> (\<forall>l\<in>{j. j \<le> Suc n} - {i}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<in> P l) \<and> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i \<notin> P i; \<Sigma>\<^sub>e R (\<lambda>i\<in>{j. j \<le> Suc n}. e\<Pi>\<^bsub>R,n\<^esub> ppa R P A i) n \<plusminus> e\<Pi>\<^bsub>R,n\<^esub> ppa R P A (Suc n) \<in> A; l \<le> Suc n; prime_ideal R (P l); ideal R (P l); e\<Pi>\<^bsub>R,n\<^esub> ppa R P A l \<in> P l\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Corps) field_distribTr:"\<lbrakk>a \<in> carrier K; b \<in> carrier K;
      x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> a \<plusminus> (-\<^sub>a (b \<cdot>\<^sub>r x)) = (a \<cdot>\<^sub>r (x\<^bsup>\<hyphen>K\<^esup>) \<plusminus> (-\<^sub>a b)) \<cdot>\<^sub>r x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<cdot>\<^sub>r x = (a \<cdot>\<^sub>r x\<^bsup>\<hyphen> K\<^esup> \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r x
[PROOF STEP]
apply (cut_tac field_is_ring,
       cut_tac invf_closed1[of x], simp, erule conjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; x \<in> carrier K; x \<noteq> \<zero>; Ring K; x\<^bsup>\<hyphen> K\<^esup> \<in> carrier K; x\<^bsup>\<hyphen> K\<^esup> \<noteq> \<zero>\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<cdot>\<^sub>r x = (a \<cdot>\<^sub>r x\<^bsup>\<hyphen> K\<^esup> \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r x
 2. \<lbrakk>a \<in> carrier K; b \<in> carrier K; x \<in> carrier K; x \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> x \<in> carrier K - {\<zero>}
[PROOF STEP]
apply (
       simp add:Ring.ring_inv1_1[of "K" "b" "x"],
       frule Ring.ring_is_ag[of "K"],
       frule aGroup.ag_mOp_closed[of "K" "b"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; x \<in> carrier K; x \<noteq> \<zero>; Ring K; x\<^bsup>\<hyphen> K\<^esup> \<in> carrier K; x\<^bsup>\<hyphen> K\<^esup> \<noteq> \<zero>; aGroup K; -\<^sub>a b \<in> carrier K\<rbrakk> \<Longrightarrow> a \<plusminus> (-\<^sub>a b) \<cdot>\<^sub>r x = (a \<cdot>\<^sub>r x\<^bsup>\<hyphen> K\<^esup> \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r x
 2. \<lbrakk>a \<in> carrier K; b \<in> carrier K; x \<in> carrier K; x \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> x \<in> carrier K - {\<zero>}
[PROOF STEP]
apply (frule Ring.ring_tOp_closed[of "K" "a" "x\<^bsup>\<hyphen>K\<^esup>"], assumption+,
       simp add:Ring.ring_distrib2, simp add:Ring.ring_tOp_assoc,
       simp add:linvf,
       simp add:Ring.ring_r_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier K; b \<in> carrier K; x \<in> carrier K; x \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> x \<in> carrier K - {\<zero>}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma wp_orbit: "wp ({(s,s') | s s'. s' \<in> \<gamma>\<^sup>\<phi> s}) \<lceil>Q\<rceil> = \<lceil>\<lambda>s. s \<in> S \<longrightarrow> (\<forall>t\<in>T. Q (\<phi> t s))\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp {(s, s') |s s'. s' \<in> \<gamma>\<^sup>\<phi> s} \<lceil>Q\<rceil> = \<lceil>\<lambda>s. s \<in> S \<longrightarrow> (\<forall>t\<in>T. Q (\<phi> t s))\<rceil>
[PROOF STEP]
unfolding orbit_def wp_g_ode g_ode_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>\<lambda>s. s \<in> S \<longrightarrow> (\<forall>t\<in>T. (\<forall>\<tau>\<in>down T t. True) \<longrightarrow> Q (\<phi> t s))\<rceil> = \<lceil>\<lambda>s. s \<in> S \<longrightarrow> (\<forall>t\<in>T. Q (\<phi> t s))\<rceil>
[PROOF STEP]
by auto


[STATEMENT]
lemma modify_roundup_ge1: "\<lbrakk>8 \<le> roundup emBits 8 * 8 - 168\<rbrakk> \<Longrightarrow> 176 \<le>  roundup emBits 8 * 8"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 8 \<le> roundup emBits 8 * 8 - 168 \<Longrightarrow> 176 \<le> roundup emBits 8 * 8
[PROOF STEP]
by arith


[STATEMENT]
lemma lookup_phiNodes_of:
  assumes [simp]: "finite (dom (phis g))"
  shows "Mapping.lookup (phiNodes_of g) v =
    (if (\<exists>n \<in> dom (phis g). v \<in> set (the (phis g n))) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
fix m n xs v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
have "Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert (n::'node \<times> 'val))) xs (m::('val, ('node \<times> 'val) set) mapping)) v =
      (case Mapping.lookup m v of None \<Rightarrow> (if v \<in> set xs then Some {n} else None)
        | Some N \<Rightarrow> (if v \<in> set xs then Some (insert n N) else Some N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert n)) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if v \<in> set xs then Some {n} else None | Some N \<Rightarrow> if v \<in> set xs then Some (insert n N) else Some N)
[PROOF STEP]
by (induction xs arbitrary: m) (auto simp: Mapping_lookup_map_default split: option.splits)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert n)) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if v \<in> set xs then Some {n} else None | Some N \<Rightarrow> if v \<in> set xs then Some (insert n N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (\<lambda>v. Mapping.map_default v {} (insert ?n3)) ?xs3 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if ?va3 \<in> set ?xs3 then Some {?n3} else None | Some N \<Rightarrow> if ?va3 \<in> set ?xs3 then Some (insert ?n3 N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
note phis_addN_conv = this [of n "case_option [] id (phis g n)" for n, folded phis_addN_def]
[PROOF STATE]
proof (state)
this:
Mapping.lookup (phis_addN g ?n6 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if ?va3 \<in> set (case phis g ?n6 of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some {?n6} else None | Some N \<Rightarrow> if ?va3 \<in> set (case phis g ?n6 of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some (insert ?n6 N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Mapping.lookup (phis_addN g ?n6 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if ?va3 \<in> set (case phis g ?n6 of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some {?n6} else None | Some N \<Rightarrow> if ?va3 \<in> set (case phis g ?n6 of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some (insert ?n6 N) else Some N)

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
fix xs m v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
have "Mapping.lookup (fold (phis_addN g) xs m) v =
      (case Mapping.lookup m v of None \<Rightarrow> if (\<exists>n \<in> set xs. v \<in> set (case_option [] id (phis g n))) then Some {n \<in> set xs. v \<in> set (case_option [] id (phis g n))} else None
        | Some N \<Rightarrow> Some ({n \<in> set xs. v \<in> set (case_option [] id (phis g n))} \<union> N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (fold (phis_addN g) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if \<exists>n\<in>set xs. v \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some {n \<in> set xs. v \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} else None | Some N \<Rightarrow> Some ({n \<in> set xs. v \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} \<union> N))
[PROOF STEP]
by (induction xs arbitrary: m) (auto simp: phis_addN_conv split: option.splits if_splits)+
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (phis_addN g) xs m) v = (case Mapping.lookup m v of None \<Rightarrow> if \<exists>n\<in>set xs. v \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some {n \<in> set xs. v \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} else None | Some N \<Rightarrow> Some ({n \<in> set xs. v \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} \<union> N))

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (phis_addN g) ?xs3 ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if \<exists>n\<in>set ?xs3. ?va3 \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some {n \<in> set ?xs3. ?va3 \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} else None | Some N \<Rightarrow> Some ({n \<in> set ?xs3. ?va3 \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} \<union> N))

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
note this [of "sorted_list_of_set (dom (phis g))", simp]
[PROOF STATE]
proof (state)
this:
Mapping.lookup (fold (phis_addN g) (sorted_list_of_set (dom (phis g))) ?m3) ?va3 = (case Mapping.lookup ?m3 ?va3 of None \<Rightarrow> if \<exists>n\<in>set (sorted_list_of_set (dom (phis g))). ?va3 \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x) then Some {n \<in> set (sorted_list_of_set (dom (phis g))). ?va3 \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} else None | Some N \<Rightarrow> Some ({n \<in> set (sorted_list_of_set (dom (phis g))). ?va3 \<in> set (case phis g n of None \<Rightarrow> [] | Some x \<Rightarrow> id x)} \<union> N))

goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
unfolding phiNodes_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (fold (phis_addN g) (sorted_list_of_set (dom (phis g))) Mapping.empty) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)
[PROOF STEP]
by (force split: option.splits simp: lookup_empty)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (phiNodes_of g) v = (if \<exists>n\<in>dom (phis g). v \<in> set (the (phis g n)) then Some {n \<in> dom (phis g). v \<in> set (the (phis g n))} else None)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fres_sol: "((y \<leftarrow> x) \<cdot> x = y) = (\<exists>z. z \<cdot> x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((y \<leftarrow> x) \<cdot> x = y) = (\<exists>z. z \<cdot> x = y)
[PROOF STEP]
using dual_order.antisym fres_canc1 fres_canc2 mult_isor
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> ?a = ?b
(?y \<leftarrow> ?x) \<cdot> ?x \<le> ?y
?y \<le> ?y \<cdot> ?x \<leftarrow> ?x
?x \<le> ?y \<Longrightarrow> ?x \<cdot> ?z \<le> ?y \<cdot> ?z

goal (1 subgoal):
 1. ((y \<leftarrow> x) \<cdot> x = y) = (\<exists>z. z \<cdot> x = y)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma istopology_subbase_UNIV:
   "istopology (arbitrary union_of (finite intersection_of P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. istopology (arbitrary union_of finite intersection_of P)
[PROOF STEP]
by (simp add: istopology_base finite_intersection_of_Int)


[STATEMENT]
lemma Infinitesimal_FreeUltrafilterNat_iff2:
  "star_n X \<in> Infinitesimal \<longleftrightarrow> (\<forall>m. eventually (\<lambda>n. norm (X n) < inverse (real (Suc m))) \<U>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X \<in> Infinitesimal) = (\<forall>m. \<forall>\<^sub>F n in \<U>. norm (X n) < inverse (real (Suc m)))
[PROOF STEP]
by (simp add: Infinitesimal_hypreal_of_nat_iff star_of_def hnorm_def
      star_of_nat_def starfun_star_n star_n_inverse star_n_less)


[STATEMENT]
lemma gfp_to_lfp_var:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'a"
  shows "gfp f = \<partial> (lfp (\<partial>\<^sub>F f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp f = \<partial> (lfp (\<partial>\<^sub>F f))
[PROOF STEP]
by (metis gfp_dual_var invol_dual_var)


[STATEMENT]
lemma fps_deriv_power:
  fixes a :: "'a::comm_semiring_1 fps"
  shows "fps_deriv (a ^ n) = fps_const (of_nat n) * fps_deriv a * a ^ (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (a ^ n) = fps_const (of_nat n) * fps_deriv a * a ^ (n - 1)
[PROOF STEP]
by (simp add: fps_deriv_power' fps_of_nat)


[STATEMENT]
lemma r_distinguishable_k_0_alt_def :
  "r_distinguishable_k M q1 q2 0 = (\<exists> x \<in> (inputs M) . \<not>(\<exists> y q1' q2' . (q1,x,y,q1') \<in> transitions M \<and> (q2,x,y,q2') \<in> transitions M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 0 = (\<exists>x\<in>FSM.inputs M. \<nexists>y q1' q2'. (q1, x, y, q1') \<in> FSM.transitions M \<and> (q2, x, y, q2') \<in> FSM.transitions M)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma of_nat_ceiling: "of_nat (nat \<lceil>r\<rceil>) \<ge> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<le> of_nat (nat \<lceil>r\<rceil>)
[PROOF STEP]
by (cases "r\<ge>0") auto


[STATEMENT]
lemma iMOD_0_card: "card [r, mod 0] = Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card [ r, mod 0 ] = Suc 0
[PROOF STEP]
by (simp add: iMOD_0 iIN_card)


[STATEMENT]
lemma flatf_lfp_transfer:
    \<comment> \<open>Transfer rule for least fixed points\<close>
    fixes B::"(_ \<Rightarrow> 'a::order_bot) \<Rightarrow> _"
    assumes TR_BOT[simp]: "\<And>x. tr bot x"
    assumes MONO: "flatf_mono_le B"
    assumes MONO': "flatf_mono_le B'"
    assumes R0: "P x x'"
    assumes RS: "\<And>f f' x x'.
       \<lbrakk>\<And>x x'. P x x' \<Longrightarrow> tr (f x) (f' x'); P x x'; flatf_lfp B' = f'\<rbrakk>
       \<Longrightarrow> tr (B f x) (B' f' x')"
    shows "tr (flatf_lfp B x) (flatf_lfp B' x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tr (flatf_lfp B x) (flatf_lfp B' x')
[PROOF STEP]
apply (rule flatf_fixp_transfer[where tr=tr and fp'="flatf_lfp B'" and P=P])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>x'. tr bot x'
 2. monotone flatf_le flatf_le B
 3. flatf_lfp B' = ?B' (flatf_lfp B')
 4. P x x'
 5. \<And>f f' x x'. \<lbrakk>\<And>x x'. P x x' \<Longrightarrow> tr (f x) (f' x'); P x x'; flatf_lfp B' = f'\<rbrakk> \<Longrightarrow> tr (B f x) (?B' f' x')
[PROOF STEP]
apply (fact|rule flatf_ord.fixp_unfold[OF MONO'])+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zless2: "0 < (2 :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2
[PROOF STEP]
by (fact zero_less_numeral)


[STATEMENT]
lemma echelon_form_of_column_k_JNF_code[code]:
  "echelon_form_of_column_k_JNF bezout (A,i) k =
    (if (i = dim_row A) \<or> (\<forall>m \<in> {i..<dim_row A}. A $$ (m, k) = 0) then (A, i) else
        if (\<forall>m\<in>{i+1..<dim_row A}. A $$ (m,k) = 0) then (A, i + 1) else
            let n = the (find_non0' i k A);
                interchange_A = swaprows i n A
           in
            (bezout_iterate_JNF (interchange_A) (dim_row A - 1) i k bezout, i + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
proof (cases "\<not> ((i = dim_row A) \<or> (\<forall>m \<in> {i..<dim_row A}. A $$ (m, k) = 0))
            \<and> \<not> (\<forall>m\<in>{i+1..<dim_row A}. A $$ (m,k) = 0)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
 2. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))

goal (2 subgoals):
 1. \<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
 2. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
let ?n = "the (find_non0' i k A)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
 2. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
let ?interchange_A = "swaprows i ?n A"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
 2. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
have f_rw: "(the (find_non0' i k A)) = (LEAST n. A $$ (n, k) \<noteq> 0 \<and> i \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the (find_non0' i k A) = (LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n)
[PROOF STEP]
proof (rule find_non0'_LEAST)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> carrier_mat ?m ?n
 2. find_non0' i k A = Some (the (find_non0' i k A))
[PROOF STEP]
have "find_non0' i k A \<noteq> None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_non0' i k A \<noteq> None
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))

goal (1 subgoal):
 1. find_non0' i k A \<noteq> None
[PROOF STEP]
unfolding find_non0'_def Let_def
[PROOF STATE]
proof (prove)
using this:
\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))

goal (1 subgoal):
 1. (case filter (\<lambda>j. A $$ (j, k) \<noteq> (0::'a)) [i..<dim_row A] of [] \<Rightarrow> None | a # list \<Rightarrow> Some (filter (\<lambda>j. A $$ (j, k) \<noteq> (0::'a)) [i..<dim_row A] ! 0)) \<noteq> None
[PROOF STEP]
by (auto split: list.split)
         (metis (mono_tags, lifting) atLeastLessThan_iff atLeastLessThan_upt empty_filter_conv)
[PROOF STATE]
proof (state)
this:
find_non0' i k A \<noteq> None

goal (2 subgoals):
 1. A \<in> carrier_mat ?m ?n
 2. find_non0' i k A = Some (the (find_non0' i k A))
[PROOF STEP]
thus "find_non0' i k A = Some (the (find_non0' i k A))"
[PROOF STATE]
proof (prove)
using this:
find_non0' i k A \<noteq> None

goal (1 subgoal):
 1. find_non0' i k A = Some (the (find_non0' i k A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
find_non0' i k A = Some (the (find_non0' i k A))

goal (1 subgoal):
 1. A \<in> carrier_mat ?m ?n
[PROOF STEP]
qed (auto)
[PROOF STATE]
proof (state)
this:
the (find_non0' i k A) = (LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n)

goal (2 subgoals):
 1. \<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
 2. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
unfolding echelon_form_of_column_k_JNF_def Let_def f_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (A, i) of (A, i) \<Rightarrow> if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else (bezout_iterate_JNF (swaprows i (LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n) A) (dim_row A - 1) i k bezout, i + 1)) = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else (bezout_iterate_JNF (swaprows i (LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n) A) (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))

goal (1 subgoal):
 1. (case (A, i) of (A, i) \<Rightarrow> if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else (bezout_iterate_JNF (swaprows i (LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n) A) (dim_row A - 1) i k bezout, i + 1)) = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else (bezout_iterate_JNF (swaprows i (LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n) A) (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))

goal (1 subgoal):
 1. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)))

goal (1 subgoal):
 1. \<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a))) \<Longrightarrow> echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)))

goal (1 subgoal):
 1. echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
unfolding echelon_form_of_column_k_JNF_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<not> (i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a))) \<and> \<not> (\<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a)))

goal (1 subgoal):
 1. (let (A, i) = (A, i) in if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = LEAST n. A $$ (n, k) \<noteq> (0::'a) \<and> i \<le> n; interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1)) = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
echelon_form_of_column_k_JNF bezout (A, i) k = (if i = dim_row A \<or> (\<forall>m\<in>{i..<dim_row A}. A $$ (m, k) = (0::'a)) then (A, i) else if \<forall>m\<in>{i + 1..<dim_row A}. A $$ (m, k) = (0::'a) then (A, i + 1) else let n = the (find_non0' i k A); interchange_A = swaprows i n A in (bezout_iterate_JNF interchange_A (dim_row A - 1) i k bezout, i + 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Rats_closure_real2: "closure (\<rat>\<times>\<rat>) = (UNIV::real set)\<times>(UNIV::real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (\<rat> \<times> \<rat>) = UNIV \<times> UNIV
[PROOF STEP]
by (simp add: Rats_closure_real closure_Times)


[STATEMENT]
lemma (in -)
  assumes "filterlim f (nhds L) F"
  shows tendsto_imp_filterlim_at_right:
          "eventually (\<lambda>x. f x > L) F \<Longrightarrow> filterlim f (at_right L) F"
    and tendsto_imp_filterlim_at_left:
          "eventually (\<lambda>x. f x < L) F \<Longrightarrow> filterlim f (at_left L) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. L < f x \<Longrightarrow> filterlim f (at_right L) F) &&& (\<forall>\<^sub>F x in F. f x < L \<Longrightarrow> filterlim f (at_left L) F)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> L) F

goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. L < f x \<Longrightarrow> filterlim f (at_right L) F) &&& (\<forall>\<^sub>F x in F. f x < L \<Longrightarrow> filterlim f (at_left L) F)
[PROOF STEP]
by (auto simp: filterlim_at elim: eventually_mono)


[STATEMENT]
lemma open_neighbourhood_base_at:
   "(\<And>S. \<lbrakk>P S; x \<in> S\<rbrakk> \<Longrightarrow> openin X S)
        \<Longrightarrow> neighbourhood_base_at x P X \<longleftrightarrow> (\<forall>W. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. P U \<and> x \<in> U \<and> U \<subseteq> W))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>P S; x \<in> S\<rbrakk> \<Longrightarrow> openin X S) \<Longrightarrow> neighbourhood_base_at x P X = (\<forall>W. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. P U \<and> x \<in> U \<and> U \<subseteq> W))
[PROOF STEP]
unfolding neighbourhood_base_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>P S; x \<in> S\<rbrakk> \<Longrightarrow> openin X S) \<Longrightarrow> (\<forall>W. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U V. openin X U \<and> P V \<and> x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> W)) = (\<forall>W. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. P U \<and> x \<in> U \<and> U \<subseteq> W))
[PROOF STEP]
by (meson subsetD)


[STATEMENT]
lemma sorted_inorder_list_subtrees:
  "sorted_less (inorder_list ts) \<Longrightarrow> \<forall> sub \<in> set (subtrees ts). sorted_less (inorder sub)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_less (inorder_list ts) \<Longrightarrow> \<forall>sub\<in>set (subtrees ts). sorted_less (inorder sub)
[PROOF STEP]
apply(induction ts)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sorted_less (inorder_list []) \<Longrightarrow> \<forall>sub\<in>set (subtrees []). sorted_less (inorder sub)
 2. \<And>a ts. \<lbrakk>sorted_less (inorder_list ts) \<Longrightarrow> \<forall>sub\<in>set (subtrees ts). sorted_less (inorder sub); sorted_less (inorder_list (a # ts))\<rbrakk> \<Longrightarrow> \<forall>sub\<in>set (subtrees (a # ts)). sorted_less (inorder sub)
[PROOF STEP]
apply (auto simp add: sorted_lems)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lfp_trans_greatest:
  "\<lbrakk> \<And>t P. \<lbrakk> le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P) \<rbrakk> \<Longrightarrow> le_trans u t;
     \<And>P. sound P \<Longrightarrow> sound (v P); le_trans (T v) v \<rbrakk> \<Longrightarrow>
   le_trans u (lfp_trans T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>t P. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans u t; \<And>P. sound P \<Longrightarrow> sound (v P); le_trans (T v) v\<rbrakk> \<Longrightarrow> le_trans u (lfp_trans T)
[PROOF STEP]
unfolding lfp_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>t P. \<lbrakk>le_trans (T t) t; \<And>P. sound P \<Longrightarrow> sound (t P)\<rbrakk> \<Longrightarrow> le_trans u t; \<And>P. sound P \<Longrightarrow> sound (v P); le_trans (T v) v\<rbrakk> \<Longrightarrow> le_trans u (Inf_trans {t. (\<forall>P. sound P \<longrightarrow> sound (t P)) \<and> le_trans (T t) t})
[PROOF STEP]
by(rule Inf_trans_greatest, auto)


[STATEMENT]
lemma QR_decomposition_square:
  fixes A::"real^'n::{mod_type}^'n::{mod_type}"
  assumes r: "rank A = ncols A"
  shows "A = fst (QR_decomposition A) ** snd (QR_decomposition A) \<and>
  orthogonal_matrix (fst (QR_decomposition A)) \<and>
  upper_triangular (snd (QR_decomposition A)) \<and>
  invertible (snd (QR_decomposition A)) \<and>
  pairwise orthogonal (columns (fst (QR_decomposition A))) \<and>
  (\<forall>i. norm (column i (fst (QR_decomposition A))) = 1) \<and>
  vec.independent (columns (fst (QR_decomposition A))) \<and>
  col_space A = col_space (fst (QR_decomposition A)) \<and>
  card (columns A) = card (columns (fst (QR_decomposition A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = fst (QR_decomposition A) ** snd (QR_decomposition A) \<and> orthogonal_matrix (fst (QR_decomposition A)) \<and> upper_triangular (snd (QR_decomposition A)) \<and> invertible (snd (QR_decomposition A)) \<and> pairwise orthogonal (columns (fst (QR_decomposition A))) \<and> (\<forall>i. norm (column i (fst (QR_decomposition A))) = 1) \<and> vec.independent (columns (fst (QR_decomposition A))) \<and> col_space A = col_space (fst (QR_decomposition A)) \<and> card (columns A) = card (columns (fst (QR_decomposition A)))
[PROOF STEP]
by (metis QR_decomposition orthogonal_matrix_fst_QR_decomposition' r)


[STATEMENT]
lemma sat_models_card:
  "finite P \<Longrightarrow> card ({sat_models (abs_ltln\<^sub>P \<phi>) \<inter> Pow P | \<phi>. prop_atoms \<phi> \<subseteq> P}) \<le> 2 ^ 2 ^ card P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite P \<Longrightarrow> card {sat_models (abs_ltln\<^sub>P \<phi>) \<inter> Pow P |\<phi>. prop_atoms \<phi> \<subseteq> P} \<le> 2 ^ 2 ^ card P
[PROOF STEP]
by (metis (mono_tags, lifting) sat_models_pow_pow Pow_def card_Pow card_mono finite_Collect_subsets)