[STATEMENT]
lemma gen_shleg_poly_altdef:
  assumes "k \<le> n"
  shows "gen_shleg_poly k =
            (\<Sum>i\<le>k. smult ((-1)^(k-i) * of_nat (k choose i) *
                    pochhammer (n-i+1) i * pochhammer (n-k+i+1) (k-i))
                    ([:0, 1:] ^ (n - i) * [:1, -1:] ^ (n-k+i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have *: "(pderiv ^^ i) (x \<circ>\<^sub>p [:1, -1:]) =
          smult ((-1) ^ i) ((pderiv ^^ i) x \<circ>\<^sub>p [:1, -1:])" for i and x :: "int poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pderiv ^^ i) (x \<circ>\<^sub>p [:1, - 1:]) = Polynomial.smult ((- 1) ^ i) ((pderiv ^^ i) x \<circ>\<^sub>p [:1, - 1:])
[PROOF STEP]
by (induction i arbitrary: x)
       (auto simp: pderiv_smult pderiv_pcompose funpow_Suc_right pderiv_pCons
                   higher_pderiv_minus simp del: funpow.simps(2))
[PROOF STATE]
proof (state)
this:
(pderiv ^^ ?i) (?x \<circ>\<^sub>p [:1, - 1:]) = Polynomial.smult ((- 1) ^ ?i) ((pderiv ^^ ?i) ?x \<circ>\<^sub>p [:1, - 1:])

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "gen_shleg_poly k = (pderiv ^^ k) ([:0, 1, -1:] ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.gen_shleg_poly k = (pderiv ^^ k) ([:0, 1, - 1:] ^ n)
[PROOF STEP]
by (simp add: gen_shleg_poly_def)
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly k = (pderiv ^^ k) ([:0, 1, - 1:] ^ n)

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly k = (pderiv ^^ k) ([:0, 1, - 1:] ^ n)

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "[:0, 1, -1::int:] = [:0, 1:] * [:1, -1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:0, 1, - 1:] = [:0, 1:] * [:1, - 1:]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[:0, 1, - 1:] = [:0, 1:] * [:1, - 1:]

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[:0, 1, - 1:] = [:0, 1:] * [:1, - 1:]

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "\<dots> ^ n = [:0, 1:] ^ n * [:1, -1:] ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([:0, 1:] * [:1, - 1:]) ^ n = [:0, 1:] ^ n * [:1, - 1:] ^ n
[PROOF STEP]
by (simp flip: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
([:0, 1:] * [:1, - 1:]) ^ n = [:0, 1:] ^ n * [:1, - 1:] ^ n

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
([:0, 1:] * [:1, - 1:]) ^ n = [:0, 1:] ^ n * [:1, - 1:] ^ n

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "(pderiv ^^ k) \<dots> =
               (\<Sum>i\<le>k. smult (of_nat (k choose i)) ((pderiv ^^ i)
                 ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, -1:] ^ n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pderiv ^^ k) ([:0, 1:] ^ n * [:1, - 1:] ^ n) = (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, - 1:] ^ n)))
[PROOF STEP]
by (simp add: higher_pderiv_mult)
[PROOF STATE]
proof (state)
this:
(pderiv ^^ k) ([:0, 1:] ^ n * [:1, - 1:] ^ n) = (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, - 1:] ^ n)))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(pderiv ^^ k) ([:0, 1:] ^ n * [:1, - 1:] ^ n) = (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, - 1:] ^ n)))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. smult (of_nat (k choose i))
                    ((pderiv ^^ i) (monom 1 n) * (pderiv ^^ (k - i)) (monom 1 n \<circ>\<^sub>p [:1, -1:])))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, - 1:] ^ n))) = (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n \<circ>\<^sub>p [:1, - 1:])))
[PROOF STEP]
by (simp add: monom_altdef pcompose_pCons pcompose_power_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, - 1:] ^ n))) = (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n \<circ>\<^sub>p [:1, - 1:])))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) ([:0, 1:] ^ n) * (pderiv ^^ (k - i)) ([:1, - 1:] ^ n))) = (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n \<circ>\<^sub>p [:1, - 1:])))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. smult ((-1) ^ (k - i) * of_nat (k choose i))
                   ((pderiv ^^ i) (monom 1 n) * ((pderiv ^^ (k - i)) (monom 1 n) \<circ>\<^sub>p [:1, -1:])))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n \<circ>\<^sub>p [:1, - 1:]))) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:]))
[PROOF STEP]
by (simp add: * mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n \<circ>\<^sub>p [:1, - 1:]))) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:]))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult (int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n \<circ>\<^sub>p [:1, - 1:]))) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:]))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. smult ((-1) ^ (k - i) * of_nat (k choose i))
                   (monom (pochhammer (n - i + 1) i) (n - i) *
                    monom (pochhammer (n - k + i + 1) (k - i)) (n - k + i) \<circ>\<^sub>p [:1, -1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:])) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) (Polynomial.monom (int (pochhammer (n - i + 1) i)) (n - i) * Polynomial.monom (int (pochhammer (n - k + i + 1) (k - i))) (n - k + i) \<circ>\<^sub>p [:1, - 1:]))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:])) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) (Polynomial.monom (int (pochhammer (n - i + 1) i)) (n - i) * Polynomial.monom (int (pochhammer (n - k + i + 1) (k - i))) (n - k + i) \<circ>\<^sub>p [:1, - 1:]))
[PROOF STEP]
by (simp add: higher_pderiv_monom)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:])) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) (Polynomial.monom (int (pochhammer (n - i + 1) i)) (n - i) * Polynomial.monom (int (pochhammer (n - k + i + 1) (k - i))) (n - k + i) \<circ>\<^sub>p [:1, - 1:]))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) ((pderiv ^^ i) (Polynomial.monom 1 n) * (pderiv ^^ (k - i)) (Polynomial.monom 1 n) \<circ>\<^sub>p [:1, - 1:])) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) (Polynomial.monom (int (pochhammer (n - i + 1) i)) (n - i) * Polynomial.monom (int (pochhammer (n - k + i + 1) (k - i))) (n - k + i) \<circ>\<^sub>p [:1, - 1:]))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. smult ((-1) ^ (k - i) * of_nat (k choose i) * pochhammer (n - i + 1) i * pochhammer (n - k + i + 1) (k - i))
                   ([:0, 1:] ^ (n - i) * [:1, -1:] ^ (n - k + i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) (Polynomial.monom (int (pochhammer (n - i + 1) i)) (n - i) * Polynomial.monom (int (pochhammer (n - k + i + 1) (k - i))) (n - k + i) \<circ>\<^sub>p [:1, - 1:])) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
by (simp add: monom_altdef algebra_simps pcompose_smult pcompose_power_left pcompose_pCons)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i)) (Polynomial.monom (int (pochhammer (n - i + 1) i)) (n - i) * Polynomial.monom (int (pochhammer (n - k + i + 1) (k - i))) (n - k + i) \<circ>\<^sub>p [:1, - 1:])) = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))

goal (1 subgoal):
 1. local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly k = (\<Sum>i\<le>k. Polynomial.smult ((- 1) ^ (k - i) * int (k choose i) * int (pochhammer (n - i + 1) i) * int (pochhammer (n - k + i + 1) (k - i))) ([:0, 1:] ^ (n - i) * [:1, - 1:] ^ (n - k + i)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lucas_lehmer_add_assoc:
  assumes m: "m > 0"
  shows   "lucas_lehmer_add m x (lucas_lehmer_add m y z) =
           lucas_lehmer_add m (lucas_lehmer_add m x y) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_add m x (lucas_lehmer_add m y z) = lucas_lehmer_add m (lucas_lehmer_add m x y) z
[PROOF STEP]
proof (rule prod_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
let ?add = "lucas_lehmer_add m"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
have "[fst (?add x (?add y z)) = fst x + (fst y + fst z)] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst x + (fst y + fst z)] (mod m)
[PROOF STEP]
by (rule lucas_lehmer_add_cong[THEN cong_trans] cong_add cong_mult cong_refl)+
[PROOF STATE]
proof (state)
this:
[fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst x + (fst y + fst z)] (mod m)

goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst x + (fst y + fst z)] (mod m)

goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
have "fst x + (fst y + fst z) = (fst x + fst y) + fst z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst x + (fst y + fst z) = fst x + fst y + fst z
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
fst x + (fst y + fst z) = fst x + fst y + fst z

goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fst x + (fst y + fst z) = fst x + fst y + fst z

goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
have "[\<dots> = fst (?add (?add x y) z)] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [fst x + fst y + fst z = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)
[PROOF STEP]
by (rule cong_sym, (rule lucas_lehmer_add_cong[THEN cong_trans] cong_add cong_mult cong_refl)+)
[PROOF STATE]
proof (state)
this:
[fst x + fst y + fst z = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)

goal (2 subgoals):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
 2. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)
[PROOF STEP]
show "fst (?add x (?add y z)) = fst (?add (?add x y) z)"
[PROOF STATE]
proof (prove)
using this:
[fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)

goal (1 subgoal):
 1. fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
by (rule cong_less_modulus_unique_nat)
       (use m in \<open>auto simp: lucas_lehmer_add_def case_prod_unfold\<close>)
[PROOF STATE]
proof (state)
this:
fst (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = fst (lucas_lehmer_add m (lucas_lehmer_add m x y) z)

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
have "[snd (?add x (?add y z)) = snd x + (snd y + snd z)] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd x + (snd y + snd z)] (mod m)
[PROOF STEP]
by (rule lucas_lehmer_add_cong[THEN cong_trans] cong_add cong_mult cong_refl)+
[PROOF STATE]
proof (state)
this:
[snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd x + (snd y + snd z)] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd x + (snd y + snd z)] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
have "snd x + (snd y + snd z) = (snd x + snd y) + snd z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd x + (snd y + snd z) = snd x + snd y + snd z
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
snd x + (snd y + snd z) = snd x + snd y + snd z

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
snd x + (snd y + snd z) = snd x + snd y + snd z

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
have "[\<dots> = snd (?add (?add x y) z)] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [snd x + snd y + snd z = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)
[PROOF STEP]
by (rule cong_sym, (rule lucas_lehmer_add_cong[THEN cong_trans] cong_add cong_mult cong_refl)+)
[PROOF STATE]
proof (state)
this:
[snd x + snd y + snd z = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)
[PROOF STEP]
show "snd (?add x (?add y z)) = snd (?add (?add x y) z)"
[PROOF STATE]
proof (prove)
using this:
[snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)] (mod m)

goal (1 subgoal):
 1. snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)
[PROOF STEP]
by (rule cong_less_modulus_unique_nat)
       (use m in \<open>auto simp: lucas_lehmer_add_def case_prod_unfold\<close>)
[PROOF STATE]
proof (state)
this:
snd (lucas_lehmer_add m x (lucas_lehmer_add m y z)) = snd (lucas_lehmer_add m (lucas_lehmer_add m x y) z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj2_abs_mult_rep:
  assumes "c \<noteq> 0"
  shows "proj2_abs (c *\<^sub>R proj2_rep x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_abs (c *\<^sub>R proj2_rep x) = x
[PROOF STEP]
using proj2_abs_mult and proj2_abs_rep and assms
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> 0 \<Longrightarrow> proj2_abs (?c *\<^sub>R ?v) = proj2_abs ?v
proj2_abs (proj2_rep ?x) = ?x
c \<noteq> 0

goal (1 subgoal):
 1. proj2_abs (c *\<^sub>R proj2_rep x) = x
[PROOF STEP]
by simp


[STATEMENT]
lemma inessential_spheremap_2:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes a2: "2 < DIM('a)" and b2: "DIM('b) = 2"
      and contf: "continuous_on (sphere a r) f" and fim: "f `(sphere a r) \<subseteq> (sphere b s)"
  obtains c where "homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "s \<le> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; s \<le> 0\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
s \<le> 0

goal (2 subgoals):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; s \<le> 0\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s \<le> 0

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using contf contractible_sphere fim nullhomotopic_into_contractible that
[PROOF STATE]
proof (prove)
using this:
s \<le> 0
continuous_on (sphere a r) f
contractible (sphere ?a ?r) = (?r \<le> 0)
f ` sphere a r \<subseteq> sphere b s
\<lbrakk>continuous_on ?S ?f; ?f ` ?S \<subseteq> ?T; contractible ?T; \<And>c. homotopic_with_canon (\<lambda>h. True) ?S ?T ?f (\<lambda>x. c) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. ?c) \<Longrightarrow> thesis

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

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> s \<le> 0

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> s \<le> 0
[PROOF STEP]
have "sphere b s homeomorphic sphere (0::complex) 1"
[PROOF STATE]
proof (prove)
using this:
\<not> s \<le> 0

goal (1 subgoal):
 1. sphere b s homeomorphic sphere 0 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> s \<le> 0
2 < DIM('a)
DIM('b) = 2
continuous_on (sphere a r) f
f ` sphere a r \<subseteq> sphere b s

goal (1 subgoal):
 1. sphere b s homeomorphic sphere 0 1
[PROOF STEP]
by (simp add: homeomorphic_spheres_gen)
[PROOF STATE]
proof (state)
this:
sphere b s homeomorphic sphere 0 1

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sphere b s homeomorphic sphere 0 1
[PROOF STEP]
obtain h k where hk: "homeomorphism (sphere b s) (sphere (0::complex) 1) h k"
[PROOF STATE]
proof (prove)
using this:
sphere b s homeomorphic sphere 0 1

goal (1 subgoal):
 1. (\<And>h k. homeomorphism (sphere b s) (sphere 0 1) h k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: homeomorphic_def)
[PROOF STATE]
proof (state)
this:
homeomorphism (sphere b s) (sphere 0 1) h k

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphism (sphere b s) (sphere 0 1) h k
[PROOF STEP]
have conth: "continuous_on (sphere b s) h"
       and  contk: "continuous_on (sphere 0 1) k"
       and  him: "h ` sphere b s \<subseteq> sphere 0 1"
       and  kim: "k ` sphere 0 1 \<subseteq> sphere b s"
[PROOF STATE]
proof (prove)
using this:
homeomorphism (sphere b s) (sphere 0 1) h k

goal (1 subgoal):
 1. (continuous_on (sphere b s) h &&& continuous_on (sphere 0 1) k) &&& h ` sphere b s \<subseteq> sphere 0 1 &&& k ` sphere 0 1 \<subseteq> sphere b s
[PROOF STEP]
by (simp_all add: homeomorphism_def)
[PROOF STATE]
proof (state)
this:
continuous_on (sphere b s) h
continuous_on (sphere 0 1) k
h ` sphere b s \<subseteq> sphere 0 1
k ` sphere 0 1 \<subseteq> sphere b s

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain c where "homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (rule inessential_spheremap_2_aux [OF a2])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> continuous_on (sphere ?a2 ?r2) ?f2
 2. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> ?f2 ` sphere ?a2 ?r2 \<subseteq> sphere 0 1
 3. \<And>c. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis; homotopic_with_canon (\<lambda>z. True) (sphere ?a2 ?r2) (sphere 0 1) ?f2 (\<lambda>x. c)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "continuous_on (sphere a r) (h \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (sphere a r) (h \<circ> f)
[PROOF STEP]
by (meson continuous_on_compose [OF contf] conth continuous_on_subset fim)
[PROOF STATE]
proof (state)
this:
continuous_on (sphere a r) (h \<circ> f)

goal (2 subgoals):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> (h \<circ> f) ` sphere a r \<subseteq> sphere 0 1
 2. \<And>c. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis; homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "(h \<circ> f) ` sphere a r \<subseteq> sphere 0 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<circ> f) ` sphere a r \<subseteq> sphere 0 1
[PROOF STEP]
using fim him
[PROOF STATE]
proof (prove)
using this:
f ` sphere a r \<subseteq> sphere b s
h ` sphere b s \<subseteq> sphere 0 1

goal (1 subgoal):
 1. (h \<circ> f) ` sphere a r \<subseteq> sphere 0 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(h \<circ> f) ` sphere a r \<subseteq> sphere 0 1

goal (1 subgoal):
 1. \<And>c. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c) \<Longrightarrow> thesis; homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c)

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c)
[PROOF STEP]
have "homotopic_with_canon (\<lambda>f. True) (sphere a r) (sphere b s) (k \<circ> (h \<circ> f)) (k \<circ> (\<lambda>x. c))"
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) (h \<circ> f) (\<lambda>x. c)

goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>f. True) (sphere a r) (sphere b s) (k \<circ> (h \<circ> f)) (k \<circ> (\<lambda>x. c))
[PROOF STEP]
by (rule homotopic_with_compose_continuous_left [OF _ contk kim])
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>f. True) (sphere a r) (sphere b s) (k \<circ> (h \<circ> f)) (k \<circ> (\<lambda>x. c))

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with_canon (\<lambda>f. True) (sphere a r) (sphere b s) (k \<circ> (h \<circ> f)) (k \<circ> (\<lambda>x. c))
[PROOF STEP]
have "homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. k c)"
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>f. True) (sphere a r) (sphere b s) (k \<circ> (h \<circ> f)) (k \<circ> (\<lambda>x. c))

goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. k c)
[PROOF STEP]
apply (rule homotopic_with_eq, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>homotopic_with_canon (\<lambda>f. True) (sphere a (dist a x)) (sphere b s) (k \<circ> (h \<circ> f)) (\<lambda>a. k c); r = dist a x\<rbrakk> \<Longrightarrow> f x = k (h (f x))
[PROOF STEP]
by (metis fim hk homeomorphism_def image_subset_iff mem_sphere)
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. k c)

goal (1 subgoal):
 1. \<lbrakk>\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. c) \<Longrightarrow> thesis; \<not> s \<le> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. k c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere b s) f (\<lambda>x. k c)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_in_trees[intro]: "(\<And>x. x \<in> set_tree t \<Longrightarrow> f x \<in> S) \<Longrightarrow> map_tree f t \<in> trees S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set_tree t \<Longrightarrow> f x \<in> S) \<Longrightarrow> map_tree f t \<in> trees S
[PROOF STEP]
by (induction t) (auto intro: trees.intros(2))


[STATEMENT]
lemma nths'_append: "\<lbrakk> i \<le> j; j \<le> k \<rbrakk> \<Longrightarrow>(nths' i j xs) @ (nths' j k xs) = nths' i k xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> nths' i j xs @ nths' j k xs = nths' i k xs
[PROOF STEP]
by (induct xs arbitrary: i j k) auto


[STATEMENT]
lemma complete_iff_full: "complete t \<longleftrightarrow> (\<exists>n. full n t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete t = (\<exists>n. full n t)
[PROOF STEP]
by (auto elim!: complete_imp_full full_imp_complete)


[STATEMENT]
lemma iMODb_inext_nth_diff: "\<lbrakk> a \<le> c; b \<le> c \<rbrakk> \<Longrightarrow>
  ([r, mod m, c] \<rightarrow> a) - ([r, mod m, c] \<rightarrow> b) = (a - b) * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; b \<le> c\<rbrakk> \<Longrightarrow> ([ r, mod m, c ] \<rightarrow> a) - ([ r, mod m, c ] \<rightarrow> b) = (a - b) * m
[PROOF STEP]
by (simp add: iMODb_inext_nth diff_mult_distrib  mult.commute[of m])


[STATEMENT]
lemma s''_calc_i_0: "$s''^{m}_n = n" if "m \<noteq> 0" "i = 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $s''^{m}_n = real n
[PROOF STEP]
unfolding acc_due_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 + i) .^ (real (k + 1) / real m) / real m) = real n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
i = 0

goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 + i) .^ (real (k + 1) / real m) / real m) = real n
[PROOF STEP]
by simp


[STATEMENT]
lemma irfb_inv2: "Inf_pres \<phi> \<Longrightarrow> (fb\<^sub>\<R> \<circ> fb\<^sup>-\<^sub>\<R>) \<phi> = \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres \<phi> \<Longrightarrow> (fb\<^sub>\<R> \<circ> fb\<^sup>-\<^sub>\<R>) \<phi> = \<phi>
[PROOF STEP]
by (simp add: rfb_def irfb_def, metis ffb_iffb_galois r2f_f2r_galois)


[STATEMENT]
lemma finite_divisor_set [simp]: "finite(divisor_set n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (divisor_set n)
[PROOF STEP]
using divisor_def divisor_set
[PROOF STATE]
proof (prove)
using this:
?n divisor ?m \<equiv> 1 \<le> ?n \<and> ?n \<le> ?m \<and> ?n dvd ?m
divisor_set ?m = {n. n divisor ?m}

goal (1 subgoal):
 1. finite (divisor_set n)
[PROOF STEP]
by simp


[STATEMENT]
lemma has_contour_integral_const_linepath: "((\<lambda>x. c) has_contour_integral c*(b - a))(linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. c) has_contour_integral c * (b - a)) (linepath a b)
[PROOF STEP]
unfolding has_contour_integral_linepath
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. c * (b - a)) has_integral c * (b - a)) {0..1}
[PROOF STEP]
by (metis content_real diff_0_right has_integral_const_real lambda_one of_real_1 scaleR_conv_of_real zero_le_one)


[STATEMENT]
lemma assoc_add_vec[simp]:
  "(v\<^sub>1 :: 'a :: semigroup_add vec) \<in> carrier_vec n \<Longrightarrow> v\<^sub>2 \<in> carrier_vec n \<Longrightarrow> v\<^sub>3 \<in> carrier_vec n
  \<Longrightarrow> (v\<^sub>1 + v\<^sub>2) + v\<^sub>3 = v\<^sub>1 + (v\<^sub>2 + v\<^sub>3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v\<^sub>1 \<in> carrier_vec n; v\<^sub>2 \<in> carrier_vec n; v\<^sub>3 \<in> carrier_vec n\<rbrakk> \<Longrightarrow> v\<^sub>1 + v\<^sub>2 + v\<^sub>3 = v\<^sub>1 + (v\<^sub>2 + v\<^sub>3)
[PROOF STEP]
by (intro eq_vecI, auto simp: ac_simps)


[STATEMENT]
lemma ln_upper_13_neg:
  assumes "0 < x" and x1: "x \<le> 1" shows "ln(x) \<le> ln_upper_13 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln x \<le> ln_upper_13 x
[PROOF STEP]
apply (rule gen_upper_bound_decreasing [OF x1 d_delta_ln_upper_13])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y. \<lbrakk>x \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> 0 < y
 2. \<And>y. \<lbrakk>x \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> diff_delta_ln_upper_13 y \<le> 0
 3. ln_upper_13 1 = ln 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
x \<le> 1

goal (3 subgoals):
 1. \<And>y. \<lbrakk>x \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> 0 < y
 2. \<And>y. \<lbrakk>x \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> diff_delta_ln_upper_13 y \<le> 0
 3. ln_upper_13 1 = ln 1
[PROOF STEP]
apply (auto simp: diff_delta_ln_upper_13_def divide_simps ln_upper_13_def mult_less_0_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bigo_measure_trans:
  fixes t :: "'a \<Rightarrow> real" and t' :: "nat \<Rightarrow> real" and m :: "'a \<Rightarrow> nat" and f ::"nat \<Rightarrow> real"
  assumes "\<And>x. x \<in> A \<Longrightarrow> t x \<le> (t' o m) x"
      and "t' \<in> O(f)"
      and "\<And>x. x \<in> A \<Longrightarrow> 0 \<le> t x"
  shows "t \<in> O[m going_to at_top within A](f o m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
have 0: "\<And>x. x \<in> A \<Longrightarrow> 0 \<le> (t' o m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> 0 \<le> (t' \<circ> m) x
[PROOF STEP]
by (meson assms(1,3) order_trans)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> 0 \<le> (t' \<circ> m) ?x

goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
have 1: "t \<in> O[m going_to at_top within A](t' o m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](t' \<circ> m)
[PROOF STEP]
apply(rule bigoI[where c=1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in m going_to sequentially within A. norm (t x) \<le> 1 * norm ((t' \<circ> m) x)
[PROOF STEP]
using assms 0
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> t ?x \<le> (t' \<circ> m) ?x
t' \<in> O(f)
?x \<in> A \<Longrightarrow> 0 \<le> t ?x
?x \<in> A \<Longrightarrow> 0 \<le> (t' \<circ> m) ?x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in m going_to sequentially within A. norm (t x) \<le> 1 * norm ((t' \<circ> m) x)
[PROOF STEP]
by (simp add: eventually_inf_principal going_to_within_def)
[PROOF STATE]
proof (state)
this:
t \<in> O[m going_to sequentially within A](t' \<circ> m)

goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
have 2: "t' o m \<in> O[m going_to at_top](f o m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t' \<circ> m \<in> O[m going_to sequentially](f \<circ> m)
[PROOF STEP]
unfolding o_def going_to_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. t' (m x)) \<in> O[filtercomap m sequentially](\<lambda>x. f (m x))
[PROOF STEP]
by(rule landau_o.big.filtercomap[OF assms(2)])
[PROOF STATE]
proof (state)
this:
t' \<circ> m \<in> O[m going_to sequentially](f \<circ> m)

goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
have 3: "t' o m \<in> O[m going_to at_top within A](f o m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t' \<circ> m \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
using landau_o.big.filter_mono[OF _2] going_to_mono[OF _subset_UNIV]
[PROOF STATE]
proof (prove)
using this:
?F1.0 \<le> m going_to sequentially \<Longrightarrow> t' \<circ> m \<in> O[?F1.0](f \<circ> m)
?F \<le> ?G \<Longrightarrow> ?f going_to ?F within ?A \<le> ?f going_to ?G

goal (1 subgoal):
 1. t' \<circ> m \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t' \<circ> m \<in> O[m going_to sequentially within A](f \<circ> m)

goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> O[m going_to sequentially within A](f \<circ> m)
[PROOF STEP]
by(rule landau_o.big_trans[OF 1 3])
[PROOF STATE]
proof (state)
this:
t \<in> O[m going_to sequentially within A](f \<circ> m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_nonneg_pos_int[simp]: "x \<ge> 0 \<Longrightarrow> y > 0 \<Longrightarrow> mod_nonneg_pos_int x y = (x mod y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < y\<rbrakk> \<Longrightarrow> mod_nonneg_pos_int x y = x mod y
[PROOF STEP]
unfolding mod_nonneg_pos_int_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < y\<rbrakk> \<Longrightarrow> int_of_integer (mod_nonneg_pos (integer_of_int x) (integer_of_int y)) = x mod y
[PROOF STEP]
using mod_nonneg_pos_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; 0 < ?y\<rbrakk> \<Longrightarrow> mod_nonneg_pos ?x ?y = ?x mod ?y

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < y\<rbrakk> \<Longrightarrow> int_of_integer (mod_nonneg_pos (integer_of_int x) (integer_of_int y)) = x mod y
[PROOF STEP]
by simp


[STATEMENT]
lemma pdevs_val_zip: "pdevs_val e (pdevs_of_list xs) = (\<Sum>(i,x)\<leftarrow>zip [0..<length xs] xs. e i *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list xs) = sum_list (map2 (\<lambda>i. (*\<^sub>R) (e i)) [0..<length xs] xs)
[PROOF STEP]
by (auto simp: sum_list_distinct_conv_sum_set
    in_set_zip image_fst_zip pdevs_apply_pdevs_of_list distinct_zipI1
    intro!: pdevs_val_inj_sumI[of _ fst]
    split: if_split_asm)


[STATEMENT]
lemma has_field_derivative_higher_deriv:
     "\<lbrakk>f holomorphic_on S; open S; x \<in> S\<rbrakk>
      \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f holomorphic_on S; open S; x \<in> S\<rbrakk> \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ Suc n) f x) (at x)
[PROOF STEP]
by (metis (no_types, opaque_lifting) DERIV_deriv_iff_field_differentiable at_within_open comp_apply
         funpow.simps(2) holomorphic_higher_deriv holomorphic_on_def)


[STATEMENT]
lemma is_isolated_vertex_degree0: "is_isolated_vertex v \<Longrightarrow> degree v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
assume assm: "is_isolated_vertex v"
[PROOF STATE]
proof (state)
this:
is_isolated_vertex v

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_isolated_vertex v
[PROOF STEP]
have "\<not> has_loop v"
[PROOF STATE]
proof (prove)
using this:
is_isolated_vertex v

goal (1 subgoal):
 1. \<not> has_loop v
[PROOF STEP]
using is_isolated_vertex_no_loop
[PROOF STATE]
proof (prove)
using this:
is_isolated_vertex v
is_isolated_vertex ?v \<Longrightarrow> \<not> has_loop ?v

goal (1 subgoal):
 1. \<not> has_loop v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> has_loop v

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> has_loop v
[PROOF STEP]
have "degree v = card (incident_edges v)"
[PROOF STATE]
proof (prove)
using this:
\<not> has_loop v

goal (1 subgoal):
 1. degree v = card (incident_edges v)
[PROOF STEP]
using degree_no_loops
[PROOF STATE]
proof (prove)
using this:
\<not> has_loop v
\<not> has_loop ?v \<Longrightarrow> degree ?v = card (incident_edges ?v)

goal (1 subgoal):
 1. degree v = card (incident_edges v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree v = card (incident_edges v)

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree v = card (incident_edges v)

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
have "\<And> e. e \<in> E \<Longrightarrow> \<not> (incident v e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. e \<in> E \<Longrightarrow> \<not> incident v e
[PROOF STEP]
using is_isolated_vertex_edge assm
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_isolated_vertex ?v; ?e \<in> E\<rbrakk> \<Longrightarrow> \<not> incident ?v ?e
is_isolated_vertex v

goal (1 subgoal):
 1. \<And>e. e \<in> E \<Longrightarrow> \<not> incident v e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?e \<in> E \<Longrightarrow> \<not> incident v ?e

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?e \<in> E \<Longrightarrow> \<not> incident v ?e
[PROOF STEP]
have "(incident_edges v) = {}"
[PROOF STATE]
proof (prove)
using this:
?e \<in> E \<Longrightarrow> \<not> incident v ?e

goal (1 subgoal):
 1. incident_edges v = {}
[PROOF STEP]
unfolding incident_edges_def
[PROOF STATE]
proof (prove)
using this:
?e \<in> E \<Longrightarrow> \<not> incident v ?e

goal (1 subgoal):
 1. {e \<in> E. incident v e} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
incident_edges v = {}

goal (1 subgoal):
 1. is_isolated_vertex v \<Longrightarrow> degree v = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree v = card (incident_edges v)
incident_edges v = {}
[PROOF STEP]
show "degree v = 0"
[PROOF STATE]
proof (prove)
using this:
degree v = card (incident_edges v)
incident_edges v = {}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_SetCompr2:
  "finite {f y x |x y. P y}" if "finite (Collect P)"
    "\<forall>y. P y \<longrightarrow> finite (range (f y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f y x |x y. P y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f y x |x y. P y}
[PROOF STEP]
have "{f y x |x y. P y} = (\<Union>y\<in>Collect P. range (f y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f y x |x y. P y} = (\<Union>y\<in>Collect P. range (f y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f y x |x y. P y} = (\<Union>y\<in>Collect P. range (f y))

goal (1 subgoal):
 1. finite {f y x |x y. P y}
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
finite (Collect P)
\<forall>y. P y \<longrightarrow> finite (range (f y))
{f y x |x y. P y} = (\<Union>y\<in>Collect P. range (f y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (Collect P)
\<forall>y. P y \<longrightarrow> finite (range (f y))
{f y x |x y. P y} = (\<Union>y\<in>Collect P. range (f y))

goal (1 subgoal):
 1. finite {f y x |x y. P y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {f y x |x y. P y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in digraph_map) euler_char_iso:
  assumes "digraph_isomorphism hom"
  shows "pre_digraph_map.euler_char (app_iso hom G) (map_iso hom) = euler_char"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_digraph_map.euler_char (app_iso hom G) (map_iso hom) = euler_char
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. pre_digraph_map.euler_char (app_iso hom G) (map_iso hom) = euler_char
[PROOF STEP]
by (auto simp: pre_digraph_map.euler_char_def card_face_cycle_sets_iso)


[STATEMENT]
lemma triple_inj_eq: "({P} t\<succ> {Q} = {P'} t'\<succ> {Q'} ) = (P=P' \<and> t=t' \<and> Q=Q')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({P} t\<succ> {Q} = {P'} t'\<succ> {Q'}) = (P = P' \<and> t = t' \<and> Q = Q')
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma summable_comparison_test_bigo':
  assumes "summable (\<lambda>n. norm (g n))"
  assumes "(\<lambda>n. norm (f n :: 'a :: banach)) \<in> O(\<lambda>n. norm (g n))"
  shows   "summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
proof (rule summable_norm_cancel, rule summable_comparison_test_bigo)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. norm (?g2 n))
 2. (\<lambda>n. norm (f n)) \<in> O(?g2)
[PROOF STEP]
show "summable (\<lambda>n. norm (norm (g n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (norm (g n)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (g n))
(\<lambda>n. norm (f n)) \<in> O(\<lambda>n. norm (g n))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (norm (g n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (norm (g n)))

goal (1 subgoal):
 1. (\<lambda>n. norm (f n)) \<in> O(\<lambda>n. norm (g n))
[PROOF STEP]
qed fact+


[STATEMENT]
theorem final_mutual_exclusion: "\<lbrakk>C.reachable s;
      t<N; t'<N; t\<noteq>t'; is_HOLD (tts s t); is_HOLD (tts s t')
    \<rbrakk> \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C.reachable s; t < N; t' < N; t \<noteq> t'; is_HOLD (tts s t); is_HOLD (tts s t')\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (erule sim.xfer_reachable)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>as. \<lbrakk>t < N; t' < N; t \<noteq> t'; is_HOLD (tts s t); is_HOLD (tts s t'); sim_rel as s; A.reachable as\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: xfer_holds)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>as. \<lbrakk>t < N; t' < N; t \<noteq> t'; is_HOLD (tts as t); is_HOLD (tts as t'); sim_rel as s; A.reachable as\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (erule (5) mutual_exclusion)


[STATEMENT]
lemma  nsetTr3:"\<lbrakk>j \<noteq> Suc (Suc 0); j - Suc 0 \<in> nset (Suc 0) (Suc n)\<rbrakk>
       \<Longrightarrow>  Suc 0 < j - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j \<noteq> Suc (Suc 0); j - Suc 0 \<in> nset (Suc 0) (Suc n)\<rbrakk> \<Longrightarrow> Suc 0 < j - Suc 0
[PROOF STEP]
apply (simp add:nset_def, erule conjE, subgoal_tac "j \<noteq> 0",
       rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_matrix_n_zero_left[simp]: "\<lbrakk>fadd 0 0 = 0; \<forall>a. fmul 0 a = 0\<rbrakk> \<Longrightarrow> mult_matrix_n n fmul fadd 0 A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul (0::'c) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n n fmul fadd 0 A = 0
[PROOF STEP]
apply (simp add: mult_matrix_n_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul (0::'c) a = (0::'a)\<rbrakk> \<Longrightarrow> Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. 0::'a) n) = 0
[PROOF STEP]
apply (subst foldseq_zero)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul (0::'c) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (0::'a) (0::'a) = (0::'a)
 2. \<And>i j. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul (0::'c) a = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>i\<le>n. (0::'a) = (0::'a)
 3. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul (0::'c) a = (0::'a)\<rbrakk> \<Longrightarrow> Abs_matrix (\<lambda>j i. 0::'a) = 0
[PROOF STEP]
by (simp_all add: zero_matrix_def)


[STATEMENT]
lemma Y_subset_A: "Y \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y \<subseteq> A
[PROOF STEP]
by (rule subset_trans [OF _ fix_subset]) (rule Y_ss [simplified P_def])


[STATEMENT]
lemma Gamma_reflection_complex':
  "Gamma z * Gamma (- z :: complex) = - of_real pi / (z * sin (of_real pi * z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma z * Gamma (- z) = - complex_of_real pi / (z * sin (complex_of_real pi * z))
[PROOF STEP]
using rGamma_reflection_complex'[of z]
[PROOF STATE]
proof (prove)
using this:
rGamma z * rGamma (- z) = - z * sin (complex_of_real pi * z) / complex_of_real pi

goal (1 subgoal):
 1. Gamma z * Gamma (- z) = - complex_of_real pi / (z * sin (complex_of_real pi * z))
[PROOF STEP]
by (force simp add: Gamma_def field_split_simps)


[STATEMENT]
lemma [code]:
   "dimacs_model ls cs \<equiv> (list_all (\<lambda>c. list_ex (\<lambda>l. ListMem l c ) ls) cs) \<and>
                               distinct (map dimacs_lit_to_var ls)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dimacs_model ls cs \<equiv> list_all (\<lambda>c. list_ex (\<lambda>l. ListMem l c) ls) cs \<and> distinct (map dimacs_lit_to_var ls)
[PROOF STEP]
unfolding dimacs_model_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>c\<in>set cs. \<exists>l\<in>set ls. l \<in> set c) \<and> distinct (map dimacs_lit_to_var ls) \<equiv> list_all (\<lambda>c. list_ex (\<lambda>l. ListMem l c) ls) cs \<and> distinct (map dimacs_lit_to_var ls)
[PROOF STEP]
by (auto simp: list.pred_set ListMem_iff list_ex_iff )


[STATEMENT]
lemma negligible: "negligible S \<longleftrightarrow> (\<forall>T. (indicat_real S has_integral 0) T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible S = (\<forall>T. (indicat_real S has_integral 0) T)
[PROOF STEP]
proof (intro iffI allI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>T. negligible S \<Longrightarrow> (indicat_real S has_integral 0) T
 2. \<forall>T. (indicat_real S has_integral 0) T \<Longrightarrow> negligible S
[PROOF STEP]
fix T
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>T. negligible S \<Longrightarrow> (indicat_real S has_integral 0) T
 2. \<forall>T. (indicat_real S has_integral 0) T \<Longrightarrow> negligible S
[PROOF STEP]
assume "negligible S"
[PROOF STATE]
proof (state)
this:
negligible S

goal (2 subgoals):
 1. \<And>T. negligible S \<Longrightarrow> (indicat_real S has_integral 0) T
 2. \<forall>T. (indicat_real S has_integral 0) T \<Longrightarrow> negligible S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
negligible S
[PROOF STEP]
show "(indicator S has_integral 0) T"
[PROOF STATE]
proof (prove)
using this:
negligible S

goal (1 subgoal):
 1. (indicator S has_integral (0::'b)) T
[PROOF STEP]
by (meson Diff_iff has_integral_negligible indicator_simps(2))
[PROOF STATE]
proof (state)
this:
(indicator S has_integral (0::?'b1)) T

goal (1 subgoal):
 1. \<forall>T. (indicat_real S has_integral 0) T \<Longrightarrow> negligible S
[PROOF STEP]
qed (simp add: negligible_def)


[STATEMENT]
theorem bound_main_lemma_s:
  fixes PROB :: "'a problem" and s
  assumes "finite PROB" "(s \<in> valid_states PROB)"
  shows "(problem_plan_bound_s PROB s \<le> 2 ^ (card (prob_dom PROB)) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
have 1: "\<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
using assms bound_main_lemma_s_1
[PROOF STATE]
proof (prove)
using this:
finite PROB
s \<in> valid_states PROB
\<lbrakk>finite ?PROB; ?s \<in> valid_states ?PROB; ?x \<in> MPLS_s ?PROB ?s\<rbrakk> \<Longrightarrow> ?x \<le> 2 ^ card (prob_dom ?PROB) - 1

goal (1 subgoal):
 1. \<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
have "MPLS_s PROB s \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. MPLS_s PROB s \<noteq> {}
[PROOF STEP]
using bound_main_lemma_s_3
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1
MPLS_s ?PROB ?s \<noteq> {}

goal (1 subgoal):
 1. MPLS_s PROB s \<noteq> {}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
MPLS_s PROB s \<noteq> {}

goal (1 subgoal):
 1. problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
MPLS_s PROB s \<noteq> {}
[PROOF STEP]
have "Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1"
[PROOF STATE]
proof (prove)
using this:
MPLS_s PROB s \<noteq> {}

goal (1 subgoal):
 1. Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
using 1 bound_main_lemma_2[where s = "MPLS_s PROB s" and k = "2 ^ card (prob_dom PROB) - 1"]
[PROOF STATE]
proof (prove)
using this:
MPLS_s PROB s \<noteq> {}
\<forall>x\<in>MPLS_s PROB s. x \<le> 2 ^ card (prob_dom PROB) - 1
MPLS_s PROB s \<noteq> {} \<and> (\<forall>x. x \<in> MPLS_s PROB s \<longrightarrow> x \<le> 2 ^ card (prob_dom PROB) - 1) \<Longrightarrow> Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
show "problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1"
[PROOF STATE]
proof (prove)
using this:
Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
unfolding problem_plan_bound_s_def
[PROOF STATE]
proof (prove)
using this:
Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1

goal (1 subgoal):
 1. Sup (MPLS_s PROB s) \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
problem_plan_bound_s PROB s \<le> 2 ^ card (prob_dom PROB) - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_var_diff[disjoint_vars]: "disjoint_var (P1 \<^bold>- P2) Q = (disjoint_var P1 Q \<and> disjoint_var P2 Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint_var (P1 \<^bold>- P2) Q = (disjoint_var P1 Q \<and> disjoint_var P2 Q)
[PROOF STEP]
unfolding disjoint_var_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (var_set (P1 \<^bold>- P2) \<inter> var_set Q = {}) = (var_set P1 \<inter> var_set Q = {} \<and> var_set P2 \<inter> var_set Q = {})
[PROOF STEP]
by auto


[STATEMENT]
lemma sophomores_dream_aux1:
  "summable (\<lambda>k. 1 / real ((k+1)^(k+1)))"
  "integral {0..1} (\<lambda>x. x powr (-x)) = (\<Sum>n. 1 / (n+1)^(n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) &&& integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
define S where "S = (\<lambda>x::real. \<Sum>k. (-(x * ln x)) ^ k / fact k)"
[PROOF STATE]
proof (state)
this:
S = (\<lambda>x. \<Sum>k. (- (x * ln x)) ^ k / fact k)

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
have S_eq: "S x = x powr (-x)" if "x > 0" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S x = x powr - x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S x = x powr - x
[PROOF STEP]
have "S x = exp (-x * ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S x = exp (- x * ln x)
[PROOF STEP]
by (simp add: S_def exp_def field_simps)
[PROOF STATE]
proof (state)
this:
S x = exp (- x * ln x)

goal (1 subgoal):
 1. S x = x powr - x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S x = exp (- x * ln x)

goal (1 subgoal):
 1. S x = x powr - x
[PROOF STEP]
have "\<dots> = x powr (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- x * ln x) = x powr - x
[PROOF STEP]
using \<open>x > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. exp (- x * ln x) = x powr - x
[PROOF STEP]
by (simp add: powr_def)
[PROOF STATE]
proof (state)
this:
exp (- x * ln x) = x powr - x

goal (1 subgoal):
 1. S x = x powr - x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S x = x powr - x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S x = x powr - x

goal (1 subgoal):
 1. S x = x powr - x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
S x = x powr - x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?x \<Longrightarrow> S ?x = ?x powr - ?x

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
have cont: "continuous_on {0..1} (\<lambda>x::real. \<Sum>k<n. (-(x * ln x)) ^ k / fact k)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k)
[PROOF STEP]
by (intro continuous_on_sum continuous_on_divide x_log_x_continuous continuous_on_power
              continuous_on_const continuous_on_minus) auto
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. \<Sum>k<?n. (- (x * ln x)) ^ k / fact k)

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
obtain I J where IJ: "\<And>n. ((\<lambda>x. \<Sum>k<n. (-(x * ln x)) ^ k / fact k) has_integral I n) {0..1}"
                       "(S has_integral J) {0..1}" "I \<longlonglongrightarrow> J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>\<And>n. ((\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k) has_integral I n) {0..1}; (S has_integral J) {0..1}; I \<longlonglongrightarrow> J\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using uniform_limit_integral [OF uniform_limit_sophomores_dream2 cont]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sequentially \<noteq> bot; \<And>I J. \<lbrakk>\<And>n. ((\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k) has_integral I n) {0..1}; ((\<lambda>x. \<Sum>k. (- (x * ln x)) ^ k / fact k) has_integral J) {0..1}; I \<longlonglongrightarrow> J\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>\<And>n. ((\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k) has_integral I n) {0..1}; (S has_integral J) {0..1}; I \<longlonglongrightarrow> J\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>k<?n. (- (x * ln x)) ^ k / fact k) has_integral I ?n) {0..1}
(S has_integral J) {0..1}
I \<longlonglongrightarrow> J

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
note \<open>(S has_integral J) {0..1}\<close>
[PROOF STATE]
proof (state)
this:
(S has_integral J) {0..1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(S has_integral J) {0..1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
have "(S has_integral J) {0..1} \<longleftrightarrow> (S has_integral J) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S has_integral J) {0..1} = (S has_integral J) {0<..<1}
[PROOF STEP]
by (simp add: has_integral_Icc_iff_Ioo)
[PROOF STATE]
proof (state)
this:
(S has_integral J) {0..1} = (S has_integral J) {0<..<1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(S has_integral J) {0..1} = (S has_integral J) {0<..<1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>x. x powr (-x)) has_integral J) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S has_integral J) {0<..<1} = ((\<lambda>x. x powr - x) has_integral J) {0<..<1}
[PROOF STEP]
by (intro has_integral_cong) (use S_eq in auto)
[PROOF STATE]
proof (state)
this:
(S has_integral J) {0<..<1} = ((\<lambda>x. x powr - x) has_integral J) {0<..<1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(S has_integral J) {0<..<1} = ((\<lambda>x. x powr - x) has_integral J) {0<..<1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ((\<lambda>x. x powr (-x)) has_integral J) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr - x) has_integral J) {0<..<1} = ((\<lambda>x. x powr - x) has_integral J) {0..1}
[PROOF STEP]
by (simp add: has_integral_Icc_iff_Ioo)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr - x) has_integral J) {0<..<1} = ((\<lambda>x. x powr - x) has_integral J) {0..1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. x powr - x) has_integral J) {0..1}
[PROOF STEP]
have integral: "((\<lambda>x. x powr (-x)) has_integral J) {0..1}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. x powr - x) has_integral J) {0..1}

goal (1 subgoal):
 1. ((\<lambda>x. x powr - x) has_integral J) {0..1}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr - x) has_integral J) {0..1}

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
have I_eq: "I = (\<lambda>n. \<Sum>k<n. 1 / real ((k+1)^(k+1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I = (\<lambda>n. \<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
have "((\<lambda>x::real. \<Sum>k<n. (-1)^k * ((x * ln x) ^ k / fact k)) has_integral
            (\<Sum>k<n. (-1)^k * ((-1)^k * fact k / real ((k + 1) ^ (k + 1)) / fact k))) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>k<n. (- 1) ^ k * ((x * ln x) ^ k / fact k)) has_integral (\<Sum>k<n. (- 1) ^ k * ((- 1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k))) {0<..<1}
[PROOF STEP]
by (intro has_integral_sum[OF _ has_integral_mult_right] has_integral_divide
                sophomores_dream_aux_integral) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>k<n. (- 1) ^ k * ((x * ln x) ^ k / fact k)) has_integral (\<Sum>k<n. (- 1) ^ k * ((- 1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k))) {0<..<1}

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>k<n. (- 1) ^ k * ((x * ln x) ^ k / fact k)) has_integral (\<Sum>k<n. (- 1) ^ k * ((- 1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k))) {0<..<1}

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
have "(\<lambda>x::real. \<Sum>k<n. (-1)^k * ((x * ln x) ^ k / fact k)) =
               (\<lambda>x::real. \<Sum>k<n. (-(x * ln x)) ^ k / fact k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>k<n. (- 1) ^ k * ((x * ln x) ^ k / fact k)) = (\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k)
[PROOF STEP]
by (simp add: power_minus')
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>k<n. (- 1) ^ k * ((x * ln x) ^ k / fact k)) = (\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k)

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>k<n. (- 1) ^ k * ((x * ln x) ^ k / fact k)) = (\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k)

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
have "(\<Sum>k<n. (-1)^k * ((-1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k)) =
               (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n. (- 1) ^ k * ((- 1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k)) = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. (- 1) ^ k * ((- 1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k)) = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. (- 1) ^ k * ((- 1) ^ k * fact k / real ((k + 1) ^ (k + 1)) / fact k)) = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
note has_integral_Icc_iff_Ioo [symmetric]
[PROOF STATE]
proof (state)
this:
(?f has_integral ?I) {?a<..<?b} = (?f has_integral ?I) {?a..?b}

goal (1 subgoal):
 1. \<And>n. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k) has_integral (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))) {0..1}
[PROOF STEP]
show "I n = (\<Sum>k<n. 1 / real ((k+1)^(k+1)))"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>k<n. (- (x * ln x)) ^ k / fact k) has_integral (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))) {0..1}

goal (1 subgoal):
 1. I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
by (rule has_integral_unique [OF IJ(1)[of n]])
[PROOF STATE]
proof (state)
this:
I n = (\<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
I = (\<lambda>n. \<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
hence sums: "(\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J"
[PROOF STATE]
proof (prove)
using this:
I = (\<lambda>n. \<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))

goal (1 subgoal):
 1. (\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J
[PROOF STEP]
using IJ(3) I_eq
[PROOF STATE]
proof (prove)
using this:
I = (\<lambda>n. \<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))
I \<longlonglongrightarrow> J
I = (\<lambda>n. \<Sum>k<n. 1 / real ((k + 1) ^ (k + 1)))

goal (1 subgoal):
 1. (\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J
[PROOF STEP]
by (simp add: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J

goal (2 subgoals):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
from sums
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J
[PROOF STEP]
show "summable (\<lambda>k. 1 / real ((k+1)^(k+1)))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J

goal (1 subgoal):
 1. summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
from integral sums
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. x powr - x) has_integral J) {0..1}
(\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J
[PROOF STEP]
show "integral {0..1} (\<lambda>x. x powr (-x)) = (\<Sum>n. 1 / (n+1)^(n+1))"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. x powr - x) has_integral J) {0..1}
(\<lambda>k. 1 / real ((k + 1) ^ (k + 1))) sums J

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))
[PROOF STEP]
by (simp add: sums_iff has_integral_iff)
[PROOF STATE]
proof (state)
this:
integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_by_bound_of[intro!]:
  fixes P::"'a \<Rightarrow> real"
  assumes bP: "bounded P"
  shows "bounded_by (bound_of P) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_by (bound_of P) P
[PROOF STEP]
unfolding bound_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_by (Sup (range P)) P
[PROOF STEP]
using bP
[PROOF STATE]
proof (prove)
using this:
Expectations.bounded P

goal (1 subgoal):
 1. bounded_by (Sup (range P)) P
[PROOF STEP]
by(intro bounded_byI cSup_upper bounded_bdd_above, auto)


[STATEMENT]
lemma at_map_sup_pres: "at_map (x \<squnion> y) = at_map x \<squnion> at_map y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_map (x \<squnion> y) = at_map x \<squnion> at_map y
[PROOF STEP]
unfolding at_map_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_atoms (atom_map (x \<squnion> y)) = Abs_atoms (atom_map x) \<squnion> Abs_atoms (atom_map y)
[PROOF STEP]
by (metis (mono_tags, lifting) Abs_atoms_inverse atom_map_sup_pres rangeI sup_atoms.transfer)


[STATEMENT]
lemma divides_ff_to_fract[simp]: "divides_ff (to_fract x) (to_fract y) \<longleftrightarrow> x dvd y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divides_ff (to_fract x) (to_fract y) = (x dvd y)
[PROOF STEP]
unfolding divides_ff_def dvd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>r. to_fract y = to_fract x * to_fract r) = (\<exists>k. y = x * k)
[PROOF STEP]
by (simp add: to_fract_def eq_fract(1) mult.commute)


[STATEMENT]
lemma set_pmf_random_permutation [simp]:
  "finite A \<Longrightarrow> set_pmf (pmf_of_set (permutations_of_set A)) = {xs. distinct xs \<and> set xs = A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> set_pmf (pmf_of_set (permutations_of_set A)) = {xs. distinct xs \<and> set xs = A}
[PROOF STEP]
by (subst set_pmf_of_set) (auto dest: permutations_of_setD)


[STATEMENT]
lemma lfilter_eq_LNil: "lfilter P xs = LNil \<longleftrightarrow> (\<forall>x \<in> lset xs. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lfilter P xs = LNil) = (\<forall>x\<in>lset xs. \<not> P x)
[PROOF STEP]
by(induction xs) simp_all


[STATEMENT]
lemma regions_part_ex_reset:
  assumes "u \<in> V"
  shows  "[r \<rightarrow> (d::nat)]u \<in> [[r \<rightarrow> d]u]\<^sub>\<R>" "[[r \<rightarrow> d]u]\<^sub>\<R> \<in> \<R>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [r\<rightarrow>real d]u \<in> [[r\<rightarrow>real d]u]\<^sub>\<R> &&& [[r\<rightarrow>real d]u]\<^sub>\<R> \<in> \<R>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> V

goal (1 subgoal):
 1. [r\<rightarrow>real d]u \<in> [[r\<rightarrow>real d]u]\<^sub>\<R> &&& [[r\<rightarrow>real d]u]\<^sub>\<R> \<in> \<R>
[PROOF STEP]
by auto


[STATEMENT]
lemma equiv_transymcl: "Equiv_Relations.equiv (Field Qeq) (transymcl Qeq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv (Field Qeq) (transymcl Qeq)
[PROOF STEP]
by (auto simp: Equiv_Relations.equiv_def sym_trancl refl_on_def transymcl_def
    dest: FieldI1 FieldI2 Field_def[THEN equalityD1, THEN set_mp]
    intro: r_r_into_trancl[of x _ _ x for x]  elim!: in_symclI)


[STATEMENT]
lemma las_minus:
  assumes "locally_antisym R A"
  shows "locally_antisym R (A - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_antisym R (A - B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally_antisym R A

goal (1 subgoal):
 1. locally_antisym R (A - B)
[PROOF STEP]
unfolding locally_antisym_def
[PROOF STATE]
proof (prove)
using this:
\<forall>t u. t \<in># A \<longrightarrow> u \<in># A \<longrightarrow> (t, u) \<in> R \<longrightarrow> (u, t) \<in> R \<longrightarrow> t = u

goal (1 subgoal):
 1. \<forall>t u. t \<in># A - B \<longrightarrow> u \<in># A - B \<longrightarrow> (t, u) \<in> R \<longrightarrow> (u, t) \<in> R \<longrightarrow> t = u
[PROOF STEP]
by (meson in_diffD)


[STATEMENT]
lemma nonneg_mod_div: "0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 \<le> (a mod b) \<and> 0 \<le> a div b"
  for a b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 \<le> b\<rbrakk> \<Longrightarrow> 0 \<le> a mod b \<and> 0 \<le> a div b
[PROOF STEP]
by (cases "b = 0") (auto intro: pos_imp_zdiv_nonneg_iff [THEN iffD2])


[STATEMENT]
lemma simplicial_complex_empty_set:
  fixes K::"nat set set"
  assumes k: "simplicial_complex K"
  shows "K = {} \<or> {} \<in> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K = {} \<or> {} \<in> K
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
simplicial_complex K

goal (1 subgoal):
 1. K = {} \<or> {} \<in> K
[PROOF STEP]
unfolding simplicial_complex_def Pow_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<sigma>\<in>K. \<sigma> \<in> simplices \<and> {B. B \<subseteq> \<sigma>} \<subseteq> K

goal (1 subgoal):
 1. K = {} \<or> {} \<in> K
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma4:
     "((nmsg_gte 0 (v,w) \<inter> nmsg_lte (Suc 0) (v,w)) \<inter>
       (- nmsg_gt 0 (v,w) \<union> A))
      \<subseteq> A \<union> nmsg_eq 0 (v,w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nmsg_gte 0 (v, w) \<inter> nmsg_lte (Suc 0) (v, w) \<inter> (- nmsg_gt 0 (v, w) \<union> A) \<subseteq> A \<union> nmsg_eq 0 (v, w)
[PROOF STEP]
apply (unfold nmsg_gte_def nmsg_lte_def nmsg_gt_def nmsg_eq_def, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_poincare_line_trough_zero_is_line:
  assumes "is_poincare_line l" and "0\<^sub>h \<in> circline_set l"
  shows "is_line l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_line l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l
0\<^sub>h \<in> circline_set l

goal (1 subgoal):
 1. is_line l
[PROOF STEP]
using inf_in_circline_set is_poincare_line_trough_zero_trough_infty
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l
0\<^sub>h \<in> circline_set l
(\<infinity>\<^sub>h \<in> circline_set ?H) = is_line ?H
\<lbrakk>is_poincare_line ?l; 0\<^sub>h \<in> circline_set ?l\<rbrakk> \<Longrightarrow> \<infinity>\<^sub>h \<in> circline_set ?l

goal (1 subgoal):
 1. is_line l
[PROOF STEP]
by blast


[STATEMENT]
lemma sym_group_is_group: "group (sym_group n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (sym_group n)
[PROOF STEP]
using permutes_inv permutes_inv_o(2)
[PROOF STATE]
proof (prove)
using this:
?p permutes ?S \<Longrightarrow> inv' ?p permutes ?S
?p permutes ?S \<Longrightarrow> inv' ?p \<circ> ?p = id

goal (1 subgoal):
 1. Group.group (sym_group n)
[PROOF STEP]
by (auto intro!: groupI
         simp add: sym_group_def permutes_compose
                   permutes_id comp_assoc, blast)


[STATEMENT]
lemma pre_to_univ_poly_inv_is_hom:
  assumes "i < Suc n"
  shows "ring_hom_ring (Pring (R[\<X>\<^bsub>n\<^esub>]) {i}) (R[\<X>\<^bsub>Suc n\<^esub>]) (pre_to_univ_poly_inv (Suc n) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_hom_ring (Pring (R [\<X>\<^bsub>n\<^esub>]) {i}) (R [\<X>\<^bsub>Suc n\<^esub>]) (pre_to_univ_poly_inv (Suc n) i)
[PROOF STEP]
apply(rule cring.Pring_universal_prop[of _ _  "pre_to_univ_poly_inv_var_ass (Suc n) i" "{i}" "pre_to_univ_poly_inv_hom (Suc n) i"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. cring (R [\<X>\<^bsub>n\<^esub>])
 2. cring (R [\<X>\<^bsub>Suc n\<^esub>])
 3. pre_to_univ_poly_inv_var_ass (Suc n) i \<in> {i} \<rightarrow> carrier (R [\<X>\<^bsub>Suc n\<^esub>])
 4. ring_hom_ring (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>Suc n\<^esub>]) (pre_to_univ_poly_inv_hom (Suc n) i)
 5. pre_to_univ_poly_inv (Suc n) i = indexed_poly_induced_morphism {i} (R [\<X>\<^bsub>Suc n\<^esub>]) (pre_to_univ_poly_inv_hom (Suc n) i) (pre_to_univ_poly_inv_var_ass (Suc n) i)
[PROOF STEP]
unfolding coord_ring_def
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. cring (Pring R {..<n})
 2. cring (Pring R {..<Suc n})
 3. pre_to_univ_poly_inv_var_ass (Suc n) i \<in> {i} \<rightarrow> carrier (Pring R {..<Suc n})
 4. ring_hom_ring (Pring R {..<n}) (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i)
 5. pre_to_univ_poly_inv (Suc n) i = indexed_poly_induced_morphism {i} (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i) (pre_to_univ_poly_inv_var_ass (Suc n) i)
[PROOF STEP]
apply (simp add: R.Pring_is_cring R.is_cring)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. cring (Pring R {..<Suc n})
 2. pre_to_univ_poly_inv_var_ass (Suc n) i \<in> {i} \<rightarrow> carrier (Pring R {..<Suc n})
 3. ring_hom_ring (Pring R {..<n}) (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i)
 4. pre_to_univ_poly_inv (Suc n) i = indexed_poly_induced_morphism {i} (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i) (pre_to_univ_poly_inv_var_ass (Suc n) i)
[PROOF STEP]
apply (simp add: R.Pring_is_cring R.is_cring)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. pre_to_univ_poly_inv_var_ass (Suc n) i \<in> {i} \<rightarrow> carrier (Pring R {..<Suc n})
 2. ring_hom_ring (Pring R {..<n}) (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i)
 3. pre_to_univ_poly_inv (Suc n) i = indexed_poly_induced_morphism {i} (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i) (pre_to_univ_poly_inv_var_ass (Suc n) i)
[PROOF STEP]
apply (metis Pi_I R.Pring_var_closed assms lessThan_iff pre_to_univ_poly_inv_var_ass_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ring_hom_ring (Pring R {..<n}) (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i)
 2. pre_to_univ_poly_inv (Suc n) i = indexed_poly_induced_morphism {i} (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i) (pre_to_univ_poly_inv_var_ass (Suc n) i)
[PROOF STEP]
apply (metis assms coord_ring_def pre_to_univ_poly_inv_hom_is_hom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_to_univ_poly_inv (Suc n) i = indexed_poly_induced_morphism {i} (Pring R {..<Suc n}) (pre_to_univ_poly_inv_hom (Suc n) i) (pre_to_univ_poly_inv_var_ass (Suc n) i)
[PROOF STEP]
by (simp add: coord_ring_def pre_to_univ_poly_inv_def)


[STATEMENT]
lemma card_UNION:
  assumes "finite A"
    and "\<forall>k \<in> A. finite k"
  shows "card (\<Union>A) = nat (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter>I)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> A) = nat (\<Sum>I | I \<subseteq> A \<and> I \<noteq> {}. (- 1) ^ (card I + 1) * int (card (\<Inter> I)))
[PROOF STEP]
by (simp only: flip: int_card_UNION [OF assms])


[STATEMENT]
lemma (*equal_union: *)
   "(X = Y \<union> Z) = (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<forall>V. Y \<subseteq> V \<and> Z \<subseteq> V \<longrightarrow> X \<subseteq> V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X = Y \<union> Z) = (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<forall>V. Y \<subseteq> V \<and> Z \<subseteq> V \<longrightarrow> X \<subseteq> V))
[PROOF STEP]
by (metis Un_least Un_upper1 Un_upper2 set_eq_subset)


[STATEMENT]
lemma "(0::nat) < emBits mod 8 \<Longrightarrow> 8 + emBits div 8 * 8 - emBits = 8 - emBits mod 8"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < emBits mod 8 \<Longrightarrow> 8 + emBits div 8 * 8 - emBits = 8 - emBits mod 8
[PROOF STEP]
by presburger


[STATEMENT]
lemma pc_next: "x \<in> [n0, n) \<Longrightarrow> P n0 \<Longrightarrow> (x \<in> [Suc n0, n) \<Longrightarrow> P x) \<Longrightarrow> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> [n0, n); P n0; x \<in> [Suc n0, n) \<Longrightarrow> P x\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (cases "x=n0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> [n0, n); P n0; x \<in> [Suc n0, n) \<Longrightarrow> P x; x = n0\<rbrakk> \<Longrightarrow> P x
 2. \<lbrakk>x \<in> [n0, n); P n0; x \<in> [Suc n0, n) \<Longrightarrow> P x; x \<noteq> n0\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (auto simp add: intervall_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fold_sum_aux':
  assumes "\<forall>u \<in> set (a # xs). \<forall>v \<in> set (xs @ [b]). f v + W u v \<ge> f u"
  shows "sum_list (map f (a # xs)) \<le> sum_list (map f (xs @ [b])) + weight (a # xs @ [b])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f (a # xs)) \<le> sum_list (map f (xs @ [b])) + local.weight (a # xs @ [b])
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>u\<in>set (a # xs). \<forall>v\<in>set (xs @ [b]). f u \<le> f v + W u v

goal (1 subgoal):
 1. sum_list (map f (a # xs)) \<le> sum_list (map f (xs @ [b])) + local.weight (a # xs @ [b])
[PROOF STEP]
by (induction xs arbitrary: a; simp)
     (smt ab_semigroup_add_class.add_ac(1) add.left_commute add_mono)


[STATEMENT]
lemma gbinomial_negated_upper: "(a gchoose k) = (-1) ^ k * ((of_nat k - a - 1) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a gchoose k = (- (1::'a)) ^ k * (of_nat k - a - (1::'a) gchoose k)
[PROOF STEP]
by (simp add: gbinomial_pochhammer pochhammer_minus algebra_simps)


[STATEMENT]
lemma sqrt_lower_bound_4:
  assumes "x \<ge> 0"
    shows "(32*x*(x+1)*(x^2+6*x+1)*(x^4+28*x^3+70*x^2+28*x+1)*(1820*x^6+8008*x^5+x^8+120*x^7+120*x+1+1820*x^2+8008*x^3+12870*x^4))
           / (225792840*x^6+64512240*x^5+601080390*x^8+471435600*x^7+496*x+1+35960*x^2+906192*x^3+10518300*x^4+x^16+906192*x^13+10518300*x^12+496*x^15+35960*x^14+471435600*x^9+225792840*x^10+64512240*x^11)
           \<le> sqrt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 32 * x * (x + 1) * (x\<^sup>2 + 6 * x + 1) * (x ^ 4 + 28 * x ^ 3 + 70 * x\<^sup>2 + 28 * x + 1) * (1820 * x ^ 6 + 8008 * x ^ 5 + x ^ 8 + 120 * x ^ 7 + 120 * x + 1 + 1820 * x\<^sup>2 + 8008 * x ^ 3 + 12870 * x ^ 4) / (225792840 * x ^ 6 + 64512240 * x ^ 5 + 601080390 * x ^ 8 + 471435600 * x ^ 7 + 496 * x + 1 + 35960 * x\<^sup>2 + 906192 * x ^ 3 + 10518300 * x ^ 4 + x ^ 16 + 906192 * x ^ 13 + 10518300 * x ^ 12 + 496 * x ^ 15 + 35960 * x ^ 14 + 471435600 * x ^ 9 + 225792840 * x ^ 10 + 64512240 * x ^ 11) \<le> sqrt x
[PROOF STEP]
by (metis assms sqrtl_4_eq gen_sqrt_lower)


[STATEMENT]
lemma has_field_derivative_Lambert_W'_gen [derivative_intros]:
  assumes "(f has_real_derivative f') (at x within A)" "f x \<in> {-exp (-1)<..<0}"
  shows   "((\<lambda>x. Lambert_W' (f x)) has_real_derivative
             (f' / (f x + exp (Lambert_W' (f x))))) (at x within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W' (f x)) has_real_derivative f' / (f x + exp (Lambert_W' (f x)))) (at x within A)
[PROOF STEP]
using DERIV_chain2[OF has_field_derivative_Lambert_W'[OF assms(2)] assms(1)]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. Lambert_W' (f x)) has_real_derivative inverse (f x + exp (Lambert_W' (f x))) * f') (at x within A)

goal (1 subgoal):
 1. ((\<lambda>x. Lambert_W' (f x)) has_real_derivative f' / (f x + exp (Lambert_W' (f x)))) (at x within A)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma One_App:
  assumes a: "App t s \<longrightarrow>\<^sub>1 r"
  shows "(\<exists>t' s'. r = App t' s' \<and> t \<longrightarrow>\<^sub>1 t' \<and> s \<longrightarrow>\<^sub>1 s') \<or>
         (\<exists>x p p' s'. r = p'[x::=s'] \<and> t = Lam [x].p \<and> p \<longrightarrow>\<^sub>1 p' \<and> s \<longrightarrow>\<^sub>1 s' \<and> x\<sharp>(s,s'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>t' s'. r = App t' s' \<and>  t \<longrightarrow>\<^sub>1 t' \<and>  s \<longrightarrow>\<^sub>1 s') \<or> (\<exists>x p p' s'. r = p'[x::=s'] \<and> t = Lam [x].p \<and>  p \<longrightarrow>\<^sub>1 p' \<and>  s \<longrightarrow>\<^sub>1 s' \<and> x \<sharp> (s, s'))
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
 App t s \<longrightarrow>\<^sub>1 r

goal (1 subgoal):
 1. (\<exists>t' s'. r = App t' s' \<and>  t \<longrightarrow>\<^sub>1 t' \<and>  s \<longrightarrow>\<^sub>1 s') \<or> (\<exists>x p p' s'. r = p'[x::=s'] \<and> t = Lam [x].p \<and>  p \<longrightarrow>\<^sub>1 p' \<and>  s \<longrightarrow>\<^sub>1 s' \<and> x \<sharp> (s, s'))
[PROOF STEP]
by (cases rule: One.cases) (auto simp add: lam.inject)


[STATEMENT]
lemma sums_pre_newman: "Re s > 1 / 2 \<Longrightarrow> (\<lambda>p. if prime p then B p s else 0) sums pre_newman s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 < Re s \<Longrightarrow> (\<lambda>p. if prime p then B p s else 0) sums pre_newman s
[PROOF STEP]
using tendsto_uniform_limitI[OF uniform_limit_pre_newman[of 0 s]]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> 0; 1 / 2 < Re s - 0; ?x \<in> cball s 0\<rbrakk> \<Longrightarrow> (\<lambda>y. \<Sum>p<y. if prime p then B p ?x else 0) \<longlonglongrightarrow> pre_newman ?x

goal (1 subgoal):
 1. 1 / 2 < Re s \<Longrightarrow> (\<lambda>p. if prime p then B p s else 0) sums pre_newman s
[PROOF STEP]
by (auto simp: sums_def)


[STATEMENT]
lemma generate_valid_topology_complies:
    "\<lbrakk> \<forall> (m_impl, m_spec) \<in> set M. SecurityInvariant_complies_formal_def m_impl m_spec;
       wf_list_graph (G::('v list_graph)) \<rbrakk> \<Longrightarrow>
       list_graph_to_graph (generate_valid_topology (get_impl M) G) =
       TopoS_Composition_Theory.generate_valid_topology (get_spec M) (list_graph_to_graph G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(m_impl, m_spec)\<in>set M. SecurityInvariant_complies_formal_def m_impl m_spec; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology (get_impl M) G) = TopoS_Composition_Theory.generate_valid_topology (get_spec M) (list_graph_to_graph G)
[PROOF STEP]
apply (subst generate_valid_topology_def_alt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(m_impl, m_spec)\<in>set M. SecurityInvariant_complies_formal_def m_impl m_spec; wf_list_graph G\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology (get_impl M) G) = FiniteGraph.delete_edges (list_graph_to_graph G) (\<Union> (get_offending_flows (get_spec M) (list_graph_to_graph G)))
[PROOF STEP]
apply (drule(1) implc_get_offending_flows_complies)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_list_graph G; set ` set (implc_get_offending_flows (get_impl M) G) = get_offending_flows (get_spec M) (list_graph_to_graph G)\<rbrakk> \<Longrightarrow> list_graph_to_graph (TopoS_Composition_Theory_impl.generate_valid_topology (get_impl M) G) = FiniteGraph.delete_edges (list_graph_to_graph G) (\<Union> (get_offending_flows (get_spec M) (list_graph_to_graph G)))
[PROOF STEP]
apply (simp add: delete_edges_correct [symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_zip1: "map (\<lambda>x. (x,k)) l = zip l (replicate (length l) k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>x. (x, k)) l = zip l (replicate (length l) k)
[PROOF STEP]
by (induct l) auto