From: du yu <doof...@gmail.com>
To: Homotopy Type Theory <HomotopyT...@googlegroups.com>
Subject: Re: [HoTT] How to define w types in agda?
Date: Fri, 26 Jan 2018 00:50:57 -0800 (PST) [thread overview]
Message-ID: <33d5f1c2-7aff-4200-9eb6-b99c035595e9@googlegroups.com> (raw)
In-Reply-To: <CAN2iy-Qz1puvoiS9h0xemzH5bQaraQ++XCjiiTu0_yX6V69xfA@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1866 bytes --]
Wow thanks! I don't know it is already defined in stdlib (google search
gives none!). As a beginner for dependent types , the data type definition
is quite confusing sometimes!
On Friday, January 26, 2018 at 10:38:39 AM UTC+8, Favonia wrote:
>
> Hello,
>
> The first argument to the function is of type Zro, and you can use the
> absurd pattern to define such a function. See
> http://agda.readthedocs.io/en/v2.5.3/language/function-definitions.html#absurd-patterns
> .
>
> However, there is a bigger issue---your W type seems wrong. At least I do
> not see why it is equivalent to the standard presentation. See
> https://github.com/agda/agda-stdlib/blob/master/src/Data/W.agda for a
> correct implementation in the standard library.
>
> Hope this helps.
>
> Best,
> Favonia
>
> On Thu, Jan 25, 2018 at 11:26 AM du yu <doo...@gmail.com <javascript:>>
> wrote:
>
>> I have the following initial thoughts but can't work out to define zero
>> as a w type
>>
>> data Zro : Set where
>>
>> data One : Set where
>> O1 : One
>>
>> data Two : Set where
>> O2 : Two
>> I2 : Two
>> -- w types
>>
>> rec2 : (x y : Set) -> Two -> Set
>> rec2 x _ O2 = x
>> rec2 _ y I2 = y
>>
>>
>> data W (A : Set) (B : A -> Set) : Set where -- well founded trees
>> w : (s : A) -> B s -> W A B
>> sup : (a : A) -> ((B a) -> ((x : A) -> W A B )) -> W A B
>>
>> natw : Set
>> natw = W Two (rec2 Zro One) -- nat type as w type
>>
>> zero_w : natw
>> zero_w = sup O2 (λ x y → {!!})
>>
>> --
>> 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 HomotopyTypeThe...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
[-- Attachment #1.2: Type: text/html, Size: 4414 bytes --]
prev parent reply other threads:[~2018-01-26 8:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 16:26 du yu
2018-01-26 2:38 ` [HoTT] " Favonia
2018-01-26 8:50 ` du yu [this message]
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=33d5f1c2-7aff-4200-9eb6-b99c035595e9@googlegroups.com \
--to="doof..."@gmail.com \
--cc="HomotopyT..."@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).