coq


Prove that a sequence of steps terminates


I have a small system that rewrites lambda terms. It has the usual (three) deterministic call-by-value rewrite rules. I have not listed them here.
The rewrites are modelled as Steps from one Term to another. I have also the StarStep relation between reachable terms, where the latter can be produced from the first by zero or more rewrite steps.
I now want to show that the rewrites terminate (either with a value, or stuck). I have stripped out the details, because I don't think they matter here, but I can add more details if needed.
Here is the code (or here in CollaCoq in the browser):
Variable Term: Type.
Variable Step: Term -> Term -> Prop.
Inductive StarStep: Term -> Term -> Prop :=
| StepNone : forall t, StarStep t t
| StepOne : forall t t', Step t t' -> forall t'', StarStep t' t'' -> StarStep t t''.
Goal forall t : Term,
~ (forall t', StarStep t t' -> exists t'', Step t' t'') ->
exists t', StarStep t t' /\ forall t'', ~ Step t' t''.
So I want to show
IF it is NOT the case that "from all reachable states it is possible
another step" THEN there exists a state t' that is reachable from t
such that it is not possible to take a step from it.
I am stuck on how to proceed. Do I need more info, i.e. induction or destructing (= case analysis of) t? And how can I use the info in the hypothesis when it is negated?
EDIT: Here are more details about Term and Step
I believe this is an instance of classical reasoning.
The statement resembles the following proposition, which is not provable in the constructive setting:
Goal forall (A : Type) (P : A -> Prop),
~ (forall x, P x) -> exists x, ~ P x.
because the knowledge that "it is not true that forall ..." doesn't yield an object which you need to prove the existence of something.
Here is a possible solution using the laws of classical logic:
Require Import Coq.Logic.Classical_Pred_Type.
Require Import Coq.Logic.Classical_Prop.
Goal forall t : Term,
~ (forall t', StarStep t t' -> exists t'', Step t' t'') ->
exists t', StarStep t t' /\ forall t'', ~ Step t' t''.
Proof.
intros t H.
apply not_all_ex_not in H.
destruct H as [tt H].
apply imply_to_and in H.
firstorder.
Qed.
Actually, we don't even need to know anything about StarStep, because the following abstract version of the previous proposition is valid in classical logic (the proof remains the same):
Goal forall (A : Type) (P Q : A -> Prop),
~ (forall s, Q s -> exists t, P t) ->
exists s, Q s /\ forall t, ~ P t.

Related Links

How to use matched case and variable equivalence in coq
Proof with false hypothesis in Isabelle/HOL Isar
Is there a convention for the order of applying ssreflect tactic/taticals?
How to systematically normalize inequalities to < (lt) and <= (le) in Coq?
Inductive subset of an inductive set in Coq
How to find the source file for an identifier in Coq
Coq “Unknown interpretation for notation” error
How to switch the current goal in Coq?
Reasoning about lists in Coq
what does the curly braces {} do in ssreflect rewrite
How to define unspecified constants in Coq
How to automatically prove simple equality of real numbers in Coq?
How to simplify real number terms in Coq?
How can I prove that (eqb x y) means x = y
What's the difference between `Reals` and `Coq.Reals.*` in Coq?
when is the `:` (colon) in necessary in ssreflect/Coq?

Categories

HOME
zeromq
hp-exstream
cplex
cvs
yahoo-oauth
gps
win32gui
sql-server-2016
callback
angular-ui-bootstrap
ios-charts
pheatmap
cross-validation
webrequest
synchronization
session-variables
windows-10-universal
jplayer
gz
remote-access
quartz-scheduler
iolanguage
undefined
evopdf
swingx
accessor
dcevm
mustache.php
microsoft-r
jndi
rundeck
xpages-ssjs
sparse-matrix
facet
maxmind
xacml
libssl
srcset
google-sites-2016
scorm2004
lxd
hybridauth
textmate
gammu
lto
objectlistview
vapor
splice
optix
mapzen
midl
import-from-excel
btrace
apple-news
rainbowtable
azure-application-gateway
jedis
aurelia-validation
windows-iot-core-10
mako
linode
dynamics-sl
dwscript
background-service
sts-springsourcetoolsuite
adxstudio-portals
skobbler-maps
qcustomplot
superstack
rvest
dlna
suffix-tree
bluegiga
asp.net5
netmq
energy
tcpserver
rtbkit
ios8-today-widget
sdhc
quicklisp
splash
cisco-ios
c++03
terminfo
heisenbug
valueconverter
balanced-payments
inbox
cos
chronoforms
specification-pattern
isnullorempty
cisco-jtapi
coderush
manchester-syntax
viewswitcher
appconkit
enter
code-cleanup
gnustep
coercion
inotifycollectionchanged
datareader
radcombobox
h.323
web-application-design
routedevent
bespin
database-management
compiler-specific
exchange-server-2003
adrotator
putchar
data-acquisition

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App