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

Is xsymbols used in Isabelle/JEdit?
Using mono attribute in inductive_set
Where is nat base 10 converted to num base 2?
What can one assume, what is worth assuming in Isar?
Introducing type abbreviations in Isabelle
Isabelle won't generate code for my recursive function without a termination proof
Proving a simple lemma about trees in Isabelle
Why can I prove ⟦ ( ∃ x. P ) ∧ ( ∃ x. Q ) ⟧ ⟹ ∃ x. (P ∧ Q)?
What is a Quotient type pattern in Isabelle?
Avoid matching (λx.x)
Program extraction using native integers/words (not bignums) from Isabelle theory
“String of nat” in Isabelle?
From a 'value' to a 'lemma'
Isabelle/Simpl: Calling a Procedure Twice
let-statement with SOME operator
Does Lueng's RegExp library work with Isabelle/ML? Is there another regex lib devs use for Isabelle/ML?

Categories

HOME
azure-data-factory
smarty
iterator
fme
mean-stack
routes
bookshelf.js
amazon-ecs
jxls
sql-server-2016
pivotal-cloud-foundry
upload
qore
virtualization
circuit
progressive-web-apps
apache-metamodel
evopdf
zapier
cx-freeze
clickonce
core-text
zurb-foundation-6
devops
java-7
emgucv
entitlements
opentype
log4js-node
dbclient
google-cloud-nl
flink-streaming
bluestacks
openoffice.org
android-ble
automake
espeak
libraries
mixture-model
dynamics-crm-2013
user-controls
sfdc
reportingservices-2005
node-gyp
turbogears
btrace
apple-news
auto-update
long-polling
revapi
jquery-validate
worksheet
statsd
nodebb
arrow-keys
query-performance
deadbolt-2
phishing
ctest
plottable.js
blackberry-10
skype4py
srand
atk4
purge
rgeo
system.reflection
ng-animate
c3
titanium-modules
issuu
bitcoinj
mesa
concurrent-collections
ember-charts
meteor-velocity
html5-notifications
access-rights
apc
django-nonrel
robotics-studio
nsnetservice
bluepill
word-processor
multipage
viewswitcher
tomcat-valve
invite
javax.script
floating
cxxtest
sef
avatar
spec#
ugc
wsdl.exe
uiq3

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