lean4-htt/tests/lean_before_refactoring/run/coe11.lean
Sebastian Ullrich fd2c42a8bf chore(library, tests): switch to new attribute declaration syntax
sed -Ei 's/^(\s*)((private |protected )?(noncomputable )?(abbreviation|definition|meta_definition|theorem|lemma|proposition|corollary)\s+\S+\s*)((\s*\[(\S+(\s+[0-9]+)*|priority.*)\])+)\s*/\1attribute \6\n\1\2/' library/**/*.lean tests/**/*.lean
sed -Ei 's/\s+$//' library/**/*.lean  # remove trailing whitespace
2016-08-12 15:36:12 -07:00

27 lines
990 B
Text

import algebra.category.basic
open category
inductive my_functor {obC obD : Type} (C : category obC) (D : category obD) : Type :=
mk : Π (obF : obC → obD) (homF : Π{A B : obC}, hom A B → hom (obF A) (obF B)),
(Π {A : obC}, homF (ID A) = ID (obF A)) →
(Π {A B C : obC} {f : hom A B} {g : hom B C}, homF (g ∘ f) = homF g ∘ homF f) →
my_functor C D
attribute [coercion]
definition my_object {obC obD : Type} {C : category obC} {D : category obD} (F : my_functor C D) : obC → obD :=
my_functor.rec (λ obF homF Hid Hcomp, obF) F
attribute [coercion]
definition my_homphism {obC obD : Type} {C : category obC} {D : category obD} (F : my_functor C D) :
Π{A B : obC}, hom A B → hom (my_object F A) (my_object F B) :=
my_functor.rec (λ obF homF Hid Hcomp, homF) F
constants obC obD : Type
constants a b : obC
constant C : category obC
attribute C [instance]
constant D : category obD
constant F : my_functor C D
constant m : hom a b
check F a
check F m