[STATEMENT]
theorem two_squares :
  assumes a: "is_prime p"
      and b: "p mod 4 = 1"
    shows "\<exists>n m. p = n\<^sup>2 + m\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
let ?S  =  "{(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> u > 0 \<and> v > 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
let ?T  =  "?S \<inter> {(u, v, w). w > 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
let ?U  =  "?S \<inter> {(u, v, w). u - v + w > 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
let ?f  =  "\<lambda>(u, v, w). (v, u, -w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
let ?g  =  "\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
let ?h  =  "\<lambda>(u, v, w). (v, u, w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have w_neq0 : "\<forall>u v w. (u, v, w) \<in> ?S \<longrightarrow> w \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> w \<noteq> 0
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>int p = 4 * u * v; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix u v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>int p = 4 * u * v; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "int p = 4 * u * v"
[PROOF STATE]
proof (state)
this:
int p = 4 * u * v

goal (1 subgoal):
 1. \<And>u v. \<lbrakk>int p = 4 * u * v; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "4 dvd int p"
[PROOF STATE]
proof (prove)
using this:
int p = 4 * u * v

goal (1 subgoal):
 1. 4 dvd int p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
4 dvd int p

goal (1 subgoal):
 1. \<And>u v. \<lbrakk>int p = 4 * u * v; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "4 dvd p"
[PROOF STATE]
proof (prove)
using this:
4 dvd int p

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

goal (1 subgoal):
 1. \<And>u v. \<lbrakk>int p = 4 * u * v; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with b
[PROOF STATE]
proof (chain)
picking this:
p mod 4 = 1
4 dvd p
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p mod 4 = 1
4 dvd p

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:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> w \<noteq> 0

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have fin_S : "finite ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
have uv_comm : "\<forall>u v w. (u, v, w) \<in> ?S \<longrightarrow> (v, u, w) \<in> ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (v, u, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (v, u, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
have bound1 : "\<forall>u v w. (u, v, w) \<in> ?S \<longrightarrow> u \<le> (int p - 1) div 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> u \<le> (int p - 1) div 4
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
fix u v w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
assume 1: "int p = 4 * u * v + w\<^sup>2" and 2: "(0::int) < v" and 3: "(0::int) < u"
[PROOF STATE]
proof (state)
this:
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
with 2 and 3
[PROOF STATE]
proof (chain)
picking this:
0 < v
0 < u
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u
[PROOF STEP]
have 4: "4 * u \<le> 4 * u * v"
[PROOF STATE]
proof (prove)
using this:
0 < v
0 < u
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u

goal (1 subgoal):
 1. 4 * u \<le> 4 * u * v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
4 * u \<le> 4 * u * v

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
have "w \<noteq> (0::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<noteq> 0
[PROOF STEP]
using 1 2 3 w_neq0
[PROOF STATE]
proof (prove)
using this:
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> w \<noteq> 0

goal (1 subgoal):
 1. w \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w \<noteq> 0

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
hence "1 \<le> w\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
w \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> w\<^sup>2
[PROOF STEP]
by (metis add_0 linorder_not_le power2_less_eq_zero_iff zless_imp_add1_zle)
[PROOF STATE]
proof (state)
this:
1 \<le> w\<^sup>2

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
with 4
[PROOF STATE]
proof (chain)
picking this:
4 * u \<le> 4 * u * v
1 \<le> w\<^sup>2
[PROOF STEP]
have 5: "4 * u \<le> 4 * u * v + w\<^sup>2 - 1"
[PROOF STATE]
proof (prove)
using this:
4 * u \<le> 4 * u * v
1 \<le> w\<^sup>2

goal (1 subgoal):
 1. 4 * u \<le> 4 * u * v + w\<^sup>2 - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
4 * u \<le> 4 * u * v + w\<^sup>2 - 1

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
note zdiv_mono1[OF 5, where b="4::int", simplified]
[PROOF STATE]
proof (state)
this:
u \<le> (4 * u * v + w\<^sup>2 - 1) div 4

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
thus "u \<le> (4 * u * v + w\<^sup>2 - 1) div 4"
[PROOF STATE]
proof (prove)
using this:
u \<le> (4 * u * v + w\<^sup>2 - 1) div 4

goal (1 subgoal):
 1. u \<le> (4 * u * v + w\<^sup>2 - 1) div 4
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
u \<le> (4 * u * v + w\<^sup>2 - 1) div 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> u \<le> (int p - 1) div 4

goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
have bound2 : "\<forall>u v w. (u, v, w) \<in> ?S \<longrightarrow> v \<le> (int p - 1) div 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> v \<le> (int p - 1) div 4
[PROOF STEP]
using bound1 uv_comm
[PROOF STATE]
proof (prove)
using this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> u \<le> (int p - 1) div 4
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (v, u, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> v \<le> (int p - 1) div 4
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> v \<le> (int p - 1) div 4

goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
have bound3 : "\<forall>u v w. (u, v, w) \<in> ?S \<longrightarrow> \<bar>w\<bar> \<le> int p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> \<bar>w\<bar> \<le> int p
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
fix u v w::int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
have 1: "\<bar>w\<bar> \<le> w\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>w\<bar> \<le> w\<^sup>2
[PROOF STEP]
by(rule sqr_geq_abs)
[PROOF STATE]
proof (state)
this:
\<bar>w\<bar> \<le> w\<^sup>2

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
assume "(0::int) < u" and "(0::int) < v"
[PROOF STATE]
proof (state)
this:
0 < u
0 < v

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
hence "0 < u * v"
[PROOF STATE]
proof (prove)
using this:
0 < u
0 < v

goal (1 subgoal):
 1. 0 < u * v
[PROOF STEP]
by(rule mult_pos_pos)
[PROOF STATE]
proof (state)
this:
0 < u * v

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
hence "0 \<le> u * v"
[PROOF STATE]
proof (prove)
using this:
0 < u * v

goal (1 subgoal):
 1. 0 \<le> u * v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> u * v

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
hence "w\<^sup>2 \<le> 4 * u * v + w\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
0 \<le> u * v

goal (1 subgoal):
 1. w\<^sup>2 \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w\<^sup>2 \<le> 4 * u * v + w\<^sup>2

goal (1 subgoal):
 1. \<And>u v w. \<lbrakk>int p = 4 * u * v + w\<^sup>2; 0 < u; 0 < v\<rbrakk> \<Longrightarrow> \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
\<bar>w\<bar> \<le> w\<^sup>2
w\<^sup>2 \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
show "\<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<bar>w\<bar> \<le> w\<^sup>2
w\<^sup>2 \<le> 4 * u * v + w\<^sup>2

goal (1 subgoal):
 1. \<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>w\<bar> \<le> 4 * u * v + w\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> \<bar>w\<bar> \<le> int p

goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
let ?prod = "{1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
have prod: "\<forall>u v w. (u, v, w) \<in> ?S \<longrightarrow> (u, v, w) \<in> ?prod"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
proof(intro allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
fix u v w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
show "(u, v, w) \<in> ?S \<longrightarrow> (u, v, w) \<in> ?prod"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
proof(rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<Longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
assume 1: "(u, v, w) \<in> ?S"
[PROOF STATE]
proof (state)
this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<Longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
note bound1[rule_format, OF 1] and
             bound2[rule_format, OF 1]
[PROOF STATE]
proof (state)
this:
u \<le> (int p - 1) div 4
v \<le> (int p - 1) div 4

goal (1 subgoal):
 1. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<Longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
u \<le> (int p - 1) div 4
v \<le> (int p - 1) div 4
[PROOF STEP]
show "(u, v, w) \<in> ?prod"
[PROOF STATE]
proof (prove)
using this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
u \<le> (int p - 1) div 4
v \<le> (int p - 1) div 4

goal (1 subgoal):
 1. (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
proof simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v; u \<le> (4 * u * v + w\<^sup>2 - 1) div 4; v \<le> (4 * u * v + w\<^sup>2 - 1) div 4\<rbrakk> \<Longrightarrow> - (4 * u * v) - w\<^sup>2 \<le> w \<and> w \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
have "\<bar>w\<bar> \<le> int p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>w\<bar> \<le> int p
[PROOF STEP]
by(rule bound3[rule_format, OF 1])
[PROOF STATE]
proof (state)
this:
\<bar>w\<bar> \<le> int p

goal (1 subgoal):
 1. \<lbrakk>int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v; u \<le> (4 * u * v + w\<^sup>2 - 1) div 4; v \<le> (4 * u * v + w\<^sup>2 - 1) div 4\<rbrakk> \<Longrightarrow> - (4 * u * v) - w\<^sup>2 \<le> w \<and> w \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
hence "w \<le> int p \<and> -w \<le> int p"
[PROOF STATE]
proof (prove)
using this:
\<bar>w\<bar> \<le> int p

goal (1 subgoal):
 1. w \<le> int p \<and> - w \<le> int p
[PROOF STEP]
by(rule abs_le_iff[THEN iffD1])
[PROOF STATE]
proof (state)
this:
w \<le> int p \<and> - w \<le> int p

goal (1 subgoal):
 1. \<lbrakk>int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v; u \<le> (4 * u * v + w\<^sup>2 - 1) div 4; v \<le> (4 * u * v + w\<^sup>2 - 1) div 4\<rbrakk> \<Longrightarrow> - (4 * u * v) - w\<^sup>2 \<le> w \<and> w \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
w \<le> int p \<and> - w \<le> int p
[PROOF STEP]
show "- (4 * u * v) - w\<^sup>2 \<le> w \<and> w \<le> 4 * u * v + w\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
w \<le> int p \<and> - w \<le> int p

goal (1 subgoal):
 1. - (4 * u * v) - w\<^sup>2 \<le> w \<and> w \<le> 4 * u * v + w\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- (4 * u * v) - w\<^sup>2 \<le> w \<and> w \<le> 4 * u * v + w\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}

goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
proof(rule_tac B="?prod" in finite_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<subseteq> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
 2. finite ({1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p})
[PROOF STEP]
show "?S \<subseteq> ?prod"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<subseteq> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
using prod
[PROOF STATE]
proof (prove)
using this:
\<forall>u v w. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<longrightarrow> (u, v, w) \<in> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}

goal (1 subgoal):
 1. {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<subseteq> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<subseteq> {1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p}

goal (1 subgoal):
 1. finite ({1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite ({1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p})
[PROOF STEP]
show "finite ?prod"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ({1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite ({1..(int p - 1) div 4} \<times> {1..(int p - 1) div 4} \<times> {- int p..int p})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have inv1 : "involution_on ?S ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. involution_on {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} (\<lambda>(u, v, w). (v, u, - w))
[PROOF STEP]
by(clarsimp simp: involution_on_def)
[PROOF STATE]
proof (state)
this:
involution_on {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} (\<lambda>(u, v, w). (v, u, - w))

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have inv2 : "involution_on ?U ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. involution_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))
[PROOF STEP]
by(fastforce simp: involution_on_def int_distrib power2_diff power2_eq_square)
[PROOF STATE]
proof (state)
this:
involution_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have inv3 : "involution_on ?T ?h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. involution_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))
[PROOF STEP]
by(fastforce simp: involution_on_def)
[PROOF STATE]
proof (state)
this:
involution_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have part1 : "\<forall>x\<in>?S. (x \<in> ?T) = (?f x \<notin> ?T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}. (x \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = ((case x of (u, v, w) \<Rightarrow> (v, u, - w)) \<notin> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w})
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < b) = (\<not> b < 0)
[PROOF STEP]
fix u v w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < b) = (\<not> b < 0)
[PROOF STEP]
assume 1: "int p = 4 * u * v + w\<^sup>2" and 2: "(0::int) < v" and 3: "(0::int) < u"
[PROOF STATE]
proof (state)
this:
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u

goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < b) = (\<not> b < 0)
[PROOF STEP]
have "w \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<noteq> 0
[PROOF STEP]
proof(rule w_neq0[rule_format])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (?u, ?v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
from 1 2 3
[PROOF STATE]
proof (chain)
picking this:
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u
[PROOF STEP]
show "(u, v, w) \<in> ?S"
[PROOF STATE]
proof (prove)
using this:
int p = 4 * u * v + w\<^sup>2
0 < v
0 < u

goal (1 subgoal):
 1. (u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(u, v, w) \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

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

goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < b) = (\<not> b < 0)
[PROOF STEP]
thus "(0 < w) = (\<not> w < 0)"
[PROOF STATE]
proof (prove)
using this:
w \<noteq> 0

goal (1 subgoal):
 1. (0 < w) = (\<not> w < 0)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(0 < w) = (\<not> w < 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}. (x \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = ((case x of (u, v, w) \<Rightarrow> (v, u, - w)) \<notin> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w})

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have part2 : "\<forall>x\<in>?S. (x \<in> ?U) = (?f x \<notin> ?U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}. (x \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) = ((case x of (u, v, w) \<Rightarrow> (v, u, - w)) \<notin> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < a - aa + b) = (\<not> b < aa - a)
[PROOF STEP]
fix u v w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < a - aa + b) = (\<not> b < aa - a)
[PROOF STEP]
assume 1: "int p = 4 * u * v + w\<^sup>2" and 2: "u > 0" and 3: "v > 0"
[PROOF STATE]
proof (state)
this:
int p = 4 * u * v + w\<^sup>2
0 < u
0 < v

goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>int p = 4 * a * aa + b\<^sup>2; 0 < a; 0 < aa\<rbrakk> \<Longrightarrow> (0 < a - aa + b) = (\<not> b < aa - a)
[PROOF STEP]
show "(0 < u - v + w) = (\<not> w < v - u)" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < u - v + w) = (\<not> w < v - u)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < u - v + w \<Longrightarrow> \<not> w < v - u
 2. \<not> w < v - u \<Longrightarrow> 0 < u - v + w
[PROOF STEP]
assume ?L
[PROOF STATE]
proof (state)
this:
0 < u - v + w

goal (2 subgoals):
 1. 0 < u - v + w \<Longrightarrow> \<not> w < v - u
 2. \<not> w < v - u \<Longrightarrow> 0 < u - v + w
[PROOF STEP]
with 2 and 3
[PROOF STATE]
proof (chain)
picking this:
0 < u
0 < v
0 < u - v + w
[PROOF STEP]
show ?R
[PROOF STATE]
proof (prove)
using this:
0 < u
0 < v
0 < u - v + w

goal (1 subgoal):
 1. \<not> w < v - u
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<not> w < v - u

goal (1 subgoal):
 1. \<not> w < v - u \<Longrightarrow> 0 < u - v + w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> w < v - u \<Longrightarrow> 0 < u - v + w
[PROOF STEP]
assume ?R
[PROOF STATE]
proof (state)
this:
\<not> w < v - u

goal (1 subgoal):
 1. \<not> w < v - u \<Longrightarrow> 0 < u - v + w
[PROOF STEP]
hence 4: "v - u \<le> w"
[PROOF STATE]
proof (prove)
using this:
\<not> w < v - u

goal (1 subgoal):
 1. v - u \<le> w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v - u \<le> w

goal (1 subgoal):
 1. \<not> w < v - u \<Longrightarrow> 0 < u - v + w
[PROOF STEP]
show ?L
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < u - v + w
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < u - v + w \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?L"
[PROOF STATE]
proof (state)
this:
\<not> 0 < u - v + w

goal (1 subgoal):
 1. \<not> 0 < u - v + w \<Longrightarrow> False
[PROOF STEP]
with 4
[PROOF STATE]
proof (chain)
picking this:
v - u \<le> w
\<not> 0 < u - v + w
[PROOF STEP]
have "w = v - u"
[PROOF STATE]
proof (prove)
using this:
v - u \<le> w
\<not> 0 < u - v + w

goal (1 subgoal):
 1. w = v - u
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
w = v - u

goal (1 subgoal):
 1. \<not> 0 < u - v + w \<Longrightarrow> False
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
int p = 4 * u * v + w\<^sup>2
w = v - u
[PROOF STEP]
have "int p = 4 * u * v + (v - u)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
int p = 4 * u * v + w\<^sup>2
w = v - u

goal (1 subgoal):
 1. int p = 4 * u * v + (v - u)\<^sup>2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
int p = 4 * u * v + (v - u)\<^sup>2

goal (1 subgoal):
 1. \<not> 0 < u - v + w \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int p = 4 * u * v + (v - u)\<^sup>2
[PROOF STEP]
have sqr : "int p = (v + u)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
int p = 4 * u * v + (v - u)\<^sup>2

goal (1 subgoal):
 1. int p = (v + u)\<^sup>2
[PROOF STEP]
by(simp add: power2_diff power2_sum)
[PROOF STATE]
proof (state)
this:
int p = (v + u)\<^sup>2

goal (1 subgoal):
 1. \<not> 0 < u - v + w \<Longrightarrow> False
[PROOF STEP]
with int_prime_not_sqr[OF a]
[PROOF STATE]
proof (chain)
picking this:
int p \<noteq> ?n\<^sup>2
int p = (v + u)\<^sup>2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
int p \<noteq> ?n\<^sup>2
int p = (v + u)\<^sup>2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < u - v + w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(0 < u - v + w) = (\<not> w < v - u)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}. (x \<in> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) = ((case x of (u, v, w) \<Rightarrow> (v, u, - w)) \<notin> {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have card_eq : "card ?T = card ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})
[PROOF STEP]
have 1: "2*card ?T = card ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
by (smt (verit, ccfv_SIG) Int_iff fin_S inv1 involution_sub_card part1 subsetI)
[PROOF STATE]
proof (state)
this:
2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})
[PROOF STEP]
have "2*card ?U = card ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
by (smt (verit, ccfv_SIG) Int_iff fin_S inv1 involution_sub_card part2 subsetI)
[PROOF STATE]
proof (state)
this:
2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
2 * card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) = card {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}

goal (1 subgoal):
 1. card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w})

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have fixp: "fixpoints_on ?U ?g = {((int p - 1) div 4, 1, 1)}" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)) = {((int p - 1) div 4, 1, 1)}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)) \<subseteq> {((int p - 1) div 4, 1, 1)}
 2. {((int p - 1) div 4, 1, 1)} \<subseteq> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))
[PROOF STEP]
show "?L \<subseteq> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)) \<subseteq> {((int p - 1) div 4, 1, 1)}
[PROOF STEP]
proof(clarsimp simp: fixpoints_on_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>int p = 4 * a * b + b\<^sup>2; 0 < a; 0 < b\<rbrakk> \<Longrightarrow> a = (4 * a * b + b\<^sup>2 - 1) div 4 \<and> b = 1
[PROOF STEP]
fix u v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>int p = 4 * a * b + b\<^sup>2; 0 < a; 0 < b\<rbrakk> \<Longrightarrow> a = (4 * a * b + b\<^sup>2 - 1) div 4 \<and> b = 1
[PROOF STEP]
assume 1: "int p = 4 * u * v + v\<^sup>2" and 2: "0 < u" and 3: "0 < v"
[PROOF STATE]
proof (state)
this:
int p = 4 * u * v + v\<^sup>2
0 < u
0 < v

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>int p = 4 * a * b + b\<^sup>2; 0 < a; 0 < b\<rbrakk> \<Longrightarrow> a = (4 * a * b + b\<^sup>2 - 1) div 4 \<and> b = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int p = 4 * u * v + v\<^sup>2
0 < u
0 < v
[PROOF STEP]
have 4: "int p = v * (4 * u + v)"
[PROOF STATE]
proof (prove)
using this:
int p = 4 * u * v + v\<^sup>2
0 < u
0 < v

goal (1 subgoal):
 1. int p = v * (4 * u + v)
[PROOF STEP]
by(simp add: power2_eq_square int_distrib)
[PROOF STATE]
proof (state)
this:
int p = v * (4 * u + v)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>int p = 4 * a * b + b\<^sup>2; 0 < a; 0 < b\<rbrakk> \<Longrightarrow> a = (4 * a * b + b\<^sup>2 - 1) div 4 \<and> b = 1
[PROOF STEP]
have 5: "p = nat v * (4 * nat u + nat v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = nat v * (4 * nat u + nat v)
[PROOF STEP]
proof(rule int_int_eq[THEN iffD1])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int p = int (nat v * (4 * nat u + nat v))
[PROOF STEP]
show "int p = int (nat v * (4 * nat u + nat v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int p = int (nat v * (4 * nat u + nat v))
[PROOF STEP]
using 2 3
[PROOF STATE]
proof (prove)
using this:
0 < u
0 < v

goal (1 subgoal):
 1. int p = int (nat v * (4 * nat u + nat v))
[PROOF STEP]
proof(simp add: 4)
[PROOF STATE]
proof (state)
goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int p = int (nat v * (4 * nat u + nat v))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p = nat v * (4 * nat u + nat v)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>int p = 4 * a * b + b\<^sup>2; 0 < a; 0 < b\<rbrakk> \<Longrightarrow> a = (4 * a * b + b\<^sup>2 - 1) div 4 \<and> b = 1
[PROOF STEP]
note prime_factors[OF a 5]
[PROOF STATE]
proof (state)
this:
nat v = 1 \<and> 4 * nat u + nat v = p \<or> nat v = p \<and> 4 * nat u + nat v = 1

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>int p = 4 * a * b + b\<^sup>2; 0 < a; 0 < b\<rbrakk> \<Longrightarrow> a = (4 * a * b + b\<^sup>2 - 1) div 4 \<and> b = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat v = 1 \<and> 4 * nat u + nat v = p \<or> nat v = p \<and> 4 * nat u + nat v = 1
[PROOF STEP]
show "u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1"
[PROOF STATE]
proof (prove)
using this:
nat v = 1 \<and> 4 * nat u + nat v = p \<or> nat v = p \<and> 4 * nat u + nat v = 1

goal (1 subgoal):
 1. u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nat v = 1 \<and> 4 * nat u + nat v = p \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
 2. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
assume "nat v = 1 \<and> 4 * nat u + nat v = p"
[PROOF STATE]
proof (state)
this:
nat v = 1 \<and> 4 * nat u + nat v = p

goal (2 subgoals):
 1. nat v = 1 \<and> 4 * nat u + nat v = p \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
 2. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
with 2 and 3
[PROOF STATE]
proof (chain)
picking this:
0 < u
0 < v
nat v = 1 \<and> 4 * nat u + nat v = p
[PROOF STEP]
have "v = 1 \<and> 4 * u + v = int p"
[PROOF STATE]
proof (prove)
using this:
0 < u
0 < v
nat v = 1 \<and> 4 * nat u + nat v = p

goal (1 subgoal):
 1. v = 1 \<and> 4 * u + v = int p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
v = 1 \<and> 4 * u + v = int p

goal (2 subgoals):
 1. nat v = 1 \<and> 4 * nat u + nat v = p \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
 2. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v = 1 \<and> 4 * u + v = int p

goal (1 subgoal):
 1. u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1

goal (1 subgoal):
 1. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
assume "nat v = p \<and> 4 * nat u + nat v = 1"
[PROOF STATE]
proof (state)
this:
nat v = p \<and> 4 * nat u + nat v = 1

goal (1 subgoal):
 1. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
with 2
[PROOF STATE]
proof (chain)
picking this:
0 < u
nat v = p \<and> 4 * nat u + nat v = 1
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
0 < u
nat v = p \<and> 4 * nat u + nat v = 1

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

goal (1 subgoal):
 1. nat v = p \<and> 4 * nat u + nat v = 1 \<Longrightarrow> u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u = (4 * u * v + v\<^sup>2 - 1) div 4 \<and> v = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)) \<subseteq> {((int p - 1) div 4, 1, 1)}

goal (1 subgoal):
 1. {((int p - 1) div 4, 1, 1)} \<subseteq> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {((int p - 1) div 4, 1, 1)} \<subseteq> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))
[PROOF STEP]
show "?R \<subseteq> ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {((int p - 1) div 4, 1, 1)} \<subseteq> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))
[PROOF STEP]
proof(clarsimp simp: fixpoints_on_def, rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. int p = 4 * ((int p - 1) div 4) + 1
 2. 0 < (int p - 1) div 4
[PROOF STEP]
show "int p = 4 * ((int p - 1) div 4) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int p = 4 * ((int p - 1) div 4) + 1
[PROOF STEP]
proof(subst dvd_mult_div_cancel)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 4 dvd int p - 1
 2. int p = int p - 1 + 1
[PROOF STEP]
show "4 dvd int p - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 dvd int p - 1
[PROOF STEP]
proof(subst mod_eq_dvd_iff[THEN sym])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int p mod 4 = 1 mod 4
[PROOF STEP]
show "int p mod 4 = 1 mod 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int p mod 4 = 1 mod 4
[PROOF STEP]
by(simp add: nat_mod_int[OF b, simplified])
[PROOF STATE]
proof (state)
this:
int p mod 4 = 1 mod 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
4 dvd int p - 1

goal (1 subgoal):
 1. int p = int p - 1 + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int p = int p - 1 + 1
[PROOF STEP]
show "int p = int p - 1 + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int p = int p - 1 + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int p = int p - 1 + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int p = 4 * ((int p - 1) div 4) + 1

goal (1 subgoal):
 1. 0 < (int p - 1) div 4
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < (int p - 1) div 4
[PROOF STEP]
show "0 < (int p - 1) div 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (int p - 1) div 4
[PROOF STEP]
using a b prime_gr4
[PROOF STATE]
proof (prove)
using this:
is_prime p
p mod 4 = 1
\<lbrakk>is_prime ?p; ?p mod 4 = 1\<rbrakk> \<Longrightarrow> 4 < ?p

goal (1 subgoal):
 1. 0 < (int p - 1) div 4
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < (int p - 1) div 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{((int p - 1) div 4, 1, 1)} \<subseteq> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)) = {((int p - 1) div 4, 1, 1)}

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have cardS1 : "odd(card ?T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))
[PROOF STEP]
proof(subst card_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}))
[PROOF STEP]
show "odd(card ?U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}))
[PROOF STEP]
using add_diff_cancel_right' fin_S fixp inv2 involution_dom_fixpoints_parity
[PROOF STATE]
proof (prove)
using this:
?a + ?b - ?b = ?a
finite {(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v}
fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w)) = {((int p - 1) div 4, 1, 1)}
involution_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}) (\<lambda>(u, v, w). (u - v + w, v, 2 * v - w))
\<lbrakk>involution_on ?A ?\<phi>; finite ?A\<rbrakk> \<Longrightarrow> odd (card ?A) = odd (card (fixpoints_on ?A ?\<phi>))

goal (1 subgoal):
 1. odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < u - v + w}))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
have fixp_ex : "\<exists>x. x \<in> fixpoints_on ?T ?h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))

goal (1 subgoal):
 1. \<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) \<Longrightarrow> False
[PROOF STEP]
hence 1: "fixpoints_on ?T ?h = {}"
[PROOF STATE]
proof (prove)
using this:
\<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))

goal (1 subgoal):
 1. fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) = {}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) = {}

goal (1 subgoal):
 1. \<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) \<Longrightarrow> False
[PROOF STEP]
note involution_dom_card_sum[OF inv3, simplified 1]
[PROOF STATE]
proof (state)
this:
finite ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) \<Longrightarrow> card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card {} + 2 * card {x \<in> preimg_img_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)). card x = 2}

goal (1 subgoal):
 1. \<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) \<Longrightarrow> False
[PROOF STEP]
hence "even(card ?T)"
[PROOF STATE]
proof (prove)
using this:
finite ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) \<Longrightarrow> card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) = card {} + 2 * card {x \<in> preimg_img_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)). card x = 2}

goal (1 subgoal):
 1. even (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))
[PROOF STEP]
by (simp add: fin_S)
[PROOF STATE]
proof (state)
this:
even (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))

goal (1 subgoal):
 1. \<nexists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w)) \<Longrightarrow> False
[PROOF STEP]
with cardS1
[PROOF STATE]
proof (chain)
picking this:
odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))
even (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
odd (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))
even (card ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
note fixp_ex
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))
[PROOF STEP]
have "\<exists>u w. u > 0 \<and> w > 0 \<and> int p = 4 * u * u + w\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<in> fixpoints_on ({(u, v, w). int p = 4 * u * v + w\<^sup>2 \<and> 0 < u \<and> 0 < v} \<inter> {(u, v, w). 0 < w}) (\<lambda>(u, v, w). (v, u, w))

goal (1 subgoal):
 1. \<exists>u w. 0 < u \<and> 0 < w \<and> int p = 4 * u * u + w\<^sup>2
[PROOF STEP]
by(clarsimp simp: fixpoints_on_def, fast)
[PROOF STATE]
proof (state)
this:
\<exists>u w. 0 < u \<and> 0 < w \<and> int p = 4 * u * u + w\<^sup>2

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u w. 0 < u \<and> 0 < w \<and> int p = 4 * u * u + w\<^sup>2
[PROOF STEP]
obtain u w where c: "u > 0 \<and> w > 0 \<and> int p = (2 * u)\<^sup>2 + w\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<exists>u w. 0 < u \<and> 0 < w \<and> int p = 4 * u * u + w\<^sup>2

goal (1 subgoal):
 1. (\<And>u w. 0 < u \<and> 0 < w \<and> int p = (2 * u)\<^sup>2 + w\<^sup>2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(fastforce simp: power2_eq_square)
[PROOF STATE]
proof (state)
this:
0 < u \<and> 0 < w \<and> int p = (2 * u)\<^sup>2 + w\<^sup>2

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
hence "p = (nat(2 * u))\<^sup>2 + (nat w)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
0 < u \<and> 0 < w \<and> int p = (2 * u)\<^sup>2 + w\<^sup>2

goal (1 subgoal):
 1. p = (nat (2 * u))\<^sup>2 + (nat w)\<^sup>2
[PROOF STEP]
by (smt (verit) int_nat_eq nat_int nat_int_add of_nat_power)
[PROOF STATE]
proof (state)
this:
p = (nat (2 * u))\<^sup>2 + (nat w)\<^sup>2

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p = (nat (2 * u))\<^sup>2 + (nat w)\<^sup>2

goal (1 subgoal):
 1. \<exists>n m. p = n\<^sup>2 + m\<^sup>2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>n m. p = n\<^sup>2 + m\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Order) ord_isom_minimum:"\<lbrakk>Order E; ord_isom D E f;
S \<subseteq> carrier D; a \<in> carrier D; minimum_elem D S a\<rbrakk> \<Longrightarrow>
              minimum_elem E (f`S) (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; minimum_elem D S a\<rbrakk> \<Longrightarrow> minimum_elem E (f ` S) (f a)
[PROOF STEP]
apply (subst minimum_elem_def,
       frule minimum_elem_mem[of "S" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; minimum_elem D S a; a \<in> S\<rbrakk> \<Longrightarrow> f a \<in> f ` S \<and> Ball (f ` S) ((\<preceq>\<^bsub>E\<^esub>) (f a))
[PROOF STEP]
apply (simp add:ord_isom_mem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; minimum_elem D S a; a \<in> S\<rbrakk> \<Longrightarrow> \<forall>x\<in>S. f a \<preceq>\<^bsub>E\<^esub> f x
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; minimum_elem D S a; a \<in> S; x \<in> S\<rbrakk> \<Longrightarrow> f a \<preceq>\<^bsub>E\<^esub> f x
[PROOF STEP]
apply (simp add:minimum_elem_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; Ball S ((\<preceq>) a); a \<in> S; x \<in> S\<rbrakk> \<Longrightarrow> f a \<preceq>\<^bsub>E\<^esub> f x
[PROOF STEP]
apply (frule_tac x = x in bspec, assumption,
       thin_tac "Ball S ((\<preceq>) a)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; a \<in> S; x \<in> S; a \<preceq> x\<rbrakk> \<Longrightarrow> f a \<preceq>\<^bsub>E\<^esub> f x
[PROOF STEP]
apply (frule_tac b = x in ord_isom_le[of E f a], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; a \<in> S; x \<in> S; a \<preceq> x\<rbrakk> \<Longrightarrow> x \<in> carrier D
 2. \<And>x. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; a \<in> S; x \<in> S; a \<preceq> x; a \<preceq> x = f a \<preceq>\<^bsub>E\<^esub> f x\<rbrakk> \<Longrightarrow> f a \<preceq>\<^bsub>E\<^esub> f x
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Order E; ord_isom D E f; S \<subseteq> carrier D; a \<in> carrier D; a \<in> S; x \<in> S; a \<preceq> x; a \<preceq> x = f a \<preceq>\<^bsub>E\<^esub> f x\<rbrakk> \<Longrightarrow> f a \<preceq>\<^bsub>E\<^esub> f x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma signed_real_of_word_sum_less_eq_numeral_iff:
  \<open>signed_real_of_word v + signed_real_of_word w \<le> numeral n
    \<longleftrightarrow> sint v + sint w \<le> numeral n\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)
[PROOF STEP]
have \<open>?Q \<longleftrightarrow> real_of_int (sint v + sint w) \<le> real_of_int (numeral n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sint v + sint w \<le> numeral n) = (real_of_int (sint v + sint w) \<le> real_of_int (numeral n))
[PROOF STEP]
by (simp only: of_int_le_iff)
[PROOF STATE]
proof (state)
this:
(sint v + sint w \<le> numeral n) = (real_of_int (sint v + sint w) \<le> real_of_int (numeral n))

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sint v + sint w \<le> numeral n) = (real_of_int (sint v + sint w) \<le> real_of_int (numeral n))

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)
[PROOF STEP]
have \<open>\<dots> \<longleftrightarrow> ?P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (sint v + sint w) \<le> real_of_int (numeral n)) = (signed_real_of_word v + signed_real_of_word w \<le> numeral n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(real_of_int (sint v + sint w) \<le> real_of_int (numeral n)) = (signed_real_of_word v + signed_real_of_word w \<le> numeral n)

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(sint v + sint w \<le> numeral n) = (signed_real_of_word v + signed_real_of_word w \<le> numeral n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sint v + sint w \<le> numeral n) = (signed_real_of_word v + signed_real_of_word w \<le> numeral n)

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(signed_real_of_word v + signed_real_of_word w \<le> numeral n) = (sint v + sint w \<le> numeral n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_divide_eq_ennreal:
  fixes a b :: ennreal
  shows "b \<noteq> 0 \<Longrightarrow> b \<noteq> top \<Longrightarrow> (a * b) / b = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> 0; b \<noteq> top\<rbrakk> \<Longrightarrow> a * b / b = a
[PROOF STEP]
unfolding divide_ennreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> 0; b \<noteq> top\<rbrakk> \<Longrightarrow> a * b * inverse b = a
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b a. \<lbrakk>0 \<le> b; b \<noteq> 0; b \<noteq> top; 0 \<le> a\<rbrakk> \<Longrightarrow> a * b * inverse b = a
[PROOF STEP]
by (metis abs_ereal_ge0 divide_ereal_def ereal_divide_eq ereal_times_divide_eq top_ereal_def)


[STATEMENT]
lemma matrix_to_iarray_mat[code_unfold]:
  "matrix_to_iarray (mat k ::'a::{zero}^'n::{mod_type}^'n::{mod_type}) = mat_iarray k CARD('n::{mod_type})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (mat k) = mat_iarray k CARD('n)
[PROOF STEP]
unfolding matrix_to_iarray_def o_def vec_to_iarray_def mat_def mat_iarray_def tabulate2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. (\<chi>i j. if i = j then k else (0::'a)) $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('n)) [0..<CARD('n)]) = IArray.of_fun (\<lambda>i. IArray.of_fun (\<lambda>j. if i = j then k else (0::'a)) CARD('n)) CARD('n)
[PROOF STEP]
using from_nat_eq_imp_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mod_type_class.from_nat ?x = mod_type_class.from_nat ?xa; ?x < CARD(?'a); ?xa < CARD(?'a)\<rbrakk> \<Longrightarrow> ?x = ?xa

goal (1 subgoal):
 1. IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. (\<chi>i j. if i = j then k else (0::'a)) $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('n)) [0..<CARD('n)]) = IArray.of_fun (\<lambda>i. IArray.of_fun (\<lambda>j. if i = j then k else (0::'a)) CARD('n)) CARD('n)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma non_empty_set_has_least':
  "S \<subseteq> T \<Longrightarrow> S \<noteq> {} \<Longrightarrow> \<exists> x \<in> S. \<forall> y \<in> S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; S \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x
[PROOF STEP]
proof (rule ccontr, induction "card S" arbitrary: S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>0 = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
 2. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)

goal (2 subgoals):
 1. \<And>S. \<lbrakk>0 = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
 2. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)

goal (1 subgoal):
 1. False
[PROOF STEP]
using finite
[PROOF STATE]
proof (prove)
using this:
0 = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
finite T

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

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = card ?S; ?S \<subseteq> T; ?S \<noteq> {}; \<not> (\<exists>x\<in>?S. \<forall>y\<in>?S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
Suc n = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = card ?S; ?S \<subseteq> T; ?S \<noteq> {}; \<not> (\<exists>x\<in>?S. \<forall>y\<in>?S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
Suc n = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
[PROOF STEP]
obtain x where x: "x \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?S; ?S \<subseteq> T; ?S \<noteq> {}; \<not> (\<exists>x\<in>?S. \<forall>y\<in>?S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
Suc n = card S
S \<subseteq> T
S \<noteq> {}
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)

goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from finite Suc.prems(1)
[PROOF STATE]
proof (chain)
picking this:
finite T
S \<subseteq> T
[PROOF STEP]
have finite: "finite S"
[PROOF STATE]
proof (prove)
using this:
finite T
S \<subseteq> T

goal (1 subgoal):
 1. finite S
[PROOF STEP]
by (auto simp: finite_subset)
[PROOF STATE]
proof (state)
this:
finite S

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
let ?S = "S - {x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x S. \<lbrakk>\<And>S. \<lbrakk>x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False; Suc x = card S; S \<subseteq> T; S \<noteq> {}; \<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases "S = {x}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {x} \<Longrightarrow> False
 2. S \<noteq> {x} \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {x}

goal (2 subgoals):
 1. S = {x} \<Longrightarrow> False
 2. S \<noteq> {x} \<Longrightarrow> False
[PROOF STEP]
with Suc.prems(3)
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
S = {x}
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
S = {x}

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

goal (1 subgoal):
 1. S \<noteq> {x} \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {x} \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {x}

goal (1 subgoal):
 1. S \<noteq> {x} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {x}
[PROOF STEP]
have S: "?S \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {x}

goal (1 subgoal):
 1. S - {x} \<noteq> {}
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {x}
x \<in> S

goal (1 subgoal):
 1. S - {x} \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S - {x} \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {x} \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases "\<exists>x \<in> ?S. \<forall>y\<in>?S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
 2. \<not> (\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa) \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa)

goal (2 subgoals):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
 2. \<not> (\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa) \<Longrightarrow> False
[PROOF STEP]
have "n = card ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = card (S - {x})
[PROOF STEP]
using Suc.hyps finite
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?S; ?S \<subseteq> T; ?S \<noteq> {}; \<not> (\<exists>x\<in>?S. \<forall>y\<in>?S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)\<rbrakk> \<Longrightarrow> False
Suc n = card S
finite S

goal (1 subgoal):
 1. n = card (S - {x})
[PROOF STEP]
by (simp add: x)
[PROOF STATE]
proof (state)
this:
n = card (S - {x})

goal (2 subgoals):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
 2. \<not> (\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa) \<Longrightarrow> False
[PROOF STEP]
from Suc.hyps(1)[OF this _ S False] Suc.prems(1)
[PROOF STATE]
proof (chain)
picking this:
S - {x} \<subseteq> T \<Longrightarrow> False
S \<subseteq> T
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
S - {x} \<subseteq> T \<Longrightarrow> False
S \<subseteq> T

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

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa
[PROOF STEP]
obtain x' where x': "\<forall>y\<in>?S. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'" "x' \<in> ?S" "x \<noteq> x'"
[PROOF STATE]
proof (prove)
using this:
\<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'; x' \<in> S - {x}; x \<noteq> x'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'
x' \<in> S - {x}
x \<noteq> x'

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
from total Suc.prems(1) x'(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>T. \<forall>y\<in>T. x \<noteq> y \<longrightarrow> x \<prec> y \<or> y \<prec> x
S \<subseteq> T
x' \<in> S - {x}
[PROOF STEP]
have "\<And> y. y \<in> S \<Longrightarrow> x' \<noteq> y \<Longrightarrow> \<not> y \<prec> x' \<Longrightarrow> x' \<prec> y"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. \<forall>y\<in>T. x \<noteq> y \<longrightarrow> x \<prec> y \<or> y \<prec> x
S \<subseteq> T
x' \<in> S - {x}

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; x' \<noteq> y; \<not> y \<prec> x'\<rbrakk> \<Longrightarrow> x' \<prec> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y \<in> S; x' \<noteq> ?y; \<not> ?y \<prec> x'\<rbrakk> \<Longrightarrow> x' \<prec> ?y

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
from total Suc.prems(1) x'(1,2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>T. \<forall>y\<in>T. x \<noteq> y \<longrightarrow> x \<prec> y \<or> y \<prec> x
S \<subseteq> T
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'
x' \<in> S - {x}
[PROOF STEP]
have *: "\<forall> y \<in> ?S. x' \<noteq> y \<longrightarrow> x' \<prec> y"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. \<forall>y\<in>T. x \<noteq> y \<longrightarrow> x \<prec> y \<or> y \<prec> x
S \<subseteq> T
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'
x' \<in> S - {x}

goal (1 subgoal):
 1. \<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> x' \<prec> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> x' \<prec> y

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
from Suc.prems(3) x'(1,2)
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'
x' \<in> S - {x}
[PROOF STEP]
have **: "x \<prec> x'"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> \<not> y \<prec> x'
x' \<in> S - {x}

goal (1 subgoal):
 1. x \<prec> x'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<prec> x'

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
have "\<forall> y \<in> ?S. x \<prec> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>S - {x}. x \<prec> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> S - {x} \<Longrightarrow> x \<prec> y
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> S - {x} \<Longrightarrow> x \<prec> y
[PROOF STEP]
assume y: "y \<in> S - {x}"
[PROOF STATE]
proof (state)
this:
y \<in> S - {x}

goal (1 subgoal):
 1. \<And>y. y \<in> S - {x} \<Longrightarrow> x \<prec> y
[PROOF STEP]
show "x \<prec> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<prec> y
[PROOF STEP]
proof (cases "y = x'")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y = x' \<Longrightarrow> x \<prec> y
 2. y \<noteq> x' \<Longrightarrow> x \<prec> y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
y = x'

goal (2 subgoals):
 1. y = x' \<Longrightarrow> x \<prec> y
 2. y \<noteq> x' \<Longrightarrow> x \<prec> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = x'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = x'

goal (1 subgoal):
 1. x \<prec> y
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
y = x'
x \<prec> x'

goal (1 subgoal):
 1. x \<prec> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<prec> y

goal (1 subgoal):
 1. y \<noteq> x' \<Longrightarrow> x \<prec> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<noteq> x' \<Longrightarrow> x \<prec> y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
y \<noteq> x'

goal (1 subgoal):
 1. y \<noteq> x' \<Longrightarrow> x \<prec> y
[PROOF STEP]
with * y
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> x' \<prec> y
y \<in> S - {x}
y \<noteq> x'
[PROOF STEP]
have "x' \<prec> y"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>S - {x}. x' \<noteq> y \<longrightarrow> x' \<prec> y
y \<in> S - {x}
y \<noteq> x'

goal (1 subgoal):
 1. x' \<prec> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<prec> y

goal (1 subgoal):
 1. y \<noteq> x' \<Longrightarrow> x \<prec> y
[PROOF STEP]
with trans Suc.prems(1) ** y x'(2) x **
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>T. \<forall>y\<in>T. \<forall>z\<in>T. x \<prec> y \<longrightarrow> y \<prec> z \<longrightarrow> x \<prec> z
S \<subseteq> T
x \<prec> x'
y \<in> S - {x}
x' \<in> S - {x}
x \<in> S
x \<prec> x'
x' \<prec> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>T. \<forall>y\<in>T. \<forall>z\<in>T. x \<prec> y \<longrightarrow> y \<prec> z \<longrightarrow> x \<prec> z
S \<subseteq> T
x \<prec> x'
y \<in> S - {x}
x' \<in> S - {x}
x \<in> S
x \<prec> x'
x' \<prec> y

goal (1 subgoal):
 1. x \<prec> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<prec> y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>S - {x}. x \<prec> y

goal (1 subgoal):
 1. \<exists>xa\<in>S - {x}. \<forall>y\<in>S - {x}. xa \<noteq> y \<longrightarrow> \<not> y \<prec> xa \<Longrightarrow> False
[PROOF STEP]
with x Suc.prems(1,3)
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
S \<subseteq> T
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
\<forall>y\<in>S - {x}. x \<prec> y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<in> S
S \<subseteq> T
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
\<forall>y\<in>S - {x}. x \<prec> y

goal (1 subgoal):
 1. False
[PROOF STEP]
using asymmetric
[PROOF STATE]
proof (prove)
using this:
x \<in> S
S \<subseteq> T
\<not> (\<exists>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> \<not> y \<prec> x)
\<forall>y\<in>S - {x}. x \<prec> y
\<forall>x\<in>T. \<forall>y\<in>T. x \<prec> y \<longrightarrow> \<not> y \<prec> x

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed