2

I have an equality definition:

Definition reglang_eq :=
  forall (A : Set)
  (r1 r2 : RegularLanguage A),
  (forall xs : List A,
    EvalInRegLang A r1 xs <-> EvalInRegLang A r2 xs)
  -> r1 = r2
.

and a subgoal:

Concat A (EmptyStr A) r = Concat A r (EmptyStr A)
(* note: Concat is a RegularLanguage constructor *)

and when I try to apply or rewrite reglang_eq, I get an error. If I understand correctly, this should simply be because I don't know the correct syntax, but I've been getting increasingly frustrated because I haven't been able to find documentation that I can understand. (Despite how many months I've been stumbling through proving stuff about RegularLanguages.)

Any help is appreciated, thanks.

1 Answer 1

2

If Concat is indeed a regular language constructor, you will not be able to prove your goal. There's two problems going on here:

  1. When you wrote down reglang_eq, you defined a proposition, but didn't give any proof of it. What you want to do is to replace the := by just a colon (:), so you can enter proof mode and justify your claim. Once you do that and finish your proof, you'll be able to apply it. But if you tried to do this, you would hit the second issue...

  2. In Coq, constructors are always disjoint. This means that the only way your equation can be true is when r = EmptyStr A (assuming the latter is also a constructor). What you probably want here is to define a different representation for regular languages so that concatenation and the empty language become defined operations (I.e. functions defined inside the logic).

2
  • Thanks, and sorry about the late reply. So if I understand this correctly, I can't say that EvalInRegLang A r1 xs <-> EvalInRegLang A r2 xs implies r1 = r2 because Coq won't accept it. = can only be used for constructive equality. In which case, I guess my question is, is there some way to show Set equality? Since Sets don't need to be constructed the same to be the same. (I assume?) Should this be a new question? Commented Apr 30, 2015 at 7:30
  • @user2063685 it depends on what you mean by "Set". I think this is interesting enough to deserve its own question, which I'd be happy to answer :) Commented Apr 30, 2015 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.