src/HOL/Dense_Linear_Order.thy
author chaieb
Sun, 22 Jul 2007 17:53:45 +0200
changeset 23902 c69069242a51
parent 23470 e28b41e8b7d4
child 23915 fcbee3512a99
permissions -rw-r--r--
Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     1
(*
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     3
    Author:     Amine Chaieb, TU Muenchen
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     4
*)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     5
23470
e28b41e8b7d4 spelling
huffman
parents: 23466
diff changeset
     6
header {* Dense linear order without endpoints
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     7
  and a quantifier elimination procedure in Ferrante and Rackoff style *}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     8
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
     9
theory Dense_Linear_Order
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
    10
imports Finite_Set
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
    11
uses
23466
886655a150f6 moved quantifier elimination tools to Tools/Qelim/;
wenzelm
parents: 23453
diff changeset
    12
  "Tools/Qelim/qelim.ML"
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    13
  "Tools/Qelim/langford_data.ML"
23466
886655a150f6 moved quantifier elimination tools to Tools/Qelim/;
wenzelm
parents: 23453
diff changeset
    14
  "Tools/Qelim/ferrante_rackoff_data.ML"
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    15
  ("Tools/Qelim/langford.ML")
23466
886655a150f6 moved quantifier elimination tools to Tools/Qelim/;
wenzelm
parents: 23453
diff changeset
    16
  ("Tools/Qelim/ferrante_rackoff.ML")
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
    17
begin
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
    18
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    19
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    20
setup Langford_Data.setup
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
    21
setup Ferrante_Rackoff_Data.setup
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
    22
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    23
section {* The classical QE after Langford for dense linear orders *}
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    24
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    25
locale dense_linear_order = Linorder + 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    26
  assumes gt_ex: "\<forall>x. \<exists>y. x \<sqsubset> y" 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    27
  and lt_ex: "\<forall>x. \<exists>y. y \<sqsubset> x"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    28
  and dense: "\<forall>x y. x \<sqsubset> y \<longrightarrow> (\<exists>z. x \<sqsubset> z \<and> z \<sqsubset> y)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    29
begin
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    30
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    31
lemma dlo_qe_bnds: 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    32
  assumes ne: "L \<noteq> {}" and neU: "U \<noteq> {}" and fL: "finite L" and fU: "finite U"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    33
  shows "(\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y)) \<equiv> (\<forall> l \<in> L. \<forall>u \<in> U. l \<sqsubset> u)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    34
proof (simp only: atomize_eq, rule iffI)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    35
  assume H: "\<exists>x. (\<forall>y\<in>L. y \<^loc>< x) \<and> (\<forall>y\<in>U. x \<^loc>< y)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    36
  then obtain x where xL: "\<forall>y\<in>L. y \<^loc>< x" and xU: "\<forall>y\<in>U. x \<^loc>< y" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    37
  {fix l u assume l: "l \<in> L" and u: "u \<in> U"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    38
    from less_trans[OF xL[rule_format, OF l] xU[rule_format, OF u]]
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    39
    have "l \<sqsubset> u" .}
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    40
  thus "\<forall>l\<in>L. \<forall>u\<in>U. l \<^loc>< u" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    41
next
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    42
  assume H: "\<forall>l\<in>L. \<forall>u\<in>U. l \<^loc>< u"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    43
  let ?ML = "Max L"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    44
  let ?MU = "Min U"  
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    45
  from fL ne have th1: "?ML \<in> L" and th1': "\<forall>l\<in>L. l \<sqsubseteq> ?ML" by auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    46
  from fU neU have th2: "?MU \<in> U" and th2': "\<forall>u\<in>U. ?MU \<sqsubseteq> u" by auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    47
  from th1 th2 H have "?ML \<sqsubset> ?MU" by auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    48
  with dense obtain w where th3: "?ML \<sqsubset> w" and th4: "w \<sqsubset> ?MU" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    49
  from th3 th1' have "\<forall>l \<in> L. l \<sqsubset> w" 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    50
    apply auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    51
    apply (erule_tac x="l" in ballE)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    52
    by (auto intro: le_less_trans)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    53
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    54
  moreover from th4 th2' have "\<forall>u \<in> U. w \<sqsubset> u" 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    55
    apply auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    56
    apply (erule_tac x="u" in ballE)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    57
    by (auto intro: less_le_trans)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    58
  ultimately show "\<exists>x. (\<forall>y\<in>L. y \<^loc>< x) \<and> (\<forall>y\<in>U. x \<^loc>< y)" by auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    59
qed
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    60
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    61
lemma dlo_qe_noub: 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    62
  assumes ne: "L \<noteq> {}" and fL: "finite L"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    63
  shows "(\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> {}. x \<sqsubset> y)) \<equiv> True"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    64
proof(simp add: atomize_eq)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    65
  from gt_ex[rule_format, of "Max L"] obtain M where M: "Max L \<sqsubset> M" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    66
  from ne fL have "\<forall>x \<in> L. x \<sqsubseteq> Max L" by simp
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    67
  with M have "\<forall>x\<in>L. x \<sqsubset> M" by (auto intro: le_less_trans)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    68
  thus "\<exists>x. \<forall>y\<in>L. y \<^loc>< x" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    69
qed
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    70
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    71
lemma dlo_qe_nolb: 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    72
  assumes ne: "U \<noteq> {}" and fU: "finite U"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    73
  shows "(\<exists>x. (\<forall>y \<in> {}. y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y)) \<equiv> True"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    74
proof(simp add: atomize_eq)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    75
  from lt_ex[rule_format, of "Min U"] obtain M where M: "M \<sqsubset> Min U" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    76
  from ne fU have "\<forall>x \<in> U. Min U \<sqsubseteq> x" by simp
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    77
  with M have "\<forall>x\<in>U. M \<sqsubset> x" by (auto intro: less_le_trans)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    78
  thus "\<exists>x. \<forall>y\<in>U. x \<^loc>< y" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    79
qed
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    80
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    81
lemma gather_simps: 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    82
  shows 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    83
  "(\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y) \<and> x \<sqsubset> u \<and> P x) \<longleftrightarrow> (\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> (insert u U). x \<sqsubset> y) \<and> P x)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    84
  and "(\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y) \<and> l \<sqsubset> x \<and> P x) \<longleftrightarrow> (\<exists>x. (\<forall>y \<in> (insert l L). y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y) \<and> P x)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    85
  "(\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y) \<and> x \<sqsubset> u) \<longleftrightarrow> (\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> (insert u U). x \<sqsubset> y))"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    86
  and "(\<exists>x. (\<forall>y \<in> L. y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y) \<and> l \<sqsubset> x) \<longleftrightarrow> (\<exists>x. (\<forall>y \<in> (insert l L). y \<sqsubset> x) \<and> (\<forall>y \<in> U. x \<sqsubset> y))"  by auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    87
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    88
lemma 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    89
  gather_start: "(\<exists>x. P x) \<equiv> (\<exists>x. (\<forall>y \<in> {}. y \<^loc>< x) \<and> (\<forall>y\<in> {}. x \<sqsubset> y) \<and> P x)" 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    90
  by simp
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    91
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    92
lemma exists_neq: "\<exists>(x::'a). x \<noteq> t" "\<exists>(x::'a). t \<noteq> x" 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    93
  using gt_ex[rule_format, of t] by auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    94
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    95
lemma less_not_permute: "\<not> (x \<sqsubset> y \<and> y \<sqsubset> x)" by (simp add: not_less linear)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    96
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    97
lemmas dlo_simps = order_refl less_irrefl not_less not_le exists_neq 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    98
  le_less neq_iff linear less_not_permute
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
    99
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   100
lemma axiom: "dense_linear_order (op \<sqsubseteq>) (op \<sqsubset>)" .
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   101
lemma atoms: includes meta_term_syntax
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   102
  shows "TERM (op \<sqsubset> :: 'a \<Rightarrow> _)" and "TERM (op \<sqsubseteq>)" and "TERM (op = :: 'a \<Rightarrow> _)" .
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   103
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   104
declare axiom[langford qe: dlo_qe_bnds dlo_qe_nolb dlo_qe_noub gather: gather_start gather_simps atoms: atoms]
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   105
declare dlo_simps[langfordsimp]
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   106
end
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   107
  (* FIXME: Move to HOL -- together with the conj_aci_rule in langford.ML *)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   108
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   109
lemma dnf:
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   110
  "(P & (Q | R)) = ((P&Q) | (P&R))" 
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   111
  "((Q | R) & P) = ((Q&P) | (R&P))"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   112
  by blast+
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   113
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   114
lemmas weak_dnf_simps = simp_thms dnf
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   115
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   116
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   117
lemma nnf_simps:
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   118
    "(\<not>(P \<and> Q)) = (\<not>P \<or> \<not>Q)" "(\<not>(P \<or> Q)) = (\<not>P \<and> \<not>Q)" "(P \<longrightarrow> Q) = (\<not>P \<or> Q)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   119
    "(P = Q) = ((P \<and> Q) \<or> (\<not>P \<and> \<not> Q))" "(\<not> \<not>(P)) = P"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   120
  by blast+
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   121
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   122
lemma ex_distrib: "(\<exists>x. P x \<or> Q x) \<longleftrightarrow> ((\<exists>x. P x) \<or> (\<exists>x. Q x))" by blast
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   123
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   124
lemmas dnf_simps = weak_dnf_simps nnf_simps ex_distrib
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   125
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   126
use "Tools/Qelim/langford.ML"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   127
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   128
method_setup dlo = {*
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   129
  Method.ctxt_args (Method.SIMPLE_METHOD' o LangfordQE.dlo_tac)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   130
*} "Langford's algorithm for quantifier elimination in dense linear orders"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   131
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   132
interpretation dlo_ordring_class: dense_linear_order["op \<le> :: 'a::{ordered_field} \<Rightarrow> _" "op <"]
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   133
apply unfold_locales
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   134
apply auto
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   135
apply (rule_tac x = "x + 1" in exI, simp)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   136
apply (rule_tac x = "x - 1" in exI, simp)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   137
apply (rule_tac x = "(x + y) / (1 + 1)" in exI)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   138
apply (rule conjI)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   139
apply (rule less_half_sum, simp)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   140
apply (rule gt_half_sum, simp)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   141
done
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   142
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   143
lemma (in dense_linear_order) "\<forall>a b. (\<exists>x. a \<sqsubset> x \<and> x\<sqsubset> b) \<longleftrightarrow> (a \<sqsubset> b)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   144
  by dlo
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   145
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   146
lemma "\<forall>(a::'a::ordered_field) b. (\<exists>x. a < x \<and> x< b) \<longleftrightarrow> (a < b)"
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   147
  by dlo
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   148
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   149
section {* Contructive dense linear orders yield QE for linear arithmetic over ordered Fields -- see Arith_Tools.thy *}
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   150
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   151
context Linorder
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   152
begin
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   153
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   154
text{* Theorems for @{text "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (P x \<longleftrightarrow> P\<^bsub>-\<infinity>\<^esub>)"}*}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   155
lemma minf_lt:  "\<exists>z . \<forall>x. x \<sqsubset> z \<longrightarrow> (x \<sqsubset> t \<longleftrightarrow> True)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   156
lemma minf_gt: "\<exists>z . \<forall>x. x \<sqsubset> z \<longrightarrow>  (t \<sqsubset> x \<longleftrightarrow>  False)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   157
  by (simp add: not_less) (rule exI[where x="t"], auto simp add: less_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   158
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   159
lemma minf_le: "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (x \<sqsubseteq> t \<longleftrightarrow> True)" by (auto simp add: less_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   160
lemma minf_ge: "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (t \<sqsubseteq> x \<longleftrightarrow> False)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   161
  by (auto simp add: less_le not_less not_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   162
lemma minf_eq: "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (x = t \<longleftrightarrow> False)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   163
lemma minf_neq: "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (x \<noteq> t \<longleftrightarrow> True)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   164
lemma minf_P: "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (P \<longleftrightarrow> P)" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   165
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   166
text{* Theorems for @{text "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (P x \<longleftrightarrow> P\<^bsub>+\<infinity>\<^esub>)"}*}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   167
lemma pinf_gt:  "\<exists>z . \<forall>x. z \<sqsubset> x \<longrightarrow> (t \<sqsubset> x \<longleftrightarrow> True)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   168
lemma pinf_lt: "\<exists>z . \<forall>x. z \<sqsubset> x \<longrightarrow>  (x \<sqsubset> t \<longleftrightarrow>  False)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   169
  by (simp add: not_less) (rule exI[where x="t"], auto simp add: less_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   170
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   171
lemma pinf_ge: "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (t \<sqsubseteq> x \<longleftrightarrow> True)" by (auto simp add: less_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   172
lemma pinf_le: "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (x \<sqsubseteq> t \<longleftrightarrow> False)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   173
  by (auto simp add: less_le not_less not_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   174
lemma pinf_eq: "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (x = t \<longleftrightarrow> False)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   175
lemma pinf_neq: "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (x \<noteq> t \<longleftrightarrow> True)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   176
lemma pinf_P: "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (P \<longleftrightarrow> P)" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   177
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   178
lemma nmi_lt: "t \<in> U \<Longrightarrow> \<forall>x. \<not>True \<and> x \<sqsubset> t \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   179
lemma nmi_gt: "t \<in> U \<Longrightarrow> \<forall>x. \<not>False \<and> t \<sqsubset> x \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   180
  by (auto simp add: le_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   181
lemma  nmi_le: "t \<in> U \<Longrightarrow> \<forall>x. \<not>True \<and> x\<sqsubseteq> t \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   182
lemma  nmi_ge: "t \<in> U \<Longrightarrow> \<forall>x. \<not>False \<and> t\<sqsubseteq> x \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   183
lemma  nmi_eq: "t \<in> U \<Longrightarrow> \<forall>x. \<not>False \<and>  x = t \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   184
lemma  nmi_neq: "t \<in> U \<Longrightarrow>\<forall>x. \<not>True \<and> x \<noteq> t \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   185
lemma  nmi_P: "\<forall> x. ~P \<and> P \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   186
lemma  nmi_conj: "\<lbrakk>\<forall>x. \<not>P1' \<and> P1 x \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x) ;
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   187
  \<forall>x. \<not>P2' \<and> P2 x \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)\<rbrakk> \<Longrightarrow>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   188
  \<forall>x. \<not>(P1' \<and> P2') \<and> (P1 x \<and> P2 x) \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   189
lemma  nmi_disj: "\<lbrakk>\<forall>x. \<not>P1' \<and> P1 x \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x) ;
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   190
  \<forall>x. \<not>P2' \<and> P2 x \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)\<rbrakk> \<Longrightarrow>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   191
  \<forall>x. \<not>(P1' \<or> P2') \<and> (P1 x \<or> P2 x) \<longrightarrow>  (\<exists> u\<in> U. u \<sqsubseteq> x)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   192
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   193
lemma  npi_lt: "t \<in> U \<Longrightarrow> \<forall>x. \<not>False \<and>  x \<sqsubset> t \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by (auto simp add: le_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   194
lemma  npi_gt: "t \<in> U \<Longrightarrow> \<forall>x. \<not>True \<and> t \<sqsubset> x \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   195
lemma  npi_le: "t \<in> U \<Longrightarrow> \<forall>x. \<not>False \<and>  x \<sqsubseteq> t \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   196
lemma  npi_ge: "t \<in> U \<Longrightarrow> \<forall>x. \<not>True \<and> t \<sqsubseteq> x \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   197
lemma  npi_eq: "t \<in> U \<Longrightarrow> \<forall>x. \<not>False \<and>  x = t \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   198
lemma  npi_neq: "t \<in> U \<Longrightarrow> \<forall>x. \<not>True \<and> x \<noteq> t \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u )" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   199
lemma  npi_P: "\<forall> x. ~P \<and> P \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   200
lemma  npi_conj: "\<lbrakk>\<forall>x. \<not>P1' \<and> P1 x \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u) ;  \<forall>x. \<not>P2' \<and> P2 x \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)\<rbrakk>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   201
  \<Longrightarrow>  \<forall>x. \<not>(P1' \<and> P2') \<and> (P1 x \<and> P2 x) \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   202
lemma  npi_disj: "\<lbrakk>\<forall>x. \<not>P1' \<and> P1 x \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u) ; \<forall>x. \<not>P2' \<and> P2 x \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)\<rbrakk>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   203
  \<Longrightarrow> \<forall>x. \<not>(P1' \<or> P2') \<and> (P1 x \<or> P2 x) \<longrightarrow>  (\<exists> u\<in> U. x \<sqsubseteq> u)" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   204
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   205
lemma lin_dense_lt: "t \<in> U \<Longrightarrow> \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t \<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> x \<sqsubset> t \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> y \<sqsubset> t)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   206
proof(clarsimp)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   207
  fix x l u y  assume tU: "t \<in> U" and noU: "\<forall>t. l \<sqsubset> t \<and> t \<sqsubset> u \<longrightarrow> t \<notin> U" and lx: "l \<sqsubset> x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   208
    and xu: "x\<sqsubset>u"  and px: "x \<sqsubset> t" and ly: "l\<sqsubset>y" and yu:"y \<sqsubset> u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   209
  from tU noU ly yu have tny: "t\<noteq>y" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   210
  {assume H: "t \<sqsubset> y"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   211
    from less_trans[OF lx px] less_trans[OF H yu]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   212
    have "l \<sqsubset> t \<and> t \<sqsubset> u"  by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   213
    with tU noU have "False" by auto}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   214
  hence "\<not> t \<sqsubset> y"  by auto hence "y \<sqsubseteq> t" by (simp add: not_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   215
  thus "y \<sqsubset> t" using tny by (simp add: less_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   216
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   217
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   218
lemma lin_dense_gt: "t \<in> U \<Longrightarrow> \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l \<sqsubset> x \<and> x \<sqsubset> u \<and> t \<sqsubset> x \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> t \<sqsubset> y)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   219
proof(clarsimp)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   220
  fix x l u y
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   221
  assume tU: "t \<in> U" and noU: "\<forall>t. l \<sqsubset> t \<and> t \<sqsubset> u \<longrightarrow> t \<notin> U" and lx: "l \<sqsubset> x" and xu: "x\<sqsubset>u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   222
  and px: "t \<sqsubset> x" and ly: "l\<sqsubset>y" and yu:"y \<sqsubset> u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   223
  from tU noU ly yu have tny: "t\<noteq>y" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   224
  {assume H: "y\<sqsubset> t"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   225
    from less_trans[OF ly H] less_trans[OF px xu] have "l \<sqsubset> t \<and> t \<sqsubset> u" by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   226
    with tU noU have "False" by auto}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   227
  hence "\<not> y\<sqsubset>t"  by auto hence "t \<sqsubseteq> y" by (auto simp add: not_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   228
  thus "t \<sqsubset> y" using tny by (simp add:less_le)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   229
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   230
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   231
lemma lin_dense_le: "t \<in> U \<Longrightarrow> \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> x \<sqsubseteq> t \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> y\<sqsubseteq> t)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   232
proof(clarsimp)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   233
  fix x l u y
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   234
  assume tU: "t \<in> U" and noU: "\<forall>t. l \<sqsubset> t \<and> t \<sqsubset> u \<longrightarrow> t \<notin> U" and lx: "l \<sqsubset> x" and xu: "x\<sqsubset>u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   235
  and px: "x \<sqsubseteq> t" and ly: "l\<sqsubset>y" and yu:"y \<sqsubset> u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   236
  from tU noU ly yu have tny: "t\<noteq>y" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   237
  {assume H: "t \<sqsubset> y"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   238
    from less_le_trans[OF lx px] less_trans[OF H yu]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   239
    have "l \<sqsubset> t \<and> t \<sqsubset> u" by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   240
    with tU noU have "False" by auto}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   241
  hence "\<not> t \<sqsubset> y"  by auto thus "y \<sqsubseteq> t" by (simp add: not_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   242
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   243
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   244
lemma lin_dense_ge: "t \<in> U \<Longrightarrow> \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> t \<sqsubseteq> x \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> t \<sqsubseteq> y)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   245
proof(clarsimp)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   246
  fix x l u y
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   247
  assume tU: "t \<in> U" and noU: "\<forall>t. l \<sqsubset> t \<and> t \<sqsubset> u \<longrightarrow> t \<notin> U" and lx: "l \<sqsubset> x" and xu: "x\<sqsubset>u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   248
  and px: "t \<sqsubseteq> x" and ly: "l\<sqsubset>y" and yu:"y \<sqsubset> u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   249
  from tU noU ly yu have tny: "t\<noteq>y" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   250
  {assume H: "y\<sqsubset> t"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   251
    from less_trans[OF ly H] le_less_trans[OF px xu]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   252
    have "l \<sqsubset> t \<and> t \<sqsubset> u" by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   253
    with tU noU have "False" by auto}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   254
  hence "\<not> y\<sqsubset>t"  by auto thus "t \<sqsubseteq> y" by (simp add: not_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   255
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   256
lemma lin_dense_eq: "t \<in> U \<Longrightarrow> \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> x = t   \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> y= t)"  by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   257
lemma lin_dense_neq: "t \<in> U \<Longrightarrow> \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> x \<noteq> t   \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> y\<noteq> t)"  by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   258
lemma lin_dense_P: "\<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P   \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P)"  by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   259
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   260
lemma lin_dense_conj:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   261
  "\<lbrakk>\<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P1 x
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   262
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P1 y) ;
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   263
  \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P2 x
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   264
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P2 y)\<rbrakk> \<Longrightarrow>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   265
  \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> (P1 x \<and> P2 x)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   266
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> (P1 y \<and> P2 y))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   267
  by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   268
lemma lin_dense_disj:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   269
  "\<lbrakk>\<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P1 x
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   270
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P1 y) ;
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   271
  \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P2 x
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   272
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P2 y)\<rbrakk> \<Longrightarrow>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   273
  \<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> (P1 x \<or> P2 x)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   274
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> (P1 y \<or> P2 y))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   275
  by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   276
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   277
lemma npmibnd: "\<lbrakk>\<forall>x. \<not> MP \<and> P x \<longrightarrow> (\<exists> u\<in> U. u \<sqsubseteq> x); \<forall>x. \<not>PP \<and> P x \<longrightarrow> (\<exists> u\<in> U. x \<sqsubseteq> u)\<rbrakk>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   278
  \<Longrightarrow> \<forall>x. \<not> MP \<and> \<not>PP \<and> P x \<longrightarrow> (\<exists> u\<in> U. \<exists> u' \<in> U. u \<sqsubseteq> x \<and> x \<sqsubseteq> u')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   279
by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   280
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   281
lemma finite_set_intervals:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   282
  assumes px: "P x" and lx: "l \<sqsubseteq> x" and xu: "x \<sqsubseteq> u" and linS: "l\<in> S"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   283
  and uinS: "u \<in> S" and fS:"finite S" and lS: "\<forall> x\<in> S. l \<sqsubseteq> x" and Su: "\<forall> x\<in> S. x \<sqsubseteq> u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   284
  shows "\<exists> a \<in> S. \<exists> b \<in> S. (\<forall> y. a \<sqsubset> y \<and> y \<sqsubset> b \<longrightarrow> y \<notin> S) \<and> a \<sqsubseteq> x \<and> x \<sqsubseteq> b \<and> P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   285
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   286
  let ?Mx = "{y. y\<in> S \<and> y \<sqsubseteq> x}"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   287
  let ?xM = "{y. y\<in> S \<and> x \<sqsubseteq> y}"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   288
  let ?a = "Max ?Mx"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   289
  let ?b = "Min ?xM"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   290
  have MxS: "?Mx \<subseteq> S" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   291
  hence fMx: "finite ?Mx" using fS finite_subset by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   292
  from lx linS have linMx: "l \<in> ?Mx" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   293
  hence Mxne: "?Mx \<noteq> {}" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   294
  have xMS: "?xM \<subseteq> S" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   295
  hence fxM: "finite ?xM" using fS finite_subset by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   296
  from xu uinS have linxM: "u \<in> ?xM" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   297
  hence xMne: "?xM \<noteq> {}" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   298
  have ax:"?a \<sqsubseteq> x" using Mxne fMx by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   299
  have xb:"x \<sqsubseteq> ?b" using xMne fxM by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   300
  have "?a \<in> ?Mx" using Max_in[OF fMx Mxne] by simp hence ainS: "?a \<in> S" using MxS by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   301
  have "?b \<in> ?xM" using Min_in[OF fxM xMne] by simp hence binS: "?b \<in> S" using xMS by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   302
  have noy:"\<forall> y. ?a \<sqsubset> y \<and> y \<sqsubset> ?b \<longrightarrow> y \<notin> S"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   303
  proof(clarsimp)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   304
    fix y   assume ay: "?a \<sqsubset> y" and yb: "y \<sqsubset> ?b" and yS: "y \<in> S"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   305
    from yS have "y\<in> ?Mx \<or> y\<in> ?xM" by (auto simp add: linear)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   306
    moreover {assume "y \<in> ?Mx" hence "y \<sqsubseteq> ?a" using Mxne fMx by auto with ay have "False" by (simp add: not_le[symmetric])}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   307
    moreover {assume "y \<in> ?xM" hence "?b \<sqsubseteq> y" using xMne fxM by auto with yb have "False" by (simp add: not_le[symmetric])}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   308
    ultimately show "False" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   309
  qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   310
  from ainS binS noy ax xb px show ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   311
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   312
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   313
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   314
lemma finite_set_intervals2:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   315
  assumes px: "P x" and lx: "l \<sqsubseteq> x" and xu: "x \<sqsubseteq> u" and linS: "l\<in> S"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   316
  and uinS: "u \<in> S" and fS:"finite S" and lS: "\<forall> x\<in> S. l \<sqsubseteq> x" and Su: "\<forall> x\<in> S. x \<sqsubseteq> u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   317
  shows "(\<exists> s\<in> S. P s) \<or> (\<exists> a \<in> S. \<exists> b \<in> S. (\<forall> y. a \<sqsubset> y \<and> y \<sqsubset> b \<longrightarrow> y \<notin> S) \<and> a \<sqsubset> x \<and> x \<sqsubset> b \<and> P x)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   318
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   319
  from finite_set_intervals[where P="P", OF px lx xu linS uinS fS lS Su]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   320
  obtain a and b where
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   321
    as: "a\<in> S" and bs: "b\<in> S" and noS:"\<forall>y. a \<sqsubset> y \<and> y \<sqsubset> b \<longrightarrow> y \<notin> S"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   322
    and axb: "a \<sqsubseteq> x \<and> x \<sqsubseteq> b \<and> P x"  by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   323
  from axb have "x= a \<or> x= b \<or> (a \<sqsubset> x \<and> x \<sqsubset> b)" by (auto simp add: le_less)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   324
  thus ?thesis using px as bs noS by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   325
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   326
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   327
end
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   328
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   329
text {* Linear order without upper bounds *}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   330
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   331
locale linorder_no_ub = Linorder + assumes gt_ex: "\<forall>x. \<exists>y. x \<sqsubset> y"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   332
begin
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   333
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   334
lemma ge_ex: "\<forall>x. \<exists>y. x \<sqsubseteq> y" using gt_ex by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   335
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   336
text {* Theorems for @{text "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (P x \<longleftrightarrow> P\<^bsub>+\<infinity>\<^esub>)"} *}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   337
lemma pinf_conj:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   338
  assumes ex1: "\<exists>z1. \<forall>x. z1 \<sqsubset> x \<longrightarrow> (P1 x \<longleftrightarrow> P1')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   339
  and ex2: "\<exists>z2. \<forall>x. z2 \<sqsubset> x \<longrightarrow> (P2 x \<longleftrightarrow> P2')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   340
  shows "\<exists>z. \<forall>x. z \<sqsubset>  x \<longrightarrow> ((P1 x \<and> P2 x) \<longleftrightarrow> (P1' \<and> P2'))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   341
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   342
  from ex1 ex2 obtain z1 and z2 where z1: "\<forall>x. z1 \<sqsubset> x \<longrightarrow> (P1 x \<longleftrightarrow> P1')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   343
     and z2: "\<forall>x. z2 \<sqsubset> x \<longrightarrow> (P2 x \<longleftrightarrow> P2')" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   344
  from gt_ex obtain z where z:"max z1 z2 \<sqsubset> z" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   345
  from z have zz1: "z1 \<sqsubset> z" and zz2: "z2 \<sqsubset> z" by simp_all
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   346
  {fix x assume H: "z \<sqsubset> x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   347
    from less_trans[OF zz1 H] less_trans[OF zz2 H]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   348
    have "(P1 x \<and> P2 x) \<longleftrightarrow> (P1' \<and> P2')"  using z1 zz1 z2 zz2 by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   349
  }
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   350
  thus ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   351
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   352
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   353
lemma pinf_disj:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   354
  assumes ex1: "\<exists>z1. \<forall>x. z1 \<sqsubset> x \<longrightarrow> (P1 x \<longleftrightarrow> P1')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   355
  and ex2: "\<exists>z2. \<forall>x. z2 \<sqsubset> x \<longrightarrow> (P2 x \<longleftrightarrow> P2')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   356
  shows "\<exists>z. \<forall>x. z \<sqsubset>  x \<longrightarrow> ((P1 x \<or> P2 x) \<longleftrightarrow> (P1' \<or> P2'))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   357
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   358
  from ex1 ex2 obtain z1 and z2 where z1: "\<forall>x. z1 \<sqsubset> x \<longrightarrow> (P1 x \<longleftrightarrow> P1')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   359
     and z2: "\<forall>x. z2 \<sqsubset> x \<longrightarrow> (P2 x \<longleftrightarrow> P2')" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   360
  from gt_ex obtain z where z:"max z1 z2 \<sqsubset> z" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   361
  from z have zz1: "z1 \<sqsubset> z" and zz2: "z2 \<sqsubset> z" by simp_all
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   362
  {fix x assume H: "z \<sqsubset> x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   363
    from less_trans[OF zz1 H] less_trans[OF zz2 H]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   364
    have "(P1 x \<or> P2 x) \<longleftrightarrow> (P1' \<or> P2')"  using z1 zz1 z2 zz2 by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   365
  }
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   366
  thus ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   367
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   368
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   369
lemma pinf_ex: assumes ex:"\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (P x \<longleftrightarrow> P1)" and p1: P1 shows "\<exists> x. P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   370
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   371
  from ex obtain z where z: "\<forall>x. z \<sqsubset> x \<longrightarrow> (P x \<longleftrightarrow> P1)" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   372
  from gt_ex obtain x where x: "z \<sqsubset> x" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   373
  from z x p1 show ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   374
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   375
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   376
end
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   377
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   378
text {* Linear order without upper bounds *}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   379
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   380
locale linorder_no_lb = Linorder + assumes lt_ex: "\<forall>x. \<exists>y. y \<sqsubset> x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   381
begin
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   382
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   383
lemma le_ex: "\<forall>x. \<exists>y. y \<sqsubseteq> x" using lt_ex by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   384
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   385
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   386
text {* Theorems for @{text "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (P x \<longleftrightarrow> P\<^bsub>-\<infinity>\<^esub>)"} *}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   387
lemma minf_conj:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   388
  assumes ex1: "\<exists>z1. \<forall>x. x \<sqsubset> z1 \<longrightarrow> (P1 x \<longleftrightarrow> P1')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   389
  and ex2: "\<exists>z2. \<forall>x. x \<sqsubset> z2 \<longrightarrow> (P2 x \<longleftrightarrow> P2')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   390
  shows "\<exists>z. \<forall>x. x \<sqsubset>  z \<longrightarrow> ((P1 x \<and> P2 x) \<longleftrightarrow> (P1' \<and> P2'))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   391
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   392
  from ex1 ex2 obtain z1 and z2 where z1: "\<forall>x. x \<sqsubset> z1 \<longrightarrow> (P1 x \<longleftrightarrow> P1')"and z2: "\<forall>x. x \<sqsubset> z2 \<longrightarrow> (P2 x \<longleftrightarrow> P2')" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   393
  from lt_ex obtain z where z:"z \<sqsubset> min z1 z2" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   394
  from z have zz1: "z \<sqsubset> z1" and zz2: "z \<sqsubset> z2" by simp_all
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   395
  {fix x assume H: "x \<sqsubset> z"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   396
    from less_trans[OF H zz1] less_trans[OF H zz2]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   397
    have "(P1 x \<and> P2 x) \<longleftrightarrow> (P1' \<and> P2')"  using z1 zz1 z2 zz2 by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   398
  }
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   399
  thus ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   400
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   401
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   402
lemma minf_disj:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   403
  assumes ex1: "\<exists>z1. \<forall>x. x \<sqsubset> z1 \<longrightarrow> (P1 x \<longleftrightarrow> P1')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   404
  and ex2: "\<exists>z2. \<forall>x. x \<sqsubset> z2 \<longrightarrow> (P2 x \<longleftrightarrow> P2')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   405
  shows "\<exists>z. \<forall>x. x \<sqsubset>  z \<longrightarrow> ((P1 x \<or> P2 x) \<longleftrightarrow> (P1' \<or> P2'))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   406
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   407
  from ex1 ex2 obtain z1 and z2 where z1: "\<forall>x. x \<sqsubset> z1 \<longrightarrow> (P1 x \<longleftrightarrow> P1')"and z2: "\<forall>x. x \<sqsubset> z2 \<longrightarrow> (P2 x \<longleftrightarrow> P2')" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   408
  from lt_ex obtain z where z:"z \<sqsubset> min z1 z2" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   409
  from z have zz1: "z \<sqsubset> z1" and zz2: "z \<sqsubset> z2" by simp_all
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   410
  {fix x assume H: "x \<sqsubset> z"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   411
    from less_trans[OF H zz1] less_trans[OF H zz2]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   412
    have "(P1 x \<or> P2 x) \<longleftrightarrow> (P1' \<or> P2')"  using z1 zz1 z2 zz2 by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   413
  }
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   414
  thus ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   415
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   416
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   417
lemma minf_ex: assumes ex:"\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (P x \<longleftrightarrow> P1)" and p1: P1 shows "\<exists> x. P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   418
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   419
  from ex obtain z where z: "\<forall>x. x \<sqsubset> z \<longrightarrow> (P x \<longleftrightarrow> P1)" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   420
  from lt_ex obtain x where x: "x \<sqsubset> z" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   421
  from z x p1 show ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   422
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   423
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   424
end
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   425
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   426
locale constr_dense_linear_order = linorder_no_lb + linorder_no_ub +
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   427
  fixes between
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   428
  assumes between_less: "\<forall>x y. x \<sqsubset> y \<longrightarrow> x \<sqsubset> between x y \<and> between x y \<sqsubset> y"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   429
     and  between_same: "\<forall>x. between x x = x"
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   430
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   431
interpretation constr_dense_linear_order < dense_linear_order
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   432
  apply unfold_locales
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   433
  using gt_ex lt_ex between_less
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   434
    by (auto, rule_tac x="between x y" in exI, simp)
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   435
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   436
context constr_dense_linear_order
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   437
begin
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   438
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   439
lemma rinf_U:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   440
  assumes fU: "finite U"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   441
  and lin_dense: "\<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P x
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   442
  \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P y )"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   443
  and nmpiU: "\<forall>x. \<not> MP \<and> \<not>PP \<and> P x \<longrightarrow> (\<exists> u\<in> U. \<exists> u' \<in> U. u \<sqsubseteq> x \<and> x \<sqsubseteq> u')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   444
  and nmi: "\<not> MP"  and npi: "\<not> PP"  and ex: "\<exists> x.  P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   445
  shows "\<exists> u\<in> U. \<exists> u' \<in> U. P (between u u')"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   446
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   447
  from ex obtain x where px: "P x" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   448
  from px nmi npi nmpiU have "\<exists> u\<in> U. \<exists> u' \<in> U. u \<sqsubseteq> x \<and> x \<sqsubseteq> u'" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   449
  then obtain u and u' where uU:"u\<in> U" and uU': "u' \<in> U" and ux:"u \<sqsubseteq> x" and xu':"x \<sqsubseteq> u'" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   450
  from uU have Une: "U \<noteq> {}" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   451
  let ?l = "Min U"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   452
  let ?u = "Max U"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   453
  have linM: "?l \<in> U" using fU Une by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   454
  have uinM: "?u \<in> U" using fU Une by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   455
  have lM: "\<forall> t\<in> U. ?l \<sqsubseteq> t" using Une fU by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   456
  have Mu: "\<forall> t\<in> U. t \<sqsubseteq> ?u" using Une fU by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   457
  have th:"?l \<sqsubseteq> u" using uU Une lM by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   458
  from order_trans[OF th ux] have lx: "?l \<sqsubseteq> x" .
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   459
  have th: "u' \<sqsubseteq> ?u" using uU' Une Mu by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   460
  from order_trans[OF xu' th] have xu: "x \<sqsubseteq> ?u" .
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   461
  from finite_set_intervals2[where P="P",OF px lx xu linM uinM fU lM Mu]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   462
  have "(\<exists> s\<in> U. P s) \<or>
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   463
      (\<exists> t1\<in> U. \<exists> t2 \<in> U. (\<forall> y. t1 \<sqsubset> y \<and> y \<sqsubset> t2 \<longrightarrow> y \<notin> U) \<and> t1 \<sqsubset> x \<and> x \<sqsubset> t2 \<and> P x)" .
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   464
  moreover { fix u assume um: "u\<in>U" and pu: "P u"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   465
    have "between u u = u" by (simp add: between_same)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   466
    with um pu have "P (between u u)" by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   467
    with um have ?thesis by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   468
  moreover{
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   469
    assume "\<exists> t1\<in> U. \<exists> t2 \<in> U. (\<forall> y. t1 \<sqsubset> y \<and> y \<sqsubset> t2 \<longrightarrow> y \<notin> U) \<and> t1 \<sqsubset> x \<and> x \<sqsubset> t2 \<and> P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   470
      then obtain t1 and t2 where t1M: "t1 \<in> U" and t2M: "t2\<in> U"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   471
        and noM: "\<forall> y. t1 \<sqsubset> y \<and> y \<sqsubset> t2 \<longrightarrow> y \<notin> U" and t1x: "t1 \<sqsubset> x" and xt2: "x \<sqsubset> t2" and px: "P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   472
        by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   473
      from less_trans[OF t1x xt2] have t1t2: "t1 \<sqsubset> t2" .
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   474
      let ?u = "between t1 t2"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   475
      from between_less t1t2 have t1lu: "t1 \<sqsubset> ?u" and ut2: "?u \<sqsubset> t2" by auto
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   476
      from lin_dense[rule_format, OF] noM t1x xt2 px t1lu ut2 have "P ?u" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   477
      with t1M t2M have ?thesis by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   478
    ultimately show ?thesis by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   479
  qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   480
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   481
theorem fr_eq:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   482
  assumes fU: "finite U"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   483
  and lin_dense: "\<forall>x l u. (\<forall> t. l \<sqsubset> t \<and> t\<sqsubset> u \<longrightarrow> t \<notin> U) \<and> l\<sqsubset> x \<and> x \<sqsubset> u \<and> P x
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   484
   \<longrightarrow> (\<forall> y. l \<sqsubset> y \<and> y \<sqsubset> u \<longrightarrow> P y )"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   485
  and nmibnd: "\<forall>x. \<not> MP \<and> P x \<longrightarrow> (\<exists> u\<in> U. u \<sqsubseteq> x)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   486
  and npibnd: "\<forall>x. \<not>PP \<and> P x \<longrightarrow> (\<exists> u\<in> U. x \<sqsubseteq> u)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   487
  and mi: "\<exists>z. \<forall>x. x \<sqsubset> z \<longrightarrow> (P x = MP)"  and pi: "\<exists>z. \<forall>x. z \<sqsubset> x \<longrightarrow> (P x = PP)"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   488
  shows "(\<exists> x. P x) \<equiv> (MP \<or> PP \<or> (\<exists> u \<in> U. \<exists> u'\<in> U. P (between u u')))"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   489
  (is "_ \<equiv> (_ \<or> _ \<or> ?F)" is "?E \<equiv> ?D")
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   490
proof-
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   491
 {
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   492
   assume px: "\<exists> x. P x"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   493
   have "MP \<or> PP \<or> (\<not> MP \<and> \<not> PP)" by blast
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   494
   moreover {assume "MP \<or> PP" hence "?D" by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   495
   moreover {assume nmi: "\<not> MP" and npi: "\<not> PP"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   496
     from npmibnd[OF nmibnd npibnd]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   497
     have nmpiU: "\<forall>x. \<not> MP \<and> \<not>PP \<and> P x \<longrightarrow> (\<exists> u\<in> U. \<exists> u' \<in> U. u \<sqsubseteq> x \<and> x \<sqsubseteq> u')" .
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   498
     from rinf_U[OF fU lin_dense nmpiU nmi npi px] have "?D" by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   499
   ultimately have "?D" by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   500
 moreover
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   501
 { assume "?D"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   502
   moreover {assume m:"MP" from minf_ex[OF mi m] have "?E" .}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   503
   moreover {assume p: "PP" from pinf_ex[OF pi p] have "?E" . }
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   504
   moreover {assume f:"?F" hence "?E" by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   505
   ultimately have "?E" by blast}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   506
 ultimately have "?E = ?D" by blast thus "?E \<equiv> ?D" by simp
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   507
qed
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   508
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   509
lemmas minf_thms = minf_conj minf_disj minf_eq minf_neq minf_lt minf_le minf_gt minf_ge minf_P
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   510
lemmas pinf_thms = pinf_conj pinf_disj pinf_eq pinf_neq pinf_lt pinf_le pinf_gt pinf_ge pinf_P
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   511
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   512
lemmas nmi_thms = nmi_conj nmi_disj nmi_eq nmi_neq nmi_lt nmi_le nmi_gt nmi_ge nmi_P
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   513
lemmas npi_thms = npi_conj npi_disj npi_eq npi_neq npi_lt npi_le npi_gt npi_ge npi_P
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   514
lemmas lin_dense_thms = lin_dense_conj lin_dense_disj lin_dense_eq lin_dense_neq lin_dense_lt lin_dense_le lin_dense_gt lin_dense_ge lin_dense_P
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   515
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   516
lemma ferrack_axiom: "constr_dense_linear_order less_eq less between" by fact
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   517
lemma atoms: includes meta_term_syntax
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   518
  shows "TERM (op \<sqsubset> :: 'a \<Rightarrow> _)" and "TERM (op \<sqsubseteq>)" and "TERM (op = :: 'a \<Rightarrow> _)" .
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   519
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   520
declare ferrack_axiom [ferrack minf: minf_thms pinf: pinf_thms
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   521
    nmi: nmi_thms npi: npi_thms lindense:
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   522
    lin_dense_thms qe: fr_eq atoms: atoms]
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   523
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   524
declaration {*
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   525
let
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   526
fun simps phi = map (Morphism.thm phi) [@{thm "not_less"}, @{thm "not_le"}]
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   527
fun generic_whatis phi =
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   528
 let
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   529
  val [lt, le] = map (Morphism.term phi)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   530
   (ProofContext.read_term_pats @{typ "dummy"} @{context} ["op \<sqsubset>", "op \<sqsubseteq>"]) (* FIXME avoid read? *)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   531
  fun h x t =
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   532
   case term_of t of
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   533
     Const("op =", _)$y$z => if term_of x aconv y then Ferrante_Rackoff_Data.Eq
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   534
                            else Ferrante_Rackoff_Data.Nox
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   535
   | @{term "Not"}$(Const("op =", _)$y$z) => if term_of x aconv y then Ferrante_Rackoff_Data.NEq
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   536
                            else Ferrante_Rackoff_Data.Nox
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   537
   | b$y$z => if Term.could_unify (b, lt) then
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   538
                 if term_of x aconv y then Ferrante_Rackoff_Data.Lt
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   539
                 else if term_of x aconv z then Ferrante_Rackoff_Data.Gt
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   540
                 else Ferrante_Rackoff_Data.Nox
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   541
             else if Term.could_unify (b, le) then
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   542
                 if term_of x aconv y then Ferrante_Rackoff_Data.Le
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   543
                 else if term_of x aconv z then Ferrante_Rackoff_Data.Ge
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   544
                 else Ferrante_Rackoff_Data.Nox
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   545
             else Ferrante_Rackoff_Data.Nox
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   546
   | _ => Ferrante_Rackoff_Data.Nox
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   547
 in h end
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   548
 fun ss phi = HOL_ss addsimps (simps phi)
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   549
in
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   550
 Ferrante_Rackoff_Data.funs  @{thm "ferrack_axiom"}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   551
  {isolate_conv = K (K (K Thm.reflexive)), whatis = generic_whatis, simpset = ss}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   552
end
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   553
*}
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   554
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   555
end
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   556
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   557
23466
886655a150f6 moved quantifier elimination tools to Tools/Qelim/;
wenzelm
parents: 23453
diff changeset
   558
use "Tools/Qelim/ferrante_rackoff.ML"
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   559
23902
c69069242a51 Added quantifier elimination in dense linear orders after Langford; locale dense_linear_order renamed to constr_dense_linear_order (since it requires the beween constant). locale dense_linear_order is now the classical definition of DLO. constr_dense_linear_order is an instance of dense_linear_order; Method dlo now applies the langford QE, odl Method dlo renamed to ferrack, since it ia a QE only in interpretations where between is interpreted in a manner to vanish after substitution.
chaieb
parents: 23470
diff changeset
   560
method_setup ferrack = {*
23453
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   561
  Method.ctxt_args (Method.SIMPLE_METHOD' o FerranteRackoff.dlo_tac)
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   562
*} "Ferrante and Rackoff's algorithm for quantifier elimination in dense linear orders"
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   563
bf46f5cbdd64 Dense linear order witout endpoints
wenzelm
parents:
diff changeset
   564
end