[STATEMENT]
lemma Qp_val_alt_def:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "b \<in> carrier Q\<^sub>p"
  shows "val b \<le> val a \<longleftrightarrow> (\<exists>y \<in> carrier Q\<^sub>p. (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (val b \<le> val a) = (\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. val b \<le> val a \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> val b \<le> val a
[PROOF STEP]
show "val a \<ge> val b \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val b \<le> val a \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. val b \<le> val a \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
assume A: "val a \<ge> val b"
[PROOF STATE]
proof (state)
this:
val b \<le> val a

goal (1 subgoal):
 1. val b \<le> val a \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
show "\<exists>y\<in>carrier Q\<^sub>p. (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
proof(cases "b = \<zero>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b = \<zero>

goal (2 subgoals):
 1. b = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = \<zero>
[PROOF STEP]
have "a = \<zero>"
[PROOF STATE]
proof (prove)
using this:
b = \<zero>

goal (1 subgoal):
 1. a = \<zero>
[PROOF STEP]
using A assms(1) val_ineq
[PROOF STATE]
proof (prove)
using this:
b = \<zero>
val b \<le> val a
a \<in> carrier Q\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; val \<zero> \<le> val ?a\<rbrakk> \<Longrightarrow> ?a = \<zero>

goal (1 subgoal):
 1. a = \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = \<zero>

goal (2 subgoals):
 1. b = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = \<zero>
[PROOF STEP]
have "(b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (\<zero>[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
a = \<zero>

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = \<zero> [^] 2
[PROOF STEP]
by (metis Qp.nat_pow_zero Qp.r_null Qp.r_zero True assms(2) p_natpow_closed(1) zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = \<zero> [^] 2

goal (2 subgoals):
 1. b = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = \<zero> [^] 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = \<zero> [^] 2

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
using True A assms(2)
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = \<zero> [^] 2
b = \<zero>
val b \<le> val a
b \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
b \<noteq> \<zero>

goal (1 subgoal):
 1. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
assume B: "b \<noteq> \<zero>"
[PROOF STATE]
proof (state)
this:
b \<noteq> \<zero>

goal (1 subgoal):
 1. b \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
show "\<exists>y\<in>carrier Q\<^sub>p. (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat)) \<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
proof(cases "a = \<zero>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = \<zero>

goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = \<zero>
[PROOF STEP]
have "(b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (b[^](4::nat))"
[PROOF STATE]
proof (prove)
using this:
a = \<zero>

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = b [^] 4
[PROOF STEP]
using Qp.cring_axioms Qp.nat_pow_closed assms(2) cring_def p_natpow_closed(1) ring.pow_zero zero_less_numeral
[PROOF STATE]
proof (prove)
using this:
a = \<zero>
cring Q\<^sub>p
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p
cring ?R \<equiv> ring ?R \<and> Group.comm_monoid ?R
\<pp> [^] ?n \<in> carrier Q\<^sub>p
\<lbrakk>ring ?R; 0 < ?n\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>?R\<^esub> [^]\<^bsub>?R\<^esub> ?n = \<zero>\<^bsub>?R\<^esub>
(0::?'a) < numeral ?n

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = b [^] 4
[PROOF STEP]
by (metis Qp.add.l_cancel_one' Qp.integral_iff assms(1))
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = b [^] 4

goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = b [^] 4
[PROOF STEP]
have "(b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = ((b[^](2::nat))[^] (2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = b [^] 4

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2
[PROOF STEP]
by (metis Qp_nat_pow_pow assms(2) mult_2_right numeral_Bit0)
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2

goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2
[PROOF STEP]
have "(b[^](2::nat)) \<in> carrier Q\<^sub>p \<and> (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = ((b[^](2::nat))[^] (2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2

goal (1 subgoal):
 1. b [^] 2 \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2
[PROOF STEP]
using Qp.nat_pow_closed assms(2)
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 2 \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 2 \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2

goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
 2. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 2 \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b [^] 2 \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> \<zero>

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
have F0:  "b \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> nonzero Q\<^sub>p
[PROOF STEP]
using B assms(2) not_nonzero_Qp
[PROOF STATE]
proof (prove)
using this:
b \<noteq> \<zero>
b \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier ?Q\<^sub>p; ?x \<notin> nonzero ?Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x = \<zero>\<^bsub>?Q\<^sub>p\<^esub>

goal (1 subgoal):
 1. b \<in> nonzero Q\<^sub>p
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
b \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
have F1: "a \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p
[PROOF STEP]
using False assms(1) not_nonzero_Qp
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>
a \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier ?Q\<^sub>p; ?x \<notin> nonzero ?Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x = \<zero>\<^bsub>?Q\<^sub>p\<^esub>

goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> nonzero Q\<^sub>p
[PROOF STEP]
have "(a \<div> b) \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. (a \<div> b) \<in> nonzero Q\<^sub>p
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
b \<noteq> \<zero>

goal (1 subgoal):
 1. (a \<div> b) \<in> nonzero Q\<^sub>p
[PROOF STEP]
by (meson Localization.submonoid.m_closed Qp.nonzero_is_submonoid assms(2) inv_in_frac(3))
[PROOF STATE]
proof (state)
this:
(a \<div> b) \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a \<div> b) \<in> nonzero Q\<^sub>p
[PROOF STEP]
have "val a \<ge> val b"
[PROOF STATE]
proof (prove)
using this:
(a \<div> b) \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. val b \<le> val a
[PROOF STEP]
using F0 F1 A
[PROOF STATE]
proof (prove)
using this:
(a \<div> b) \<in> nonzero Q\<^sub>p
b \<in> nonzero Q\<^sub>p
a \<in> nonzero Q\<^sub>p
val b \<le> val a

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

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
val b \<le> val a
[PROOF STEP]
have "val (a \<div> b) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
val b \<le> val a

goal (1 subgoal):
 1. 0 \<le> val (a \<div> b)
[PROOF STEP]
using F0 F1 val_fract assms(1) local.eint_minus_ineq'
[PROOF STATE]
proof (prove)
using this:
val b \<le> val a
b \<in> nonzero Q\<^sub>p
a \<in> nonzero Q\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> val (?a \<div> ?b) = val ?a - val ?b
a \<in> carrier Q\<^sub>p
?b \<le> ?a \<Longrightarrow> 0 \<le> ?a - ?b

goal (1 subgoal):
 1. 0 \<le> val (a \<div> b)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
0 \<le> val (a \<div> b)

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
obtain y where y_def: "y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 = y [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Qp_val_ring_alt_def0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> nonzero Q\<^sub>p; 0 \<le> ord ?a\<rbrakk> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. \<one> \<oplus> \<pp> [^] 3 \<otimes> ?a [^] 4 = y [^] 2

goal (1 subgoal):
 1. (\<And>y. y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 = y [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson B False Qp.integral Qp.nonzero_closed \<open>(a \<div> b) \<in> nonzero Q\<^sub>p\<close> \<open>0 \<le> val (a \<div> b)\<close>
              assms(1) assms(2) inv_in_frac(1) inv_in_frac(2) ord_nonneg val_ringI)
[PROOF STATE]
proof (state)
this:
y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 = y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 = y [^] 2
[PROOF STEP]
have "(b[^](4::nat)) \<otimes> (\<one> \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat))) =
               (b[^](4::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 = y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = b [^] 4 \<otimes> y [^] 2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = b [^] 4 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = b [^] 4 \<otimes> y [^] 2
[PROOF STEP]
have  F2: "(b[^](4::nat)) \<otimes> (\<one> \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat))) =
               ((b[^](2::nat)) [^] (2::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = b [^] 4 \<otimes> y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
by (metis Qp.nat_pow_pow assms(2) mult_2_right numeral_Bit0)
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
have  F3: "((b[^](4::nat)) \<otimes> \<one>) \<oplus>\<^bsub>Q\<^sub>p\<^esub> ((b[^](4::nat)) \<otimes>((\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat)))) =
               ((b[^](2::nat))[^] (2::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
have 0: "(\<pp>[^](3::nat)) \<otimes> (a \<div> b[^](4::nat)) \<in> carrier Q\<^sub>p "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
have "(a \<div> b[^](4::nat)) \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
using F0 Qp.nat_pow_closed assms(1) fract_closed Qp_nat_pow_nonzero
[PROOF STATE]
proof (prove)
using this:
b \<in> nonzero Q\<^sub>p
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
a \<in> carrier Q\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> (?a \<div> ?b) \<in> carrier Q\<^sub>p
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(a \<div> b [^] 4) \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. \<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a \<div> b [^] 4) \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. \<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
[PROOF STEP]
by (meson Qp.cring_axioms cring.cring_simprules(5) p_natpow_closed(1))
[PROOF STATE]
proof (state)
this:
\<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
have 1: "(b[^](4::nat)) \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
using Qp.nat_pow_closed assms(2)
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
using 0 F2  ring.ring_simprules(23)[of Q\<^sub>p "\<one>" "(\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat))" "(b[^](4::nat))"]
                  Qp.cring_axioms Qp.nonzero_mult_closed Qp.ring_axioms Qp_nat_pow_nonzero \<open>(a \<div> b) \<in> nonzero Q\<^sub>p\<close> p_nonzero
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p
\<pp> [^] 3 \<otimes> (a \<div> b [^] 4) \<in> carrier Q\<^sub>p
b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
\<lbrakk>ring Q\<^sub>p; \<one> \<in> carrier Q\<^sub>p; \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 \<in> carrier Q\<^sub>p; b [^] 4 \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> b [^] 4 \<otimes> (\<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4)
cring Q\<^sub>p
\<lbrakk>?a \<in> nonzero Q\<^sub>p; ?b \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> ?a \<otimes> ?b \<in> carrier Q\<^sub>p
ring Q\<^sub>p
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p
(a \<div> b) \<in> nonzero Q\<^sub>p
\<pp> \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
have F4: "(b[^](4::nat)) \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
using Qp.nat_pow_closed assms(2)
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
have "((b[^](4::nat)) \<otimes> \<one>) = (b[^](4::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> = b [^] 4
[PROOF STEP]
using Qp.r_one
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x \<otimes> \<one> = ?x

goal (1 subgoal):
 1. b [^] 4 \<otimes> \<one> = b [^] 4
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> \<one> = b [^] 4

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<otimes> \<one> = b [^] 4
[PROOF STEP]
have F5:  "(b[^](4::nat))\<oplus>\<^bsub>Q\<^sub>p\<^esub> ((b[^](4::nat)) \<otimes>((\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat)))) =
               ((b[^](2::nat)) [^] (2::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<otimes> \<one> = b [^] 4

goal (1 subgoal):
 1. b [^] 4 \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
using F3
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<otimes> \<one> = b [^] 4
b [^] 4 \<otimes> \<one> \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
have "((b[^](4::nat)) \<otimes>((\<pp>[^](3::nat))\<otimes> ((a \<div> b)[^](4::nat)))) = (\<pp>[^](3::nat))\<otimes>((b[^](4::nat)) \<otimes> ((a \<div> b)[^](4::nat)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
have 0: "(b[^](4::nat)) \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
using F4
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
have 1: "(\<pp>[^](3::nat)) \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] 3 \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<pp> [^] 3 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
have  2: "((a \<div> b)[^](4::nat)) \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<div> b) [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
using F0 Qp.nat_pow_closed assms(1) fract_closed
[PROOF STATE]
proof (prove)
using this:
b \<in> nonzero Q\<^sub>p
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
a \<in> carrier Q\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> (?a \<div> ?b) \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. (a \<div> b) [^] 4 \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a \<div> b) [^] 4 \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
using 0 1 2  monoid.m_assoc[of Q\<^sub>p] comm_monoid.m_comm[of Q\<^sub>p]
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p
\<pp> [^] 3 \<in> carrier Q\<^sub>p
(a \<div> b) [^] 4 \<in> carrier Q\<^sub>p
\<lbrakk>Group.monoid Q\<^sub>p; ?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p; ?z \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y \<otimes> ?z = ?x \<otimes> (?y \<otimes> ?z)
\<lbrakk>Group.comm_monoid Q\<^sub>p; ?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y = ?y \<otimes> ?x

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
using Qp.m_lcomm
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<in> carrier Q\<^sub>p
\<pp> [^] 3 \<in> carrier Q\<^sub>p
(a \<div> b) [^] 4 \<in> carrier Q\<^sub>p
\<lbrakk>Group.monoid Q\<^sub>p; ?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p; ?z \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y \<otimes> ?z = ?x \<otimes> (?y \<otimes> ?z)
\<lbrakk>Group.comm_monoid Q\<^sub>p; ?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y = ?y \<otimes> ?x
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p; ?z \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<otimes> (?y \<otimes> ?z) = ?y \<otimes> (?x \<otimes> ?z)

goal (1 subgoal):
 1. b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
[PROOF STEP]
have  "(b[^](4::nat))\<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes>((b[^](4::nat)) \<otimes> ((a \<div> b)[^](4::nat))) =
               ((b[^](2::nat)) [^] (2::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
using F5
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4)
b [^] 4 \<oplus> b [^] 4 \<otimes> (\<pp> [^] 3 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
have  "(b[^](4::nat))\<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes>((b \<otimes>(a \<div> b))[^](4::nat)) =
               ((b[^](2::nat)) [^] (2::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b \<otimes> (a \<div> b)) [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
using F0 Qp.nat_pow_distrib assms(1) assms(2) fract_closed
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b [^] 4 \<otimes> (a \<div> b) [^] 4) = (b [^] 2) [^] 2 \<otimes> y [^] 2
b \<in> nonzero Q\<^sub>p
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> (?x \<otimes> ?y) [^] ?n = ?x [^] ?n \<otimes> ?y [^] ?n
a \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> (?a \<div> ?b) \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b \<otimes> (a \<div> b)) [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b \<otimes> (a \<div> b)) [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b \<otimes> (a \<div> b)) [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
have  "(b[^](4::nat))\<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes>(a[^](4::nat)) =
               ((b[^](2::nat)) [^] (2::nat)) \<otimes> (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> (b \<otimes> (a \<div> b)) [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
by (metis F0 assms(1) local.fract_cancel_right)
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2
[PROOF STEP]
have  "(b[^](4::nat))\<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes>(a[^](4::nat)) =
               (((b[^](2::nat))\<otimes> y)[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2
[PROOF STEP]
using Qp.nat_pow_closed Qp.nat_pow_distrib assms(2) y_def
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2) [^] 2 \<otimes> y [^] 2
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> (?x \<otimes> ?y) [^] ?n = ?x [^] ?n \<otimes> ?y [^] ?n
b \<in> carrier Q\<^sub>p
y \<in> carrier Q\<^sub>p \<and> \<one> \<oplus> \<pp> [^] 3 \<otimes> (a \<div> b) [^] 4 = y [^] 2

goal (1 subgoal):
 1. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2
[PROOF STEP]
have  "((b[^](2::nat))\<otimes> y) \<in> carrier Q\<^sub>p \<and> (b[^](4::nat))\<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes>(a[^](4::nat)) =
               (((b[^](2::nat))\<otimes> y)[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2

goal (1 subgoal):
 1. b [^] 2 \<otimes> y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2
[PROOF STEP]
by (meson Qp.cring_axioms Qp.nat_pow_closed assms(2) cring.cring_simprules(5) y_def)
[PROOF STATE]
proof (state)
this:
b [^] 2 \<otimes> y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] 2 \<otimes> y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b [^] 2 \<otimes> y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = (b [^] 2 \<otimes> y) [^] 2

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
val b \<le> val a \<Longrightarrow> \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> val b \<le> val a
[PROOF STEP]
show "\<exists>y \<in> carrier Q\<^sub>p. (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat)) \<Longrightarrow> val a \<ge> val b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> val b \<le> val a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> val b \<le> val a
[PROOF STEP]
assume A: "\<exists>y \<in> carrier Q\<^sub>p. (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> val b \<le> val a
[PROOF STEP]
show "val a \<ge> val b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val b \<le> val a
[PROOF STEP]
proof(cases "a = \<zero>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> val b \<le> val a
 2. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = \<zero>

goal (2 subgoals):
 1. a = \<zero> \<Longrightarrow> val b \<le> val a
 2. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = \<zero>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = \<zero>

goal (1 subgoal):
 1. val b \<le> val a
[PROOF STEP]
using eint_ord_code(3) local.val_zero
[PROOF STATE]
proof (prove)
using this:
a = \<zero>
(?q \<le> \<infinity>) = True
val \<zero> = \<infinity>

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

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> \<zero>

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
have  "b \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> \<zero>
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> b \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
assume  "\<not> b \<noteq> \<zero>"
[PROOF STATE]
proof (state)
this:
\<not> b \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> b \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> b \<noteq> \<zero>
[PROOF STEP]
have "\<exists>y \<in> carrier Q\<^sub>p.  (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
\<not> b \<noteq> \<zero>

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
\<not> b \<noteq> \<zero>
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. \<exists>y\<in>carrier Q\<^sub>p. \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
by (metis (no_types, lifting) Qp.add.r_cancel_one' Qp.nat_pow_closed Qp.nonzero_memE(2)
              Qp_nonzero_nat_pow assms(1) assms(2) local.monom_term_car not_nonzero_Qp
              p_natpow_closed(1) zero_less_numeral)
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. \<not> b \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<in>carrier Q\<^sub>p. \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
[PROOF STEP]
obtain y where y_def: "y \<in> carrier Q\<^sub>p \<and> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>carrier Q\<^sub>p. \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. (\<And>y. y \<in> carrier Q\<^sub>p \<and> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> carrier Q\<^sub>p \<and> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. \<not> b \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
have 0: "ord ((\<pp>[^](3::nat))\<otimes> (a[^](4::nat))) = 3 +  4* ord a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
have 00: "(\<pp>[^](3::nat)) \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] 3 \<in> nonzero Q\<^sub>p
[PROOF STEP]
using Qp_nat_pow_nonzero p_nonzero
[PROOF STATE]
proof (prove)
using this:
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p
\<pp> \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. \<pp> [^] 3 \<in> nonzero Q\<^sub>p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<pp> [^] 3 \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
have 01: "(a[^](4::nat)) \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] 4 \<in> nonzero Q\<^sub>p
[PROOF STEP]
using False Qp_nat_pow_nonzero assms(1) not_nonzero_Qp Qp.nonzero_memI
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p
a \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier ?Q\<^sub>p; ?x \<notin> nonzero ?Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x = \<zero>\<^bsub>?Q\<^sub>p\<^esub>
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> ?a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a [^] 4 \<in> nonzero Q\<^sub>p
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
a [^] 4 \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a [^] 4 \<in> nonzero Q\<^sub>p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a [^] 4 \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
using ord_mult[of "\<pp>[^](3::nat)" "a[^](4::nat)"]
[PROOF STATE]
proof (prove)
using this:
a [^] 4 \<in> nonzero Q\<^sub>p
\<lbrakk>\<pp> [^] 3 \<in> nonzero Q\<^sub>p; a [^] 4 \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> ord (\<pp> [^] 3 \<otimes> a [^] 4) = ord (\<pp> [^] 3) + ord (a [^] 4)

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
by (metis (no_types, lifting) "00" False assms(1) nonzero_nat_pow_ord
                not_nonzero_Qp of_nat_numeral ord_p_pow_nat)
[PROOF STATE]
proof (state)
this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a

goal (1 subgoal):
 1. \<not> b \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
have 1: "ord ((\<pp>[^](3::nat))\<otimes> (a[^](4::nat))) = 2* (ord y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
have "y \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<noteq> \<zero>
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> y \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
assume " \<not> y \<noteq> \<zero>"
[PROOF STATE]
proof (state)
this:
\<not> y \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> y \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> y \<noteq> \<zero>
[PROOF STEP]
have "(\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = \<zero>"
[PROOF STATE]
proof (prove)
using this:
\<not> y \<noteq> \<zero>

goal (1 subgoal):
 1. \<pp> [^] 3 \<otimes> a [^] 4 = \<zero>
[PROOF STEP]
using y_def  Qp.cring_axioms cring_def pos2 ring.pow_zero
[PROOF STATE]
proof (prove)
using this:
\<not> y \<noteq> \<zero>
y \<in> carrier Q\<^sub>p \<and> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
cring Q\<^sub>p
cring ?R \<equiv> ring ?R \<and> Group.comm_monoid ?R
0 < 2
\<lbrakk>ring ?R; 0 < ?n\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>?R\<^esub> [^]\<^bsub>?R\<^esub> ?n = \<zero>\<^bsub>?R\<^esub>

goal (1 subgoal):
 1. \<pp> [^] 3 \<otimes> a [^] 4 = \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<pp> [^] 3 \<otimes> a [^] 4 = \<zero>

goal (1 subgoal):
 1. \<not> y \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<pp> [^] 3 \<otimes> a [^] 4 = \<zero>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<pp> [^] 3 \<otimes> a [^] 4 = \<zero>

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis False Qp.integral Qp.nat_pow_closed Qp.nonzero_pow_nonzero
                  Qp.not_nonzero_memI Qp_nat_pow_nonzero assms(1) p_natpow_closed(1) p_nonzero)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y \<noteq> \<zero>

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> \<zero>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> \<zero>

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
using y_def
[PROOF STATE]
proof (prove)
using this:
y \<noteq> \<zero>
y \<in> carrier Q\<^sub>p \<and> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
by (metis nonzero_nat_pow_ord not_nonzero_Qp of_nat_numeral)
[PROOF STATE]
proof (state)
this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y

goal (1 subgoal):
 1. \<not> b \<noteq> \<zero> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y

goal (1 subgoal):
 1. False
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b \<noteq> \<zero>

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> \<zero>
[PROOF STEP]
have F0: "b \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> \<zero>

goal (1 subgoal):
 1. b \<in> nonzero Q\<^sub>p
[PROOF STEP]
using assms(2) not_nonzero_Qp
[PROOF STATE]
proof (prove)
using this:
b \<noteq> \<zero>
b \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier ?Q\<^sub>p; ?x \<notin> nonzero ?Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x = \<zero>\<^bsub>?Q\<^sub>p\<^esub>

goal (1 subgoal):
 1. b \<in> nonzero Q\<^sub>p
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
b \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
have F1: "a \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p
[PROOF STEP]
using False assms(1) not_nonzero_Qp
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>
a \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier ?Q\<^sub>p; ?x \<notin> nonzero ?Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x = \<zero>\<^bsub>?Q\<^sub>p\<^esub>

goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
obtain y where y_def: "y \<in> carrier Q\<^sub>p \<and> (b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat)) = (y[^](2::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. (\<And>y. y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. a \<noteq> \<zero> \<Longrightarrow> val b \<le> val a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val b \<le> val a
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
assume " \<not> val a \<ge> val b "
[PROOF STATE]
proof (state)
this:
\<not> val b \<le> val a

goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> val b \<le> val a
[PROOF STEP]
have F2: "ord a < ord b"
[PROOF STATE]
proof (prove)
using this:
\<not> val b \<le> val a

goal (1 subgoal):
 1. ord a < ord b
[PROOF STEP]
using F0 F1 assms
[PROOF STATE]
proof (prove)
using this:
\<not> val b \<le> val a
b \<in> nonzero Q\<^sub>p
a \<in> nonzero Q\<^sub>p
a \<in> carrier Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. ord a < ord b
[PROOF STEP]
by (metis False \<open>b \<noteq> \<zero>\<close> eint_ord_simps(1) leI val_def)
[PROOF STATE]
proof (state)
this:
ord a < ord b

goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
have 0: "ord ((\<pp>[^](3::nat))\<otimes> (a[^](4::nat))) = 3 + 4* ord a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
using F0 ord_mult F1 Qp_nat_pow_nonzero nonzero_nat_pow_ord ord_p_pow_nat p_natpow_closed(2)
[PROOF STATE]
proof (prove)
using this:
b \<in> nonzero Q\<^sub>p
\<lbrakk>?x \<in> nonzero Q\<^sub>p; ?y \<in> nonzero Q\<^sub>p\<rbrakk> \<Longrightarrow> ord (?x \<otimes> ?y) = ord ?x + ord ?y
a \<in> nonzero Q\<^sub>p
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ord (?a [^] ?n) = int ?n * ord ?a
ord (\<pp> [^] ?n) = int ?n
\<pp> [^] ?n \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a

goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
have 1: " ord (b[^](4::nat)) = 4* ord b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (b [^] 4) = 4 * ord b
[PROOF STEP]
using F0 nonzero_nat_pow_ord
[PROOF STATE]
proof (prove)
using this:
b \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ord (?a [^] ?n) = int ?n * ord ?a

goal (1 subgoal):
 1. ord (b [^] 4) = 4 * ord b
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ord (b [^] 4) = 4 * ord b

goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
have 2: "(4 * (ord b)) > 4 * (ord a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * ord a < 4 * ord b
[PROOF STEP]
using F2
[PROOF STATE]
proof (prove)
using this:
ord a < ord b

goal (1 subgoal):
 1. 4 * ord a < 4 * ord b
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
4 * ord a < 4 * ord b

goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
have 3: "(4 * (ord b)) \<le> 3 + 4* ord a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * ord b \<le> 3 + 4 * ord a
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 4 * ord b \<le> 3 + 4 * ord a \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (4 * (ord b)) \<le> 3 + 4* ord a"
[PROOF STATE]
proof (state)
this:
\<not> 4 * ord b \<le> 3 + 4 * ord a

goal (1 subgoal):
 1. \<not> 4 * ord b \<le> 3 + 4 * ord a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 4 * ord b \<le> 3 + 4 * ord a
[PROOF STEP]
have "(4 * (ord b)) > 3 + 4* ord a"
[PROOF STATE]
proof (prove)
using this:
\<not> 4 * ord b \<le> 3 + 4 * ord a

goal (1 subgoal):
 1. 3 + 4 * ord a < 4 * ord b
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
3 + 4 * ord a < 4 * ord b

goal (1 subgoal):
 1. \<not> 4 * ord b \<le> 3 + 4 * ord a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 + 4 * ord a < 4 * ord b
[PROOF STEP]
have 30: "ord ((b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat))) = 3 + 4* ord a"
[PROOF STATE]
proof (prove)
using this:
3 + 4 * ord a < 4 * ord b

goal (1 subgoal):
 1. ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
using "0" "1" F0 F1  Qp_nat_pow_nonzero Qp.nat_pow_closed assms(1) monom_term_car not_nonzero_Qp ord_ultrametric_noteq
                p_natpow_closed(1) p_nonzero
[PROOF STATE]
proof (prove)
using this:
3 + 4 * ord a < 4 * ord b
ord (\<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
ord (b [^] 4) = 4 * ord b
b \<in> nonzero Q\<^sub>p
a \<in> nonzero Q\<^sub>p
?x \<in> nonzero Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> nonzero Q\<^sub>p
?x \<in> carrier Q\<^sub>p \<Longrightarrow> ?x [^] ?n \<in> carrier Q\<^sub>p
a \<in> carrier Q\<^sub>p
\<lbrakk>?c \<in> carrier Q\<^sub>p; ?x \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?c \<otimes> ?x [^] ?n \<in> carrier Q\<^sub>p
\<lbrakk>?x \<in> carrier ?Q\<^sub>p; ?x \<notin> nonzero ?Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x = \<zero>\<^bsub>?Q\<^sub>p\<^esub>
\<lbrakk>?x \<in> nonzero Q\<^sub>p; ?y \<in> nonzero Q\<^sub>p; ord ?y < ord ?x\<rbrakk> \<Longrightarrow> ord (?x \<oplus> ?y) = ord ?y
\<pp> [^] ?n \<in> carrier Q\<^sub>p
\<pp> \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a
[PROOF STEP]
by (metis Qp.integral)
[PROOF STATE]
proof (state)
this:
ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a

goal (1 subgoal):
 1. \<not> 4 * ord b \<le> 3 + 4 * ord a \<Longrightarrow> False
[PROOF STEP]
have "y \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> nonzero Q\<^sub>p
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
assume A: "y \<notin> nonzero Q\<^sub>p"
[PROOF STATE]
proof (state)
this:
y \<notin> nonzero Q\<^sub>p

goal (1 subgoal):
 1. y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<notin> nonzero Q\<^sub>p
[PROOF STEP]
have "y = \<zero>"
[PROOF STATE]
proof (prove)
using this:
y \<notin> nonzero Q\<^sub>p

goal (1 subgoal):
 1. y = \<zero>
[PROOF STEP]
using y_def  Qp.nonzero_memI
[PROOF STATE]
proof (prove)
using this:
y \<notin> nonzero Q\<^sub>p
y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> ?a \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. y = \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = \<zero>

goal (1 subgoal):
 1. y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = \<zero>
[PROOF STEP]
have "b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = \<zero>"
[PROOF STATE]
proof (prove)
using this:
y = \<zero>

goal (1 subgoal):
 1. b [^] (4::'a) \<oplus> \<pp> [^] (3::'b) \<otimes> a [^] (4::'c) = \<zero>
[PROOF STEP]
by (smt "0" "1" A F0 False Qp.integral Qp.nat_pow_closed Qp.nonzero_closed
                Qp.nonzero_mult_closed Qp.nonzero_pow_nonzero Qp.pow_zero assms(1) diff_ord_nonzero not_nonzero_Qp p_nonzero pos2 y_def)
[PROOF STATE]
proof (state)
this:
b [^] (4::?'a4) \<oplus> \<pp> [^] (3::?'b4) \<otimes> a [^] (4::?'c4) = \<zero>

goal (1 subgoal):
 1. y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b [^] (4::?'a4) \<oplus> \<pp> [^] (3::?'b4) \<otimes> a [^] (4::?'c4) = \<zero>
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
b [^] (4::?'a4) \<oplus> \<pp> [^] (3::?'b4) \<otimes> a [^] (4::?'c4) = \<zero>

goal (1 subgoal):
 1. False
[PROOF STEP]
by (smt "0" "1" A F0 F1 Qp.integral Qp.nat_pow_closed Qp.nonzero_mult_closed
                Qp_nat_pow_nonzero assms(1) diff_ord_nonzero not_nonzero_Qp p_natpow_closed(1) p_nonzero y_def)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. \<not> 4 * ord b \<le> 3 + 4 * ord a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> nonzero Q\<^sub>p
[PROOF STEP]
have 31: "ord ((b[^](4::nat)) \<oplus>\<^bsub>Q\<^sub>p\<^esub> (\<pp>[^](3::nat))\<otimes> (a[^](4::nat))) = 2* ord y"
[PROOF STATE]
proof (prove)
using this:
y \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
using nonzero_nat_pow_ord y_def
[PROOF STATE]
proof (prove)
using this:
y \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ord (?a [^] ?n) = int ?n * ord ?a
y \<in> carrier Q\<^sub>p \<and> b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2

goal (1 subgoal):
 1. ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y

goal (1 subgoal):
 1. \<not> 4 * ord b \<le> 3 + 4 * ord a \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y

goal (1 subgoal):
 1. False
[PROOF STEP]
using 30
[PROOF STATE]
proof (prove)
using this:
ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 2 * ord y
ord (b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4) = 3 + 4 * ord a

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
4 * ord b \<le> 3 + 4 * ord a

goal (1 subgoal):
 1. \<not> val b \<le> val a \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using 2 3
[PROOF STATE]
proof (prove)
using this:
4 * ord a < 4 * ord b
4 * ord b \<le> 3 + 4 * ord a

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
val b \<le> val a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
val b \<le> val a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>carrier Q\<^sub>p. b [^] 4 \<oplus> \<pp> [^] 3 \<otimes> a [^] 4 = y [^] 2 \<Longrightarrow> val b \<le> val a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in fin_bipartite_graph) sum_degree_normalized_Y_density:
  "(\<Sum> y \<in> Y. degree_normalized y X) / card Y = edge_density X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>Y. degree_normalized y X) / real (card Y) = local.density
[PROOF STEP]
using bipartite_sym fin_bipartite_graph.sum_degree_normalized_X_density fin_bipartite_graph_def
    fin_graph_system_axioms edge_density_commute
[PROOF STATE]
proof (prove)
using this:
bipartite_graph V E Y X
fin_bipartite_graph ?vertices ?edges ?X ?Y \<Longrightarrow> (\<Sum>x\<in>?X. ulgraph.degree_normalized ?edges x ?Y) / real (card ?X) = ulgraph.edge_density ?edges ?X ?Y
fin_bipartite_graph ?vertices ?edges ?X ?Y \<equiv> bipartite_graph ?vertices ?edges ?X ?Y \<and> fin_graph_system ?vertices ?edges
fin_graph_system V E
edge_density ?X ?Y = edge_density ?Y ?X

goal (1 subgoal):
 1. (\<Sum>y\<in>Y. degree_normalized y X) / real (card Y) = local.density
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sup_ccINF:
  "countable B \<Longrightarrow> sup a (INF b\<in>B. f b) = (INF b\<in>B. sup a (f b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable B \<Longrightarrow> sup a (Inf (f ` B)) = (INF b\<in>B. sup a (f b))
[PROOF STEP]
by (simp only: sup_ccInf image_image countable_image)


[STATEMENT]
lemma higher_differentiable_on_open_Un: "higher_differentiable_on (S \<union> T) f n"
  if "higher_differentiable_on S f n"
    "higher_differentiable_on T f n"
    "open S" "open T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on (S \<union> T) f n
[PROOF STEP]
using higher_differentiable_on_open_Union[of "{S, T}" f n] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>s. s \<in> {S, T} \<Longrightarrow> higher_differentiable_on s f n; \<And>s. s \<in> {S, T} \<Longrightarrow> open s\<rbrakk> \<Longrightarrow> higher_differentiable_on (\<Union> {S, T}) f n
higher_differentiable_on S f n
higher_differentiable_on T f n
open S
open T

goal (1 subgoal):
 1. higher_differentiable_on (S \<union> T) f n
[PROOF STEP]
by auto


[STATEMENT]
lemma affine_no_rel_frontier:
  fixes S :: "('n::euclidean_space) set"
  assumes "affine S"
  shows "rel_frontier S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S = {}
[PROOF STEP]
unfolding rel_frontier_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure S - rel_interior S = {}
[PROOF STEP]
using assms affine_closed[of S]
  closure_closed[of S] affine_rel_open[of S] rel_open_def[of S]
[PROOF STATE]
proof (prove)
using this:
affine S
affine S \<Longrightarrow> closed S
closed S \<Longrightarrow> closure S = S
affine S \<Longrightarrow> rel_open S
rel_open S = (rel_interior S = S)

goal (1 subgoal):
 1. closure S - rel_interior S = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma unitary11_gen_div_sm:
  assumes "k \<noteq> 0" and "unitary11_gen (k *\<^sub>s\<^sub>m M)"
  shows "unitary11_gen M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary11_gen M
[PROOF STEP]
using assms unitary11_gen_mult_sm[of "1/k" "k *\<^sub>s\<^sub>m M"]
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
unitary11_gen (k *\<^sub>s\<^sub>m M)
\<lbrakk>1 / k \<noteq> 0; unitary11_gen (k *\<^sub>s\<^sub>m M)\<rbrakk> \<Longrightarrow> unitary11_gen ((1 / k) *\<^sub>s\<^sub>m (k *\<^sub>s\<^sub>m M))

goal (1 subgoal):
 1. unitary11_gen M
[PROOF STEP]
by simp


[STATEMENT]
lemma zmset_of_remove1_mset: "x \<in># M \<Longrightarrow> zmset_of (remove1_mset x M) = zmset_of M - {#x#}\<^sub>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># M \<Longrightarrow> zmset_of (remove1_mset x M) = zmset_of M - {#x#}\<^sub>z
[PROOF STEP]
by (induct M) auto


[STATEMENT]
lemma iIN_minus: "\<lbrakk> x \<in> [n\<dots>,d]; k \<le> x - n \<rbrakk> \<Longrightarrow> x - k \<in> [n\<dots>,d]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> [n\<dots>,d]; k \<le> x - n\<rbrakk> \<Longrightarrow> x - k \<in> [n\<dots>,d]
[PROOF STEP]
by (fastforce simp: iIN_iff)


[STATEMENT]
lemma eucl_of_list_map_divide_right[simp]:
  assumes [simp]: "length xs = DIM('a::executable_euclidean_space)"
  shows "(eucl_of_list (map (\<lambda>x. f x / r) xs)::'a) = eucl_of_list (map f xs) /\<^sub>R r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_of_list (map (\<lambda>x. f x / r) xs) = eucl_of_list (map f xs) /\<^sub>R r
[PROOF STEP]
by (auto intro!: euclidean_eqI[where 'a='a] simp: algebra_simps eucl_of_list_inner divide_simps)


[STATEMENT]
lemma intpow_uminus_nat: "n \<ge> 0 \<Longrightarrow> x ^\<^sub>Z -n = inverse (x ^ nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> n \<Longrightarrow> x ^\<^sub>Z - n = inverse (x ^ nat n)
[PROOF STEP]
by (simp add: intpow_def)


[STATEMENT]
lemma impl_rule:
 assumes "(\<forall>i < m.\<forall>j < n. (P i) \<and> (Q j))"
           and "\<forall> i j.(P i) \<and> (Q j) \<longrightarrow> R i j"
 shows  "(\<forall>i < m.\<forall>j < n. R i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<m. \<forall>j<n. R i j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i<m. \<forall>j<n. P i \<and> Q j
\<forall>i j. P i \<and> Q j \<longrightarrow> R i j

goal (1 subgoal):
 1. \<forall>i<m. \<forall>j<n. R i j
[PROOF STEP]
by metis


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

goal (1 subgoal):
 1. \<infinity>\<^sub>h \<in> circline_set l
[PROOF STEP]
by simp


[STATEMENT]
lemma erfc_real_gt_0 [simp, intro]: "erfc (x::real) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < erfc x
[PROOF STEP]
proof (cases "x \<ge> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> x

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
have "0 < integral {x..x+1} (\<lambda>t. exp (-(x+1)\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < integral {x..x + 1} (\<lambda>t. exp (- (x + 1)\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < integral {x..x + 1} (\<lambda>t. exp (- (x + 1)\<^sup>2))

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < integral {x..x + 1} (\<lambda>t. exp (- (x + 1)\<^sup>2))

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x
[PROOF STEP]
have "\<dots> \<le> integral {x..x+1} (\<lambda>t. exp (-t\<^sup>2))"
[PROOF STATE]
proof (prove)
using this:
0 \<le> x

goal (1 subgoal):
 1. integral {x..x + 1} (\<lambda>t. exp (- (x + 1)\<^sup>2)) \<le> integral {x..x + 1} (\<lambda>t. exp (- t\<^sup>2))
[PROOF STEP]
by (intro integral_le)
       (auto intro!: integrable_continuous_real continuous_intros power_mono)
[PROOF STATE]
proof (state)
this:
integral {x..x + 1} (\<lambda>t. exp (- (x + 1)\<^sup>2)) \<le> integral {x..x + 1} (\<lambda>t. exp (- t\<^sup>2))

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {x..x + 1} (\<lambda>t. exp (- (x + 1)\<^sup>2)) \<le> integral {x..x + 1} (\<lambda>t. exp (- t\<^sup>2))

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
have "\<dots> \<le> sqrt pi / 2 * erfc x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {x..x + 1} (\<lambda>t. exp (- t\<^sup>2)) \<le> sqrt pi / 2 * erfc x
[PROOF STEP]
by (rule has_integral_subset_le[OF _ integrable_integral has_integral_erfc])
       (auto intro!: integrable_continuous_real continuous_intros True)
[PROOF STATE]
proof (state)
this:
integral {x..x + 1} (\<lambda>t. exp (- t\<^sup>2)) \<le> sqrt pi / 2 * erfc x

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < sqrt pi / 2 * erfc x
[PROOF STEP]
have "sqrt pi / 2 * erfc x > 0"
[PROOF STATE]
proof (prove)
using this:
0 < sqrt pi / 2 * erfc x

goal (1 subgoal):
 1. 0 < sqrt pi / 2 * erfc x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < sqrt pi / 2 * erfc x

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
hence "\<dots> * (2 / sqrt pi) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < sqrt pi / 2 * erfc x

goal (1 subgoal):
 1. 0 < sqrt pi / 2 * erfc x * (2 / sqrt pi)
[PROOF STEP]
by (rule mult_pos_pos) simp_all
[PROOF STATE]
proof (state)
this:
0 < sqrt pi / 2 * erfc x * (2 / sqrt pi)

goal (2 subgoals):
 1. 0 \<le> x \<Longrightarrow> 0 < erfc x
 2. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
thus "erfc x > 0"
[PROOF STATE]
proof (prove)
using this:
0 < sqrt pi / 2 * erfc x * (2 / sqrt pi)

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

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> x

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
have "0 \<le> (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> 1

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> 1

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 \<le> x
[PROOF STEP]
have "\<dots> < erfc x"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> x

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

goal (1 subgoal):
 1. \<not> 0 \<le> x \<Longrightarrow> 0 < erfc x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < erfc x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < erfc x

goal (1 subgoal):
 1. 0 < erfc x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < erfc x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) lcos_disjoint:
  assumes "subgroup H G"
  assumes p: "a \<in> lcosets H" "b \<in> lcosets H" "a\<noteq>b"
  shows "a \<inter> b = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<inter> b = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<inter> b = {}
[PROOF STEP]
interpret subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<inter> b = {}
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
a \<in> lcosets H
b \<in> lcosets H
a \<noteq> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> lcosets H
b \<in> lcosets H
a \<noteq> b

goal (1 subgoal):
 1. a \<inter> b = {}
[PROOF STEP]
apply (simp add: LCOSETS_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x\<in>carrier G. a = x <# H; \<exists>x\<in>carrier G. b = x <# H; a \<noteq> b\<rbrakk> \<Longrightarrow> a \<inter> b = {}
[PROOF STEP]
apply (metis inf.cobounded1 inf.cobounded2 l_repr_independence subgroup_axioms subset_empty subset_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
a \<inter> b = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lebesgue_measure_ball_pos:
  "emeasure lborel (cball (0::'a::euclidean_space) 1) > 0"
  "measure lborel (cball (0::'a::euclidean_space) 1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < emeasure lborel (cball (0::'a) 1) &&& 0 < content (cball (0::'a) 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < emeasure lborel (cball (0::'a) 1)
 2. 0 < content (cball (0::'a) 1)
[PROOF STEP]
show "emeasure lborel (cball (0::'a::euclidean_space) 1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < emeasure lborel (cball (0::'a) 1)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(emeasure lborel (cball (0::'a::euclidean_space) 1) > 0)"
[PROOF STATE]
proof (state)
this:
\<not> 0 < emeasure lborel (cball (0::'a) 1)

goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < emeasure lborel (cball (0::'a) 1)
[PROOF STEP]
have "emeasure lborel (cball (0::'a) 1) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < emeasure lborel (cball (0::'a) 1)

goal (1 subgoal):
 1. emeasure lborel (cball (0::'a) 1) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
emeasure lborel (cball (0::'a) 1) = 0

goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel (cball (0::'a) 1) = 0
[PROOF STEP]
have "emeasure lborel (cball (0::'a) n) = 0" for n::nat
[PROOF STATE]
proof (prove)
using this:
emeasure lborel (cball (0::'a) 1) = 0

goal (1 subgoal):
 1. emeasure lborel (cball (0::'a) (real n)) = 0
[PROOF STEP]
using lebesgue_measure_ball(2)[of "real n" 0]
[PROOF STATE]
proof (prove)
using this:
emeasure lborel (cball (0::'a) 1) = 0
0 \<le> real n \<Longrightarrow> emeasure lborel (cball (0::?'b1) (real n)) = ennreal (real n) ^ DIM(?'b1) * emeasure lborel (cball (0::?'b1) 1)

goal (1 subgoal):
 1. emeasure lborel (cball (0::'a) (real n)) = 0
[PROOF STEP]
by (metis mult_zero_right of_nat_0_le_iff)
[PROOF STATE]
proof (state)
this:
emeasure lborel (cball (0::'a) (real ?n)) = 0

goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel (cball (0::'a) (real ?n)) = 0
[PROOF STEP]
have "emeasure lborel (\<Union>n. cball (0::'a) (real n)) = 0"
[PROOF STATE]
proof (prove)
using this:
emeasure lborel (cball (0::'a) (real ?n)) = 0

goal (1 subgoal):
 1. emeasure lborel (\<Union>n. cball (0::'a) (real n)) = 0
[PROOF STEP]
by (metis (mono_tags, lifting) borel_closed closed_cball emeasure_UN_eq_0 imageE sets_lborel subsetI)
[PROOF STATE]
proof (state)
this:
emeasure lborel (\<Union>n. cball (0::'a) (real n)) = 0

goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
emeasure lborel (\<Union>n. cball (0::'a) (real n)) = 0

goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
have "(\<Union>n. cball (0::'a) (real n)) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. cball (0::'a) (real n)) = UNIV
[PROOF STEP]
by (auto simp add: real_arch_simple)
[PROOF STATE]
proof (state)
this:
(\<Union>n. cball (0::'a) (real n)) = UNIV

goal (1 subgoal):
 1. \<not> 0 < emeasure lborel (cball (0::'a) 1) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel (\<Union>n. cball (0::'a) (real n)) = 0
(\<Union>n. cball (0::'a) (real n)) = UNIV
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
emeasure lborel (\<Union>n. cball (0::'a) (real n)) = 0
(\<Union>n. cball (0::'a) (real n)) = UNIV

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < emeasure lborel (cball (0::'a) 1)

goal (1 subgoal):
 1. 0 < content (cball (0::'a) 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < emeasure lborel (cball (0::'a) 1)

goal (1 subgoal):
 1. 0 < content (cball (0::'a) 1)
[PROOF STEP]
have "emeasure lborel (cball (0::'a::euclidean_space) 1) < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel (cball (0::'a) 1) < \<infinity>
[PROOF STEP]
by (rule emeasure_bounded_finite, auto)
[PROOF STATE]
proof (state)
this:
emeasure lborel (cball (0::'a) 1) < \<infinity>

goal (1 subgoal):
 1. 0 < content (cball (0::'a) 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < emeasure lborel (cball (0::'a) 1)
emeasure lborel (cball (0::'a) 1) < \<infinity>
[PROOF STEP]
show "measure lborel (cball (0::'a::euclidean_space) 1) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < emeasure lborel (cball (0::'a) 1)
emeasure lborel (cball (0::'a) 1) < \<infinity>

goal (1 subgoal):
 1. 0 < content (cball (0::'a) 1)
[PROOF STEP]
by (metis borel_closed closed_cball ennreal_0 has_integral_iff_emeasure_lborel has_integral_measure_lborel less_irrefl order_refl zero_less_measure_iff)
[PROOF STATE]
proof (state)
this:
0 < content (cball (0::'a) 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_weighted_gauss_Ico_div2:
  fixes f :: "nat \<Rightarrow> nat"
  assumes "\<And>i j. i \<le> j \<Longrightarrow> j < n \<Longrightarrow> f i \<ge> f j"
  shows "(\<Sum>i=0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
 2. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
 2. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n = Suc n

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i \<le> ?j; ?j < n\<rbrakk> \<Longrightarrow> f ?j \<le> f ?i
n = Suc n
[PROOF STEP]
have "Suc n * (\<Sum>i=0..<Suc n. Suc i * f i) \<le> (\<Sum>i=0..<Suc n. Suc i) * sum f {0..<Suc n}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> ?j; ?j < n\<rbrakk> \<Longrightarrow> f ?j \<le> f ?i
n = Suc n

goal (1 subgoal):
 1. Suc n * (\<Sum>i = 0..<Suc n. Suc i * f i) \<le> sum Suc {0..<Suc n} * sum f {0..<Suc n}
[PROOF STEP]
by (intro Chebyshev_sum_upper_nat [of "Suc n" Suc f]) auto
[PROOF STATE]
proof (state)
this:
Suc n * (\<Sum>i = 0..<Suc n. Suc i * f i) \<le> sum Suc {0..<Suc n} * sum f {0..<Suc n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc n * (\<Sum>i = 0..<Suc n. Suc i * f i) \<le> sum Suc {0..<Suc n} * sum f {0..<Suc n}
[PROOF STEP]
have "Suc n * (2 * (\<Sum>i=0..n. Suc i * f i)) \<le> 2 * (\<Sum>i=0..n. Suc i) * sum f {0..n}"
[PROOF STATE]
proof (prove)
using this:
Suc n * (\<Sum>i = 0..<Suc n. Suc i * f i) \<le> sum Suc {0..<Suc n} * sum f {0..<Suc n}

goal (1 subgoal):
 1. Suc n * (2 * (\<Sum>i = 0..n. Suc i * f i)) \<le> 2 * sum Suc {0..n} * sum f {0..n}
[PROOF STEP]
by (simp add: atLeastLessThanSuc_atLeastAtMost)
[PROOF STATE]
proof (state)
this:
Suc n * (2 * (\<Sum>i = 0..n. Suc i * f i)) \<le> 2 * sum Suc {0..n} * sum f {0..n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc n * (2 * (\<Sum>i = 0..n. Suc i * f i)) \<le> 2 * sum Suc {0..n} * sum f {0..n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
have "2 * (\<Sum>i=0..n. Suc i) = Suc n * (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * sum Suc {0..n} = Suc n * (n + 2)
[PROOF STEP]
using arith_series_nat [of 1 1 n]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..n. 1 + i * 1) = Suc n * (2 * 1 + n * 1) div 2

goal (1 subgoal):
 1. 2 * sum Suc {0..n} = Suc n * (n + 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * sum Suc {0..n} = Suc n * (n + 2)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc n * (2 * (\<Sum>i = 0..n. Suc i * f i)) \<le> Suc n * (n + 2) * sum f {0..n}
[PROOF STEP]
have "2 * (\<Sum>i=0..n. Suc i * f i) \<le> (n + 2) * sum f {0..n}"
[PROOF STATE]
proof (prove)
using this:
Suc n * (2 * (\<Sum>i = 0..n. Suc i * f i)) \<le> Suc n * (n + 2) * sum f {0..n}

goal (1 subgoal):
 1. 2 * (\<Sum>i = 0..n. Suc i * f i) \<le> (n + 2) * sum f {0..n}
[PROOF STEP]
by (simp only: ac_simps Suc_mult_le_cancel1)
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>i = 0..n. Suc i * f i) \<le> (n + 2) * sum f {0..n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
n = Suc n
2 * (\<Sum>i = 0..n. Suc i * f i) \<le> (n + 2) * sum f {0..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc n
2 * (\<Sum>i = 0..n. Suc i * f i) \<le> (n + 2) * sum f {0..n}

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2
[PROOF STEP]
by (simp only: atLeastLessThanSuc_atLeastAtMost) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. (i + 1) * f i) \<le> (n + 1) * sum f {0..<n} div 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma min_eventually_eq:
  "eventually (\<lambda>x. f x = (g x :: real)) at_top \<Longrightarrow> eventually (\<lambda>x. min (f x) (g x) = f x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x = g x \<Longrightarrow> \<forall>\<^sub>F x in at_top. min (f x) (g x) = f x
[PROOF STEP]
by (erule eventually_mono) simp


[STATEMENT]
lemma hom_deg_set_closed_minus:
  assumes "\<And>a1 a2. a1 \<in> A \<Longrightarrow> a2 \<in> A \<Longrightarrow> a1 - a2 \<in> A"
    and "p \<in> hom_deg_set z A" and "q \<in> hom_deg_set z A"
  shows "p - q \<in> hom_deg_set z A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
p \<in> hom_deg_set z A
[PROOF STEP]
obtain a1 where "a1 \<in> A" and p: "p = hom_component a1 z"
[PROOF STATE]
proof (prove)
using this:
p \<in> hom_deg_set z A

goal (1 subgoal):
 1. (\<And>a1. \<lbrakk>a1 \<in> A; p = hom_component a1 z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding hom_deg_set_def
[PROOF STATE]
proof (prove)
using this:
p \<in> (\<lambda>a. hom_component a z) ` A

goal (1 subgoal):
 1. (\<And>a1. \<lbrakk>a1 \<in> A; p = hom_component a1 z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a1 \<in> A
p = hom_component a1 z

goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
q \<in> hom_deg_set z A
[PROOF STEP]
obtain a2 where "a2 \<in> A" and q: "q = hom_component a2 z"
[PROOF STATE]
proof (prove)
using this:
q \<in> hom_deg_set z A

goal (1 subgoal):
 1. (\<And>a2. \<lbrakk>a2 \<in> A; q = hom_component a2 z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding hom_deg_set_def
[PROOF STATE]
proof (prove)
using this:
q \<in> (\<lambda>a. hom_component a z) ` A

goal (1 subgoal):
 1. (\<And>a2. \<lbrakk>a2 \<in> A; q = hom_component a2 z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a2 \<in> A
q = hom_component a2 z

goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
from \<open>a1 \<in> A\<close> this(1)
[PROOF STATE]
proof (chain)
picking this:
a1 \<in> A
a2 \<in> A
[PROOF STEP]
have "a1 - a2 \<in> A"
[PROOF STATE]
proof (prove)
using this:
a1 \<in> A
a2 \<in> A

goal (1 subgoal):
 1. a1 - a2 \<in> A
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
this:
a1 - a2 \<in> A

goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a1 - a2 \<in> A

goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
have "p - q = hom_component (a1 - a2) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p - q = hom_component (a1 - a2) z
[PROOF STEP]
by (simp only: p q hom_component_minus)
[PROOF STATE]
proof (state)
this:
p - q = hom_component (a1 - a2) z

goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a1 - a2 \<in> A
p - q = hom_component (a1 - a2) z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a1 - a2 \<in> A
p - q = hom_component (a1 - a2) z

goal (1 subgoal):
 1. p - q \<in> hom_deg_set z A
[PROOF STEP]
unfolding hom_deg_set_def
[PROOF STATE]
proof (prove)
using this:
a1 - a2 \<in> A
p - q = hom_component (a1 - a2) z

goal (1 subgoal):
 1. p - q \<in> (\<lambda>a. hom_component a z) ` A
[PROOF STEP]
by (rule rev_image_eqI)
[PROOF STATE]
proof (state)
this:
p - q \<in> hom_deg_set z A

goal:
No subgoals!
[PROOF STEP]
qed