-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInductiv.thy
40 lines (31 loc) · 1023 Bytes
/
Inductiv.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
theory Inductiv
imports Main
begin
inductive ev :: "nat \<Rightarrow> bool" where
ev0: "ev 0" |
evSS: "ev n \<Longrightarrow> ev (Suc (Suc n))"
fun evn :: "nat \<Rightarrow> bool" where
"evn 0 = True" |
"evn (Suc 0) = False" |
"evn (Suc (Suc n)) = evn n"
lemma "ev (Suc (Suc (Suc (Suc 0))))"
apply(rule evSS)
apply(rule evSS)
apply(rule ev0)
done
lemma "ev m \<Longrightarrow> evn m"
apply(induction rule: ev.induct)
apply(simp_all)
done
lemma "evn n \<Longrightarrow> ev n"
apply(induction n rule: evn.induct)
apply(simp_all add: ev0 evSS)
done
inductive star :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> bool" for r where
refl: "star r x x" |
step: "r x y \<Longrightarrow> star r y z \<Longrightarrow> star r x z"
lemma star_trans: "star r x y \<Longrightarrow> star r y z \<Longrightarrow> star r x z"
apply(induction rule:star.induct)
apply(assumption)
by (simp add: star.step)
end