homotopy-type-theory

How to explicitly use an induction principle in coq?

三世轮回 提交于 2020-05-16 22:06:15
问题 I'm trying to prove symmetry of propositional identity with the induction principal explicitly in Coq, but can't do it with the induction principle like I can in agda. I don't know how to locally declare a variable in Coq, nor do I know how to unfold a definition, as you can see below. How can I get a proof that resembles the agda one below? Inductive Id (A : Type) (x : A) : A -> Type := | refl : Id A x x. (* trivial with induction *) Theorem symId {A} {x y} : Id A x y -> Id A y x. Proof.

How to explicitly use an induction principle in coq?

我的梦境 提交于 2020-05-16 22:05:20
问题 I'm trying to prove symmetry of propositional identity with the induction principal explicitly in Coq, but can't do it with the induction principle like I can in agda. I don't know how to locally declare a variable in Coq, nor do I know how to unfold a definition, as you can see below. How can I get a proof that resembles the agda one below? Inductive Id (A : Type) (x : A) : A -> Type := | refl : Id A x x. (* trivial with induction *) Theorem symId {A} {x y} : Id A x y -> Id A y x. Proof.

How to explicitly use an induction principle in coq?

陌路散爱 提交于 2020-05-16 22:05:03
问题 I'm trying to prove symmetry of propositional identity with the induction principal explicitly in Coq, but can't do it with the induction principle like I can in agda. I don't know how to locally declare a variable in Coq, nor do I know how to unfold a definition, as you can see below. How can I get a proof that resembles the agda one below? Inductive Id (A : Type) (x : A) : A -> Type := | refl : Id A x x. (* trivial with induction *) Theorem symId {A} {x y} : Id A x y -> Id A y x. Proof.

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 ε ++