]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/nlibrary/nat/big_ops.ma
ground_2 released and permanently renamed as ground
[helm.git] / matita / matita / nlibrary / nat / big_ops.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/order.ma".
16 include "algebra/magmas.ma".
17
18 alias symbol "eq" = "leibnitz's equality".
19 alias id "refl" = "cic:/matita/ng/logic/equality/eq.con(0,1,2)".
20 nlet rec big_op (M: magma_type) (n: nat) (f: ∀m. lt m n → M) (v: M) on n : M ≝
21  (match n return λx.∀p:n=x.? with
22    [ O ⇒ λ_.v
23    | S n' ⇒ λp.op ? (f n' ?) (big_op M n' ? v) ]) (refl ? n).
24 ##[ nrewrite > p; napply le_n
25   | #m; #H; napply (f m); nrewrite > p; napply le_S; nassumption]
26 nqed.