]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/lib/basics/core_notation.ma
decentralizing core notation continues ...
[helm.git] / matita / matita / lib / basics / core_notation.ma
1 (* exists *******************************************************************)
2
3 notation "hvbox(∃ _ break . p)"
4  with precedence 20
5 for @{'exists $p }.
6
7 notation < "hvbox(\exists ident i : ty break . p)"
8  right associative with precedence 20
9 for @{'exists (\lambda ${ident i} : $ty. $p) }.
10
11 notation < "hvbox(\exists ident i break . p)"
12   with precedence 20
13 for @{'exists (\lambda ${ident i}. $p) }.
14
15 (*
16 notation < "hvbox(\exists ident i opt (: ty) break . p)"
17   right associative with precedence 20
18 for @{ 'exists ${default
19   @{\lambda ${ident i} : $ty. $p}
20   @{\lambda ${ident i} . $p}}}.
21 *)
22
23 notation > "\exists list1 ident x sep , opt (: T). term 19 Px"
24   with precedence 20
25   for ${ default
26           @{ ${ fold right @{$Px} rec acc @{'exists (λ${ident x}:$T.$acc)} } }
27           @{ ${ fold right @{$Px} rec acc @{'exists (λ${ident x}.$acc)} } }
28        }.
29
30 notation > "hvbox(∃∃ ident x0 break . term 19 P0 break & term 19 P1)"
31  non associative with precedence 20
32  for @{ 'exists2 (λ${ident x0}.$P0) (λ${ident x0}.$P1) }.
33
34 notation < "hvbox(∃∃ ident x0 break . term 19 P0 break & term 19 P1)"
35  non associative with precedence 20
36  for @{ 'exists2 (λ${ident x0}:$T0.$P0) (λ${ident x0}:$T0.$P1) }.
37
38 (* sigma ********************************************************************)
39
40 notation < "hvbox(\Sigma ident i : ty break . p)"
41  left associative with precedence 20
42 for @{'sigma (\lambda ${ident i} : $ty. $p) }.
43
44 notation < "hvbox(\Sigma ident i break . p)"
45  with precedence 20
46 for @{'sigma (\lambda ${ident i}. $p) }.
47
48 (*
49 notation < "hvbox(\Sigma ident i opt (: ty) break . p)"
50   right associative with precedence 20
51 for @{ 'sigma ${default
52   @{\lambda ${ident i} : $ty. $p}
53   @{\lambda ${ident i} . $p}}}.
54 *)
55
56 notation > "\Sigma list1 ident x sep , opt (: T). term 19 Px"
57   with precedence 20
58   for ${ default
59           @{ ${ fold right @{$Px} rec acc @{'sigma (λ${ident x}:$T.$acc)} } }
60           @{ ${ fold right @{$Px} rec acc @{'sigma (λ${ident x}.$acc)} } }
61        }.
62
63 notation "hvbox(« term 19 a, break term 19 b»)" 
64 with precedence 90 for @{ 'dp $a $b }.
65
66 (* dependent pairs (i.e. Sigma with predicate in Type[0])  ********************)
67
68 notation < "hvbox(𝚺 ident i : ty break . p)"
69  left associative with precedence 20
70 for @{'dpair (\lambda ${ident i} : $ty. $p) }.
71
72 notation < "hvbox(𝚺 ident i break . p)"
73  with precedence 20
74 for @{'dpair (\lambda ${ident i}. $p) }.
75
76 (*
77 notation < "hvbox(𝚺 ident i opt (: ty) break . p)"
78   right associative with precedence 20
79 for @{ 'dpair ${default
80   @{\lambda ${ident i} : $ty. $p}
81   @{\lambda ${ident i} . $p}}}.
82 *)
83
84 notation > "𝚺 list1 ident x sep , opt (: T). term 19 Px"
85   with precedence 20
86   for ${ default
87           @{ ${ fold right @{$Px} rec acc @{'dpair (λ${ident x}:$T.$acc)} } }
88           @{ ${ fold right @{$Px} rec acc @{'dpair (λ${ident x}.$acc)} } }
89        }.
90
91 notation "hvbox(❬ term 19 a, break term 19 b❭)" 
92 with precedence 90 for @{ 'mk_DPair $a $b }.
93
94 (* equality, conguence ******************************************************)
95
96 notation > "hvbox(a break = b)" 
97   non associative with precedence 45
98 for @{ 'eq ? $a $b }.
99
100 notation < "hvbox(term 46 a break maction (=) (=\sub t) term 46 b)" 
101   non associative with precedence 45
102 for @{ 'eq $t $a $b }.
103
104 notation > "hvbox(n break (≅ \sub term 90 p) m)"
105   non associative with precedence 45
106 for @{ 'congruent $n $m $p }.
107
108 notation < "hvbox(term 46 n break ≅ \sub p term 46 m)"
109   non associative with precedence 45
110 for @{ 'congruent $n $m $p }.
111
112 (* pairs, projections *******************************************************)
113
114 notation "hvbox(\langle term 19 a, break term 19 b\rangle)" 
115 with precedence 90 for @{ 'pair $a $b}.
116
117 notation "hvbox(x break \times y)" with precedence 70
118 for @{ 'product $x $y}.
119
120 notation < "\fst \nbsp term 90 x" with precedence 69 for @{'pi1a $x}.
121 notation < "\snd \nbsp term 90 x" with precedence 69 for @{'pi2a $x}.
122
123 notation < "\fst \nbsp term 90 x \nbsp term 90 y" with precedence 69 for @{'pi1b $x $y}.
124 notation < "\snd \nbsp term 90 x \nbsp term 90 y" with precedence 69 for @{'pi2b $x $y}.
125
126 notation > "\fst" with precedence 90 for @{'pi1}.
127 notation > "\snd" with precedence 90 for @{'pi2}.
128
129 (* implication **************************************************************)
130
131 notation "hvbox(a break \to b)" 
132   right associative with precedence 20
133 for @{ \forall $_:$a.$b }.
134
135 notation < "hvbox(a break \to b)" 
136   right associative with precedence 20
137 for @{ \Pi $_:$a.$b }.
138
139 (* orders *******************************************************************)
140
141 notation "hvbox(a break \leq b)" 
142   non associative with precedence 45
143 for @{ 'leq $a $b }.
144
145 notation "hvbox(a break \geq b)" 
146   non associative with precedence 45
147 for @{ 'geq $a $b }.
148
149 notation "hvbox(a break \lt b)" 
150   non associative with precedence 45
151 for @{ 'lt $a $b }.
152
153 notation "hvbox(a break \gt b)" 
154   non associative with precedence 45
155 for @{ 'gt $a $b }.
156
157 (* negated equality *********************************************************)
158
159 notation > "hvbox(a break \neq b)" 
160   non associative with precedence 45
161 for @{ 'neq ? $a $b }.
162
163 notation < "hvbox(a break maction (\neq) (\neq\sub t) b)" 
164   non associative with precedence 45
165 for @{ 'neq $t $a $b }.
166
167 (* negated orders ***********************************************************)
168
169 notation "hvbox(a break \nleq b)" 
170   non associative with precedence 45
171 for @{ 'nleq $a $b }.
172
173 notation "hvbox(a break \ngeq b)" 
174   non associative with precedence 45
175 for @{ 'ngeq $a $b }.
176
177 notation "hvbox(a break \nless b)" 
178   non associative with precedence 45
179 for @{ 'nless $a $b }.
180
181 notation "hvbox(a break \ngtr b)" 
182   non associative with precedence 45
183 for @{ 'ngtr $a $b }.
184
185 (* divides, negated divides *************************************************)
186
187 notation "hvbox(a break \divides b)"
188   non associative with precedence 45
189 for @{ 'divides $a $b }.
190
191 notation "hvbox(a break \ndivides b)"
192   non associative with precedence 45
193 for @{ 'ndivides $a $b }.
194
195 (* arithmetics **************************************************************)
196
197 notation "hvbox(a break + b)" 
198   left associative with precedence 55
199 for @{ 'plus $a $b }.
200
201 notation "hvbox(a break - b)" 
202   left associative with precedence 55
203 for @{ 'minus $a $b }.
204
205 notation "hvbox(a break * b)" 
206   left associative with precedence 60
207 for @{ 'times $a $b }.
208
209 notation "hvbox(a break \middot b)" 
210   left associative with precedence 60
211   for @{ 'middot $a $b }.
212
213 notation "hvbox(a break \mod b)" 
214   left associative with precedence 60
215 for @{ 'module $a $b }.
216
217 notation < "a \frac b" 
218   non associative with precedence 90
219 for @{ 'divide $a $b }.
220
221 notation "a \over b" 
222   left associative with precedence 60
223 for @{ 'divide $a $b }.
224
225 notation "hvbox(a break / b)" 
226   left associative with precedence 60
227 for @{ 'divide $a $b }.
228
229 notation "- term 65 a" with precedence 65 
230 for @{ 'uminus $a }.
231
232 notation "\sqrt a" 
233   non associative with precedence 65
234 for @{ 'sqrt $a }.
235
236 (* logical connectives ******************************************************)
237
238 notation "hvbox(a break \lor b)" 
239   left associative with precedence 30
240 for @{ 'or $a $b }.
241
242 notation "hvbox(a break \land b)" 
243   left associative with precedence 35
244 for @{ 'and $a $b }.
245
246 notation "hvbox(\lnot a)" 
247   non associative with precedence 40
248 for @{ 'not $a }.
249
250 notation > "hvbox(a break \liff b)" 
251   left associative with precedence 25
252 for @{ 'iff $a $b }.
253
254 notation "hvbox(a break \leftrightarrow b)" 
255   left associative with precedence 25
256 for @{ 'iff $a $b }.
257
258 (* subsets ******************************************************************)
259
260 notation "hvbox(\Omega \sup term 90 A)" non associative with precedence 90
261 for @{ 'powerset $A }.
262
263 notation > "hvbox(\Omega ^ term 90 A)" non associative with precedence 90
264 for @{ 'powerset $A }.
265
266 notation "hvbox(a break ∈ b)" non associative with precedence 45
267 for @{ 'mem $a $b }.
268
269 notation "hvbox(a break ∉ b)" non associative with precedence 45
270 for @{ 'notmem $a $b }.
271
272 notation "hvbox(a break ≬ b)" non associative with precedence 45
273 for @{ 'overlaps $a $b }. (* \between *)
274
275 notation "hvbox(a break ∩ b)" left associative with precedence 60
276 for @{ 'intersects $a $b }. (* \cap *)
277
278 notation "hvbox(a break ∪ b)" left associative with precedence 55
279 for @{ 'union $a $b }. (* \cup *)
280
281 (* other notations **********************************************************)
282
283 notation < "term 76 a \sup term 90 b" non associative with precedence 75 for @{ 'exp $a $b}.
284 notation > "a \sup term 90 b" non associative with precedence 75 for @{ 'exp $a $b}.
285 notation > "a ^ term 90 b"  non associative with precedence 75 for @{ 'exp $a $b}.
286 notation "s \sup (-1)" non associative with precedence 75 for @{ 'invert $s }.
287 notation > "s ^ (-1)" non associative with precedence 75 for @{ 'invert $s }.
288 notation < "s \sup (-1) x" non associative with precedence 90 for @{ 'invert_appl $s $x}. 
289
290 notation "| term 19 C |" with precedence 70 for @{ 'card $C }.
291
292 notation "\naturals" non associative with precedence 90 for @{'N}.
293 notation "\rationals" non associative with precedence 90 for @{'Q}.
294 notation "\reals" non associative with precedence 90 for @{'R}.
295 notation "\integers" non associative with precedence 90 for @{'Z}.
296 notation "\complexes" non associative with precedence 90 for @{'C}.
297
298 notation "\ee" with precedence 90 for @{ 'neutral }. (* ⅇ *)
299
300 notation > "x ⊩ y" with precedence 45 for @{'Vdash2 $x $y ?}.
301 notation > "x ⊩⎽ term 90 c y" with precedence 45 for @{'Vdash2 $x $y $c}.
302 notation "x (⊩ \sub term 90 c) y" with precedence 45 for @{'Vdash2 $x $y $c}.
303 notation > "⊩ " with precedence 65 for @{'Vdash ?}.
304 notation "(⊩ \sub term 90 c) " with precedence 65 for @{'Vdash $c}.
305
306 notation < "maction (mstyle color #ff0000 (­…­)) (t)" 
307 non associative with precedence 90 for @{'hide $t}.