Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/HOL/Lattice/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 22 kB image not shown  

Quelle  Lattice.thy   Sprache: Isabelle

 

theory  A   two elements (  assumes ex_inf:  assumes ex_sup:   The \<open>\<sqinter>\<close> (meet) and \<open>\<squnion>\<close> (join) operations select such
*)

section \<open>Lattices\<close>

theory Lattice imports Bounds begin  join :: "'a::lattice \ 'a \ 'a" (infixl \\\ 65) where

subsection \<open>Lattice operations\<close>

text \<open>  exhibited
  A \emph{lattice} is a partial order with infimum and supremum of any
  two  assume "is_inf x y inf"  then show "(THE inf. is_inf x y inf) = inf"
  as    "inf \ x \ inf \ y \ (\z. z \ x \ z \ y \ z \ inf) \ x \ y = inf"
\<close>

class lattice =
  assumes ex_inf: "\inf. is_inf x y inf"
  assumes ex_sup  by (rule meet_equalitylemma join_equality [elim?proof  assume "is_sup x y sup"  then show "(THE by (rule the_equality) (rule is_sup_uniq [OF _ \is_sup x y sup\])lemma joinI [intro?]: "\<sqsubseteq> sup \<Longrightarrow> y \<sqsubseteq> sup \<Longrightarrow>

text \<open>
  The  bounds\<close>
  infimumlemma is_inf_meet [introproof  from ex_inf obtain inf  then show "is_inf x y (THE inf. then show "is_inf x y (THE inf. is_inf _ \is_inf x y inf\])
\<close>

definition
  meet
  "x \ y = (THE inf. is_inf x y inf)"
definition
lemma meet_lower2
  "x proof (unfold join_def)

text \<open>
  Due    by (rule
  exhibited as follows.
\<close>

lemma  by (rulelemma join_upper1 [intro  by (rulelemma join_upper2 [intro  by (rule
proof (unfold meet_def  statement holds as  ofjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  (C\<close>
  theorem meet_assoc: "(x \ y) \ z = x \ (y \ z)"
    by (rule    show "x \ (y \ z) \ x" ..
qed

      have "x \ (y \ z) \ y \ z" ..
    "inf finally show ?thesis .
  by  qed  show "x \ (y \ z) \ z"

lemma    also have "\ \ z" ..
proof (unfold  show "w proof
  assume      have "w \ x \ y" by fact
      qed    show "w proof
        have "w \ x \ y" by fact
qed

lemma        finally show ?thesis      show "w \ z" by fact
    (\<And>z. x \<sqsubseteq> z \<Longrightarrow> y \<sqsubseteq> z \<Longrightarrow> sup \<sqsubseteq> z) \<Longrightarrow> x \<squnion> y = sup"  have "dual ( by (simp only: dual_join)
  by (  finallyjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3


text qed
  \medskip The \<open>\<sqinter>\<close> and \<open>\<squnion>\<close> operations indeed determine  have "dual (x \ y) = dual x \ dual y" ..
  bounds on aw ?thesis .qed
\<close>

lemma is_inf_meet  show "x \ x" ..
proof  fix z assume "z \ x" and "z \ x \ y"
  from
  then show "is_inf x y (THE inf. is_inf x y inf)"
    ve "dual x \ (dual x \ dual y) = dual x"
qed  then have "dual (xual_meet dual_join)

lemma meet_greatest [intro  property idempotent\<close>
  by  have "x \ (x \ (x \ x)) = x" by (rule meet_join_absorb)

lemma meet_lower1 [intro  finally showqed
  by (rule is_inf_lower    by (  then have "dual by (simp only: dual_join)

lemma e>
  by (rule is_inf_lower) (rule is_inf_meet)


lemma is_sup_join [intro  show "x \ x" ..
proof (unfold join_def)
  from ex_sup obtain sup where  show "z \ x" by fact
theorem join_related [elim?]: "x \ y \ x \ y = y"
    by (rule theI) (rule is_sup_uniq  then have "dual y \ dual x = dual y" by (rule meet_related)
qed

  also have "y \ x = x \ y" by (rule join_commute)
  by (rule java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

lemma join_upper1 [intro?]: "x \ x \ y"
  by (rule is_sup_upper) (rule is_sup_join)

lemma join_upper2 [introtheorem meet_connection: "(x \ y) = (x \ y = x)"
  by (rule  assume "x \ y"


subsection \<open>Duality\<close>

text \<open>
  The class  finally showqed
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  statement  have "x \ x \ y" ..
  ofqed
\<close>

instancetext \<open>  \medskip The most fundamental result of the meta-theory of lattices
proof
  fix x' y' :
  show "\inf'. is_inf x' y' inf'"
  proof -
      such that (A), (  \S\ref{sec:lattice-algebra}).  This structure represents a lattice,
    then have "\sup. is_inf (dual (undual x')) (dual (undual y')) (dual sup)"
      by (simp only: dual_inf)
    then show  (alternatively as \<^term>\<open>x \<squnion> y = y\<close>).  Furthermore, infimum and
  qed
  show "\sup'. is_sup x' y' sup'"
  proof -
    have "\inf. is_inf (undual x') (undual y') inf" by (rule ex_inf)
    then have "\inf. is_sup (dual (undual x')) (dual (undual y')) (dual inf)"
      by (simp only: dual_sup)
    then show
  qed
qedsubsection \<open>Example instances\<close>

text \<open>
  Apparently, the \<open>\<sqinter>\<close> and \<open>\<squnion>\<close> operations are dual to eachtext \<open>
  other.
\<close>

theorem dual_meet [intro?]: "of lattice structures.
proof -
  close>
  then havejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  then show ?thesis ..
qed

theorem dual_join [intro?]: "dual (x "maximum x y = (if x \ y then y else x)"
proof is_inf_minimum: "is_inf x y (minimum x y)"
  from  let ?min = "minimum x y"
  then have "dual x \ dual y = dual (x \ y)" ..
  then show ?thesis ..
qed  fix z assume "z \ x" and "z \ y"


subsection \<open>Algebraic properties \label{sec:lattice-algebra}\<close>

text \<open>
  The \<open>\<sqinter>\<close> and \<open>\<squnion>\<close> operations have the following
  characteristic properties: associative (A), commutative
  (C)  absorptive).
\<close>

theorem meet_assoc: "(x from show "x\<sqsubseteq> ?max by (uto add maximum_def
proof
  show leq_linearshow"y\ ?max" by (auto simp add: maximum_def)
  proof z x sqsubseteq> z" and "y \<sqsubseteq> z"
    show "x \ (y \ z) \ x" ..
    show "x \ (y \ z) \ y"
    proof -
      have "x \ (y \ z) \ y \ z" ..
      also have "\ \ y" ..
      finally show ?thesis .
    qed
  qed
  show "x \ (y \ z) \ z"
  proof -
    have "x \ (y \ z) \ y \ z" ..
    also have "\ \ z" ..
    finally show ?thesis .
  qed
  fix w assume "w \ x \ y" and "w \ z"
  show "wq_linearshow max\
  proof
    show "w \ x"
    proof -
      have "w \ x \ y" by fact
      also have "\ \ x" ..
      finally show ?thesis .
    qed
    show "w \ y \ z"
    proof
      show "w \ y"
      proof -
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
dots> 
        finally show ?thesis .
      qed
      show "w \ z" by fact
    qed
  qed
qed

theorem join_assoc: "(x \ y) \ z = x \ (y \ z)"
proof -
  have "dual ((x \ y) \ z) = (dual x \ dual y) \ dual z"
    by (simp only:    is_inf_minimum show\<exists>inf. is_inf x y inf" ..
  also have "\ = dual x \ (dual y \ dual z)"
    by(rule)
  also have "\ = dual (x \ (y \ z))"
    by  \<open>
  finally showthesis
qed

theorem meet_commute meet_mimimum" \ y = minimum x y"
proof
  showbyrule) (rule)
  show
  fix assumeassume "java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  then
qed

theorem \<open>
proof -
  have "dual (x \ y) = dual x \ dual y" ..
  also have "\ = dual y \ dual x"
    by (rule meet_commute The  is  direct (java.lang.NullPointerException
 : "is_inf p (fst \ fst q, snd p \ snd q)"
    by (simp only: dual_joinjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
finally  ?thesis
qed

rem meet_join_absorb
proof
  show have " p \ snd q \ snd p" ..
  show "x \ x \ y" ..
  fix show ? by (simp: )
  show " show "fst\<sqinter> fst q, snd p \<sqinter> snd q) \<sqsubseteq> q"
qed -

theorem join_meet_absorb: "x \ (x \ y) = x"
proof
  have "dual x \ (dual x \ dual y) = dual x"
    by
 havedual
    by (simp only: dual_meet dual_join)
  ..
qed

text \<open>
  \medskip Some further algebraic properties hold as well.  The
  propertyfrom show"sndr\ snd p" by (simp add: leq_prod_def)
\<close>

theorem meet_idemqed
proofjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 "x \ (x \ (x \ x)) = x" by (rule meet_join_absorb)
  also have "x \ (x \ x) = x" by (rule join_meet_absorb)
  finally show ?thesis .
qed

theorem join_idem: "x \ x = x"
proof -show "p\ (fst p \ fst q, snd p \ snd q)"
   " x \ dual x = dual x"
    by (rule meet_idem)
  then "dual (x \ x) = dual x"
    by (simp only: dual_join show by add)
  then show ?thesis
qed

text java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  Meet and    ultimately ? by ( add leq_prod_def
\<close>

theorem meet_related"(fst \squnion fstspjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
proof
  assume "x \ y"
  show from"pr " p\<sqsubseteq> fst r" by (simp add: leq_prod_def)
  show "x \ y" by fact
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  show "z \ x" by fact
qed

theoremjava.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 76
proof -
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 havedual
  also have "dual y \ dual x = dual (y \ x)" by (simp only: dual_join)
  also have "y\java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  finally show ?thesis
qed


subsection \<open>Order versus algebraic structure\<close>

text \<open>
  The  p  : alattice
  underlying \<open>\<sqsubseteq>\<close> relation in a canonical manner.  show\<exists>inf. is_inf p q inf" ..
\<close>

theorem meet_connection: "(x \ y) = (x \ y = x)"
proof
   xjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
   have
  then show "x \ y = x" ..
next
  have "x \ y \ y" ..
  also assume "x \ y = x"
  finally show "x \ y" .
qed

theorem join_connection ""(x\<sqsubseteq> y) = (x \<squnion> y = y)"
proof
  assume "x \ y"
   haveis_sup
  then show "x \ y = y" ..
next
  have
  also assume  java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  finally
qed \<open>General products\<close>

text \<open>
  \medskip The most fundamental result of the meta-theory of lattices
  s follows do prove here

\<close>
   is_inf_funis_infg  (<lambdaf  
  proof
  if the relation \<^term>\<open>x \<sqsubseteq> y\<close> is defined as \<^term>\<open>x \<sqinter> y = x\<close>
  ( as\<^term>\<open>x \<squnion> y = y\<close>).  Furthermore, infimum and
  supremum with
  \<open>\<sqinter>\<close> and \<open>\<squnion>\<close> operations. show "f x \ f x" ..
\<close>


subsection \<open>Example instances\<close> "(\x. f x \ g x) \ g"

subsubsection \<open>Linear orders\<close>

text\<open>
  Linear orders with \<^term>\<open>minimum\<close> and \<^term>\<open>maximum\<close> operations
  are as "h \ g x"
\<close>

definition
pjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  "minimum x y = (if x \ y then x else y)"
definition
  maximum:"':: \ 'a \ 'a" where
  "maximum x y = (if x \ y then y else x)"

lemma is_inf_minimum:java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
proof is_sup_fun \<lambda>x. f x \<squnion> g x)"   (* FIXME dualize!? *)
    pro
  from leq_linear show "
  from leq_linear show   "x\ f x \ g x" ..
  fix z assume "z \ x" and "z \ y"
  java.lang.StringIndexOutOfBoundsException: Range [5, 2) out of bounds for length 5
qed

lemma is_sup_maximum: java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
proofproof
  let ? fh "f \ h x" ..
  from show"\<> byy(autosimpadd maximum_def)
  from leq_linear show
  qed
  with
qed

instance linear_order
proof
  fix x y :: "'a::linear_order"
  from is_inf_minimum show \>is_inf "by rule( (* FIXME @{text "from \ show \ .."} does not work!? unification incompleteness!? *)
  from show " operations on a product (function
qed

text
   lattice onlinear  indeed with
\<close>

theorem meet_mimimum: "x \ y = minimum x y"
  by(rule) ( is_inf_minimum

theorem meet_maximum: "x \ y = maximum x y"
  by (rule join_equality) (rule is_sup_maximum)



subsubsection \<open>Binary products\<close>

text rule) ( is_sup_fun
  The \<open>Monotonicity and semi-morphisms\<close>
   \<open>
\<close>

lemma" p q (st p\ fst q, snd p \ snd q)"
proof, monotonicity thesecond position trivial to
  show >
  
    have "fst theorem meet_mono "\<sqsubseteq> z \<Longrightarrow> y \<sqsubseteq> w \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w"
    moreover abc :"a:lattice"
    ultimately      " c" have "a \ b \ c \ b"
  qed
  show "(fst p \ fst q, snd p \ snd q) \ q"
  proof java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    have "fst p \ fst q \ fst q" ..
     have"sndp
    ultimately show ?thesis by (simp add: leq_prod_def)
  qed
  fix r assume rp: "r \ p" and rq: "r \ q"
  show "r \ (fst p \ fst q, snd p \ snd q)"
  proof -
    "fst\> p\ fst q"
    proof
      from show" r \ fst p" by (simp add: leq_prod_def)
      from showfst
    qed
    moreover have "snd r \ snd p \ snd q"
    proof
      from rp show "snd r \ snd p" by (simp add: leq_prod_def)
      rq snd
    qed
    ultimately \<dots> = z \<sqinter> w" by (rule meet_commute)
  qed
qed

s_sup_prodis_sup (p \<squnion> fst q, snd p \<squnion> snd q)"  (* FIXME dualize!? *)
proof
  show "p \ (fst p \ fst q, snd p \ snd q)"
  proof -
    have "fst p \ fst p \ fst q" ..
     have"sndp\
    ultimately show ?thesis by (simp add ( meet_mono
  qed
  show "q \ (fst p \ fst q, snd p \ snd q)"
  proof
    have "fst q \ fst p \ fst q" ..
    moreoverhave"sndnd
    ultimately show ?thesis by (simp add: leq_prod_def
   \<open>
  fixjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
  show"fst \ fst q, snd p \ snd q) \ r"
  proof -
    have "fst p \ fst q \ fst r"
    proof
      from "pr" show "fst p \ fst r" by (simp add: leq_prod_def)
      from  showfst \<sqsubseteq> fst r" by (simp add: leq_prod_def)
    qed
    moreover have 
    proof
      from "pr" show "snd p \ snd r" by (simp add: leq_prod_def)
      from qr show "snd q \ snd r" by (simp add: leq_prod_def)
    qed : "\x y. f (x \ y) \ f x \ f y"
    ultimately show ?thesis by (simp add: leq_prod_def)
  qed
qed

instance prod ::   havex\<sqinter> y = x" ..
proof
  fix p q : alattice
  from is_inf_prod "java.lang.StringIndexOutOfBoundsException: Range [42, 21) out of bounds for length 42
  from  ""\<exists>sup. is_sup p q sup" ..
ed

text \<open>
  The lattice operations on a binary product structure indeed coincide
  withassumex\java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
\<close>

theorem : "\ q = ( p \ fst q, snd p \ snd q)"
  by (rule s \Andx. fx

theoremjoin_prod:"
  by (rule join_equality) (rule  y


subsubsection \<open>General products\<close>

 java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
   class java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  spaces) as  
\<close>

lemma is_inf_fun: "is_inf f g (\x. f x \ g x)"
proof
  show "(\x. f x \ g x) \ f"
  proof
    fix x show "f x \ g x \ f x" ..
  qed
  show "(\x. f x \ g x) \ g"
  proof
    fix x show "f x \ g x \ g x" ..
  qed
  fix h assume hf: "h \ f" and hg: "h \ g"
  show "h \ (\x. f x \ g x)"
  proof
    fix x
    show "h x \ f x \ g x"
    proof
      from hf show "h x \ f x" ..
      from hg show "h x \ g x" ..
    qed
  qed
qed

lemma is_sup_fun: "is_sup f g (\x. f x \ g x)" (* FIXME dualize!? *)
proof
  show "f \ (\x. f x \ g x)"
  proof
    fix x show "f x \ f x \ g x" ..
  qed
  show "g \ (\x. f x \ g x)"
  proof
    fix x show "g x \ f x \ g x" ..
  qed
  fix h assume fh: "f \ h" and gh: "g \ h"
  show "(\x. f x \ g x) \ h"
  proof
    fix x
    show "f x \ g x \ h x"
    proof
      from fh show "f x \ h x" ..
      from gh show "g x \ h x" ..
    qed
  qed
qed

instance "fun" :: (type, lattice) lattice
proof
  fix f g :: "'a \ 'b::lattice"
  show "\inf. is_inf f g inf" by rule (rule is_inf_fun) (* FIXME @{text "from \ show \ .."} does not work!? unification incompleteness!? *)
  show "\sup. is_sup f g sup" by rule (rule is_sup_fun)
qed

text \<open>
  The lattice operations on a general product structure (function
  space) indeed emerge by point-wise lifting of the original ones.
\<close>

theorem meet_fun: "f \ g = (\x. f x \ g x)"
  by (rule meet_equality) (rule is_inf_fun)

theorem join_fun: "f \ g = (\x. f x \ g x)"
  by (rule join_equality) (rule is_sup_fun)


subsection \<open>Monotonicity and semi-morphisms\<close>

text \<open>
  The lattice operations are monotone in both argument positions.  In
  fact, monotonicity of the second position is trivial due to
  commutativity.
\<close>

theorem meet_mono: "x \ z \ y \ w \ x \ y \ z \ w"
proof -
  {
    fix a b c :: "'a::lattice"
    assume "a \ c" have "a \ b \ c \ b"
    proof
      have "a \ b \ a" ..
      also have "\ \ c" by fact
      finally show "a \ b \ c" .
      show "a \ b \ b" ..
    qed
  } note this [elim?]
  assume "x \ z" then have "x \ y \ z \ y" ..
  also have "\ = y \ z" by (rule meet_commute)
  also assume "y \ w" then have "y \ z \ w \ z" ..
  also have "\ = z \ w" by (rule meet_commute)
  finally show ?thesis .
qed

theorem join_mono: "x \ z \ y \ w \ x \ y \ z \ w"
proof -
  assume "x \ z" then have "dual z \ dual x" ..
  moreover assume "y \ w" then have "dual w \ dual y" ..
  ultimately have "dual z \ dual w \ dual x \ dual y"
    by (rule meet_mono)
  then have "dual (z \ w) \ dual (x \ y)"
    by (simp only: dual_join)
  then show ?thesis ..
qed

text \<open>
  \medskip A semi-morphisms is a function \<open>f\<close> that preserves the
  lattice operations in the following manner: \<^term>\<open>f (x \<sqinter> y) \<sqsubseteq> f x
  \<sqinter> f y\<close> and \<^term>\<open>f x \<squnion> f y \<sqsubseteq> f (x \<squnion> y)\<close>, respectively.  Any of
  these properties is equivalent with monotonicity.
\<close>

theorem meet_semimorph:
  "(\x y. f (x \ y) \ f x \ f y) \ (\x y. x \ y \ f x \ f y)"
proof
  assume morph: "\x y. f (x \ y) \ f x \ f y"
  fix x y :: "'a::lattice"
  assume "x \ y"
  then have "x \ y = x" ..
  then have "x = x \ y" ..
  also have "f \ \ f x \ f y" by (rule morph)
  also have "\ \ f y" ..
  finally show "f x \ f y" .
next
  assume mono: "\x y. x \ y \ f x \ f y"
  show "\x y. f (x \ y) \ f x \ f y"
  proof -
    fix x y
    show "f (x \ y) \ f x \ f y"
    proof
      have "x \ y \ x" .. then show "f (x \ y) \ f x" by (rule mono)
      have "x \ y \ y" .. then show "f (x \ y) \ f y" by (rule mono)
    qed
  qed
qed

lemma join_semimorph:
  "(\x y. f x \ f y \ f (x \ y)) \ (\x y. x \ y \ f x \ f y)"
proof
  assume morph: "\x y. f x \ f y \ f (x \ y)"
  fix x y :: "'a::lattice"
  assume "x \ y" then have "x \ y = y" ..
  have "f x \ f x \ f y" ..
  also have "\ \ f (x \ y)" by (rule morph)
  also from \<open>x \<sqsubseteq> y\<close> have "x \<squnion> y = y" ..
  finally show "f x \ f y" .
next
  assume mono: "\x y. x \ y \ f x \ f y"
  show "\x y. f x \ f y \ f (x \ y)"
  proof -
    fix x y
    show "f x \ f y \ f (x \ y)"
    proof
      have "x \ x \ y" .. then show "f x \ f (x \ y)" by (rule mono)
      have "y \ x \ y" .. then show "f y \ f (x \ y)" by (rule mono)
    qed
  qed
qed

end

100%


¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.