I have these definitions (irrelavant ones are removed)
open import Agda.Builtin.Nat renaming (Nat to ℕ)
infix 3 _>0
data _>0 : ℕ → Set where
intro : ∀ n → suc n >0
infix 4 _*>0_
_*>0_ : ∀ {a b} → a >0 → b >0 → a * b >0
intro n *>0 intro m = intro (m + n * suc m)
infix 5 _÷_⟨_⟩
data ℚ : Set where
_÷_⟨_⟩ : (a b : ℕ) → b >0 → ℚ
And I wanted to prove this to be true:
open import Agda.Builtin.Equality
div-mul-comm : ∀ a c d → (x : c >0) → (y : d >0) →
a ÷ c * d ⟨ x *>0 y ⟩ ≡ a ÷ d * c ⟨ y *>0 x ⟩
div-mul-comm a c d x y = ?
But whatever I tried I can't prove this, also, the error message is strange.
This is what I've tried:
postulate nat-multiply-comm : ∀ a b → a * b ≡ b * a
div-mul-comm a c d x y
rewrite nat-multiply-comm c d = {!!}
Agda says:
c * d != w of type ℕ
when checking that the type
(c d w : ℕ) →
w ≡ d * c →
(a : ℕ) (x : c >0) (y : d >0) →
a ÷ w ⟨ x *>0 y ⟩ ≡ a ÷ d * c ⟨ y *>0 x ⟩
of the generated with function is well-formed
Agda.Builtin
only. Wait – ice1000nat-multiply-comm
. Using+-comm
from the standard library does not yield the error you're reporting. – gallaispostulate
. I think there shouldn't be more mistakes. – ice1000