aboutsummaryrefslogtreecommitdiff
path: root/Nat.thy
blob: cbfbe2d2892ac37f43ffb355c727d8ca86a8cc13 (plain)
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
41
42
43
44
45
46
(********
Isabelle/HoTT: Natural numbers
Feb 2019

********)

theory Nat
imports HoTT_Base

begin

axiomatization
  Nat    :: t and
  zero   :: t  ("0") and
  succ   :: "t \<Rightarrow> t" and
  indNat :: "[t \<Rightarrow> t, [t, t] \<Rightarrow> t, t, t] \<Rightarrow> t"
where
  Nat_form: "Nat: U O" and

  Nat_intro_0: "0: Nat" and

  Nat_intro_succ: "n: Nat \<Longrightarrow> succ n: Nat" and

  Nat_elim: "\<lbrakk>
    a: C 0;
    n: Nat;
    C: Nat \<leadsto> U i;
    \<And>n c. \<lbrakk>n: Nat; c: C n\<rbrakk> \<Longrightarrow> f n c: C (succ n) \<rbrakk> \<Longrightarrow> indNat C f a n: C n" and

  Nat_cmp_0: "\<lbrakk>
    a: C 0;
    C: Nat \<leadsto> U i;
    \<And>n c. \<lbrakk>n: Nat; c: C n\<rbrakk> \<Longrightarrow> f n c: C (succ n) \<rbrakk> \<Longrightarrow> indNat C f a 0 \<equiv> a" and

  Nat_cmp_succ: "\<lbrakk>
    a: C 0;
    n: Nat;
    C: Nat \<leadsto> U i;
    \<And>n c. \<lbrakk>n: Nat; c: C n\<rbrakk> \<Longrightarrow> f n c: C (succ n)
  \<rbrakk> \<Longrightarrow> indNat C f a (succ n) \<equiv> f n (indNat C f a n)"

lemmas Nat_form [form]
lemmas Nat_routine [intro] = Nat_form Nat_intro_0 Nat_intro_succ Nat_elim
lemmas Nat_comp [comp] = Nat_cmp_0 Nat_cmp_succ

end