aboutsummaryrefslogtreecommitdiff
path: root/Nat.thy
blob: 05b0bfe60785d9305270b6a18f8d4b113bfb938c (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
47
48
49
50
51
52
53
54
55
(*  Title:  HoTT/Nat.thy
    Author: Josh Chen
    Date:   Aug 2018

Natural numbers.
*)

theory Nat
  imports HoTT_Base
begin


section ‹Constants and type rules›

axiomatization
  Nat :: Term   ("ℕ") and
  zero :: Term  ("0") and
  succ :: "Term ⇒ Term" and
  indNat :: "[[Term, Term] ⇒ Term, Term, Term] ⇒ Term"  ("(1ind⇩ℕ)")
where
  Nat_form: "ℕ: U(O)"
and
  Nat_intro1: "0: ℕ"
and
  Nat_intro2: "n: ℕ ⟹ succ(n): ℕ"
and
  Nat_elim: "⟦
    C: ℕ ⟶ U(i);
    ⋀n c. ⟦n: ℕ; c: C(n)⟧ ⟹ f(n)(c): C(succ n);
    a: C(0);
    n: ℕ
    ⟧ ⟹ ind⇩ℕ(f)(a)(n): C(n)"
and
  Nat_comp1: "⟦
    C: ℕ ⟶ U(i);
    ⋀n c. ⟦n: ℕ; c: C(n)⟧ ⟹ f(n)(c): C(succ n);
    a: C(0)
    ⟧ ⟹ ind⇩ℕ(f)(a)(0) ≡ a"
and
  Nat_comp2: "⟦
    C: ℕ ⟶ U(i);
    ⋀n c. ⟦n: ℕ; c: C(n)⟧ ⟹ f(n)(c): C(succ n);
    a: C(0);
    n: ℕ
    ⟧ ⟹ ind⇩ℕ(f)(a)(succ n) ≡ f(n)(ind⇩ℕ f a n)"


text "Rule declarations:"

lemmas Nat_intro = Nat_intro1 Nat_intro2
lemmas Nat_rules [intro] = Nat_form Nat_intro Nat_elim Nat_comp1 Nat_comp2
lemmas Nat_comps [comp] = Nat_comp1 Nat_comp2


end