1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/arith/nat_minus.ma".
16 include "ground/arith/ynat_pred.ma".
18 (* LEFT SUBTRACTION FOR NON-NEGATIVE INTEGERS WITH INFINITY *****************)
21 definition ylminus (x) (n): ynat ≝
25 "left minus (non-negative integers with infinity)"
26 'minus x n = (ylminus x n).
28 (* Basic constructions ******************************************************)
31 lemma ylminus_zero_dx (x:ynat): x = x - 𝟎 .
35 lemma yminus_pred_sn (x) (n): ↓(x-n) = ↓x - n.
36 #x #n @(niter_appl … ypred)
39 (*** yminus_succ2 yminus_S2 *)
40 lemma ylminus_succ_dx (x:ynat) (n): ↓(x-n) = x - ↑n.
41 #x #n @(niter_succ … ypred)
45 lemma ylminus_unit_dx (x): ↓x = x - (𝟏).
49 lemma ylminus_inf_sn (n): ∞ = ∞ - n.
50 #n @(nat_ind_succ … n) -n //
53 (* Constructions with nminus ************************************************)
56 lemma ylminus_inj_sn (m) (n): yinj_nat (m - n) = yinj_nat m - n.
58 @(niter_compose ???? yinj_nat)
62 (* Advanced constructions ***************************************************)
65 lemma ylminus_zero_sn (n): 𝟎 = 𝟎 - n.
69 lemma ylminus_refl (n): 𝟎 = yinj_nat n - n.
72 (*** yminus_minus_comm *)
73 lemma ylminus_minus_comm (x) (n) (o):
74 x - n - o = x - o - n.
75 #x @(ynat_split_nat_inf … x) -x //