[STATEMENT]
lemma card_inj_on_subset_funcset: assumes finB: "finite B"
  and finC: "finite C"
  and AB: "A \<subseteq> B"
shows "card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} =
  card C^(card B - card A) * prod ((-) (card C)) {0 ..< card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
define D where "D = B - A"
[PROOF STATE]
proof (state)
this:
D = B - A

goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
from AB
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> B
[PROOF STEP]
have B: "B = A \<union> D" and disj: "A \<inter> D = {}"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B

goal (1 subgoal):
 1. B = A \<union> D &&& A \<inter> D = {}
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B

goal (1 subgoal):
 1. B = A \<union> (B - A) &&& A \<inter> (B - A) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B = A \<union> D
A \<inter> D = {}

goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
have sub: "card B - card A = card D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B - card A = card D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B - card A = card (B - A)
[PROOF STEP]
using finB AB
[PROOF STATE]
proof (prove)
using this:
finite B
A \<subseteq> B

goal (1 subgoal):
 1. card B - card A = card (B - A)
[PROOF STEP]
by (metis card_Diff_subset finite_subset)
[PROOF STATE]
proof (state)
this:
card B - card A = card D

goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
have "finite A" "finite D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A &&& finite D
[PROOF STEP]
using finB
[PROOF STATE]
proof (prove)
using this:
finite B

goal (1 subgoal):
 1. finite A &&& finite D
[PROOF STEP]
unfolding B
[PROOF STATE]
proof (prove)
using this:
finite (A \<union> D)

goal (1 subgoal):
 1. finite A &&& finite D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite A
finite D

goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
finite D

goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
unfolding sub
[PROOF STATE]
proof (prove)
using this:
finite A
finite D

goal (1 subgoal):
 1. card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
unfolding B
[PROOF STATE]
proof (prove)
using this:
finite A
finite D

goal (1 subgoal):
 1. card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
using disj
[PROOF STATE]
proof (prove)
using this:
finite A
finite D
A \<inter> D = {}

goal (1 subgoal):
 1. card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * prod ((-) (card C)) {0..<card A}
[PROOF STEP]
proof (induct A rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite D; {} \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> {} \<union> D \<rightarrow>\<^sub>E C. inj_on f {}} = card C ^ card D * prod ((-) (card C)) {0..<card {}}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
finite D
{} \<inter> D = {}

goal (2 subgoals):
 1. \<lbrakk>finite D; {} \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> {} \<union> D \<rightarrow>\<^sub>E C. inj_on f {}} = card C ^ card D * prod ((-) (card C)) {0..<card {}}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
from card_funcsetE[OF this(1), of C]
[PROOF STATE]
proof (chain)
picking this:
card (D \<rightarrow>\<^sub>E C) = card C ^ card D
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (D \<rightarrow>\<^sub>E C) = card C ^ card D

goal (1 subgoal):
 1. card {f. f \<in> {} \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f {}} = card C ^ card D * prod ((-) (card C)) {0..<card {}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {f. f \<in> {} \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f {}} = card C ^ card D * prod ((-) (card C)) {0..<card {}}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
\<lbrakk>finite D; A \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} = card C ^ card D * prod ((-) (card C)) {0..<card A}
finite D
insert a A \<inter> D = {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "{f. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f (insert a A)}
      = {f(a := c) | f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}"
      (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} = {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
 2. {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} \<subseteq> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}
[PROOF STEP]
show "?r \<subseteq> ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} \<subseteq> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}
[PROOF STEP]
by (auto intro: inj_on_fun_updI split: if_splits)
[PROOF STATE]
proof (state)
this:
{f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} \<subseteq> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
{f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} \<subseteq> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
assume f: "f \<in> ?l"
[PROOF STATE]
proof (state)
this:
f \<in> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
let ?g = "f(a := undefined)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
let ?h = "?g(a := f a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
have mem: "f a \<in> C - ?g ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<in> C - f(a := undefined) ` A
[PROOF STEP]
using insert(1,2,4,5) f
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
finite D
insert a A \<inter> D = {}
f \<in> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}

goal (1 subgoal):
 1. f a \<in> C - f(a := undefined) ` A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f a \<in> C - f(a := undefined) ` A

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
f \<in> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}
[PROOF STEP]
have f: "f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C" "inj_on f (insert a A)"
[PROOF STATE]
proof (prove)
using this:
f \<in> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)}

goal (1 subgoal):
 1. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C &&& inj_on f (insert a A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C
inj_on f (insert a A)

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
hence "?g \<in> A \<union> D \<rightarrow>\<^sub>E C" "inj_on ?g A"
[PROOF STATE]
proof (prove)
using this:
f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C
inj_on f (insert a A)

goal (1 subgoal):
 1. f(a := undefined) \<in> A \<union> D \<rightarrow>\<^sub>E C &&& inj_on (f(a := undefined)) A
[PROOF STEP]
using \<open>a \<notin> A\<close> \<open>insert a A \<inter> D = {}\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C
inj_on f (insert a A)
a \<notin> A
insert a A \<inter> D = {}

goal (1 subgoal):
 1. f(a := undefined) \<in> A \<union> D \<rightarrow>\<^sub>E C &&& inj_on (f(a := undefined)) A
[PROOF STEP]
by (auto split: if_splits simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
f(a := undefined) \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on (f(a := undefined)) A

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
with mem
[PROOF STATE]
proof (chain)
picking this:
f a \<in> C - f(a := undefined) ` A
f(a := undefined) \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on (f(a := undefined)) A
[PROOF STEP]
have "?h \<in> ?r"
[PROOF STATE]
proof (prove)
using this:
f a \<in> C - f(a := undefined) ` A
f(a := undefined) \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on (f(a := undefined)) A

goal (1 subgoal):
 1. f(a := undefined, a := f a) \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f(a := undefined, a := f a) \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f(a := undefined, a := f a) \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
have "?h = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f(a := undefined, a := f a) = f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f(a := undefined, a := f a) = f

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f \<in> {uu_. \<exists>f c. uu_ = f(a := c) \<and> f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
have "f \<in> ?r"
[PROOF STATE]
proof (prove)
using this:
f \<in> {uu_. \<exists>f c. uu_ = f(a := c) \<and> f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. f \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?f2 \<in> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<Longrightarrow> ?f2 \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
thus "?l \<subseteq> ?r"
[PROOF STATE]
proof (prove)
using this:
?f2 \<in> {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<Longrightarrow> ?f2 \<in> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. {f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} \<subseteq> {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} = {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert a A)} = {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "\<dots> = (\<lambda> (f, c). f (a := c)) `
         (Sigma {f . f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} (\<lambda> f. C - f ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} = (\<lambda>(f, c). f(a := c)) ` (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} = (\<lambda>(f, c). f(a := c)) ` (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{f(a := c) |f c. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A \<and> c \<in> C - f ` A} = (\<lambda>(f, c). f(a := c)) ` (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "card (...) = card (Sigma {f . f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} (\<lambda> f. C - f ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>(f, c). f(a := c)) ` (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)) = card (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)
[PROOF STEP]
proof (rule card_image, intro inj_onI, clarsimp, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
case (1 f c g d)
[PROOF STATE]
proof (state)
this:
f(a := c) = g(a := d)
c \<in> C
c \<notin> f ` A
d \<in> C
d \<notin> g ` A
f \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on f A
g \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on g A

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
let ?f = "f(a := c, a := undefined)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
let ?g = "g(a := d, a := undefined)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
f(a := c) = g(a := d)
c \<in> C
c \<notin> f ` A
d \<in> C
d \<notin> g ` A
f \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on f A
g \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on g A
[PROOF STEP]
have id: "f(a := c) = g(a := d)"
[PROOF STATE]
proof (prove)
using this:
f(a := c) = g(a := d)
c \<in> C
c \<notin> f ` A
d \<in> C
d \<notin> g ` A
f \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on f A
g \<in> A \<union> D \<rightarrow>\<^sub>E C
inj_on g A

goal (1 subgoal):
 1. f(a := c) = g(a := d)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f(a := c) = g(a := d)

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
from fun_upd_eqD[OF id]
[PROOF STATE]
proof (chain)
picking this:
c = d
[PROOF STEP]
have cd: "c = d"
[PROOF STATE]
proof (prove)
using this:
c = d

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

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
from id
[PROOF STATE]
proof (chain)
picking this:
f(a := c) = g(a := d)
[PROOF STEP]
have "?f = ?g"
[PROOF STATE]
proof (prove)
using this:
f(a := c) = g(a := d)

goal (1 subgoal):
 1. f(a := c, a := undefined) = g(a := d, a := undefined)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f(a := c, a := undefined) = g(a := d, a := undefined)

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f(a := c, a := undefined) = g(a := d, a := undefined)

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
have "?f = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f(a := c, a := undefined) = f
[PROOF STEP]
using `f \<in> A \<union> D \<rightarrow>\<^sub>E C` insert(1,2,4,5)
[PROOF STATE]
proof (prove)
using this:
f \<in> A \<union> D \<rightarrow>\<^sub>E C
finite A
a \<notin> A
finite D
insert a A \<inter> D = {}

goal (1 subgoal):
 1. f(a := c, a := undefined) = f
[PROOF STEP]
by (intro ext, auto)
[PROOF STATE]
proof (state)
this:
f(a := c, a := undefined) = f

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f(a := c, a := undefined) = f

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
have "?g = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g(a := d, a := undefined) = g
[PROOF STEP]
using `g \<in> A \<union> D \<rightarrow>\<^sub>E C` insert(1,2,4,5)
[PROOF STATE]
proof (prove)
using this:
g \<in> A \<union> D \<rightarrow>\<^sub>E C
finite A
a \<notin> A
finite D
insert a A \<inter> D = {}

goal (1 subgoal):
 1. g(a := d, a := undefined) = g
[PROOF STEP]
by (intro ext, auto)
[PROOF STATE]
proof (state)
this:
g(a := d, a := undefined) = g

goal (1 subgoal):
 1. \<And>aa b aaa ba. \<lbrakk>aa(a := b) = aaa(a := ba); b \<in> C; b \<notin> aa ` A; ba \<in> C; ba \<notin> aaa ` A; aa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aa A; aaa \<in> A \<union> D \<rightarrow>\<^sub>E C; inj_on aaa A\<rbrakk> \<Longrightarrow> aa = aaa \<and> b = ba
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f = g
[PROOF STEP]
show "f = g \<and> c = d"
[PROOF STATE]
proof (prove)
using this:
f = g

goal (1 subgoal):
 1. f = g \<and> c = d
[PROOF STEP]
using cd
[PROOF STATE]
proof (prove)
using this:
f = g
c = d

goal (1 subgoal):
 1. f = g \<and> c = d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = g \<and> c = d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card ((\<lambda>(f, c). f(a := c)) ` (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)) = card (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ((\<lambda>(f, c). f(a := c)) ` (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)) = card (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "\<dots> = (\<Sum>f\<in>{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. card (C - f ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A) = (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card (C - f ` A))
[PROOF STEP]
by (rule card_SigmaI, rule finite_subset[of _ "A \<union> D \<rightarrow>\<^sub>E C"],
          insert \<open>finite C\<close> \<open>finite D\<close> \<open>finite A\<close>, auto intro!: finite_PiE)
[PROOF STATE]
proof (state)
this:
card (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A) = (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card (C - f ` A))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (SIGMA f:{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. C - f ` A) = (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card (C - f ` A))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "\<dots> = (\<Sum>f\<in>{f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}. card C - card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card (C - f ` A)) = (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card C - card A)
[PROOF STEP]
by (rule sum.cong[OF refl], subst card_Diff_subset, insert \<open>finite A\<close>, auto simp: card_image)
[PROOF STATE]
proof (state)
this:
(\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card (C - f ` A)) = (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card C - card A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card (C - f ` A)) = (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card C - card A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "\<dots> = (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card C - card A) = (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card C - card A) = (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>f | f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A. card C - card A) = (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "\<dots> = card C ^ card D * ((card C - card A) * prod ((-) (card C)) {0..<card A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * ((card C - card A) * prod ((-) (card C)) {0..<card A})
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>finite D; A \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} = card C ^ card D * prod ((-) (card C)) {0..<card A}
finite D
insert a A \<inter> D = {}

goal (1 subgoal):
 1. (card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * ((card C - card A) * prod ((-) (card C)) {0..<card A})
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
(card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * ((card C - card A) * prod ((-) (card C)) {0..<card A})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(card C - card A) * card {f \<in> A \<union> D \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ card D * ((card C - card A) * prod ((-) (card C)) {0..<card A})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "(card C - card A) * prod ((-) (card C)) {0..<card A} =
      prod ((-) (card C)) {0..<Suc (card A)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card C - card A) * prod ((-) (card C)) {0..<card A} = prod ((-) (card C)) {0..<Suc (card A)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(card C - card A) * prod ((-) (card C)) {0..<card A} = prod ((-) (card C)) {0..<Suc (card A)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(card C - card A) * prod ((-) (card C)) {0..<card A} = prod ((-) (card C)) {0..<Suc (card A)}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
have "Suc (card A) = card (insert a A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card A) = card (insert a A)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>finite D; A \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f. f \<in> A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f A} = card C ^ card D * prod ((-) (card C)) {0..<card A}
finite D
insert a A \<inter> D = {}

goal (1 subgoal):
 1. Suc (card A) = card (insert a A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc (card A) = card (insert a A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite D; F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> F \<union> D \<rightarrow>\<^sub>E C. inj_on f F} = card C ^ card D * prod ((-) (card C)) {0..<card F}; finite D; insert x F \<inter> D = {}\<rbrakk> \<Longrightarrow> card {f \<in> insert x F \<union> D \<rightarrow>\<^sub>E C. inj_on f (insert x F)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert x F)}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {f. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f (insert a A)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert a A)}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card {f. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f (insert a A)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert a A)}

goal (1 subgoal):
 1. card {f. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f (insert a A)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert a A)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {f. f \<in> insert a A \<union> D \<rightarrow>\<^sub>E C \<and> inj_on f (insert a A)} = card C ^ card D * prod ((-) (card C)) {0..<card (insert a A)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {f \<in> B \<rightarrow>\<^sub>E C. inj_on f A} = card C ^ (card B - card A) * prod ((-) (card C)) {0..<card A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sinh_real_le_iff [simp]: "sinh x \<le> sinh y \<longleftrightarrow> x \<le> (y::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sinh x \<le> sinh y) = (x \<le> y)
[PROOF STEP]
using sinh_real_strict_mono
[PROOF STATE]
proof (prove)
using this:
strict_mono sinh

goal (1 subgoal):
 1. (sinh x \<le> sinh y) = (x \<le> y)
[PROOF STEP]
by (simp add: strict_mono_less_eq)


[STATEMENT]
lemma scalar_mult_periodic_arithmetic:
  fixes f :: "nat \<Rightarrow> complex" and a :: complex
  assumes "periodic_arithmetic f k"
  shows "periodic_arithmetic (\<lambda>n. a * f n) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. a * f n) k
[PROOF STEP]
using mult_periodic_arithmetic[OF const_periodic_arithmetic[of a k] assms(1)]
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>n. a * f n) k

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. a * f n) k
[PROOF STEP]
by simp


[STATEMENT]
lemma Bseq_Suc_iff: "Bseq (\<lambda>n. f (Suc n)) \<longleftrightarrow> Bseq f"
  for f :: "nat \<Rightarrow> 'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq (\<lambda>n. f (Suc n)) = Bseq f
[PROOF STEP]
using Bseq_offset[of f 1]
[PROOF STATE]
proof (prove)
using this:
Bseq (\<lambda>n. f (n + 1)) \<Longrightarrow> Bseq f

goal (1 subgoal):
 1. Bseq (\<lambda>n. f (Suc n)) = Bseq f
[PROOF STEP]
by (auto intro: Bseq_subseq)


[STATEMENT]
lemma list_eq: "(length xs = length ys \<and> (\<forall>i<length xs. xs!i=ys!i)) = (xs=ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i)) = (xs = ys)
[PROOF STEP]
apply(rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i) \<Longrightarrow> xs = ys
 2. xs = ys \<Longrightarrow> length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! i = ys ! i\<rbrakk> \<Longrightarrow> xs = ys
 2. xs = ys \<Longrightarrow> length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i)
[PROOF STEP]
apply(erule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>\<forall>i<length xs. xs ! i = ys ! i; i < length xs\<rbrakk> \<Longrightarrow> xs ! i = ys ! i
 2. xs = ys \<Longrightarrow> length xs = length ys \<and> (\<forall>i<length xs. xs ! i = ys ! i)
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma min_height_balanced:
  assumes "balanced kdt"
  shows "min_height kdt = nat(floor(log 2 (size_kdt kdt)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
assume *: "complete kdt"
[PROOF STATE]
proof (state)
this:
KD_Tree.complete kdt

goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
hence "size_kdt kdt = 2 ^ min_height kdt"
[PROOF STATE]
proof (prove)
using this:
KD_Tree.complete kdt

goal (1 subgoal):
 1. KD_Tree.size_kdt kdt = 2 ^ min_height kdt
[PROOF STEP]
by (simp add: complete_iff_height size_if_complete)
[PROOF STATE]
proof (state)
this:
KD_Tree.size_kdt kdt = 2 ^ min_height kdt

goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
from log2_of_power_eq[OF this]
[PROOF STATE]
proof (chain)
picking this:
real (min_height kdt) = log 2 (real (KD_Tree.size_kdt kdt))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (min_height kdt) = log 2 (real (KD_Tree.size_kdt kdt))

goal (1 subgoal):
 1. min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>

goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
assume *: "\<not> complete kdt"
[PROOF STATE]
proof (state)
this:
\<not> KD_Tree.complete kdt

goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
hence "height kdt = min_height kdt + 1"
[PROOF STATE]
proof (prove)
using this:
\<not> KD_Tree.complete kdt

goal (1 subgoal):
 1. height kdt = min_height kdt + 1
[PROOF STEP]
using assms min_height_le_height[of kdt]
[PROOF STATE]
proof (prove)
using this:
\<not> KD_Tree.complete kdt
balanced kdt
min_height kdt \<le> height kdt

goal (1 subgoal):
 1. height kdt = min_height kdt + 1
[PROOF STEP]
by(auto simp add: balanced_def complete_iff_height)
[PROOF STATE]
proof (state)
this:
height kdt = min_height kdt + 1

goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
hence "size_kdt kdt < 2 ^ (min_height kdt + 1)"
[PROOF STATE]
proof (prove)
using this:
height kdt = min_height kdt + 1

goal (1 subgoal):
 1. KD_Tree.size_kdt kdt < 2 ^ (min_height kdt + 1)
[PROOF STEP]
by (metis * size_height_if_incomplete)
[PROOF STATE]
proof (state)
this:
KD_Tree.size_kdt kdt < 2 ^ (min_height kdt + 1)

goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
hence "log 2 (size_kdt kdt) < min_height kdt + 1"
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt kdt < 2 ^ (min_height kdt + 1)

goal (1 subgoal):
 1. log 2 (real (KD_Tree.size_kdt kdt)) < real (min_height kdt + 1)
[PROOF STEP]
using log2_of_power_less size_ge0
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt kdt < 2 ^ (min_height kdt + 1)
\<lbrakk>?m < 2 ^ ?n; 0 < ?m\<rbrakk> \<Longrightarrow> log 2 (real ?m) < real ?n
0 < KD_Tree.size_kdt ?kdt

goal (1 subgoal):
 1. log 2 (real (KD_Tree.size_kdt kdt)) < real (min_height kdt + 1)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
log 2 (real (KD_Tree.size_kdt kdt)) < real (min_height kdt + 1)

goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
log 2 (real (KD_Tree.size_kdt kdt)) < real (min_height kdt + 1)

goal (1 subgoal):
 1. min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
using min_height_size_log[of kdt]
[PROOF STATE]
proof (prove)
using this:
log 2 (real (KD_Tree.size_kdt kdt)) < real (min_height kdt + 1)
real (min_height kdt) \<le> log 2 (real (KD_Tree.size_kdt kdt))

goal (1 subgoal):
 1. min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
min_height kdt = nat \<lfloor>log 2 (real (KD_Tree.size_kdt kdt))\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dist_transform:
  fixes p :: point and \<delta> :: real and l :: int
  shows "dist p (l, snd p) < \<delta> \<longleftrightarrow> l - \<delta> < fst p \<and> fst p < l + \<delta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < \<delta>) = (real_of_int l - \<delta> < real_of_int (fst p) \<and> real_of_int (fst p) < real_of_int l + \<delta>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < \<delta>) = (real_of_int l - \<delta> < real_of_int (fst p) \<and> real_of_int (fst p) < real_of_int l + \<delta>)
[PROOF STEP]
have "dist p (l, snd p) = sqrt ((real_of_int (fst p) - l)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt ((real_of_int (fst p) - real_of_int l)\<^sup>2)
[PROOF STEP]
by (auto simp add: dist_prod_def dist_real_def prod.case_eq_if)
[PROOF STATE]
proof (state)
this:
dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt ((real_of_int (fst p) - real_of_int l)\<^sup>2)

goal (1 subgoal):
 1. (dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < \<delta>) = (real_of_int l - \<delta> < real_of_int (fst p) \<and> real_of_int (fst p) < real_of_int l + \<delta>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt ((real_of_int (fst p) - real_of_int l)\<^sup>2)

goal (1 subgoal):
 1. (dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < \<delta>) = (real_of_int l - \<delta> < real_of_int (fst p) \<and> real_of_int (fst p) < real_of_int l + \<delta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(dist (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case (l, snd p) of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < \<delta>) = (real_of_int l - \<delta> < real_of_int (fst p) \<and> real_of_int (fst p) < real_of_int l + \<delta>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_form:
  assumes "open_form f" "length xs = DIM('a::executable_euclidean_space)" "distinct xs"
  shows "open (Collect (\<lambda>x::'a. interpret_form f (list_updates xs (list_of_eucl x) vs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. interpret_form f (list_updates xs (list_of_eucl x) vs)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open_form f
length xs = DIM('a)
distinct xs

goal (1 subgoal):
 1. open {x. interpret_form f (list_updates xs (list_of_eucl x) vs)}
[PROOF STEP]
by (induction f) (auto intro!: open_Collect_less continuous_on_floatarith open_Collect_conj open_Collect_disj)


[STATEMENT]
lemma rel_interior_injective_linear_image:
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  assumes "bounded_linear f"
    and "inj f"
  shows "rel_interior (f ` S) = f ` (rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (f ` S) = f ` rel_interior S
[PROOF STEP]
using assms rel_interior_injective_on_span_linear_image[of f S]
    subset_inj_on[of f "UNIV" "span S"]
[PROOF STATE]
proof (prove)
using this:
bounded_linear f
inj f
\<lbrakk>bounded_linear f; inj_on f (span S)\<rbrakk> \<Longrightarrow> rel_interior (f ` S) = f ` rel_interior S
\<lbrakk>inj f; span S \<subseteq> UNIV\<rbrakk> \<Longrightarrow> inj_on f (span S)

goal (1 subgoal):
 1. rel_interior (f ` S) = f ` rel_interior S
[PROOF STEP]
by auto


[STATEMENT]
lemma  (in Module) mHom_tOp_assoc:"\<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N;
        h \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N (tOp_mHom R M N f g) h =
          tOp_mHom R M N f (tOp_mHom R M N g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; h \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N (tOp_mHom R M N f g) h = tOp_mHom R M N f (tOp_mHom R M N g h)
[PROOF STEP]
apply (frule_tac f = f and g = g in tOp_mHom_closed [of N], assumption+,
       frule_tac f = "tOp_mHom R M N f g" and g = h in
                      tOp_mHom_closed [of N], assumption+,
       frule_tac f = g and g = h in tOp_mHom_closed [of N], assumption+,
       frule_tac f = f and g = "tOp_mHom R M N g h" in
                      tOp_mHom_closed [of N], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; h \<in> mHom R M N; tOp_mHom R M N f g \<in> mHom R M N; tOp_mHom R M N (tOp_mHom R M N f g) h \<in> mHom R M N; tOp_mHom R M N g h \<in> mHom R M N; tOp_mHom R M N f (tOp_mHom R M N g h) \<in> mHom R M N\<rbrakk> \<Longrightarrow> tOp_mHom R M N (tOp_mHom R M N f g) h = tOp_mHom R M N f (tOp_mHom R M N g h)
[PROOF STEP]
apply (rule mHom_eq, assumption+, rule ballI,
        thin_tac "tOp_mHom R M N f g \<in> mHom R M N",
        thin_tac "tOp_mHom R M N (tOp_mHom R M N f g) h \<in> mHom R M N",
        thin_tac "tOp_mHom R M N g h \<in> mHom R M N",
        thin_tac "tOp_mHom R M N f (tOp_mHom R M N g h) \<in> mHom R M N")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; h \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> tOp_mHom R M N (tOp_mHom R M N f g) h m = tOp_mHom R M N f (tOp_mHom R M N g h) m
[PROOF STEP]
apply (simp add:tOp_mHom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; h \<in> mHom R M N; m \<in> carrier M\<rbrakk> \<Longrightarrow> f m \<plusminus>\<^bsub>N\<^esub> g m \<plusminus>\<^bsub>N\<^esub> h m = f m \<plusminus>\<^bsub>N\<^esub> (g m \<plusminus>\<^bsub>N\<^esub> h m)
[PROOF STEP]
apply (frule_tac f = f and m = m in mHom_mem [of N], assumption+,
        frule_tac f = g and m = m in mHom_mem [of N], assumption+,
        frule_tac f = h and m = m in mHom_mem [of N], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; h \<in> mHom R M N; m \<in> carrier M; f m \<in> carrier N; g m \<in> carrier N; h m \<in> carrier N\<rbrakk> \<Longrightarrow> f m \<plusminus>\<^bsub>N\<^esub> g m \<plusminus>\<^bsub>N\<^esub> h m = f m \<plusminus>\<^bsub>N\<^esub> (g m \<plusminus>\<^bsub>N\<^esub> h m)
[PROOF STEP]
apply (frule Module.module_is_ag [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>R module N; f \<in> mHom R M N; g \<in> mHom R M N; h \<in> mHom R M N; m \<in> carrier M; f m \<in> carrier N; g m \<in> carrier N; h m \<in> carrier N; aGroup N\<rbrakk> \<Longrightarrow> f m \<plusminus>\<^bsub>N\<^esub> g m \<plusminus>\<^bsub>N\<^esub> h m = f m \<plusminus>\<^bsub>N\<^esub> (g m \<plusminus>\<^bsub>N\<^esub> h m)
[PROOF STEP]
apply (simp add:aGroup.ag_pOp_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem ln_upper_15: "0<x \<Longrightarrow> ln(x) \<le> ln_upper_15 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> ln_upper_15 x
[PROOF STEP]
by (metis le_less_linear less_eq_real_def ln_upper_15_neg ln_upper_15_pos)


[STATEMENT]
lemma omega_loop_fixpoint:
  "y * (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<squnion> z = y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<squnion> z = y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. y * (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<squnion> z \<le> y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z
 2. y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z \<le> y * (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<squnion> z
[PROOF STEP]
apply (smt (verit, ccfv_threshold) eq_refl mult_isotone mult_left_sub_dist_sup omega_induct omega_unfold star.circ_loop_fixpoint sup_assoc sup_commute sup_right_isotone)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z \<le> y * (y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z) \<squnion> z
[PROOF STEP]
by (smt (z3) mult_left_sub_dist_sup omega_unfold star.circ_loop_fixpoint sup.left_commute sup_commute sup_right_isotone)


[STATEMENT]
lemma less_3_cases: "n < 3 \<Longrightarrow> n = 0 \<or> n = Suc 0 \<or> n = Suc (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < 3 \<Longrightarrow> n = 0 \<or> n = Suc 0 \<or> n = Suc (Suc 0)
[PROOF STEP]
by auto