From 88df8512841c1f2cb7016d2b604b9250582d4b8d Mon Sep 17 00:00:00 2001 From: Josh Chen Date: Thu, 16 Apr 2020 15:03:23 +0200 Subject: minor naming --- hott/Nat.thy | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hott/Nat.thy b/hott/Nat.thy index b88398b..59ec517 100644 --- a/hott/Nat.thy +++ b/hott/Nat.thy @@ -17,39 +17,43 @@ where NatE: "\ n: Nat; - n\<^sub>0: C 0; + c\<^sub>0: C 0; \n. n: Nat \ C n: U i; \k c. \k: Nat; c: C k\ \ f k c: C (suc k) - \ \ NatInd (\n. C n) n\<^sub>0 (\k c. f k c) n: C n" and + \ \ NatInd (\n. C n) c\<^sub>0 (\k c. f k c) n: C n" and Nat_comp_zero: "\ - n\<^sub>0: C 0; + c\<^sub>0: C 0; \k c. \k: Nat; c: C k\ \ f k c: C (suc k); \n. n: Nat \ C n: U i - \ \ NatInd (\n. C n) n\<^sub>0 (\k c. f k c) 0 \ n\<^sub>0" and + \ \ NatInd (\n. C n) c\<^sub>0 (\k c. f k c) 0 \ c\<^sub>0" and Nat_comp_suc: "\ n: Nat; - n\<^sub>0: C 0; + c\<^sub>0: C 0; \k c. \k: Nat; c: C k\ \ f k c: C (suc k); \n. n: Nat \ C n: U i \ \ - NatInd (\n. C n) n\<^sub>0 (\k c. f k c) (suc n) \ - f n (NatInd (\n. C n) n\<^sub>0 (\k c. f k c) n)" + NatInd (\n. C n) c\<^sub>0 (\k c. f k c) (suc n) \ + f n (NatInd (\n. C n) c\<^sub>0 (\k c. f k c) n)" lemmas [intros] = NatF Nat_zero Nat_suc and [elims] = NatE and [comps] = Nat_comp_zero Nat_comp_suc +text \Non-dependent recursion\ + +abbreviation "NatRec C \ NatInd (K C)" + section \Basic arithmetic\ definition add (infixl "+" 50) where - [comps]: "m + n \ NatInd (K Nat) n (K suc) m" + [comps]: "m + n \ NatRec Nat n (K suc) m" definition mul (infixl "*" 55) where - [comps]: "m * n \ NatInd (K Nat) 0 (K $ add n) m" + [comps]: "m * n \ NatRec Nat 0 (K $ add n) m" end -- cgit v1.2.3