Discussion of Homotopy Type Theory and Univalent Foundations
 help / color / mirror / Atom feed
From: xieyuheng <xyheme@gmail.com>
To: Homotopy Type Theory <HomotopyTypeTheory@googlegroups.com>
Subject: [HoTT] Re: is there a categorical construction to generalize arrow composition, by allowing domain and codomain to be refined (or changed) by the composition ?
Date: Tue, 19 Jun 2018 01:07:33 -0700 (PDT)	[thread overview]
Message-ID: <ca4b0d50-f038-4072-b27f-5f2d0b433bed@googlegroups.com> (raw)
In-Reply-To: <5edbc6da-6e18-45af-8ac0-e498f122a4ec@googlegroups.com>


[-- Attachment #1.1: Type: text/plain, Size: 4315 bytes --]

thank you Matt Oliveri.

the substitutions you used above explains my examples perfectly.
I also found a bug in my second examples :

f   : (A, t1, t2) -> (A, t, t3, t4)
g   : (B, t3, t4) -> (B, t6, t7)

(unify)
B = (A, t)

f   : (A, t1, t2) -> (A, t, t3, t4)
g   : (A, t, t3, t4) -> (A, t, t6, t7)

f;g : (A, t1, t2) -> (A, t, t6, t7)

(shorten)
f;g : (t1, t2) -> (t, t6, t7)

(but I mistakenly wrote)
f;g : (t, t1, t2) -> (t, t6, t7)

---

I will learn more about polycategory and polymorphic,
and try to use them to explain dependent type system.

thank you again :)

------

xieyuheng


On Tuesday, June 19, 2018 at 2:58:05 AM UTC+8, Matt Oliveri wrote:
>
> Hi, Xieyuheng.
>
> On Monday, June 18, 2018 at 12:32:14 PM UTC-4, xieyuheng wrote:
>>
>> is there a categorical construction to generalize arrow composition,
>> by allowing domain and codomain to be refined (or changed) by the
>> composition ?
>>
>> this construction would be useful for
>> forming theoretical background of dependent type system.
>>
>> for example, compose two functions
>> f : (A x -> B y)
>> g : (B n -> C z)
>> will give us a function of type (A n -> C z)
>>
>
> I can't figure out what rule you're using to get that type. If n unifies 
> with y, how did x become n also? That's what I'm guessing you're trying.
>
>
>> another example would be the following generalized composition in 
>> cartesian closed category :
>>         f   : (t1, t2) -> (t3, t4)
>>         g   : (t, t3, t4) -> (t6, t7)
>>         f;g : (t, t1, t2) -> (t6, t7)
>> and
>>         f   : (t1, t2) -> (t, t3, t4)
>>         g   : (t3, t4) -> (t6, t7)
>>         f;g : (t, t1, t2) -> (t, t6, t7)
>> this can be called `cut`
>> because it looks like gentzen's cut rule in sequent calculus,
>> and it can be used to provide semantic
>> for a stack based concatenative programming language.
>>
>
> This looks more like a combination of composition and tensoring, in a 
> monoidal category. Based on some stuff in a blog post (
> https://golem.ph.utexas.edu/category/2017/11/the_polycategory_of_multivaria.html), 
> the cut rule is instead composition in a polycategory, and you can only cut 
> out one type at a time.
>
> I'm thinking the first "generalized composition" could be explained thus:
> f only looks at the top two stack elements, and replaces them with three 
> others. But the stack generally has additional elements, which I'll 
> abstract away as Γ:
> f  :  (Γ, t1, t2) -> (Γ, t3, t4)
>
> g has a similar story, but we use a different stack/context variable to 
> avoid accidental constraints:
> g  :  (Δ, t, t3, t4) -> (Δ, t6, t7)
>
> To compose these, we need (Γ, t3, t4) to unify with (Δ, t, t3, t4), so (Γ 
> := Δ, t), and
> f;g  :  (Δ, t, t1, t2) -> (Δ, t6, t7)
> which we shorten to (t, t1, t2) -> (t6, t7).
>
> So your composable operators seem to be substitutions (morphisms between 
> contexts) that are polymorphic in most of the context. All but a finite 
> chunk all the way on the right. Composition would presumably be composition 
> of substitutions, after instantiating them with the principal unifier.
>
> For simply-typed systems, contexts and substitutions can be modeled in a 
> monoidal category, which includes cartesian closed categories. For 
> dependent type systems, other kinds of categories are used, like contextual 
> categories and categories with families; hopefully what you want is still 
> instantiation and composition of this new kind of substitution.
>
> I'm not an expert on the kinds of categorical structures involved, but 
> hopefully polymorphic substitutions is a good way of thinking about what 
> you're doing, which connects it with categorical models.
>
> Beware that with dependent types, there generally are not principal 
> unifiers, due to binding operators appearing in types. But concatenative 
> people don't seem to like binders, so maybe you dodged the bullet.
>

-- 
You received this message because you are subscribed to the Google Groups "Homotopy Type Theory" group.
To unsubscribe from this group and stop receiving emails from it, send an email to HomotopyTypeTheory+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5714 bytes --]

  parent reply	other threads:[~2018-06-19  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 16:32 [HoTT] " xieyuheng
2018-06-18 18:58 ` [HoTT] " Matt Oliveri
2018-06-19  4:59   ` xieyuheng
2018-06-19  8:07   ` xieyuheng [this message]
2018-06-19 18:59     ` Matt Oliveri
2018-06-20  6:02       ` xieyuheng
2018-06-21 19:16         ` xieyuheng
2018-06-19  8:21   ` xieyuheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca4b0d50-f038-4072-b27f-5f2d0b433bed@googlegroups.com \
    --to=xyheme@gmail.com \
    --cc=HomotopyTypeTheory@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).