isabelle


Isabelle function to find the longest sequence of members of a relation


I have a relation R :: w => w => bool that is both transitive an irreflexive.
I have the axiom Ax1: "finite {x::w. True}". Therefore, for each x there is always a longest sequence of wn R ... R w2 R w1 R x.
I need a function F:: w => nat, that -for a given x - gives back the "lenght" of this sequence (or 0 if there is no y such that xRy). How would I go about building one in isabelle.
Also: Is Ax1 a good way to axiomatize the "finiteness of type w" or is there a better one?
First of all, a more idiomatic way of writing {x::w. True} is UNIV :: w set. I suggest writing finite (UNIV :: w set), or possibly using the finite type class, although that might make your theorem more difficult to apply because you need a finite instance for your type. I think it's not really necessary or helpful for your use case.
I then suggest the following approach:
Define an inductive predicate (using inductive) on lists of type w list stating that the first element is x and for each two successive list elements y and z, R y z holds, i.e. the list is an ascending chain w.r.t. R.
Show that any list that is such a chain must have distinct elements (cf. distinct :: 'a list ⇒ bool).
Show that there are finitely many distinct lists over a finite set.
Use the Max operator to find the biggest n such that there exists a list of length n that is an ascending chain w.r.t. R. That this works should be easy since there is at least one such chain, and you've already shown that there are only finitely many chains.

Related Links

Error when trying to evaluate `coprime`
All available predicates in Isabelle
How do I refer to the current subgoal in Isar?
How to manage all the various proof methods
How to analyze if-expressions in assumptions?
What does `class` do in Isabelle
How to define a linear ordering on a type?
Parsing the content of a cartouche using a “term parser”
Defining finite sets in Isabelle
Find Lemmas used by simp/auto/clarify
Complete proof output in Isabelle
How to prove in HOLCF that double reversion of a list doesn't change it
Organization of `thy` files that come with Isabelle
Error message in Isabelle/HOL
What happens during function proofs
Inner syntax error when using `o` as a variable/function name

Categories

HOME
testing
openstack
dictionary
spagobi
kalman-filter
jpeg
disassembler
fingerprint
ios-charts
portia
multiple-records
virtualization
cloudkit
communication
dax
imacros
rascal
decomposition
pythonanywhere
oxyplot
immutable.js
cx-freeze
dynamic-featured-image
poltergeist
chromebook
nhapi
web-api-testing
windows-server-2000
delicious-api
preg-match
directx-10
data-manipulation
caret
devextreme
web-mining
hot-module-replacement
temporary-files
fedex
node-sass
eclipse-gef
executenonquery
osx-mavericks
azure-application-gateway
komodoedit
datastax-startup
powercli
kbuild
google-perftools
android-cursor
dtexec
boost-preprocessor
pdfclown
hittest
crosswalk-runtime
quartz-composer
nsviewcontroller
hover-over
pickadate
ptrace
vhd
maven-tomcat-plugin
r-tree
thredds
coveralls
muse
map-projections
method-parameters
sonarqube5.1.2
truevault
tween
jsonpickle
heisenbug
valuechangelistener
transcoding
meteor-velocity
intentservice
quantlib-swig
sitemesh
dbconnection
eclipse-memory-analyzer
factory-method
cisco-jtapi
manchester-syntax
qt-jambi
blackberry-playbook
file-comparison
revisions
database-management
zend-tool
uimenucontroller

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