* **[HoTT] Defining n-sphere via HIT in cubical Agda**
**@ 2019-01-27 20:11 Yuhao Huang**
0 siblings, 0 replies; 1+ messages in thread
From: Yuhao Huang @ 2019-01-27 20:11 UTC (permalink / raw)
To: Homotopy Type Theory
[-- Attachment #1.1: Type: text/plain, Size: 1257 bytes --]
I was experimenting cubical Agda with {-# OPTIONS --cubical --rewriting #-}
I tried to define S^2, S^3 separately and found HIT worked fine.
However when I was trying to write down Sphere n for general natural number
n it simply won't allow me to do so.
And the error message is "The target of a constructor must be the datatype
applied to its parameters".
So how do I define a dependent HIT?
PtType : Set₁
PtType = Σ Set (λ A → A)
Ω1 : PtType → PtType
Ω1 A = ((A .snd) ≡ (A .snd)) , refl
Ω : (n : ℕ) → PtType → PtType
Ω 0 A = A
Ω (suc n) A = Ω1 (Ω n A)
data S² : Set where
base : S²
surf : ((Ω 2 (S² , base)) .fst)
data S³ : Set where
base : S³
cell : ((Ω 3 (S³ , base)) .fst)
data Sphere : ℕ → Set where
base : (n : ℕ) → Sphere n
--cell : (n : ℕ) → ((Ω n ((Sphere n) , (base n))) .fst) -- Error!
222222222222
--
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: 14981 bytes --]
^ permalink raw reply [**flat**|nested] 1+ messages in thread

only message in thread, back to index
**Thread overview:** (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-27 20:11 [HoTT] Defining n-sphere via HIT in cubical Agda Yuhao Huang

Discussion of Homotopy Type Theory and Univalent Foundations
Archives are clonable: git clone --mirror http://inbox.vuxu.org/hott
Newsgroup available over NNTP:
nntp://inbox.vuxu.org/vuxu.archive.hott
AGPL code for this site: git clone https://public-inbox.org/ public-inbox