Discussion of Homotopy Type Theory and Univalent Foundations
 help / color / mirror / Atom feed
From: Favonia <fav...@gmail.com>
To: du yu <doof...@gmail.com>
Cc: Homotopy Type Theory <HomotopyT...@googlegroups.com>
Subject: Re: [HoTT] How to define w types in agda?
Date: Fri, 26 Jan 2018 02:38:27 +0000	[thread overview]
Message-ID: <CAN2iy-Qz1puvoiS9h0xemzH5bQaraQ++XCjiiTu0_yX6V69xfA@mail.gmail.com> (raw)
In-Reply-To: <2d2edbc3-10f6-4c85-a88d-f810acf6789a@googlegroups.com>

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

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 <doof...@gmail.com> 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.
> For more options, visit https://groups.google.com/d/optout.
>

[-- Attachment #2: Type: text/html, Size: 2502 bytes --]

  reply	other threads:[~2018-01-26  2:38 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 ` Favonia [this message]
2018-01-26  8:50   ` [HoTT] " du yu

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=CAN2iy-Qz1puvoiS9h0xemzH5bQaraQ++XCjiiTu0_yX6V69xfA@mail.gmail.com \
    --to="fav..."@gmail.com \
    --cc="HomotopyT..."@googlegroups.com \
    --cc="doof..."@gmail.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).