Section utils.
Fact prime_2_or_odd p : prime p -> p = 2 \/ exists n, 0 < n /\ p = 2*n+1.
Fact remarkable_id1_nat x y : (x+y)*(x+y) = x*x+2*(x*y)+y*y.
Local Fact bounded_upper_limit_4 a b c d m :
(a <= m
-> b <= m
-> c <= m
-> d <= m
-> a+b+c+d = 4*m
-> a = m
/\ b = m
/\ c = m
/\ d = m)%Z.
Fact Zsquare_inj x y : (x*x = y*y -> { x = y } + { - x = y } )%Z.
Fact square_4_simpl x m :
(4*(x*x) = Z.of_nat m*Z.of_nat m)%Z
-> { n | m = 2*n
/\   (x = Z.of_nat n
\/ (x = - Z.of_nat n)%Z) }.
Fact square_4_simpl' x m :
(4*(x*x) = Z.of_nat (2*m)*Z.of_nat (2*m)
-> x = Z.of_nat m \/ x = - Z.of_nat m)%Z.
(* We can find a small representative in absolute value *)

Lemma Zp_small_repr m (Hm : m <> 0) x :
exists y, Z2Zp Hm x = Z2Zp Hm y
/\ (4*(y*y) <= Z.of_nat m * Z.of_nat m)%Z.