-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathT_Tt.v
433 lines (271 loc) · 12.6 KB
/
T_Tt.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
(** ** Operations T and Tt on carriers of lB-systems and
their properties TT and TTt.
by Vladimir Voevodsky, file created on Jan. 6, 2015 *)
Unset Automatic Introduction.
Require Export lBsystems.lB_carriers .
(** *** Operation(s) T.
Including constructions related to their domains of definition. *)
(** **** Domains of definition of operations of type T *)
Definition T_dom { BB : lBsystem_carrier } ( X1 X2 : BB ) :=
dirprod ( ll X1 > 0 ) ( isabove X2 ( ft X1 ) ) .
Definition T_dom_constr { BB : lBsystem_carrier } { X1 X2 : BB }
( gt0 : ll X1 > 0 ) ( isab : isabove X2 ( ft X1 ) ) : T_dom X1 X2 :=
tpair _ gt0 isab .
Definition T_dom_gt0 { BB : lBsystem_carrier } { X1 X2 : BB } ( inn : T_dom X1 X2 ) :
ll X1 > 0 := pr1 inn .
Definition T_dom_gth { BB : lBsystem_carrier } { X1 X2 : BB } ( inn : T_dom X1 X2 ) :
ll X2 > ll ( ft X1 ) := isabove_gth ( pr2 inn ) .
Definition T_dom_isabove { BB : lBsystem_carrier } { X1 X2 : BB } ( inn : T_dom X1 X2 ) :
isabove X2 ( ft X1 ) := pr2 inn .
Definition T_dom_geh { BB : lBsystem_carrier } { X1 X2 : BB } ( inn : T_dom X1 X2 ) :
ll X2 >= ll X1 .
Proof .
intros . assert ( gt := T_dom_gth inn ) .
assert ( gte := natgthtogehsn _ _ gt ) .
refine ( istransnatgeh _ _ _ gte _ ) .
rewrite ll_ft .
change ( 1 + ( ll X1 - 1 ) >= ll X1 ) .
rewrite natpluscomm .
exact ( minusplusnmmineq _ _ ) .
Defined.
Lemma T_dom_gt0_2 { BB : lBsystem_carrier } { X1 X2 : BB } ( inn : T_dom X1 X2 ) :
ll X2 > 0 .
Proof .
intros .
exact ( isabove_gt0 ( T_dom_isabove inn ) ) .
Defined.
Lemma isaprop_T_dom { BB : lBsystem_carrier } ( X1 X2 : BB ) : isaprop ( T_dom X1 X2 ) .
Proof.
intros .
apply isapropdirprod .
apply ( pr2 ( _ > _ ) ) .
exact ( isaprop_isabove _ _ ) .
Defined.
Lemma noparts_T_dom { BB : lBsystem_carrier } { X1 X2 : BB } ( inn1 inn2 : T_dom X1 X2 ) :
inn1 = inn2 .
Proof .
intros . apply ( proofirrelevance _ ( isaprop_T_dom X1 X2 ) ) .
Defined .
Definition T_dom_refl { BB : lBsystem_carrier } ( X : BB ) ( gt0 : ll X > 0 ) : T_dom X X :=
T_dom_constr gt0 ( isabove_X_ftX X gt0 ) .
Definition T_dom_comp { BB : lBsystem_carrier } { X1 X2 X3 : BB }
( inn12 : T_dom X1 X2 ) ( inn23 : T_dom X2 X3 ) : T_dom X1 X3 .
Proof.
intros.
assert ( gt0 := T_dom_gt0 inn12 ) .
assert ( is21 := T_dom_isabove inn12 ) . assert ( is32 := T_dom_isabove inn23 ) .
refine ( T_dom_constr _ _ ) .
exact gt0 .
exact ( isabov_trans is32 ( isover_ft' is21 ) ) .
Defined.
Lemma T_dom_ftn { BB : lBsystem_carrier } { X1 X2 : BB } ( n : nat ) ( inn : T_dom X1 X2 )
( isab : isabove ( ftn n X2 ) ( ft X1 ) ) : T_dom X1 ( ftn n X2 ) .
Proof .
intros. exact ( T_dom_constr ( T_dom_gt0 inn ) isab ) .
Defined.
(** **** The type objects of which are candidates for operations T on an lB-system. *)
Definition T_ops_type ( BB : lBsystem_carrier ) :=
forall ( X1 X2 : BB ) ( inn : T_dom X1 X2 ) , BB .
Identity Coercion T_ops_to_Fun : T_ops_type >-> Funclass .
Lemma T_equals_T { BB : lBsystem_carrier } { X1 X2 X2' : BB } ( T : T_ops_type BB )
( eq : X2 = X2' ) ( inn : T_dom X1 X2 ) ( inn' : T_dom X1 X2' ) :
T X1 X2 inn = T X1 X2' inn' .
Proof.
intros BB X1 X2 X2' T eq .
rewrite eq .
intros . rewrite ( noparts_T_dom inn inn' ) .
apply idpath .
Defined.
(** **** The zeros property (later an axiom) of an operation of type T *)
Definition T_ax0_type { BB : lBsystem_carrier } ( T : T_ops_type BB ) :=
forall ( X1 X2 : BB ) ( inn : T_dom X1 X2 ) , ll ( T X1 X2 inn ) = 1 + ( ll X2 ) .
Identity Coercion T_ax0_to_Fun : T_ax0_type >-> Funclass .
Lemma ll_T_gt0 { BB : lBsystem_carrier }
{ T : T_ops_type BB } ( ax0 : T_ax0_type T )
{ X1 X2 : BB } ( inn : T_dom X1 X2 ) : ll ( T X1 X2 inn ) > 0 .
Proof.
intros .
rewrite ax0 .
exact ( natgthsn0 _ ) .
Defined.
(** **** The first property (later an axiom) of an operation of type T *)
Lemma T_ax1a_dom { BB : lBsystem_carrier } { X1 X2 : BB } ( inn : T_dom X1 X2 )
( isab : isabove ( ft X2 ) ( ft X1 ) ) : T_dom X1 ( ft X2 ) .
Proof .
intros. exact ( T_dom_constr ( T_dom_gt0 inn ) isab ) .
Defined.
Definition T_ax1a_type { BB : lBsystem_carrier } ( T : T_ops_type BB ) :=
forall ( X1 X2 : BB ) ( inn : T_dom X1 X2 ) ( isab : isabove ( ft X2 ) ( ft X1 ) ) ,
ft ( T X1 X2 inn ) = T X1 ( ft X2 ) ( T_ax1a_dom inn isab ) .
Identity Coercion T_ax1a_to_Fun: T_ax1a_type >-> Funclass .
Definition T_ax1b_type { BB : lBsystem_carrier } ( T : T_ops_type BB ) :=
forall ( X1 X2 : BB ) ( inn : T_dom X1 X2 ) , isabove ( T X1 X2 inn ) X1 .
Identity Coercion T_ax1b_to_Fun: T_ax1b_type >-> Funclass .
(** **** The computation of the iterated ft of ( T X1 X2 ) *)
Lemma ftn_T { BB : lBsystem_carrier } { T : T_ops_type BB } ( ax1a : T_ax1a_type T )
( n : nat ) { X1 X2 : BB } ( isab : isabove ( ftn n X2 ) ( ft X1 ) )
( inn : T_dom X1 X2 ) :
ftn n ( T X1 X2 inn ) = T X1 ( ftn n X2 ) ( T_dom_ftn n inn isab ) .
Proof .
intros BB T ax1a n . induction n as [ | n IHn ] .
intros .
rewrite ( noparts_T_dom inn (T_dom_ftn 0 inn isab) ) .
apply idpath .
intros .
change ( ftn (S n) (T X1 X2 inn) ) with ( ft ( ftn n (T X1 X2 inn) ) ) .
assert ( isab' : isabove ( ftn n X2 ) ( ft X1 ) ) .
exact ( isabove_ft_inv isab ) .
rewrite ( IHn X1 X2 isab' inn ) .
refine ( ax1a _ _ _ _ ) .
Defined.
Lemma ft_T { BB : lBsystem_carrier } { T : T_ops_type BB } { X1 X2 : BB } ( ax0 : T_ax0_type T )
( ax1b : T_ax1b_type T ) ( iseq : ft X2 = ft X1 ) ( inn : T_dom X1 X2 ) :
ft ( T X1 X2 inn ) = X1 .
Proof.
intros .
assert ( isov := ax1b X1 X2 inn : isover (T X1 X2 inn) X1 ) .
unfold isover in isov . rewrite ax0 in isov . rewrite ( natassocpmeq _ _ _ ( T_dom_geh inn ) )
in isov .
assert ( eq : ll X2 = ll X1 ) .
assert ( eq' : ll X2 - 1 = ll X1 - 1 ) . repeat rewrite <- ll_ft . rewrite iseq .
apply idpath .
assert ( eq1 : ( ll X1 - 1 ) + 1 = ll X1 ) . refine ( minusplusnmm _ _ _ ) .
exact ( natgthtogehsn _ _ (T_dom_gt0 inn ) ) .
assert ( eq2 : ( ll X2 - 1 ) + 1 = ll X2 ) . refine ( minusplusnmm _ _ _ ) .
exact ( istransnatgeh _ _ _ ( T_dom_geh inn ) ( natgthtogehsn _ _ (T_dom_gt0 inn ) ) ) .
assert ( eq'' := maponpaths ( fun n => n + 1 ) eq' ) .
lazy beta in eq'' .
rewrite eq1 in eq'' . rewrite eq2 in eq'' . exact eq'' .
rewrite eq in isov .
rewrite natminusnn in isov .
exact ( ! isov ) .
Defined.
(** **** The isover and isabove properties of the expressions T X1 X2 *)
Lemma isover_T_T_2 { BB : lBsystem_carrier }
{ T : T_ops_type BB } ( ax0 : T_ax0_type T ) ( ax1a : T_ax1a_type T )
{ X1 X2 X2' : BB } ( inn : T_dom X1 X2 ) ( inn' : T_dom X1 X2' )
( is : isover X2 X2' ) : isover ( T X1 X2 inn ) ( T X1 X2' inn' ) .
Proof .
intros .
unfold isover in * .
repeat rewrite ax0 .
simpl .
assert ( isab : isabove ( ftn ( ll X2 - ll X2') X2 ) ( ft X1 ) ) .
rewrite <- is .
Set Printing All .
exact ( T_dom_isabove inn' ) .
rewrite ( ftn_T ax1a _ isab inn ) .
exact ( T_equals_T _ is _ _ ) .
Defined.
Lemma isabove_T_T_2 { BB : lBsystem_carrier }
{ T : T_ops_type BB } ( ax0 : T_ax0_type T ) ( ax1a : T_ax1a_type T )
{ X1 X2 X2' : BB } ( inn : T_dom X1 X2 ) ( inn' : T_dom X1 X2' )
( is : isabove X2 X2' ) : isabove ( T X1 X2 inn ) ( T X1 X2' inn' ) .
Proof .
intros .
refine ( isabove_constr _ _ ) .
repeat rewrite ax0 .
exact ( isabove_gth is ) .
exact ( isover_T_T_2 ax0 ax1a _ _ is ) .
Defined.
(** *** Operation(s) Tt .
Including constructions related to their domains of definition. *)
(** **** Domains of definition of operations of type Tt *)
Definition Tt_dom { BB : lBsystem_carrier } ( X : BB ) ( s : Tilde BB ) := T_dom X ( dd s ) .
(** **** The type objects of which are candidates for operations Tt on an lB-system. *)
Definition Tt_ops_type ( BB : lBsystem_carrier ) :=
forall ( X : BB ) ( s : Tilde BB ) ( inn : Tt_dom X s ) , Tilde BB .
Identity Coercion Tt_ops_to_Fun: Tt_ops_type >-> Funclass .
(** **** The zeros property (later an axiom) of an operation of type Tt
It will be shown to be a corollary of the first property of Tt and the zeros property of T.
However it is convenient to have it separately for the use in the definition of a prelBsystem. *)
Definition Tt_ax0_type { BB : lBsystem_carrier } ( Tt : Tt_ops_type BB ) :=
forall ( X : BB ) ( s : Tilde BB ) ( inn : Tt_dom X s ) ,
ll ( dd ( Tt X s inn ) ) = 1 + ll ( dd s ) .
(** **** The first property (later an axiom) of an operation of type Tt *)
Definition Tt_ax1_type { BB : lBsystem_carrier } ( T : T_ops_type BB ) ( Tt : Tt_ops_type BB ) :=
forall ( X : BB ) ( s : Tilde BB ) ( inn : Tt_dom X s ) ,
dd ( Tt X s inn ) = T X ( dd s ) inn .
Identity Coercion Tt_ax1_to_Fun: Tt_ax1_type >-> Funclass .
Lemma Tt_ax1_to_Tt_ax0 { BB : lBsystem_carrier }
{ T : T_ops_type BB } ( ax0 : T_ax0_type T )
{ Tt : Tt_ops_type BB } ( ax1 : Tt_ax1_type T Tt ) : Tt_ax0_type Tt .
Proof .
intros .
unfold Tt_ax0_type .
intros .
rewrite ax1 .
exact ( ax0 _ _ _ ) .
Defined.
(** *** The properties TT and TTt *)
(** **** Two implications of the zeros and first properties of operations of type T
that are required for the formulation of the property TT *)
Lemma T_dom_12_23_to_T12_T13 { BB : lBsystem_carrier } { T : T_ops_type BB }
( ax0 : T_ax0_type T ) ( ax1a : T_ax1a_type T ) ( ax1b : T_ax1b_type T )
{ X1 X2 X3 : BB } ( inn12 : T_dom X1 X2 ) ( inn23 : T_dom X2 X3 ) :
T_dom ( T X1 X2 inn12 ) ( T X1 X3 ( T_dom_comp inn12 inn23 ) ) .
Proof .
intros .
assert ( is21 := T_dom_isabove inn12 ) .
assert ( is32 := T_dom_isabove inn23 ) .
refine ( T_dom_constr _ _ ) .
rewrite ( ax0 _ _ inn12 ) . exact ( natgthsn0 _ ) .
destruct ( isabove_choice is21 ) as [ isab | eq ] .
rewrite ( ax1a _ _ _ isab ) .
exact ( isabove_T_T_2 ax0 ax1a _ _ is32) .
rewrite ( ft_T ax0 ax1b ( ! eq ) _ ) .
apply ax1b .
Defined.
Lemma T_dom_12_23_to_T1T23 { BB : lBsystem_carrier }
{ T : T_ops_type BB } ( ax1b : T_ax1b_type T )
{ X1 X2 X3 : BB } ( inn12 : T_dom X1 X2 ) ( inn23 : T_dom X2 X3 ) :
T_dom X1 ( T X2 X3 inn23 ) .
Proof .
intros .
refine ( T_dom_constr _ _ ) .
exact ( T_dom_gt0 inn12 ) .
refine ( isabov_trans ( ax1b _ _ _ ) _ ) .
exact ( T_dom_isabove inn12 ) .
Defined.
(** **** The property (later an axiom) TT *)
Definition TT_type { BB : lBsystem_carrier } { T : T_ops_type BB }
( ax0 : T_ax0_type T ) ( ax1a : T_ax1a_type T ) ( ax1b : T_ax1b_type T ) :=
forall ( X1 X2 X3 : BB ) ( inn12 : T_dom X1 X2 ) ( inn23 : T_dom X2 X3 ) ,
T ( T X1 X2 inn12 ) ( T X1 X3 ( T_dom_comp inn12 inn23 ) )
( T_dom_12_23_to_T12_T13 ax0 ax1a ax1b inn12 inn23 ) =
T X1 ( T X2 X3 inn23 ) ( T_dom_12_23_to_T1T23 ax1b inn12 inn23 ) .
Identity Coercion TT_to_Fun: TT_type >-> Funclass .
(** **** Two implications of the zeros and first properties of operations of type T and Tt
that are required for the formulation of the property TTt *)
Lemma Tt_dom_12_2r_to_T12_Tt1r { BB : lBsystem_carrier } { T : T_ops_type BB }
( ax0 : T_ax0_type T ) ( ax1a : T_ax1a_type T ) ( ax1b : T_ax1b_type T )
{ Tt : Tt_ops_type BB } ( ax1at : Tt_ax1_type T Tt )
{ X1 X2 : BB } { r : Tilde BB } ( inn12 : T_dom X1 X2 ) ( inn2r : Tt_dom X2 r ) :
Tt_dom ( T X1 X2 inn12 ) ( Tt X1 r ( T_dom_comp inn12 inn2r ) ) .
Proof.
intros .
unfold Tt_dom .
rewrite ax1at .
apply ( T_dom_12_23_to_T12_T13 ax0 ax1a ax1b inn12 inn2r ) .
Defined.
Lemma Tt_dom_12_2r_to_Tt1Tt2r { BB : lBsystem_carrier } { T : T_ops_type BB }
( ax0 : T_ax0_type T ) ( ax1b : T_ax1b_type T )
{ Tt : Tt_ops_type BB } ( ax1at : Tt_ax1_type T Tt )
{ X1 X2 : BB } { r : Tilde BB } ( inn12 : T_dom X1 X2 ) ( inn2r : Tt_dom X2 r ) :
Tt_dom X1 ( Tt X2 r inn2r ) .
Proof.
intros.
unfold Tt_dom.
rewrite ax1at .
apply ( T_dom_12_23_to_T1T23 ax1b inn12 inn2r ) .
Defined.
(** **** The property TTt *)
Definition TTt_type { BB : lBsystem_carrier } { T : T_ops_type BB }
( ax0 : T_ax0_type T ) ( ax1a : T_ax1a_type T ) ( ax1b : T_ax1b_type T )
{ Tt : Tt_ops_type BB } ( ax1t : Tt_ax1_type T Tt ) :=
forall ( X1 X2 : BB ) ( r : Tilde BB ) ( inn12 : T_dom X1 X2 ) ( inn2r : Tt_dom X2 r ) ,
Tt ( T X1 X2 inn12 ) ( Tt X1 r ( T_dom_comp inn12 inn2r ) )
( Tt_dom_12_2r_to_T12_Tt1r ax0 ax1a ax1b ax1t inn12 inn2r ) =
Tt X1 ( Tt X2 r inn2r ) ( Tt_dom_12_2r_to_Tt1Tt2r ax0 ax1b ax1t inn12 inn2r ) .
Identity Coercion TTt_to_Fun: TTt_type >-> Funclass .
(* End of the file lBsystems_T_Tt.v *)