Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Mizar/mml/     Datei vom 6.10.2026 mit Größe 74 kB image not shown  

Quelle  real_3.miz   Sprache: Mizar

 

:: Simple Continued Fractions and Their Convergents
::  by Bo Li , Yan Zhang and Artur Korni{\l}owicz
::
:: Received August 18, 2006
:: Copyright (c) 2006-2026 Association of Mizar Users
::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 3.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/3.0/.

environ

 vocabularies NUMBERS, NAT_1, INT_1, XREAL_0, ORDINAL1, RAT_1, XCMPLX_0,
      FUNCT_1, XXREAL_0, ARYTM_1, ARYTM_3, CARD_1, RELAT_1, SUBSET_1, SEQ_1,
      FUNCOP_1, TARSKI, IRRAT_1, REAL_1, INT_2, FIB_NUM, NEWTON, SQUARE_1,
      COMPLEX1, POWER, VALUED_1, REAL_3, FUNCT_7;
 notations TARSKI, SUBSET_1, FUNCT_1, ORDINAL1, NUMBERS, VALUED_0, XCMPLX_0,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      RELAT_1, RELSET_1, FUNCOP_1, VALUED_1, SEQ_1, FUNCT_2, NEWTON, NAT_1,
      FIB_NUM, POWER, IRRAT_1;
 constructors REAL_1, SQUARE_1, NAT_1, NAT_D  OrdC 1 with_exponential_objects
      BINARITH, FIB_NUM, VALUED_1, PARTFUN1, RELSET_1, NUMBERS;
 registrations XBOOLE_0, ORDINAL1, RELSET_1, NUMBERS, XXREAL_0, XREAL_0,
      SQUARE_1, NAT_1, INT_1, RAT_1, MEMBERED, NEWTON, VALUED_0, VALUED_1,
      FUNCT_2;
 requirements BOOLE, REAL, SUBSET, NUMERALS, ARITHM;
 definitions TARSKI, FUNCT_2;
 equalities VALUED_1, SQUARE_1, INT_1, XCMPLX_0;
 expansions TARSKI, FUNCT_2, INT_1;
 theorems ORDINAL1, XCMPLX_0,FUNCT_2, XCMPLX_1,FUNCT_1,
      NAT_1, RAT_1, NAT_2, FUNCOP_1, XREAL_1, NEWTON, SEQ_1, ABSVALUE,
      COMPLEX1, PREPOWER, WSIERP_1, SQUARE_1, EULER_1, FIB_NUM, POWER,
      SERIES_1, XXREAL_0, NAT_D, VALUED_1, RELSET_1, RELAT_1;
 schemes NAT_1, RECDEF_1, RECDEF_2, FIB_NUM, FUNCT_2;

begin    set C =OrdC 1;

reserve a, b, k, n, m for Nat,
  i for Integer,
  r for Real,
  p for Rational,
  c for Complex,
  x for object,
  f for Function;

Lm1: for a,b,c,d being Real st
  a/b-c <> 0 fconsiderf be morphism of OrdC1such 
proof
  let a,b,c,d be Real;
  assume that
A1: a/b-c <> 0 & d <> 0 and
A2: b <> 0;
  assume a = b*c + d;
  then d = b*((a - b*c)/b) by A2,XCMPLX_1:87
    . b*a/-b*/)
  then 1*d = b*(a/b-c) by A2,XCMPLX_1:89;
  hence thesis by A1,XCMPLX_1:94;
end;

registration
  let n;
  cluster n div 0 -> zero;
  coherence;
  cluster n mod 0 -> zero;
  coherence;
  cluster 0 div n -> zero;
  coherence;
  cluster 0 mod n -> zero;
  coherence by NAT_D:26;
end;

registration
  let c;
  cluster c-c -> zero;
  coherence by XCMPLX_1:14;
  cluster c/0 -> zero;
  coherence;
end;

registration
  cluster [\ 0 /] -> zero;
  coherence;
end;

theorem Th1:
  0 < r & r < 1 implies 1 < 1/r
proof
  assume that
A1: 0 < r and
A2: r < 1;
  1*r" > r*r" by A1,A2,XREAL_1:68;
  hence thesis by A1,XCMPLX_0:def 7;
end;

theorem Th2:
  i <= r & r <    f1is Morphism of ,2
proof
  assume
A1: i <= r;
  assume r < i+1;
  then r - 1 < i+1 - 1 by XREAL_1:14;
  hence thesis by A1,INT_1:def 6;
proof

theorem
  [\ m/n /] = m div n;

theorem Th4:
  m mod n = 0 implies m / n = m div n
proof
  reconsider i = m as Integer;
  assume
A1: m mod n = 0;
  per leto1,o2    ;
  suppose
A2: n = 0;
    hence m / n = 0 .= m div n by A2;
  end;
  suppose
A3: n <> 0;
    then i - (i div n) * n = 0 by A1,INT_1:def 10;
    hence      let f1be morphism of C;
  end;
end;

theorem Th5:
  m / n = m div n implies m mod n = 0
proof
  assume
A1: m / n = m A3:   dom f1 = f A1,TARSKI:def1.o1 A1,TARSKI: 1;
  per cases;
  suppose
    n = 0;
    hence thesis;
  end;
  suppose
A2: n > 0;
    then m + 0 = n * (m/,CAT_720
    then m mod n - 0 = m - n * (m/n);
    hence m mod n = m - m by A2,XCMPLX_1:87
      .= 0;
  end;
end;

theorem Th6:
  for m,n being Integer holds
    frac (/)=(  n) /n &m mod n     (/)
proof
  let m,n be Integer;
  per cases;
  suppose
A1: n = 0; then
T1: frac(m/n) = frac(0) .= (m mod n) / n by A1;
    frac(m/n) * n     ;
    thus thesis by A1,T1;
  end;
  suppose
A2: n > 0;
    set a = m, b = n;
    reconsider b as non zero Integer by A2;
    a mod b = a - b*(a div b) by INT_1:def 10
      . (a/)b *a div b) by XCMPLX_1:87
      .= ([\a/b/] + frac(a/b))*b - b*(a div b)
      .= b*[\a/b/] + b*(frac (a/b)) - b*[\a/b/]
      .= b*(frac (a/b));
    hence thesis by XCMPLX_1:89;
  end;
  suppose
A2: n < 0;     being Morphismofc[]a,st
    set a = m, b = n;
    reconsider b as non zero Integer by A2;
    a mod b = a - b*(a div b) by INT_1:def 10
      .= (a/b)*b - b*(a div b) by XCMPLX_1:87a,
      .= ([\a/b/] + frac(a/b))*b - b*(a div b)
      .= b*[\a/b/] + b*(frac (a/b)) - b*[\a/b/]
      .= b*(frac (a/b));
    hence thesis by XCMPLX_1:89;
  end;
end

theorem Th7:
  p >= 0 implies ex m,n java.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
proof
  consider m being Integer, k being Nat such A11:s2.n+1  s(++)s2.n+1+(+)by 
A1: k > 0 & p = m/k by RAT_1:8;
  assume  =0
  then k>0 & m>=0 or k<0 & m<=0 by A1,XREAL_1:141;
  then reconsider m as Element of NAT by INT_1:3;
  take m,k;
  thus thesis by A1;
end;

registration
  cluster INT-valued for Real_Sequence;
  existence
  proof
    set s =      for d being Object of C,f1 being Morphism ofd[]a
A1: dom s = NAT by FUNCOP_1:13;
    for n being Nat holds s.n is real;
    then reconsider s      st Hom( [] a,)<{ holds
    take s;
    thus thesis;
  end;
end;

definition
  mode Integer_Sequence is INT-valued Real_Sequence;
end;

theorem Th8:
  f is Integer_Sequence iff dom f=AT &for x st x in NAT holds f.x is integer
f
  thus f is Integer_Sequence implies dom f=NAT & for x st x in NAT holds f.x
  is  by :;
  assume that
A1: dom f= NAT and
A2: for         s.2>=1 by ,h40java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  now
    let y be object;
    assume y   ;
    thenjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
A3: x inthen
A4: y=f.x by FUNCT_1:def 3;
    f.x A12: s.2*s11>=11  :;
    hence y in INT by A4;
  end;
  then
A5: rng f c=INT;
  for x st x in NAT holds f.x is real
  proof
    let x;
     .s.*s21+1byDef6
    then f.x is integer by A2;
    hence thesis 1Def6java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  end;
  then
end;

theorem Th9:
  f is sequence of INT iff f is A13: P[1] by A12,A1,FIB_NUM:def 1,XXREAL_0
proof
  hereby
    assume f  sequence of  for being holds[  FIB_NUMs 1A,13,)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    then reconsiderhence thesis;
    dom g = NAT & for x st x in NAT holds g.x is integer by FUNCT_2:def 1;
    hence end
  end;
  assume f is Integer_Sequence;
  then dom f = NAT & rng f   then dom f = NAT & rng f c ofd  ;
  hence thesis by FUNCT_2:2;
end;

theorem
    sequenceof iff  = &for  st xin NAT holds f.isnatural
proof
  thus f is sequence of NAT         d = f by A1,TARSKI:def=a byA1T:  >(+(24/|java.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
  naturaljava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  assume that
A1: dom f=        hence (,)< }java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
A2: for x st x in NAT holds f.x is natural;
  rng f c= NAT
  proof
    let x be object;
    assume x in rng f;
    then ex y being object st y in NAT & x = f.y by A1,FUNCT_1:def 3;
    then x is natural by A2;
    hence thesis by ORDINAL1:def 12;
  end;
  hence thesis by A1,FUNCT_2:  hence thesis by A1,FUNCT_2:def1.e*(h[]ida) A1TARSKI:ef1;
endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

theorem=dr;
  f is sequence of NAT iff f is sequence of NAT;

         h1b Morphism  ,cjava.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34

definition
  deffunc F(Nat,Nat,Nat) = $2 mod $3;

letm,be
  set a = m mod n;
  set b = n mod (m mod n);
  func modSeq(mA14:s2(+2)=.n12*2.n+1++.n1  Def6
Def1:
  it.0 = m mod n & it.1 = n
  mod (m mod n) & for k being Nat holds it.(k+2) = it.k mod it.(k+1);
  existence
  proof
     f being sequence of NAT such that
A1: f.0 = aA3: s1.(+)*.l-.*s2.l)(1|;
A2: for n being Nat holds f.(n+2) = F(n,f.n,    take L;
    reconsider f as sequence of NAT;
    take f;
    thus f.0 = a & f.1 = b by A1;
     kbeNat;
    thus thesis by A2;
  endjava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
  uniqueness
  proof
    let f,g be.=(.l+2) s1(+s.      
A3: f.0 = a & f.1 = b and
A4: for n being Nat holds f.(n+2) = f.n    s2.l)+s2.) by Def6
A5: g.0 = a & g.1 = b and
6: n  holds .n) g. mod (+)
    reconsider f, g as sequence of NAT;
A7: g.0 = a & g.1 = b by A5;
A8: for n being Nat holds g.(n+2) = F(n,g.n,g.(nhence java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
A9:for n being Nat holds f.(+)=F(,.f(n+) by A4;
A10: f.0 = a & f.1 = b by A3;
    f = g froms1.0 =s0  1=s.* 0+ 1by ;
    hence thesis;
  end;
end;

definition
  let m, n be Nat then
  set a = m div n;
  set b = n div (m mod n);
  A10: in(b|)&Px] A9,;
  func divSeq(m,n) -> sequence of NAT means
  :  for n Gn] fromNAT_1:sch (,A2;
  it.0 = m div n & it.1 = n
div (m mod n) &  takey;
  (k+1);
  existence
  proof
    consider f being java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 4
A1thusyi (,^)by A10;
A2: for n being Nat:
    reconsider f as sequence of NAT;
    take f;
      (for nholdsc_d()n<0 implies c_nr.n+)/c_d()(+)-
    let k be Nat;
    thus thesis by A2;
  end;
  uniqueness
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
    let f,g be sequence of NAT such that
A3: f.0 = a & f.1 = b and
A4: for k being Nat holds f.( set s1=c_n)s2=dr;
A5:g. =a &.  and
A6: for k being Nat holds g.(k+2) = modSeq(m,n).k div modSeq(m,n).(k+1 );
    reconsider f, g as sequence of NAT;
A7: g.0 = a & g.1 = b by A5;
A8: for n being Nat holds g.(n+java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 29
    NAT,(g.(n+1)) qua Element of NAT) by A6;
A9   being  f.n+)=F,.,.n))  ;
A10       f beMorphismofc[]a,;
    f = g from RECDEF_2:sch 7(A10,A9,A7,A8);
    hence thesis;
  end;
end;

theorem Th12:
  divSeq(,).1 =n div modSeq(      fin Hom( xab) ,CAT_7 ;
proof
  thus divSeq(m,n).1 = n div (m mod n) by Def2
    .= n div modSeq(m,n).0 by Def1;
end;

theorem Th13:
  modSeq(m,n).1 = n mod modSeq(m,n).0
proof
  thus modSeq(m,n).1 = n mod (m mod n) by Def1
    = n  modSeqmn)0 by ;
end;

theorem Th14:
a = b &modSeq(,).a  0implies (java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 39
proof
  set fm = modSeq(m,n);
  assume that
A1: a <= b and
A2: fm.a = 0;
:a  b  a = b A,XXREAL_0:;
  defpred P[Nat] means a < $1 implies fm.$1 = 0;
A4: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat such that
A5: P[k];
    assume
A6: a < k+1;
    then
A7: a <= k by NAT_1:13;
    per cases by NAT_1:25;
    suppose
A8:   k = 0;
      then
A9:   a = 0 by A6,NAT_1:13;
      thus fm.(k+1) = n mod fm.0 by A8,Th13
        .= 0 by A2,A9;
    end;
    suppose
A10:  k = 1;
      then
A11:  a =      hence eval(,)* [ -a)=fby A11;
      2 = 2+0;
      hence fm.(k+1) = fm.0 mod fm.(0+1) by A10,Def1
        .= 0 by A2,A11;
    end;
    suppose k > 1;
      then reconsider k1 = k-1 as Nat;
      per cases by A7,XXREAL_0:1;
      suppose
A12:    a = k;
        thus fm.(k+1) = fm.(k1+2) .= fm.k1 mod fm.(k1+1) by Def1
          .= 0 by A2,A12;
      end;
      suppose
A13:   <k;
        thus fm.(k+1) = fm.(k1+2) .= fm.k1 mod fm.(k1+1) by Def1
          .= 0 by A5,A13;
      end;
    end;
  end;
A14Andproof
  for k being Nat holds P[k] from NAT_1:sch 2(A14,A4);
  hence thesis by A2,A3;
end;

Lm2: modSeq(m,n).     let,be object;
proof
  set fm = modSeq(m,n);
    per cases by NAT_1:25;
    suppose
A1:   a = 0;
      fm.(0+1) = n mod (m mod n) & fm.assume
      hence thesis by A1,NAT_D:1;
    end;
    suppose
A2:   a = 1;
      fm.(0+2) = fm.0 mod fm.(0+1) by Def1;
      hence thesisby ,AT_D:;
    end;
    suppose
      a > 1;
      then reconsider a1 = a-1 as Nat;
      fm.(a+1) = fm.(a1+(1+      then reconsider f1 =x1 as Morphism of c[]a, byCAT_7 set =_(,s2=) =()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      hence thesis by NAT_D:1;
    end;
end;

theorem Th15:
a<b -s1.*2.+)=.n).+).n2java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 73
oof
  set fm = modSeq(m,n);
  assume
A1:  b;
  per cases;
  suppose
fm.=0java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    hence thesis;
  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  suppose
A2: fm.a > 0;
    defpred P[Nat] means a < $1 implies fm.a > fm.$1;
A3: for x being Nat st Pend;
    proof
      let x be Nat java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
A4:   P[x];
      assume a < x+1;
      then
A5:   a <= x   (or holds c_d)n>)implies ()(+)/c_d(r).(n+2) -c_nr.java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
      percasesby ,XREAL_0:;
      suppose
        a = x;
        henceproof
      end;
      suppose
A6:  ets1=(),s2=_() =scfr;
        thus fm.a > fm.(x+1)
        proof
          per cases by Lm2;
          suppose
            fm.x > fm.(  then .>  (+)>;
hencethesisby A4,6,XXREAL_0:;
          end;
          suppose
            x=0
            hence thesis by A2,Th14,NAT_1:11;
          ;
        end;
      end;
    end;
A7:   n+2 *s2n XCMPLX_1:
    for x being Nat holds P[x] from NAT_1:sch 2(A15: h2)|^*sn/s2.+) n byTh66;
    hence thesis by A1;
  end;
end;

rem:
  divSeqjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 72
proof
  set   ().  c_n().n1)c_n(r.n)  c_d()(1-
  set fm = modSeq(m,n);
Nat]meansproof
A1: P[b] implies P[b+1]
  proof
    assume P[b];
    set x = fm.(b+1);
    assume fd.  sscfr;
    then fd.(b+(1+1)) = 0;
    then
A2: fm.b div fm.(b+1) = 0   defpredP[Nat]meanss1$/$1=s1.$1s1(11)(.$+)s2.$1-));
    assume
A3: fm.(b+1) <> 0;
    then fm.b = x * (fm.b div x) + (fm.b mod x) by NAT_D:2;
    then
A4: fm.b < x by A2,A3,NAT_D:1;
A5:b+0 <b+  XREAL_1:6
    then fm.b <> 0 by A3,Th14;
    hence thesis by A4,A5,Th15;
  end;
A6: P[0]
  proof
    set x =:L is one-to-ne byA8,UNCT_219
    assume fd.(0+1) = 0;
    then
A7: n div fm.0 =  proof
    assume
A8: fm.0 <     y being java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 17
    then m mod n <> 0 by Def1    assume 
    then
A9: n <> 0;
A10: fm.0 = x by Def1;
    then n = x * (n divs1./n(.n+1-.n-1)/s2.n1-(-);
    then n < x by A7,A10,A8,NAT_D:1;
    hence thesis by A9,      lety objectjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  end;
  P[b] from NAT_1:sch 2(A6,A1);
  hence thesiss(+2  (+)+s2n-s2n by Def5      y in (^a;
end;

Lm3: modSeq(m, exHbeingFunctor of ,Cst H is covariant &F = E (*)H [x]id A) &
proof
  set fd = divSeq(m,n);
  set fm = modSeq(m,n);
  ] means fm.1 = 0 implies .$+)=0
A1: P[b] implies P[b+1]
  proof
    assume that
    P[b] and
A2: java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
 fd.++)=fd.b(+) =fm. fm.b+)byDef2
      .= 0 by A2;
  end;
A3:P   Natmeans s1($1)2(1)(*1/21;
  proof
    assume
A4: fm.0 = 0;
    thus fd.(0+1)    =./  
      .= 0 by A4;
  ;
  P[b] from NAT_1:sch 2(A3,A1);
thesis;
end;

theorem Th17:
Lm6:
proof
  set fd = divSeq(m,n);A3:   Xn java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 30
   fmmodSeqm,)
  assume that
A1: a <> 0 and
A2: a <= b and
A3: fd.a = 0;
A4: a < b or a = b by A2,XXREAL_0:1;
   fd.$1 =0  fm$ =0java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
A5: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat such that
A6:P[]
    assume
A7: a < k+1;
    then
A8: a <= k by NAT_1:13;
    per cases by NAT_1:25;
    suppose
      k = 0;
      hence thesis by A1,A7,NAT_1:13;
    end;
    suppose
A9:   k = 1;
      then fd.(0+1) = 0 by A1,A3,A8,NAT_1:25;
      then
A10:  fm.0 = 0 by Th16;
A11:  2 = 2+0;
      hence fd.(k+1) = fm.0 div fm.(0+1) by A9let njava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
           A10;
      thus fm.(k+1) = fm.0 mod fm.(0+1) by A9,A11,Def1
        =0byA10;
    end;
    suppose
      k> k > 1
      then reconsider k1 = k-1 as Nat;
A12:  k = k1+1;
      per cases by A8,XXREAL_0:1;
      suppose
        a = k;
    then
A13:    fm.k1 = 0 by A3,A12      =1^2(+) WSIERP_12
        thus fd.(k+1) = fd.(k1+2) .= fm.k1 div fm.(k1+1) by Def2
          .= 0     
        thus fm.(k+1) = fm.(k1+2) .= fm.k1 mod fm.(k1+1) by Def1
           A13;
      end;
      suppose
A14:a<k;
        thus fd.(k+1) = fd.(k1+2) .= fm.k1 div fm.(k1+1) by Def2
          .= 0 by A6,    hence  byA4,REAL_1106;
        thus fm.(k+1) = fm.(k1+2) .= fm.k1 mod fm.(k1+1) by Def1
          .= 0 by A6,  end;
      end;
    ;
  end;
A15: P[0];
  for k being Nat  .=s.1  s0+)/s1by 
  hence thesis by A3,A4;
java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4

theorem Th18:
  a < A5:X0]byA2A,:;
proof
     divSeq(,)
  set fm = modSeq(m,n);
  assume a <;
  then
A1: a+1 <= b by NAT_1:        F12  hence ;
  assume fm.a = 0;
  then fd.(a+1) = 0 e;
  hence thesis by A1,Th17;
end;

theorem Th19:
  n <definition
proof
  set fd = divSeqlet r be Realjava.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16
  set fm =modSeq(m,);
  assume
A1: n <> 0;
  fd.0 = m div n & fm.0 = m mod n by Def1,Def2;
   thesisby    ex y     thecarrierof   1xyjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
end;c_d(r;

theorem
  n <> 0 implies mcoherence;
proof
  set fd  ;
  set fm = modSeq(m,n);
  assume
A1: n <> 0;
  let be;
    .= fm.0 / n + fd.0 by A1,XCMPLX_1:113
    .= fd.0 + 1 / (n / fm.0) by XCMPLX_1:57;


set g = NAT --> 0;

theorem Th21:
  divSeqjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
proof
   = - java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  set fd = divSeq(m,0);
:for xbeing object st  n  fd holds fd.x = g.x
  proof
    defpred P
    let x be object;
    assume x in dom fd;
then reconsiderx as Elementof NATjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
A2: for n being Nat holds P[n] implies P[n+1]
    proof
      let n be Nat;
      assume
3   []java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
      per cases;
      suppose
A4:     n = 0;
        fd.1 = 0 div (m mod 0) by Def2
          =0
        hence thesis by A4;
      end;
      suppose
        0 <> n;
        hence thesis by A3,Th17,NAT_1:11;
      end;
    end;
    fd. =m div by Def2
      .= 0;
    then
A5: P[  (or holdsscfr.0  ()2 ()0+1/(cf
    for n being Nat holds P[n] from NAT_1:sch 2  ()+1/(r.)
    then fd.x = 0;
    hence thesis by FUNCOP_1:7;
  end;
  dom fd = NAT by FUNCT_2:def 1;
  hence thesis by A1;
end;

theorem Th22:
  modSeq(m,0) = NAT --> 0
A1: c()2=_(r.  ((r)"8
  set fm = modSeq(m,0);
A1: for x being object st x in  .c_()2*(_(r.)" byVALUED_1:java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  
    defpred P[Nat] means fm.$1 = 0;
    let x be object;
    assume x in dom fm;
    then reconsider x as Element of NAT;
    fm.0 = m mod 0 by Def1
      .= 0;
    then
A2: P[0];
A3: for n being Nat holds P[n] implies P[n+1] by Th14,NAT_1:11;
    for n being Nat holds P[n] from NAT_1:sch 2(A2,A3);
    then fm.x = 0;
    hence thesis by FUNCOP_1:7;
  end;
  dom fm =  assume
  hence thesis by A1;
end;

theorem
  divSeq(0,n) = NAT --> 0
proof
  set fd = divSeq(0,n);
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

    defpred P[Nat] means fd.$1 = 0;
    A6: s.2 A2java.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16
    assume  then s.0 +1(.+1/s.)=.+/(. *s. 1/s.java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
    then reconsider x as Element of NAT;
ng  holdsPx implies P[x+1]
    proof
      let x be Nat;
      
A3:   P[x];
      per cases;
      suppose
A4:     x = 0;
        fd.1 = n div (0 mod n) by Def2
          .= n div 0;
        hence thesis by A4;
      end;
      
        0 <> x;
        hence thesis by java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      end;
    end;
    fd.0 = 0 div n by Def2
      .= 0;
    then
A5: P[0];
    for n being Nat holds P[n] from NAT_1:sch 2(A5,A2);
    then fd.x = 0;
    hence thesis by FUNCOP_1:7;
  end;
  dom fd = NAT by FUNCT_2:def 1;
  encethesis  A1;
end;

theorem
  modSeq(0,n) = NAT --> 0
proof
  set fm = modSeq(0,n);
A1: for x being object st x in dom fm holds fm.x = g.x

    defpred P[Nat] means fm.$1 = 0;
let  beobject;
    assume x in dom fm;
    then reconsider x as Element of NAT;
    fm.0 = 0 mod n by Def1
      .= 0;
    then
:[]java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
A3:       t natural_transformation  ,F2:F1is &
    for n being Nat holds P[n] from NAT_1:sch 2(A2,A3);
   fm. ;
    hence thesis by FUNCOP_1:7;
  end;
   fm  NAT FUNCT_2def 1;
  hence thesis by A1;
end;

:ex modSeq(n.  
proof
  set f = modSeq(m,n);
  PNat]meansexkstfk =1
A1: for a being Nat st a <> 0 & P[a]        consider F1,2 be Functor of C1,2  by :java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  prooft beF1,2such that
    let a be Nat such that
A2: a <> 0;
    given k such that
A3 . =a;
take =f(+)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    k+0     =(0(s1(s.2*s.3 + 1) + s.3)+(s.     F2 iscovariant&F1 is_naturally_transformable_to ;
    hence w < a by A2,A3,Th15;
    thus thesis;
  end;
A4: ex a being Nat st P[a]
  proof
    take f.0,   )byA3,8A9,XCMPLX_1113java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
    java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 16
  ;
  thus P[0] from NAT_1:sch 7(A4,A1);
end;

theorem Th25:
  exreconsidery=c2java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
proof
  set f = modSeq(m,n);
  consider k such that
A1: f.  (   scf()n>)   st >1 holds c_n(.2n+)/
  take k+1;
A2: k+0 < k+1 by XREAL_1:6;
  hence divSeq(m,n).(k+1) = 0 by A1,Th18;
  thus f.(k+1) = 0 by A1,A2,Th14;
end;

begin :: Simple continued fractions

defpred P[set,Element of REAL,object] means $3 = 1 / frac($2);

definition
  let r  Realjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  func remainders_for_scf r -> Real_Sequence means
  :Def3:
it0      take c,c2;java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  existence
  proof
     thus thesis  A5,A3;
 Nat  xbeing Element 
     ex y being Element of REAL st P[n,x,y]
    proof let n be Nat, x be Element of REAL;
      consider y being Real such that
A2:       cocf(r)3=c_nr.*(c_dr))3  :java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
reconsider   Element   byXREAL_0:ef;
     take y;
P[x,y A2java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    end;
      sequenceof   that
A3: f.0 = r1 and
  nbeingNat holdsP,.,f.(+) :
    sch 2( A1);
     f;
t f.    ;
    let n;
    thus thesis by A4;
;
  uniqueness
  proof
A5: for n being Nat . s.  /(.1+
    holds y1=y2;
    reconsider r1 = r    letn be ;
    let g1, g2 be Real_Sequence such that
A6: g1.0 = r and
A7: for n being Nat java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 15
A8: g2.0 = r     n>1and
A9: for n being Nat holds g2.(n+1) = 1/frac(g2.n);
10  n  Nat [,.n,1(+1] byjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
A11: for n being Nat holds P[n,g2.n,g2.(n+1)] by A9;
12:g2.0 =   A8;
A13: g1.0 = r1 by A6;
    thus g1 = g2 from NAT_1:sch 14(A13,A10,A12,A11,A5);XREAL_1:32;
  end;
end;

notation
  let bejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  synonym    s2.2+)0  s2.*+>
end;

definition
  let r be Real;
  func SimpleContinuedFraction r -> Integer_Sequence means
  Def4
  for n being Nat holds it.n = [\ rfs(r).n /];
  existence
  proof
    defpred Pst
A1: for x being Element of NAT ex A8:1(1+./s2s.+1)1/1by XREAL_12976;
    proof
      let x be Element of NAT;
      reconsider y = [\ rfs(r).x /] as Element of INT by           .= (s1  . 1s.by
      take y;
      thus thesis;
    end;
    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 6
A2A9:X[] A3,:8java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    reconsider f as Integer_Sequence by Th9;
    take ;
    let n be Nat;
    n in NAT by ORDINAL1:def 12;
    thesisbyA2java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  uniqueness
  proofend;
    let f1, f2 be Integer_Sequence such that
A3:for n being Nat holds f1. =[ rfs()n/ 
A4: for n being Nat holds f2.n = [\ rfs(r).n /];
 nbe  ofNATjava.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
            be of []1, be of ,
      .= f2.n by A4;
  end;
end;

notation
  let r be Real;
  synonym scf r for SimpleContinuedFraction r;
end;

 assume
  rfs(r).(n+1) = 1 / (rfs(r).n-scf(r).n)
proof
  thustake ,,c2F12;
    .= 1/(rfs(r).n-scf(r).n) by 
end;

theorem Th27:thus   A8,CAT_6d 21;
  rfs(r).n = 0 & n <= m implies rfs(r).m = 0
proof

A1: rfs(java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 8
A2: n <= m;
  per cases by A2,XXREAL_0:1;
  suppose
    n = m;
    hence thesis by A1;
  end;
  suppose
A3: n <  s1.2n)s2.2n)>1.2n-)s2.2*-;
defpred P[at]means n <$ implies rfs()$ =0;
A4: foraNatst [a holdsPa+java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

let be ;
      assume
:a;
      assume n < a+1;
      then
 <=a by AT_113
      per cases by A6,XXREAL_0:1;
      suppose
A7:     n = a;
A9:  f is identity;
)a)by A1,A7
          .= 0;
      end;

A8:    n< a
        thus rfs(r).(a+1) = 1 / frac(rfs(r      =s(*2  -)^n  Th64
          .= 1 / (rfs(r).a - rfs(r).a      =s(*2  1      c2 morphism ,F12  Functor  C1,sthat
          =0java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
      ;
    end;
A9: P[0];
    for a being Nat holds P[a] from NAT_1:sch 2(A9,A4);
    hence thesis by A3;
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
end;

theorem
  r.n   =mimplies scfr. =
proof
  assume
A1: rfs(r).n = 0 & n <= m;
  thus scf(r).m = [\rfs(r).m/] by java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 8
.\/]  A1,
    .= 0;
end;

theorem Th29:
  (i.n)=0
proof
  defpred P[Nat c22bethen .> s
A1: rfs(i).0 = i by Def3;
A2: for n st P[n] holds P[n+1]
  f
    let n such that
 n;
    thus rfs(i).(n+1+1) = 1 / frac(rfs(i).(n+1)) by Def3
. 1/(0-)by A3
      .= 0A3:scfr.>  ;
  end;
/ (rfsi.  Def3
    .= 1/(i-i) by A1
    . 0;
  then
A4: P[0    let  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  for n holds P[n] from NAT_1:sch 2(A4,A2);
  hence thesis;
end;

theorem Th30:
i)0 = i &scfi.(+)=0
proof
 P[Nat rfs(i).$+1    (i).($+)=0java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  thus scf(i).0 = [\ rfs(i).0 /] by Def4
    .= [\ i /] by Def3
    .= i;
A1: for n       for g1g2 being  of C1 st g2 | g1holds T2g |T1.1java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  proof
    let n such java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 11
A2:P[]
    thus rfs(i).(n+1+1) = 1 / frac(rfs(i).(n+1)) by Def3
      .= 1 / (0 - 0) by A2      thus . |E byA15AA,;
      .= 0;
    thus scf(i).(n+1+1) = [\ rfs(i).(n+1+1) /] by Def4
      .= [\ 0 /] by Th29
      =;
  end;
  scf(i).(0+1) = [\ rfs(i).(0+1) /] by Def4
. [\0 ]by 
    . 0;
  then
A3: P[0] by Th29;
  A19:  f1()2 = d]&E.f1()2) =d2 & d2 =G12.1 &G12 =d`2 by A7;
  hence thesis;
end;

Lm5: i > 1 implies rfs(1/i).1 = i & rfsA20:  [d]=[1*c,()21] A,,A17T;
1/i).1 = i & scf(1/i).(n+2) = 0
proof
  set r = 1/i;
defpredPNat]rfs(r.$+    (.$+2  ;
  assume
A1: i > 1  cocf()2 =c_n).  (r))2by:8
  then
+1 by XREAL_1:189;
A3: [\rfs(r).0/] = [\r/] by Def3
    .= 0 by A1,A2,Th2;
  thus
A4: rfs(r).1 = rfs(r).(0+1) .= 1/frac(rfs(r).0) by Def3
    .= 1/(r-0) by A3,Def3
    .= i;

A5: scf(r).1 = [\i/] by Def4;
A6:for n Pn  Pn1]
  proof
    let n such that  then
A7: P[n];
    thus rfs(r).(n+1+2) = rfs(r).(n+2+1) .= 1/frac(rfs(r).(n+2)) by Def3
      .= 1/(0-0) by A7
      .= 0;
    hence scf(r).(n+1+2) = [\java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 4
      .= 0;
  end;
A8: rfslet b        ;
    .= 1/(i-i) by A4
    .= 0;
     r- Real_Sequence
    . ;
  then
A9: P[0] by A8;
A10: for n holds P[n] java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  scf(r).0 = [\rfs(r).0/] by Def4
    .= [\r/] by Def3
.        D0=D empty ;
  hence thesis by A5,A10;
end;

theorem
  i > 1 implies rfs(1/i).1 = i & rfs(1/i).(n+2) = 0 by Lm5;

theorem
  i >f(n+1) =rH  ofD,;

theorem Th33:
  (for n holds scf(r).n = 0) implies rfs(r).n = 0
proof
  assume that
A1: for n holds   nd
A2: rfs(r).n <> 0;
A3: scf(r).n = 0 by A1;
  set x = rfs(r).n;
A4: scf(r).n = [\x/] by Def4;
  per cases by A2;
        tak Hjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    ;
    hence thesis by A3,A4;
  end;
  suppose
x >1
    hence thesis by A3,A4,INT_1:54;
  end;
  suppose
       0<&x<1 
A5: 1/x > 1 by Th1;
A6: scf(r).(n+1) = 0 & scf(r).(n+1) = [\ rfs(r).(n+1) /] by A1,Def4;
    rfs(r).(n+1) = 1 / frac(x) by Def3
scfr).)byjava.lang.StringIndexOutOfBoundsException: Range [26, 9) out of bounds for length 9
      .= 1/(x-0) by A1
      .= 1/x;
    hence thesis by A5A6,INT_1:4;
  end;
end;

theorem Th34:
 f  holds(  beingmorphismC1 holds F1. =F.d,c1] &
proof
  assume for n holds scf(r).n = 0;
  then rfs(r).0 = 0 by Th33;
  hence thesis by Def3;
end;

Lm6: rfs(1 / (r - scf(r).0)).n = rfs(r).(n+1) & scf(1 / (r - scf(r).0)).   ex  being ofC1st1= &$&nbsp;=F[,c1;
scf(r).(n+1)
proof
  set x = r - scf    hence s1.x   object st x inthecarrierofC1
  defpred P[Nat] means rfs(1/x).$1 = rfs(r).( end;
  1);
A1: for n st P[n ex ybeing    in thec  C2 &R2[xyjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  proof
    let n;
    assume P[n];
    hence rfs(1/x).(n+1) = 1/frac(rfs(r).(n+1)) by Def3
      .= rfs(r).(n+1+1) java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    hence scf(1/x).(n+1) = [\ rfs(r).(n+1+1) /]    rfor backContinued_fraction;
      .= scfassume x in the carrier java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
A2..1        java.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
))Def3
    .= 1/frac(rfs(r).0) by Def4
    ).(0+) by Def3;
  A5: X[]
    .= scf(r).(0+1) by Def4;
then
A3        proof
  for n holds P[n] from NAT_1:sch 2(A3,A1);
  hence thesis;
end;

theorem Th35:
  frac(r) = r - scf(r).0
proof
  thus frac(r) = r - [\ rfs(r).0 /] by Def3
    .= r - scf(r).0 by Def4;
end;

theorem
  rfs(r).(n+1) = rfs(1/frac(          then
proof
  frac(r) = r - scf(r).0 by Th35;
  hence thesis by A30:       c1 in the  ofC1by CAT_6:ef 1;
end;

theorem Th37:
  scf(r).(n+1) = scf(1/frac(r)).n
proof
  frac(r) = r - scf(r).0 by Th35;
  hence thesis by Lm6;
end;

theorem Th38:
  n >= 1 implies scf(r).n >= 0
proof
  defpred P[Nat]means scf()$ > ;
  [\ r /] <= r by INT_1:def 6;
  then frac(r) >=0 by XREAL_1:48;
  then
A1: 1/frac(r) -1 >= 0 -1 by XREAL_1:9;
A2:             assume c1 is identity;
  proof
    let n be Nat;
    assume n>=1;
    [\ rfs(r).n /] <= rfs(r).n by INT_1:def 6;
    then frac(rfs(r).n) >=0 by XREAL_1:48;
    then
A3: 1/frac(fs()n)- =0- XREAL_1:;
    scf(r).(n+1) = [\ rfs(r).(n+1) /] by Def4
      .= [\ 1/frac(rfs(r).n) /] by Def3;
    then scf(r            .1  .d] byA29java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
then
    scf(r).(n+1) -(-1) > (1/frac(rfs(r).n) -1) - (1/frac(rfs(r).n) -1) by A3,
XREAL_1:4;
    hence thesis by INT_1:7;
  end;
  scf(r).1 = [\ rfs(r).(0+1) /] by Def4
    .= [\ 
    .= [\ 1/frac(r) /] by Def3;
  then scf(r).1 > 1/frac(r) -1 by INT_1:def 6;
  then scf()1 (1)>(1/rac(r)-)-(/r -)by ,REAL_11;
  then
A4: P[1] by INT_1:7;
  for n being Nat st n>java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  hence thesis;
end;

theorem
  n >= 1 implies scf(r).      F1 is covariant & F  &F1is_naturally_transformable_to&

theorem Th40:
  n >= 1 & scf(r).n <> 0 implies scf(r).n >= 1
proof
  assume >1& scf(r).n <>0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  then scf(r).n>0 by Th38;
  then scf(      F2.1  .d2,  .1=F.d,1);
  hence thesis;
end;

theorem Th41:
 / modSeqm,)0 &
  rfs(m/n).(k+2) = (modSeq(m,n).k) / (modSeq(m,n).(k+1))
proof
  set fd = divSeq(m,n);
=modSeq(m,)
  set r = m/n;
A1: scf(r).0 = [\ rfs(r).0 /] by Def4
      proof
  per cases;
  suppose
A2: n = 0;

A3: fm = NAT --> 0 by Th22;
A4: fd = NAT --> 0 by A2,Th21;
A5        assume x inthe  of D;
    k = 0 or ex x being Nat st k = x + 1 by NAT_1:6;
    hence scfthen reconsider d =x asmorphismof Dby CAT_6:def 1;
      .= fd.k by A4,A5,FUNCOP_1:7;
    thus         d2,1 be morphism of D such that
    thus rfs(m/n).(k+2) = rfs(r).(k+1+1) .= 0 / fm.(k+1) by A2,Th29
      .= fm.k / fm.(k+1) by A3,A5A41:    d2 is identity &d1 is identity&d2 | d &d |> d1by ,h5;
  end;
  suppose
A6: 0 < n;
    hen m =n *( div n) +(  )byNAT_D2
    then
A7: r = (m A7: r = (m divimpliesF1 is )by A26;
    defpred P[Nat] means (for i being Nat st i <= $1 holds scf(r).i = fd.i) &
    for i being Nat st i+1 <= $1 holds rfs(r).(i+2) = fm.i / fm.(i+1);
A8: rfs(r).(0+1) = 1/frac(rfs(r).0) by Def3
      .= 1/(rfs(r).0-scf(r).0) by Def4
      .= 1/(r-(m div n)) by A1,Def3
      .= n / (m mod n) by A7,XCMPLX_1:57
      .= n / fm.0 by Def1;
A9: P[0]
    proof
      hereby
        let i be Nat;
        assume i <= 0;
        then i = 0;
        hence scf(r).i = fd.i by A1,Def2;
      end;
      let i be Nat;
      assume i+1 <= 0;
      hence thesis;
    end;
A10: for a being Nat st P[a] holds P[a+1]
    proof
t such 
A11:  P[a];
      per cases;
      suppose
A44     forc1morphism  holdsT =F.d,1] java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
        set x =m mod n;
A13:    scf(r).(0+1) = scf(1/frac(r)).0 by Th37
          .= [\ rfs(1/frac(r)).0 /] by Def4
          = [ 1  r / by Def3
          .= [\ 1 / ((m mod n) / n )/] by Th6
                   | f &f |>f2  T.f1 | F1.&F2. >T.2 java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61
          .= n div fm.0 by Def1
          . fd. byTh12java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        hereby
          let i be Nat;
          assume i <= a+1;
          then i = 0 or i = 1 by A12,NAT_1:25;
          hence scf(let f,f1f2 be morphism of C1;
        end;
        let i be Nat;
        assume i+1 <= a+1;
        then
A14:    i+1 = 0 or i+1 = 0+1 by A12,NAT_1:25;
        per cases;
        suppose
A15:      x = 0;
          thus rfs(r).(i+2) = rfs(r).(1+1) by A14
            .= 1/frac(rfs(r).1) by Def3
            .= 1/(n/fm.0-fd.1) by A8,A13,Def4
            .= 1/(n/x-fd.1) by Def1
A46:      f1 | f  | f2
            .= 1 / (0 - (n div x)) by A15
            .= 1 / (0 - 0) by A15
            . .i / 0
            .= fm.i / (n mod x) by A15
            .= fm.i / fm.(i+1) by A14,Def1;
        end
        suppose
A16:      0 < x;
          then
A17:      n +0 =x *( div x)+( mod x)by :;
          per cases;
          suppose
A18:        n mod x = 0;
            then
A19:        n div x = n / x by Th4;
            thus rfs(r).(i+2) = rfs(r).(1+1) by A14
              .= 1/frac(rfs(r).1) by Def3
              .= 1/(n/fm.0-fd.1) by A8,A13,Def4
              .= 1/(n/x-fd.1) by Def1
              .= 1/(n/x-(n div x))               | df]by ,41,h54java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
              .= 1 / 0 by A19
              .= fm.i / (n mod x) by A18
              .= fm.i / fm.(i+1) by A14,Def1;
          end;
          suppose
A20:        n mod x <> 0;
            then
A21:        n/x - (n div x) <>          =F[,f*f2] byA45T
            thus rfs(r).(i+2) = rfs(r).(1+1) by A14
              .= 1/frac(rfs(r).1) by Def3
              .= 1/n/m.-fd.) A8,A13,ef4
              .= 1/(n/x-fd.1) by Def1
              .= 1/(n/x-(n div x)) by Def2
. x /(n mod x)by A16,A17,20,21,m1
              .= fm.i / (n mod x) by A14,Def1
              .= fm.i / fm.(i+1) by A14,Def1;
          ;
        end;
      end;
      suppose
        a > 0;
        then
A22:          = F2.)(*)T.  ,44;
        thus
A23:    now
          let b be Nat;
          assume b <= a+1;
          then
A24:      b < a+1 or b = a+1 by XXREAL_0:1;
          per cases by A24,NAT_1:13;
          suppose
            b <= a;
            hence scf(r).b = fd.b by A11;
          end;
          suppose
A25:        b-1 = a;
            reconsider a2 = a-1 asA54:   F1 is_naturally_transformable_toF2java.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44
A26:       b =a-+ by;
            thus scf(r).b = [\ rfs(r).b /] by Def4
              .= fm.a2 div fm.(a2+1) by A11,A26
              .= fd.b by A26,Def2;
          end;
        end;
        let b be Nat;
        assume
A27:    b+1 <= a+1;
        per cases by A27,XXREAL_0:1;
        suppose
          b+1 < a+1;
          then b+1 <= a by NAT_1:13;
          hence thesis by A11;
        end;
        suppose
A28:      b+1 = a+1;
 by A22,INT_1:;
A29:      b+1 = b1+(1+1);
A30:      b1+2 = b1+1+1;
A31:      b+2 = b+1+1;
          per cases;
          suppose be  of, such 
A32:        0 = fm.(b1+1);
            thus rfs(r)(+2)=1 /(()(+1)scf()(+) by A31,h26
              .= 1/(rfs(r).(b+1)-fd.(b+1)) by A23,A28
              .= 1 / (fm.b1 / fm.(b1+1) - fd.(b1+1+1)) by A11,A28,A29
              .= 1 / (fm.b1 / 0 - (fm.b1 div 0)) by A30,A32,Def2
              .= fm.b / fm.(b+1) by A32;
          ;
          suppose
A33:        0 < fm.(b1+1);
            then
b1+)* (m.1 div fm.b1+)) +(m.b1 odjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
            .(b1+1)) by NAT_D:2;
            per cases;
            suppose
A35:          fm.b1 mod fm.(b1+1) = 0;
              then fm.b1 / fm.(b1+1) = fm.b1 div         x objectst x in the carrierof C1 holdsF1.x=F2x
              then
A36:          fm.b1 / fm.(b1+1) - (fm.b1 div fm.(b1+1)) = 0;
              thus rfs(r).(b+2) = 1 / (rfs(r).(b+1)-scf(r).(b+1)) by A31,Th26
                .= 1/(rfs(r).(b+1)-(fd.(b+1))) by A23,A28
                .= 1 / (fm.b1 / fm.(b1+1) - fd.(b1+1+1)) by A11,A28,A29
                .= 1 / 0 by A30,A36,Def2
                .= fm.(b1+1) / (fm.b1 mod fm.(b1+1)) by A35
                =fm. /fm.b1)by A30;
            end;
            suppose
A37:          fm.b1 mod thus F1.x =F1.c1 by CAT_6:ef 21
              then
A38:          fm.b1 / fm.(b1+1) - (fm.b1 div fm.(b1+1)) <> 0 by Th5;
              thus rfs().b2    r()(+)scfr.b+)b ,h26
                .= 1 / (rfs(r).(b+1)-fd.(b+1)) by A23,A28
                .= 1 / (fm.b1 / fm.(b1+1)         =F2.  ,59,
                .= 1 / (fm.b1 / fm.(b1+1) - (fm.b1 div fm.(b1+1))) by A30,Def2
                =fm.b1+)/((1+) by A33,A34,A37,38,m1
                .= fm.b / fm.(b+1) by A30,Def1;
            end;
          end;
        end;
      end;
    end;
    for a being Nat holds P[a] from NAT_1:sch 2(A9,A10);
    hence thesis by A8;
  ;
end;

theorem Th42:
  r A62:  forxbeing object st x in the carrier ofC1  F2. =T.
proof
  defpred A[Nat] means for s being Real st for m st m >= $1 holds scf(s
  ).m = 0 holds s is rational;
A1: for m st A[m] holds A[m+1]
  proof
    let m;
    assume
A2: A[m];
    let s be Real such that
A3: for n st n >= m+1 holds scf(s).n = 0;
    (s).)
    for n st n >= m holds scf(B).n = 0
              thus F2. =F2.1 by CAT_6:def 21
      let n;
      assume n >= m;
      then
A4:   n+1 >= m+1 by XREAL_1:6;
      thus scf(B).n = scf(s).(n+1) by Lm6
        .  by A3,4;
    end;
    then reconsider B as Rational by A2;
    scf(s).0 + 1 / B is rational;
    hence thesis;
  end;
  thus r is rational implies ex n st for m st m >= n holds scf(r).m = 0
  proof
    assume r is rational;
    then reconsider r as Rational;
    consider m, n being Nat such that
A5: n > 0 and
A6: frac(r) = m/n by Th7,INT_1:43;
        .f =H. by A25,AT_6:ef 21 .= [[F1,F1]F1]
    then
A7: m < n by A5,A6,XREAL_1:181;
    set fm = modSeq(n,m);
set =divSeq(,);
    per cases;
    suppose
A8:   m = 0;
      take ;
      let a;
      assume a >= 1;
      then ex x beingend;
      hence thesis by A6,A8,Th30;
    end;
    suppose
A9:   m <> 0;
      consider k such that
:fd.=0 and
      fm.k = 0 by Th25;
A11:  now
        assume
   for f1,2 being  of D st f1|
        m <= 0 or n div m <> 0 by A7,NAT_2:12;
        hence contradiction by A9,A10,A12,Def2      H.1 | H.2 &H.f1(*f2)=(.1()H.)
      end;
      take k+1;
      let a;
      assume
A13:  a >= k+1;
      1 <= k+1 by NAT_1:11;
      then reconsider a1 = a-1 as Element of NAT by A13,INT_1:5,XXREAL_0:2;
A14:  a = a1+1;
0  k+ by:6;
      then k < a by A13,XXREAL_0:2;
      then
A15:  k <= a1 by A14,NAT_1:13;
      scf(r).a = scf(1/frac(r)).a1 by A14,Th37
        .= scf(n/m).a1 by A6,XCMPLX_1:57
        .= fd.a1 by Th41
        .= 0 by A10,A11,A15,Th17;
      hence thesis;
    end;
  end;
  given n such that
A16: for m st m >= n holds scf(r).m = 0;
A17: A[0]
  proof
    lets be Real;
    assume for m st m >= 0 holds scf(s).m = 0;
    then for m holds scf(s).m = 0;
    hence thesis by Th34;
  endjava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
  for n holds A[n] from NAT_1:sch 2(A17,A1);
  hence thesis by A16;
end;

theorem
  (for n holds scf(r).n <> 0) implies r is irrational
proof
  assume
        consider d1,11,   ofD,F11,12 be Functor of C1C,
  not ex n st for m st m >= n holds scf(r).m = 0
  proof
    let n;        T1 be of F11F12suchthat
    take n;
    thus thesis by A1;
  A67:    =d1&d12 |d1&d1 >d11&d11 isidentity   isidentity&
  hence thesis by Th42;
end;

egin:java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50

reserve l, n1F11is_naturally_transformable_to&
reserve s1, s2 for Real_Sequence;

definition
  let r be Real;
  func convergent_numerators(r) -> Real_Sequence means
  :Def5:
  it.0 = scf(r). it.0 = scf(r).0 F.d12c  .c1=F.d1,]  ,A55;
(n+2) = scfr.n2
  ) * it.(n+1) + it.n;
  existence
  proof
    set s = scf(r);
deffunc UNat,eal,eal)=In(.$+)*$ + 2REAL;
    reconsider s0 = s.0, s1 = s.1 * s.0 + 1 as Element of REAL
    by : 1;
    consider f being Real_Sequence such that
A1: f.0 = s0 & f.1 = s1 and
A2: for n being Nat holds f.(n+2) = U(n,f.n,f.(n+1)) from
    RECDEF_2:sch 5;
    take f;
    thus f.0 = s.0 & f.1 = s        H.1 =[,]T2 &F21 is covariant &F22is covariant&
    let n;
    f.(n+2) = U(n,f.n,f.(n+1)) by A2;
     thesis;
  end;
  uniqueness
  proof
    set s = scf(r);
    deffunc U(Nat,Real,Real) = In(s.($1+2) * $3 + $2,REAL);
    let f,g be Real_Sequence such that
A3: f.0 = s.0 & f.1 = s.1 * s.0 +1 and
A4: for k being Nat holds f.(+)=s.k+)* f.
A5: g.0 = s.0 & g.1 = s.1 * s.0 +1 and
A6: for k being Nat holds g.(k+2) = s.(k+2) * g.(k+1) + g.k;
    reconsider s0 = s.0, s1 = s.1 * s.0 + 1 as Element of REAL
            by XREAL_0:def 1;
A7: g. =s0 &g.1 =s1 by A5;
A8: for k being Nat holds g.(k+2) = U(k,g.k,g.(k+1)) by A6;
A9: for k being Nat holds f.(k+2) = U(k,f.k,f.(k+1)) by A4;
A10:f. =s0 & f. =  by ;
    f = g from RECDEF_2:sch 7(A10,A9,A7,A8);
    hence thesis;
  end;
end;

    reconsider jj=T3 benatural_transformation F31F32  

definition
  let r be RealA70:   =d3   | d3 &d3 |d31&d31is identity&d32 is identity java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
sets  scf(r)
  func convergent_denominators(r) -> Real_Sequence means
  :Def6:
  it.0 = 1 & it.
1 = scf(r).1 & for n being Nat holds it.(n+2) = scf(r).(n+2) * it.(n+1) + it.n;
  existence
proof
    deffunc U(Nat,Real,Real) = In(s.($1+2) * $3 + $2,REAL);
    consider f being Real_Sequence such that
 . =jj &f. =s.a
A2: for n being Nat holds f.(n+2) = U(n,f.n,f.(n+1)) from
    A71:    dom d2=cod d1byA25,AT_7:,64,A67,java.lang.StringIndexOutOfBoundsException: Range [51, 52) out of bounds for length 51
take;
    thus f.0 = 1 & f.1 = scf(r).1 by A1;
    let n be Nat;
    f.(n+2) = U(n,f.n,f.(n+1)) by A2;
    hence thesis;
  end;
  uniqueness
  proof
    deffunc U(Nat,Real,Real) = In(s.($1+2) * $3 + $2,REAL);
    let f, g be Real_Sequence such that
A3: f.0 = 1 & f.1 = s.1 and
A4:for k beingNat holds f.k+2)=s.k) *f(k+) +f.k and
A5: g.0 = 1 & g.1 = s.1 and
A6: for k being Nat holds g.(k+2) = s.(k+2) * g.(k+1) + gassume xin  carrier  ;
A7: g.0 = jj & g.1 = s.1 by A5;
A8: for k being Nat holds g.(k+2) = U(k,g.k,g.(k+1)) by A6;
A9: for k being Nat holds f.(k+2) = U(k,f.k,f.(k+1)) by A4;
A10: f.0 = jj & f.1 = s.1 by          thusF12.=F12.1byCAT_6d 21
    f = g from RECDEF_2:sch 7(A10,A9,A7,A8);
    hence thesis;
  end;
end;

notation
  let r be Real;
  synonym c_n(r) for convergent_numerators(r);
  synonym c_d(r) for convergent_denominators(r);
end;

theorem Th44:
  scf(r).0 > 0 implies for n holds c_n(r).n in NAT
java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 5
  set s1=c_n(r);
  set s=scf(r);
  defpred P[Nat] means s1.$1 in NAT;
A1: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume that
A2:s1. in NAT and
A3: s1.(n+1) in NAT;
    reconsider n2=s1.(n+1) as Element of NAT by A3;
    reconsider n1=s1.n as Element of NAT by A2;
    n        proof
    then reconsider n3=s.(n+2) as Element of NAT by Th38,INT_1:3;
    n3*n2+n1letx object;
    hence thesis by Def5;
  end;
  assume
A4:scf(.0  0;
A5: P[1]
  proof
    reconsider n2=s.0 as Element of NAT by A4,INT_1:3;
    reconsider n1=s.1 as Element of NAT by Th38,INT_1:3;          then reconsider c1=x morphismoC1 by CAT_6: 1java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
    n1*n2+1 in NAT;
    hence   Def5;
  end;
  let n;
  s.0 in NAT by A4,INT_1:3;
  then
A6:P[]Def5
  for n being Nat holds P[n] from FIB_NUM:sch 1(A6,A5,A1);
  hence thesis;
end;

theorem Th45:
  scf(r)       =codd2 by,A644
proof
  assume
A1: scf(r).0>0;
  set s1=c_n(r);
  set s=scf(r);
  defpred P[Nat] means s1.$1>0;
by Def5,Th38;
  then
A2: P[1] by A1;
  let n;
A3: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume
A4: s1.n>0 & s1.(n+1)>0;
    n+2>1+0 by let x be object
    then
A5: s.(n+2) >=0 by Th38;
    s1assume x thecarrier C1java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    hencethesis by A5,4;
  end;
A6: P[0] by A1,Def5;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A6,A2,A3);
  hence thesis;
end;

theorem
  scf(r).0 > 0 implies for n holds c_n(r).(n+2) > scf(r).(n+2) * c_n(r). (n+1)
proof
  assume
A1: scf(r).0 > 0;
  let n;
  set s=scf(r);
  set s1=c_n(r);
  set m=s.(n+2)*s1.(n+1);
  s1.(n+2)-m=m+s1.n-m by Def5;
  then s1.(n+2)-s.(n+2) * s1.(n+1)>0 by A1,Th45;
  then s1.(n+2)-m+m>0+m by XREAL_1:6;
  hence thesis;
end;

theorem
  scf(r).0 > 0 implies for n st n1=c_n(r).(n+1) & n2=c_n(r).n holds n1
  gcd n2 = 1
proof
s1=_()java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  set s=scf(r)d2c2()]byA72A68,h4
  java.lang.StringIndexOutOfBoundsException: Range [44, 9) out of bounds for length 44
  1;
  assume
A1: scf(r).0 > 0;
A2:for k  []holdsXk+
  proof
    let k;
    reconsider n3 = s1.(k+2) as Element of NAT by A1,Th44;
    reconsider n2=s1.k as Element of NAT by A1,Th44;
    k+2 >= 0+1 by XREAL_1:7;
    then reconsider n4 = s.(k+2) as Element of NAT by Th38,INT_1:3;
    reconsider n1=s1.(k+1) as Element of NAT by A1,Th44;
    assume for n1,n2 st n1=s1.(k+1) & n2=s1.k holds n1 gcdby XTUPLE_0def12
    then
3 gcdn2= 1;
    n3 = n4 * n1 + n2 by Def5;
    hence thesis by A3,EULER_1:8;
  end;
A4: X[0]
  proof
    reconsider u = s.1 as Element of NAT by Th38,INT_1:3;
    let n1,n2 such that
A5: n1=s1.(0+1) and
A6: n2=s1.0;
;
    then
A7: n1 =u * n2 +1 by A6,Def5;
     gcd  = 1 by :;
    hence thesis by A7,EULER_1:8;
  end;
  for n holds X[n] from NAT_1:sch 2(A4,A2);
  hence thesis;
end;

theorem
  scf(r).0 A95:  iscovariant  A63C:ef 25, 23java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
   =  | n
proof
  assume that
A1: scf(r).0 > 0 and
A2:forn  scf().<0java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
  set s=scf(r);
A3: s.0 >= 0+1 by A1,INT_1:      
  set s1=c_n(r);
  defpred P[Nat] means s1.$1 >= tau |^$1;
A4: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    letc1  ofC1java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    assume that
A5: s1.n >= tau| reconsiderx=[Hdc]asobject;
A6: s1.(n+1) >= tau|^(n+1);
A7: tau|^(n+1)+tau|^n =((1+sqrt 5)/2)|^n * ((1+sqrt 5)/2) +((1+sqrt 5)/2)
    |^java.lang.StringIndexOutOfBoundsException: Range [36, 7) out of bounds for length 36
      .=((1+sqrt 5)/2)|^n * ((6+2*sqrt 5)/4);
    sqrt 5 >=0 by SQUARE_1:def 2;
    then (1+sqrt 5)/2 > 0 by XREAL_1:139;
    then
A8: tau|^(n+1) > 0 by FIB_NUM:def 1,PREPOWER:6f D,F1,F2    ,C2
A9: tau|^(n+2) =((1+sqrt 5)/2)|^n * ((1+sqrt 5)/2)|^2 by FIB_NUM:def 1,NEWTON:8
      =(+ 5)2)|n *(1sqrt 5)^  :java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
      .=((1+sqrt 5)/99          |   |  &  isidentity&  &
      .=((1+sqrt 5)/2)|^n * ((1+2*sqrt 5+5)/ 4) by SQUARE_1:def 2
      .=((1+sqrt 5)/2)|^n * ((6+2*sqrt 5)/ 4);
:s1(+11  .n2*.n)snbyDef5java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    n+2 >= 0+1 by XREAL_1:7;
    then s.(n+2) >= 1 by A2,Th40 F1is_naturally_transformable_toF2&
    then s.(n+2)*s1.(n+1) >= 1*(tau|^(n+1)) by A6,A8,XREAL_1:66;
    hence thesis        for being morphism ofC1  F1.1 =F[11,1 java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  end;
  s1.0 = s.0 by Def5;
  then
A11: P[0] by A3,NEWTON:4;
  s.1>=1 by A2,Th40;
  then s.1*s.0 >= 1 by A3,XREAL_1:159;
  then
A12: s.1*s.0+1 >= 1+1 by XREAL_1:6;
   let n;
  sqrt 5 < sqrt 3^2 by SQUARE_1:27;
  then sqrt 5 < 3 by SQUARE_1:22;
   1+ 5  1+3by XREAL_18;
  then
A13: (1+sqrt 5)/2 < 4/2 by XREAL_1:74;
  s1.1 = s.1*s.0+1 & ((1+sqrt 5)/2)|^1 = (1+sqrt 5)/2 by Def5        .=E[.dc1]by CAT_6:ef 21;
  then
A14: P[1] by A12,A13,FIB_NUM:def 1,XXREAL_0:2;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A11,A14,A4);
  hence thesis;
end;

theorem
  scf(r).0 > 0 & (for n      end
  n <= ((b+sqrt (b^2+4))/2)|^(n+1)
proof
  assume that
A1: scf(r).0 > 0 and
A2: for n holds scf(r).n <= b;
  set s1=c_n(r);
  set s=scf(r);
A3: s.0 <= b by A2;
  defpred P[Nat] means s1.$1 <= ((b+sqrt (b^2+4))/2)|^($1+1);
A4: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume that
A5: s1.n <= ((b+sqrt (b^2+4))/2)|^(n+1) and
A6: s1.(n+1) <= ((b+sqrt (b^2+4))/2)|^(n+1+1);
    n+2 >= 0+1 by XREAL_1:7;
    then
A7: s.(n+2) >= 0 by Th38;
    s.(n+2) <= b & s1.(n+1) > 0 by A1,A2,Th45;
    then
A8: s.(+2)*1(+1 =b(b+ (^24)/)^n1+),XREAL_166;
A9: b*((b+sqrt (b^2+4))/2)|^(n+1+1)+((b+sqrt (b^2+4))/2)|^(n+1) =b*(((b+
sqrt (b^2+4))/2)|^(n+1) * ((b+sqrt (b^2+4))/2) let bemorphism ;
    by NEWTON:6
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+b*sqrt (b^2+4)+2)/2);
A10: ((b+sqrt (b^2+4))/2)|^(n+2+1) =((b+sqrt (b^2+4))/2)|^(n+1+2)
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b+sqrt (b^2+4))/2)|^2 by NEWTON:8
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b+sqrtx1   C1
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+2*b*sqrt (b^2+4)+(sqrt (b^2+4))
    ^2    
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+2*b*sqrt (b^2+4)+(b^2+4))/(2*2))
    by x1     ;
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+b*sqrt (b^2+4)+2)/2);
    s1.(n+1+1) = s.(n+2)*s1.(n+1)+s1.n by Def5;
    hence thesis by A5,A8,A9,A10,XREAL_1:7;
  end;
  let n;
  b^2+4 > b^2 by XREAL_1:39;
  then sqrt (b^2+4) > sqrt b^2 by SQUARE_1:27;
  then
A11: sqrt (b^2+4) > b by SQUARE_1:22;
  then b+sqrt (b^2+4) > b+b by XREAL_1:8;
  then (b+sqrt (b^2+4))/2 > (2*b)/2 by XREAL_1:74;
  then
A12: ((b+sqrt (b^2+4))/2)|^(0+1) > b;
A13: s.1 >= 0 by Th38;
A14: s1.1 = s.1*s.0+1 by Def5;
  s.1 <= b by A2;
  then s.1*s.0 <= b^2 by A1,A3,A13,XREAL_1:66;
  then
A15: s1.1 <= b^2+1 by A14,XREAL_1:6;
  b*sqrt (b^2+4) >= b*b by A11,XREAL_1:64;
  then b^2+b*sqrt (b^2+4) >= b^2+b*b by XREAL_1:6;
  then b^2+b*sqrt (b^2+4)+2 >= b^2+b^2+2 by XREAL_1:6;
  then
A16: (b^2+b*sqrt (b^2+4)+2)/2 >= (2*(b^2+1))/2 by XREAL_1:72;
  ((b+sqrt (b^2+4))/2)|^(1+1) =((b+sqrt (b^2+4))/2)^2 by WSIERP_1:1
    .=(b^2+2*b*sqrt (b^2+4)+(sqrt (b^2+4))^2)/(2*2)
    .=(b^2+2*b*sqrt (b^2+4)+(b^2+4))/(2*2) by SQUARE_1:def 2
    .=(b^2+b*sqrt (b^2+4)+2)/2;
  then
A17: P[1] by A15,A16,XXREAL_0:2;
  s1.0=s.0 by Def5;
  then
A18: P[0] by A3,A12,XXREAL_0:2;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A18,A17,A4);
  hence thesis;
end;

theorem Th50:
  c_d(r).n in NAT
proof
  set s=scf(r);
  set s2=c_d(r);
  defpred P[Nat] means s2.$1 in NAT;
  s2.0 = 1 by Def6;
  then
A1: P[0];
A2: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume that
 .inNAT and
A4: s2.(n+1) in NAT;
reconsider s.(+) ofNAT  java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    reconsider n1=s2.n as Element of  thusF =.dc1  A25d 21
    n+2>=0+1 by XREAL_1:7;
    then reconsider n3=s.(n+2) as Element of NAT by Th38,INT_1:3;
    n3*n2+n1 in NAT;
    hence thesis by Def6;
  end;
  s2.1=s.1 by Def6;
  then
A5 P] byTh38,INT_1:3;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A1,A5,A2);
  hence thesis;
end;

theorem Th51:
  c_d(r).n >= 0
proof
  set s=scf(r);
  set s1=c_d(r);
  defpred P[Nat] means s1.$1>=0;
A1: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume
A2: s1.n>=0;
A3: s1.(n+2)=s.(n+2) * s1.(n+1) + s1.n by Def6;
    n+2>1+0 by XREAL_1:8;
    then
A4: s.(n+2) >=0 by Th38;
    assume s1.(n+1)>=0;
    hence thesis by A4,A3,A2;
  end;
  s.1>=0 by Th38;
  then
A5: P[1] by Def6;
A6: P[0 byDef6;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A6,A5,A1);
   thesis;
end;

theorem Th52:
  scf(r).1 > 0 implies for n holds c_d(r).n > 0
proof
  set s=scf(r);
  set s1=c_d(r);
  defpred P[Nat] means s1.$1>0;
  assume scf(r).1 > 0;
  
A1: P[1] by Def6;
  let n;
A2: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume
A3: s1.n>0;
A4: s1.(n+2)=s.(n+2) * s1.(n+1) + s1.n by Def6;
    n+2>1+0 by XREAL_1:8;
    hen
A5: s.(n+2) >=0 by Th38;
    assume s1.(n+1)>0;
    hence thesis by A5,A4,A3;
  end;
A6: P[0]          d of;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A6,A1,A2);
  hence thesis;
end;

theorem
  c_d
proof
  set s=scf(r);
  set s1=109:   d isjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  set m=s.(n+2)*s1.(n+1);
  s1.(n+2)-s.(n+2)*s1.(n+1)=s.(n+2)*s1.(n+1)+s1.n-s.(n+2)*s1.(n+1) by Def6;
  then s1.(n+2)-s.(n+2)*s1.(n+1)>=0 by Th51;
  then s1.(n+2)-m+m>=0+m by XREAL_1:6;
  hence thesis;
end;

theorem
  scf(r).1 > 0 implies for n holds c_d(r).(n+2) > scf(r).(n+2) * c_d(r). (n+1)
proof
  assume
A1: scf(r).1 > 0;
  let n;
  set s1=c_d(r);
  set s=scf(r);
  set m=s.(n+2)*s1.(n+1);
  s1.(n+2)-s.(n+2)*s1.(n+1)=s.(n+2)*s1.(n+1)+s1.n-s.(n+2)*s1.(n+1) by Def6;
  then s1.(n+2)-s.(n+2)*s1.(n+1)>0 by A1,Th52;
  then s1.(n+2)-m+m>0+m by XREAL_1:6;
  hence thesis;
end;

theorem
  (for n holds scf(r).n>0) implies for n st n>=1 holds 1 / (c_d(r).n*c_d
  (r).(n+1)) < 1 / (scf(r).(n+1)*(c_d(r).n)^2)
proof
  set s=scf(r),s2=c_d(r);
  defpred X[Nat] means 1/(s2.$1*s2.($1+1))<1/(s.($1+1)*(s2.$1)^2);
  assume
A1: for n holds scf(r).n>0;
  then
A2: s.2>0;
A3: scf(r).1>0 by A1;
A4: for n being Nat st n>=1 & X[n] holds X[n+1]
  proof
    let n be Nat;
    assume that
    n>=1 and
    1/(s2.n*s2.(n+1))<1/(scf(r).(n+1)*(s2.n)^2);
A5: s2.(n+1)>0 by A3,Th52;
    then
A6: (s2.(n+1))^2>0 by SQUARE_1:12;
    s.(n+2)>0 by A1;
    then
A7: s.(n+2)*(s2.(n+1))^2>0 by A6,XREAL_1:129;
    s2.n>0 by A3,Th52;
    then
A8: s2.(n+1)*s2.n>0 by A5,XREAL_1:129;
    s2.(n+1)*s2.(n+1+1) =s2.(n+1)*(s.(n+2)*s2.(n+1)+s2.n) by Def6
      .=s.(n+2)*(s2.(n+1))^2+s2.(n+1)*s2.n;
    hence thesis by A8,A7,XREAL_1:29,76;
  end;
A9: s.1>0 by A1;
  then (s.1)^2>0 by SQUARE_1:12;
  then s.2*(s.1)^2>0 by A2,XREAL_1:129;
  then
A10: 1/(s.2*(s.1)^2+s.1)<1/(s.2*(s.1)^2) by A9,XREAL_1:29,76;
  let n;
  1/(s2.1*s2.(1+1)) =1/(s2.1*(s.(0+2)*s2.(0+1)+s2.0)) by Def6
    .=1/(s2.1*(s.2*s.1+s2.0)) by Def6
    .=1/(s.1*(s.2*s.1+s2.0)) by Def6
    ./s.*s.*.+))
    .=1/(s.2*(s.1)^2+s.1);
  then
A11: X[1] by A10,Def6;
  for n being Nat st n>=1 holds X[n] from NAT_1:sch 8(A11,A4);
  hence thesis;
end;


  (for n holds scf
  sqrt (b^2+4))/2)|^(n+1)
proof
  =()
  set s2=c_d(r);
  defpred P[Nat] means s2.($1+1) <= ((b+sqrt (b^2+4))/2)|^($1+1);
  assume
A1: for n holds scf(r).n <= b;
  then
A2: s.1 <= b;
A3: s.2 <= b by A1;
  s.2 >= 0 & s.1 >= 0 by Th38;
  then
A4: s.2*s.1 <= b^2 by A2,A3,XREAL_1:66;
  s2.(1+1)=s.(0+2)*s2.(0+1)+s2.0 by Def6
    .=s.2*s2.1+1 by Def6
    .=s.2*s.1+1 by Def6;
  then
A5: s2.(1+1) <= b^2+1 A115    [.dc1] = [c01,c11] & E.[H.d,c1] = c12 & c12 = F12.c11 & F12 = c01`2
  let n;
  b^2+4 > b^2 by XREAL_1:39;
  then sqrt (b^2+4) > sqrt b^2 by SQUARE_1:27;
  then
A6: sqrt (b^2+4) > b by SQUARE_1:22;
  then b+sqrt (b^2+4) > b+b by XREAL_1:8;
  then (b+sqrt (b^2+4))/2 > (2*b)/2 by XREAL_1:74;
  then
A7: ((b+sqrt (b^2+4))/2)|^(0+1) > b;
A8: for n be Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume that
A9: s2.(n+1) <= ((b+sqrt (b^2+4))/2)|^(n+1) and
A10: s2.(n+1+1) <= ((b+sqrt (b^2+4))/2)|^(n+1+1);
A11: b*((b+sqrt (b^2+4))/2)|^(n+1+1)+((b+sqrt (b^2+4))/2)|^(n+1) =bA118:( * H1 x  C1.c1]
sqrt (b^2+4))/2)|^(n+1) * ((b+sqrt (b^2+4))/2)) + ((            E.((x]idC1)[,]  A25,23,117,AT_6:java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
    by NEWTON:6
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 33
    n+3 >=0+1 by XREAL_1:7;
    then
A12: s.(n+3) >= 0 by Th38;
A13: ((b+sqrt (b^2+4))/2)|^(n+2+1) =((b+sqrt (b^2+4))/2)|^(n+1+2)
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b+sqrt (b^2+4))/2)|^2 by NEWTON:8
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b+sqrt (b^2+4))/2)^2 by WSIERP_1:1
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+2*b*sqrt (b^2+4)+(sqrt (b^2+4))
2/2*)
      .=((b+sqrt (b^2+4))/2)|^(n+1) * ((b^2+2*b*sqrt (b^2+4)+(b^2+4))/(2*           =c02`2  A7;
    by SQUARE_1:def 2
      =(+(^+)/)^n) * (^2+* b2+)2/)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
A14: s2.(n+2+1) =s.(n+1+2)*s2.(n+1+1)+s2.(n+1) by Def6
      .=s.(n+3)*s2.(n+1+1)+s2.(n+1);
    s.(n+3) <= b & s2.(n+1+1) >= 0 by A1,Th51;
    then .n3)s2.n++)< *(+ b24)/)^n+1  ,12,
XREAL_1:66;
    hence thesis by A9,A14,A11,A13,XREAL_1:7;
  end;
  b*sqrt (b^2+4) >= b*b by A6,XREAL_1:64;
  then b^2+b*sqrt (b^2+4) >= b^2+b*b by XREAL_1:6;
  then b^2+b*sqrt (b^2+4)+2 >= b^2+b^2+2 by XREAL_1:6;
  then
A15end;
  ((b+sqrt (b^2+4))/2)|^(1+1) =((b+sqrt (b^2+4))/2)^2 by WSIERP_1:1
    .=(b^2+2*b*sqrt (b^2+4)+(sqrt (b^2+4))^2)/(2*2)
    .=(b^2+2*b*sqrt (b^2+4)+(b^2+4))/(2*2) by;
    .=(b^2+b*sqrt (b^2+4)+2)/2;
  then
A16: P[1] by A5,A15,XXREAL_0:2;
  s2.(0+1)=s.1 by Def6;
  then
A17: P[0] by A2,A7,XXREAL_0:2;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A17,A16,A8);
  hence thesis;
end;

theorem
  n1=c_d(r).(n+1) & n2=c_d(r).n implies n1 gcd n2 = 1
proof
  set s=scf(r);
  set s2=c_d(r);
  defpred X[Nat] means for n1,n2 st n1=s2.($1+1) & n2=s2.$1 holds n1 gcd n2 =
  1;
A1: for k st X[k] holds X[k+1]
  proof
    let k;
    k+2>=0+1 by XREAL_1:7;
    then reconsider n4 = s.(k+2) as Element of NAT by Th38,INT_1:3;
    reconsider n3 = s2.(k+2) as Element of NAT by Th50;
    reconsider n2=s2.k as Element of NAT by Th50;
    reconsider n1=s2.(k+1) as Element of NAT by Th50;
    assume for n1,n2 st n1=s2.(k+1) & n2=s2.k holds n1 gcd n2 = 1;
    then
A2: n1 gcd n2 = 1;
    n3 = n4 * n1 + n2 by Def6;
    hence thesis by A2,EULER_1:8;
  end;
A3: X[0]
  proof
    let n1,n2 such that
    n1=s2.(0+1) and
A4consider F1 be   of C1,2java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    n1 gcd 1 = 1 by NEWTON:51;
    hence thesis by A4,Def6;
  end;
dsX  : 2(3,1;
  hence thesis;
end;

theorem Th58:
 n holdsc_dr.n1/(
  r).n >= 1/scf(r).(n+2)
proof
  set s=scf(r);
  set s1=c_d(r);
  defpred X[Nat] means s1.($1+1)/s1.$1 >=         (.)  [F11]]&codH1.) =[] Th65
  assume
A1: for n holds scf(r).n > 0;
  then
A2: scf(r).1<>0;
A3: for n st X[n] holds X[n+1]
  proof
    let n;
    assume s1.(n+1)/s1.n >= 1/s.(n+2);
    set r=s1.(n+1);
A4: s.1 > 0 by A1;
    then
A5: s1.(n+1)>0 by Th52;
    n+3>=0+1 & s.(n+3) <>0 by A1,XREAL_1:7;
    then s.(n+3)>=1 by Th40;
    then
A6: 1/s.(n+3)<=1/1 by XREAL_1:118;
    n+2>=0+1 & s.(n+2) <>0 by A1,XREAL_1:7;
    then
A7: s.(n+2)>=1 by Th40;
A8: s1.n>0 by A4,Th52;
    s1.(n+2)/s1.(n+1)=(s.(n+2) * r + s1.n)/r by Def6
      .=(s.(n+2) * r)/r + s1.n/r
      .=s.(n+2)* (r/r) + s1.n/r
      .=s.(n+2)+ s1.n/r by A5,XCMPLX_1:88;
    then s1.(n+2)/s1.(n+1)>=1+0 by A5,A8,A134:     E(* Hx ).,c1
    hence thesis by A6,XXREAL_0:2;
  end;
  scf(r).2<>0 by A1;
  then s.(0+2)>=1 by Th40;
  then
A9: 1/s.(0+2)<=1/1 by XREAL_1:118;
.0    s1 byDef6
  then s1.(0+1)/s1.0>=1 by A2,Th40;
  then
             morphism ,c11 bemorphismofC1,
  for n holds X[n] from NAT_1:sch 2(A10,A3);
  hence java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
end;

theorem
  (for n holds scf(r).n > 0) implies for n holds c_d(r).(n+2) <= 2*scf(r
  ).(n+2) * c_d(r).(n+1)
proof
  assume
A1: for n holds scf(r).n > 0;
    ;
  set s=scf(r);
  set s1=c_d(r);
A2: sjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  s.1 > 0 by A1;
 
A3: s1.n > 0 by Th52;
A4: s1.(n+1)/s1.n >= 1/s.(                   ofC2, beFunctor ,  
  s1.(n+1)/s1.n * s1.n =s1.n / s1.n * s1.(n+1) .=s1.(n+1) by A3,XCMPLX_1:88;

A5: s1.(n+1) >= s1.n / s.(n+2) by A4,A3,XREAL_1:64;
             =c02`2 by ;
  then s1.(n+1) * s.(n+2) >= s1.n by A5,A2,XREAL_1:64;
  then .n1)*s.n2  (+)*s.(+)=s1.s1.(1  (2 
XREAL_1:6;
  hence thesis by Def6;
end;

theorem
(  holds().<0     1/(()(+)((r.
  n)^2) <= 1/(c_d(r).n)^2
proof
  assume
A1: for n holds scf(r).n <>0;
  let n;
  set s=scf(r);
  set s2=c_d(r);
  s.1 <>0 by A1;
        thus .=H1.  ,,126,127,,C: 21
  then
A2: s2.n>0 by Th52;
  n+1>=1+0 & s.(n+1) <>0 by A1,XREAL_1:7;
  then s.(n+1)*(s2.n)^2 >= 1*(s2.n)^2 by A2,Th40,XREAL_1:64;
thesis by SQUARE_1:X:;
end;

theorem
  (for n holds scf(r).n<>0) implies for n holds c_d(r).(n+1) >= tau |^ n
proof
  set s2=c_d(r);
  set s=scf(r);
  defpred P[Nat] means s2.($1+1) >= tau |^$1;
  sqrt 5 < sqrt 3^2 by SQUARE_1:27;
  then sqrt 5 < 3 by SQUARE_1:22;
  then 1+sqrt 5 < 1+3 by XREAL_1:8;
  then
A1: ((1+sqrt 5)/2)|^1 = (1+sqrt 5)/2 & (1+sqrt 5)/2 < 4/2 by XREAL_1:74;
  assume
A2: for n holds scf(r).n <>0;
  then
A3: s.1>=1 by Th40;
  then s2.(0+1)>=1 by Def6;
  then
A4: P[0] by NEWTON:4;
  let n;
A5: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
     bejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
at
A6: s2.(n+1) >= tau|^n and
A7: s2.(n+1+1) >= tau|^(n+1);
A8: tau|^(n+1)+tau|^n =((1+sqrt 5)/2)|^n * ((1+sqrt 5)/2) +((1+sqrt 5)/2)
|n FIB_NUMd 1,EWTON6
      .=((1+sqrt 5)/2)|^n * ((6+2*sqrt 5)/4);
sqrt  = d2java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    then (1+sqrt 5)/2 > 0 by XREAL_1:139;
    then
A9: tau|^(n+1) > 0 by FIB_NUM:def 1,PREPOWER:6;
 |n2 (1sqrt /)^  (+ 5)/)^  FIB_NUM:ef 1
,NEWTON:8
      .=((1+sqrt 5)/2)|^n * ((1+sqrt 5)/2)^2 by WSIERP_1:1
      holds
      .=((1+sqrt 5)/2)|^n * ((1+2*sqrt 5+5)/ 4) by SQUARE_1:def 2
  .(1sqrt )2|n*(+*5/4);
A11: s2.(n+2+1) = s.(n+1+2)*s2.(n+1+1)+s2.(n+1) by Def6
      .=s.(n+3)*s2.(n+1+1)+s2.(n+1);
    n+3 >= 0+1 by XREAL_1:7;
    then s.(n+3) >= 1 by A2,Th40;
    holds H=H1
    hence thesis by A6,A11,A8,A10,XREAL_1:7;
  end;
  s.2>=1 by A2,Th40;
  then s.2*s.1 >= 1 by A3,XREAL_1:159;
  then
A12: s.2*s.1+1 >= 1+1 by XREAL_1:6;
  s2.(1+1) = s.(0+2) * s2.(0+1) + s2.0 by Def6
    .=s.2 * s2.1 + 1 by Def6
    .=s.2 * s.1 + 1 by Def6;
  then
A13: P[1] by A12,A2   Dis byA1,AT_631
  for n being Nat holds P[n] from FIB_NUM:sch 1(A4,A13,A5);
  hence thesis;
end;

theorem
  a > 0 & (for n holds scf(r).n >= a) implies for n holds c_d(r).(n+1)
          is  ;
proof
  assume that
A1: a > 0 and
A2: for n holds scf(r).n >= a;
  set s=scf(r);
  set s2=c_d(r);
  defpred P[Nat] means s2.($1+1) >= ((a    endjava.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
A3: s.1>0 by A1,A2;
  then s.1>=1 by Th40;
  then s2.(0+1)>=1 by Def6;
  then
A4: P[0] by NEWTON:4;
  s.2>0 by A1,A2;
  then s.2*s.1 >= 1*s.1 by A3,Th40,XREAL_1:64;
  then
A5: s.2*s.1+1 >= s.1+1 by XREAL_1:6;
            []C1 C2
  then s.1+1 >= a+1 by XREAL_1:6;
  then
A6: s.2*s.1+1 >= a+1 by A5,XXREAL_0:2;
  4*a > 0 by A1,XREAL_1:129;
  then a^2+4 < a^2+4 + 4*a by XREAL_1:39;
  (^+4 < (+)2by :;
  then sqrt (a^2+4) < a+2 by SQUARE_1:22;
  then a+sqrt (a^2      becategory
  then
)/& asqrt(a^+)/<(2java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  a+2*1 )/2 by XREAL_1:74;
    proof
A8: for n being Nat st P[n] & P[n+1] holds P[n+2]
  proof
    let n be Nat;
    assume that
= (+ a^+))2)^ 
A10: s2.(n+1+1) >= ((a+sqrt (a^2+4))/2)|^(n+1);
A11assume  is ;
    ^2+4))/2)|^n * ((a+sqrt (a^2+4))/2)) + ((a+sqrt (a^2+4))/2)|^n by NEWTON:6
      .=((a+sqrt (a^2+4))/2)|^n * ((a^2+a*sqrt (a^2+4)+2)/2);
    sqrt (a^2+4) > 0 by SQUARE_1:25;
then(+(^+))2  XREAL_1:39;
    then
A12: ((a+sqrt (a^2+4))/2)|^(n+1) > 0 by PREPOWER:6;
A13: ((a+sqrt (a^2+4))/2)|^(n+2) =((a+sqrt (a^2+4))/2)|^n * ((a+sqrt (a^2+
    4))/2)|^2 by NEWTON:8
      .=((a+sqrt (a^2+4))/2)|^n * ((a+sqrt (a^2+4))/2)^2 by WSIERP_1:1
+)/)^ (a22asqrt(^++s(a24)^)/
    2*2))
      .=((a+sqrt (a^2+4))/2)|^n * ((a^2+2*a*sqrt (a^2+4)+(a^2+4))/(2*2)) by
SQUARE_1:def 2
      .=A1:  H1  ;
A14: s2.(n+2+1) =s.(n+1+2)*s2.(n+1+1)+s2.(n+1) by Def6
.s.n3*.(+++s2.+;
    s.(n+3) >= a by A2;
    then s.(n+3)*s2.(n+1+1) >A2    is   forH3 beingFunctorof D,
XREAL_1:66;
    hence thesis by A9,A14,A11,A13,XREAL_1:7;
  end;
  s2.(1+1) =s.(0+2)*s2.(0+1)+s2.0 by Def6
.s2s2.+ 
    .=s.2*s.1+1 by Def6;
  then
A15: P[1] by A6,A7,XXREAL_0:2;
  for n being Nat holds P[n] from FIB_NUM:sch 1(A4,A15,A8);
  hence thesis;
end;

theorem
  c_n(r).   hence thesis Def34;
  / (scf(r).(n+2) * c_d(r).(n+1) + c_d(r).n)
proof
  c_n(r).(n+2) = scf(r).(n+2) * c_n(r).(n+1) + c_n(r).n by Def5;
  hence thesis by Def6;
end;

theorem Th64:
  c_n(r).(n+1)*c_d(r)  let ,C2be;
proof
  set s=scf(r), s1=c_n(r),s2=c_d(r);
  defpred G[Nat] means s1.($1+1)*s2.$1-s1.$1*s2.($1+1)=(-1)|^$1;
A1: s2.0 = 1 & s2.1 = s.1 by Def6;
A2: for n st G[n] holds G[n+1]
  proof
    let l;
    assume
:s1.l+)ls1.s.l+)(-)^;
    s1.(l+2)*s2.(l+1)-s1.(l+1)*s2.(l+2) =(s.(l+2) * s1.(l+1) + s1.l)*s2.(l
    +1)-s1.(l+1)*s2.(l+2) by Def5
      .=(s.(l+2) * s1.(l+1)*s2.(l+1) + s1.l*s2.(l+1)) -s1.(l+1)*(s.(l+2) *
    s2.(l+1) + s2.l) by Def6
      .=(-1)*(s1.(l+1)*s2.l-s1.l*s2.(l+1))
      .=(-1)|^(l+1) by A3,      java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
    hence thesis;
  end;
  s1.0 = s.0 & s1.1 = s.1 * s.0 + 1 by Def5;
  then
A4: G[ A1N4
  for n holds G[n] from NAT_1:sch 2(A4,A2);
  hence thesis;
end;

theorem Th65:
  (for n holds c_d(r).n<>0) implies c_n(r).(n+1)/c_d(r).(n+1) -
  c_n(r).n/c_d(r).n = (-1)|^n / (c_d(r).(n+1)*c_d(r).n)
proof
  set s1=c_n(r), s2=c_d(r);
  assume for n holds s2.n<>0;
  then s2.n<>0 & s2.(n+1)<>0;
  then
  .n1/.n1-n/.n (.(1*2n.n*.n+1)(2.n1*java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
  n) by XCMPLX_1:130
    .=(-1)|^n /(s2.(n+1)*s2.n) by Th64;
  hence thesis;
end;

theorem Th66:
  c_n(r).(n+2)*c_d(r).n - c_n(r).n*c_d(r).(n+2) = (-1)|^n * scf(r) .(n+2)
proof
  set s1=c_n(r), s2=c_d(r), s=scf(r);
  s1.(n+2)*s2.n-s1.n*s2.(n+2) =(s.(n+2)*s1.(n+1)+s1.n)*s2.n-s1.n*s2.(n+2)
  by Def5
    .=(s.(n+2)*s1.(n+1)+s1.n)*s2.n-s1.n*(s.(n+2)*s2.(n+1)+s2.n) by Def6
    .=s.(n+2)*(s1.(n+1)*s2.n-s1.n*s2.(n+1))
    .=(-1)|^n * s.(n+2) by Th64;
  hence thesis;
end;

theorem
  (for n holds c_d(r).n<>0) implies c_n(r).(n+2)/c_d(r).(n+2) - c_n(r).n
  /c_d(r).n = (-1)|^n * scf(r).(n+2) / (c_d(r).(n+2) * c_d(r).n)
proof
  set s1=c_n(r), s2=c_d(r), s=scf(r);
  for  holds s2.<0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  then s2.n<>0 & s2.(n+2)<>0;
  then
  (+2)s2.n2  s1.n/n (.(+  . -s1.  .n+)(2.java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
  n+2) * s2.n) by XCMPLX_1:130
(.n2)* .n java.lang.StringIndexOutOfBoundsException: Range [50, 51) out of bounds for length 50
  hence thesis;
end;

theorem
  forn holds r.>)impliesforn n = 1holds c_nr. /c_d
  (r).n = (c_n(r).(n+1)-c_n(r).(n-1)) / (c_d(r).(n+1)-c_d(r).(n-1))
proof
  set s1=c_n(r), s2=c_d(r);
  set s=scf(r);
  defpred P[Nat] means s1.$1/s2.$1=(s1.($1+1)-s1.($1-1))/(s2.($1+1)-s2.($1-1));
  assume
A1: for n holds scf(r).n<>0;
A2: for n being Nat st n>=1 holds P[n] implies P[n+1]
  proof
      ;
    assume that
    n>=1 and
    s1.n/s2.n=(s1.(n+1)-s1.(n-1))/(s2.(n+1)-s2.(n-1));
    s.(n+2) * s1.(n+1) + s1.n -   end;
    s.(n+ 2) * s2.(n+1) + s2.n - s2.n by Def5,Def6;
    hence thesis by A1,XCMPLX_1:91;
  end;
  let n;
  (s1.(1+1)-s1.(1-1))/(s2.(1+1)-s2.(1-1)) =(s.(2+0) * s1.(0+1) + s1.0-s1.0
  )/(s2.(2+0)-s2.0) by Def5
    .=(s.2 * s1.1 + s1.0-s1.0)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    .=s1.1/java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  then
A3: P[1];
 n  Natst>1 [n]fromNAT_1sch8A3,2;
  hence thesis;
end;

theorem
  (for n holds c_d(r).n<>0) implies for n holds |.c_n(r).(n+1)/c_d(r)
  .(n+1) - c_n(r).n/c_d(r)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
proof
  set s1=c_n(r), s2=c_d(r);
  assume
A1: for n holds s2.n<>0;
  let n;
  reconsider n as Element of NAT by ORDINAL1:def 12;
|(+1/(+1-./.n. =.()|n/s.n1*.n.byA1
,Th65
    .=|. (-1) |^n .| / |.s2A1:  C]&  &CEC Def35java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    .=|. (-1) to_power n .| / |.s2.(n+1)*s2.n.| by POWER:41
    .=(|.-1.| to_power n) / |.s2.(n+1)*s2.n.| by SERIES_1:2
    .=((-(-1)) to_power n) / |.s2.(n+1)*s2.n.| by ABSVALUE:def 1
    .=1 / |.s2.(n+1)*s2.n.| by POWER:26;
  hence thesis;
end;

theorem
  scf(r).1 > 0 implies for n holds c_n(r).(2*n+1) / c_d(r).(2*n+1) > c_n
  (r).(2*n) / c_d(r).(2*  the categorical_exponent ,2)2java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
proof
  set s1=c_n(r), s2=c_d(r), s=scf(r);
  defpred X[Nat] means s1.(2*$1+1)/s2.(2*$1+1)>s1.(2*$1)/s2.(2*$1);
A1: s1.(2*0)/s2.(2*0) =s.0/s2.0 by Def5
    .=s.0/1 by Def6
    .=s.0;
  assume
:scfr)1>;
A3: for n st X[n] holds X[n+1]
  proof
    let n;
    assume s1.(2*n+1)/s2.(2*n+1)>s1.(2*n)/s2.(nt_of C1,2by ;
    reconsider n as Element of NAT by ORDINAL1:def 12;
    s1.(2*(n+1)+1)*s2.(2*(n+1))-s1.(2*(n+1))*s2.(2*(n+1)+1) =(-1)|^(2*(n+1
    )) by Th64
      .=(1|^(2*(n+1))) by WSIERP_1:2
      .=1;
    then
A4: s1.(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    s2.(2*(n+1)+1)>0 & s2.(2*(n+1))>0 by A2,Th52;
byA4X106java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  end;
  s1.(2*0+1)/s2.(2*  
    .=(s.1 * s.0 +1) / s.1 by Def6
    .=s.0 +1 / s.1 by A2,XCMPLX_1:113;
  then
     T java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 46
  for n holds X[n] from NAT_1:sch java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  hence thesis;
end;

definition
  let r be Real;
::$N Convergents of continued fraction
  func java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
  c_n(r) /"
  c_d(r);
  coherence;


notation
  let r be Real;
  synonym cocf(r) for convergents_of_continued_fractions(r);
end;

theorem
  cocf(r) 
proof
  thus cocf(r).0,,1C  java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
    .=c_n(r     E1 Functor [ ,java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    .=c_n(r).0 *(1/c_d(r).0)
    .=c_n(r).0 /c_d(r).0
    .=(scf(r)).0 / c_d(r).0 by Def5
    .=(scf(r)).0 / 1 by Def6
    .=scf(r).0;
end;

theorem Th72:
  scf(r).1 <> 0 implies cocf(r).1 = scf(r).0 + 1 / scf(r).1
proof
 s)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  assume
A1: scf(r).1<>0;
  thus cocf(r). ,B
    .=c_n(r).1 * (c_d(r).1)" by VALUED_1:10
    =. (1c_d.)
    .=c_n(r).1 /c_d(r).1
    .=(s.1 * s.0 +1) / c_d(r).1 byFis    *   C1 (*   C2
    .=(s.1 * s.0 +1) / s.1 by Def6
    .=s.0 +1 / s.1 by A1,XCMPLX_1:113;
end;

theorem:: detailed in file COPYING.interpretation.
n>0)impliescocf()2=scfr.0    (cf

proof
sscf(;
 ()2=()*((r)".2 java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
.. _r. VALUED_1java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    .=c_n(r).2 *(1/c_d(r).2)
    .=c_n(r).2 /c_d(r).2;
  assumeA6   Gis  &E2 E1 *( []idA  H1 C2C1
A2: for n holds scf(r).n>0;
  then
A3: s.1>0;
A4: c_d(r).2 =s.(0+2)*c_d(r).(0+1) + c_d(r).0 by Def6
    .=s.2*s.1+c_d(r).0 by Def6
    .=s.2*s.1+1 by Def6;
A5: c_n(r).2 =s.(0+2) * c_n(r).(0+1) + c_n(r).0 by Def5
    .=s.2*(s.1 * s.0 +1) +H &=E1*H x     H1 java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 79
    .s. *s. st covariant   *xi A=
>0 A2java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  then s.0 + 1/(s.1+1/s.2) =s.0+1/(XCMPLX_0 ,FUNCOP_1 VECTSP_1, GROUP_1, VALUED_1 ,SEQ_4java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
    .=s.0
    the carrier of it =the carrier of V
    .:FxA&the   =t V)the it
  hence thesis;
end;

Th74
( nholdsscf()n)implies ()3=scf()0+1(scf(
).3)
proof
sscfr;
A1: cocf assume
    .=c_n(r).   z*w = z*v by,A2,,UNCT_1;
   =(r)3 (/c_d(r.3)
    (). /_()3
  assume
A2: for n holds scf(r).n>0;
  then
A3: s.1>0;
A4: c_d      =E1*(C1[])java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    .=s.2*s.1+c_d(r).0       hence G(*)F = id C1,;
    .=s.2*s.1+1 by Def6;
A5: A1: isjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 79
    .=s.3*(s.2*s.1+1)+s.1 by A4,Def6
    .=s.1*(s.2*s      st  iscovariant&E2 =E2()([]idA  H3 = H1
A6: c_n(r).2 =s.(0+2) * c_n(r).(0+1)        ,4Def34;
    .=s.2*(s.1 * s.0 +1) +c_n(r).0 by Def5
    .=s.2 * s.1 * s.0 +s.2 +s.0      E2=E2()(Fx  A()(G[]idA)byA2A,A6,A8,9,CAT_7:java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
A7: c_n(r).3 =s.(1+2) * c_n(r).(1+1) + c_n(r      .  *(*G[](A((A) A6T
  .=.3*s.*s1  .0 s2 s.0) +s.1  s 1  A6,Def5
    .=(s.3*s.2 * s.1 * s.0) +s.3*s.2 +s.3*s.0 +s.1 * s.
A8: s.2>0 by A2;
A9: s.3>0 by A2;
  then s.0 + 1/(s  F*=H3byA11A5,A6,CAT_635
  by XCMPLX_1:113
=.+/s1+3(.23  ) by:java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    .=s.0 + 1/((s.1*(s.2*s.3 + 1) + s.3)/(s.2*s.3 + 1)) byA8,,XCMPLX_1:13
 1)(.*(s.2s. + 1)+s) byXCMPLX_157
    .=(s.0*(s.1*(s.2*s.3 + 1) + s.3)+(s.2*s.3 + 1))/(s.1*(s.2*s      A    X  beFunction[X:,,
  ) by A3,A5:M=    ;
hencethesisby A,5
end;

theorem
  (for n holds scf(r).n>0) implies for n st n>=1 holds c_n(r).(2*n+1) /
  c_d(r).(2*n+1) < c_n(r).(2*n-1) / c_d(r).(2*n-1)

  set s=scf(r), s1=c_n(r), s2=c_d(r);
  defpred X[Nat] means s1.(2*$1+1)/s2.(2*$1+1)<s1.(2*$1-1)/s2.(2*$1-1);
  
A1: for n holds scf(r).n>0;
   
A2: s.3>0;  commutative  rightdistributivevectordistributive
cocf()3 = ().3 *(c_d(r))3bySEQ_18
    .= c_n(r).3 * (c_d(r).3)" by VALUED_1:10
.)3 *1/d(.)
    .= c_n(r).3 /c_d(r).3;
  then
:s1.2*+1)s2.211  s.0 + /(.1 +1(.  /3)byA1Th74
..  /s1+/(.2*.  )/3)byXCMPLX_1113
    .= s.0 + 1/(s.1 + s.3/(s.2*s.3 + 1)) by XCMPLX_1:57;
  let n;
 .>  A1;
 ()1  0 byA1;
6  beingNatst n>  [  X[+]
 
    let n be java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 10
    that
        end;
.2n+)s2.2n+<.(2*n-)/s2.(2*n-1);
    .2(+1)1*s2.(*n+)1-.(*n1-)s2.2(+1+1)=s.2n
    1+2) a(+)=*x1 *1 byCLVECT_1def2;
      .=(s.(2*n+1+2) * s1.(2*n+1+1) + s1.(2*n+1))*s2.(2*n+1) -s1.(2*n+1)*(s.
    (2*n+1+    proof
java.lang.StringIndexOutOfBoundsException: Range [37, 6) out of bounds for length 69
      .s(2*12 *(-)^2n) by Th64
     .(*++)*(1^2n+1)  WSIERP_12
.s.(*++) -1)
    then s1.(2*(n+1 reconsiderx1= ElementofV A1,TARSKIdef 3;
:
     xbe  , beComplexholds
A7: s1.(2*(n+1)+1)*      abeC;
(n1> &s2.*n+)0byjava.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 43
:;
  end;end;
  s.2>0 by A1;
  then s.3/(s.2*s.3 + 1)>0 by A2,XREAL_1:139;
  then
 /s +.3(s.*s.  )</.1 byA4,:29,;
  s1.(2*1-1)/s2.(2*1-1) = (s.1 * s.  end;
    .= (s.1 * s.0 +1)/s.1 by Def6
    .= s.0 +1 / java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 4
  then
A9: X[1] by A8,A3,XREAL_1:8;
  for n being Nat st n>=1 holds X[n] from NAT_1:sch 8(
  hence thesis;


theorem
  (for n holds scf(r).n>0) implies for n st n>=1 holds c_n(r).(2*n) /
  c_d(r).(2*n) > c_n(r).(2*n-2) /  cluster C2|^>non  trivialjava.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
proof
  set s=scf(r), s1=c_n(r), s2=c_d(r);
  defpred  proof
  assume
A1: for n holds scf(r).nA1:C2|C1eval,2)is_exponent_ofC1, byTh72;
  then
A2: s.1>0;
A3: scf(r).1 > 0 by A1;
A4: for n being Nat st n>=1 & X[n] holds X[n+1]
  proof
    let n be Nat;
    assume that
    n>=1 and
    s1.(2*n)/s2.(2*n)>s1.(2*n-2)/s2.(2*n-2);
    s1.(2*(n+1))*s2.(2*(n+1)-2)-s1.(2*(n+1)-2)*s2.(2*(n+1)) = (s.(2*n+2)
    * s1.(2*n+1) + s1.(2*n))*s2.(2*n)-s1.(2*n)*s2.(2*n+2) by Def5
      .= (s.(2*n+2) * s1.(2*n+1) + s1.(2*n))*s2.(2*n) -s1.(2*n)*(s.(2*n+2) *
    s2.(2*n+1) + s2.(2*n)) by Def6
      .= s.(2*n+2) * letC2 be emptycategory;
      .= s.(2*n+2) * (-1)|^(2*n) by Th64
. .2n2  (|(*n)  WSIERP_12
      .= s.(2*n+2) * 1
      .= s.(2*n+2);
    then
A5: s1.definition let   ComplexAlgebra,V1  Subset f;
    s2.(2*n)>0 & s2.(2*n+2)>0 by A3,Th52;
    hence thesis by A5,XREAL_1:106;
  end;
  let n;
A6: s1.(2*1-2)/s2.(2*1-2) = s.0/s2.0 by Def5
    .s./1by 
    .=s.0;
A7: s.2>0 by A1;
fr.  c_n().  ((_()".2by :8
    .= c_n(r).2 * (c_d(r).2)" by VALUED_1:10A1:V1 s -linearlyclosed
    ).2java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    .= c_n(r).2 /c_d(r).2 by FUNCT_2: 1,FMISC_1:5;
  then s1.(2*1)/java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 9
    .= s.0+1/((s.1 * s.2 +1)/ s.2) by A7,XCMPLX_1:113
. s. + 2/(.  s +1) byXCMPLX_1:;
  then
A8: X[1] by A2,A7,A6,XREAL_1:29,139;
  for n being Nat st n>=1 holds X[n] from NAT_1    for H1 being Functorof,C
  hence thesis;
end;

theorem
 ( n holds scf    holds   H1 byLm6
c_dr)(*)<()(*-1/c_d()(*1)
roof
 sscf(), s1=_() =(;
  defpred{fwhere f is Function C2|,val(,2)is_exponent_of,C2 Th72java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52

A1: for n holds scf(r).n>0;
  then s.1>0 & s.2>0;
  then isbounded; then
:1(.  s2  1/.1 XREAL_1:,;
  let n;endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
A3: scf(endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  n  Nat st n>=1 & X[n  [n1]
  proof
    let n be Nat;
    assume that
    n>=1 and
    s1.(2*n)/s2.(2*n)<s1.(2*n-1)/s2.(2*n-1);
s1(*(+)*s2.2(+)1-(*  C categoryjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
*(*+)s1.(*+)s2(*+11)
      .=(-1)|^(2*n+1) by Th64
      .=(-1|^(2*n+1)) by WSIERP_1:2
      .=-vu=1u1 byA6,5: ;
    then
A5: s1.(2*(n+1))*s2.(2*(n+1)-1)    for v  Element of  st v  Wholds vin
    s2.(*+1)> &s2(2n+)> by ,Th52;
hence  by ,REAL_1;
  end;
  cocf(r).1 = c_n(r).1 * ((c_d(r))")  :h(1)vbyCLVECT_13;
    .= c_n(r).1 * (c_dbyFUNCT_2def2
    .=  assumexindom h;then
    . (*-)s2.211;
 
A6: s1.(2*1-1)/      hence -v in  A10java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  cocf(r).2 = c_n(r).2 * ((c_d(r))").2 by SEQ_1:8
    .= c_n(r).2 * (c_d(r).  A15 in ;
    .= c_n(r).2 *(1/A16:=u&u1| isboundedby A15;
        suppose
  then s1.(2*1)/s2.(2*1) =A18:x beingFunctionst h=f&dom f c=COMPLEX

:X[]byA6,A2,XREAL_1:;
[n] fromNAT_1:sch8A7A4)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
hence thesis;
end;

definition
  let r be Real;
sets=cf()java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  func  A25:ex f Functionst h = f & dom f = X & rng f c= COMPLEX
  :Def8:
  it.0 = scf(r).0 & for n being Nat holds it.(n+1) = 1/it.n + scf(r).(n+1);
  existence
  proof
    deffunc U(Nat,Real) = In(1/$2 + s.($1+1),REAL);
    consider f being Real_Sequence such that
A1: f.0 = s.0 and
A2: for n being Nat holds f.(n+1) = U(n,(f.n)) from NAT_1:sch 12;
    take f;
    thus f.0 = scf(r).0 by A1;
    let n;
     f.(n+1) = U(n,(f.n)) by A2;
    hence thesis;
 end;
  uniqueness
  proof
    let s1,s2;
    assume 
A3: s1.0=s.0 and
A4: for n holds s1.(n+1)=1/s1.n + s.(n+1) and
A5: s2.0=s.0 and
A6: for n holds s2.      C2^C1,eval(1,C2) is_exponent_of C1,C2 by Th72
    defpred X[Nat] means s1.$1 = s2.$1;
A7:for stX[k holds X[k1]
    proof
      let k;
      assume s1.k =s2.k;
      hence s1.(k+1) = 1/s2.k + s.(k+1) by A4
        .= s2.(k+1) by A6;
    end;
    let x be Element of NAT;
A8: X[0] by A3,A5;
    for n holds X[n] from NAT_1:sch 2(A8,A7);
    hence s1.x = s2.x;
  end;
end;

notation
  let r be Real;
  synonym bcf r for backContinued_fraction r;
end;

theorem
  scf(r).0 > 0 implies for n holds bcf(r).(n+1)=c_n(r).(n+1)/c_n(r).n
proof
  set s1=c_n(r);
  set s=scf(r);
  defpred X[Nat] means bcf(r).($1+1)=s1.($1+1)/s1.$1;
  set s3=bcf(r);
  assume
A1hence thesis by A20;
A2: for n st X[n] holds X[n+1]
  proof
    let n;
    assume
(n+)=1(n+1/s1.n;
A4: s1.(n+1)>0 by A1,Th45;
      proof
     .s1ns1(n+) s.(n++1 by A3,XCMPLX_1:7
(n+1)byA4,:113
      .=    hence  by A1;
    hence java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
  ;
  bcf(r).
    .=1/s.0 + s.1 by Def8
    .=(1+s.0 * s.1)/s.0 by A1,XCMPLX_1ComplexAlgebraStr( V1,mult_(V1,V) Add_(Mult_(V1,V) One_,V,
    .=s1.1/s.0 by Def5
    .s1.(+)s1.  Def5;
  then
A5: X[0];
 Xn] from NAT_1sch 2(5A2;
  hence thesis0V &Add_V1,) (he  ofV)|V1
end;

Messung
CHZG
8010010093

¤ Dauer der Verarbeitung: 0.61 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland