Skip to content

Commit 945209d

Browse files
committed
demo should not break abstractions
1 parent 635cc47 commit 945209d

File tree

1 file changed

+14
-90
lines changed

1 file changed

+14
-90
lines changed

tests/enriched_cat_case6.v

Lines changed: 14 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,7 @@ HB.instance Definition cmfunQ :=
313313
Definition cmfunQ_comp {A B: CMon.type} (f g: hom A B) : hom A B :=
314314
fun x => @mop B (f x) (g x).
315315

316-
Definition cmfunQ_zero {A B: CMon.type} : hom A B.
317-
destruct B.
318-
unfold hom; simpl; intro.
319-
destruct class.
320-
destruct enriched_cat_case5_isMon_mixin.
321-
exact munit0.
322-
Defined.
316+
Definition cmfunQ_zero {A B: CMon.type} : hom A B := fun a : A => munit.
323317

324318
(* does not work without declaring the Magma wrapper *)
325319
HB.instance Definition cmfunQ_isMagma (A B: CMon.type) :
@@ -332,29 +326,19 @@ Obligation 1.
332326
unfold associative, mop; simpl; intros.
333327
unfold cmfunQ_comp; simpl; intros.
334328
eapply functional_extensionality; intro x0.
335-
destruct B.
336-
destruct class.
337-
destruct enriched_cat_case5_isMon_mixin.
338-
simpl in *.
339-
eapply massoc0; auto.
329+
refine (massoc _ _ _).
340330
Qed.
341331
Obligation 2.
342332
unfold left_id, mop; simpl; intros.
343333
unfold cmfunQ_comp, cmfunQ_zero; simpl; intros.
344334
eapply functional_extensionality; intro x0.
345-
destruct B.
346-
destruct class.
347-
destruct enriched_cat_case5_isMon_mixin.
348-
auto.
335+
refine (mlid _).
349336
Qed.
350337
Obligation 3.
351338
unfold right_id, mop; simpl; intros.
352339
unfold cmfunQ_comp, cmfunQ_zero; simpl; intros.
353340
eapply functional_extensionality; intro x0.
354-
destruct B.
355-
destruct class.
356-
destruct enriched_cat_case5_isMon_mixin.
357-
auto.
341+
refine (mrid _).
358342
Qed.
359343

360344
Program Definition cmfunQ_isCAlg (A B: CMon.type) :
@@ -363,11 +347,7 @@ Obligation 1.
363347
unfold commutative, mop; simpl; intros.
364348
unfold cmfunQ_comp; simpl; intros.
365349
eapply functional_extensionality; intro x0.
366-
destruct B.
367-
destruct class.
368-
destruct enriched_cat_case5_isCAlg_mixin.
369-
simpl in *.
370-
eapply acomm0; auto.
350+
refine (acomm _ _).
371351
Qed.
372352

373353
HB.instance Definition cmfunQ_isMonoid (A B: CMon.type) :
@@ -399,14 +379,7 @@ HB.instance Definition imfunQ :=
399379
Definition imfunQ_comp {A B: IMon.type} (f g: hom A B) : hom A B :=
400380
fun x => @mop B (f x) (g x).
401381

402-
Definition imfunQ_zero {A B: IMon.type} : hom A B.
403-
destruct B.
404-
unfold hom; simpl; intro.
405-
destruct class.
406-
destruct enriched_cat_case1_isIMon_mixin.
407-
destruct imon0.
408-
exact munit0.
409-
Defined.
382+
Definition imfunQ_zero {A B: IMon.type} : hom A B := fun a : A => munit.
410383

411384
(* does not work without declaring the Magma wrapper *)
412385
HB.instance Definition imfunQ_isMagma (A B: IMon.type) :
@@ -419,32 +392,19 @@ Obligation 1.
419392
unfold associative, mop; simpl; intros.
420393
unfold imfunQ_comp; simpl; intros.
421394
eapply functional_extensionality; intro x0.
422-
destruct B.
423-
destruct class.
424-
destruct enriched_cat_case1_isIMon_mixin.
425-
simpl in *.
426-
destruct imon0.
427-
eapply massoc0; auto.
395+
refine (massoc _ _ _).
428396
Qed.
429397
Obligation 2.
430398
unfold left_id, mop; simpl; intros.
431399
unfold imfunQ_comp, imfunQ_zero; simpl; intros.
432400
eapply functional_extensionality; intro x0.
433-
destruct B.
434-
destruct class.
435-
destruct enriched_cat_case1_isIMon_mixin.
436-
destruct imon0.
437-
auto.
401+
refine (mlid _).
438402
Qed.
439403
Obligation 3.
440404
unfold right_id, mop; simpl; intros.
441405
unfold imfunQ_comp, imfunQ_zero; simpl; intros.
442406
eapply functional_extensionality; intro x0.
443-
destruct B.
444-
destruct class.
445-
destruct enriched_cat_case1_isIMon_mixin.
446-
destruct imon0.
447-
auto.
407+
refine (mrid _).
448408
Qed.
449409

450410
Program Definition imfunQ_isIAlg (A B: IMon.type) :
@@ -453,20 +413,7 @@ Obligation 1.
453413
unfold idempotent, mop; simpl; intros.
454414
unfold imfunQ_comp; simpl; intros.
455415
eapply functional_extensionality; intro x0.
456-
destruct B.
457-
destruct class.
458-
destruct enriched_cat_case1_isIMon_mixin.
459-
simpl in *.
460-
destruct iia0; auto.
461-
Qed.
462-
463-
Program Definition imfunQ_isIMon (A B: IMon.type) :
464-
isIMon (hom A B) := isIMon.Build (hom A B) _ _.
465-
Obligation 1.
466-
eapply imfunQ_isIAlg.
467-
Qed.
468-
Obligation 2.
469-
eapply imfunQ_isMon.
416+
refine (aidem _).
470417
Qed.
471418

472419
HB.instance Definition imfunQ_isMonoid (A B: IMon.type) :
@@ -475,9 +422,6 @@ HB.instance Definition imfunQ_isMonoid (A B: IMon.type) :
475422
HB.instance Definition imfunQ_isIAlgebra (A B: IMon.type) :
476423
isIAlg (hom A B) := imfunQ_isIAlg A B.
477424

478-
HB.instance Definition imfunQ_isIMonoid (A B: IMon.type) :
479-
isIMon (hom A B) := imfunQ_isIMon A B.
480-
481425
Check IMon.type : IAlg_enriched_quiver.type.
482426

483427
(*********************************************************)
@@ -495,14 +439,7 @@ HB.instance Definition icmfunQ :=
495439
Definition icmfunQ_comp {A B: ICMon.type} (f g: hom A B) : hom A B :=
496440
fun x => @mop B (f x) (g x).
497441

498-
Definition icmfunQ_zero {A B: ICMon.type} : hom A B.
499-
destruct B.
500-
unfold hom; simpl; intro.
501-
destruct class.
502-
destruct enriched_cat_case1_isICMon_mixin.
503-
destruct mon0.
504-
exact munit0.
505-
Defined.
442+
Definition icmfunQ_zero {A B: ICMon.type} : hom A B := fun a : A => munit.
506443

507444
(* does not work without declaring the Magma wrapper *)
508445
HB.instance Definition icmfunQ_isMagma (A B: ICMon.type) :
@@ -515,32 +452,19 @@ Obligation 1.
515452
unfold associative, mop; simpl; intros.
516453
unfold icmfunQ_comp; simpl; intros.
517454
eapply functional_extensionality; intro x0.
518-
destruct B.
519-
destruct class.
520-
destruct enriched_cat_case1_isICMon_mixin.
521-
simpl in *.
522-
destruct mon0.
523-
eapply massoc0; auto.
455+
refine (massoc _ _ _).
524456
Qed.
525457
Obligation 2.
526458
unfold left_id, mop; simpl; intros.
527459
unfold icmfunQ_comp, icmfunQ_zero; simpl; intros.
528460
eapply functional_extensionality; intro x0.
529-
destruct B.
530-
destruct class.
531-
destruct enriched_cat_case1_isICMon_mixin.
532-
destruct mon0.
533-
auto.
461+
refine (mlid _).
534462
Qed.
535463
Obligation 3.
536464
unfold right_id, mop; simpl; intros.
537465
unfold icmfunQ_comp, icmfunQ_zero; simpl; intros.
538466
eapply functional_extensionality; intro x0.
539-
destruct B.
540-
destruct class.
541-
destruct enriched_cat_case1_isICMon_mixin.
542-
destruct mon0.
543-
auto.
467+
refine (mrid _).
544468
Qed.
545469

546470

0 commit comments

Comments
 (0)