]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/nat/plus.ma
62fe4917a3ecff80a5db88248715a0999e413653
[helm.git] / helm / software / matita / nlibrary / nat / plus.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "nat/nat.ma".
16 include "algebra/magmas.ma".
17
18 nlet rec plus (n:nat) (m:nat) on n : nat ≝
19  match n with
20   [ O ⇒ m
21   | S n' ⇒ S (plus n' m) ].
22
23 ndefinition plus_magma_type: magma_type.
24  napply mk_magma_type
25   [ napply NAT
26   | napply mk_binary_morphism
27      [ napply plus
28      | #a; #a'; #b; #b'; #Ha; #Hb; nrewrite < Ha; nrewrite < Hb; napply refl ]##]
29 nqed.