[STATEMENT]
lemma computation2:
" rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A))
     (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A)
       (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) =
    rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have 1:"(B - rat_poly_times (rat_poly_times A A) A)
               = B - (A^3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B - rat_poly_times (rat_poly_times A A) A = B - A ^ 3
[PROOF STEP]
by (metis power3_eq_cube)
[PROOF STATE]
proof (state)
this:
B - rat_poly_times (rat_poly_times A A) A = B - A ^ 3

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B - rat_poly_times (rat_poly_times A A) A = B - A ^ 3
[PROOF STEP]
have 2:"(rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)
                 = B*A - (A^3)*A"
[PROOF STATE]
proof (prove)
using this:
B - rat_poly_times (rat_poly_times A A) A = B - A ^ 3

goal (1 subgoal):
 1. rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A = rat_poly_times B A - rat_poly_times (A ^ 3) A
[PROOF STEP]
by (metis minus_right_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A = rat_poly_times B A - rat_poly_times (A ^ 3) A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A = rat_poly_times B A - rat_poly_times (A ^ 3) A
[PROOF STEP]
have "... = 1 - (A^4)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A = rat_poly_times B A - rat_poly_times (A ^ 3) A

goal (1 subgoal):
 1. rat_poly_times B A - rat_poly_times (A ^ 3) A = 1 - A ^ 4
[PROOF STEP]
using inverse2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A = rat_poly_times B A - rat_poly_times (A ^ 3) A
rat_poly_times B A = 1

goal (1 subgoal):
 1. rat_poly_times B A - rat_poly_times (A ^ 3) A = 1 - A ^ 4
[PROOF STEP]
by (metis mult.commute one_plus_numeral power_add power_one_right semiring_norm(2)
              semiring_norm(4))
[PROOF STATE]
proof (state)
this:
rat_poly_times B A - rat_poly_times (A ^ 3) A = 1 - A ^ 4

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B A - rat_poly_times (A ^ 3) A = 1 - A ^ 4
[PROOF STEP]
have "(rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A))
                      = A - (A^4)*A"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B A - rat_poly_times (A ^ 3) A = 1 - A ^ 4

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - rat_poly_times (A ^ 4) A
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B A - rat_poly_times (A ^ 3) A = 1 - A ^ 4
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A = rat_poly_times B A - rat_poly_times (A ^ 3) A

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - rat_poly_times (A ^ 4) A
[PROOF STEP]
by (simp add: minus_left_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - rat_poly_times (A ^ 4) A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - rat_poly_times (A ^ 4) A
[PROOF STEP]
have 3:"(rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A))
                  = A - (A^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - rat_poly_times (A ^ 4) A

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - A ^ 5
[PROOF STEP]
by (simp add: numeral_Bit0 numeral_Bit1)
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - A ^ 5

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "(rat_poly_times (B - rat_poly_times (rat_poly_times A A) A)
       (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)))
                 =  (B - (A^3))*(B*( B - (A^3)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
B - rat_poly_times (rat_poly_times A A) A = B - A ^ 3

goal (1 subgoal):
 1. rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))
[PROOF STEP]
have "... =  (B - (A^3))*(B*B - (B*(A^3)))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))
[PROOF STEP]
by (metis minus_left_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))
[PROOF STEP]
have "... = (B - (A^3))*(B*B - (A^2))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)
[PROOF STEP]
using inverse2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))
rat_poly_times B A = 1

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)
[PROOF STEP]
by (simp add: power2_eq_square power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)
[PROOF STEP]
have "... = B*(B*B - (A^2)) - (A^3)*(B*B - (A^2))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)
[PROOF STEP]
by (metis minus_right_distributivity)
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)
[PROOF STEP]
have "... = ((B^3) - A) - A + (A^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "B*(B*B - (A^2)) = (B*B*B - B*(A^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * (B * B - A\<^sup>2) = B * B * B - B * A\<^sup>2
[PROOF STEP]
by (simp add: right_diff_distrib)
[PROOF STATE]
proof (state)
this:
B * (B * B - A\<^sup>2) = B * B * B - B * A\<^sup>2

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B * (B * B - A\<^sup>2) = B * B * B - B * A\<^sup>2

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "... = (B*B*B - B*(A*A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * B * B - B * A\<^sup>2 = B * B * B - B * (A * A)
[PROOF STEP]
by (metis power2_eq_square)
[PROOF STATE]
proof (state)
this:
B * B * B - B * A\<^sup>2 = B * B * B - B * (A * A)

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B * B * B - B * A\<^sup>2 = B * B * B - B * (A * A)

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "...  = ((B^3) - ((B::rat_poly)*A)*A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A
[PROOF STEP]
by (simp add: power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "... = ((B^3) - ((1::rat_poly)*A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - rat_poly_times 1 A
[PROOF STEP]
by (metis inverse2)
[PROOF STATE]
proof (state)
this:
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - rat_poly_times 1 A

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - rat_poly_times 1 A

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "... = (B^3) - A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B ^ 3 - rat_poly_times 1 A = B ^ 3 - A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B ^ 3 - rat_poly_times 1 A = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B * (B * B - A\<^sup>2) = B * B * B - B * A\<^sup>2
B * B * B - B * A\<^sup>2 = B * B * B - B * (A * A)
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - rat_poly_times 1 A
B ^ 3 - rat_poly_times 1 A = B ^ 3 - A
[PROOF STEP]
have s1:"(B::rat_poly)*(B*B - (A^2)) = (B^3) - (A::rat_poly)"
[PROOF STATE]
proof (prove)
using this:
B * (B * B - A\<^sup>2) = B * B * B - B * A\<^sup>2
B * B * B - B * A\<^sup>2 = B * B * B - B * (A * A)
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - rat_poly_times 1 A
B ^ 3 - rat_poly_times 1 A = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have s2:"((A::rat_poly)^3)*(B*B - (A^2)) = (A^3)*(B*B) - (A^(3::nat))*(A^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)
[PROOF STEP]
by (metis minus_left_distributivity power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)
[PROOF STEP]
have "... = (((A::rat_poly)^3)*(B*B) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
using power_add
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)
?a ^ (?m + ?n) = ?a ^ ?m * ?a ^ ?n

goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2); \<And>a m n. a ^ (m + n) = a ^ m * a ^ n\<rbrakk> \<Longrightarrow> rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
have "(A^(3::nat))*(A^2) = A^5"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^ 3 * A\<^sup>2 = A ^ 5
[PROOF STEP]
by (metis One_nat_def Suc_1 numeral_3_eq_3 power_Suc power_numeral_odd)
[PROOF STATE]
proof (state)
this:
A ^ 3 * A\<^sup>2 = A ^ 5

goal (1 subgoal):
 1. \<lbrakk>rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2); \<And>a m n. a ^ (m + n) = a ^ m * a ^ n\<rbrakk> \<Longrightarrow> rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A ^ 3 * A\<^sup>2 = A ^ 5
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A ^ 3 * A\<^sup>2 = A ^ 5

goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
using s2
[PROOF STATE]
proof (prove)
using this:
A ^ 3 * A\<^sup>2 = A ^ 5
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)

goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
have "... =  ((((A::rat_poly)*A*A)*(B*B)) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
by (metis power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5
[PROOF STEP]
have "... = ((((A::rat_poly)*(A*(A*B)*B))) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5
[PROOF STEP]
have "... = ((((A::rat_poly)*(A*(1)*B))) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5
[PROOF STEP]
using inverse1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5
rat_poly_times A B = 1

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5
[PROOF STEP]
have "... =  ((((A::rat_poly)*(A*B))) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5
[PROOF STEP]
have "... = ((((A::rat_poly))) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A B) - A ^ 5 = A - A ^ 5
[PROOF STEP]
using inverse1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5
rat_poly_times A B = 1

goal (1 subgoal):
 1. rat_poly_times A (rat_poly_times A B) - A ^ 5 = A - A ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times A (rat_poly_times A B) - A ^ 5 = A - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5
rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5
rat_poly_times A (rat_poly_times A B) - A ^ 5 = A - A ^ 5
[PROOF STEP]
have "((A::rat_poly)^3)*(B*B - (A^2)) = ((A::rat_poly) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2)
rat_poly_times (A ^ 3) (rat_poly_times B B) - rat_poly_times (A ^ 3) (A\<^sup>2) = rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5
rat_poly_times (A ^ 3) (rat_poly_times B B) - A ^ 5 = rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5
rat_poly_times (rat_poly_times (rat_poly_times A A) A) (rat_poly_times B B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5
rat_poly_times A (rat_poly_times (rat_poly_times A (rat_poly_times A B)) B) - A ^ 5 = rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5
rat_poly_times A (rat_poly_times (rat_poly_times A 1) B) - A ^ 5 = rat_poly_times A (rat_poly_times A B) - A ^ 5
rat_poly_times A (rat_poly_times A B) - A ^ 5 = A - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = A - A ^ 5
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = A - A ^ 5

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = A - A ^ 5
[PROOF STEP]
have "B*(B*B - (A^2)) - (A^3)*(B*B - (A^2))
                       = (B^3) - (A::rat_poly) - ((A::rat_poly) - (A^5))"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = A - A ^ 5

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A - (A - A ^ 5)
[PROOF STEP]
using s1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = A - A ^ 5
rat_poly_times B (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A - (A - A ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A - (A - A ^ 5)

goal (1 subgoal):
 1. rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) \<Longrightarrow> rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A - (A - A ^ 5)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = B ^ 3 - A - (A - A ^ 5)

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))
rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)
rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "(rat_poly_times (B - rat_poly_times (rat_poly_times A A) A)
       (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)))
             = ((B^3) - A) - A + (A^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3))
rat_poly_times (B - A ^ 3) (rat_poly_times B (B - A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3))
rat_poly_times (B - A ^ 3) (rat_poly_times B B - rat_poly_times B (A ^ 3)) = rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2)
rat_poly_times (B - A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2)
rat_poly_times B (rat_poly_times B B - A\<^sup>2) - rat_poly_times (A ^ 3) (rat_poly_times B B - A\<^sup>2) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)

goal (1 subgoal):
 1. rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
[PROOF STEP]
have "?l =  A - (A^5) +  ((B^3) - A) - A + (A^5)"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_plus (rat_poly_plus (A - A ^ 5) (B ^ 3 - A) - A) (A ^ 5)
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A)) = rat_poly_plus (B ^ 3 - A - A) (A ^ 5)
rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A) = A - A ^ 5

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_plus (rat_poly_plus (A - A ^ 5) (B ^ 3 - A) - A) (A ^ 5)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_plus (rat_poly_plus (A - A ^ 5) (B ^ 3 - A) - A) (A ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_plus (rat_poly_plus (A - A ^ 5) (B ^ 3 - A) - A) (A ^ 5)
[PROOF STEP]
have 4:"?l = (B^3) - A"
[PROOF STATE]
proof (prove)
using this:
rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_plus (rat_poly_plus (A - A ^ 5) (B ^ 3 - A) - A) (A ^ 5)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = B ^ 3 - A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "?r =  B*((B - rat_poly_times (rat_poly_times A A) A)*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B*(B - (A^3))*B"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times (rat_poly_times B (B - A ^ 3)) B
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
B - rat_poly_times (rat_poly_times A A) A = B - A ^ 3

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times (rat_poly_times B (B - A ^ 3)) B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times (rat_poly_times B (B - A ^ 3)) B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times (rat_poly_times B (B - A ^ 3)) B

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B*(B*B - (A^3)*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times B (B - A ^ 3)) B = rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B)
[PROOF STEP]
using minus_left_distributivity
[PROOF STATE]
proof (prove)
using this:
rat_poly_times ?p (?q - ?r) = rat_poly_times ?p ?q - rat_poly_times ?p ?r

goal (1 subgoal):
 1. rat_poly_times (rat_poly_times B (B - A ^ 3)) B = rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B)
[PROOF STEP]
by (simp add: minus_left_distributivity mult.commute)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B (B - A ^ 3)) B = rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B (B - A ^ 3)) B = rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B*(B*B - (A*A*A)*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
by (metis power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B*(B*B - (A*A*(A*B)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B))

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B*(B*B - A*A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B)) = rat_poly_times B (rat_poly_times B B - rat_poly_times A A)
[PROOF STEP]
using  inverse1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A B = 1

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

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B)) = rat_poly_times B (rat_poly_times B B - rat_poly_times A A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B*B*B - B*(A*A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times B B - rat_poly_times A A) = rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A)
[PROOF STEP]
by (metis minus_left_distributivity rat_poly.comm)
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times A A) = rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times B B - rat_poly_times A A) = rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A)

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B^3 - (B*A)*A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A
[PROOF STEP]
by (metis ab_semigroup_mult_class.mult_ac(1) power3_eq_cube)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
have "... = B^3 - A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - A
[PROOF STEP]
using inverse2
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B A = 1

goal (1 subgoal):
 1. B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - A
[PROOF STEP]
by (metis monoid_mult_class.mult.left_neutral)
[PROOF STATE]
proof (state)
this:
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times (rat_poly_times B (B - A ^ 3)) B
rat_poly_times (rat_poly_times B (B - A ^ 3)) B = rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B)
rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B)
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B))
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B)) = rat_poly_times B (rat_poly_times B B - rat_poly_times A A)
rat_poly_times B (rat_poly_times B B - rat_poly_times A A) = rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A)
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - A
[PROOF STEP]
have "?r =  B^3 - A"
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times (rat_poly_times B (B - A ^ 3)) B
rat_poly_times (rat_poly_times B (B - A ^ 3)) B = rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B)
rat_poly_times B (rat_poly_times B B - rat_poly_times (A ^ 3) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B)
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times (rat_poly_times A A) A) B) = rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B))
rat_poly_times B (rat_poly_times B B - rat_poly_times (rat_poly_times A A) (rat_poly_times A B)) = rat_poly_times B (rat_poly_times B B - rat_poly_times A A)
rat_poly_times B (rat_poly_times B B - rat_poly_times A A) = rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A)
rat_poly_times (rat_poly_times B B) B - rat_poly_times B (rat_poly_times A A) = B ^ 3 - rat_poly_times (rat_poly_times B A) A
B ^ 3 - rat_poly_times (rat_poly_times B A) A = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = B ^ 3 - A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = B ^ 3 - A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = B ^ 3 - A

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B)
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
rat_poly_times B (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) B) = B ^ 3 - A
rat_poly_plus (rat_poly_times A (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) A)) (rat_poly_times (B - rat_poly_times (rat_poly_times A A) A) (rat_poly_times B (B - rat_poly_times (rat_poly_times A A) A))) = B ^ 3 - A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldl_assoc:
  fixes b :: "('a \<Rightarrow> 'a) \<Rightarrow> ('a \<Rightarrow> 'a) \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "\<cdot>" 55)
  assumes "\<And>f g h. f \<cdot> (g \<cdot> h) = f \<cdot> g \<cdot> h"
  shows "foldl (\<cdot>) (x \<cdot> y) zs = x \<cdot> foldl (\<cdot>) y zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<cdot>) (x \<cdot> y) zs = x \<cdot> foldl (\<cdot>) y zs
[PROOF STEP]
using assms[symmetric]
[PROOF STATE]
proof (prove)
using this:
?f \<cdot> ?g \<cdot> ?h = ?f \<cdot> (?g \<cdot> ?h)

goal (1 subgoal):
 1. foldl (\<cdot>) (x \<cdot> y) zs = x \<cdot> foldl (\<cdot>) y zs
[PROOF STEP]
by (induct zs arbitrary: y) simp_all


[STATEMENT]
lemma integral_combine_division_bottomup:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  assumes "\<D> division_of S" "\<And>k. k \<in> \<D> \<Longrightarrow> f integrable_on k"
  shows "integral S f = sum (\<lambda>i. integral i f) \<D>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S f = (\<Sum>i\<in>\<D>. integral i f)
[PROOF STEP]
by (meson assms integral_unique has_integral_combine_division has_integral_integrable_integral)


[STATEMENT]
lemma up_set_idem [simp]: "\<Up> \<circ> \<Up> = \<Up>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Up> \<circ> \<Up> = \<Up>
[PROOF STEP]
by (simp add: dual_upset_set)


[STATEMENT]
lemma qtm_conc[simp]: "queue_to_multiset (q@q')
  = queue_to_multiset q + queue_to_multiset q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_to_multiset (q @ q') = queue_to_multiset q + queue_to_multiset q'
[PROOF STEP]
by (induct q) (auto simp add: union_ac)


[STATEMENT]
lemma Im_complex_div_lt_0: "Im (a / b) < 0 \<longleftrightarrow> Im (a * cnj b) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im (a / b) < 0) = (Im (a * cnj b) < 0)
[PROOF STEP]
by (metis Im_complex_div_eq_0 Im_complex_div_gt_0 less_asym neq_iff)


[STATEMENT]
lemma distinct_mset_set_mset_ident[simp]: "distinct_mset M \<Longrightarrow> mset_set (set_mset M) = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset M \<Longrightarrow> mset_set (set_mset M) = M
[PROOF STEP]
by (induction M) auto


[STATEMENT]
lemma nonneg_has_sum_complete:
  fixes f :: \<open>'a \<Rightarrow> 'b :: {complete_linorder, ordered_comm_monoid_add, linorder_topology}\<close>
  assumes \<open>\<And>x. x\<in>A \<Longrightarrow> f x \<ge> 0\<close>
  shows \<open>has_sum f A (SUP F\<in>{F. finite F \<and> F\<subseteq>A}. sum f F)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum f A (Sup (sum f ` {F. finite F \<and> F \<subseteq> A}))
[PROOF STEP]
using assms nonneg_bdd_above_has_sum
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> (0::'b) \<le> f ?x
\<lbrakk>\<And>x. x \<in> ?A \<Longrightarrow> (0::?'b) \<le> ?f x; bdd_above (sum ?f ` {F. F \<subseteq> ?A \<and> finite F})\<rbrakk> \<Longrightarrow> has_sum ?f ?A (Sup (sum ?f ` {F. finite F \<and> F \<subseteq> ?A}))

goal (1 subgoal):
 1. has_sum f A (Sup (sum f ` {F. finite F \<and> F \<subseteq> A}))
[PROOF STEP]
by blast


[STATEMENT]
lemma dim_eq_card_independent: "independent B \<Longrightarrow> dim B = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent B \<Longrightarrow> dim B = card B
[PROOF STEP]
by (rule dim_eq_card[OF refl])


[STATEMENT]
theorem inorder_update:
  "sorted1(inorder t) \<Longrightarrow> inorder(update x y t) = upd_list x y (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted1 (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (update x y t) = upd_list x y (Tree2.inorder t)
[PROOF STEP]
by (induct t) (auto simp: upd_list_simps inorder_split inorder_skew)


[STATEMENT]
lemma A_det: "b>2 \<Longrightarrow> mat_det (A b n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 < b \<Longrightarrow> mat_det (A b n) = 1
[PROOF STEP]
apply (auto simp: A_pow, induction n, simp add: mat_det.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>2 < b \<Longrightarrow> mat_det (mat_pow n (B b)) = 1; 2 < b\<rbrakk> \<Longrightarrow> mat_det (mat_pow (Suc n) (B b)) = 1
[PROOF STEP]
using det_mult
[PROOF STATE]
proof (prove)
using this:
mat_det (mat_mul ?M1.0 ?M2.0) = mat_det ?M1.0 * mat_det ?M2.0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>2 < b \<Longrightarrow> mat_det (mat_pow n (B b)) = 1; 2 < b\<rbrakk> \<Longrightarrow> mat_det (mat_pow (Suc n) (B b)) = 1
[PROOF STEP]
apply (auto simp del: mat_mul.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>mat_det (mat_pow n (B b)) = 1; 2 < b; \<And>M1 M2. mat_det (mat_mul M1 M2) = mat_det M1 * mat_det M2\<rbrakk> \<Longrightarrow> mat_det (B b) = 1
[PROOF STEP]
by (simp add: B.simps mat_det.simps)


[STATEMENT]
lemma is_K33_outerD:
  assumes "is_K33_outer_inv G (ig_verts_cnt G) blue"
  assumes "i < ig_verts_cnt G" "j < ig_verts_cnt G"
  shows "(blue (ig_verts G ! i) = blue (ig_verts G ! j)) \<longleftrightarrow> (ig_verts G ! i, ig_verts G ! j) \<notin> set (ig_arcs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (blue (ig_verts G ! i) = blue (ig_verts G ! j)) = ((ig_verts G ! i, ig_verts G ! j) \<notin> set (ig_arcs G))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_K33_outer_inv G (ig_verts_cnt G) blue
i < ig_verts_cnt G
j < ig_verts_cnt G

goal (1 subgoal):
 1. (blue (ig_verts G ! i) = blue (ig_verts G ! j)) = ((ig_verts G ! i, ig_verts G ! j) \<notin> set (ig_arcs G))
[PROOF STEP]
unfolding is_K33_outer_last
[PROOF STATE]
proof (prove)
using this:
\<forall>u\<in>set (ig_verts G). \<forall>v\<in>set (ig_verts G). (blue u = blue v) = ((u, v) \<notin> set (ig_arcs G))
i < ig_verts_cnt G
j < ig_verts_cnt G

goal (1 subgoal):
 1. (blue (ig_verts G ! i) = blue (ig_verts G ! j)) = ((ig_verts G ! i, ig_verts G ! j) \<notin> set (ig_arcs G))
[PROOF STEP]
by auto


[STATEMENT]
lemma prod_list_minus_1_exp: "prod_list (map (\<lambda> i. (-1)^(f i)) xs)
  = (-1)^(sum_list (map f xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<leftarrow>xs. (- (1::'a)) ^ f i) = (- (1::'a)) ^ sum_list (map f xs)
[PROOF STEP]
by (induct xs, auto simp: power_add)


[STATEMENT]
lemma out_arcs_app_iso_eq:
  assumes "digraph_isomorphism hom" and "u \<in> verts G"
  shows "out_arcs (app_iso hom G) (iso_verts hom u) = iso_arcs hom ` out_arcs G u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_arcs (app_iso hom G) (iso_verts hom u) = iso_arcs hom ` out_arcs G u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
u \<in> verts G

goal (1 subgoal):
 1. out_arcs (app_iso hom G) (iso_verts hom u) = iso_arcs hom ` out_arcs G u
[PROOF STEP]
unfolding out_arcs_def
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
u \<in> verts G

goal (1 subgoal):
 1. {e \<in> arcs (app_iso hom G). tail (app_iso hom G) e = iso_verts hom u} = iso_arcs hom ` {e \<in> arcs G. tail G e = u}
[PROOF STEP]
by (auto simp: iso_verts_tail)


[STATEMENT]
lemma Ball_atLeast0AtMost_insert:
  assumes "(\<forall>x\<in>{0..m}. psi x \<le> 3 / 2 * ln 2 * real x)"
  assumes "psi (numeral n) \<le> 3 / 2 * ln 2 * real (numeral n)" "m = pred_numeral n"
  shows   "(\<forall>x\<in>{0..numeral n}. psi x \<le> 3 / 2 * ln 2 * real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0..numeral n}. psi x \<le> 3 / 2 * ln 2 * real x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..m}. psi x \<le> 3 / 2 * ln 2 * real x
psi (numeral n) \<le> 3 / 2 * ln 2 * real (numeral n)
m = pred_numeral n

goal (1 subgoal):
 1. \<forall>x\<in>{0..numeral n}. psi x \<le> 3 / 2 * ln 2 * real x
[PROOF STEP]
by (subst numeral_eq_Suc[of n], subst atLeast0_atMost_Suc,
      subst ball_simps, simp only: numeral_eq_Suc [symmetric])


[STATEMENT]
lemma evens_Compl_infinite:
  shows "infinite (- evens)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (- evens)
[PROOF STEP]
proof(rule iffD2[OF infinite_iff_countable_subset], rule exI, rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj ?f3
 2. range ?f3 \<subseteq> - evens
[PROOF STEP]
let ?f = "\<lambda>n::nat. cofinite (2*n+1)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj ?f3
 2. range ?f3 \<subseteq> - evens
[PROOF STEP]
show "inj ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>n. cofinite.cofinite (2 * n + 1))
[PROOF STEP]
by (auto intro: inj_onI)
[PROOF STATE]
proof (state)
this:
inj (\<lambda>n. cofinite.cofinite (2 * n + 1))

goal (1 subgoal):
 1. range (\<lambda>n. cofinite.cofinite (2 * n + 1)) \<subseteq> - evens
[PROOF STEP]
show "range ?f \<subseteq> -evens"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (\<lambda>n. cofinite.cofinite (2 * n + 1)) \<subseteq> - evens
[PROOF STEP]
by clarsimp presburger
[PROOF STATE]
proof (state)
this:
range (\<lambda>n. cofinite.cofinite (2 * n + 1)) \<subseteq> - evens

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_ortho_set_singleton[simp]: \<open>is_ortho_set {x} \<longleftrightarrow> x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_ortho_set {x} = (x \<noteq> (0::'a))
[PROOF STEP]
by (simp add: is_ortho_set_def)


[STATEMENT]
lemma det_row_minus: "det (upd_row M i (a - b)) = det (upd_row M i a) - det (upd_row M i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_row M i (a - b)) = Square_Matrix.det (upd_row M i a) - Square_Matrix.det (upd_row M i b)
[PROOF STEP]
unfolding diff_conv_add_uminus det_row_add det_row_uminus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_row M i a) + - Square_Matrix.det (upd_row M i b) = Square_Matrix.det (upd_row M i a) + - Square_Matrix.det (upd_row M i b)
[PROOF STEP]
..


[STATEMENT]
lemma output_size_shallow_model': "output_size (shallow_model' Z M N) = Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. output_size (shallow_model' Z M N) = Z
[PROOF STEP]
apply (induction N)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. output_size (shallow_model' Z M 0) = Z
 2. \<And>N. output_size (shallow_model' Z M N) = Z \<Longrightarrow> output_size (shallow_model' Z M (Suc N)) = Z
[PROOF STEP]
unfolding shallow_model'.simps
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. output_size (Conv (Z, M) (Input M)) = Z
 2. \<And>N. output_size (shallow_model' Z M N) = Z \<Longrightarrow> output_size (Pool (Conv (Z, M) (Input M)) (shallow_model' Z M N)) = Z
[PROOF STEP]
using output_size.simps
[PROOF STATE]
proof (prove)
using this:
output_size (Input ?M) = ?M
output_size (Conv (?r0.0, ?r1.0) ?m) = ?r0.0
output_size (Pool ?m1.0 ?m2.0) = output_size ?m1.0

goal (2 subgoals):
 1. output_size (Conv (Z, M) (Input M)) = Z
 2. \<And>N. output_size (shallow_model' Z M N) = Z \<Longrightarrow> output_size (Pool (Conv (Z, M) (Input M)) (shallow_model' Z M N)) = Z
[PROOF STEP]
by simp_all


[STATEMENT]
lemma "M x x y = x \<and> M x y x = x \<and> M y x x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M x x y = x \<and> M x y x = x \<and> M y x x = x
[PROOF STEP]
apply (simp add: M_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) = x \<and> ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x = x \<and> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) = x
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) = x
 2. ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x = x
 3. ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) = x
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<le> x
 2. x \<le> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y)
 3. ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x = x
 4. ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) = x
[PROOF STEP]
apply (simp_all add: lemma_2_10_24 lemma_2_5_9_b)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x = x
 2. ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) = x
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<le> x
 2. x \<le> ((y l\<rightarrow> x) r\<rightarrow> x) \<sqinter> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x
 3. ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) = x
[PROOF STEP]
apply (simp_all add: lemma_2_10_24 lemma_2_5_9_b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) = x
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x) \<le> x
 2. x \<le> ((x l\<rightarrow> y) r\<rightarrow> y) \<sqinter> x \<sqinter> ((y l\<rightarrow> x) r\<rightarrow> x)
[PROOF STEP]
by (simp_all add: lemma_2_10_24 lemma_2_5_9_b)


[STATEMENT]
lemma  dot_cross_det: "x \<bullet> (y \<times> z) = det(vector[x,y,z])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> y \<times> z = det (vector [x, y, z])
[PROOF STEP]
by (simp add: cross3_simps)


[STATEMENT]
lemma HMA_mat_minus[transfer_rule]: "(HMA_M ===> HMA_M ===> HMA_M)
  (\<lambda> A B. A + map_mat uminus B) ((-) :: 'a :: group_add ^'nc:: mod_type^'nr:: mod_type
  \<Rightarrow> 'a^'nc:: mod_type^'nr:: mod_type \<Rightarrow> 'a^'nc:: mod_type^'nr:: mod_type)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Mod_Type_Connect.HMA_M ===> Mod_Type_Connect.HMA_M ===> Mod_Type_Connect.HMA_M) (\<lambda>A B. A + map_mat uminus B) (-)
[PROOF STEP]
unfolding rel_fun_def HMA_M_def from_hma\<^sub>m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x = Matrix.mat CARD('nr) CARD('nc) (\<lambda>(i, j). y $h mod_type_class.from_nat i $h mod_type_class.from_nat j) \<longrightarrow> (\<forall>xa ya. xa = Matrix.mat CARD('nr) CARD('nc) (\<lambda>(i, j). ya $h mod_type_class.from_nat i $h mod_type_class.from_nat j) \<longrightarrow> x + map_mat uminus xa = Matrix.mat CARD('nr) CARD('nc) (\<lambda>(i, j). (y - ya) $h mod_type_class.from_nat i $h mod_type_class.from_nat j))
[PROOF STEP]
by auto


[STATEMENT]
lemma numeral_4_eq_4:"4 = Suc (Suc (Suc (Suc 0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 = Suc (Suc (Suc (Suc 0)))
[PROOF STEP]
by simp


[STATEMENT]
lemma uminus_nonpos_Reals_iff [simp]: "-x \<in> \<real>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> x \<in> \<real>\<^sub>\<ge>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<in> \<real>\<^sub>\<le>\<^sub>0) = (x \<in> \<real>\<^sub>\<ge>\<^sub>0)
[PROOF STEP]
by (metis (no_types) minus_minus uminus_nonneg_Reals_iff)


[STATEMENT]
lemma fps_hypergeo_nth[simp]: "fps_hypergeo as bs c $ n =
  (foldl (\<lambda>r a. r* pochhammer a n) 1 as * c^n) /
    (foldl (\<lambda>r b. r * pochhammer b n) 1 bs * of_nat (fact n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_hypergeo as bs c $ n = foldl (\<lambda>r a. r * pochhammer a n) (1::'a) as * c ^ n / (foldl (\<lambda>r b. r * pochhammer b n) (1::'a) bs * of_nat (fact n))
[PROOF STEP]
by (simp add: fps_hypergeo_def)


[STATEMENT]
lemma lhss_union_distrib:
  shows "lhss (A \<union> B) = lhss A \<union> lhss B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lhss (A \<union> B) = lhss A \<union> lhss B
[PROOF STEP]
by (auto simp add: lhss_def)


[STATEMENT]
lemma span_image: "m2.span (f ` S) = f ` (m1.span S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m2.span (f ` S) = f ` m1.span S
[PROOF STEP]
proof (rule m2.span_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f ` S \<subseteq> f ` m1.span S
 2. m2.subspace (f ` m1.span S)
 3. \<And>T'. \<lbrakk>f ` S \<subseteq> T'; m2.subspace T'\<rbrakk> \<Longrightarrow> f ` m1.span S \<subseteq> T'
[PROOF STEP]
show "f ` S \<subseteq> f ` m1.span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` S \<subseteq> f ` m1.span S
[PROOF STEP]
by (rule image_mono, rule m1.span_superset)
[PROOF STATE]
proof (state)
this:
f ` S \<subseteq> f ` m1.span S

goal (2 subgoals):
 1. m2.subspace (f ` m1.span S)
 2. \<And>T'. \<lbrakk>f ` S \<subseteq> T'; m2.subspace T'\<rbrakk> \<Longrightarrow> f ` m1.span S \<subseteq> T'
[PROOF STEP]
show "m2.subspace (f ` m1.span S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m2.subspace (f ` m1.span S)
[PROOF STEP]
using m1.subspace_span
[PROOF STATE]
proof (prove)
using this:
m1.subspace (m1.span ?S)

goal (1 subgoal):
 1. m2.subspace (f ` m1.span S)
[PROOF STEP]
by (rule subspace_image)
[PROOF STATE]
proof (state)
this:
m2.subspace (f ` m1.span S)

goal (1 subgoal):
 1. \<And>T'. \<lbrakk>f ` S \<subseteq> T'; m2.subspace T'\<rbrakk> \<Longrightarrow> f ` m1.span S \<subseteq> T'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T'. \<lbrakk>f ` S \<subseteq> T'; m2.subspace T'\<rbrakk> \<Longrightarrow> f ` m1.span S \<subseteq> T'
[PROOF STEP]
fix T
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T'. \<lbrakk>f ` S \<subseteq> T'; m2.subspace T'\<rbrakk> \<Longrightarrow> f ` m1.span S \<subseteq> T'
[PROOF STEP]
assume "f ` S \<subseteq> T" and "m2.subspace T"
[PROOF STATE]
proof (state)
this:
f ` S \<subseteq> T
m2.subspace T

goal (1 subgoal):
 1. \<And>T'. \<lbrakk>f ` S \<subseteq> T'; m2.subspace T'\<rbrakk> \<Longrightarrow> f ` m1.span S \<subseteq> T'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` S \<subseteq> T
m2.subspace T
[PROOF STEP]
show "f ` m1.span S \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
f ` S \<subseteq> T
m2.subspace T

goal (1 subgoal):
 1. f ` m1.span S \<subseteq> T
[PROOF STEP]
unfolding image_subset_iff_subset_vimage
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> f -` T
m2.subspace T

goal (1 subgoal):
 1. m1.span S \<subseteq> f -` T
[PROOF STEP]
by (metis subspace_vimage m1.span_minimal)
[PROOF STATE]
proof (state)
this:
f ` m1.span S \<subseteq> T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zl_le_rl: "l<n \<Longrightarrow> z l \<le> r l" for l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l < n \<Longrightarrow> z l \<le> r l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l < n \<Longrightarrow> z l \<le> r l
[PROOF STEP]
assume l: "l < n"
[PROOF STATE]
proof (state)
this:
l < n

goal (1 subgoal):
 1. l < n \<Longrightarrow> z l \<le> r l
[PROOF STEP]
have "Zeq l t \<le> Req l t" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Zeq l t \<le> Req l t
[PROOF STEP]
using Z l
[PROOF STATE]
proof (prove)
using this:
?l < n \<Longrightarrow> Zeq ?l ?t = (if 0 < Req ?l ?t then Suc 0 else 0)
l < n

goal (1 subgoal):
 1. Zeq l t \<le> Req l t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Zeq l ?t \<le> Req l ?t

goal (1 subgoal):
 1. l < n \<Longrightarrow> z l \<le> r l
[PROOF STEP]
hence "nth_digit (z l) t b \<le> nth_digit (r l) t b" for t
[PROOF STATE]
proof (prove)
using this:
Zeq l ?t \<le> Req l ?t

goal (1 subgoal):
 1. nth_digit (z l) t b \<le> nth_digit (r l) t b
[PROOF STEP]
using Zeq_def Req_def
[PROOF STATE]
proof (prove)
using this:
Zeq l ?t \<le> Req l ?t
Zeq = (\<lambda>l t. nth_digit (z l) t b)
Req = (\<lambda>l t. nth_digit (r l) t b)

goal (1 subgoal):
 1. nth_digit (z l) t b \<le> nth_digit (r l) t b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nth_digit (z l) ?t b \<le> nth_digit (r l) ?t b

goal (1 subgoal):
 1. l < n \<Longrightarrow> z l \<le> r l
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nth_digit (z l) ?t b \<le> nth_digit (r l) ?t b

goal (1 subgoal):
 1. z l \<le> r l
[PROOF STEP]
using digitwise_leq b_gt1
[PROOF STATE]
proof (prove)
using this:
nth_digit (z l) ?t b \<le> nth_digit (r l) ?t b
\<lbrakk>1 < ?b; \<forall>t. nth_digit ?x t ?b \<le> nth_digit ?y t ?b\<rbrakk> \<Longrightarrow> ?x \<le> ?y
1 < b

goal (1 subgoal):
 1. z l \<le> r l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z l \<le> r l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma factorize_rat_poly_basic: assumes res: "factorize_rat_poly_basic p = (c,qs)"
  shows "p = smult c (prod_list qs)"
  "\<And> q. q \<in> set qs \<Longrightarrow> irreducible\<^sub>d q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = smult c (prod_list qs) &&& (\<And>q. q \<in> set qs \<Longrightarrow> irreducible\<^sub>d q)
[PROOF STEP]
using factorize_rat_poly_main[OF res[unfolded factorize_rat_poly_basic_def]]
[PROOF STATE]
proof (prove)
using this:
Ball (set []) irreducible\<^sub>d \<Longrightarrow> Ball (set qs) irreducible\<^sub>d
Ball (set []) irreducible\<^sub>d \<Longrightarrow> smult 1 (prod_list ([] @ [p])) = smult c (prod_list qs)

goal (1 subgoal):
 1. p = smult c (prod_list qs) &&& (\<And>q. q \<in> set qs \<Longrightarrow> irreducible\<^sub>d q)
[PROOF STEP]
by auto


[STATEMENT]
lemma bij_add: "bij (\<lambda>x. x + y :: 'a :: group_add)" (is ?g1)
  and bij_minus: "bij (\<lambda>x. x - y :: 'a)" (is ?g2)
  and inv_add[simp]: "Hilbert_Choice.inv (\<lambda>x. x + y) = (\<lambda>x. x - y)" (is ?g3)
  and inv_minus[simp]: "Hilbert_Choice.inv (\<lambda>x. x - y) = (\<lambda>x. x + y)" (is ?g4)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bij (\<lambda>x. x + y) &&& bij (\<lambda>x. x - y)) &&& inv (\<lambda>x. x + y) = (\<lambda>x. x - y) &&& inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. bij (\<lambda>x. x + y)
 2. bij (\<lambda>x. x - y)
 3. inv (\<lambda>x. x + y) = (\<lambda>x. x - y)
 4. inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
have 1: "(\<lambda>x. x - y) \<circ> (\<lambda>x. x + y) = id" and 2: "(\<lambda>x. x + y) \<circ> (\<lambda>x. x - y) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x - y) \<circ> (\<lambda>x. x + y) = id &&& (\<lambda>x. x + y) \<circ> (\<lambda>x. x - y) = id
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x - y) \<circ> (\<lambda>x. x + y) = id
(\<lambda>x. x + y) \<circ> (\<lambda>x. x - y) = id

goal (4 subgoals):
 1. bij (\<lambda>x. x + y)
 2. bij (\<lambda>x. x - y)
 3. inv (\<lambda>x. x + y) = (\<lambda>x. x - y)
 4. inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
from o_bij[OF 1 2]
[PROOF STATE]
proof (chain)
picking this:
bij (\<lambda>x. x + y)
[PROOF STEP]
show ?g1
[PROOF STATE]
proof (prove)
using this:
bij (\<lambda>x. x + y)

goal (1 subgoal):
 1. bij (\<lambda>x. x + y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bij (\<lambda>x. x + y)

goal (3 subgoals):
 1. bij (\<lambda>x. x - y)
 2. inv (\<lambda>x. x + y) = (\<lambda>x. x - y)
 3. inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
from o_bij[OF 2 1]
[PROOF STATE]
proof (chain)
picking this:
bij (\<lambda>x. x - y)
[PROOF STEP]
show ?g2
[PROOF STATE]
proof (prove)
using this:
bij (\<lambda>x. x - y)

goal (1 subgoal):
 1. bij (\<lambda>x. x - y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bij (\<lambda>x. x - y)

goal (2 subgoals):
 1. inv (\<lambda>x. x + y) = (\<lambda>x. x - y)
 2. inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
from inv_unique_comp[OF 2 1]
[PROOF STATE]
proof (chain)
picking this:
inv (\<lambda>x. x + y) = (\<lambda>x. x - y)
[PROOF STEP]
show ?g3
[PROOF STATE]
proof (prove)
using this:
inv (\<lambda>x. x + y) = (\<lambda>x. x - y)

goal (1 subgoal):
 1. inv (\<lambda>x. x + y) = (\<lambda>x. x - y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inv (\<lambda>x. x + y) = (\<lambda>x. x - y)

goal (1 subgoal):
 1. inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
from inv_unique_comp[OF 1 2]
[PROOF STATE]
proof (chain)
picking this:
inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
show ?g4
[PROOF STATE]
proof (prove)
using this:
inv (\<lambda>x. x - y) = (\<lambda>x. x + y)

goal (1 subgoal):
 1. inv (\<lambda>x. x - y) = (\<lambda>x. x + y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inv (\<lambda>x. x - y) = (\<lambda>x. x + y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surj_image: "surj f \<Longrightarrow> surj (image f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj f \<Longrightarrow> surj ((`) f)
[PROOF STEP]
using Pow_UNIV image_Pow_surj
[PROOF STATE]
proof (prove)
using this:
Pow UNIV = UNIV
?f ` ?A = ?B \<Longrightarrow> (`) ?f ` Pow ?A = Pow ?B

goal (1 subgoal):
 1. surj f \<Longrightarrow> surj ((`) f)
[PROOF STEP]
by metis


[STATEMENT]
lemma continuous_on_cos_real: "continuous_on {a..b} cos" for a::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} cos
[PROOF STEP]
using continuous_at_imp_continuous_on isCont_cos
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>?s. isCont ?f x \<Longrightarrow> continuous_on ?s ?f
isCont cos ?x

goal (1 subgoal):
 1. continuous_on {a..b} cos
[PROOF STEP]
by blast


[STATEMENT]
theorem vec_length: assumes "vec m x" and "vec n y"
shows "vec (m*n) (vec_vec_Tensor x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (m * n) (vec_vec_Tensor x y)
[PROOF STEP]
apply(simp add:vec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (vec_vec_Tensor x y) = m * n
[PROOF STEP]
apply(simp add:vec_vec_Tensor_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length x * length y = m * n
[PROOF STEP]
apply (metis assms(1) assms(2) vec_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bound_intersect_2d:
  assumes "bound_intersect_2d prec Xs x = Some (m, M)"
  shows "(\<Union>(p1, p2) \<in> set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<subseteq> {(x, m) .. (x, M)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<subseteq> {(x, m)..(x, M)}
[PROOF STEP]
proof (clarsimp, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
fix b x0 y0 x1 y1
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
assume H: "((x0, y0), x1, y1) \<in> set Xs" "(x, b) \<in> closed_segment (x0, y0) (x1, y1)"
[PROOF STATE]
proof (state)
this:
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)

goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
hence "intersect_segment_xline prec ((x0, y0), x1, y1) x \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)

goal (1 subgoal):
 1. intersect_segment_xline prec ((x0, y0), x1, y1) x \<noteq> None
[PROOF STEP]
by (intro notI)
      (auto dest!: intersect_segment_xline_eq_None simp del: intersect_segment_xline.simps)
[PROOF STATE]
proof (state)
this:
intersect_segment_xline prec ((x0, y0), x1, y1) x \<noteq> None

goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
intersect_segment_xline prec ((x0, y0), x1, y1) x \<noteq> None
[PROOF STEP]
obtain e f where ef: "intersect_segment_xline prec ((x0, y0), x1, y1) x = Some (e, f)"
[PROOF STATE]
proof (prove)
using this:
intersect_segment_xline prec ((x0, y0), x1, y1) x \<noteq> None

goal (1 subgoal):
 1. (\<And>e f. intersect_segment_xline prec ((x0, y0), x1, y1) x = Some (e, f) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
intersect_segment_xline prec ((x0, y0), x1, y1) x = Some (e, f)

goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
with H
[PROOF STATE]
proof (chain)
picking this:
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)
intersect_segment_xline prec ((x0, y0), x1, y1) x = Some (e, f)
[PROOF STEP]
have "m \<le> e"
[PROOF STATE]
proof (prove)
using this:
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)
intersect_segment_xline prec ((x0, y0), x1, y1) x = Some (e, f)

goal (1 subgoal):
 1. m \<le> e
[PROOF STEP]
by (auto intro: bound_intersect_2d_lower[OF assms])
[PROOF STATE]
proof (state)
this:
m \<le> e

goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m \<le> e

goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
have "\<dots> \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<le> b
[PROOF STEP]
using intersect_segment_xline[OF ef] H
[PROOF STATE]
proof (prove)
using this:
closed_segment (x0, y0) (x1, y1) \<inter> {p. fst p = x} \<subseteq> {(x, e)..(x, f)}
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)

goal (1 subgoal):
 1. e \<le> b
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
e \<le> b

goal (2 subgoals):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> m \<le> b
 2. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
m \<le> b
[PROOF STEP]
show "m \<le> b"
[PROOF STATE]
proof (prove)
using this:
m \<le> b

goal (1 subgoal):
 1. m \<le> b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
m \<le> b

goal (1 subgoal):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
have "b \<le> f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> f
[PROOF STEP]
using intersect_segment_xline[OF ef] H
[PROOF STATE]
proof (prove)
using this:
closed_segment (x0, y0) (x1, y1) \<inter> {p. fst p = x} \<subseteq> {(x, e)..(x, f)}
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)

goal (1 subgoal):
 1. b \<le> f
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
b \<le> f

goal (1 subgoal):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b \<le> f

goal (1 subgoal):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
have "\<dots> \<le> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<le> M
[PROOF STEP]
using H ef
[PROOF STATE]
proof (prove)
using this:
((x0, y0), x1, y1) \<in> set Xs
(x, b) \<in> closed_segment (x0, y0) (x1, y1)
intersect_segment_xline prec ((x0, y0), x1, y1) x = Some (e, f)

goal (1 subgoal):
 1. f \<le> M
[PROOF STEP]
by (auto intro: bound_intersect_2d_upper[OF assms])
[PROOF STATE]
proof (state)
this:
f \<le> M

goal (1 subgoal):
 1. \<And>b aa ba ab bb. \<lbrakk>((aa, ba), ab, bb) \<in> set Xs; (x, b) \<in> closed_segment (aa, ba) (ab, bb)\<rbrakk> \<Longrightarrow> b \<le> M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b \<le> M
[PROOF STEP]
show "b \<le> M"
[PROOF STATE]
proof (prove)
using this:
b \<le> M

goal (1 subgoal):
 1. b \<le> M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
b \<le> M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_fine3: "\<lbrakk>fine \<delta> (a, b) D; (u, z, v) \<in> set D\<rbrakk> \<Longrightarrow> v - u < \<delta> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fine \<delta> (a, b) D; (u, z, v) \<in> set D\<rbrakk> \<Longrightarrow> v - u < \<delta> z
[PROOF STEP]
by (induct arbitrary: z u v set: fine) auto


[STATEMENT]
lemma length_inorder[simp]: "length (inorder t) = size t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (inorder t) = size t
[PROOF STEP]
by (induction t) auto