Questions tagged [agda]
20 questions
9
votes
1 answer
Relationship between inductive families and type-returning functions
Dependently typed languages such as Agda support inductive families, also called indexed datatypes, which allow type parameters to vary between constructors. This can be used to define a set of relations between types, which can be used to constrain…
Alexis King
- 304
- 1
- 11
8
votes
2 answers
In Agda's GADT, are "parameterized" and "indexed" different semantically?
I know they have different scoping:
data a (n : Set) : Set where
introA : a n
data b : Set -> Set where
introB : {n : Set} -> b n
That's not what I'm caring about. Are they different semantically?
ice1000
- 980
- 6
- 35
7
votes
2 answers
Proof that type does not have decidable equality in Agda
Can one create such function in Agda ?
ℕ→ℕ-undecidable : ¬ ( (f g : ℕ → ℕ ) → Dec (f ≡ g))
ℕ→ℕ-undecidable = ?
I am particularly interested in proof using cubical Agda.
MJG
- 125
- 4
5
votes
2 answers
What does it mean if we disable K-rule in Agda?
TL;DR: Can I say, "K-rule in Agda enables people to match $ \forall a.a \equiv a $ with $ \mathit{refl} $"?
In https://agda.readthedocs.io/en/v2.5.4.1/language/without-k.html#without-k, K-rule is introduced as an implicit rule and it's defaultly…
ice1000
- 980
- 6
- 35
4
votes
1 answer
Which would be better for programming using Homotopy type theory Agda or Idris
I'm looking to model data inputs for an artificially intelligent system, which is affected by its internal parts and has feedback loops. I'd like to model it mathematically, using category theory or homotopy type theory.
Is Agda or Idris the best…
Ali S
- 41
- 2
4
votes
1 answer
Which inductive schemes can encode the following Agda definition?
Which induction schemes (e.g. induction-recursion by Dybjer and Setzer, "Irish" induction-recursion by McBride or induction-induction by Forsberg and Setzer or perhaps some simpler ones) allow one to encode the following Agda definition
data A :…
Primary Key
- 143
- 4
3
votes
1 answer
Building non-classical logics in Agda & Coq
Is it possible to construct different systems of logic in Coq or Agda?
I ask because I'm interested in using a proof assistant to construct (and verify) theorems in things like many-valued logics, relevant logics, and conditional logics in Graham…
Kevin Flowers Jr
- 133
- 3
3
votes
0 answers
Does Type:Type lead to inconsistency without general inductive types?
In e.g. Agda , it is possible to derive an element of the empty type by enabling the "type in type" option.
Every proof I have seen (and come up with) involves making a special inductive type definition.
Can a contradiction be derived using type in…
while1fork
- 319
- 1
- 7
3
votes
0 answers
Strict Positivity of Indexed Datatype in Agda
Agda is ruling out definitions like
data Bad : Set where
bad : (Bad → Bad) → Bad
Because "Non strictly-positive declarations are rejected because one can write a non-terminating function using them." (as one may read in Agda wiki). I know also…
MJG
- 125
- 4
2
votes
1 answer
Why this pattern matching fails in Agda?
Consider function wa'' (need natural number definition, either in stdlib or Agda.Builtin.Nat):
postulate comm : ∀ m n -> m + n ≡ n + m
wa'' : ∀ m n -> wa (m + n) ≡ wa (n + m)
wa'' m n with comm n m
... | refl = { }0
The pattern matching on…
ice1000
- 980
- 6
- 35
2
votes
0 answers
"Universe-shrinking" function in Agda
Agda does not allow datatypes in one universe to be indexed by, or non-trivially parametrized by a type in a larger universe (strangely, Coq does not appear to require this for propositional inductives, but perhaps this is related to prop…
Jason Carr
- 326
- 1
- 8
2
votes
1 answer
Why does universe level restriction behave differently between inductive family and parameterized inductive type without axiom K in agda
An observation when defining List in agda with --without-K enabled:
The following parameterized inductive definition is accepted:
data List (A : Set) : Set where
[] : List A
_::_ : A → List A → List A
but not the equivalent inductive family…
Kaa1el
- 191
- 8
2
votes
2 answers
Propositional truncation of excluded middle
It is clear to me that it should be impossible to prove :
exclMidl = isProp A → ((A) ⊎ (¬ A))
Because it would give deciding oracle for every Proposition.
My question is about the following Types:
exclMidl' = isProp A → ∥ ((A) ⊎ (¬ A)) ∥…
MJG
- 125
- 4
2
votes
1 answer
Can one get Turing-completeness without nontermination?
As I'm reading the movfuscator paper by Stephen Dolan, I encounter this claim:
In order to have Turing-completeness, we must allow for nontermination.
This seems like a reasonable statement. But I'm also aware of this work by Wouter Swierstra…
ulidtko
- 121
- 3
1
vote
1 answer
`transp` In Agda
I'm still a bit confused about the transp operator in Agda:
transp : ∀ {ℓ} (A : I → Set ℓ) (r : I) (a : A i0) → A i1
Is found this paper and I wonder if there is a relation?
As far as I understand, the $\mathsf{comp}^i$ operator lets you…
fweth
- 239
- 1
- 9