cubical-type-theory

How do I find further constraints than boundary conditions?

给你一囗甜甜゛ 提交于 2021-01-29 15:32:19
问题 In the following Agda code, I have one hole with some potential filling; alas, the filling doesn't typecheck. It seems to fulfill all the constraints Agda shows, so I'd like to know where I could find what other, invisible constraints there are. {-# OPTIONS --cubical #-} module _ where open import Cubical.Core.Everything open import Cubical.Foundations.Everything open import Cubical.Data.Nat module UntypedNominalTerms (A : Type) where data Term : Type where var : ℕ → (x : A) → Term rename : ∀

Cubical Agda: how do I prove two things not equal

久未见 提交于 2020-05-16 06:32:08
问题 How can I prove two things are not equal in Cubical Agda? (v2.6.1, Cubical repo version acabbd9 ) Concretely, here are the integers as a higher inductive type: {-# OPTIONS --safe --warning=error --cubical --without-K #-} open import Cubical.Core.Everything open import Cubical.Foundations.Prelude module Integers where data False : Set where data ℕ : Set where zero : ℕ succ : ℕ → ℕ {-# BUILTIN NATURAL ℕ #-} data ℤ : Set where pos : ℕ → ℤ neg : ℕ → ℤ congZero : pos 0 ≡ neg 0 It's easy to show

Pushing a path along a pair of paths originating from its endpoints

不想你离开。 提交于 2019-12-25 03:24:44
问题 Suppose I have, using the cubical-demo library, the following things in scope: i : I p0 : x ≡ y p1 : x' ≡ y' q0 : x ≡ x' q1 : y ≡ y' How do I then construct q' : p0 i ≡ p1 i ? 回答1: One way is by contracting singleton pairs with J, there might be simpler proofs though. open import Cubical.PathPrelude q' : ∀ {A : Set} (i : I) (x : A) x' (q0 : x ≡ x') y (p0 : x ≡ y) y' (p1 : x' ≡ y') (q1 : y ≡ y') → p0 i ≡ p1 i q' i x = pathJ _ (pathJ _ (pathJ _ (\ q1 → q1))) 回答2: Another one I've come up with

Defining non-unary functions in Cubical mode

折月煮酒 提交于 2019-12-21 04:58:31
问题 I'd like to define a function with two, higher inductive typed, arguments in Cubical mode. I am using the cubical package as my "prelude" library. I first define a quotient type for integers as a HIT: {-# OPTIONS --cubical #-} module _ where open import Data.Nat renaming (_+_ to _+̂_) open import Cubical.Core.Prelude data ℤ : Set where _-_ : (x : ℕ) → (y : ℕ) → ℤ quot : ∀ {x y x′ y′} → (x ℕ+ y′) ≡ (x′ ℕ+ y) → (x - y) ≡ (x′ - y′) I can then define a unary function using pattern matching: _+1 :

Constructing a path with constraints in an isSet type

狂风中的少年 提交于 2019-12-11 05:22:19
问题 I am trying to write a proof for an equality in results of a function with a HIT domain. Because the function is defined over a HIT, the proof of equality also has to handle path cases. In those cases, Agda reports a ton of constraints on the higher-dimensional path I'm required to construct; for example: Goal: fromList (toList m) ≡ εˡ m i ———————————————————————————————————————————————————————————— i : I m : FreeMonoid A AIsSet : isSet A A : Type ℓ ℓ : Level ———— Constraints ————————————————

Constructing squares with constraints in an isSet type

烂漫一生 提交于 2019-12-10 16:50:52
问题 This is in continuation of this question, based on this answer. Using the technique explained by Saizan, and factoring my fromList-toList proof a bit to avoid the problematic recursion, I managed to fill in all but one cases of fromList-toList . I think it's easiest if I just show everything I have: {-# OPTIONS --cubical #-} module _ where open import Cubical.Core.Everything open import Cubical.Foundations.Everything hiding (assoc) data FreeMonoid {ℓ} (A : Type ℓ) : Type ℓ where [_] : A →

Defining non-unary functions in Cubical mode

做~自己de王妃 提交于 2019-12-03 15:38:33
I'd like to define a function with two, higher inductive typed, arguments in Cubical mode. I am using the cubical package as my "prelude" library. I first define a quotient type for integers as a HIT: {-# OPTIONS --cubical #-} module _ where open import Data.Nat renaming (_+_ to _+̂_) open import Cubical.Core.Prelude data ℤ : Set where _-_ : (x : ℕ) → (y : ℕ) → ℤ quot : ∀ {x y x′ y′} → (x ℕ+ y′) ≡ (x′ ℕ+ y) → (x - y) ≡ (x′ - y′) I can then define a unary function using pattern matching: _+1 : ℤ → ℤ (x - y) +1 = suc x - y quot {x} {y} prf i +1 = quot {suc x} {y} (cong suc prf) i So far, so good

Constructing a path with constraints in an isSet type

主宰稳场 提交于 2019-12-02 03:53:48
I am trying to write a proof for an equality in results of a function with a HIT domain. Because the function is defined over a HIT, the proof of equality also has to handle path cases. In those cases, Agda reports a ton of constraints on the higher-dimensional path I'm required to construct; for example: Goal: fromList (toList m) ≡ εˡ m i ———————————————————————————————————————————————————————————— i : I m : FreeMonoid A AIsSet : isSet A A : Type ℓ ℓ : Level ———— Constraints ——————————————————————————————————————————— (hcomp (λ { j ((~ i ∨ i) = i1) → (λ { (i = i0) → fromList (toList ε ++