Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7073551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:56:35+00:00 2026-05-28T05:56:35+00:00

Context: I’m working on exercises in Software Foundations . Theorem neg_move : forall x

  • 0

Context: I’m working on exercises in Software Foundations.

Theorem neg_move : forall x y : bool,
  x = negb y -> negb x = y.
Proof. Admitted.

Theorem evenb_n__oddb_Sn : forall n : nat,
  evenb n = negb (evenb (S n)).
Proof.
  intros n. induction n as [| n'].
  Case "n = 0".
    simpl. reflexivity.
  Case "n = S n'".
    rewrite -> neg_move.

Before the last line, my subgoal is this:

evenb (S n') = negb (evenb (S (S n')))

And I want to transform it into this:

negb (evenb (S n')) = evenb (S (S n'))

When I try to step through rewrite -> neg_move, however, it produces this error:

Error: Unable to find an instance for the variable y.

I’m sure this is really simple, but what am I doing wrong? (Please don’t give anything away for solving evenb_n__oddb_Sn, unless I’m doing it completely wrong).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:56:36+00:00Added an answer on May 28, 2026 at 5:56 am

    As danportin mentioned, Coq is telling you that it does not know how to instantiate y. Indeed, when you do rewrite -> neg_move, you ask it to replace some negb x by a y. Now, what y is Coq supposed to use here? It cannot figure it out.

    One option is to instantiate y explicitly upon rewriting:

    rewrite -> neg_move with (y:=some_term)

    This will perform the rewrite and ask you to prove the premises, here it will add a subgoal of the form x = negb some_term.

    Another option is to specialize neg_move upon rewriting:

    rewrite -> (neg_move _ _ H)

    Here H must be a term of type some_x = negb some_y. I put two wildcards for the x and the y parameters of neg_move since Coq is able to infer them from H as being some_x and some_y respectively. Coq will then try to rewrite an occurence of negb some_x in your goal with some_y.
    But you first need to get this H term in your hypotheses, which might be some additional burden…

    (Note that the first option I gave you should be equivalent to rewrite -> (neg_move _ some_term))

    Another option is erewrite -> negb_move, which will add uninstantiated variables that will look like ?x and ?y, and try to do the rewrite. You will then have to prove the premise, which will look like (evenb (S (S n'))) = negb ?y, and hopefully in the process of solving this subgoal, Coq will find out what ?y should have been from the start (there are some restrictions though, and some problems may arise is Coq solves the goal without figuring out what ?y must be).


    However, for your particular problem, it is quite easier:

    ==========
    evenb (S n') = negb (evenb (S (S n')))
    

    symmetry.

    ==========
    negb (evenb (S (S n'))) = evenb (S n')
    

    apply neg_move.

    ==========
    evenb (S (S n')) = negb (evenb (S n'))
    

    And that’s what you wanted (backwards, do another symmetry. if you care).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context: I'm working with a relatively simple winforms application, written in VB.NET on the
Context: I work at a small software company that has traditionally done research-type work,
Context: I'm in charge of running a service written in .NET. Proprietary application. It
Context: So, I am attempting to build a ridiculously complex domain model. Talking with
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp
Context : programming a c/c++ win32-mfc library How to know whether we are in
Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
Context: .NET 3.5, VS2008. I'm not sure about the title of this question, so
Context: There's an application where you draw things on canvas. Where user clicks there's
Context: I need to develop a monitoring server that monitors some of our applications

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.