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

Port a Coq lemma over Z to a similar lemma over nat
Coq fixpoint defintion numerated by natural numbers.(type of (n+1)'s type depends on (n)'s type)
`No more subgoals, but there are non-instantiated existential variables` in Coq proof language?
Simplify assumption
Apply partially instantiated lemma
Using reflexivity in Coq
High-speed calculation of Coq's theorems
Topological Definition of Continuous in Coq
Reference in Coq Lists library not found
Purpose of maximal vs non-maximal implicit arguments
Idris type system properties
How to destruct/generalize over Program's rewritten match statements
Show all axioms Coq
Product Type in Coq
Coq inductive definition for the entailment property
How to make sublists in Coq?

Categories

HOME
variables
bluetooth
netsuite
openstack
tinymce
cmd
binary-tree
ckeditor
ebean
multiple-records
google-translate
midi
windows-azure-storage
n-gram
vb.net-2010
fortumo
ibm-odm
decimal
netflix
lombok
clojurescript
finite-automata
swingx
amazonsellercentral
xlsxwriter
css-animations
core-text
claims-based-identity
maquette
assistant
elasticsearch-net
facebook-apps
atlassian-crucible
subdomains
procdump
frame
siesta-swift
repo
accelerate-framework
vxworks
restlet
libraries
uft-api
dynamic-reports
android-mediaprojection
slick-3.0
prolog-setof
logparser
python-webbrowser
ionicons
svmlight
google-perftools
spring-mongodb
hittest
or-tools
removechild
url-masking
database-optimization
prettytensor
master-slave
fadeout
revolution-r
ford-fulkerson
reactive-banana
jqgrid-formatter
operation
generic-programming
unity3d-gui
clipperlib
dereference
inmobi
python-green
facebook-graph-api-v2.4
tween
jscript.net
asp.net-dynamic-data
client-side-templating
fluentautomation
jubula
system.net.webexception
valuechangelistener
datagridviewcolumn
multiprocessor
aqtime
runtime.exec
blending
ember-app-kit
type-equivalence
flashvars
wsdl-2.0
automount
tridion-worldserver
wse3.0
code-cleanup
punbb
zpt
external-accessory
disclosure
floating
user-friendly
gacutil

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App