proof - Idris rewrite tactic doesn't work as expected -
i have example
o : type hom : o -> o -> type id : (a : o) -> hom a comp : hom b -> hom b c -> hom c idright : (f : hom b) -> comp f (id b) = f idleft : (f : hom b) -> comp (id a) f = f assoc : (f : hom b) -> (g : hom b c) -> (h : hom c d) -> comp f (comp g h) = comp (comp f g) h eqid : (f : hom b) -> (g : hom b a) -> (h : hom b a) -> comp f g = id -> comp h f = id b -> g = h eqid = ?eqidproof
and try use tactics in order make proof
1. intro a, b, f, g, h, fg, hf 2. rewrite idleft g 3. rewrite hf 4. rewrite assoc h f g
so 4 step nothing. nothing sym
. i'm doing wrong? possible there bug in idris itself?
your file contains type declarations. need fill in body definitions if want this. example o : type
, type declaration o
, , won't usable until write like
o : type o = bool
in order use rewrite, need supply proof of form a = b
. more specifically, need total functions return type equality want. (for example type :doc multcommutative
). don't have such proofs in file. don't have theorems proved because haven't defined yet. if load in idris, should tell you have number of "metavariables" or "holes", means parts of code need filled in.
it looks intend define data type, perhaps like
data hom : type -> type -> type mkhom : (f : -> b) -> hom b comp : hom b -> hom b c -> hom c
if want extend type system introducing new types need use data
declaration.
Comments
Post a Comment