[STATEMENT]
lemma divisibility_cong:
  fixes e f :: int
  fixes l :: nat
  fixes M :: mat2
  assumes "mat_22 M = 0" "mat_21 M = 1"
  shows "(mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))) mod e^2 = (-1)^(l-1)*l*e*f^(l-1)*(mat_21 M) mod e^2
        \<and> mat_22  (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e^2 = (-1)^l *f^l mod e^2"
(is "?P l \<and> ?Q l" )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
[PROOF STEP]
proof(induction l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mat_21 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (0 - 1) * int 0 * e * f ^ (0 - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ 0 * f ^ 0 mod e\<^sup>2
 2. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. mat_21 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (0 - 1) * int 0 * e * f ^ (0 - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ 0 * f ^ 0 mod e\<^sup>2
 2. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_21 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (0 - 1) * int 0 * e * f ^ (0 - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ 0 * f ^ 0 mod e\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_21 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (0 - 1) * int 0 * e * f ^ (0 - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow 0 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ 0 * f ^ 0 mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
case (Suc l)
[PROOF STATE]
proof (state)
this:
mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S2: "mat_pow (Suc(l)) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) =
    mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
[PROOF STEP]
using mat_exp_law[of l _ 1] mat2.sel
[PROOF STATE]
proof (prove)
using this:
mat_mul (mat_pow l ?M) (mat_pow 1 ?M) = mat_pow (l + 1) ?M
mat_11 (mat ?x1.0 ?x2.0 ?x3.0 ?x4.0) = ?x1.0
mat_12 (mat ?x1.0 ?x2.0 ?x3.0 ?x4.0) = ?x2.0
mat_21 (mat ?x1.0 ?x2.0 ?x3.0 ?x4.0) = ?x3.0
mat_22 (mat ?x1.0 ?x2.0 ?x3.0 ?x4.0) = ?x4.0

goal (1 subgoal):
 1. mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
[PROOF STEP]
by (auto, metis)+
[PROOF STATE]
proof (state)
this:
mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define a1 where "a1 = mat_11 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))"
[PROOF STATE]
proof (state)
this:
a1 = mat_11 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define b1 where "b1 = mat_12 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))"
[PROOF STATE]
proof (state)
this:
b1 = mat_12 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define c1 where "c1 = mat_21 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))"
[PROOF STATE]
proof (state)
this:
c1 = mat_21 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define d1 where "d1 = mat_22 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))"
[PROOF STATE]
proof (state)
this:
d1 = mat_22 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define a where "a = mat_11 M"
[PROOF STATE]
proof (state)
this:
a = mat_11 M

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define b where "b = mat_12 M"
[PROOF STATE]
proof (state)
this:
b = mat_12 M

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define c where "c = mat_21 M"
[PROOF STATE]
proof (state)
this:
c = mat_21 M

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define d where "d = mat_22 M"
[PROOF STATE]
proof (state)
this:
d = mat_22 M

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define g where "g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))"
[PROOF STATE]
proof (state)
this:
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
define h where "h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))"
[PROOF STATE]
proof (state)
this:
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S2 g_def a1_def h_def c1_def
[PROOF STATE]
proof (chain)
picking this:
mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
a1 = mat_11 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
c1 = mat_21 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
[PROOF STEP]
have S3: "mat_21 (mat_pow (Suc(l)) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g*a1 + h*c1"
[PROOF STATE]
proof (prove)
using this:
mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
a1 = mat_11 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
c1 = mat_21 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g * a1 + h * c1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g * a1 + h * c1

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S2 g_def b1_def h_def d1_def
[PROOF STATE]
proof (chain)
picking this:
mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
b1 = mat_12 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
d1 = mat_22 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
[PROOF STEP]
have S4: "mat_22 (mat_pow (Suc(l)) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
    = g*b1+h*d1"
[PROOF STATE]
proof (prove)
using this:
mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)) = mat_mul (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
b1 = mat_12 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
d1 = mat_22 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))

goal (1 subgoal):
 1. mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g * b1 + h * d1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g * b1 + h * d1

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S5: "mat_11 (mat_scalar_mult e M) = e*a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_11 (mat_scalar_mult e M) = e * a
[PROOF STEP]
by (simp add: a_def)
[PROOF STATE]
proof (state)
this:
mat_11 (mat_scalar_mult e M) = e * a

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S6: "mat_12 (mat_scalar_mult e M) = e*b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_12 (mat_scalar_mult e M) = e * b
[PROOF STEP]
by (simp add: b_def)
[PROOF STATE]
proof (state)
this:
mat_12 (mat_scalar_mult e M) = e * b

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S7: "mat_21 (mat_scalar_mult e M) = e*c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_21 (mat_scalar_mult e M) = e * c
[PROOF STEP]
by (simp add: c_def)
[PROOF STATE]
proof (state)
this:
mat_21 (mat_scalar_mult e M) = e * c

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S8: "mat_22 (mat_scalar_mult e M) = e*d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_22 (mat_scalar_mult e M) = e * d
[PROOF STEP]
by (simp add: d_def)
[PROOF STATE]
proof (state)
this:
mat_22 (mat_scalar_mult e M) = e * d

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from a1_def S5
[PROOF STATE]
proof (chain)
picking this:
a1 = mat_11 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_11 (mat_scalar_mult e M) = e * a
[PROOF STEP]
have S9: "a1 = e*a-f"
[PROOF STATE]
proof (prove)
using this:
a1 = mat_11 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_11 (mat_scalar_mult e M) = e * a

goal (1 subgoal):
 1. a1 = e * a - f
[PROOF STEP]
by (simp add: Exp_Matrices.ID_def)
[PROOF STATE]
proof (state)
this:
a1 = e * a - f

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from b1_def S6
[PROOF STATE]
proof (chain)
picking this:
b1 = mat_12 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_12 (mat_scalar_mult e M) = e * b
[PROOF STEP]
have S10: "b1 = e*b"
[PROOF STATE]
proof (prove)
using this:
b1 = mat_12 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_12 (mat_scalar_mult e M) = e * b

goal (1 subgoal):
 1. b1 = e * b
[PROOF STEP]
by (simp add: Exp_Matrices.ID_def)
[PROOF STATE]
proof (state)
this:
b1 = e * b

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from c1_def S7
[PROOF STATE]
proof (chain)
picking this:
c1 = mat_21 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_21 (mat_scalar_mult e M) = e * c
[PROOF STEP]
have S11: "c1 = e*c"
[PROOF STATE]
proof (prove)
using this:
c1 = mat_21 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_21 (mat_scalar_mult e M) = e * c

goal (1 subgoal):
 1. c1 = e * c
[PROOF STEP]
by (simp add: Exp_Matrices.ID_def)
[PROOF STATE]
proof (state)
this:
c1 = e * c

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S11 assms(2) c_def
[PROOF STATE]
proof (chain)
picking this:
c1 = e * c
mat_21 M = 1
c = mat_21 M
[PROOF STEP]
have S115: "c1 = e"
[PROOF STATE]
proof (prove)
using this:
c1 = e * c
mat_21 M = 1
c = mat_21 M

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from d1_def S8
[PROOF STATE]
proof (chain)
picking this:
d1 = mat_22 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_22 (mat_scalar_mult e M) = e * d
[PROOF STEP]
have S12: "d1 = e*d - f"
[PROOF STATE]
proof (prove)
using this:
d1 = mat_22 (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))
mat_22 (mat_scalar_mult e M) = e * d

goal (1 subgoal):
 1. d1 = e * d - f
[PROOF STEP]
by (simp add: Exp_Matrices.ID_def)
[PROOF STATE]
proof (state)
this:
d1 = e * d - f

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S12 assms(1) d_def
[PROOF STATE]
proof (chain)
picking this:
d1 = e * d - f
mat_22 M = 0
d = mat_22 M
[PROOF STEP]
have S125: "d1 = - f"
[PROOF STATE]
proof (prove)
using this:
d1 = e * d - f
mat_22 M = 0
d = mat_22 M

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from assms(2) c_def Suc g_def c_def
[PROOF STATE]
proof (chain)
picking this:
mat_21 M = 1
c = mat_21 M
mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
c = mat_21 M
[PROOF STEP]
have S13: "g mod e^2 = (-1)^(l-1)*l*e*f^(l-1)*c mod e^2"
[PROOF STATE]
proof (prove)
using this:
mat_21 M = 1
c = mat_21 M
mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
g = mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
c = mat_21 M

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from assms(2) c_def S13
[PROOF STATE]
proof (chain)
picking this:
mat_21 M = 1
c = mat_21 M
g mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
have S135: "g mod e^2 = (-1)^(l-1)*l*e*f^(l-1) mod e^2"
[PROOF STATE]
proof (prove)
using this:
mat_21 M = 1
c = mat_21 M
g mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from Suc h_def
[PROOF STATE]
proof (chain)
picking this:
mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))
[PROOF STEP]
have S14: "h mod e^2 = (-1)^l *f^l mod e^2"
[PROOF STATE]
proof (prove)
using this:
mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
h = mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID)))

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S10 S135
[PROOF STATE]
proof (chain)
picking this:
b1 = e * b
g mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) mod e\<^sup>2
[PROOF STEP]
have S27: "g*b1 mod e^2 = (-1)^(l-1)*l*e*f^(l-1)*e*b mod e^2"
[PROOF STATE]
proof (prove)
using this:
b1 = e * b
g mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) mod e\<^sup>2

goal (1 subgoal):
 1. g * b1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * e * b mod e\<^sup>2
[PROOF STEP]
by (metis mod_mult_left_eq mult.assoc)
[PROOF STATE]
proof (state)
this:
g * b1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * e * b mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S27
[PROOF STATE]
proof (chain)
picking this:
g * b1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * e * b mod e\<^sup>2
[PROOF STEP]
have S28: "g*b1 mod e^2 = 0 mod e^2"
[PROOF STATE]
proof (prove)
using this:
g * b1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * e * b mod e\<^sup>2

goal (1 subgoal):
 1. g * b1 mod e\<^sup>2 = 0 mod e\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
g * b1 mod e\<^sup>2 = 0 mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S125 S14 mod_mult_cong
[PROOF STATE]
proof (chain)
picking this:
d1 = - f
h mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
\<lbrakk>?a mod ?c = ?a' mod ?c; ?b mod ?c = ?b' mod ?c\<rbrakk> \<Longrightarrow> ?a * ?b mod ?c = ?a' * ?b' mod ?c
[PROOF STEP]
have S29: "h*d1 mod e^2 = (-1)^l *f^l*(- f) mod e^2"
[PROOF STATE]
proof (prove)
using this:
d1 = - f
h mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
\<lbrakk>?a mod ?c = ?a' mod ?c; ?b mod ?c = ?b' mod ?c\<rbrakk> \<Longrightarrow> ?a * ?b mod ?c = ?a' * ?b' mod ?c

goal (1 subgoal):
 1. h * d1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * - f mod e\<^sup>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h * d1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * - f mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S29
[PROOF STATE]
proof (chain)
picking this:
h * d1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * - f mod e\<^sup>2
[PROOF STEP]
have S30: "h*d1 mod e^2 = (-1)^(l+1) *f^l*f mod e^2"
[PROOF STATE]
proof (prove)
using this:
h * d1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * - f mod e\<^sup>2

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S30
[PROOF STATE]
proof (chain)
picking this:
h * d1 mod e\<^sup>2 = (- 1) ^ (l + 1) * f ^ l * f mod e\<^sup>2
[PROOF STEP]
have S31: "h*d1 mod e^2 = (-1)^(l+1) *f^(l+1) mod e^2"
[PROOF STATE]
proof (prove)
using this:
h * d1 mod e\<^sup>2 = (- 1) ^ (l + 1) * f ^ l * f mod e\<^sup>2

goal (1 subgoal):
 1. h * d1 mod e\<^sup>2 = (- 1) ^ (l + 1) * f ^ (l + 1) mod e\<^sup>2
[PROOF STEP]
by (metis mult.assoc power_add power_one_right)
[PROOF STATE]
proof (state)
this:
h * d1 mod e\<^sup>2 = (- 1) ^ (l + 1) * f ^ (l + 1) mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S31
[PROOF STATE]
proof (chain)
picking this:
h * d1 mod e\<^sup>2 = (- 1) ^ (l + 1) * f ^ (l + 1) mod e\<^sup>2
[PROOF STEP]
have F2: "?Q (Suc(l))"
[PROOF STATE]
proof (prove)
using this:
h * d1 mod e\<^sup>2 = (- 1) ^ (l + 1) * f ^ (l + 1) mod e\<^sup>2

goal (1 subgoal):
 1. mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
by (metis S28 S4 Suc_eq_plus1 add.left_neutral mod_add_cong)
[PROOF STATE]
proof (state)
this:
mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S9 S13
[PROOF STATE]
proof (chain)
picking this:
a1 = e * a - f
g mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
have S15: "g*a1 mod e^2 = ((-1)^(l-1)*l*e*f^(l-1)*c*(e*a-f))mod e^2"
[PROOF STATE]
proof (prove)
using this:
a1 = e * a - f
g mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2

goal (1 subgoal):
 1. g * a1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) mod e\<^sup>2
[PROOF STEP]
by (metis mod_mult_left_eq)
[PROOF STATE]
proof (state)
this:
g * a1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S16: "((-1)^(l-1)*l*e*f^(l-1)*c*(e*a-f)) = ((-1)^(l-1)*l*e^2*f^(l-1)*c*a) - f*(-1)^(l-1)*l*e*f^(l-1)*c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) = (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) = (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S17: "((-1)^(l-1)*l*e^2*f^(l-1)*c*a) mod e^2 = 0 mod e^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S17
[PROOF STATE]
proof (chain)
picking this:
(- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2
[PROOF STEP]
have S18: "(((-1)^(l-1)*l*e^2*f^(l-1)*c*a) - f*(-1)^(l-1)*l*e*f^(l-1)*c) mod e^2 =
    - f*(-1)^(l-1)*l*e*f^(l-1)*c mod e^2"
[PROOF STATE]
proof (prove)
using this:
(- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2

goal (1 subgoal):
 1. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2 \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
have f1: "\<forall>i ia. (ia::int) - (0 - i) = ia + i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia. ia - (0 - i) = ia + i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i ia. ia - (0 - i) = ia + i

goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2 \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
have "\<forall>i ia. ((0::int) - ia) * i = 0 - ia * i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia. (0 - ia) * i = 0 - ia * i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i ia. (0 - ia) * i = 0 - ia * i

goal (1 subgoal):
 1. (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a mod e\<^sup>2 = 0 mod e\<^sup>2 \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i ia. (0 - ia) * i = 0 - ia * i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i ia. (0 - ia) * i = 0 - ia * i

goal (1 subgoal):
 1. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
\<forall>i ia. (0 - ia) * i = 0 - ia * i
\<forall>i ia. ia - (0 - i) = ia + i

goal (1 subgoal):
 1. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i ia. (0 - ia) * i = 0 - ia * i; \<forall>i ia. ia - (0 - i) = ia + i\<rbrakk> \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
have f1: "\<And>i. (0::int) - i = - i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. 0 - i = - i
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
0 - ?i = - ?i

goal (1 subgoal):
 1. \<lbrakk>\<forall>i ia. (0 - ia) * i = 0 - ia * i; \<forall>i ia. ia - (0 - i) = ia + i\<rbrakk> \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 - ?i = - ?i
[PROOF STEP]
have "\<And>i. (i - - ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a)) mod e\<^sup>2 = i mod e\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
0 - ?i = - ?i

goal (1 subgoal):
 1. \<And>i. (i - - ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a)) mod e\<^sup>2 = i mod e\<^sup>2
[PROOF STEP]
by (metis (no_types) S17 \<open>\<forall>i ia. ia - (0 - i) = ia + i\<close> add.right_neutral mod_add_right_eq)
[PROOF STATE]
proof (state)
this:
(?i - - ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a)) mod e\<^sup>2 = ?i mod e\<^sup>2

goal (1 subgoal):
 1. \<lbrakk>\<forall>i ia. (0 - ia) * i = 0 - ia * i; \<forall>i ia. ia - (0 - i) = ia + i\<rbrakk> \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?i - - ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a)) mod e\<^sup>2 = ?i mod e\<^sup>2
[PROOF STEP]
have "\<And>i. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - i) mod e\<^sup>2 = - i mod e\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(?i - - ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a)) mod e\<^sup>2 = ?i mod e\<^sup>2

goal (1 subgoal):
 1. \<And>i. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - i) mod e\<^sup>2 = - i mod e\<^sup>2
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
(?i - - ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a)) mod e\<^sup>2 = ?i mod e\<^sup>2
0 - ?i = - ?i

goal (1 subgoal):
 1. \<And>i. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - i) mod e\<^sup>2 = - i mod e\<^sup>2
[PROOF STEP]
by (metis \<open>\<forall>i ia. ia - (0 - i) = ia + i\<close> uminus_add_conv_diff)
[PROOF STATE]
proof (state)
this:
((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - ?i) mod e\<^sup>2 = - ?i mod e\<^sup>2

goal (1 subgoal):
 1. \<lbrakk>\<forall>i ia. (0 - ia) * i = 0 - ia * i; \<forall>i ia. ia - (0 - i) = ia + i\<rbrakk> \<Longrightarrow> ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - ?i) mod e\<^sup>2 = - ?i mod e\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - ?i) mod e\<^sup>2 = - ?i mod e\<^sup>2

goal (1 subgoal):
 1. ((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
using f1 \<open>\<forall>i ia. (0 - ia) * i = 0 - ia * i\<close>
[PROOF STATE]
proof (prove)
using this:
((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - ?i) mod e\<^sup>2 = - ?i mod e\<^sup>2
0 - ?i = - ?i
\<forall>i ia. (0 - ia) * i = 0 - ia * i

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

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

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S15 S16 S18
[PROOF STATE]
proof (chain)
picking this:
g * a1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) mod e\<^sup>2
(- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) = (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c
((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
have S19: "g*a1 mod e^2 = - f*(-1)^(l-1)*l*e*f^(l-1)*c mod e^2"
[PROOF STATE]
proof (prove)
using this:
g * a1 mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) mod e\<^sup>2
(- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c * (e * a - f) = (- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c
((- 1) ^ (l - 1) * int l * e\<^sup>2 * f ^ (l - 1) * c * a - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c) mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2

goal (1 subgoal):
 1. g * a1 mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
g * a1 mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S11 S14
[PROOF STATE]
proof (chain)
picking this:
c1 = e * c
h mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2
[PROOF STEP]
have S20: "h*c1 mod e^2 = (-1)^l *f^l*e*c mod e^2"
[PROOF STATE]
proof (prove)
using this:
c1 = e * c
h mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2

goal (1 subgoal):
 1. h * c1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * e * c mod e\<^sup>2
[PROOF STEP]
by (metis mod_mult_left_eq mult.assoc)
[PROOF STATE]
proof (state)
this:
h * c1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * e * c mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S19 S20
[PROOF STATE]
proof (chain)
picking this:
g * a1 mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
h * c1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * e * c mod e\<^sup>2
[PROOF STEP]
have S21: "(g*a1 + h*c1) mod e^2 = (- f*(-1)^(l-1)*l*e*f^(l-1)*c + (-1)^l *f^l*e*c) mod e^2"
[PROOF STATE]
proof (prove)
using this:
g * a1 mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
h * c1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * e * c mod e\<^sup>2

goal (1 subgoal):
 1. (g * a1 + h * c1) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2
[PROOF STEP]
using mod_add_cong
[PROOF STATE]
proof (prove)
using this:
g * a1 mod e\<^sup>2 = - f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c mod e\<^sup>2
h * c1 mod e\<^sup>2 = (- 1) ^ l * f ^ l * e * c mod e\<^sup>2
\<lbrakk>?a mod ?c = ?a' mod ?c; ?b mod ?c = ?b' mod ?c\<rbrakk> \<Longrightarrow> (?a + ?b) mod ?c = (?a' + ?b') mod ?c

goal (1 subgoal):
 1. (g * a1 + h * c1) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(g * a1 + h * c1) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from assms(2) c_def
[PROOF STATE]
proof (chain)
picking this:
mat_21 M = 1
c = mat_21 M
[PROOF STEP]
have S22: "(- f*(-1)^(l-1)*l*e*f^(l-1)*c + (-1)^l *f^l*e*c) mod e^2=(- f*(-1)^(l-1)*l*e*f^(l-1) + (-1)^l *f^l*e) mod e^2"
[PROOF STATE]
proof (prove)
using this:
mat_21 M = 1
c = mat_21 M

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S23: "(- f*(-1)^(l-1)*l*e*f^(l-1) + (-1)^l *f^l*e) mod e^2 = (f*(-1)^(l)*l*e*f^(l-1) + (-1)^l *f^l*e) mod e^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
[PROOF STEP]
by (smt One_nat_def Suc_pred mult.commute mult_cancel_left2 mult_minus_left neq0_conv of_nat_eq_0_iff power.simps(2))
[PROOF STATE]
proof (state)
this:
(- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S24: "(f*(-1)^(l)*l*e*f^(l-1) + (-1)^l *f^l*e) mod e^2 = ((-1)^(l)*l*e*f^l + (-1)^l *f^l*e) mod e^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
[PROOF STEP]
by (smt One_nat_def Suc_pred mult.assoc mult.commute mult_eq_0_iff neq0_conv of_nat_eq_0_iff power.simps(2))
[PROOF STATE]
proof (state)
this:
(f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
have S25: "((-1)^(l)*l*e*f^l + (-1)^l *f^l*e) mod e^2 = ((-1)^(l)*(l+1)*e*f^l) mod e^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
have f1: "\<forall>i ia. (ia::int) * i = i * ia"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia. ia * i = i * ia
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i ia. ia * i = i * ia

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i ia. ia * i = i * ia
[PROOF STEP]
have f2: "\<forall>i ia. (ia::int) * i - - i = i * (ia - - 1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i ia. ia * i = i * ia

goal (1 subgoal):
 1. \<forall>i ia. ia * i - - i = i * (ia - - 1)
[PROOF STEP]
by (metis (no_types) mult.right_neutral mult_minus_left right_diff_distrib')
[PROOF STATE]
proof (state)
this:
\<forall>i ia. ia * i - - i = i * (ia - - 1)

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

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. int n - - 1 = int (n + 1)
[PROOF STEP]
have "e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. int n - - 1 = int (n + 1)

goal (1 subgoal):
 1. e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2
[PROOF STEP]
using f2
[PROOF STATE]
proof (prove)
using this:
\<forall>n. int n - - 1 = int (n + 1)
\<forall>i ia. ia * i - - i = i * (ia - - 1)

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

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2
[PROOF STEP]
have "((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2
\<forall>i ia. ia * i = i * ia

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2; \<forall>i ia. ia * i = i * ia\<rbrakk> \<Longrightarrow> ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
have f1: "\<And>i ia ib. (i::int) * (ia * ib) = ia * (i * ib)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia ib. i * (ia * ib) = ia * (i * ib)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i * (?ia * ?ib) = ?ia * (?i * ?ib)

goal (1 subgoal):
 1. \<lbrakk>e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2; \<forall>i ia. ia * i = i * ia\<rbrakk> \<Longrightarrow> ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i * (?ia * ?ib) = ?ia * (?i * ?ib)
[PROOF STEP]
have "\<And>i ia ib. (i::int) * (ia * ib) - - (i * ib) = (ia - - 1) * (i * ib)"
[PROOF STATE]
proof (prove)
using this:
?i * (?ia * ?ib) = ?ia * (?i * ?ib)

goal (1 subgoal):
 1. \<And>i ia ib. i * (ia * ib) - - (i * ib) = (ia - - 1) * (i * ib)
[PROOF STEP]
by (metis (no_types) \<open>\<forall>i ia. ia * i = i * ia\<close> f2)
[PROOF STATE]
proof (state)
this:
?i * (?ia * ?ib) - - (?i * ?ib) = (?ia - - 1) * (?i * ?ib)

goal (1 subgoal):
 1. \<lbrakk>e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2; \<forall>i ia. ia * i = i * ia\<rbrakk> \<Longrightarrow> ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i * (?ia * ?ib) - - (?i * ?ib) = (?ia - - 1) * (?i * ?ib)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i * (?ia * ?ib) - - (?i * ?ib) = (?ia - - 1) * (?i * ?ib)

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
?i * (?ia * ?ib) - - (?i * ?ib) = (?ia - - 1) * (?i * ?ib)
?i * (?ia * ?ib) = ?ia * (?i * ?ib)

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
by (metis (no_types) \<open>\<forall>i ia. ia * i = i * ia\<close> \<open>e * (f ^ l * (int l * (- 1) ^ l - - ((- 1) ^ l))) mod e\<^sup>2 = e * (f ^ l * ((- 1) ^ l * int (l + 1))) mod e\<^sup>2\<close> f2 mult_minus_right)
[PROOF STATE]
proof (state)
this:
((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2

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

goal (1 subgoal):
 1. ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((- 1) ^ l * int l * e * f ^ l - - ((- 1) ^ l) * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2

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

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

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S21 S22 S23 S24 S25
[PROOF STATE]
proof (chain)
picking this:
(g * a1 + h * c1) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2
(- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
(- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
(f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
have S26: "(g*a1 + h*c1) mod e^2 = ((-1)^(l)*(l+1)*e*f^l) mod e^2"
[PROOF STATE]
proof (prove)
using this:
(g * a1 + h * c1) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2
(- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * c + (- 1) ^ l * f ^ l * e * c) mod e\<^sup>2 = (- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
(- f * (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
(f * (- 1) ^ l * int l * e * f ^ (l - 1) + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = ((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2
((- 1) ^ l * int l * e * f ^ l + (- 1) ^ l * f ^ l * e) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2

goal (1 subgoal):
 1. (g * a1 + h * c1) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(g * a1 + h * c1) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from S3 S26
[PROOF STATE]
proof (chain)
picking this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g * a1 + h * c1
(g * a1 + h * c1) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2
[PROOF STEP]
have F1: "?P (Suc(l))"
[PROOF STATE]
proof (prove)
using this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) = g * a1 + h * c1
(g * a1 + h * c1) mod e\<^sup>2 = (- 1) ^ l * int (l + 1) * e * f ^ l mod e\<^sup>2

goal (1 subgoal):
 1. mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2
[PROOF STEP]
by (metis Suc_eq_plus1 assms(2) diff_Suc_1 mult.right_neutral)
[PROOF STATE]
proof (state)
this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2

goal (1 subgoal):
 1. \<And>l. mat_21 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (l - 1) * int l * e * f ^ (l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow l (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ l * f ^ l mod e\<^sup>2 \<Longrightarrow> mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
from F1 F2
[PROOF STATE]
proof (chain)
picking this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2
mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2
mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2

goal (1 subgoal):
 1. mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_21 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ (Suc l - 1) * int (Suc l) * e * f ^ (Suc l - 1) * mat_21 M mod e\<^sup>2 \<and> mat_22 (mat_pow (Suc l) (mat_minus (mat_scalar_mult e M) (mat_scalar_mult f ID))) mod e\<^sup>2 = (- 1) ^ Suc l * f ^ Suc l mod e\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_permute_set:
  shows "x \<in> p \<bullet> S \<longleftrightarrow> (- p \<bullet> x) \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> p \<bullet> S) = (- p \<bullet> x \<in> S)
[PROOF STEP]
by (metis mem_permute_iff permute_minus_cancel(2))


[STATEMENT]
lemma Fun_inv:
    assumes "iso f"
    shows "Fun (inv f) = restrict (inv_into (Dom f) (Fun f)) (Cod f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fun (local.inv f) = restrict (inv_into (Dom f) (Fun f)) (Cod f)
[PROOF STEP]
using assms inv_in_hom inv_char iso_inv_iso iso_is_arr Fun_mkArr
[PROOF STATE]
proof (prove)
using this:
local.iso f
\<lbrakk>local.iso ?f; \<guillemotleft>?f : ?a \<rightarrow> ?b\<guillemotright>\<rbrakk> \<Longrightarrow> \<guillemotleft>local.inv ?f : ?b \<rightarrow> ?a\<guillemotright>
local.iso ?f \<Longrightarrow> local.inv ?f = mkArr (Cod ?f) (Dom ?f) (inv_into (Dom ?f) (Fun ?f))
local.iso ?f \<Longrightarrow> local.iso (local.inv ?f)
local.iso ?f \<Longrightarrow> arr ?f
arr (mkArr ?A ?B ?F) \<Longrightarrow> Fun (mkArr ?A ?B ?F) = restrict ?F ?A

goal (1 subgoal):
 1. Fun (local.inv f) = restrict (inv_into (Dom f) (Fun f)) (Cod f)
[PROOF STEP]
by metis


[STATEMENT]
lemma ordinal_plus_left_cancel_le [simp]:
"(w + x \<le> w + y) = (x \<le> (y::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w + x \<le> w + y) = (x \<le> y)
[PROOF STEP]
by (rule normal.cancel_le[OF normal_plus])


[STATEMENT]
lemma subspace_kernel: "m1.subspace {x. f x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1.subspace {x. f x = (0::'c)}
[PROOF STEP]
using subspace_vimage[OF m2.subspace_single_0]
[PROOF STATE]
proof (prove)
using this:
m1.subspace (f -` {0::'c})

goal (1 subgoal):
 1. m1.subspace {x. f x = (0::'c)}
[PROOF STEP]
by (simp add: vimage_def)


[STATEMENT]
lemma mono_increasing_o:
     "mono g ==> increasing f \<subseteq> increasing (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono g \<Longrightarrow> increasing f \<subseteq> increasing (g \<circ> f)
[PROOF STEP]
apply (unfold increasing_def stable_def constrains_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa act xb xc. \<lbrakk>mono g; \<forall>xa. \<forall>act\<in>Acts x. act `` {s. xa \<le> f s} \<subseteq> {s. xa \<le> f s}; act \<in> Acts x; (xc, xb) \<in> act; xa \<le> g (f xc)\<rbrakk> \<Longrightarrow> xa \<le> g (f xb)
[PROOF STEP]
apply (blast intro: monoD order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma HInter_hinsert [simp]: "A\<noteq>0 \<Longrightarrow> \<Sqinter>(A \<triangleleft> a) = a \<sqinter> \<Sqinter>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> 0 \<Longrightarrow> \<Sqinter>(A \<triangleleft> a) = a \<sqinter> \<Sqinter>A
[PROOF STEP]
by (auto simp: hf_ext HInter_iff [OF hinsert_nonempty])


[STATEMENT]
lemma (in Group) lcsTr7:"\<lbrakk>G \<guillemotright> H; a \<in> carrier G; b \<in> carrier G; (\<rho> a) \<cdot> b \<in> H\<rbrakk>
                        \<Longrightarrow> a \<diamondsuit> H \<subseteq>  b \<diamondsuit> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; \<rho> a \<cdot> b \<in> H\<rbrakk> \<Longrightarrow> a \<diamondsuit> H \<subseteq> b \<diamondsuit> H
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; \<rho> a \<cdot> b \<in> H; x \<in> a \<diamondsuit> H\<rbrakk> \<Longrightarrow> x \<in> b \<diamondsuit> H
[PROOF STEP]
apply (simp add:lcsTr6 [of "H" "a" "b" _])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_complex_eq_numeral_power_int_cancel_iff [simp]:
  "(of_complex y :: 'a :: {complex_div_algebra, division_ring}) = power_int (numeral x) n \<longleftrightarrow>
     y = power_int (numeral x) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_complex y = numeral x powi n) = (y = numeral x powi n)
[PROOF STEP]
by (subst (1 2) eq_commute) simp


[STATEMENT]
lemma lcmof_leastUpper:
  fixes G (structure)
  assumes carr[simp]: "a \<in> carrier G"  "b \<in> carrier G"
  shows "(x \<in> carrier G \<and> x lcmof a b) = least (division_rel G) x (Upper (division_rel G) {a, b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> carrier G \<and> x lcmof a b) = is_lub (division_rel G) x {a, b}
[PROOF STEP]
by (auto simp: islcm_def least_def Upper_def elem_def)


[STATEMENT]
lemma star_plus_without_loops:
  "x\<^sup>\<star> \<sqinter> -1 = x\<^sup>+ \<sqinter> -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> \<sqinter> - (1::'a) = x\<^sup>+ \<sqinter> - (1::'a)
[PROOF STEP]
by (metis maddux_3_13 star_left_unfold_equal)


[STATEMENT]
lemma enn2ereal_e2ennreal: "x \<ge> 0 \<Longrightarrow> enn2ereal (e2ennreal x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> enn2ereal (e2ennreal x) = x
[PROOF STEP]
by (metis e2ennreal_enn2ereal ereal_ennreal_cases not_le)


[STATEMENT]
lemma hyp_eq_divide_eq [divide_simps]:
  fixes a b c :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "a = b / c \<longleftrightarrow> (if Base c \<noteq> 0 then a * c = b else a = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a = b / c) = (if Base c \<noteq> (0::'a) then a * c = b else a = 0)
[PROOF STEP]
by (metis hyp_divide_eq_eq)


[STATEMENT]
lemma LENGTH_contr:
  "Suc 0 < LENGTH('e) \<Longrightarrow> 2 ^ LENGTH('e::len) \<le> Suc (Suc 0) \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < LENGTH('e); 2 ^ LENGTH('e) \<le> Suc (Suc 0)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis le_antisym len_gt_0 n_less_equal_power_2 not_less_eq numeral_2_eq_2 one_le_numeral
      self_le_power)


[STATEMENT]
lemma INFM_neq [simp]:
  "(INFM x::'a. x \<noteq> a) \<longleftrightarrow> infinite (UNIV::'a set)"
  "(INFM x::'a. a \<noteq> x) \<longleftrightarrow> infinite (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>x. x \<noteq> a) = infinite UNIV &&& (\<exists>\<^sub>\<infinity>x. a \<noteq> x) = infinite UNIV
[PROOF STEP]
unfolding frequently_cofinite
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {x. x \<noteq> a} = infinite UNIV &&& infinite {x. a \<noteq> x} = infinite UNIV
[PROOF STEP]
by simp_all


[STATEMENT]
lemma dg_prod_2_is_arrI'[dg_prod_cs_intros]:
  assumes "gf = [g, f]\<^sub>\<circ>"
    and "ab = [a, b]\<^sub>\<circ>"
    and "cd = [c, d]\<^sub>\<circ>"
    and "g : a \<mapsto>\<^bsub>\<AA>\<^esub> c"
    and "f : b \<mapsto>\<^bsub>\<BB>\<^esub> d"
  shows "gf : ab \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G \<BB>\<^esub> cd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gf : ab \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G \<BB>\<^esub> cd
[PROOF STEP]
using assms(4,5)
[PROOF STATE]
proof (prove)
using this:
g : a \<mapsto>\<^bsub>\<AA>\<^esub> c
f : b \<mapsto>\<^bsub>\<BB>\<^esub> d

goal (1 subgoal):
 1. gf : ab \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G \<BB>\<^esub> cd
[PROOF STEP]
unfolding assms(1,2,3)
[PROOF STATE]
proof (prove)
using this:
g : a \<mapsto>\<^bsub>\<AA>\<^esub> c
f : b \<mapsto>\<^bsub>\<BB>\<^esub> d

goal (1 subgoal):
 1. [g, f]\<^sub>\<circ> : [a, b]\<^sub>\<circ> \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G \<BB>\<^esub> [c, d]\<^sub>\<circ>
[PROOF STEP]
by (rule dg_prod_2_is_arrI)


[STATEMENT]
lemma mod_lemma: "[| (0::nat) < c; r < b |] ==> b * (q mod c) + r < b * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < c; r < b\<rbrakk> \<Longrightarrow> b * (q mod c) + r < b * c
[PROOF STEP]
apply (cut_tac m = q and n = c in mod_less_divisor)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < c; r < b\<rbrakk> \<Longrightarrow> 0 < c
 2. \<lbrakk>0 < c; r < b; q mod c < c\<rbrakk> \<Longrightarrow> b * (q mod c) + r < b * c
[PROOF STEP]
apply (drule_tac [2] m = "q mod c" in less_imp_Suc_add, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>r < b; c = Suc (q mod c + k)\<rbrakk> \<Longrightarrow> b * (q mod c) + r < b * c
[PROOF STEP]
apply (erule_tac P = "%x. lhs < rhs x" for lhs rhs in ssubst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. r < b \<Longrightarrow> b * (q mod c) + r < b * Suc (q mod c + k)
[PROOF STEP]
apply (simp add: add_mult_distrib2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fref_PRE_D2:
    assumes "(f,h) \<in> fref (comp_PRE S1 Q P X) R S"
    shows "(f,h) \<in> fref (\<lambda>x. Q x \<and> (\<forall>y. (y,x)\<in>S1 \<longrightarrow> X x \<longrightarrow> P x y)) R S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f, h) \<in> [\<lambda>x. Q x \<and> (\<forall>y. (y, x) \<in> S1 \<longrightarrow> X x \<longrightarrow> P x y)]\<^sub>f R \<rightarrow> S
[PROOF STEP]
by (rule fref_weaken_pre[OF PRE_D2 assms])


[STATEMENT]
lemma  mat_hom_inj: "map_mat hom A = map_mat hom B \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_mat hom A = map_mat hom B \<Longrightarrow> A = B
[PROOF STEP]
unfolding mat_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (map_mat hom A) = dim_row (map_mat hom B) \<and> dim_col (map_mat hom A) = dim_col (map_mat hom B) \<and> (\<forall>i j. i < dim_row (map_mat hom B) \<longrightarrow> j < dim_col (map_mat hom B) \<longrightarrow> map_mat hom A $$ (i, j) = map_mat hom B $$ (i, j)) \<Longrightarrow> dim_row A = dim_row B \<and> dim_col A = dim_col B \<and> (\<forall>i j. i < dim_row B \<longrightarrow> j < dim_col B \<longrightarrow> A $$ (i, j) = B $$ (i, j))
[PROOF STEP]
by auto


[STATEMENT]
lemma powrat_less_1_cancel_iff [simp]:
  assumes x0: "0 < x" and x1: "x < 1"
  shows "(x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s) = (s < r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s) = (s < r)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s \<Longrightarrow> s < r
 2. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
assume xrs: "x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s"
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s

goal (2 subgoals):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s \<Longrightarrow> s < r
 2. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
have invx: "1 < 1/x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < 1 / x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
x < 1

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

goal (2 subgoals):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s \<Longrightarrow> s < r
 2. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
have  "r < s \<or> r \<ge> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r < s \<or> s \<le> r
[PROOF STEP]
using leI
[PROOF STATE]
proof (prove)
using this:
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x

goal (1 subgoal):
 1. r < s \<or> s \<le> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
r < s \<or> s \<le> r

goal (2 subgoals):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s \<Longrightarrow> s < r
 2. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r < s \<or> s \<le> r
[PROOF STEP]
show "s < r"
[PROOF STATE]
proof (prove)
using this:
r < s \<or> s \<le> r

goal (1 subgoal):
 1. s < r
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r < s \<Longrightarrow> s < r
 2. s \<le> r \<Longrightarrow> s < r
[PROOF STEP]
assume "r < s"
[PROOF STATE]
proof (state)
this:
r < s

goal (2 subgoals):
 1. r < s \<Longrightarrow> s < r
 2. s \<le> r \<Longrightarrow> s < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r < s
[PROOF STEP]
have " inverse x pow\<^sub>\<rat> r < inverse x pow\<^sub>\<rat> s"
[PROOF STATE]
proof (prove)
using this:
r < s

goal (1 subgoal):
 1. inverse x pow\<^sub>\<rat> r < inverse x pow\<^sub>\<rat> s
[PROOF STEP]
using invx
[PROOF STATE]
proof (prove)
using this:
r < s
1 < 1 / x

goal (1 subgoal):
 1. inverse x pow\<^sub>\<rat> r < inverse x pow\<^sub>\<rat> s
[PROOF STEP]
by (simp add: inverse_eq_divide)
[PROOF STATE]
proof (state)
this:
inverse x pow\<^sub>\<rat> r < inverse x pow\<^sub>\<rat> s

goal (2 subgoals):
 1. r < s \<Longrightarrow> s < r
 2. s \<le> r \<Longrightarrow> s < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse x pow\<^sub>\<rat> r < inverse x pow\<^sub>\<rat> s
[PROOF STEP]
have " x pow\<^sub>\<rat> s < x pow\<^sub>\<rat> r"
[PROOF STATE]
proof (prove)
using this:
inverse x pow\<^sub>\<rat> r < inverse x pow\<^sub>\<rat> s

goal (1 subgoal):
 1. x pow\<^sub>\<rat> s < x pow\<^sub>\<rat> r
[PROOF STEP]
by (simp add: powrat_gt_zero powrat_inverse x0)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> s < x pow\<^sub>\<rat> r

goal (2 subgoals):
 1. r < s \<Longrightarrow> s < r
 2. s \<le> r \<Longrightarrow> s < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x pow\<^sub>\<rat> s < x pow\<^sub>\<rat> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x pow\<^sub>\<rat> s < x pow\<^sub>\<rat> r

goal (1 subgoal):
 1. s < r
[PROOF STEP]
using xrs
[PROOF STATE]
proof (prove)
using this:
x pow\<^sub>\<rat> s < x pow\<^sub>\<rat> r
x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s

goal (1 subgoal):
 1. s < r
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
s < r

goal (1 subgoal):
 1. s \<le> r \<Longrightarrow> s < r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s \<le> r \<Longrightarrow> s < r
[PROOF STEP]
assume "r \<ge> s"
[PROOF STATE]
proof (state)
this:
s \<le> r

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

goal (1 subgoal):
 1. s < r
[PROOF STEP]
using less_eq_rat_def xrs
[PROOF STATE]
proof (prove)
using this:
s \<le> r
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
s < r

goal (1 subgoal):
 1. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
assume sr: "s < r"
[PROOF STATE]
proof (state)
this:
s < r

goal (1 subgoal):
 1. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
have invx: "1 < 1/x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < 1 / x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
x < 1

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

goal (1 subgoal):
 1. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < 1 / x
[PROOF STEP]
have " inverse x pow\<^sub>\<rat> s < inverse x pow\<^sub>\<rat> r"
[PROOF STATE]
proof (prove)
using this:
1 < 1 / x

goal (1 subgoal):
 1. inverse x pow\<^sub>\<rat> s < inverse x pow\<^sub>\<rat> r
[PROOF STEP]
using invx sr
[PROOF STATE]
proof (prove)
using this:
1 < 1 / x
1 < 1 / x
s < r

goal (1 subgoal):
 1. inverse x pow\<^sub>\<rat> s < inverse x pow\<^sub>\<rat> r
[PROOF STEP]
by (simp add: inverse_eq_divide)
[PROOF STATE]
proof (state)
this:
inverse x pow\<^sub>\<rat> s < inverse x pow\<^sub>\<rat> r

goal (1 subgoal):
 1. s < r \<Longrightarrow> x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse x pow\<^sub>\<rat> s < inverse x pow\<^sub>\<rat> r
[PROOF STEP]
show "x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s"
[PROOF STATE]
proof (prove)
using this:
inverse x pow\<^sub>\<rat> s < inverse x pow\<^sub>\<rat> r

goal (1 subgoal):
 1. x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s
[PROOF STEP]
by (simp add: powrat_gt_zero powrat_inverse x0)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> r < x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed