How to resolve this error in agda?

你说的曾经没有我的故事 提交于 2019-12-20 05:37:09

问题


I have defined Stream of positive rational like this.

one : ℤ
one = + 1

--giving a rational as input it will return next rational (in some down tailing method)
next : pair → pair
next q = if (n eq one) then (mkPair (+ m Data.Integer.+ one) 1)
         else (mkPair (n Data.Integer.- one) (m Nat.+ 1))
  where
     n = getX q
     m = getY q

--it will generate all rational from (1,1)
rational : Stream pair
rational = iterate next (mkPair one 1) 

--it will get all the rational which are greater than the given rational. 
RQ : pair → Stream pair → Stream pair
RQ q (x ∷ xs) = (x add q) ∷ ♯ (RQ q (♭ xs))    

--This is a stream of positive rational greater than (0,1).
positiveRat : Stream pair
positiveRat = RQ (mkPair (+ 0) (1)) rational

here pair is a record with two field Z and N.

Now i want to prove that `for all x if x > 0 then x will belong to Stream of positive rational.

 open import Data.Stream
 open import Data.Nat
 open import Data.Rational
 open import Data.Integer
 open import Coinduction

lemma : (x : pair) → ((+ 0) Data.Integer.≤ (pair.x x)) → ( x ∈ positiveRat ) 
lemma q proof = ?

An attempt to split proof leads to the following error message:

 I'm not sure if there should be a case for the constructor +≤+,
because I get stuck when trying to solve the following unification
problems (inferred index ≟ expected index):
  + m ≟ + 0
  + n ≟ getX q₁
when checking that the expression ? has type q ∈ positiveRat

Please help to resolve this error.

来源:https://stackoverflow.com/questions/30951993/how-to-resolve-this-error-in-agda

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!