Debian Codegraph @

src/Util/Wf1.v

raw
1 (** * Miscellaneous Well-Foundedness Facts *)
2 From Coq Require Import Setoid Program.
3 From Coq.Program Require Import Wf.
4 From Coq Require Import Wf_nat Morphisms.
5 From Coq.Init Require Import Wf.
6 Require Import Crypto.Util.Telescope.Core.
7 Require Import Crypto.Util.Telescope.Instances.
8 Require Import Crypto.Util.Telescope.Equality.
9 Require Import Crypto.Util.Equality.
10 Require Import Crypto.Util.Tactics.ETransitivity.
11 Require Import Crypto.Util.Tactics.SetEvars.
12 Require Import Crypto.Util.Tactics.SubstEvars.
13 Require Import Crypto.Util.Tactics.SubstLet.
14 Import Init.Wf.
15
16 Local Set Implicit Arguments.
17
18 Local Ltac Fix_eq_t F_ext Rwf :=
19 let generalize_if_not_var x :=
20 first [ is_var x; fail 1
21 | generalize x ] in
22 intros;
23 unfold Fix;
24 rewrite <- Fix_F_eq;
25 apply F_ext; intros;
26 repeat match goal with
27 | [ |- context[Fix_F _ _ ?x] ] => generalize_if_not_var x
28 | [ |- context[Fix_F _ _ ?x _] ] => generalize_if_not_var x
29 end;
30 clear -F_ext Rwf;
31 match goal with
32 | [ |- forall x : Acc _ ?a, _ ] => induction (Rwf a)
33 end;
34 intros; rewrite <- !Fix_F_eq;
35 apply F_ext; eauto.
36
37 Local Ltac Fix_Proper_t Fix_eq wf :=
38 change (@flatten_forall_eq_relation) with (@flatten_forall_eq);
39 change (@flatten_forall_eq_relation_with_assumption) with (@flatten_forall_eq_with_assumption);
40 let H := fresh "H" in
41 let a := fresh "a" in
42 unfold forall_relation, pointwise_relation, respectful;
43 intros ?? H a; repeat intro;
44 induction (wf a);
45 rewrite !Fix_eq; [ erewrite H; [ reflexivity | .. ] | .. ]; eauto; intros;
46 [ etransitivity; [ symmetry; apply H; reflexivity | apply H; eassumption ]; reflexivity
47 | etransitivity; [ apply H; eassumption | symmetry; apply H; reflexivity ]; reflexivity ].
48
49 Section FixV.
50 Context A (B : A -> Telescope)
51 (R : A -> A -> Prop) (Rwf : well_founded R)
52 (P : forall a, flattenT (B a) Type).
53
54 Local Notation FixV := (@Fix A R Rwf (fun a : A => flatten_forall (P a))).
55
56 Section F.
57 Context (F : forall x : A, (forall y : A, R y x -> flatten_forall (P y)) -> flatten_forall (P x)).
58
59 Definition FixV_eq
60 (F_ext : forall x (f g : forall y, R y x -> flatten_forall (P y)),
61 (forall y (p : R y x), flatten_forall_eq (f y p) (g y p))
62 -> flatten_forall_eq (@F x f) (@F x g))
63 : forall a, flatten_forall_eq (@FixV F a) (@F a (fun y (_ : R y a) => @FixV F y)).
64 Proof. Fix_eq_t F_ext Rwf. Defined.
65
66 Definition FixV_eq_with_assumption
67 Q
68 (F_ext : forall x (f g : forall y, R y x -> flatten_forall (P y)),
69 (forall y (p : R y x), flatten_forall_eq_with_assumption (Q y) (f y p) (g y p))
70 -> flatten_forall_eq_with_assumption (Q x) (@F x f) (@F x g))
71 : forall a, flatten_forall_eq_with_assumption (Q a) (@FixV F a) (@F a (fun y (_ : R y a) => @FixV F y)).
72 Proof. Fix_eq_t F_ext Rwf. Defined.
73
74 Definition FixV_rect
75 (Q : forall a, flattenT (Telescope_append (B a) (P a)) Type)
76 (H0 : forall x, (forall y, R y x -> flatten_append_forall (@Q y) (@FixV F y))
77 -> flatten_append_forall (@Q x) (@F x (fun (y : A) (_ : R y x) => @FixV F y)))
78 (F_ext : forall x (f g : forall y, R y x -> flatten_forall (@P y)),
79 (forall y (p : R y x), flatten_forall_eq (f y p) (g y p))
80 -> flatten_forall_eq (@F x f) (@F x g))
81 a
82 : flatten_append_forall (@Q a) (@FixV F a).
83 Proof.
84 induction (Rwf a).
85 eapply flatten_append_forall_Proper; auto with nocore.
86 symmetry; eapply FixV_eq; auto with nocore.
87 Defined.
88 End F.
89
90 Global Instance FixV_Proper_eq
91 : Proper
92 ((forall_relation
93 (fun a =>
94 (forall_relation
95 (fun a' =>
96 pointwise_relation
97 _
98 (flatten_forall_eq_relation)))
99 ==> flatten_forall_eq_relation))
100 ==> (forall_relation (fun a => flatten_forall_eq_relation)))
101 FixV.
102 Proof. Fix_Proper_t @FixV_eq Rwf. Qed.
103
104 Global Instance FixV_Proper_eq_with_assumption
105 Q
106 : Proper
107 ((forall_relation
108 (fun a : A =>
109 (forall_relation
110 (fun a' : A =>
111 pointwise_relation
112 (R a' a)
113 (flatten_forall_eq_relation_with_assumption (Q a'))))
114 ==> flatten_forall_eq_relation_with_assumption (Q a)))
115 ==> (forall_relation (fun a => flatten_forall_eq_relation_with_assumption (Q a))))
116 FixV.
117 Proof. Fix_Proper_t @FixV_eq_with_assumption Rwf. Qed.
118 End FixV.
119
120 Arguments FixV_Proper_eq {A B R Rwf P} _ _ _ _.
121 Arguments FixV_Proper_eq_with_assumption {A B R Rwf P} _ _ _ _ _.
122
123 Local Arguments flatten_forall / _ _.
124 Local Arguments flattenT / _ _.
125 Local Arguments flatten_forall_eq / _ _ _ _.
126 Local Arguments flatten_forall_eq_relation / _ _ _ _.
127 Local Arguments flatten_forall_eq_with_assumption / _ _ _ _ _.
128 Local Arguments flatten_forall_eq_relation_with_assumption / _ _ _ _ _.
129 Local Arguments flatten_append_forall / _ _ _ _.
130
131 Local Notation type_of x := ((fun T (y : T) => T) _ x).
132
133 Section FixVTransfer.
134 Context A (B B' : A -> Telescope)
135 (f0 : forall a, flattenT_sig (B a) -> flattenT_sig (B' a))
136 (g0 : forall a, flattenT_sig (B' a) -> flattenT_sig (B a))
137 (sect : forall a x, g0 a (f0 a x) = x)
138 (R : A -> A -> Prop) (Rwf : well_founded R)
139 (P : forall a, flattenT (B a) Type).
140
141 Let P' : forall a, flattenT (B' a) Type
142 := fun a => flattenT_unapply (fun x => flattenT_apply (P a) (g0 _ x)).
143
144 Local Notation FixV := (@Fix A R Rwf (fun a : A => flatten_forall (P a))).
145 Local Notation FixV' := (@Fix A R Rwf (fun a : A => flatten_forall (P' a))).
146
147 Section F.
148 Context (F : forall x : A, (forall y : A, R y x -> flatten_forall (P y)) -> flatten_forall (P x)).
149
150 Let transfer
151 : forall y,
152 flatten_forall
153 (flattenT_unapply
154 (fun x : flattenT_sig (B y) => flattenT_apply (P' y) (f0 y x)))
155 -> flatten_forall (P y).
156 Proof.
157 intro y.
158 refine (flatten_forall_eq_rect
159 (transitivity
160 ((_ : Proper (pointwise_relation _ _ ==> _) flattenT_unapply)
161 _ _
162 (fun x' => transitivity
163 (symmetry (flattenT_apply_unapply _ _))
164 (f_equal (flattenT_apply _) (sect _ _))))
165 (symmetry (flattenT_unapply_apply _)))).
166 Defined.
167
168 Let transfer'
169 : forall a,
170 flatten_forall (P a)
171 -> flatten_forall (P' a).
172 Proof.
173 intro a.
174 refine (fun f' => flatten_forall_unapply (fun x' => flatten_forall_apply f' (g0 _ x'))).
175 Defined.
176
177 Let untransfer'
178 : forall a,
179 flatten_forall (P' a)
180 -> flatten_forall (P a).
181 Proof.
182 intro a.
183 refine (fun f' => _).
184 refine (transfer
185 _
186 (flatten_forall_unapply (fun x => flatten_forall_apply f' (f0 _ x)))).
187 Defined.
188
189 Let F' : forall x : A, (forall y : A, R y x -> flatten_forall (P' y)) -> flatten_forall (P' x)
190 := fun a F' => transfer' _ (@F a (fun y pf => transfer _ (flatten_forall_unapply (fun x => flatten_forall_apply (F' y pf) (f0 _ x))))).
191
192
193 Context (F_ext : forall x (f g : forall y, R y x -> flatten_forall (P y)),
194 (forall y (p : R y x), flatten_forall_eq (f y p) (g y p))
195 -> flatten_forall_eq (@F x f) (@F x g)).
196
197 Lemma F'_ext
198 : forall x (f g : forall y, R y x -> flatten_forall (P' y)),
199 (forall y (p : R y x), flatten_forall_eq (f y p) (g y p))
200 -> flatten_forall_eq (@F' x f) (@F' x g).
201 Proof.
202 intros x f' g' IH.
203 subst F' transfer transfer'; cbv beta.
204 apply (_ : Proper (forall_relation _ ==> _) flatten_forall_unapply); intro.
205 apply flatten_forall_apply_Proper.
206 apply F_ext; intros.
207 refine ((_ : Proper (flatten_forall_eq ==> _) (@flatten_forall_eq_rect _ _ _ _)) _ _ _).
208 apply (_ : Proper (forall_relation _ ==> _) flatten_forall_unapply); intro.
209 apply flatten_forall_apply_Proper.
210 apply IH.
211 Qed.
212
213 Definition FixV_transfer_eq
214 a
215 : flatten_forall_eq (@FixV F a) (untransfer' _ (@FixV' F' a)).
216 Proof.
217 induction (Rwf a).
218 rewrite FixV_eq by eauto with nocore.
219 etransitivity_rev _.
220 { unfold transfer, untransfer'; cbv beta.
221 apply flatten_forall_eq_rect_Proper, flatten_forall_unapply_Proper; intro.
222 apply flatten_forall_apply_Proper.
223 rewrite FixV_eq by auto using F'_ext with nocore.
224 reflexivity. }
225 etransitivity.
226 { apply F_ext; intros.
227 set_evars.
228 match goal with
229 | [ H : forall y r, flatten_forall_eq _ _ |- _ ] => rewrite H by assumption
230 end.
231 match goal with
232 | [ |- ?R ?a (?e ?x ?y) ]
233 => revert x y
234 end.
235 match goal with
236 | [ H := ?e |- _ ] => is_evar e; subst H
237 end.
238 match goal with
239 | [ |- forall x y, ?R (@?LHS x y) (?RHS x y) ]
240 => unify LHS RHS; cbv beta
241 end.
242 reflexivity. }
243 lazymatch goal with
244 | [ |- context[FixV' ?F _] ]
245 => generalize (FixV' F)
246 end.
247 subst F'; cbv beta.
248 subst untransfer' transfer transfer'; cbv beta.
249 intro.
250 rewrite flatten_forall_eq_rect_trans.
251 match goal with
252 | [ |- context[flatten_forall_eq_rect
253 (flattenT_unapply_Proper ?P ?Q ?H)
254 (flatten_forall_unapply ?f)] ]
255 => rewrite (@flatten_forall_eq_rect_flattenT_unapply_Proper _ P Q H f)
256 end.
257 etransitivity_rev _.
258 { apply flatten_forall_eq_rect_Proper.
259 apply flatten_forall_unapply_Proper; intro.
260 match goal with
261 | [ |- context[@transitivity _ (@eq ?A) ?P _ _ _ _ _] ]
262 => change (@transitivity _ (@eq ?A) P) with (@eq_trans A)
263 end.
264 match goal with
265 | [ |- context[@symmetry _ (@eq ?A) ?P _ _ _] ]
266 => change (@symmetry _ (@eq ?A) P) with (@eq_sym A)
267 end.
268 set_evars.
269 rewrite @transport_pp.
270 match goal with
271 | [ |- context G[eq_rect _ (fun T => T) (flatten_forall_apply (flatten_forall_unapply ?k) ?x0) _ (eq_sym (flattenT_apply_unapply ?f1 ?x0))] ]
272 => let H := fresh in
273 pose proof (@eq_rect_symmetry_flattenT_apply_unapply _ f1 x0 k) as H;
274 cbv beta in H |- *;
275 let RHS := match type of H with _ = ?RHS => constr:(RHS) end in
276 let LHS := match type of H with ?LHS = _ => constr:(LHS) end in
277 let G' := context G[LHS] in
278 change G';
279 rewrite H;
280 clear H
281 end.
282 match goal with
283 | [ |- context[f_equal _ ?p] ]
284 => destruct p; unfold f_equal; simpl @eq_rect
285 end.
286 subst_let.
287 reflexivity. }
288 rewrite flatten_forall_eq_rect_symmetry_flattenT_unapply_apply.
289 apply F_ext; intros.
290 reflexivity.
291 Qed.
292 End F.
293 End FixVTransfer.
294
295 Section Fix_rect.
296 Context (A : Type).
297 Local Notation T := (fun _ : A => bottom).
298
299 Let Fix_rect' := @FixV_rect A T.
300 Let Fix_rect'T := Eval simpl in type_of Fix_rect'.
301
302 Let Fix_Proper_eq' := @FixV_Proper_eq A T.
303 Let Fix_Proper_eq'T := Eval simpl in type_of Fix_Proper_eq'.
304
305 Let Fix_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T.
306 Let Fix_Proper_eq_with_assumption'T := Eval simpl in type_of Fix_Proper_eq_with_assumption'.
307
308 Definition Fix_rect : Fix_rect'T := Fix_rect'.
309 Definition Fix_Proper_eq : Fix_Proper_eq'T := Fix_Proper_eq'.
310 Definition Fix_Proper_eq_with_assumption : Fix_Proper_eq_with_assumption'T := Fix_Proper_eq_with_assumption'.
311 End Fix_rect.
312
313 Arguments Fix_Proper_eq {A R Rwf P} _ _ _ _.
314 Arguments Fix_Proper_eq_with_assumption {A R Rwf P} _ _ _ _ _ _.
315 Global Existing Instance Fix_Proper_eq.
316 Global Existing Instance Fix_Proper_eq_with_assumption.
317
318 (** A variant of [Fix] that has a nice [Fix_eq] for functions which
319 doesn't require [functional_extensionality]. *)
320 (* Following code generated by the following Python script:
321 <<
322 ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
323 alpha = ALPHA.lower()
324 for fixn in range(1, 11):
325 print(r"""Section Fix%(fixn)d.""" % locals())
326 def make_forall(n, pat, skip_forall=0):
327 mycur = ''
328 if n > skip_forall + 1:
329 mycur += 'forall ' + ' '.join(alpha[skip_forall:n-1]) + ', '
330 mycur2 = ''
331 if n > 1:
332 mycur2 += ' ' + ' '.join(alpha[:n-1])
333 return mycur + (pat % mycur2)
334
335 cur = ' Context A'
336 for j in range(1, fixn + 1):
337 cur += ' (%s : ' % ALPHA[j]
338 cur += make_forall(j, '%s%%s -> Type)' % ALPHA[j-1])
339 print(cur)
340 print(r""" (R : A -> A -> Prop) (Rwf : well_founded R)""")
341 cur = " (P : "
342 cur += make_forall(j+1, '%s%%s -> Type).' % ALPHA[j])
343 print(cur)
344 print("")
345 cur = " Local Notation Fix%d := (@Fix A R Rwf (fun a : A => %s))."
346 cur = cur % (j, make_forall(j+2, '@P%s', skip_forall=1))
347 print(cur)
348 def make_tele(chars, final, append=''):
349 if chars:
350 return '(fun %s => tele _ %s)' % (chars[0], make_tele(chars[1:], final, append + ' ' + chars[0]))
351 else:
352 return '(fun _ : %s%s => bottom)' % (final, append)
353 print(' Local Notation T := %s.' % make_tele(alpha[:fixn], '@' + ALPHA[fixn]))
354 fix_underscores = ' '.join('_' for i in range(fixn + 4))
355 letters = ' '.join(ALPHA[:fixn+1])
356 preletters = ' '.join(ALPHA[:fixn])
357 print(r"""
358 Let Fix%(fixn)d_eq' := @FixV_eq A T R Rwf P.
359 Let Fix%(fixn)d_eq'T := Eval simpl in type_of Fix%(fixn)d_eq'.
360
361 Let Fix%(fixn)d_rect' := @FixV_rect A T R Rwf P.
362 Let Fix%(fixn)d_rect'T := Eval simpl in type_of Fix%(fixn)d_rect'.
363
364 Let Fix%(fixn)d_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
365 Let Fix%(fixn)d_Proper_eq'T := Eval simpl in type_of Fix%(fixn)d_Proper_eq'.
366
367 Let Fix%(fixn)d_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
368 Let Fix%(fixn)d_Proper_eq_with_assumption'T := Eval simpl in type_of Fix%(fixn)d_Proper_eq_with_assumption'.
369
370 Definition Fix%(fixn)d_eq : Fix%(fixn)d_eq'T := Fix%(fixn)d_eq'.
371 Definition Fix%(fixn)d_rect : Fix%(fixn)d_rect'T := Fix%(fixn)d_rect'.
372 Definition Fix%(fixn)d_Proper_eq : Fix%(fixn)d_Proper_eq'T := Fix%(fixn)d_Proper_eq'.
373 Definition Fix%(fixn)d_Proper_eq_with_assumption : Fix%(fixn)d_Proper_eq_with_assumption'T := Fix%(fixn)d_Proper_eq_with_assumption'.
374 End Fix%(fixn)d.
375
376 Arguments Fix%(fixn)d_Proper_eq {%(letters)s R Rwf P} %(fix_underscores)s.
377 Arguments Fix%(fixn)d_Proper_eq_with_assumption {%(letters)s R Rwf P} _ _ %(fix_underscores)s.
378 Global Existing Instance Fix%(fixn)d_Proper_eq.
379 Global Existing Instance Fix%(fixn)d_Proper_eq_with_assumption.
380 """ % locals())
381 >> *)
382 Section Fix1.
383 Context A (B : A -> Type)
384 (R : A -> A -> Prop) (Rwf : well_founded R)
385 (P : forall a, B a -> Type).
386
387 Local Notation Fix1 := (@Fix A R Rwf (fun a : A => forall b, @P a b)).
388 Local Notation T := (fun a => tele _ (fun _ : @B a => bottom)).
389
390 Let Fix1_eq' := @FixV_eq A T R Rwf P.
391 Let Fix1_eq'T := Eval simpl in type_of Fix1_eq'.
392
393 Let Fix1_rect' := @FixV_rect A T R Rwf P.
394 Let Fix1_rect'T := Eval simpl in type_of Fix1_rect'.
395
396 Let Fix1_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
397 Let Fix1_Proper_eq'T := Eval simpl in type_of Fix1_Proper_eq'.
398
399 Let Fix1_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
400 Let Fix1_Proper_eq_with_assumption'T := Eval simpl in type_of Fix1_Proper_eq_with_assumption'.
401
402 Definition Fix1_eq : Fix1_eq'T := Fix1_eq'.
403 Definition Fix1_rect : Fix1_rect'T := Fix1_rect'.
404 Definition Fix1_Proper_eq : Fix1_Proper_eq'T := Fix1_Proper_eq'.
405 Definition Fix1_Proper_eq_with_assumption : Fix1_Proper_eq_with_assumption'T := Fix1_Proper_eq_with_assumption'.
406 End Fix1.
407
408 Arguments Fix1_Proper_eq {A B R Rwf P} _ _ _ _ _.
409 Arguments Fix1_Proper_eq_with_assumption {A B R Rwf P} _ _ _ _ _ _ _.
410 Global Existing Instance Fix1_Proper_eq.
411 Global Existing Instance Fix1_Proper_eq_with_assumption.
412
413 Section Fix2.
414 Context A (B : A -> Type) (C : forall a, B a -> Type)
415 (R : A -> A -> Prop) (Rwf : well_founded R)
416 (P : forall a b, C a b -> Type).
417
418 Local Notation Fix2 := (@Fix A R Rwf (fun a : A => forall b c, @P a b c)).
419 Local Notation T := (fun a => tele _ (fun b => tele _ (fun _ : @C a b => bottom))).
420
421 Let Fix2_eq' := @FixV_eq A T R Rwf P.
422 Let Fix2_eq'T := Eval simpl in type_of Fix2_eq'.
423
424 Let Fix2_rect' := @FixV_rect A T R Rwf P.
425 Let Fix2_rect'T := Eval simpl in type_of Fix2_rect'.
426
427 Let Fix2_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
428 Let Fix2_Proper_eq'T := Eval simpl in type_of Fix2_Proper_eq'.
429
430 Let Fix2_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
431 Let Fix2_Proper_eq_with_assumption'T := Eval simpl in type_of Fix2_Proper_eq_with_assumption'.
432
433 Definition Fix2_eq : Fix2_eq'T := Fix2_eq'.
434 Definition Fix2_rect : Fix2_rect'T := Fix2_rect'.
435 Definition Fix2_Proper_eq : Fix2_Proper_eq'T := Fix2_Proper_eq'.
436 Definition Fix2_Proper_eq_with_assumption : Fix2_Proper_eq_with_assumption'T := Fix2_Proper_eq_with_assumption'.
437 End Fix2.
438
439 Arguments Fix2_Proper_eq {A B C R Rwf P} _ _ _ _ _ _.
440 Arguments Fix2_Proper_eq_with_assumption {A B C R Rwf P} _ _ _ _ _ _ _ _.
441 Global Existing Instance Fix2_Proper_eq.
442 Global Existing Instance Fix2_Proper_eq_with_assumption.
443
444 Section Fix3.
445 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type)
446 (R : A -> A -> Prop) (Rwf : well_founded R)
447 (P : forall a b c, D a b c -> Type).
448
449 Local Notation Fix3 := (@Fix A R Rwf (fun a : A => forall b c d, @P a b c d)).
450 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun _ : @D a b c => bottom)))).
451
452 Let Fix3_eq' := @FixV_eq A T R Rwf P.
453 Let Fix3_eq'T := Eval simpl in type_of Fix3_eq'.
454
455 Let Fix3_rect' := @FixV_rect A T R Rwf P.
456 Let Fix3_rect'T := Eval simpl in type_of Fix3_rect'.
457
458 Let Fix3_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
459 Let Fix3_Proper_eq'T := Eval simpl in type_of Fix3_Proper_eq'.
460
461 Let Fix3_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
462 Let Fix3_Proper_eq_with_assumption'T := Eval simpl in type_of Fix3_Proper_eq_with_assumption'.
463
464 Definition Fix3_eq : Fix3_eq'T := Fix3_eq'.
465 Definition Fix3_rect : Fix3_rect'T := Fix3_rect'.
466 Definition Fix3_Proper_eq : Fix3_Proper_eq'T := Fix3_Proper_eq'.
467 Definition Fix3_Proper_eq_with_assumption : Fix3_Proper_eq_with_assumption'T := Fix3_Proper_eq_with_assumption'.
468 End Fix3.
469
470 Arguments Fix3_Proper_eq {A B C D R Rwf P} _ _ _ _ _ _ _.
471 Arguments Fix3_Proper_eq_with_assumption {A B C D R Rwf P} _ _ _ _ _ _ _ _ _.
472 Global Existing Instance Fix3_Proper_eq.
473 Global Existing Instance Fix3_Proper_eq_with_assumption.
474
475 Section Fix4.
476 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type)
477 (R : A -> A -> Prop) (Rwf : well_founded R)
478 (P : forall a b c d, E a b c d -> Type).
479
480 Local Notation Fix4 := (@Fix A R Rwf (fun a : A => forall b c d e, @P a b c d e)).
481 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun _ : @E a b c d => bottom))))).
482
483 Let Fix4_eq' := @FixV_eq A T R Rwf P.
484 Let Fix4_eq'T := Eval simpl in type_of Fix4_eq'.
485
486 Let Fix4_rect' := @FixV_rect A T R Rwf P.
487 Let Fix4_rect'T := Eval simpl in type_of Fix4_rect'.
488
489 Let Fix4_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
490 Let Fix4_Proper_eq'T := Eval simpl in type_of Fix4_Proper_eq'.
491
492 Let Fix4_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
493 Let Fix4_Proper_eq_with_assumption'T := Eval simpl in type_of Fix4_Proper_eq_with_assumption'.
494
495 Definition Fix4_eq : Fix4_eq'T := Fix4_eq'.
496 Definition Fix4_rect : Fix4_rect'T := Fix4_rect'.
497 Definition Fix4_Proper_eq : Fix4_Proper_eq'T := Fix4_Proper_eq'.
498 Definition Fix4_Proper_eq_with_assumption : Fix4_Proper_eq_with_assumption'T := Fix4_Proper_eq_with_assumption'.
499 End Fix4.
500
501 Arguments Fix4_Proper_eq {A B C D E R Rwf P} _ _ _ _ _ _ _ _.
502 Arguments Fix4_Proper_eq_with_assumption {A B C D E R Rwf P} _ _ _ _ _ _ _ _ _ _.
503 Global Existing Instance Fix4_Proper_eq.
504 Global Existing Instance Fix4_Proper_eq_with_assumption.
505
506 Section Fix5.
507 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type) (F : forall a b c d, E a b c d -> Type)
508 (R : A -> A -> Prop) (Rwf : well_founded R)
509 (P : forall a b c d e, F a b c d e -> Type).
510
511 Local Notation Fix5 := (@Fix A R Rwf (fun a : A => forall b c d e f, @P a b c d e f)).
512 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun e => tele _ (fun _ : @F a b c d e => bottom)))))).
513
514 Let Fix5_eq' := @FixV_eq A T R Rwf P.
515 Let Fix5_eq'T := Eval simpl in type_of Fix5_eq'.
516
517 Let Fix5_rect' := @FixV_rect A T R Rwf P.
518 Let Fix5_rect'T := Eval simpl in type_of Fix5_rect'.
519
520 Let Fix5_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
521 Let Fix5_Proper_eq'T := Eval simpl in type_of Fix5_Proper_eq'.
522
523 Let Fix5_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
524 Let Fix5_Proper_eq_with_assumption'T := Eval simpl in type_of Fix5_Proper_eq_with_assumption'.
525
526 Definition Fix5_eq : Fix5_eq'T := Fix5_eq'.
527 Definition Fix5_rect : Fix5_rect'T := Fix5_rect'.
528 Definition Fix5_Proper_eq : Fix5_Proper_eq'T := Fix5_Proper_eq'.
529 Definition Fix5_Proper_eq_with_assumption : Fix5_Proper_eq_with_assumption'T := Fix5_Proper_eq_with_assumption'.
530 End Fix5.
531
532 Arguments Fix5_Proper_eq {A B C D E F R Rwf P} _ _ _ _ _ _ _ _ _.
533 Arguments Fix5_Proper_eq_with_assumption {A B C D E F R Rwf P} _ _ _ _ _ _ _ _ _ _ _.
534 Global Existing Instance Fix5_Proper_eq.
535 Global Existing Instance Fix5_Proper_eq_with_assumption.
536
537 Section Fix6.
538 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type) (F : forall a b c d, E a b c d -> Type) (G : forall a b c d e, F a b c d e -> Type)
539 (R : A -> A -> Prop) (Rwf : well_founded R)
540 (P : forall a b c d e f, G a b c d e f -> Type).
541
542 Local Notation Fix6 := (@Fix A R Rwf (fun a : A => forall b c d e f g, @P a b c d e f g)).
543 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun e => tele _ (fun f => tele _ (fun _ : @G a b c d e f => bottom))))))).
544
545 Let Fix6_eq' := @FixV_eq A T R Rwf P.
546 Let Fix6_eq'T := Eval simpl in type_of Fix6_eq'.
547
548 Let Fix6_rect' := @FixV_rect A T R Rwf P.
549 Let Fix6_rect'T := Eval simpl in type_of Fix6_rect'.
550
551 Let Fix6_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
552 Let Fix6_Proper_eq'T := Eval simpl in type_of Fix6_Proper_eq'.
553
554 Let Fix6_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
555 Let Fix6_Proper_eq_with_assumption'T := Eval simpl in type_of Fix6_Proper_eq_with_assumption'.
556
557 Definition Fix6_eq : Fix6_eq'T := Fix6_eq'.
558 Definition Fix6_rect : Fix6_rect'T := Fix6_rect'.
559 Definition Fix6_Proper_eq : Fix6_Proper_eq'T := Fix6_Proper_eq'.
560 Definition Fix6_Proper_eq_with_assumption : Fix6_Proper_eq_with_assumption'T := Fix6_Proper_eq_with_assumption'.
561 End Fix6.
562
563 Arguments Fix6_Proper_eq {A B C D E F G R Rwf P} _ _ _ _ _ _ _ _ _ _.
564 Arguments Fix6_Proper_eq_with_assumption {A B C D E F G R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _.
565 Global Existing Instance Fix6_Proper_eq.
566 Global Existing Instance Fix6_Proper_eq_with_assumption.
567
568 Section Fix7.
569 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type) (F : forall a b c d, E a b c d -> Type) (G : forall a b c d e, F a b c d e -> Type) (H : forall a b c d e f, G a b c d e f -> Type)
570 (R : A -> A -> Prop) (Rwf : well_founded R)
571 (P : forall a b c d e f g, H a b c d e f g -> Type).
572
573 Local Notation Fix7 := (@Fix A R Rwf (fun a : A => forall b c d e f g h, @P a b c d e f g h)).
574 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun e => tele _ (fun f => tele _ (fun g => tele _ (fun _ : @H a b c d e f g => bottom)))))))).
575
576 Let Fix7_eq' := @FixV_eq A T R Rwf P.
577 Let Fix7_eq'T := Eval simpl in type_of Fix7_eq'.
578
579 Let Fix7_rect' := @FixV_rect A T R Rwf P.
580 Let Fix7_rect'T := Eval simpl in type_of Fix7_rect'.
581
582 Let Fix7_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
583 Let Fix7_Proper_eq'T := Eval simpl in type_of Fix7_Proper_eq'.
584
585 Let Fix7_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
586 Let Fix7_Proper_eq_with_assumption'T := Eval simpl in type_of Fix7_Proper_eq_with_assumption'.
587
588 Definition Fix7_eq : Fix7_eq'T := Fix7_eq'.
589 Definition Fix7_rect : Fix7_rect'T := Fix7_rect'.
590 Definition Fix7_Proper_eq : Fix7_Proper_eq'T := Fix7_Proper_eq'.
591 Definition Fix7_Proper_eq_with_assumption : Fix7_Proper_eq_with_assumption'T := Fix7_Proper_eq_with_assumption'.
592 End Fix7.
593
594 Arguments Fix7_Proper_eq {A B C D E F G H R Rwf P} _ _ _ _ _ _ _ _ _ _ _.
595 Arguments Fix7_Proper_eq_with_assumption {A B C D E F G H R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _ _.
596 Global Existing Instance Fix7_Proper_eq.
597 Global Existing Instance Fix7_Proper_eq_with_assumption.
598
599 Section Fix8.
600 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type) (F : forall a b c d, E a b c d -> Type) (G : forall a b c d e, F a b c d e -> Type) (H : forall a b c d e f, G a b c d e f -> Type) (I : forall a b c d e f g, H a b c d e f g -> Type)
601 (R : A -> A -> Prop) (Rwf : well_founded R)
602 (P : forall a b c d e f g h, I a b c d e f g h -> Type).
603
604 Local Notation Fix8 := (@Fix A R Rwf (fun a : A => forall b c d e f g h i, @P a b c d e f g h i)).
605 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun e => tele _ (fun f => tele _ (fun g => tele _ (fun h => tele _ (fun _ : @I a b c d e f g h => bottom))))))))).
606
607 Let Fix8_eq' := @FixV_eq A T R Rwf P.
608 Let Fix8_eq'T := Eval simpl in type_of Fix8_eq'.
609
610 Let Fix8_rect' := @FixV_rect A T R Rwf P.
611 Let Fix8_rect'T := Eval simpl in type_of Fix8_rect'.
612
613 Let Fix8_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
614 Let Fix8_Proper_eq'T := Eval simpl in type_of Fix8_Proper_eq'.
615
616 Let Fix8_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
617 Let Fix8_Proper_eq_with_assumption'T := Eval simpl in type_of Fix8_Proper_eq_with_assumption'.
618
619 Definition Fix8_eq : Fix8_eq'T := Fix8_eq'.
620 Definition Fix8_rect : Fix8_rect'T := Fix8_rect'.
621 Definition Fix8_Proper_eq : Fix8_Proper_eq'T := Fix8_Proper_eq'.
622 Definition Fix8_Proper_eq_with_assumption : Fix8_Proper_eq_with_assumption'T := Fix8_Proper_eq_with_assumption'.
623 End Fix8.
624
625 Arguments Fix8_Proper_eq {A B C D E F G H I R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _.
626 Arguments Fix8_Proper_eq_with_assumption {A B C D E F G H I R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _ _ _.
627 Global Existing Instance Fix8_Proper_eq.
628 Global Existing Instance Fix8_Proper_eq_with_assumption.
629
630 Section Fix9.
631 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type) (F : forall a b c d, E a b c d -> Type) (G : forall a b c d e, F a b c d e -> Type) (H : forall a b c d e f, G a b c d e f -> Type) (I : forall a b c d e f g, H a b c d e f g -> Type) (J : forall a b c d e f g h, I a b c d e f g h -> Type)
632 (R : A -> A -> Prop) (Rwf : well_founded R)
633 (P : forall a b c d e f g h i, J a b c d e f g h i -> Type).
634
635 Local Notation Fix9 := (@Fix A R Rwf (fun a : A => forall b c d e f g h i j, @P a b c d e f g h i j)).
636 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun e => tele _ (fun f => tele _ (fun g => tele _ (fun h => tele _ (fun i => tele _ (fun _ : @J a b c d e f g h i => bottom)))))))))).
637
638 Let Fix9_eq' := @FixV_eq A T R Rwf P.
639 Let Fix9_eq'T := Eval simpl in type_of Fix9_eq'.
640
641 Let Fix9_rect' := @FixV_rect A T R Rwf P.
642 Let Fix9_rect'T := Eval simpl in type_of Fix9_rect'.
643
644 Let Fix9_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
645 Let Fix9_Proper_eq'T := Eval simpl in type_of Fix9_Proper_eq'.
646
647 Let Fix9_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
648 Let Fix9_Proper_eq_with_assumption'T := Eval simpl in type_of Fix9_Proper_eq_with_assumption'.
649
650 Definition Fix9_eq : Fix9_eq'T := Fix9_eq'.
651 Definition Fix9_rect : Fix9_rect'T := Fix9_rect'.
652 Definition Fix9_Proper_eq : Fix9_Proper_eq'T := Fix9_Proper_eq'.
653 Definition Fix9_Proper_eq_with_assumption : Fix9_Proper_eq_with_assumption'T := Fix9_Proper_eq_with_assumption'.
654 End Fix9.
655
656 Arguments Fix9_Proper_eq {A B C D E F G H I J R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _ _.
657 Arguments Fix9_Proper_eq_with_assumption {A B C D E F G H I J R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.
658 Global Existing Instance Fix9_Proper_eq.
659 Global Existing Instance Fix9_Proper_eq_with_assumption.
660
661 Section Fix10.
662 Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type) (E : forall a b c, D a b c -> Type) (F : forall a b c d, E a b c d -> Type) (G : forall a b c d e, F a b c d e -> Type) (H : forall a b c d e f, G a b c d e f -> Type) (I : forall a b c d e f g, H a b c d e f g -> Type) (J : forall a b c d e f g h, I a b c d e f g h -> Type) (K : forall a b c d e f g h i, J a b c d e f g h i -> Type)
663 (R : A -> A -> Prop) (Rwf : well_founded R)
664 (P : forall a b c d e f g h i j, K a b c d e f g h i j -> Type).
665
666 Local Notation Fix10 := (@Fix A R Rwf (fun a : A => forall b c d e f g h i j k, @P a b c d e f g h i j k)).
667 Local Notation T := (fun a => tele _ (fun b => tele _ (fun c => tele _ (fun d => tele _ (fun e => tele _ (fun f => tele _ (fun g => tele _ (fun h => tele _ (fun i => tele _ (fun j => tele _ (fun _ : @K a b c d e f g h i j => bottom))))))))))).
668
669 Let Fix10_eq' := @FixV_eq A T R Rwf P.
670 Let Fix10_eq'T := Eval simpl in type_of Fix10_eq'.
671
672 Let Fix10_rect' := @FixV_rect A T R Rwf P.
673 Let Fix10_rect'T := Eval simpl in type_of Fix10_rect'.
674
675 Let Fix10_Proper_eq' := @FixV_Proper_eq A T R Rwf P.
676 Let Fix10_Proper_eq'T := Eval simpl in type_of Fix10_Proper_eq'.
677
678 Let Fix10_Proper_eq_with_assumption' := @FixV_Proper_eq_with_assumption A T R Rwf P.
679 Let Fix10_Proper_eq_with_assumption'T := Eval simpl in type_of Fix10_Proper_eq_with_assumption'.
680
681 Definition Fix10_eq : Fix10_eq'T := Fix10_eq'.
682 Definition Fix10_rect : Fix10_rect'T := Fix10_rect'.
683 Definition Fix10_Proper_eq : Fix10_Proper_eq'T := Fix10_Proper_eq'.
684 Definition Fix10_Proper_eq_with_assumption : Fix10_Proper_eq_with_assumption'T := Fix10_Proper_eq_with_assumption'.
685 End Fix10.
686
687 Arguments Fix10_Proper_eq {A B C D E F G H I J K R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _ _ _.
688 Arguments Fix10_Proper_eq_with_assumption {A B C D E F G H I J K R Rwf P} _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.
689 Global Existing Instance Fix10_Proper_eq.
690 Global Existing Instance Fix10_Proper_eq_with_assumption.