[STATEMENT]
lemma ord_4_3 [simp]: "ord 4 (3::nat) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
have "[3 ^ 2 = (1 :: nat)] (mod 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [3\<^sup>2 = 1] (mod 4)
[PROOF STEP]
by (simp add: cong_def)
[PROOF STATE]
proof (state)
this:
[3\<^sup>2 = 1] (mod 4)

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
hence "ord 4 (3::nat) dvd 2"
[PROOF STATE]
proof (prove)
using this:
[3\<^sup>2 = 1] (mod 4)

goal (1 subgoal):
 1. ord 4 3 dvd 2
[PROOF STEP]
by (subst (asm) ord_divides) auto
[PROOF STATE]
proof (state)
this:
ord 4 3 dvd 2

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
hence "ord 4 (3::nat) \<le> 2"
[PROOF STATE]
proof (prove)
using this:
ord 4 3 dvd 2

goal (1 subgoal):
 1. ord 4 3 \<le> 2
[PROOF STEP]
by (intro dvd_imp_le) auto
[PROOF STATE]
proof (state)
this:
ord 4 3 \<le> 2

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ord 4 3 \<le> 2

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
have "ord 4 (3::nat) \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord 4 3 \<noteq> 1
[PROOF STEP]
by (auto simp: ord_eq_Suc_0_iff cong_def)
[PROOF STATE]
proof (state)
this:
ord 4 3 \<noteq> 1

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ord 4 3 \<noteq> 1

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
have "ord 4 (3::nat) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord 4 3 \<noteq> 0
[PROOF STEP]
by (auto simp: gcd_non_0_nat coprime_iff_gcd_eq_1)
[PROOF STATE]
proof (state)
this:
ord 4 3 \<noteq> 0

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ord 4 3 \<le> 2
ord 4 3 \<noteq> 1
ord 4 3 \<noteq> 0
[PROOF STEP]
show "ord 4 (3 :: nat) = 2"
[PROOF STATE]
proof (prove)
using this:
ord 4 3 \<le> 2
ord 4 3 \<noteq> 1
ord 4 3 \<noteq> 0

goal (1 subgoal):
 1. ord 4 3 = 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
ord 4 3 = 2

goal:
No subgoals!
[PROOF STEP]
qed