Questions tagged [agda]

Agda is a dependently typed, total functional programming language and a proof assistant.

Agda is a dependently typed functional programming language. It has inductive families, i.e., data types which depend on values, such as the type of vectors of a given length. It also has parametrised modules, mixfix operators, Unicode characters, and an interactive Emacs interface which can assist the programmer in writing the program.

Agda is a proof assistant. It is an interactive system for writing and checking proofs. Agda is based on intuitionistic type theory, a foundational system for constructive mathematics developed by the Swedish logician Per Martin-Löf. It has many similarities with other proof assistants based on dependent types, such as Coq, Epigram, Matita and NuPRL.

The current version is 2.6.1.1

Useful links

819 questions
0
votes
3 answers

Propositional Logic and Proofs

I am trying to prove the below case for a homework assignment and have been working hours on it, still no luck. Any suggestions or comments as to what I am doing wrong?
0
votes
0 answers

Left Inverse over integer in agda

I am trying to proof inverse property over integer (which is represented as setoid i.e (a , b) represents a - b.) I have defined the negation part as - (a , b) = (b , a): -_ : ℤ -> ℤ - (x , y) = (y , x) is0 : ℤ → Set is0 (a , b) = a ≡…
ajayv
  • 641
  • 6
  • 21
0
votes
2 answers

Combining proofs of commutativity and associativity of addition

I am trying to proof the below lemma infixr 5 _~_ _~_ = trans lemma-+swap : ∀ a b c → a + (b + c) ≡ b + (a + c) lemma-+swap zero b c = refl lemma-+swap (suc a) b c = (+-assoc a b c) ~ (comm-+ a (b + c)) ~ (+-assoc b c a) Note : I imported this…
ajayv
  • 641
  • 6
  • 21
0
votes
0 answers

Substitution versus (OPE-based) renaming

Based on this suggestion I am trying to use order-preserving embeddings to represent renamings in a project where I am going to need two levels of contexts (types live in a kinding context of type variable kinds, and terms live in a typing context…
Cactus
  • 27,075
  • 9
  • 69
  • 149
0
votes
2 answers

How to prove commutative property for rational number in Agda?

I am trying to prove commutative property for agda. I tried to explore the standard library but there is lot of complex thing which i could not understand. I tried in this way -- comm : (a b : Q) -> (a + b) === (b + a) the problem here is + which…
ajayv
  • 641
  • 6
  • 21
0
votes
1 answer

How to prove there exist a rational which is less than some rational in agda?

I want to proof that there exist an rational which is less than some rational. for example.. v : ℚ v = + 1 ÷ 2 thm : (Σ[ x ∈ ℚ ] (x Data.Rational.≤ v)) thm = ? What to write in second line?? And what is the meaning of x ∈ ℚ, will it give an…
ajayv
  • 641
  • 6
  • 21
0
votes
2 answers

How to use Logical AND operation between two sets in agda?

I wanted to proof that if there is m which is less than 10 and there is n which is less than 15 then there exist z which is less than 25. thm : ((∃ λ m → (m < 10)) AND (∃ λ n → (n < 15))) -> (∃ λ z → (z < 25)) thm = ? How to define AND here??…
ajayv
  • 641
  • 6
  • 21
0
votes
1 answer

How to write this in agda?

I wanted to implement this statement in agda ; A dedekind cut is a pair (L, U) of mere predicates L : Q -> Set and R : Q -> Set which is 1) inhibited : exists (q : Q) . L(q) ^ exists (r : Q) . U(r) I have tried in this way, record cut : Set…
ajayv
  • 641
  • 6
  • 21
0
votes
1 answer

How to write agda equivalent code of this coq code?

I want to write the given coq code in agda. Definition included (D1 D2:R -> Prop) : Prop := forall x:R, D1 x -> D2 x. I have tried in this way .. data included (D1 D2 : R -> Set) : Set where forall x : R D1 x -> D2 x I know the problem is in…
ajayv
  • 641
  • 6
  • 21
0
votes
1 answer

How to work with stream in agda?

I have written the stream data type and one head operation in Agda. Now i want to check whether head operation is correct or not. So i take my input stream as 1 :: 2 :: 3 :: . . . But agda does not accept this as a stream. So my question is how…
ajayv
  • 641
  • 6
  • 21
0
votes
0 answers

Hidden attributes of relationships in Agda

So I'm building a simple text editor in Agda and attempting to write proofs to check modifications of the buffer after certain keystrokes, are correct. The one in particular I am working right now is to check that cursor input is not modifying the…
0
votes
1 answer

GHC incompatibility installing haskell-src-exts via cabal

I'm running into a compatibility problem trying to cabal install agda using GHC 7.8.3 and Cabal 1.16.0.2, on Ubuntu 14.04. The problem appears to be with haskell-src-exts-1.15.0.1, which Agda requires. Compiling that library runs into the following…
Roly
  • 2,126
  • 2
  • 20
  • 34
0
votes
1 answer

Simplifying boolean logic expressions to DNF and CNF (in Haskell)

I understand that there are generally-accepted algorithms for reducing a given boolean-logic expression to CNF or DNF. I've found a few websites about this sorta thing, but nothing that I can really use to build a Haskell program around it. This…
Allan
  • 149
  • 5
0
votes
1 answer

Expressing a theorem about idempotent substitutions

I'm working in a simple library containing definitions and properties about substitutions for simple types. I'm using the following encoding for types: data Ty (n : Nat) : Set where var : Fin n -> Ty n con : Ty n app : Ty n -> Ty n -> Ty…
Rodrigo Ribeiro
  • 3,198
  • 1
  • 18
  • 26
0
votes
1 answer

Arbitrary evaluation in the type signature in agda

So I have another "simple" Adga question. I wanted to have a proof that used arbitrary evaluations as premises and results. But I don't think I know the type system well enough to do that. as a simple example take f : {S : Set} -> (a : S) -> ( R…
user833970
  • 2,729
  • 3
  • 26
  • 41
1 2 3
54
55