Skip to content

Commit 872cb3d

Browse files
authored
Added support for Isabelle (proof assistant) (4 files)
Added support for the Isabelle proof assistant language, containing 4 files, in Isabelle, PNG, and PDF formats.
1 parent 4cff4ff commit 872cb3d

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
theorem sqrt2_not_rational:
2+
"sqrt 2 ∉ Q"
3+
proof
4+
let ?x = "sqrt 2"
5+
assume "?x ∈ Q"
6+
then obtain m n :: nat where
7+
sqrt_rat: "¦?x¦ = m / n" and lowest_terms: "coprime m n"
8+
by (rule Rats_abs_nat_div_natE)
9+
hence "m^2 = ?x^2 * n^2" by (auto simp add: power2_eq_square)
10+
hence eq: "m^2 = 2 * n^2" using of_nat_eq_iff power2_eq_square by fastforce
11+
hence "2 dvd m^2" by simp
12+
hence "2 dvd m" by simp
13+
have "2 dvd n" proof -
14+
from2 dvd mobtain k where "m = 2 * k" ..
15+
with eq have "2 * n^2 = 2^2 * k^2" by simp
16+
hence "2 dvd n^2" by simp
17+
thus "2 dvd n" by simp
18+
qed
19+
with2 dvd mhave "2 dvd gcd m n" by (rule gcd_greatest)
20+
with lowest_terms have "2 dvd 1" by simp
21+
thus False using odd_one by blast
22+
qed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
theorem sqrt2_not_rational:
2+
"sqrt 2 ∉ Q"
3+
proof
4+
let ?x = "sqrt 2"
5+
assume "?x ∈ Q"
6+
then obtain m n :: nat where
7+
sqrt_rat: "¦?x¦ = m / n" and lowest_terms: "coprime m n"
8+
by (rule Rats_abs_nat_div_natE)
9+
hence "m^2 = ?x^2 * n^2" by (auto simp add: power2_eq_square)
10+
hence eq: "m^2 = 2 * n^2" using of_nat_eq_iff power2_eq_square by fastforce
11+
hence "2 dvd m^2" by simp
12+
hence "2 dvd m" by simp
13+
have "2 dvd n" proof -
14+
from2 dvd mobtain k where "m = 2 * k" ..
15+
with eq have "2 * n^2 = 2^2 * k^2" by simp
16+
hence "2 dvd n^2" by simp
17+
thus "2 dvd n" by simp
18+
qed
19+
with2 dvd mhave "2 dvd gcd m n" by (rule gcd_greatest)
20+
with lowest_terms have "2 dvd 1" by simp
21+
thus False using odd_one by blast
22+
qed

0 commit comments

Comments
 (0)