0

In my Isabelle formalisation I'm dealing with finite sets of natural numbers, and on these sets I'd like to consider functions that have the property of being a linear order.

I see that there are several different formalisations of orders in the library, but I'm not sure which one to reuse. In most cases those functions of which I'd like to check whether they are linear orders will simply be defined by using library operators such as < (less), but in some cases they might be defined as more complex combinations of library functions.

I tried HOL/Library/Order_Relation, but that doesn't seem to be connected to <; e.g. I'm unable to have the following lemma proved automatically:

lemma "linear_order_on {1::nat, 2} {(a::nat, b) . {a, b} ⊆ {1::nat, 2} ∧ a < b}"

(I'm sure there are nicer ways of converting a function to a relation, but that's not the main point here.)

If there were some ready-to-reuse library could I'd appreciate if you could let me know. Modelling this in a mathematically elegant way is not of utmost importance to me right now, so for now I'm considering to resort to functions that assign rational or real numbers to the natural numbers in my sets, and then using < on these rational/real numbers.

chris
  • 4,988
  • 20
  • 36
Christoph Lange
  • 595
  • 2
  • 13
  • 2
    Your lemma as stated (with implication) is false, because the relation you give includes the entire complement of {1,2}x{1,2}. I think you want to replace the implication with a conjunction. – Brian Huffman May 21 '13 at 21:56
  • Thanks, Brian, fixed! (With the lemma fixed, the problem remains, though.) – Christoph Lange May 22 '13 at 02:50

1 Answers1

2

I don't really know if there are better theories to use, but the lemma you have given is (still after the fix) false (the given relation is irreflexive while the expected one should be reflexive). Here are two versions that are correct:

lemma "linear_order_on {1::nat, 2} {(a::nat, b) . {a, b} ⊆ {1::nat, 2} ∧ a ≤ b}"
  unfolding linear_order_on_def partial_order_on_def preorder_on_def
    refl_on_def total_on_def trans_def antisym_def
  by auto

lemma "strict_linear_order_on {1::nat, 2} {(a::nat, b) . {a, b} ⊆ {1::nat, 2} ∧ a < b}"
  unfolding strict_linear_order_on_def partial_order_on_def preorder_on_def
    irrefl_def total_on_def trans_def antisym_def
  by auto
Mathieu
  • 726
  • 3
  • 11
  • Thanks, Le_J, indeed – strict_linear_order_on is what I had actually been looking for. So thanks for solving two problems for me: the one that I stated above (but didn't actually have), and the one that I did have (but didn't state above) ;-) – Christoph Lange May 22 '13 at 21:09