Why is an object not defined as identity morphism?References on functorially-defined subgroups“Distributivity” of unary operationsWhat do people mean by “subcategory”?Why do categorical foundationalists want to escape set theory?Tensor product and category theoryHomset vs one collectionIs there a nice application of category theory to functional/complex/harmonic analysis?Is a background in Category Theory enough for starting a PhD in Category Theory?What's there to do in category theory?The “derived drift” is pretty unsatisfying and dangerous to category theory (or at least, to me)

Why is an object not defined as identity morphism?


References on functorially-defined subgroups“Distributivity” of unary operationsWhat do people mean by “subcategory”?Why do categorical foundationalists want to escape set theory?Tensor product and category theoryHomset vs one collectionIs there a nice application of category theory to functional/complex/harmonic analysis?Is a background in Category Theory enough for starting a PhD in Category Theory?What's there to do in category theory?The “derived drift” is pretty unsatisfying and dangerous to category theory (or at least, to me)













7












$begingroup$


I've seen that there was a single-sorted definition of a category. In some ways, it seems more understandable than the original definition.



I don't know much about category theory. But I would like to know how each definition is useful.










share|cite|improve this question









$endgroup$









  • 17




    $begingroup$
    The two-sorted definition corresponds to how most people think of categories, and how they talk about categories. For example, we speak of the categories of sets (not of functions), of groups (not of group homomorphisms), of topological spaces (not of continuous maps), etc. (If I remember correctly, Ehresmann did write about the categories of functions, of homomorphisms, of continuous maps, etc., but that never caught on.)
    $endgroup$
    – Andreas Blass
    Jul 19 at 16:39






  • 1




    $begingroup$
    One can identify an object with its identity morphism. Then we have a category consisting of morphisms that can be composed. Usually the composition is thought of one function for the whole category. However, the composition function can be broken up into a performing compositions, one such place for each object. In higher order category theory there may be 2-morphisms between the usual morphisms. They may also be places or performing compositions. With the appropriate additional axioms higher order category theory fits into this scheme.
    $endgroup$
    – Jay Kangel
    Jul 19 at 17:52










  • $begingroup$
    My impression is that the single-sorted POV is slightly more widespread in the context of groupoids (considered as small categories where every morphism is iso) but I am not a specialist and would be happy to be corrected here by others. However, one often ends up introducing the "unit space" of the groupoid which is the "set of objects", so even then two sorts seem to emerge
    $endgroup$
    – Yemon Choi
    Jul 19 at 18:20







  • 4




    $begingroup$
    Another area where the single sorted definition is more widespread is when working with strict $n$-categories or strict $infty$-categories. Working with the single sorted definition allows to compose arrows of different dimension without writing iterated identities everywhere. It makes the manipulation of expressions a little more bearable, so lots of paper use it (where the "lots" need to be taken relatively as there is not that many paper on that topics anyway)
    $endgroup$
    – Simon Henry
    Jul 19 at 19:54







  • 1




    $begingroup$
    Actually I would argue that the homsets-definition (ncatlab.org/nlab/show/category#AFamilyOfCollectionsOfMorphisms) is the one that corresponds to how more people think of categories in practice.
    $endgroup$
    – Mike Shulman
    Jul 21 at 23:26















7












$begingroup$


I've seen that there was a single-sorted definition of a category. In some ways, it seems more understandable than the original definition.



I don't know much about category theory. But I would like to know how each definition is useful.










share|cite|improve this question









$endgroup$









  • 17




    $begingroup$
    The two-sorted definition corresponds to how most people think of categories, and how they talk about categories. For example, we speak of the categories of sets (not of functions), of groups (not of group homomorphisms), of topological spaces (not of continuous maps), etc. (If I remember correctly, Ehresmann did write about the categories of functions, of homomorphisms, of continuous maps, etc., but that never caught on.)
    $endgroup$
    – Andreas Blass
    Jul 19 at 16:39






  • 1




    $begingroup$
    One can identify an object with its identity morphism. Then we have a category consisting of morphisms that can be composed. Usually the composition is thought of one function for the whole category. However, the composition function can be broken up into a performing compositions, one such place for each object. In higher order category theory there may be 2-morphisms between the usual morphisms. They may also be places or performing compositions. With the appropriate additional axioms higher order category theory fits into this scheme.
    $endgroup$
    – Jay Kangel
    Jul 19 at 17:52










  • $begingroup$
    My impression is that the single-sorted POV is slightly more widespread in the context of groupoids (considered as small categories where every morphism is iso) but I am not a specialist and would be happy to be corrected here by others. However, one often ends up introducing the "unit space" of the groupoid which is the "set of objects", so even then two sorts seem to emerge
    $endgroup$
    – Yemon Choi
    Jul 19 at 18:20







  • 4




    $begingroup$
    Another area where the single sorted definition is more widespread is when working with strict $n$-categories or strict $infty$-categories. Working with the single sorted definition allows to compose arrows of different dimension without writing iterated identities everywhere. It makes the manipulation of expressions a little more bearable, so lots of paper use it (where the "lots" need to be taken relatively as there is not that many paper on that topics anyway)
    $endgroup$
    – Simon Henry
    Jul 19 at 19:54







  • 1




    $begingroup$
    Actually I would argue that the homsets-definition (ncatlab.org/nlab/show/category#AFamilyOfCollectionsOfMorphisms) is the one that corresponds to how more people think of categories in practice.
    $endgroup$
    – Mike Shulman
    Jul 21 at 23:26













7












7








7





$begingroup$


I've seen that there was a single-sorted definition of a category. In some ways, it seems more understandable than the original definition.



I don't know much about category theory. But I would like to know how each definition is useful.










share|cite|improve this question









$endgroup$




I've seen that there was a single-sorted definition of a category. In some ways, it seems more understandable than the original definition.



I don't know much about category theory. But I would like to know how each definition is useful.







ct.category-theory






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jul 19 at 16:35









Usin JungUsin Jung

382 bronze badges




382 bronze badges










  • 17




    $begingroup$
    The two-sorted definition corresponds to how most people think of categories, and how they talk about categories. For example, we speak of the categories of sets (not of functions), of groups (not of group homomorphisms), of topological spaces (not of continuous maps), etc. (If I remember correctly, Ehresmann did write about the categories of functions, of homomorphisms, of continuous maps, etc., but that never caught on.)
    $endgroup$
    – Andreas Blass
    Jul 19 at 16:39






  • 1




    $begingroup$
    One can identify an object with its identity morphism. Then we have a category consisting of morphisms that can be composed. Usually the composition is thought of one function for the whole category. However, the composition function can be broken up into a performing compositions, one such place for each object. In higher order category theory there may be 2-morphisms between the usual morphisms. They may also be places or performing compositions. With the appropriate additional axioms higher order category theory fits into this scheme.
    $endgroup$
    – Jay Kangel
    Jul 19 at 17:52










  • $begingroup$
    My impression is that the single-sorted POV is slightly more widespread in the context of groupoids (considered as small categories where every morphism is iso) but I am not a specialist and would be happy to be corrected here by others. However, one often ends up introducing the "unit space" of the groupoid which is the "set of objects", so even then two sorts seem to emerge
    $endgroup$
    – Yemon Choi
    Jul 19 at 18:20







  • 4




    $begingroup$
    Another area where the single sorted definition is more widespread is when working with strict $n$-categories or strict $infty$-categories. Working with the single sorted definition allows to compose arrows of different dimension without writing iterated identities everywhere. It makes the manipulation of expressions a little more bearable, so lots of paper use it (where the "lots" need to be taken relatively as there is not that many paper on that topics anyway)
    $endgroup$
    – Simon Henry
    Jul 19 at 19:54







  • 1




    $begingroup$
    Actually I would argue that the homsets-definition (ncatlab.org/nlab/show/category#AFamilyOfCollectionsOfMorphisms) is the one that corresponds to how more people think of categories in practice.
    $endgroup$
    – Mike Shulman
    Jul 21 at 23:26












  • 17




    $begingroup$
    The two-sorted definition corresponds to how most people think of categories, and how they talk about categories. For example, we speak of the categories of sets (not of functions), of groups (not of group homomorphisms), of topological spaces (not of continuous maps), etc. (If I remember correctly, Ehresmann did write about the categories of functions, of homomorphisms, of continuous maps, etc., but that never caught on.)
    $endgroup$
    – Andreas Blass
    Jul 19 at 16:39






  • 1




    $begingroup$
    One can identify an object with its identity morphism. Then we have a category consisting of morphisms that can be composed. Usually the composition is thought of one function for the whole category. However, the composition function can be broken up into a performing compositions, one such place for each object. In higher order category theory there may be 2-morphisms between the usual morphisms. They may also be places or performing compositions. With the appropriate additional axioms higher order category theory fits into this scheme.
    $endgroup$
    – Jay Kangel
    Jul 19 at 17:52










  • $begingroup$
    My impression is that the single-sorted POV is slightly more widespread in the context of groupoids (considered as small categories where every morphism is iso) but I am not a specialist and would be happy to be corrected here by others. However, one often ends up introducing the "unit space" of the groupoid which is the "set of objects", so even then two sorts seem to emerge
    $endgroup$
    – Yemon Choi
    Jul 19 at 18:20







  • 4




    $begingroup$
    Another area where the single sorted definition is more widespread is when working with strict $n$-categories or strict $infty$-categories. Working with the single sorted definition allows to compose arrows of different dimension without writing iterated identities everywhere. It makes the manipulation of expressions a little more bearable, so lots of paper use it (where the "lots" need to be taken relatively as there is not that many paper on that topics anyway)
    $endgroup$
    – Simon Henry
    Jul 19 at 19:54







  • 1




    $begingroup$
    Actually I would argue that the homsets-definition (ncatlab.org/nlab/show/category#AFamilyOfCollectionsOfMorphisms) is the one that corresponds to how more people think of categories in practice.
    $endgroup$
    – Mike Shulman
    Jul 21 at 23:26







17




17




$begingroup$
The two-sorted definition corresponds to how most people think of categories, and how they talk about categories. For example, we speak of the categories of sets (not of functions), of groups (not of group homomorphisms), of topological spaces (not of continuous maps), etc. (If I remember correctly, Ehresmann did write about the categories of functions, of homomorphisms, of continuous maps, etc., but that never caught on.)
$endgroup$
– Andreas Blass
Jul 19 at 16:39




$begingroup$
The two-sorted definition corresponds to how most people think of categories, and how they talk about categories. For example, we speak of the categories of sets (not of functions), of groups (not of group homomorphisms), of topological spaces (not of continuous maps), etc. (If I remember correctly, Ehresmann did write about the categories of functions, of homomorphisms, of continuous maps, etc., but that never caught on.)
$endgroup$
– Andreas Blass
Jul 19 at 16:39




1




1




$begingroup$
One can identify an object with its identity morphism. Then we have a category consisting of morphisms that can be composed. Usually the composition is thought of one function for the whole category. However, the composition function can be broken up into a performing compositions, one such place for each object. In higher order category theory there may be 2-morphisms between the usual morphisms. They may also be places or performing compositions. With the appropriate additional axioms higher order category theory fits into this scheme.
$endgroup$
– Jay Kangel
Jul 19 at 17:52




$begingroup$
One can identify an object with its identity morphism. Then we have a category consisting of morphisms that can be composed. Usually the composition is thought of one function for the whole category. However, the composition function can be broken up into a performing compositions, one such place for each object. In higher order category theory there may be 2-morphisms between the usual morphisms. They may also be places or performing compositions. With the appropriate additional axioms higher order category theory fits into this scheme.
$endgroup$
– Jay Kangel
Jul 19 at 17:52












$begingroup$
My impression is that the single-sorted POV is slightly more widespread in the context of groupoids (considered as small categories where every morphism is iso) but I am not a specialist and would be happy to be corrected here by others. However, one often ends up introducing the "unit space" of the groupoid which is the "set of objects", so even then two sorts seem to emerge
$endgroup$
– Yemon Choi
Jul 19 at 18:20





$begingroup$
My impression is that the single-sorted POV is slightly more widespread in the context of groupoids (considered as small categories where every morphism is iso) but I am not a specialist and would be happy to be corrected here by others. However, one often ends up introducing the "unit space" of the groupoid which is the "set of objects", so even then two sorts seem to emerge
$endgroup$
– Yemon Choi
Jul 19 at 18:20





4




4




$begingroup$
Another area where the single sorted definition is more widespread is when working with strict $n$-categories or strict $infty$-categories. Working with the single sorted definition allows to compose arrows of different dimension without writing iterated identities everywhere. It makes the manipulation of expressions a little more bearable, so lots of paper use it (where the "lots" need to be taken relatively as there is not that many paper on that topics anyway)
$endgroup$
– Simon Henry
Jul 19 at 19:54





$begingroup$
Another area where the single sorted definition is more widespread is when working with strict $n$-categories or strict $infty$-categories. Working with the single sorted definition allows to compose arrows of different dimension without writing iterated identities everywhere. It makes the manipulation of expressions a little more bearable, so lots of paper use it (where the "lots" need to be taken relatively as there is not that many paper on that topics anyway)
$endgroup$
– Simon Henry
Jul 19 at 19:54





1




1




$begingroup$
Actually I would argue that the homsets-definition (ncatlab.org/nlab/show/category#AFamilyOfCollectionsOfMorphisms) is the one that corresponds to how more people think of categories in practice.
$endgroup$
– Mike Shulman
Jul 21 at 23:26




$begingroup$
Actually I would argue that the homsets-definition (ncatlab.org/nlab/show/category#AFamilyOfCollectionsOfMorphisms) is the one that corresponds to how more people think of categories in practice.
$endgroup$
– Mike Shulman
Jul 21 at 23:26










2 Answers
2






active

oldest

votes


















14












$begingroup$

They're so automatically interchangeable that it doesn't really make sense to say that one is more useful than the other except in minor ways: if we really care about "symbolic parsimoy" then the object-free approach has a minor advantage, while if we care about matching informal discourse then objects are generally essential (per Andreas' comment).



Ultimately I'd say that the second point wins out - it's hard to beat intuitive clarity if the cost is so minor. But since the translations in both directions are really so trivial, you can use whichever one you want. And to be fair, it's not the case that the two-sorted approach is always more intuitive - when thinking of a group as a category, having to consider an utterly pointless object is a bit weird at first. (EDIT: Simon Henry's comment points out a more convincing example of this, where the two-sorted approach results in meaningfully annoying technical overhead.)






share|cite|improve this answer











$endgroup$






















    0












    $begingroup$

    Your question is good, as well as the answers.
    I'm wondering about a first undergraduate course in General Topology, or Measure Theory, or Group Theory, where one would avoid any reference to sets with structures, and everything would be said in terms of morphisms... can you explain even Linear Algebra from scratch with just linear maps and never mention vector spaces nor of course vectors themselves? probably, since a vector in E is the same as a linear map R->E, or in other words, a linear map composable on the right with (the identity of) E and on the left with (the identity of) R. Fun!






    share|cite|improve this answer











    $endgroup$

















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "504"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathoverflow.net%2fquestions%2f336533%2fwhy-is-an-object-not-defined-as-identity-morphism%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      14












      $begingroup$

      They're so automatically interchangeable that it doesn't really make sense to say that one is more useful than the other except in minor ways: if we really care about "symbolic parsimoy" then the object-free approach has a minor advantage, while if we care about matching informal discourse then objects are generally essential (per Andreas' comment).



      Ultimately I'd say that the second point wins out - it's hard to beat intuitive clarity if the cost is so minor. But since the translations in both directions are really so trivial, you can use whichever one you want. And to be fair, it's not the case that the two-sorted approach is always more intuitive - when thinking of a group as a category, having to consider an utterly pointless object is a bit weird at first. (EDIT: Simon Henry's comment points out a more convincing example of this, where the two-sorted approach results in meaningfully annoying technical overhead.)






      share|cite|improve this answer











      $endgroup$



















        14












        $begingroup$

        They're so automatically interchangeable that it doesn't really make sense to say that one is more useful than the other except in minor ways: if we really care about "symbolic parsimoy" then the object-free approach has a minor advantage, while if we care about matching informal discourse then objects are generally essential (per Andreas' comment).



        Ultimately I'd say that the second point wins out - it's hard to beat intuitive clarity if the cost is so minor. But since the translations in both directions are really so trivial, you can use whichever one you want. And to be fair, it's not the case that the two-sorted approach is always more intuitive - when thinking of a group as a category, having to consider an utterly pointless object is a bit weird at first. (EDIT: Simon Henry's comment points out a more convincing example of this, where the two-sorted approach results in meaningfully annoying technical overhead.)






        share|cite|improve this answer











        $endgroup$

















          14












          14








          14





          $begingroup$

          They're so automatically interchangeable that it doesn't really make sense to say that one is more useful than the other except in minor ways: if we really care about "symbolic parsimoy" then the object-free approach has a minor advantage, while if we care about matching informal discourse then objects are generally essential (per Andreas' comment).



          Ultimately I'd say that the second point wins out - it's hard to beat intuitive clarity if the cost is so minor. But since the translations in both directions are really so trivial, you can use whichever one you want. And to be fair, it's not the case that the two-sorted approach is always more intuitive - when thinking of a group as a category, having to consider an utterly pointless object is a bit weird at first. (EDIT: Simon Henry's comment points out a more convincing example of this, where the two-sorted approach results in meaningfully annoying technical overhead.)






          share|cite|improve this answer











          $endgroup$



          They're so automatically interchangeable that it doesn't really make sense to say that one is more useful than the other except in minor ways: if we really care about "symbolic parsimoy" then the object-free approach has a minor advantage, while if we care about matching informal discourse then objects are generally essential (per Andreas' comment).



          Ultimately I'd say that the second point wins out - it's hard to beat intuitive clarity if the cost is so minor. But since the translations in both directions are really so trivial, you can use whichever one you want. And to be fair, it's not the case that the two-sorted approach is always more intuitive - when thinking of a group as a category, having to consider an utterly pointless object is a bit weird at first. (EDIT: Simon Henry's comment points out a more convincing example of this, where the two-sorted approach results in meaningfully annoying technical overhead.)







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Jul 19 at 20:15

























          answered Jul 19 at 18:48









          Noah SchweberNoah Schweber

          20.5k3 gold badges52 silver badges154 bronze badges




          20.5k3 gold badges52 silver badges154 bronze badges
























              0












              $begingroup$

              Your question is good, as well as the answers.
              I'm wondering about a first undergraduate course in General Topology, or Measure Theory, or Group Theory, where one would avoid any reference to sets with structures, and everything would be said in terms of morphisms... can you explain even Linear Algebra from scratch with just linear maps and never mention vector spaces nor of course vectors themselves? probably, since a vector in E is the same as a linear map R->E, or in other words, a linear map composable on the right with (the identity of) E and on the left with (the identity of) R. Fun!






              share|cite|improve this answer











              $endgroup$



















                0












                $begingroup$

                Your question is good, as well as the answers.
                I'm wondering about a first undergraduate course in General Topology, or Measure Theory, or Group Theory, where one would avoid any reference to sets with structures, and everything would be said in terms of morphisms... can you explain even Linear Algebra from scratch with just linear maps and never mention vector spaces nor of course vectors themselves? probably, since a vector in E is the same as a linear map R->E, or in other words, a linear map composable on the right with (the identity of) E and on the left with (the identity of) R. Fun!






                share|cite|improve this answer











                $endgroup$

















                  0












                  0








                  0





                  $begingroup$

                  Your question is good, as well as the answers.
                  I'm wondering about a first undergraduate course in General Topology, or Measure Theory, or Group Theory, where one would avoid any reference to sets with structures, and everything would be said in terms of morphisms... can you explain even Linear Algebra from scratch with just linear maps and never mention vector spaces nor of course vectors themselves? probably, since a vector in E is the same as a linear map R->E, or in other words, a linear map composable on the right with (the identity of) E and on the left with (the identity of) R. Fun!






                  share|cite|improve this answer











                  $endgroup$



                  Your question is good, as well as the answers.
                  I'm wondering about a first undergraduate course in General Topology, or Measure Theory, or Group Theory, where one would avoid any reference to sets with structures, and everything would be said in terms of morphisms... can you explain even Linear Algebra from scratch with just linear maps and never mention vector spaces nor of course vectors themselves? probably, since a vector in E is the same as a linear map R->E, or in other words, a linear map composable on the right with (the identity of) E and on the left with (the identity of) R. Fun!







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Jul 21 at 17:15

























                  answered Jul 21 at 17:10









                  Gael MeigniezGael Meigniez

                  7184 silver badges13 bronze badges




                  7184 silver badges13 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to MathOverflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathoverflow.net%2fquestions%2f336533%2fwhy-is-an-object-not-defined-as-identity-morphism%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                      Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                      Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form