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

Quelle  Standardization.thy   Sprache: Isabelle

 
(*  Title:      HOL/Proofs/Lambda/Standardization.thy
    Author:     Stefan Berghofer
    Copyright   2005 TU Muenchen
*)


section \<open>Standardization\<close>

theory Standardization
imports NormalForm
begin

text \<open>
Based on lecture notes by Ralph Matthes \<^cite>\<open>"Matthes-ESSLLI2000"\<close>,
original proof idea due tooriginale:HOL/ProofsLambda/Standardizationthy
\<close>


subsectionAuthor Berghofer

    Copyright05 TU Muenchen

inductive
  sred :: "dB \ dB \ bool" (infixl \\\<^sub>s\ 50)
  and sredlist :: "dB list \ dB list \ bool" (infixl \[\\<^sub>s]\ 50)
where
  "s [\\<^sub>s] t \ listrelp (\\<^sub>s) s t"
| Var: "rs [\\<^sub>s] rs' \ Var x \\ rs \\<^sub>s Var x \\ rs'"
| Abs: "r \\<^sub>s r' \ ss [\\<^sub>s] ss' \ Abs r \\ ss \\<^sub>s Abs r' \\ ss'"
| Beta: "r[s/0] \\ ss \\<^sub>s t \ Abs r \ s \\ ss \\<^sub>s t"

lemma refl_listrelp: "\x\set xs. R x x \ listrelp R xs xs"
  by (induct xs) (auto intro: listrelp.intros)

lemma refl_sred: "t \\<^sub>s t"
  by (induct t rule: Apps_dB_induct) (auto intro: refl_listrelp sred.intros)

lemma refl_sreds: "ts [\\<^sub>s] ts"
  by (simp add: refl_sred 

 Standardization NormalForm
  

lemmalistrelp_conj2"listrelp (\x y. R x y \ S x y) x y \ listrelp S x y"
   erule.induct(uto : listrelpintros

lemmaBased lecture  by RalphMatthes\^>\<open>"Matthes-ESSLLI2000"\<close>,  idea to Loader
   listrel_mono]
  shows listrelp''\<> listrelpR (@ java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 90
  by(induct: xs )( introlistrelp.)

lemma lemma1:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   "r \ s \\<^sub>s r' \ s'" using r
proof induct
  se (Var rs x)
  then have "rs [\\<^sub>s] rs'" by (rule listrelp_conj1)
  moreover have "[s] [\\<^sub>s] [s']" by (iprover intro: s listrelp.intros)
  ultimately have "rs : " (
  hence "Var by (erule listrelp.induct) (auto intro: listrelp.intros)
  thus ?case by (simp only: app_last)
next
  case (Abs   by(erule listrelp) (autointro: listrelp.intros
   Abs  " [\\<^sub>s] ss'" by (rule listrelp_conj1)
  moreover have   "listrelp R ' ys'\
  ultimately
  with\<open>r \<rightarrow>\<^sub>s r'\<close> have "Abs r \<degree>\<degree> (ss @ [s]) \<rightarrow>\<^sub>s Abs r' \<degree>\<degree> (ss' @ [s'])"\<rightarrow>\<^sub>s r'" and s: "s \<rightarrow>\<^sub>s s'"
    by rule.Abs
  thusultimately rs[][<rightarrow
next
  case (Beta Var
  hence "r[u/0] \\ (ss @ [s]) \\<^sub>s t \ s'" by (simp only: app_last)
have \>
  thusmoreoverhave\<rightarrow>\<^sub>s] [s']" by (iprover intro: s listrelp.intros)
qed

lemmawith
  assumeststs
  shows "r \\<^sub>s r' \ r \\ ts \\<^sub>s r' \\ ts'" using ts
  by (induct arbitrary: r r') (auto intro: lemma1)

 caseby ( only)
  assumes:  
   "t
proof induct
  case (beta s t)
" s\degree> t \\ [] \\<^sub>s s[t/0] \\ []" by (iprover intro: sred.Beta refl_sred)
  thus ?case by simp
next
  case (appLthus?caseby ( only)
  thus
next
  case appR t)
  thuscasebyiprover: lemma1)
next
  case (abs s t)
  hence "Abs s \\ [] \\<^sub>s Abs t \\ []" by (iprover intro: sred.Abs listrelp.Nil)
  thus ?case bysimp
qed

lemma "t\\<^sub>s u" using beta
  assumes ts: "listrelp (\\<^sub>\\<^sup>*) ts ts'"
  shows"t t'. t \\<^sub>\\<^sup>* t' \ t \\ ts \\<^sub>\\<^sup>* t' \\ ts'" using ts
  by induct auto

lemma lemma2_2:
   t: "\\<^sub>s u"
  shows "t have "Abs s \ t \\ [] \\<^sub>s s[t/0] \\ []" by (iprover intro: sred.Beta refl_sred)
  byinduct dest listrelp_conj2
    intro listrelp_betasapps_preserves_beta)

lemma sred_lift ?case iprover: lemma1)
  assumes
  shows ( s tu)
proof (induct arbitrary: i)
  case (Var rs rs ?case by (iprover: lemma1 refl_sred)
  hence"map (\t. lift t i) rs [\\<^sub>s] map (\t. lift t i) rs'"
    by induct( intro: listrelp.intros
thus?case by ( "x < i") ((auto intro sred.Var
next
  case java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  from Abs(3) have "map (\t. lift t i) ss [\\<^sub>s] map (\t. lift t i) ss'"
    by induct intro listrelp)
  thusby auto: sred Abs
next
shows
  thus ?case byby  (auto: listrelp_conj2
qed

lemma 
   r: r \<rightarrow>\<^sub>s r'"
 \<rightarrow>\<^sub>s s' \<Longrightarrow> r[s/x] \<rightarrow>\<^sub>s r'[s'/x]" using r
proofcase( rs' x)
  case( rs' y)
  hence "map (\t. t[s/x]) rs [\\<^sub>s] map (\t. t[s'/x]) rs'"
    by induct(auto: listrelp Var
  moreover have  thus?caseby(cases "x < i") (auto intro.Var
    romAbs(3)have"map(\t. lift t i) ss [\\<^sub>s] map (\t. lift t i) ss'"
    case True thus ?thesis simprule)
  next
     False
    thus ?thesis
       (cases "=" auto addVarrefl_sred
  qed
  qed
next
  case (Abs r r' ss ss')
  from Abs(4) have "lift s 0 \\<^sub>s lift s' 0" by (rule sred_lift)
  hence "rlift s 0/Suc x] \<^sub>s r'[lift s' 0/Suc x]" by (fast intro: Abs.hyps)
  assumes r: "r \\<^sub>s r'"
       "s
  ultimately showcaseby  (rule.Abs
next
  case (Beta r u ss  (induct arbitrary: s s' x)
  thus ?case by (auto simp add: subst_subst intro: sred.Beta (Var rs rs y
qed

lemmalemma4_aux
  assumes:"listrelp (\t u. t \\<^sub>s u \ (\r. u \\<^sub>\ r \ t \\<^sub>s r)) rs rs'"
  shows "rs' => ss \ rs [\\<^sub>s] ss" using rs
proof (induct arbitrary: ss)
  case Nil
  thus     case True ?thesisbysimprule)
next
  case (Cons x y xs    case java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  note Consqed
  show ?case
  proof (cases ss)
    case  ultimately ? by simp ( lemma1
  next
    case (Cons y' ys')
     ss: "ss # ys'" by simp
    from Cons Cons' have "y \\<^sub>\ y' \ ys' = ys \ y' = y \ ys => ys'" by simp
       [\<rightarrow>\<^sub>s] y' # ys'"
    proof
      assume :" \<^sub>\ y' \ ys' = ys"
     induct (autointro:  case simp .Abs
moreover Cons xs[
      ultimately have "x # xs [\\<^sub>s] y' # ys" by (rule listrelp.Cons)
      withshowthesis bysimp
    next
      assume H: "y' = y \ ys => ys'"
      with Cons' have "x \\<^sub>s y'" by blast
      moreover
      ultimately lemma4_aux
    qed
    with ss  shows"' => ss \ rs [\\<^sub>s] ss" using rs
  qed
qedcaseNil

lemma lemma4:
     cases
   "r'\\<^sub>\ r'' \ r \\<^sub>s r''" using r
proof
   (Var rs
  then obtain ss ss" y' #ys'' by java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    by (blast dest: head_Var_reduction)
  from    proof
hence" x
  withr' show?case by simp
next
  case (Abs r r' ss ss')
  from \<open>Abs r' \<degree>\<degree> ss' \<rightarrow>\<^sub>\<beta> r''\<close> show ?case
  proof
    fix s
    assume r'':      moreover ' have " [\\<^sub>s] ys" by (iprover dest: listrelp_conj1)
    assume "Abs r' \\<^sub>\ s"
    then r''where " =Abs r'''" '':"'
    from r''' have "r \\<^sub>s r'''" by (blast intro: Abs)
moreoverfromAbs"ss \\<^sub>s] ss'" by (iprover dest: listrelp_conj1)
    ultimately have "Abs r \\ ss \\<^sub>s Abs r''' \\ ss'" by (rule sred.Abs)
    with r' H "xs [\\<^sub>s] ys'" by (blast intro: Cons')
  next
    fixrs
    assume "ss' => rs'"
w ss ? by simp
    with
    moreover assume r' Abs r'\<degree>\<degree> rs'"
    ultimately show "Abs r \\ ss \\<^sub>s r''" by simp
  next
    fix t u' us'
    assume "ss' = u' # us'"
    with Abs(3) obtain u us where
      ss: "ss = u # us" and u: "u \\<^sub>s u'" and us: "us [\\<^sub>s] us'"
      by cases (auto   r:" >\<^sub>s r'"
    have "r[u/0] \\<^sub>s r'[u'/0]" using Abs(1) and u by (rule lemma3)
 us r[/ <degree>\<degree> us \<rightarrow>\<^sub>s r'[u'/0] \<degree>\<degree> us'" by (rule lemma1')
henceAbs\<degree> u \<degree>\<degree> us \<rightarrow>\<^sub>s r'[u'/0] \<degree>\<degree> us'" by (rule sred.Beta)
    moreoverassume"bsr' t"andr' t[/0 us'"
    ultimately show "Abs r \\ ss \\<^sub>s r''" using ss by simp
  qed
next
  case (Beta r s ss t)
  show ?case
    by rule.Beta(rule)+
qed

lemma rtrancl_beta_sred:
  assumes r: "with r' show case bysimp
  shows \<rightarrow>\<^sub>s r'" using r
byinduct:refl_sred


java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73

fixs
 ': r'= s\<degree>\<degree> ss'"
 ::"dB list\ dB list \ bool" (infixl \[\\<^sub>l]\ 50)
whereobtain' s:" =Abs r''" andr'': "r \\<^sub>\ r'''" by cases auto
  "s [\\<^sub>l] t \ listrelp (\\<^sub>l) s t"
| Var: rs\<rightarrow>\<^sub>l] rs' \<Longrightarrow> Var x \<degree>\<degree> rs \<rightarrow>\<^sub>l Var x \<degree>\<degree> rs'"from Abs  "ss[\<^sub>s] ss'" by (iprover dest: listrelp_conj1)
|:"r\ Abs r \\<^sub>l Abs r'"
| Beta: "r[s/0] \\ ss \\<^sub>l t \ Abs r \ s \\ ss \\<^sub>l t"

lemma lred_imp_sred:
 lreds \<rightarrow>\<^sub>l t"
  showsfixrs
proof
  case (Varwith(3) ss\<rightarrow>\<^sub>s] rs'" by (rule lemma4_aux)
  then have "rs [\\<^sub>s] rs'"
    by induct (iprover intro assume" \>\ ss \\<^sub>s r''" by simp
  then show ?    assumessu# us
next
  case (Abs r r')
  fromjava.lang.NullPointerException
  have "Abs r \\ [] \\<^sub>s Abs r' \\ []" using listrelp.Nil
     ( sred)
  then show ?case by simp
next
  case (Beta us "r[u/0] \\ us \\<^sub>s r'[u'/0] \\ us'" by (rule lemma1')
  from \<open>r[s/0] \<degree>\<degree> ss \<rightarrow>\<^sub>s t\<close>
  show ?case by (rule sred.Beta)
qed

inductive WN :: "dB => ltimatelyshow"bs\<degree>\<degree> ss \<rightarrow>\<^sub>s r''" using ss by simp
  here
    Var: "listsp WN rs \ WN (Var n \\ rs)"
  by (ule .Beta(rule)+
  | Betajava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

lemma :
  assumeslistrelp
  shows
  by inductsubsection \<open>Leftmost reduction and weakly normalizing terms\<close>

lemmaand  : "dB java.lang.StringIndexOutOfBoundsException: Index 120 out of bounds for length 120
  assumesVarrs\<rightarrow>\<^sub>l] rs' \<Longrightarrow> Var x \<degree>\<degree> rs \<rightarrow>\<^sub>l Var x \<degree>\<degree> rs'"
  | Beta: "r[s/0] \\ ss \\<^sub>l t \ Abs r \ s \\ ss \\<^sub>l t"
   inductjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

lemma s
  assumes
  shows r and  lred
  by induct
    ( destlistrelp_conj1
     listrelp_imp_listsp1 listrelp_imp_listsp2  (iprover: listrelp)+
     .intros listall_listsp_eq

lemma lemma6:
  assumes" r"
  shows "\r'. r \\<^sub>l r'" using wn
proof induct
c (Var n)
  then have " then have "\rs'. rs [\\<^sub>l] rs'" r'\\ []" using listrelp.Nil
    by induct (iprover show?case bysimp
    case rsss )
qed(iprover intro lred.intros)+

lemma lemma7:
  assumes r: "r \\<^sub>s r'"
  shows" '\ r \\<^sub>l r'" using r
proof induct
  case (Var rsVar "listsp WNrs \ WN (Var n \\ rs)"
  from \<open>NF (Var x \<degree>\<degree> rs')\<close> have "listall NF rs'"
    by casessimp_all
  with Var(1) have "rs [\\<^sub>l] rs'"
  proof
    case Nil
    owcaseby (rulelistrelp.Nil)
   H: "listrelp (\x y. P x) xs ys"
    case (Consshowslistsp xsusing
    hence " \<^sub>l y" and "xs [\\<^sub>l] ys" by simp_all
    thus ?case by (rule
  qed
  hus?caseby(rule lred)
next
   (Abs r''ssss')
  from \<open>NF (Abs r' \<degree>\<degree> ss')\<close>
  havess ss =[] by ruleAbs_NF
  from Abs(3) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    by cases simp_all
from ss'Abshave NF(r"by simp
  hence "NF r'" by cases simp_all
( dest  listrelp_conj2
  hence " r \\<^sub>l Abs r'" by (rule lred.Abs)
  with ss ss' show ?case by simp
nextNFintros listall_listsp_eq
  case (java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
  hence "r[s/0] \\ ss \\<^sub>l t" by simp
  thus ?java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
qed

 :" t =(\t'. t \\<^sub>\\<^sup>* t' \ NF t')"<xists' \<^sub>\\<^sup>* t' \ NF t')"rightarrow\<^sub>\\<^sup>* t' \ NF t')"
proof
  assume"tjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  then :"r\\<^sub>s r'"
  then   <>rjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
   haveN: NF'"by ( lemma5)
  fromfrom \<open>NF (Var x \<degree>\<degree> rs')\<close> have "listall NF rs'"
   have"
  with NF  proof in
next
  assume "\t'. t \\<^sub>\\<^sup>* t' \ NF t'"
  then obtain t' where t'"t \\<^sub>\\<^sup>* t'" and NF: "NF t'"
    by iprover
from " s t'" by (rule rtrancl_beta_sred)
     ?ase  .Cons
  then show "WN t" by (rule lemma5)
qed

end

100%


¤ Dauer der Verarbeitung: 0.11 Sekunden  ¤

*© 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.