src/ZF/ex/Ramsey.thy
author wenzelm
Sat, 22 Oct 2016 20:09:30 +0200
changeset 64349 26bc905be09d
parent 61798 27f3c10b0b50
child 65449 c82e63b11b8b
permissions -rw-r--r--
expose results on failure (via mail);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35762
af3ff2ba4c54 removed old CVS Ids;
wenzelm
parents: 21404
diff changeset
     1
(*  Title:      ZF/ex/Ramsey.thy
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
Ramsey's Theorem (finite exponent 2 version)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
Based upon the article
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
    D Basin and M Kaufmann,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
    The Boyer-Moore Prover and Nuprl: An Experimental Comparison.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
    In G Huet and G Plotkin, editors, Logical Frameworks.
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    11
    (CUP, 1991), pages 89-119
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
See also
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
    M Kaufmann,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
    An example in NQTHM: Ramsey's Theorem
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
    Internal Note, Computational Logic, Inc., Austin, Texas 78703
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
    Available from the author: kaufmann@cli.com
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    18
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    19
This function compute Ramsey numbers according to the proof given below
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    20
(which, does not constrain the base case values at all.
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    21
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    22
fun ram 0 j = 1
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    23
  | ram i 0 = 1
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    24
  | ram i j = ram (i-1) j + ram i (j-1)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 13339
diff changeset
    27
theory Ramsey imports Main begin
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
    28
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
    29
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    30
  Symmetric :: "i=>o" where
46822
95f1e700b712 mathematical symbols for Isabelle/ZF example theories
paulson
parents: 35762
diff changeset
    31
    "Symmetric(E) == (\<forall>x y. <x,y>:E \<longrightarrow> <y,x>:E)"
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    32
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    33
definition
61798
27f3c10b0b50 isabelle update_cartouches -c -t;
wenzelm
parents: 46822
diff changeset
    34
  Atleast :: "[i,i]=>o" where \<comment> "not really necessary: ZF defines cardinality"
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    35
    "Atleast(n,S) == (\<exists>f. f \<in> inj(n,S))"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    36
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    37
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    38
  Clique  :: "[i,i,i]=>o" where
46822
95f1e700b712 mathematical symbols for Isabelle/ZF example theories
paulson
parents: 35762
diff changeset
    39
    "Clique(C,V,E) == (C \<subseteq> V) & (\<forall>x \<in> C. \<forall>y \<in> C. x\<noteq>y \<longrightarrow> <x,y> \<in> E)"
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    40
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    41
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    42
  Indept  :: "[i,i,i]=>o" where
46822
95f1e700b712 mathematical symbols for Isabelle/ZF example theories
paulson
parents: 35762
diff changeset
    43
    "Indept(I,V,E) == (I \<subseteq> V) & (\<forall>x \<in> I. \<forall>y \<in> I. x\<noteq>y \<longrightarrow> <x,y> \<notin> E)"
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    44
  
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    45
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
    46
  Ramsey  :: "[i,i,i]=>o" where
46822
95f1e700b712 mathematical symbols for Isabelle/ZF example theories
paulson
parents: 35762
diff changeset
    47
    "Ramsey(n,i,j) == \<forall>V E. Symmetric(E) & Atleast(n,V) \<longrightarrow>  
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    48
         (\<exists>C. Clique(C,V,E) & Atleast(i,C)) |       
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    49
         (\<exists>I. Indept(I,V,E) & Atleast(j,I))"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    50
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    51
(*** Cliques and Independent sets ***)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    52
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    53
lemma Clique0 [intro]: "Clique(0,V,E)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    54
by (unfold Clique_def, blast)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    55
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    56
lemma Clique_superset: "[| Clique(C,V',E);  V'<=V |] ==> Clique(C,V,E)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    57
by (unfold Clique_def, blast)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    58
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    59
lemma Indept0 [intro]: "Indept(0,V,E)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    60
by (unfold Indept_def, blast)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    62
lemma Indept_superset: "[| Indept(I,V',E);  V'<=V |] ==> Indept(I,V,E)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    63
by (unfold Indept_def, blast)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    64
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    65
(*** Atleast ***)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    66
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    67
lemma Atleast0 [intro]: "Atleast(0,A)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    68
by (unfold Atleast_def inj_def Pi_def function_def, blast)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    69
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    70
lemma Atleast_succD: 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    71
    "Atleast(succ(m),A) ==> \<exists>x \<in> A. Atleast(m, A-{x})"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    72
apply (unfold Atleast_def)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    73
apply (blast dest: inj_is_fun [THEN apply_type] inj_succ_restrict)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    74
done
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    76
lemma Atleast_superset: 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    77
    "[| Atleast(n,A);  A \<subseteq> B |] ==> Atleast(n,B)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    78
by (unfold Atleast_def, blast intro: inj_weaken_type)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    79
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    80
lemma Atleast_succI: 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    81
    "[| Atleast(m,B);  b\<notin> B |] ==> Atleast(succ(m), cons(b,B))"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    82
apply (unfold Atleast_def succ_def)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    83
apply (blast intro: inj_extend elim: mem_irrefl) 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    84
done
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    85
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    86
lemma Atleast_Diff_succI:
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    87
     "[| Atleast(m, B-{x});  x \<in> B |] ==> Atleast(succ(m), B)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    88
by (blast intro: Atleast_succI [THEN Atleast_superset]) 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    89
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    90
(*** Main Cardinality Lemma ***)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    92
(*The #-succ(0) strengthens the original theorem statement, but precisely
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    93
  the same proof could be used!!*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    94
lemma pigeon2 [rule_format]:
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    95
     "m \<in> nat ==>  
46822
95f1e700b712 mathematical symbols for Isabelle/ZF example theories
paulson
parents: 35762
diff changeset
    96
          \<forall>n \<in> nat. \<forall>A B. Atleast((m#+n) #- succ(0), A \<union> B) \<longrightarrow>    
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    97
                           Atleast(m,A) | Atleast(n,B)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
    98
apply (induct_tac "m")
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
    99
apply (blast intro!: Atleast0, simp)
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   100
apply (rule ballI)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   101
apply (rename_tac m' n) (*simplifier does NOT preserve bound names!*)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   102
apply (induct_tac "n", auto)
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   103
apply (erule Atleast_succD [THEN bexE])
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   104
apply (rename_tac n' A B z)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   105
apply (erule UnE)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   106
(**case z \<in> B.  Instantiate the '\<forall>A B' induction hypothesis. **)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   107
apply (drule_tac [2] x1 = A and x = "B-{z}" in spec [THEN spec])
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   108
apply (erule_tac [2] mp [THEN disjE])
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   109
(*cases Atleast(succ(m1),A) and Atleast(succ(k),B)*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   110
apply (erule_tac [3] asm_rl notE Atleast_Diff_succI)+
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   111
(*proving the condition*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   112
prefer 2 apply (blast intro: Atleast_superset)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   113
(**case z \<in> A.  Instantiate the '\<forall>n \<in> nat. \<forall>A B' induction hypothesis. **)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   114
apply (drule_tac x2="succ(n')" and x1="A-{z}" and x=B
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   115
       in bspec [THEN spec, THEN spec])
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   116
apply (erule nat_succI)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   117
apply (erule mp [THEN disjE])
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   118
(*cases Atleast(succ(m1),A) and Atleast(succ(k),B)*)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   119
apply (erule_tac [2] asm_rl Atleast_Diff_succI notE)+
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   120
(*proving the condition*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   121
apply simp
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   122
apply (blast intro: Atleast_superset)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   123
done
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   125
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   126
(**** Ramsey's Theorem ****)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   127
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   128
(** Base cases of induction; they now admit ANY Ramsey number **)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   129
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   130
lemma Ramsey0j: "Ramsey(n,0,j)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   131
by (unfold Ramsey_def, blast)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   132
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   133
lemma Ramseyi0: "Ramsey(n,i,0)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   134
by (unfold Ramsey_def, blast)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   135
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   136
(** Lemmas for induction step **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   138
(*The use of succ(m) here, rather than #-succ(0), simplifies the proof of 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   139
  Ramsey_step_lemma.*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   140
lemma Atleast_partition: "[| Atleast(m #+ n, A);  m \<in> nat;  n \<in> nat |]   
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   141
      ==> Atleast(succ(m), {x \<in> A. ~P(x)}) | Atleast(n, {x \<in> A. P(x)})"
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   142
apply (rule nat_succI [THEN pigeon2], assumption+)
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   143
apply (rule Atleast_superset, auto)
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   144
done
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   145
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   146
(*For the Atleast part, proves ~(a \<in> I) from the second premise!*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   147
lemma Indept_succ: 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   148
    "[| Indept(I, {z \<in> V-{a}. <a,z> \<notin> E}, E);  Symmetric(E);  a \<in> V;   
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   149
        Atleast(j,I) |] ==>    
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   150
     Indept(cons(a,I), V, E) & Atleast(succ(j), cons(a,I))"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   151
apply (unfold Symmetric_def Indept_def)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   152
apply (blast intro!: Atleast_succI)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   153
done
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   154
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   155
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   156
lemma Clique_succ: 
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   157
    "[| Clique(C, {z \<in> V-{a}. <a,z>:E}, E);  Symmetric(E);  a \<in> V;   
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   158
        Atleast(j,C) |] ==>    
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   159
     Clique(cons(a,C), V, E) & Atleast(succ(j), cons(a,C))"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   160
apply (unfold Symmetric_def Clique_def)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   161
apply (blast intro!: Atleast_succI)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   162
done
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   163
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   164
(** Induction step **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   166
(*Published proofs gloss over the need for Ramsey numbers to be POSITIVE.*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   167
lemma Ramsey_step_lemma:
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   168
   "[| Ramsey(succ(m), succ(i), j);  Ramsey(n, i, succ(j));   
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   169
       m \<in> nat;  n \<in> nat |] ==> Ramsey(succ(m#+n), succ(i), succ(j))"
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 12867
diff changeset
   170
apply (unfold Ramsey_def, clarify)
12867
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   171
apply (erule Atleast_succD [THEN bexE])
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   172
apply (erule_tac P1 = "%z.<x,z>:E" in Atleast_partition [THEN disjE],
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   173
       assumption+)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   174
(*case m*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   175
apply (fast dest!: Indept_succ elim: Clique_superset)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   176
(*case n*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   177
apply (fast dest!: Clique_succ elim: Indept_superset)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   178
done
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   179
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   180
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   181
(** The actual proof **)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   182
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   183
(*Again, the induction requires Ramsey numbers to be positive.*)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   184
lemma ramsey_lemma: "i \<in> nat ==> \<forall>j \<in> nat. \<exists>n \<in> nat. Ramsey(succ(n), i, j)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   185
apply (induct_tac "i")
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   186
apply (blast intro!: Ramsey0j)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   187
apply (rule ballI)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   188
apply (induct_tac "j")
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   189
apply (blast intro!: Ramseyi0)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   190
apply (blast intro!: add_type Ramsey_step_lemma)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   191
done
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   192
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   193
(*Final statement in a tidy form, without succ(...) *)
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   194
lemma ramsey: "[| i \<in> nat;  j \<in> nat |] ==> \<exists>n \<in> nat. Ramsey(n,i,j)"
5c900a821a7c New-style versions of these old examples
paulson
parents: 11354
diff changeset
   195
by (blast dest: ramsey_lemma)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
end