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 8022393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:15:19+00:00 2026-06-04T22:15:19+00:00

I am trying to define a domain in the proof checker coq. How do

  • 0

I am trying to define a domain in the proof checker coq. How do I do this?

I’m trying to do the equivalent of V in [0,10].

I’ve tried to do Definition V := forall v in R, 0 <= v /\ v <= 10., but this lead to problems with constants like 0 not being in V according to Coq.

  • 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-06-04T22:15:21+00:00Added an answer on June 4, 2026 at 10:15 pm

    A simple approach might be something like,

    Require Import Omega.
    
    Inductive V : Set :=
      mkV : forall (v:nat), 0 <= v /\ v <= 10 -> V.
    
    Lemma member0 : V.
    Proof. apply (mkV 0). omega. Qed.
    
    Definition inc (v:V) : nat := match v with mkV n _ => n + 1 end.
    
    Lemma inc_bounds : forall v, 0 <= inc v <= 11.
    Proof. intros v; destruct v; simpl. omega. Qed.
    

    Of course the type of member0 may not be as informative as you might like. In that case, you may want to index V by the nat corresponding to each element of the set.

    Require Import Omega.
    
    Inductive V : nat -> Set :=
      mkV : forall (v:nat), 0 <= v /\ v <= 10 -> V v.
    
    Lemma member0 : V 0.
    Proof. apply (mkV 0). omega. Qed.
    
    Definition inc {n} (v:V n) : nat := n + 1.
    
    Lemma inc_bounds : forall {n:nat} (v:V n), 0 <= inc v <= 11.
    Proof. intros n v. unfold inc. destruct v. omega. Qed.
    

    I’ve not worked with Reals before, but the above can be implemented on R as well.

    Require Import Reals.
    Require Import Fourier.
    Open Scope R_scope.
    
    Inductive V : R -> Set :=
      mkV : forall (v:R), 0 <= v /\ v <= 10 -> V v.
    
    Lemma member0 : V 0.
    Proof. apply (mkV 0). split. right; auto. left; fourier. Qed.
    
    Definition inc {r} (v:V r) : R := r + 1.
    
    Lemma inc_bounds : forall {r:R} (v:V r), 0 <= inc v <= 11.
    Proof. intros r v; unfold inc. 
      destruct v as (r,pf). destruct pf. split; fourier. 
    Qed.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to define nested modules, but I couldn't find any complete explanations
I'm trying to define a new array through a where query but I can
I am trying to define MapPageRoute on the application global.asax but my problem is
I'm trying to figure out how I can define validation rules for my domain
I'm trying to define a domain which will allow to pass only 6 chars
Im trying to define a select tag in my view. My view looks like
I'm trying to define a method in my vb.net interface that will only accept
I am trying to define a dynamic var in a different namespace. The Lobos
I am trying to define a number of classes based on an abstract base
I am trying to define an abstract class that has operators to compare two

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.