[STATEMENT]
lemma normal_density_times:
  assumes "\<sigma> > 0" "\<sigma>' > 0"
  shows "normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = (1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu>*\<sigma>'\<^sup>2 + \<mu>'*\<sigma>\<^sup>2)/(\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have non0: "2*\<sigma>\<^sup>2 \<noteq> 0" "2*\<sigma>'\<^sup>2 \<noteq> 0" "\<sigma>\<^sup>2 + \<sigma>'\<^sup>2 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<sigma>\<^sup>2 \<noteq> 0 &&& 2 * \<sigma>'\<^sup>2 \<noteq> 0 &&& \<sigma>\<^sup>2 + \<sigma>'\<^sup>2 \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma>
0 < \<sigma>'

goal (1 subgoal):
 1. 2 * \<sigma>\<^sup>2 \<noteq> 0 &&& 2 * \<sigma>'\<^sup>2 \<noteq> 0 &&& \<sigma>\<^sup>2 + \<sigma>'\<^sup>2 \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * \<sigma>\<^sup>2 \<noteq> 0
2 * \<sigma>'\<^sup>2 \<noteq> 0
\<sigma>\<^sup>2 + \<sigma>'\<^sup>2 \<noteq> 0

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have "?lhs = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: normal_density_def)
[PROOF STATE]
proof (state)
this:
normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have "... = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: exp_add[of "- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))" "- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))",simplified add_uminus_conv_diff])
[PROOF STATE]
proof (state)
this:
exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2))) * exp (- ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have "... = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)))  / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))
[PROOF STEP]
have "((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) + ((x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))"
         (is "?lhs' = ?rhs'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "?lhs' = (2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: field_class.add_frac_eq[OF non0(1,2)])
[PROOF STATE]
proof (state)
this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: power2_eq_square division_ring_class.add_divide_distrib)
[PROOF STATE]
proof (state)
this:
(2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 * ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2) + 2 * ((x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2)) / (4 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x  + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: comm_ring_1_class.power2_diff ring_class.left_diff_distrib semiring_class.distrib_right)
[PROOF STATE]
proof (state)
this:
((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((x - \<mu>)\<^sup>2 * \<sigma>'\<^sup>2 + (x - \<mu>')\<^sup>2 * \<sigma>\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp only: complete_the_square2'[OF non0(3),of x "(\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)" "(\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)"])
[PROOF STATE]
proof (state)
this:
((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * x\<^sup>2 - 2 * (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) * x + (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - (((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: division_ring_class.diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * ((\<sigma> * \<sigma>') / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: monoid_mult_class.power2_eq_square[of "(\<sigma> * \<sigma>') / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)"] ab_semigroup_mult_class.mult.commute[of "\<sigma>\<^sup>2 + \<sigma>'\<^sup>2"] )
          (simp add: monoid_mult_class.power2_eq_square[of \<sigma>] monoid_mult_class.power2_eq_square[of \<sigma>'])
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... =  (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))
[PROOF STEP]
by(simp add: comm_semiring_1_class.power2_sum[of "\<mu> * \<sigma>'\<^sup>2" "\<mu>' * \<sigma>\<^sup>2"] semiring_class.distrib_right[of "\<sigma>\<^sup>2" "\<sigma>'\<^sup>2" "\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2"] )
          (simp add: semiring_class.distrib_left[of _ "\<mu>'\<^sup>2 * \<sigma>\<^sup>2 " "\<mu>\<^sup>2 * \<sigma>'\<^sup>2"])
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2)\<^sup>2 - (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2 + \<mu>\<^sup>2 * \<sigma>'\<^sup>2)) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) / (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + ((\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)*\<mu>\<^sup>2 + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)*\<mu>'\<^sup>2 - (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2) * 2 * (\<mu>*\<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))
[PROOF STEP]
by(simp add: monoid_mult_class.power2_eq_square division_ring_class.minus_divide_left)
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - ((\<mu> * \<sigma>'\<^sup>2)\<^sup>2 + (\<mu>' * \<sigma>\<^sup>2)\<^sup>2 + 2 * (\<mu> * \<sigma>'\<^sup>2) * (\<mu>' * \<sigma>\<^sup>2) - (\<sigma>\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2) + (\<sigma>'\<^sup>2 * (\<mu>'\<^sup>2 * \<sigma>\<^sup>2) + \<sigma>'\<^sup>2 * (\<mu>\<^sup>2 * \<sigma>'\<^sup>2)))) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2)))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu>*\<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma>
0 < \<sigma>'

goal (1 subgoal):
 1. (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2)
[PROOF STEP]
by(simp add: division_ring_class.add_divide_distrib division_ring_class.diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2)

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>\<^sup>2 + \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * \<mu>'\<^sup>2 - \<sigma>\<^sup>2 * \<sigma>'\<^sup>2 * 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * (2 * (\<sigma>\<^sup>2 * \<sigma>'\<^sup>2))) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2)

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
have "... = ?rhs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
by(simp add: comm_ring_1_class.power2_diff ab_semigroup_mult_class.mult.commute[of 2])
[PROOF STATE]
proof (state)
this:
(x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu>\<^sup>2 + \<mu>'\<^sup>2 - 2 * (\<mu> * \<mu>')) / ((\<sigma>\<^sup>2 + \<sigma>'\<^sup>2) * 2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. (x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2) + (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2) = (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) + (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (- ((x - \<mu>)\<^sup>2 / (2 * \<sigma>\<^sup>2)) - (x - \<mu>')\<^sup>2 / (2 * \<sigma>'\<^sup>2)) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have "... = (exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2))) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2)  * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
by(simp add: exp_add[of "- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2)" "- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))",simplified] normal_density_def)
[PROOF STATE]
proof (state)
this:
exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (- (x - (\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2 / (2 * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) - (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) = exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
have "exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma>
0 < \<sigma>'

goal (1 subgoal):
 1. exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)))
[PROOF STEP]
by(simp add: real_sqrt_mult)
[PROOF STATE]
proof (state)
this:
exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)))

goal (1 subgoal):
 1. exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)))

goal (1 subgoal):
 1. exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) / (sqrt (2 * pi * \<sigma>\<^sup>2) * sqrt (2 * pi * \<sigma>'\<^sup>2)) * sqrt (2 * pi * (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))\<^sup>2) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x

goal (1 subgoal):
 1. normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
normal_density \<mu> \<sigma> x * normal_density \<mu>' \<sigma>' x = 1 / sqrt (2 * pi * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) * exp (- (\<mu> - \<mu>')\<^sup>2 / (2 * (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2))) * normal_density ((\<mu> * \<sigma>'\<^sup>2 + \<mu>' * \<sigma>\<^sup>2) / (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) (\<sigma> * \<sigma>' / sqrt (\<sigma>\<^sup>2 + \<sigma>'\<^sup>2)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) npMulDistr:"\<And> n m. x \<in> carrier R  \<Longrightarrow>
                 (npow R x n) \<cdot>\<^sub>r (npow R x m) = npow R x (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n m. x \<in> carrier R \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R m\<^esup> = x^\<^bsup>R (n + m)\<^esup>
[PROOF STEP]
apply (induct_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n m. x \<in> carrier R \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R 0\<^esup> = x^\<^bsup>R (n + 0)\<^esup>
 2. \<And>n m na. \<lbrakk>x \<in> carrier R; x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R na\<^esup> = x^\<^bsup>R (n + na)\<^esup>\<rbrakk> \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R Suc na\<^esup> = x^\<^bsup>R (n + Suc na)\<^esup>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. x \<in> carrier R \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r 1\<^sub>r = x^\<^bsup>R n\<^esup>
 2. \<And>n m na. \<lbrakk>x \<in> carrier R; x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R na\<^esup> = x^\<^bsup>R (n + na)\<^esup>\<rbrakk> \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R Suc na\<^esup> = x^\<^bsup>R (n + Suc na)\<^esup>
[PROOF STEP]
apply (rule ring_r_one, simp add:npClose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n m na. \<lbrakk>x \<in> carrier R; x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R na\<^esup> = x^\<^bsup>R (n + na)\<^esup>\<rbrakk> \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R Suc na\<^esup> = x^\<^bsup>R (n + Suc na)\<^esup>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<lbrakk>x \<in> carrier R; x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R na\<^esup> = x^\<^bsup>R (n + na)\<^esup>\<rbrakk> \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r (x^\<^bsup>R na\<^esup> \<cdot>\<^sub>r x) = x^\<^bsup>R (n + na)\<^esup> \<cdot>\<^sub>r x
[PROOF STEP]
apply (frule_tac x = x and n = n in npClose,
         frule_tac x = x and n = na in npClose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<lbrakk>x \<in> carrier R; x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x^\<^bsup>R na\<^esup> = x^\<^bsup>R (n + na)\<^esup>; x^\<^bsup>R n\<^esup> \<in> carrier R; x^\<^bsup>R na\<^esup> \<in> carrier R\<rbrakk> \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r (x^\<^bsup>R na\<^esup> \<cdot>\<^sub>r x) = x^\<^bsup>R (n + na)\<^esup> \<cdot>\<^sub>r x
[PROOF STEP]
apply (simp add:ring_tOp_assoc[THEN sym])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_Collect_ex: "(\<And>i. open {x. P i x}) \<Longrightarrow> open {x. \<exists>i. P i x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. open {x. P i x}) \<Longrightarrow> open {x. \<exists>i. P i x}
[PROOF STEP]
using open_UN[of UNIV "\<lambda>i. {x. P i x}"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. open {xa. P x xa} \<Longrightarrow> open (\<Union>x. {xa. P x xa})

goal (1 subgoal):
 1. (\<And>i. open {x. P i x}) \<Longrightarrow> open {x. \<exists>i. P i x}
[PROOF STEP]
unfolding Collect_ex_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. open {xa. P x xa} \<Longrightarrow> open (\<Union>x. {xa. P x xa})

goal (1 subgoal):
 1. (\<And>i. open {x. P i x}) \<Longrightarrow> open (\<Union>y. {x. P y x})
[PROOF STEP]
by simp


[STATEMENT]
theorem JF1set_simps:
  "JF1set a = F1set1 (dtor1 a) \<union>
    ((\<Union> b \<in> F1set2 (dtor1 a). JF1set b) \<union>
     (\<Union> b \<in> F1set3 (dtor1 a). JF2set b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JF1set a = F1set1 (dtor1 a) \<union> (\<Union> (JF1set ` F1set2 (dtor1 a)) \<union> \<Union> (JF2set ` F1set3 (dtor1 a)))
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. JF1set a \<subseteq> F1set1 (dtor1 a) \<union> (\<Union> (JF1set ` F1set2 (dtor1 a)) \<union> \<Union> (JF2set ` F1set3 (dtor1 a)))
 2. F1set1 (dtor1 a) \<union> (\<Union> (JF1set ` F1set2 (dtor1 a)) \<union> \<Union> (JF2set ` F1set3 (dtor1 a))) \<subseteq> JF1set a
[PROOF STEP]
apply (rule conjunct1[OF JFset_le])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1set1 (dtor1 a) \<union> (\<Union> (JF1set ` F1set2 (dtor1 a)) \<union> \<Union> (JF2set ` F1set3 (dtor1 a))) \<subseteq> JF1set a
[PROOF STEP]
apply (rule Un_least)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F1set1 (dtor1 a) \<subseteq> JF1set a
 2. \<Union> (JF1set ` F1set2 (dtor1 a)) \<union> \<Union> (JF2set ` F1set3 (dtor1 a)) \<subseteq> JF1set a
[PROOF STEP]
apply (rule F1set1_incl_JF1set)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (JF1set ` F1set2 (dtor1 a)) \<union> \<Union> (JF2set ` F1set3 (dtor1 a)) \<subseteq> JF1set a
[PROOF STEP]
apply (rule Un_least)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (JF1set ` F1set2 (dtor1 a)) \<subseteq> JF1set a
 2. \<Union> (JF2set ` F1set3 (dtor1 a)) \<subseteq> JF1set a
[PROOF STEP]
apply (rule UN_least)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. b \<in> F1set2 (dtor1 a) \<Longrightarrow> JF1set b \<subseteq> JF1set a
 2. \<Union> (JF2set ` F1set3 (dtor1 a)) \<subseteq> JF1set a
[PROOF STEP]
apply (erule F1set2_JF1set_incl_JF1set)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (JF2set ` F1set3 (dtor1 a)) \<subseteq> JF1set a
[PROOF STEP]
apply (rule UN_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in> F1set3 (dtor1 a) \<Longrightarrow> JF2set b \<subseteq> JF1set a
[PROOF STEP]
apply (erule F1set3_JF2set_incl_JF1set)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cmod_eq_Re: "Im z = 0 \<Longrightarrow> cmod z = \<bar>Re z\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im z = 0 \<Longrightarrow> cmod z = \<bar>Re z\<bar>
[PROOF STEP]
by (simp add: norm_complex_def)


[STATEMENT]
lemma tendsto_add_filterlim_at_infinity':
  fixes c :: "'b::real_normed_vector"
    and F :: "'a filter"
  assumes "filterlim f at_infinity F"
    and "(g \<longlongrightarrow> c) F"
  shows "filterlim (\<lambda>x. f x + g x) at_infinity F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x F. f x + g x :> at_infinity
[PROOF STEP]
by (subst add.commute) (rule tendsto_add_filterlim_at_infinity assms)+


[STATEMENT]
lemma IVT2:
  fixes f :: "'a::linear_continuum_topology \<Rightarrow> 'b::linorder_topology"
  shows "f b \<le> y \<Longrightarrow> y \<le> f a \<Longrightarrow> a \<le> b \<Longrightarrow> (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x) \<Longrightarrow>
    \<exists>x. a \<le> x \<and> x \<le> b \<and> f x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f b \<le> y; y \<le> f a; a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>x\<ge>a. x \<le> b \<and> f x = y
[PROOF STEP]
by (rule IVT2') (auto intro: continuous_at_imp_continuous_on)


[STATEMENT]
theorem wallis: "(\<lambda>n. \<Prod>k=1..n. (4*real k^2) / (4*real k^2 - 1)) \<longlonglongrightarrow> pi / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
from tendsto_inverse[OF tendsto_mult[OF
         sin_product_formula_real[of "1/2"] tendsto_const[of "2/pi"]]]
[PROOF STATE]
proof (chain)
picking this:
sin (pi * (1 / 2)) * (2 / pi) \<noteq> 0 \<Longrightarrow> (\<lambda>x. inverse (pi * (1 / 2) * (\<Prod>k = 1..x. 1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2) * (2 / pi))) \<longlonglongrightarrow> inverse (sin (pi * (1 / 2)) * (2 / pi))
[PROOF STEP]
have "(\<lambda>n. (\<Prod>k=1..n. inverse (1 - (1/2)\<^sup>2 / (real k)\<^sup>2))) \<longlonglongrightarrow> pi/2"
[PROOF STATE]
proof (prove)
using this:
sin (pi * (1 / 2)) * (2 / pi) \<noteq> 0 \<Longrightarrow> (\<lambda>x. inverse (pi * (1 / 2) * (\<Prod>k = 1..x. 1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2) * (2 / pi))) \<longlonglongrightarrow> inverse (sin (pi * (1 / 2)) * (2 / pi))

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
by (simp add: prod_inversef [symmetric])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>k = 1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2)) \<longlonglongrightarrow> pi / 2

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>k = 1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2)) \<longlonglongrightarrow> pi / 2

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
have "(\<lambda>n. (\<Prod>k=1..n. inverse (1 - (1/2)\<^sup>2 / (real k)\<^sup>2))) =
               (\<lambda>n. (\<Prod>k=1..n. (4*real k^2)/(4*real k^2 - 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2)) = (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1))
[PROOF STEP]
by (intro ext prod.cong refl) (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>k = 1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2)) = (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1))

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>k = 1..n. 4 * (real k)\<^sup>2 / (4 * (real k)\<^sup>2 - 1)) \<longlonglongrightarrow> pi / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Limsup_max_eq_max_Limsup:
  fixes u::"'a \<Rightarrow> 'b::complete_linorder"
  shows "Limsup F (\<lambda>n. max (u n) (v n)) = max (Limsup F u) (Limsup F v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) = max (Limsup F u) (Limsup F v)
[PROOF STEP]
proof (rule order_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
 2. max (Limsup F u) (Limsup F v) \<le> Limsup F (\<lambda>n. max (u n) (v n))
[PROOF STEP]
show "max (Limsup F u) (Limsup F v) \<le> Limsup F (\<lambda>n. max (u n) (v n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (Limsup F u) (Limsup F v) \<le> Limsup F (\<lambda>n. max (u n) (v n))
[PROOF STEP]
by (auto intro: Limsup_mono)
[PROOF STATE]
proof (state)
this:
max (Limsup F u) (Limsup F v) \<le> Limsup F (\<lambda>n. max (u n) (v n))

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
have "Limsup F (\<lambda>n. max (u n) (v n)) < e" if "max (Limsup F u) (Limsup F v) < e" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
proof (cases "\<exists>t. max (Limsup F u) (Limsup F v) < t \<and> t < e")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<exists>t>max (Limsup F u) (Limsup F v). t < e

goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>t>max (Limsup F u) (Limsup F v). t < e
[PROOF STEP]
obtain t where t: "t < e" "max (Limsup F u) (Limsup F v) < t"
[PROOF STATE]
proof (prove)
using this:
\<exists>t>max (Limsup F u) (Limsup F v). t < e

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t < e; max (Limsup F u) (Limsup F v) < t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t < e
max (Limsup F u) (Limsup F v) < t

goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t < e
max (Limsup F u) (Limsup F v) < t
[PROOF STEP]
have "Limsup F u < t" "Limsup F v < t"
[PROOF STATE]
proof (prove)
using this:
t < e
max (Limsup F u) (Limsup F v) < t

goal (1 subgoal):
 1. Limsup F u < t &&& Limsup F v < t
[PROOF STEP]
using that max_def
[PROOF STATE]
proof (prove)
using this:
t < e
max (Limsup F u) (Limsup F v) < t
max (Limsup F u) (Limsup F v) < e
max ?a ?b = (if ?a \<le> ?b then ?b else ?a)

goal (1 subgoal):
 1. Limsup F u < t &&& Limsup F v < t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Limsup F u < t
Limsup F v < t

goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Limsup F u < t
Limsup F v < t
[PROOF STEP]
have *: "eventually (\<lambda>n. u n < t) F" "eventually (\<lambda>n. v n < t) F"
[PROOF STATE]
proof (prove)
using this:
Limsup F u < t
Limsup F v < t

goal (1 subgoal):
 1. \<forall>\<^sub>F n in F. u n < t &&& \<forall>\<^sub>F n in F. v n < t
[PROOF STEP]
by (auto simp: Limsup_lessD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in F. u n < t
\<forall>\<^sub>F n in F. v n < t

goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
have "eventually (\<lambda>n. max (u n) (v n) < t) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in F. max (u n) (v n) < t
[PROOF STEP]
using eventually_mono[OF eventually_conj[OF *]]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. u x < t \<and> v x < t \<Longrightarrow> ?Q x) \<Longrightarrow> eventually ?Q F

goal (1 subgoal):
 1. \<forall>\<^sub>F n in F. max (u n) (v n) < t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in F. max (u n) (v n) < t

goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in F. max (u n) (v n) < t
[PROOF STEP]
have "Limsup F (\<lambda>n. max (u n) (v n)) \<le> t"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in F. max (u n) (v n) < t

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> t
[PROOF STEP]
by (meson Limsup_obtain' not_le_imp_less order.asym)
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> t

goal (2 subgoals):
 1. \<exists>t>max (Limsup F u) (Limsup F v). t < e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
 2. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> t

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> t
t < e
max (Limsup F u) (Limsup F v) < t

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>n. max (u n) (v n)) < e

goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e)

goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
have "Limsup F u < e" "Limsup F v < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F u < e &&& Limsup F v < e
[PROOF STEP]
using that max_def
[PROOF STATE]
proof (prove)
using this:
max (Limsup F u) (Limsup F v) < e
max ?a ?b = (if ?a \<le> ?b then ?b else ?a)

goal (1 subgoal):
 1. Limsup F u < e &&& Limsup F v < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Limsup F u < e
Limsup F v < e

goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Limsup F u < e
Limsup F v < e
[PROOF STEP]
have *: "eventually (\<lambda>n. u n < e) F" "eventually (\<lambda>n. v n < e) F"
[PROOF STATE]
proof (prove)
using this:
Limsup F u < e
Limsup F v < e

goal (1 subgoal):
 1. \<forall>\<^sub>F n in F. u n < e &&& \<forall>\<^sub>F n in F. v n < e
[PROOF STEP]
by (auto simp: Limsup_lessD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in F. u n < e
\<forall>\<^sub>F n in F. v n < e

goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
have "eventually (\<lambda>n. max (u n) (v n) \<le> max (Limsup F u) (Limsup F v)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in F. max (u n) (v n) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
apply (rule eventually_mono[OF eventually_conj[OF *]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. u x < e \<and> v x < e \<Longrightarrow> max (u x) (v x) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
using False not_le_imp_less
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e)
\<not> ?y \<le> ?x \<Longrightarrow> ?x < ?y

goal (1 subgoal):
 1. \<And>x. u x < e \<and> v x < e \<Longrightarrow> max (u x) (v x) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in F. max (u n) (v n) \<le> max (Limsup F u) (Limsup F v)

goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in F. max (u n) (v n) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
have "Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in F. max (u n) (v n) \<le> max (Limsup F u) (Limsup F v)

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
by (meson Limsup_obtain' leD leI)
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)

goal (1 subgoal):
 1. \<not> (\<exists>t>max (Limsup F u) (Limsup F v). t < e) \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
using that le_less_trans
[PROOF STATE]
proof (prove)
using this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
max (Limsup F u) (Limsup F v) < e
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) < e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>n. max (u n) (v n)) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
max (Limsup F u) (Limsup F v) < ?e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < ?e

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
max (Limsup F u) (Limsup F v) < ?e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < ?e
[PROOF STEP]
show "Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)"
[PROOF STATE]
proof (prove)
using this:
max (Limsup F u) (Limsup F v) < ?e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < ?e

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
using not_le_imp_less
[PROOF STATE]
proof (prove)
using this:
max (Limsup F u) (Limsup F v) < ?e \<Longrightarrow> Limsup F (\<lambda>n. max (u n) (v n)) < ?e
\<not> ?y \<le> ?x \<Longrightarrow> ?x < ?y

goal (1 subgoal):
 1. Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>n. max (u n) (v n)) \<le> max (Limsup F u) (Limsup F v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positively_invariant_y_upper:
  shows "g.positively_invariant {p. (snd p) - 751/100 \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g.positively_invariant {p. snd p - 751 / 100 \<le> 0}
[PROOF STEP]
apply (rule g.positively_invariant_barrier)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. ((\<lambda>x. snd x - 751 / 100) has_derivative ?V' x) (at x)
 2. continuous_on UNIV (\<lambda>x. ?V' x (case x of (x, y) \<Rightarrow> (gx x y, gy x y)))
 3. \<And>s. snd s - 751 / 100 = 0 \<Longrightarrow> ?V' s (case s of (x, y) \<Rightarrow> (gx x y, gy x y)) < 0
[PROOF STEP]
apply (auto intro!: continuous_intros derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. b * 100 = 751 \<Longrightarrow> gy a b < 0
[PROOF STEP]
unfolding gy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. b * 100 = 751 \<Longrightarrow> 6 / 10 - 8 / 10\<^sup>2 * b - a\<^sup>2 * b < 0
[PROOF STEP]
by (sos "((R<1 + ((R<1 * (R<18775/2 * [a]^2)) + ((A<=0 * R<1) * (R<1250 * [1]^2)))))")


[STATEMENT]
lemma (in prime_number_theorem) totient_primorial'_asymp_equiv':
  "(\<lambda>k. totient (primorial' k)) \<sim>[at_top]
      (\<lambda>k. third_mertens_const * primorial' k / ln (ln (primorial' k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
let ?C = third_mertens_const
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
have "(\<lambda>k. totient (primorial' k)) \<sim>[at_top] (\<lambda>k. third_mertens_const * primorial' k / ln k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (real k))
[PROOF STEP]
by (rule totient_primorial'_asymp_equiv)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (real k))

goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (real k))

goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
have "\<dots> \<sim>[at_top] (\<lambda>k. third_mertens_const * primorial' k / ln (ln (primorial' k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. third_mertens_const * real (primorial' k) / ln (real k)) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
by (intro asymp_equiv_intros asymp_equiv_symI[OF ln_ln_primorial'_asymp_equiv])
[PROOF STATE]
proof (state)
this:
(\<lambda>k. third_mertens_const * real (primorial' k) / ln (real k)) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))

goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>c d. c \<sim>[sequentially] d \<Longrightarrow> c \<sim>[sequentially] d) \<Longrightarrow> (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>a. third_mertens_const * real (primorial' a) / ln (ln (real (primorial' a))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>c d. c \<sim>[sequentially] d \<Longrightarrow> c \<sim>[sequentially] d) \<Longrightarrow> (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>a. third_mertens_const * real (primorial' a) / ln (ln (real (primorial' a))))

goal (1 subgoal):
 1. (\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (totient (primorial' x))) \<sim>[sequentially] (\<lambda>k. third_mertens_const * real (primorial' k) / ln (ln (real (primorial' k))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_projection_on_id_minus:
  fixes M :: \<open>'a::complex_inner set\<close>
  assumes is_proj: "is_projection_on \<pi> M"
    and cc: "closed_csubspace M"
  shows "is_projection_on (id - \<pi>) (orthogonal_complement M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_projection_on (id - \<pi>) (orthogonal_complement M)
[PROOF STEP]
using is_proj
[PROOF STATE]
proof (prove)
using this:
is_projection_on \<pi> M

goal (1 subgoal):
 1. is_projection_on (id - \<pi>) (orthogonal_complement M)
[PROOF STEP]
apply (simp add: cc is_projection_on_iff_orthog)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>h. h - \<pi> h \<in> orthogonal_complement M \<and> \<pi> h \<in> M \<Longrightarrow> \<forall>h. \<pi> h \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
using double_orthogonal_complement_increasing
[PROOF STATE]
proof (prove)
using this:
?M \<subseteq> orthogonal_complement (orthogonal_complement ?M)

goal (1 subgoal):
 1. \<forall>h. h - \<pi> h \<in> orthogonal_complement M \<and> \<pi> h \<in> M \<Longrightarrow> \<forall>h. \<pi> h \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
by blast


[STATEMENT]
lemma n_s_narrow_rep:
assumes "finite X"  "S1 = S2 on -X"  "\<forall>x. S2 x \<le> S1 x"  "\<forall>x. S1 x \<triangle> S2 x \<le> S1 x"
  "S1 x \<noteq> S1 x \<triangle> S2 x"
shows "(\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))
[PROOF STEP]
have 1: "\<forall>x. n(S1 x \<triangle> S2 x) \<le> n(S1 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. n (S1 x \<triangle> S2 x) \<le> n (S1 x)
[PROOF STEP]
by (metis assms(3) assms(4) eq_iff less_le_not_le n_narrow)
[PROOF STATE]
proof (state)
this:
\<forall>x. n (S1 x \<triangle> S2 x) \<le> n (S1 x)

goal (1 subgoal):
 1. (\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))
[PROOF STEP]
have "x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
by (metis Compl_iff assms(2) assms(5) narrowid)
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. (\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))
[PROOF STEP]
hence 2: "\<exists>x\<in>X. n(S1 x \<triangle> S2 x) < n(S1 x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> X

goal (1 subgoal):
 1. \<exists>x\<in>X. n (S1 x \<triangle> S2 x) < n (S1 x)
[PROOF STEP]
by (metis assms(3-5) eq_iff less_le_not_le n_narrow)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. n (S1 x \<triangle> S2 x) < n (S1 x)

goal (1 subgoal):
 1. (\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))
[PROOF STEP]
apply(rule sum_strict_mono_ex1[OF \<open>finite X\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>X. n (S1 x \<triangle> S2 x) \<le> n (S1 x)
 2. \<exists>a\<in>X. n (S1 a \<triangle> S2 a) < n (S1 a)
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
\<forall>x. n (S1 x \<triangle> S2 x) \<le> n (S1 x)
\<exists>x\<in>X. n (S1 x \<triangle> S2 x) < n (S1 x)

goal (2 subgoals):
 1. \<forall>x\<in>X. n (S1 x \<triangle> S2 x) \<le> n (S1 x)
 2. \<exists>a\<in>X. n (S1 a \<triangle> S2 a) < n (S1 a)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>X. n (S1 x \<triangle> S2 x)) < (\<Sum>x\<in>X. n (S1 x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eqpoll_iff_bijections:
   "A \<approx> B \<longleftrightarrow> (\<exists>f g. (\<forall>x \<in> A. f x \<in> B \<and> g(f x) = x) \<and> (\<forall>y \<in> B. g y \<in> A \<and> f(g y) = y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<approx> B) = (\<exists>f g. (\<forall>x\<in>A. f x \<in> B \<and> g (f x) = x) \<and> (\<forall>y\<in>B. g y \<in> A \<and> f (g y) = y))
[PROOF STEP]
by (auto simp: eqpoll_def bij_betw_iff_bijections)


[STATEMENT]
lemma of_real_closed_segment [simp]:
  "of_real x \<in> closed_segment (of_real a) (of_real b) \<longleftrightarrow> x \<in> closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_real x \<in> closed_segment (of_real a) (of_real b)) = (x \<in> closed_segment a b)
[PROOF STEP]
apply (auto simp: in_segment scaleR_conv_of_real elim!: ex_forward)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1; of_real x = ((1::'a) - of_real u) * of_real a + of_real u * of_real b\<rbrakk> \<Longrightarrow> x = (1 - u) * a + u * b
[PROOF STEP]
using of_real_eq_iff
[PROOF STATE]
proof (prove)
using this:
(of_real ?x = of_real ?y) = (?x = ?y)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1; of_real x = ((1::'a) - of_real u) * of_real a + of_real u * of_real b\<rbrakk> \<Longrightarrow> x = (1 - u) * a + u * b
[PROOF STEP]
by fastforce