[STATEMENT]
theorem Euler_Rule_Amicable:
  fixes k l f p q r m n :: nat
  assumes "k > l" and "l \<ge> 1" and "f = 2^l+1"
      and "prime p" and "prime q" and "prime r"
      and "p = 2^(k-l) * f - 1" and "q = 2^k * f - 1" and "r = 2^(2*k-l) * f^2 - 1"
      and "m = 2^k * p * q" and "n = 2^k * r"
  shows "m Amic n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
note [[linarith_split_limit = 50]]
[PROOF STATE]
proof (state)
this:
TERM _

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have A1: "(p+1)*(q+1) = (r+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
have a: "p+1 = (2^(k-l))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p + 1 = 2 ^ (k - l) * f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. p + 1 = 2 ^ (k - l) * f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p + 1 = 2 ^ (k - l) * f

goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
have b: "q+1 = (2^(k))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q + 1 = 2 ^ k * f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. q + 1 = 2 ^ k * f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q + 1 = 2 ^ k * f

goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
have c: "r+1 = (2^(2*k-l))*(f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r + 1 = 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. r + 1 = 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r + 1 = 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
have d: "(p+1)*(q+1) = (2^(k-l))*(2^(k))*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p + 1) * (q + 1) = 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
p + 1 = 2 ^ (k - l) * f
q + 1 = 2 ^ k * f

goal (1 subgoal):
 1. (p + 1) * (q + 1) = 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
(p + 1) * (q + 1) = 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
using d c
[PROOF STATE]
proof (prove)
using this:
(p + 1) * (q + 1) = 2 ^ (k - l) * 2 ^ k * f\<^sup>2
r + 1 = 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. (p + 1) * (q + 1) = r + 1
[PROOF STEP]
by (metis Nat.add_diff_assoc add.commute assms(1) less_imp_le_nat mult_2 power_add)
[PROOF STATE]
proof (state)
this:
(p + 1) * (q + 1) = r + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(p + 1) * (q + 1) = r + 1

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have aa: "Esigma p = p+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma p = p + 1
[PROOF STEP]
using assms \<open>prime p\<close> prime_sum_div
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
prime p
prime ?n \<Longrightarrow> Esigma ?n = ?n + 1

goal (1 subgoal):
 1. Esigma p = p + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma p = p + 1

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have bb: "Esigma q = q+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma q = q + 1
[PROOF STEP]
using \<open>prime q\<close> prime_sum_div assms
[PROOF STATE]
proof (prove)
using this:
prime q
prime ?n \<Longrightarrow> Esigma ?n = ?n + 1
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. Esigma q = q + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma q = q + 1

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have cc: "Esigma r = r+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma r = r + 1
[PROOF STEP]
using \<open>prime r\<close> prime_sum_div assms
[PROOF STATE]
proof (prove)
using this:
prime r
prime ?n \<Longrightarrow> Esigma ?n = ?n + 1
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. Esigma r = r + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma r = r + 1

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have A2: "(Esigma p)*(Esigma q) = Esigma r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma p * Esigma q = Esigma r
[PROOF STEP]
using aa bb cc A1
[PROOF STATE]
proof (prove)
using this:
Esigma p = p + 1
Esigma q = q + 1
Esigma r = r + 1
(p + 1) * (q + 1) = r + 1

goal (1 subgoal):
 1. Esigma p * Esigma q = Esigma r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma p * Esigma q = Esigma r

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have A3: "Esigma (2^k)*(Esigma p)*(Esigma q) = Esigma(2^k)*(Esigma r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k) * Esigma p * Esigma q = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
using A2
[PROOF STATE]
proof (prove)
using this:
Esigma p * Esigma q = Esigma r

goal (1 subgoal):
 1. Esigma (2 ^ k) * Esigma p * Esigma q = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k) * Esigma p * Esigma q = Esigma (2 ^ k) * Esigma r

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have A4: "Esigma(( 2^k)*r) = (Esigma(2^k))*(Esigma r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
have Z0: "gcd ((2::nat)^k)r =1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (2 ^ k) r = 1
[PROOF STEP]
using assms \<open>prime r\<close>
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
prime r

goal (1 subgoal):
 1. gcd (2 ^ k) r = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd (2 ^ k) r = 1

goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
have A: "(2::nat)^k \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 2 ^ k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 1 \<le> 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> 2 ^ k

goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
have Ab: "(2::nat)^k \<noteq> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k \<noteq> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ k \<noteq> r
[PROOF STEP]
by (metis gcd_nat.idem numeral_le_one_iff prime_ge_2_nat semiring_norm(69) Z0)
[PROOF STATE]
proof (state)
this:
2 ^ k \<noteq> r

goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
using Z0 gcd_Esigma_mult assms A Ab
[PROOF STATE]
proof (prove)
using this:
gcd (2 ^ k) r = 1
gcd ?m ?n = 1 \<Longrightarrow> Esigma (?m * ?n) = Esigma ?m * Esigma ?n
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
1 \<le> 2 ^ k
2 ^ k \<noteq> r

goal (1 subgoal):
 1. Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have A5: "Esigma((2^k)*p*q) =(Esigma(2^k))*(Esigma p)*(Esigma q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have "(2::nat)^k \<ge>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 2 ^ k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 1 \<le> 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> 2 ^ k

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have A:  "gcd (2^k) p =1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (2 ^ k) p = 1
[PROOF STEP]
using assms \<open>prime p\<close>
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
prime p

goal (1 subgoal):
 1. gcd (2 ^ k) p = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd (2 ^ k) p = 1

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have B:  "gcd (2^k) q =1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (2 ^ k) q = 1
[PROOF STEP]
using assms \<open>prime q\<close>
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
prime q

goal (1 subgoal):
 1. gcd (2 ^ k) q = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd (2 ^ k) q = 1

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have BB: "gcd (2^k) (p*q) =1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (2 ^ k) (p * q) = 1
[PROOF STEP]
using assms A B
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
gcd (2 ^ k) p = 1
gcd (2 ^ k) q = 1

goal (1 subgoal):
 1. gcd (2 ^ k) (p * q) = 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
gcd (2 ^ k) (p * q) = 1

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have C:  "p*q \<ge>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> p * q
[PROOF STEP]
using assms One_nat_def one_le_mult_iff prime_ge_1_nat
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
1 = Suc 0
(Suc 0 \<le> ?m * ?n) = (Suc 0 \<le> ?m \<and> Suc 0 \<le> ?n)
prime ?p \<Longrightarrow> 1 \<le> ?p

goal (1 subgoal):
 1. 1 \<le> p * q
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
1 \<le> p * q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have A6: " Esigma((2^k)*(p*q))=( Esigma(2^k))*(Esigma(p*q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)
[PROOF STEP]
have "(( 2::nat)^k) \<noteq> (p*q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k \<noteq> p * q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ k \<noteq> p * q
[PROOF STEP]
by (metis BB Nat.add_0_right gcd_idem_nat less_add_eq_less
            not_add_less1 power_inject_exp prime_gt_1_nat semiring_normalization_rules(32)
            two_is_prime_nat )
[PROOF STATE]
proof (state)
this:
2 ^ k \<noteq> p * q

goal (1 subgoal):
 1. Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)
[PROOF STEP]
using \<open>(( 2::nat)^k) \<noteq> (p*q)\<close>
          \<open>( 2::nat)^k \<ge>1\<close>  gcd_Esigma_mult assms C BB
[PROOF STATE]
proof (prove)
using this:
2 ^ k \<noteq> p * q
1 \<le> 2 ^ k
gcd ?m ?n = 1 \<Longrightarrow> Esigma (?m * ?n) = Esigma ?m * Esigma ?n
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
1 \<le> p * q
gcd (2 ^ k) (p * q) = 1

goal (1 subgoal):
 1. Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma (p * q)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have A7:"Esigma(p*q) = (Esigma p)*(Esigma q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (p * q) = Esigma p * Esigma q
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma (p * q) = Esigma p * Esigma q
[PROOF STEP]
have "p \<noteq> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> q
[PROOF STEP]
using assms One_nat_def Suc_pred add_gr_0 add_is_0 diff_commute diff_diff_cancel
          diff_is_0_eq nat_0_less_mult_iff nat_mult_eq_cancel_disj
          numeral_One prime_gt_1_nat power_inject_exp
          semiring_normalization_rules(7) two_is_prime_nat zero_less_numeral zero_less_power
zero_neq_numeral
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
1 = Suc 0
0 < ?n \<Longrightarrow> Suc (?n - Suc 0) = ?n
(0 < ?m + ?n) = (0 < ?m \<or> 0 < ?n)
(?m + ?n = 0) = (?m = 0 \<and> ?n = 0)
?i - ?j - ?k = ?i - ?k - ?j
?i \<le> ?n \<Longrightarrow> ?n - (?n - ?i) = ?i
(?m - ?n = 0) = (?m \<le> ?n)
(0 < ?m * ?n) = (0 < ?m \<and> 0 < ?n)
(?k * ?m = ?k * ?n) = (?k = 0 \<or> ?m = ?n)
Numeral1 = (1::?'a)
prime ?p \<Longrightarrow> 1 < ?p
(1::?'a) < ?a \<Longrightarrow> (?a ^ ?m = ?a ^ ?n) = (?m = ?n)
?a * ?b = ?b * ?a
prime 2
(0::?'a) < numeral ?n
(0::?'a) < ?a \<Longrightarrow> (0::?'a) < ?a ^ ?n
(0::?'a) \<noteq> numeral ?n

goal (1 subgoal):
 1. p \<noteq> q
[PROOF STEP]
by (smt less_imp_le_nat)
[PROOF STATE]
proof (state)
this:
p \<noteq> q

goal (1 subgoal):
 1. Esigma (p * q) = Esigma p * Esigma q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (p * q) = Esigma p * Esigma q
[PROOF STEP]
using \<open>p \<noteq> q\<close>
          \<open>prime p\<close>  \<open>prime q\<close> C  prime_Esigma_mult assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q
prime p
prime q
1 \<le> p * q
\<lbrakk>prime ?m; prime ?n; ?m \<noteq> ?n\<rbrakk> \<Longrightarrow> Esigma (?m * ?n) = Esigma ?n * Esigma ?m
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. Esigma (p * q) = Esigma p * Esigma q
[PROOF STEP]
by (metis mult.commute)
[PROOF STATE]
proof (state)
this:
Esigma (p * q) = Esigma p * Esigma q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Esigma (p * q) = Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
have A8: "Esigma((2^k)*( p*q))=(Esigma(2^k))*(Esigma p)*(Esigma q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
by (simp add: A6 A7)
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
using A8
[PROOF STATE]
proof (prove)
using this:
Esigma (2 ^ k * (p * q)) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have Z: "Esigma((2^k)*p*q) = Esigma ((2^k)*r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k * r)
[PROOF STEP]
using A1 A2 A3 A4 A5
[PROOF STATE]
proof (prove)
using this:
(p + 1) * (q + 1) = r + 1
Esigma p * Esigma q = Esigma r
Esigma (2 ^ k) * Esigma p * Esigma q = Esigma (2 ^ k) * Esigma r
Esigma (2 ^ k * r) = Esigma (2 ^ k) * Esigma r
Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k * r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k * r)

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
have Z1: "Esigma ((2^k)*p*q) = 2^k *p*q + 2^k*r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "prime (2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prime 2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have s: "Esigma (2^k) =((2::nat)^(k+1)-1)/(2-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Esigma (2 ^ k)) = real (2 ^ (k + 1) - 1) / (2 - 1)
[PROOF STEP]
using  \<open>prime (2::nat)\<close> assms Esigma_prime_sum
[PROOF STATE]
proof (prove)
using this:
prime 2
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
\<lbrakk>prime ?m; 1 \<le> ?k\<rbrakk> \<Longrightarrow> real (Esigma (?m ^ ?k)) = real (?m ^ (?k + 1) - 1) / (real ?m - 1)

goal (1 subgoal):
 1. real (Esigma (2 ^ k)) = real (2 ^ (k + 1) - 1) / (2 - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (Esigma (2 ^ k)) = real (2 ^ (k + 1) - 1) / (2 - 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have ss: "Esigma (2^k) =(2^(k+1)-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k) = 2 ^ (k + 1) - 1
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
real (Esigma (2 ^ k)) = real (2 ^ (k + 1) - 1) / (2 - 1)

goal (1 subgoal):
 1. Esigma (2 ^ k) = 2 ^ (k + 1) - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k) = 2 ^ (k + 1) - 1

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have J: "(k+1+k-l+k)= 3*k +1-l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k + 1 + k - l + k = 3 * k + 1 - l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. k + 1 + k - l + k = 3 * k + 1 - l
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
k + 1 + k - l + k = 3 * k + 1 - l

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have JJ: "(2^(k-l))*(2^k) = (2::nat)^(2*k-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * 2 ^ k = 2 ^ (2 * k - l)
[PROOF STEP]
apply (simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * 2 ^ (k - l) = 2 ^ (k * 2 - l)
[PROOF STEP]
by (metis Nat.add_diff_assoc assms(1) less_imp_le_nat mult_2_right power_add)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * 2 ^ k = 2 ^ (2 * k - l)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "Esigma((2^k)*p*q)= (Esigma(2^k))*(Esigma p)*(Esigma q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
using A5
[PROOF STATE]
proof (prove)
using this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k) * Esigma p * Esigma q

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(k+1)-1)*(p+1)*(q+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k) * Esigma p * Esigma q = (2 ^ (k + 1) - 1) * (p + 1) * (q + 1)
[PROOF STEP]
using assms ss aa bb
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
Esigma (2 ^ k) = 2 ^ (k + 1) - 1
Esigma p = p + 1
Esigma q = q + 1

goal (1 subgoal):
 1. Esigma (2 ^ k) * Esigma p * Esigma q = (2 ^ (k + 1) - 1) * (p + 1) * (q + 1)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k) * Esigma p * Esigma q = (2 ^ (k + 1) - 1) * (p + 1) * (q + 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k) * Esigma p * Esigma q = (2 ^ (k + 1) - 1) * (p + 1) * (q + 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(k+1)-1)*((2^(k-l))*f)*((2^k)*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ (k + 1) - 1) * (p + 1) * (q + 1) = (2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. (2 ^ (k + 1) - 1) * (p + 1) * (q + 1) = (2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(2 ^ (k + 1) - 1) * (p + 1) * (q + 1) = (2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ (k + 1) - 1) * (p + 1) * (q + 1) = (2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(k+1)-1)*(2^(k-l))*(2^k)*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f) = (2 ^ (k + 1) - 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
(2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f) = (2 ^ (k + 1) - 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ (k + 1) - 1) * (2 ^ (k - l) * f) * (2 ^ k * f) = (2 ^ (k + 1) - 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(k+1))*(2^(k-l))*(2^k)*f^2-(2^(k-l))*(2^k)*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ (k + 1) - 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (k + 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
by (smt left_diff_distrib' mult.commute mult_numeral_1_right numeral_One)
[PROOF STATE]
proof (state)
this:
(2 ^ (k + 1) - 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (k + 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ (k + 1) - 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (k + 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(k+1+k-l+k))*f^2-(2^(k-l))*(2^k)*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k + 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
by (metis Nat.add_diff_assoc assms(1) less_imp_le_nat power_add)
[PROOF STATE]
proof (state)
this:
2 ^ (k + 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ (k + 1) * 2 ^ (k - l) * 2 ^ k * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(3*k+1-l))*f^2-(2^(k-l))*(2^k)*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
using J
[PROOF STATE]
proof (prove)
using this:
k + 1 + k - l + k = 3 * k + 1 - l

goal (1 subgoal):
 1. 2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ (k + 1 + k - l + k) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have "\<dots> = (2^(3*k+1-l))*f^2-(2^(2*k-l))*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
using JJ
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) * 2 ^ k = 2 ^ (2 * k - l)

goal (1 subgoal):
 1. 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (k - l) * 2 ^ k * f\<^sup>2 = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Esigma (2 ^ k * p * q) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have YY:" Esigma((2^k)*p*q)= (2^(3*k+1-l))*f^2-(2^(2*k-l))*f^2"
[PROOF STATE]
proof (prove)
using this:
Esigma (2 ^ k * p * q) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have auxicalc: "(2^(2*k-l))*(f^2)=(2^(2*k-l))*f +(2^(2*k))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
have i: "(2^(2*k-l))*f = (2^(2*k-l))*(2^l+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * (2 ^ l + 1)
[PROOF STEP]
using assms \<open>f = 2^l+1\<close>
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
f = 2 ^ l + 1

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * (2 ^ l + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * (2 ^ l + 1)

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
have ii: "( 2^(2*k-l))*f = (2^(2*k-l))*( 2^l)+(2^(2*k-l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * 2 ^ l + 2 ^ (2 * k - l)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * (2 ^ l + 1)

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * 2 ^ l + 2 ^ (2 * k - l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * 2 ^ l + 2 ^ (2 * k - l)

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
have iii: "(2^(2*k-l))*f = (2^(2*k-l+l))+(2^(2*k-l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ (2 * k - l + l) + 2 ^ (2 * k - l)
[PROOF STEP]
using ii
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f = 2 ^ (2 * k - l) * 2 ^ l + 2 ^ (2 * k - l)

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ (2 * k - l + l) + 2 ^ (2 * k - l)
[PROOF STEP]
by (simp add: power_add)
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f = 2 ^ (2 * k - l + l) + 2 ^ (2 * k - l)

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
have iv: "( 2^(2*k-l))*f*f =(((2^(2*k))+(2^(2*k-l))))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f * f = (2 ^ (2 * k) + 2 ^ (2 * k - l)) * f
[PROOF STEP]
using iii assms
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f = 2 ^ (2 * k - l + l) + 2 ^ (2 * k - l)
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f * f = (2 ^ (2 * k) + 2 ^ (2 * k - l)) * f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f * f = (2 ^ (2 * k) + 2 ^ (2 * k - l)) * f

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
have v:  "(2^(2*k-l))*f *f =((2^(2*k)))*f+((2^(2*k-l)))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f * f = 2 ^ (2 * k) * f + 2 ^ (2 * k - l) * f
[PROOF STEP]
using iv assms comm_monoid_mult_axioms  power2_eq_square semiring_normalization_rules(18)
          semiring_normalization_rules
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f * f = (2 ^ (2 * k) + 2 ^ (2 * k - l)) * f
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
class.comm_monoid_mult (*) (1::?'a)
?a\<^sup>2 = ?a * ?a
?lx * (?rx * ?ry) = ?lx * ?rx * ?ry
?a * ?m + ?b * ?m = (?a + ?b) * ?m
?a * ?m + ?m = (?a + (1::?'a)) * ?m
?m + ?a * ?m = (?a + (1::?'a)) * ?m
?m + ?m = ((1::?'a) + (1::?'a)) * ?m
(0::?'a) + ?a = ?a
?a + (0::?'a) = ?a
?a * ?b = ?b * ?a
(?a + ?b) * ?c = ?a * ?c + ?b * ?c
(0::?'a) * ?a = (0::?'a)
?a * (0::?'a) = (0::?'a)
(1::?'a) * ?a = ?a
?a * (1::?'a) = ?a
?lx * ?ly * (?rx * ?ry) = ?lx * ?rx * (?ly * ?ry)
?lx * ?ly * (?rx * ?ry) = ?lx * (?ly * (?rx * ?ry))
?lx * ?ly * (?rx * ?ry) = ?rx * (?lx * ?ly * ?ry)
?lx * ?ly * ?rx = ?lx * ?rx * ?ly
?lx * ?ly * ?rx = ?lx * (?ly * ?rx)
?lx * (?rx * ?ry) = ?lx * ?rx * ?ry
?lx * (?rx * ?ry) = ?rx * (?lx * ?ry)
?a + ?b + (?c + ?d) = ?a + ?c + (?b + ?d)
?a + ?b + ?c = ?a + (?b + ?c)
?a + (?c + ?d) = ?c + (?a + ?d)
?a + ?b + ?c = ?a + ?c + ?b
?a + ?c = ?c + ?a
?a + (?c + ?d) = ?a + ?c + ?d
?x ^ ?p * ?x ^ ?q = ?x ^ (?p + ?q)
?x * ?x ^ ?q = ?x ^ Suc ?q
?x ^ ?q * ?x = ?x ^ Suc ?q
?x * ?x = ?x\<^sup>2
(?x * ?y) ^ ?q = ?x ^ ?q * ?y ^ ?q
(?x ^ ?p) ^ ?q = ?x ^ (?p * ?q)
?x ^ 0 = (1::?'a)
?x ^ 1 = ?x
?x * (?y + ?z) = ?x * ?y + ?x * ?z
?x ^ Suc ?q = ?x * ?x ^ ?q
?x ^ (2 * ?n) = ?x ^ ?n * ?x ^ ?n

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f * f = 2 ^ (2 * k) * f + 2 ^ (2 * k - l) * f
[PROOF STEP]
by (simp add: add_mult_distrib assms)
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f * f = 2 ^ (2 * k) * f + 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
(*slow*)
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f * f = 2 ^ (2 * k) * f + 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f * f = 2 ^ (2 * k) * f + 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
[PROOF STEP]
by (simp add: power2_eq_square semiring_normalization_rules(18))
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W1: "2^k*p*q + 2^k*r = 2^k *(p*q +r) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * p * q + 2 ^ k * r = 2 ^ k * (p * q + r)
[PROOF STEP]
by (simp add: add_mult_distrib2)
[PROOF STATE]
proof (state)
this:
2 ^ k * p * q + 2 ^ k * r = 2 ^ k * (p * q + r)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W2: "2^k*(p*q +r)= 2^k *((2^(k-l)*f-1)*((2^k)*f-1)+(2^(2*k-l))*f^2-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (p * q + r) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ k * (p * q + r) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ k * (p * q + r) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W3: "2^k*((2^(k-l)*f-1)*((2^k)*f-1)+(2^(2*k-l))*f^2-1)=
2^k*((2^(k-l)*f-1)*((2^k)*f)-(2^(k-l)*f-1)+(2^(2*k-l))*f^2-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
by (simp add: right_diff_distrib')
[PROOF STATE]
proof (state)
this:
2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W4: "2^k*((2^(k-l)*f-1)*((2^k)*f)-(2^(k-l)*f-1)+(2^(2*k-l))*f^2-1) =
2^k*((2^(k-l)*f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f-1)+(2^(2*k-l))*f^2-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
by (simp add: diff_mult_distrib)
[PROOF STATE]
proof (state)
this:
2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W5: " 2^k*((2^(k-l)*f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f-1)+(2^(2*k-l))*f^2-1) =
2^k *(( 2^(k-l)*f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f)+1 +(2^(2*k-l))*f^2-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
using assms  less_imp_le_nat less_imp_le_nat  prime_ge_1_nat
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
?m < ?n \<Longrightarrow> ?m \<le> ?n
?m < ?n \<Longrightarrow> ?m \<le> ?n
prime ?p \<Longrightarrow> 1 \<le> ?p

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
[PROOF STEP]
by (smt Nat.add_diff_assoc2 Nat.diff_diff_right One_nat_def Suc_leI Suc_pred W3 W4
          add_diff_cancel_right' add_gr_0 le_Suc_ex less_numeral_extra(1) mult_cancel1
          nat_0_less_mult_iff zero_less_diff zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W6: "2^k*((2^(k-l)* f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f)+1+(2^(2*k-l))*f^2-1 ) =
 2^k*((2^(k-l)*f)*((2^k)*f)-((2^k )*f)-(2^(k-l)*f)+(2^(2*k-l))*f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W7: "2^k*((2^(k-l)*f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f)+(2^(2*k-l))*f^2) =
   2^k *((2^(2*k-l+1)*(f^2))-((2^k)*f)-(2^(k-l)* f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have a: "(2^(k-l)*f)*(2^k * f) = (2^(k-l)*f*(f*(2^k))) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) = 2 ^ (k - l) * f * (f * 2 ^ k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) = 2 ^ (k - l) * f * (f * 2 ^ k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * f * (2 ^ k * f) = 2 ^ (k - l) * f * (f * 2 ^ k)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have b: "(2^(k-l)*f)*(f*(2^k)) = 2^(k-l)*(f*f)*(2^k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * f * (f * 2 ^ k) = 2 ^ (k - l) * (f * f) * 2 ^ k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (f * 2 ^ k) = 2 ^ (k - l) * (f * f) * 2 ^ k
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * f * (f * 2 ^ k) = 2 ^ (k - l) * (f * f) * 2 ^ k

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have c: "2^(k-l)*(f*f)*(2^k) = 2^(k-l+k)*(f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * (f * f) * 2 ^ k = 2 ^ (k - l + k) * f\<^sup>2
[PROOF STEP]
using Semiring_Normalization.comm_semiring_1_class.semiring_normalization_rules(16)
          Semiring_Normalization.comm_semiring_1_class.semiring_normalization_rules(29)
[PROOF STATE]
proof (prove)
using this:
?lx * ?ly * ?rx = ?lx * ?rx * ?ly
?x * ?x = ?x\<^sup>2

goal (1 subgoal):
 1. 2 ^ (k - l) * (f * f) * 2 ^ k = 2 ^ (k - l + k) * f\<^sup>2
[PROOF STEP]
by  (simp add:  power_add)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * (f * f) * 2 ^ k = 2 ^ (k - l + k) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have d: "2^(k-l+k) *(f^2) = 2^(2*k-l) *(f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l + k) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by (simp add: JJ power_add)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l + k) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have e: "(2^(2*k-l))*f^2 + (2^(2*k-l))*f^2 =  2^(2*k-l +1)*(f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f\<^sup>2 + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have f1: "((2^(k-l)*f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f)+(2^(2*k-l))*f^2) =
    (2^(2*k-l)*(f^2)-((2^k)*f)-(2^(k-l)*f)+(2^(2*k-l))*f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
using a b c d e
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) * f * (2 ^ k * f) = 2 ^ (k - l) * f * (f * 2 ^ k)
2 ^ (k - l) * f * (f * 2 ^ k) = 2 ^ (k - l) * (f * f) * 2 ^ k
2 ^ (k - l) * (f * f) * 2 ^ k = 2 ^ (k - l + k) * f\<^sup>2
2 ^ (k - l + k) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2
2 ^ (2 * k - l) * f\<^sup>2 + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
have f2:"((2^(k-l)*f)*((2^k)*f)-((2^k)*f)-(2^(k-l)*f))+(2^(2*k-l))*f^2
       = ((2^(2*k-l+1)*(f^2))-((2^k)*f)-(2^(k-l)*f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
have aa: "f > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

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

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
have a: "((2::nat)^(2*k-l))*f^2-((2::nat)^(k-l)*f)>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
[PROOF STEP]
have b: "(2::nat)^(2*k-l) > 2^(k-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) < 2 ^ (2 * k - l)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ (k - l) < 2 ^ (2 * k - l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) < 2 ^ (2 * k - l)

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
[PROOF STEP]
have c: "(2::nat)^(2*k-l)*f > 2^(k-l)*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * f < 2 ^ (2 * k - l) * f
[PROOF STEP]
using a assms
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) * f * (2 ^ k * f) = 2 ^ (k - l) * f * (f * 2 ^ k)
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ (k - l) * f < 2 ^ (2 * k - l) * f
[PROOF STEP]
by (metis One_nat_def add_gr_0 b lessI mult_less_mono1)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * f < 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
[PROOF STEP]
using c auxicalc
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) * f < 2 ^ (2 * k - l) * f
2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
have aaa: "(2^(2*k-l))*f^2 -(2^(k-l)*f)-((2^k)*f) >0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f
[PROOF STEP]
have A: "(2^(2*k-l))*f-(2^(k-l))-(( 2^k)) >0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
[PROOF STEP]
have A_1 : "(2^(2*k-l))*f  > (2^(k-l))+((2^k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
have A_2: "(2^(2*k-l))*f = 2^(k)*2^(k-l)*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f = 2 ^ k * 2 ^ (k - l) * f
[PROOF STEP]
by (metis JJ semiring_normalization_rules(7))
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f = 2 ^ k * 2 ^ (k - l) * f

goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
have df1: "(2^(k-l))+((2^k))< ((2::nat)^(2*k-l))+((2^k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) + 2 ^ k
[PROOF STEP]
using \<open>l < k\<close>
[PROOF STATE]
proof (prove)
using this:
l < k

goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) + 2 ^ k
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) + 2 ^ k

goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
have df2: "((2::nat)^(2*k-l))+((2^k)) < ((2::nat)^(2*k-l))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
have "k >1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

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

goal (1 subgoal):
 1. 2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
have df: "((2::nat)^(k-l))+(1::nat) < ((2::nat)^(k-l))*f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
obtain x::nat where xx: "x=(2::nat)^(k-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x = 2 ^ (k - l) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = 2 ^ (k - l)

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
have xxx: "x \<ge>( 2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> x
[PROOF STEP]
using assms xx
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
x = 2 ^ (k - l)

goal (1 subgoal):
 1. 2 \<le> x
[PROOF STEP]
by (metis One_nat_def Suc_leI one_le_numeral power_increasing
                        semiring_normalization_rules(33) zero_less_diff)
[PROOF STATE]
proof (state)
this:
2 \<le> x

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
have c: "x*f \<ge> x*(2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * 2 \<le> x * f
[PROOF STEP]
using aa
[PROOF STATE]
proof (prove)
using this:
1 < f

goal (1 subgoal):
 1. x * 2 \<le> x * f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x * 2 \<le> x * f

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
have c1: "x+(1::nat) < x*(2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + 1 < x * 2
[PROOF STEP]
using auxiliary_ineq  xxx
[PROOF STATE]
proof (prove)
using this:
2 \<le> ?x \<Longrightarrow> ?x + 1 < 2 * ?x
2 \<le> x

goal (1 subgoal):
 1. x + 1 < x * 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x + 1 < x * 2

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
have c2: "((2::nat)^(k-l))+(1::nat) < ((2::nat)^(k-l))*(2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * 2
[PROOF STEP]
using c1 xx
[PROOF STATE]
proof (prove)
using this:
x + 1 < x * 2
x = 2 ^ (k - l)

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) + 1 < 2 ^ (k - l) * 2

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
using c2 c xx
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) + 1 < 2 ^ (k - l) * 2
x * 2 \<le> x * f
x = 2 ^ (k - l)

goal (1 subgoal):
 1. 2 ^ (k - l) + 1 < 2 ^ (k - l) * f
[PROOF STEP]
by (metis diff_is_0_eq' le_trans nat_less_le zero_less_diff)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) + 1 < 2 ^ (k - l) * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) + 1 < 2 ^ (k - l) * f

goal (1 subgoal):
 1. 2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
using df aa assms
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) + 1 < 2 ^ (k - l) * f
1 < f
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
by (smt JJ add.commute mult_less_cancel2 semiring_normalization_rules
                      zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
using A_2 df1 df2
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f = 2 ^ k * 2 ^ (k - l) * f
2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) + 2 ^ k
2 ^ (2 * k - l) + 2 ^ k < 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
[PROOF STEP]
using assms A_1
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
[PROOF STEP]
using diff_diff_left zero_less_diff
[PROOF STATE]
proof (prove)
using this:
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
2 ^ (k - l) + 2 ^ k < 2 ^ (2 * k - l) * f
?i - ?j - ?k = ?i - (?j + ?k)
(0 < ?n - ?m) = (?m < ?n)

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f
[PROOF STEP]
using A aa assms
[PROOF STATE]
proof (prove)
using this:
0 < 2 ^ (2 * k - l) * f - 2 ^ (k - l) - 2 ^ k
1 < f
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r

goal (1 subgoal):
 1. 0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f
[PROOF STEP]
by (metis (no_types, opaque_lifting)  a nat_0_less_mult_iff right_diff_distrib'
                semiring_normalization_rules(18) semiring_normalization_rules(29)
               semiring_normalization_rules(7))
[PROOF STATE]
proof (state)
this:
0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f - 2 ^ k * f

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
have b3: "((2^(2*k-l)*(f^2))-((2^k)*f)-(2^(k-l)*f)+(2^(2*k-l))*f^2) =
                  (2*(2^(2*k-l)*(f^2))-((2^k)*f)-(2^(k-l)*f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 * (2 ^ (2 * k - l) * f\<^sup>2) - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
using a aa assms  minus_eq_nat_subst_order
[PROOF STATE]
proof (prove)
using this:
0 < 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ (k - l) * f
1 < f
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
\<lbrakk>0 < ?B - ?C - ?D; ?A = ?B - ?C - ?D + ?B\<rbrakk> \<Longrightarrow> ?A = 2 * ?B - ?C - ?D

goal (1 subgoal):
 1. 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 * (2 ^ (2 * k - l) * f\<^sup>2) - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
by (smt aaa diff_commute)
[PROOF STATE]
proof (state)
this:
2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 * (2 ^ (2 * k - l) * f\<^sup>2) - 2 ^ k * f - 2 ^ (k - l) * f

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f
[PROOF STEP]
by (metis b3 e mult_2)
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
using f2
[PROOF STATE]
proof (prove)
using this:
2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have W8: "2^k*((2^(2*k-l+1)*(f^2))-((2^k)*f)-(2^(k-l)*f)) = (2^(3*k+1-l))*f^2-(2^(2*k-l))*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have a: "2^k*(2^(2*k-l+1)*f^2-2^k*f-2^(k-l)*f) = 2^k*(2^(2*k-l+1)*f^2)-2^k*(2^k*f)-2^k*(2^(k-l)*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have b: "2^k*(2^(2*k-l+1)*f^2)-2^k*(2^k*f)-2^k*(2^(k-l)*f) =
2^k*(2^(2*k-l+1)*f^2)-2^k*(2^k*f)-2^k*(2^(k-l)*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have c: "2^k*(2^(2*k-l+1)*f^2)-2^k*(2^k*f)-2^k*(2^(k-l)*f) =
2^(2*k+1-l+k)*f^2-2^k*(2^k*f)-2^k*(2^(k-l)*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f) = 2 ^ (2 * k + 1 - l + k) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
[PROOF STEP]
apply (simp add: algebra_simps power_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (f\<^sup>2 * (2 ^ k * 2 ^ (k * 2 - l))) - (f * (2 ^ k * 2 ^ k) + f * (2 ^ k * 2 ^ (k - l))) = f\<^sup>2 * (2 ^ k * 2 ^ (Suc (k * 2) - l)) - (f * (2 ^ k * 2 ^ k) + f * (2 ^ k * 2 ^ (k - l)))
[PROOF STEP]
by (smt Groups.mult_ac(1) Groups.mult_ac(2) Nat.diff_add_assoc assms(1) le_simps(1)
mult_2_right plus_nat.simps(2) power.simps(2))
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f) = 2 ^ (2 * k + 1 - l + k) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have d: "2^k*(2^(2*k-l+1)*(f^2))= (2^(3*k+1-l))*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) = 2 ^ (3 * k + 1 - l) * f\<^sup>2
[PROOF STEP]
using power_add   Nat.add_diff_assoc assms(1) less_imp_le_nat mult_2
          semiring_normalization_rules(18) semiring_normalization_rules(23)
[PROOF STATE]
proof (prove)
using this:
?a ^ (?m + ?n) = ?a ^ ?m * ?a ^ ?n
?k \<le> ?j \<Longrightarrow> ?i + (?j - ?k) = ?i + ?j - ?k
l < k
?m < ?n \<Longrightarrow> ?m \<le> ?n
(2::?'a) * ?z = ?z + ?z
?lx * (?rx * ?ry) = ?lx * ?rx * ?ry
?a + ?b + ?c = ?a + ?c + ?b

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) = 2 ^ (3 * k + 1 - l) * f\<^sup>2
[PROOF STEP]
by (smt J)
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) = 2 ^ (3 * k + 1 - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have e: "2^k*((2^(2*k-l+1)*(f^2))-((2^k)*f)-(2^(k-l)*f)) =
(2^(3*k+1-l))*f^2-(2^k)*((2^k)*f)-(2^k)*(2^(k-l)*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
[PROOF STEP]
using a b c d  One_nat_def  one_le_mult_iff
          Nat.add_diff_assoc assms(1) less_imp_le_nat
[PROOF STATE]
proof (prove)
using this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f) = 2 ^ (2 * k + 1 - l + k) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2) = 2 ^ (3 * k + 1 - l) * f\<^sup>2
1 = Suc 0
(Suc 0 \<le> ?m * ?n) = (Suc 0 \<le> ?m \<and> Suc 0 \<le> ?n)
?k \<le> ?j \<Longrightarrow> ?i + (?j - ?k) = ?i + ?j - ?k
l < k
?m < ?n \<Longrightarrow> ?m \<le> ?n

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have ee: "2^k*((2^(2*k-l+1)*(f^2))-((2^k)*f)-((2::nat)^(k-l)*f))
= (2^(3*k+1-l))*f^2-( 2^k)*((2^k)*f)-(2^(2*k-l)*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ (2 * k - l) * f
[PROOF STEP]
using e  power_add  Nat.add_diff_assoc assms(1) less_imp_le_nat mult_2
          semiring_normalization_rules
[PROOF STATE]
proof (prove)
using this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ k * (2 ^ (k - l) * f)
?a ^ (?m + ?n) = ?a ^ ?m * ?a ^ ?n
?k \<le> ?j \<Longrightarrow> ?i + (?j - ?k) = ?i + ?j - ?k
l < k
?m < ?n \<Longrightarrow> ?m \<le> ?n
(2::?'a) * ?z = ?z + ?z
?a * ?m + ?b * ?m = (?a + ?b) * ?m
?a * ?m + ?m = (?a + (1::?'a)) * ?m
?m + ?a * ?m = (?a + (1::?'a)) * ?m
?m + ?m = ((1::?'a) + (1::?'a)) * ?m
(0::?'a) + ?a = ?a
?a + (0::?'a) = ?a
?a * ?b = ?b * ?a
(?a + ?b) * ?c = ?a * ?c + ?b * ?c
(0::?'a) * ?a = (0::?'a)
?a * (0::?'a) = (0::?'a)
(1::?'a) * ?a = ?a
?a * (1::?'a) = ?a
?lx * ?ly * (?rx * ?ry) = ?lx * ?rx * (?ly * ?ry)
?lx * ?ly * (?rx * ?ry) = ?lx * (?ly * (?rx * ?ry))
?lx * ?ly * (?rx * ?ry) = ?rx * (?lx * ?ly * ?ry)
?lx * ?ly * ?rx = ?lx * ?rx * ?ly
?lx * ?ly * ?rx = ?lx * (?ly * ?rx)
?lx * (?rx * ?ry) = ?lx * ?rx * ?ry
?lx * (?rx * ?ry) = ?rx * (?lx * ?ry)
?a + ?b + (?c + ?d) = ?a + ?c + (?b + ?d)
?a + ?b + ?c = ?a + (?b + ?c)
?a + (?c + ?d) = ?c + (?a + ?d)
?a + ?b + ?c = ?a + ?c + ?b
?a + ?c = ?c + ?a
?a + (?c + ?d) = ?a + ?c + ?d
?x ^ ?p * ?x ^ ?q = ?x ^ (?p + ?q)
?x * ?x ^ ?q = ?x ^ Suc ?q
?x ^ ?q * ?x = ?x ^ Suc ?q
?x * ?x = ?x\<^sup>2
(?x * ?y) ^ ?q = ?x ^ ?q * ?y ^ ?q
(?x ^ ?p) ^ ?q = ?x ^ (?p * ?q)
?x ^ 0 = (1::?'a)
?x ^ 1 = ?x
?x * (?y + ?z) = ?x * ?y + ?x * ?z
?x ^ Suc ?q = ?x * ?x ^ ?q
?x ^ (2 * ?n) = ?x ^ ?n * ?x ^ ?n

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ (2 * k - l) * f
[PROOF STEP]
by (smt J)
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have eee :
        "-(( 2::nat)^(2*k-l))*(f^(2::nat)) =(-(( 2::nat)^(2*k))*f-(( 2::nat)^(2*k-l))*f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - int (2 ^ (2 * k - l)) * int (f\<^sup>2) = - int (2 ^ (2 * k)) * int f - int (2 ^ (2 * k - l) * f)
[PROOF STEP]
using auxicalc mult_minus_eq_nat mult_minus_left of_nat_mult
[PROOF STATE]
proof (prove)
using this:
2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f
?x + ?y = ?z \<Longrightarrow> - int ?x - int ?y = - int ?z
- ?a * ?b = - (?a * ?b)
of_nat (?m * ?n) = of_nat ?m * of_nat ?n

goal (1 subgoal):
 1. - int (2 ^ (2 * k - l)) * int (f\<^sup>2) = - int (2 ^ (2 * k)) * int f - int (2 ^ (2 * k - l) * f)
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
- int (2 ^ (2 * k - l)) * int (f\<^sup>2) = - int (2 ^ (2 * k)) * int f - int (2 ^ (2 * k - l) * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have e4: "2^k*((2^(2*k-l+1)*(f^2))-((2^k)*f)-(2^(k-l)*f))=(2^(3*k+1-l))*f^2-(2^(2*k-l))*(f^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
define A where A: "A = 2^k*((2^(2*k-l+1)*(f^2))-((2^k)*f)-(2^(k-l)*f))"
[PROOF STATE]
proof (state)
this:
A = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
define B where B: "B = (2^(3*k+(1::nat)-l))*f^2"
[PROOF STATE]
proof (state)
this:
B = 2 ^ (3 * k + 1 - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
define C where C: "C = (2^k)*((2^k)*f)"
[PROOF STATE]
proof (state)
this:
C = 2 ^ k * (2 ^ k * f)

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
define D where D: "D = (2^(2*k-l)*f)"
[PROOF STATE]
proof (state)
this:
D = 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
define E where E: "E = (2^(2*k-l))*(f^2)"
[PROOF STATE]
proof (state)
this:
E = 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have wq: "A = B-C-D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B - C - D
[PROOF STEP]
using ee A B C D
[PROOF STATE]
proof (prove)
using this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ k * (2 ^ k * f) - 2 ^ (2 * k - l) * f
A = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
B = 2 ^ (3 * k + 1 - l) * f\<^sup>2
C = 2 ^ k * (2 ^ k * f)
D = 2 ^ (2 * k - l) * f

goal (1 subgoal):
 1. A = B - C - D
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A = B - C - D

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have wq1: "-E = -C-D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - int E = - int C - int D
[PROOF STEP]
using eee C D E
[PROOF STATE]
proof (prove)
using this:
- int (2 ^ (2 * k - l)) * int (f\<^sup>2) = - int (2 ^ (2 * k)) * int f - int (2 ^ (2 * k - l) * f)
C = 2 ^ k * (2 ^ k * f)
D = 2 ^ (2 * k - l) * f
E = 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. - int E = - int C - int D
[PROOF STEP]
by (simp add: semiring_normalization_rules(36))
[PROOF STATE]
proof (state)
this:
- int E = - int C - int D

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
have wq2: "A = B-E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B - E
[PROOF STEP]
using wq wq1  minus_eq_nat_subst
[PROOF STATE]
proof (prove)
using this:
A = B - C - D
- int E = - int C - int D
\<lbrakk>?A = ?B - ?C - ?D; - int ?E = - int ?C - int ?D\<rbrakk> \<Longrightarrow> ?A = ?B - ?E

goal (1 subgoal):
 1. A = B - E
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A = B - E

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
using wq2 A B E
[PROOF STATE]
proof (prove)
using this:
A = B - E
A = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
B = 2 ^ (3 * k + 1 - l) * f\<^sup>2
E = 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
using e4
[PROOF STATE]
proof (prove)
using this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
have Y: "2^k*p*q+2^k*r = (2^(3*k+1-l))*f^2-(2^(2*k-l))*f^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ k * p * q + 2 ^ k * r = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
using W1 W2 W3 W4 W5 W6 W7 W8
[PROOF STATE]
proof (prove)
using this:
2 ^ k * p * q + 2 ^ k * r = 2 ^ k * (p * q + r)
2 ^ k * (p * q + r) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
2 ^ k * ((2 ^ (k - l) * f - 1) * (2 ^ k * f) - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - (2 ^ (k - l) * f - 1) + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1)
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 1 + 2 ^ (2 * k - l) * f\<^sup>2 - 1) = 2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2)
2 ^ k * (2 ^ (k - l) * f * (2 ^ k * f) - 2 ^ k * f - 2 ^ (k - l) * f + 2 ^ (2 * k - l) * f\<^sup>2) = 2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f)
2 ^ k * (2 ^ (2 * k - l + 1) * f\<^sup>2 - 2 ^ k * f - 2 ^ (k - l) * f) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. 2 ^ k * p * q + 2 ^ k * r = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 ^ k * p * q + 2 ^ k * r = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
using Y YY  auxicalc
[PROOF STATE]
proof (prove)
using this:
2 ^ k * p * q + 2 ^ k * r = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
Esigma (2 ^ k * p * q) = 2 ^ (3 * k + 1 - l) * f\<^sup>2 - 2 ^ (2 * k - l) * f\<^sup>2
2 ^ (2 * k - l) * f\<^sup>2 = 2 ^ (2 * k - l) * f + 2 ^ (2 * k) * f

goal (1 subgoal):
 1. Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
using Z Z1 Amicable_pair_equiv_def_conv assms One_nat_def  one_le_mult_iff
         one_le_numeral less_imp_le_nat one_le_power
[PROOF STATE]
proof (prove)
using this:
Esigma (2 ^ k * p * q) = Esigma (2 ^ k * r)
Esigma (2 ^ k * p * q) = 2 ^ k * p * q + 2 ^ k * r
\<lbrakk>1 \<le> ?m; 1 \<le> ?n; Esigma ?m = Esigma ?n \<and> Esigma ?m = ?m + ?n\<rbrakk> \<Longrightarrow> ?m Amic ?n
l < k
1 \<le> l
f = 2 ^ l + 1
prime p
prime q
prime r
p = 2 ^ (k - l) * f - 1
q = 2 ^ k * f - 1
r = 2 ^ (2 * k - l) * f\<^sup>2 - 1
m = 2 ^ k * p * q
n = 2 ^ k * r
1 = Suc 0
(Suc 0 \<le> ?m * ?n) = (Suc 0 \<le> ?m \<and> Suc 0 \<le> ?n)
(1::?'a) \<le> numeral ?n
?m < ?n \<Longrightarrow> ?m \<le> ?n
(1::?'a) \<le> ?a \<Longrightarrow> (1::?'a) \<le> ?a ^ ?n

goal (1 subgoal):
 1. m Amic n
[PROOF STEP]
by (metis prime_ge_1_nat)
[PROOF STATE]
proof (state)
this:
m Amic n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vpairs_mono:
  assumes "r \<subseteq>\<^sub>\<circ> s"
  shows "vpairs r \<subseteq>\<^sub>\<circ> vpairs s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vpairs r \<subseteq>\<^sub>\<circ> vpairs s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<subseteq>\<^sub>\<circ> s

goal (1 subgoal):
 1. vpairs r \<subseteq>\<^sub>\<circ> vpairs s
[PROOF STEP]
by blast


[STATEMENT]
lemma compute_floorlog [code]:
  "floorlog b x = (if x > 0 \<and> b > 1 then floorlog b (x div b) + 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. floorlog b x = (if 0 < x \<and> 1 < b then floorlog b (x div b) + 1 else 0)
[PROOF STEP]
by (auto simp: floorlog_def floor_log_div[of b x] div_eq_0_iff nat_add_distrib
    intro!: floor_eq2)


[STATEMENT]
lemma incseq_interlaced_seq:
  assumes "(\<lambda>n. of_rat (r n)) \<longlonglongrightarrow> (x::real)"
  and "(\<lambda>n. of_rat (s n)) \<longlonglongrightarrow> (x::real)"
  and "\<forall>n. of_rat (r n) < x"
  and "\<forall>n. of_rat (s n) < x"
  shows "incseq (interlaced_seq r s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
have "interlaced_seq r s n \<le> interlaced_seq r s (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interlaced_seq r s n \<le> interlaced_seq r s (Suc n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
(\<lambda>n. real_of_rat (s n)) \<longlonglongrightarrow> x
\<forall>n. real_of_rat (r n) < x
\<forall>n. real_of_rat (s n) < x

goal (1 subgoal):
 1. interlaced_seq r s n \<le> interlaced_seq r s (Suc n)
[PROOF STEP]
by (auto intro: LeastI2_ex [OF lemma_seq_point_gt_ex2]
          simp add: interlaced_seq_def)
[PROOF STATE]
proof (state)
this:
interlaced_seq r s n \<le> interlaced_seq r s (Suc n)

goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
interlaced_seq r s ?n2 \<le> interlaced_seq r s (Suc ?n2)

goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interlaced_seq r s ?n2 \<le> interlaced_seq r s (Suc ?n2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interlaced_seq r s ?n2 \<le> interlaced_seq r s (Suc ?n2)

goal (1 subgoal):
 1. incseq (interlaced_seq r s)
[PROOF STEP]
by (simp add: incseq_SucI)
[PROOF STATE]
proof (state)
this:
incseq (interlaced_seq r s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma state_set_card:
  fixes X
  shows "card (state_set X) = length X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (state_set X) = length X
[PROOF STEP]
proof (induction X)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (state_set []) = length []
 2. \<And>a X. card (state_set X) = length X \<Longrightarrow> card (state_set (a # X)) = length (a # X)
[PROOF STEP]
case (Cons a X)
[PROOF STATE]
proof (state)
this:
card (state_set X) = length X

goal (2 subgoals):
 1. card (state_set []) = length []
 2. \<And>a X. card (state_set X) = length X \<Longrightarrow> card (state_set (a # X)) = length (a # X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (state_set X) = length X
[PROOF STEP]
have "card (state_set (a # X)) = 1 + card (state_set X)"
[PROOF STATE]
proof (prove)
using this:
card (state_set X) = length X

goal (1 subgoal):
 1. card (state_set (a # X)) = 1 + card (state_set X)
[PROOF STEP]
using state_set_card_iii
[PROOF STATE]
proof (prove)
using this:
card (state_set X) = length X
card (state_set (?a # ?X)) = 1 + card (state_set ?X)

goal (1 subgoal):
 1. card (state_set (a # X)) = 1 + card (state_set X)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
card (state_set (a # X)) = 1 + card (state_set X)

goal (2 subgoals):
 1. card (state_set []) = length []
 2. \<And>a X. card (state_set X) = length X \<Longrightarrow> card (state_set (a # X)) = length (a # X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (state_set (a # X)) = 1 + card (state_set X)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (state_set (a # X)) = 1 + card (state_set X)

goal (1 subgoal):
 1. card (state_set (a # X)) = length (a # X)
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
card (state_set (a # X)) = 1 + card (state_set X)
card (state_set X) = length X

goal (1 subgoal):
 1. card (state_set (a # X)) = length (a # X)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card (state_set (a # X)) = length (a # X)

goal (1 subgoal):
 1. card (state_set []) = length []
[PROOF STEP]
qed auto


[STATEMENT]
lemma resolute_on_decisive_on:
  assumes "resolute_on A f"
  shows "decisive_on A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decisive_on A f
[PROOF STEP]
using %invisible assms
[PROOF STATE]
proof (prove)
using this:
resolute_on A f

goal (1 subgoal):
 1. decisive_on A f
[PROOF STEP]
unfolding resolute_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>B\<subseteq>A. B \<noteq> {} \<longrightarrow> (\<exists>a. f B = {a})

goal (1 subgoal):
 1. decisive_on A f
[PROOF STEP]
by - (rule decisive_onI; auto)


[STATEMENT]
lemma square_continuous:
  fixes e :: real
  shows "e > 0 \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>y. \<bar>y - x\<bar> < d \<longrightarrow> \<bar>y * y - x * x\<bar> < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>y. \<bar>y - x\<bar> < d \<longrightarrow> \<bar>y * y - x * x\<bar> < e
[PROOF STEP]
using isCont_power[OF continuous_ident, of x, unfolded isCont_def LIM_eq, rule_format, of e 2]
[PROOF STATE]
proof (prove)
using this:
0 < e \<Longrightarrow> \<exists>s>0. \<forall>xa. xa \<noteq> x \<and> norm (xa - x) < s \<longrightarrow> norm (xa\<^sup>2 - x\<^sup>2) < e

goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>y. \<bar>y - x\<bar> < d \<longrightarrow> \<bar>y * y - x * x\<bar> < e
[PROOF STEP]
by (force simp add: power2_eq_square)


[STATEMENT]
lemma last_rot90_knights_path:
  assumes "knights_path (board n m) ps" "last ps = (i,j)"
  shows "last (mirror1 (transpose ps)) = (int m+1-j,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
knights_path (board n m) ps
last ps = (i, j)

goal (1 subgoal):
 1. last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>knights_path (board n m) ps; last ps = (i, j)\<rbrakk> \<Longrightarrow> last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)
[PROOF STEP]
have "last (transpose ps) = (j,i)" "knights_path (board m n) (transpose ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (KnightsTour.transpose ps) = (j, i) &&& knights_path (board m n) (KnightsTour.transpose ps)
[PROOF STEP]
using assms knights_path_non_nil last_transpose transpose_knights_path
[PROOF STATE]
proof (prove)
using this:
knights_path (board n m) ps
last ps = (i, j)
knights_path ?b ?ps \<Longrightarrow> ?ps \<noteq> []
?ps \<noteq> [] \<Longrightarrow> last (KnightsTour.transpose ?ps) = transpose_square (last ?ps)
knights_path (board ?n ?m) ?ps \<Longrightarrow> knights_path (board ?m ?n) (KnightsTour.transpose ?ps)

goal (1 subgoal):
 1. last (KnightsTour.transpose ps) = (j, i) &&& knights_path (board m n) (KnightsTour.transpose ps)
[PROOF STEP]
by (auto simp: transpose_square_def)
[PROOF STATE]
proof (state)
this:
last (KnightsTour.transpose ps) = (j, i)
knights_path (board m n) (KnightsTour.transpose ps)

goal (1 subgoal):
 1. \<lbrakk>knights_path (board n m) ps; last ps = (i, j)\<rbrakk> \<Longrightarrow> last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
last (KnightsTour.transpose ps) = (j, i)
knights_path (board m n) (KnightsTour.transpose ps)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
last (KnightsTour.transpose ps) = (j, i)
knights_path (board m n) (KnightsTour.transpose ps)

goal (1 subgoal):
 1. last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)
[PROOF STEP]
using last_mirror1
[PROOF STATE]
proof (prove)
using this:
last (KnightsTour.transpose ps) = (j, i)
knights_path (board m n) (KnightsTour.transpose ps)
\<lbrakk>knights_path (board ?n ?m) ?ps; last ?ps = (?i, ?j)\<rbrakk> \<Longrightarrow> last (mirror1 ?ps) = (int ?n + 1 - ?i, ?j)

goal (1 subgoal):
 1. last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
last (mirror1 (KnightsTour.transpose ps)) = (int m + 1 - j, i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma weight_simp [simp]:
  "weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))
[PROOF STEP]
define scff where "scff = (scf (f, length ts) :: nat \<Rightarrow> nat)"
[PROOF STATE]
proof (state)
this:
scff = scf (f, length ts)

goal (1 subgoal):
 1. weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))
[PROOF STEP]
have "(\<Sum>(ti, i) \<leftarrow> zip ts [0..<length ts]. weight ti * scff i) =
   sum_list (map weight (scf_list scff ts))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))
[PROOF STEP]
proof (induct ts rule: List.rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
case (snoc t ts)
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))

goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))

goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))

goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
have "sum_list (replicate n (weight t)) = n * weight t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (replicate n (weight t)) = n * weight t
[PROOF STEP]
by (induct n) auto
[PROOF STATE]
proof (state)
this:
sum_list (replicate n (weight t)) = n * weight t

goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
sum_list (replicate ?n7 (weight t)) = ?n7 * weight t

goal (2 subgoals):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
 2. \<And>x xs. sum_list (map2 (\<lambda>ti i. weight ti * scff i) xs [0..<length xs]) = sum_list (map weight (scf_list scff xs)) \<Longrightarrow> sum_list (map2 (\<lambda>ti i. weight ti * scff i) (xs @ [x]) [0..<length (xs @ [x])]) = sum_list (map weight (scf_list scff (xs @ [x])))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))
sum_list (replicate ?n7 (weight t)) = ?n7 * weight t
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))
sum_list (replicate ?n7 (weight t)) = ?n7 * weight t

goal (1 subgoal):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) (ts @ [t]) [0..<length (ts @ [t])]) = sum_list (map weight (scf_list scff (ts @ [t])))
[PROOF STEP]
by (simp add: scf_list_def)
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) (ts @ [t]) [0..<length (ts @ [t])]) = sum_list (map weight (scf_list scff (ts @ [t])))

goal (1 subgoal):
 1. sum_list (map2 (\<lambda>ti i. weight ti * scff i) [] [0..<length []]) = sum_list (map weight (scf_list scff []))
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))

goal (1 subgoal):
 1. weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (\<lambda>ti i. weight ti * scff i) ts [0..<length ts]) = sum_list (map weight (scf_list scff ts))

goal (1 subgoal):
 1. weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))
[PROOF STEP]
by (simp add: Let_def scff_def)
[PROOF STATE]
proof (state)
this:
weight (Fun f ts) = w (f, length ts) + sum_list (map weight (scf_list (scf (f, length ts)) ts))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cut_less_Min_not_empty: "\<lbrakk> I \<noteq> {}; iMin I < t \<rbrakk> \<Longrightarrow> I \<down>< t \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; iMin I < t\<rbrakk> \<Longrightarrow> I \<down>< t \<noteq> {}
[PROOF STEP]
apply (simp add: i_cut_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; iMin I < t\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> I \<and> x < t
[PROOF STEP]
apply (rule_tac x="iMin I" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; iMin I < t\<rbrakk> \<Longrightarrow> iMin I \<in> I \<and> iMin I < t
[PROOF STEP]
apply (simp add: iMinI_ex2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done