Polymorphic Record Category (obj : Type) :=
{
Morphism : obj -> obj -> Type;
Identity : forall o, Morphism o o
}.
Polymorphic Record Functor objC (C :Category objC) objD (D : Category objD) :=
{
ObjectOf :> objC -> objD;
MorphismOf : forall s d, C.(Morphism) s d -> D.(Morphism) (ObjectOf s) (ObjectOf d);
FIdentityOf : forall o, MorphismOf _ _ (C.(Identity) o) = D.(Identity) (ObjectOf o)
}.
Create HintDb functor discriminated.
#[export] HintRewrite @FIdentityOf : functor.
Polymorphic Definition ComposeFunctors objC C objD D objE E (G : @Functor objD D objE E) (F : @Functor objC C objD D) : Functor C E.
refine {| ObjectOf := (fun c => G (F c));
MorphismOf := (fun _ _ m => G.(MorphismOf) _ _ (F.(MorphismOf) _ _ m))
|}; intros; autorewrite with functor; reflexivity. Defined.
Definition Cat0 : Category@{i j} Empty_set.
refine {|
Morphism := fun s d : Empty_set => s = d;
Identity := fun o : Empty_set => eq_refl
|};
admit. Defined.
Polymorphic Definition Cat0 : Category Empty_set.
refine {|
Morphism := fun s d : Empty_set => s = d;
Identity := fun o : Empty_set => eq_refl;
Compose := fun s d d2 m0 m1 => eq_trans m1 m0
|};
admit. Defined.
Set Printing All. Set Printing Universes.
Polymorphic Definition ProductLaw0Functor (objC : Type) (C : Category objC) : Functor (ProductCategory C Cat0) Cat0.
refine (Build_Functor (ProductCategory C Cat0) Cat0 _ _). (* Toplevel input, characters 15-71: Error: Refiner was given an argument
"prod (* Top.2289 Top.2289 *) "Type (* Top.2289 *)" instead of "Set". *) Abort.
Polymorphic Definition ProductLaw0Functor (objC : Type) (C : Category objC) : Functor (ProductCategory C Cat0) Cat0.
econstructor. (* Toplevel input, characters 0-12: Error: No applicable tactic.
*) Abort. End Comment2.
#[export] Polymorphic Hint Resolve foo. (* success *)
#[export] Polymorphic HintRewrite @foo. (* Success *)
#[export] Polymorphic Hint Resolve @foo. (* Error: @foo is a term and cannot be made a polymorphic hint, only global references can be polymorphic hints. *)
Fail #[export] Polymorphic HintRewrite foo. (* Error: Cannot infer the implicit parameter obj of foo. *) End Comment3.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.