Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Impressum aescip_1.miz   Sprache: Mizar

 

:: Formalization of the Advanced Encryption Standard -- Part {I}
::  by Kenichi Arai and Hiroyuki Okazaki
::
:: Received October 7, 2013
:: Copyright (c) 2013-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 AESCIP_1, DESCIP_1, TARSKI, XBOOLE_0, FINSEQ_1, RELAT_1, FUNCT_1,
      ARYTM_1, FUNCT_2, FINSEQ_2, NAT_1, MARGREL1, ZFMISC_1, SUBSET_1, NUMBERS,
      INT_1, CARD_1, JORDAN3, XXREAL_0, ARYTM_3, ORDINAL4, FINSEQ_5, XCMPLX_0;
 notations TARSKI, XBOOLE_0, ZFMISC_1, SUBSET_1, RELAT_1, FUNCT_1, ORDINAL1,
      RELSET_1, PARTFUN1, FUNCT_2, BINOP_1, CARD_1, NUMBERS, XCMPLX_0,
      XXREAL_0, NAT_1, INT_1, NAT_D, FINSEQ_1, FINSEQ_2, MARGREL1, FINSEQ_4,
      FINSEQ_6, DESCIP_1;
 constructors RELSET_1, FINSEQ_4, NAT_D, FINSEQ_6, DESCIP_1, BINOP_1;
 registrations FINSEQ_1, RELSET_1, FINSEQ_2, FUNCT_2, ORDINAL1, MARGREL1,
      INT_1, NAT_1, XXREAL_0, XBOOLE_0, FUNCT_1, XREAL_0, FINSEQ_4;
 requirements BOOLE, SUBSET, NUMERALS, ARITHM, REAL;
 equalities FINSEQ_1, FINSEQ_2;
 theorems TARSKI, FUNCT_1, FUNCT_2, XXREAL_0, XREAL_1, FINSEQ_6, XREAL_0,
      NAT_1, INT_1, FINSEQ_1, CARD_1, BINOP_1, NAT_D, FINSEQ_2, FINSEQ_4,
      RFINSEQ, FINSEQ_5, XBOOLE_0, ORDINAL1, DESCIP_1, MARGREL1, NAT_2,
      WSIERP_1, XCMPLX_1, FINSEQ_3;
 schemes FUNCT_2, FINSEQ_1, NAT_1, BINOP_1, RECDEF_1;

begin :: Preliminaries

theorem XLMOD02:
  for k,m be Nat st m <> 0 & (k+1) mod m <> 0
  holds (k+1) mod m = (k mod m)+1
proof
  let k,m be Nat;
  assume
C1: m <> 0 & (k+1) mod m <> 0;
  (k mod m)+1 <= m by NAT_D:1,C1,NAT_1:13;
  then
P1: (k mod m)+1-1 <= m-1 by XREAL_1:9;
P2: (k+1) mod m = ((k mod m)+1) mod m by NAT_D:22;
  k mod m < m-1
  proof
    assume not k mod m < m-1;
    then (k+1) mod m = (m-1+1) mod m by XXREAL_0:1,P1,P2
      .= 0 by INT_1:50;
    hence contradiction by C1;
  end;
  then (k mod m)+1 < m-1+1 by XREAL_1:8;
  hence (k+1) mod m = (k mod m)+1 by NAT_D:24,P2;
end;

theorem XLMOD01:
  for k,m be Nat st m <> 0 & (k+1) mod m <> 0 holds (k+1) div m = k div m
proof
  let k,m be Nat;
  assume
C1: m <> 0 & (k+1) mod m <> 0;
  k+1 = ((k+1) div m )*m+((k+1) mod m) by INT_1:59,C1
    .= ((k+1) div m )*m+((k mod m)+1) by XLMOD02,C1;
  then
P1: ((k+1) div m)*m+(k mod m)-(k mod m) = (k div m )*m+(k mod m)-(k mod m)
  by INT_1:59,C1;
  thus ((k+1) div m) = (k div m)*m / m by XCMPLX_1:89,C1,P1
    .= (k div m) by XCMPLX_1:89,C1;
end;

theorem XLMOD02X:
  for k,m be Nat st m <> 0 & (k+1) mod m = 0 holds m-1 = (k mod m)
proof
  let k,m be Nat;
  assume
C1: m <> 0 & (k+1) mod m = 0;
  then (k mod m)+1 <= m by NAT_D:1,NAT_1:13;
  then
P1: (k mod m)+1-1 <= m-1 by XREAL_1:9;
P2: (k+1) mod m = ((k mod m)+1) mod m by NAT_D:22;
  assume not k mod m = m-1;
  then k mod m < m-1 by XXREAL_0:1,P1;
  then k mod m+1 < m-1+1 by XREAL_1:8;
  hence contradiction by P2,NAT_D:24,C1;
end;

theorem XLMOD01X:
  for k,m be Nat st m <> 0 & (k+1) mod m = 0
  holds (k+1) div m = (k div m)+1
proof
  let k,m be Nat;
  assume
C1: m <> 0 & (k+1) mod m = 0;
  then
P3: k mod m = m-1 by XLMOD02X;
P4: k+1 = ((k+1) div m)*m+((k+1) mod m) by INT_1:59,C1
    .= ((k+1) div m)*m by C1;
P5: k = (k div m )*m+(k mod m) by INT_1:59,C1
    .= (k div m)*m+m-1 by P3;
  thus ((k+1) div m) = ((k div m)+1)*m / m by XCMPLX_1:89,C1,P4,P5
    .= ((k div m)+1) by XCMPLX_1:89,C1;
end;

theorem XLMOD03:
  for k,m be Nat holds (k-m) mod m = k mod m
proof
  let k,m be Nat;
  thus (k-m) mod m = (k+m*(-1)) mod m
    .= k mod m by NAT_D:61;
end;

theorem XLMOD04:
  for k,m be Nat st m <> 0 holds (k-m) div m = (k div m)-1
proof
  let k,m be Nat;
  assume
AS: m <> 0;
  thus (k-m) div m = (k+m*(-1)) div m
    .= (k div m)+-1 by AS,NAT_D:61
    .= (k div m)-1;
end;

definition
  let m,n be Nat, X,D be non empty set;
  let F be Function of X, m-tuples_on(n-tuples_on D);
  let x be Element of X;
  redefine func F.x -> Element of m-tuples_on(n-tuples_on D);
  coherence
  proof
    F.x in m-tuples_on(n-tuples_on D);
    hence thesis;
  end;
end;

definition
  let m be Nat, X,Y,D be non empty set;
  let F be Function of [:X,Y:], m-tuples_on D;
  let x be Element of X,y be Element of Y;
  redefine func F.(x,y) -> Element of m-tuples_on D;
  coherence
  proof
    F.(x,y) in m-tuples_on D;
    hence thesis;
  end;
end;

theorem LM01:
  for m,n be Nat, D be non empty set,
  F1,F2 be Element of m-tuples_on (n-tuples_on D) st for i,j be Nat
  st i in Seg m & j in Seg n
  holds (F1.i).j = (F2.i).j holds F1 = F2
  proof
    let m,n be Nat, D be non empty set,
    F1,F2 be Element of m-tuples_on (n-tuples_on D);
    assume
AS: for i,j be Nat st i in Seg m & j in Seg n
    holds (F1.i).j = (F2.i).j;
    F1 in m-tuples_on (n-tuples_on D);
    then
P1: ex s be Element of (n-tuples_on D)* st F1 = s & len s = m;
    F2 in m-tuples_on (n-tuples_on D);
    then
P2: ex s be Element of (n-tuples_on D)* st F2 = s & len s = m;
    now let i be Nat;
      assume 1 <= i & i <= len F1;
      then
P4:   i in Seg m by P1;
      then i in dom F1 by FINSEQ_1:def 3,P1;
      then F1.i in rng F1 by FUNCT_1:3;
      then F1.i in n-tuples_on D;
      then
P6:   ex s be Element of D* st F1.i = s & len s = n;
      then reconsider F1i = F1.i as Element of D*;
      i in dom F2 by FINSEQ_1:def 3,P2,P4;
      then F2.i in rng F2 by FUNCT_1:3;
      then F2.i in n-tuples_on D;
      then
R6:   ex s be Element of D* st F2.i = s & len s = n;
      then reconsider F2i = F2.i as Element of D*;
      now let j be Nat;
      assume 1 <= j & j <= len F1i;
      then j in Seg n by P6;
      hence F1i.j = F2i.j by AS,P4;
    end;
    hence
    F1.i = F2.i by P6,R6,FINSEQ_1:14;
  end;
  hence F1 = F2 by P1,P2,FINSEQ_1:14;
end;

theorem LMGSEQ4:
  for D be non empty set, x1,x2,x3,x4 be Element of D
  holds <* x1,x2,x3,x4 *> is Element of (4-tuples_on D)
proof
  let D be non empty set, x1,x2,x3,x4 be Element of D;
  reconsider x1234 = <* x1,x2,x3,x4 *> as FinSequence of D;
P1: len x1234 = 4 by FINSEQ_4:76;
  x1234 in D* by FINSEQ_1:def 11;
  then x1234 in 4-tuples_on D by P1;
  hence thesis;
end;

theorem LMGSEQ5:
  for D be non empty set,x1,x2,x3,x4,x5 be Element of D
  holds <* x1,x2,x3,x4,x5 *> is Element of (5-tuples_on D)
proof
  let D be non empty set, x1,x2,x3,x4,x5 be Element of D;
  reconsider x12345 = <* x1,x2,x3,x4,x5 *> as FinSequence of D;
P1: len x12345 = 5 by FINSEQ_4:78;
  x12345 in D* by FINSEQ_1:def 11;
  then x12345 in 5-tuples_on D by P1;
  hence thesis;
end;

theorem
  for D be non empty set, x1,x2,x3,x4,x5,x6,x7,x8 be Element of D
  holds <* x1,x2,x3,x4 *>^<* x5,x6,x7,x8 *> is Element of (8-tuples_on D)
proof
  let D be non empty set,x1,x2,x3,x4,x5,x6,x7,x8 be Element of D;
  reconsider x1234 = <* x1,x2,x3,x4 *> as Element of 4-tuples_on D
  by LMGSEQ4;
  reconsider x5678 = <* x5,x6,x7,x8 *> as Element of 4-tuples_on D
  by LMGSEQ4;
  D c= D;
  hence thesis by FINSEQ_2:109;
end;

theorem LMGSEQ10:
  for D be non empty set, x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 be Element of D
  holds <* x1,x2,x3,x4,x5 *>^<* x6,x7,x8,x9,x10 *> is
  Element of (10-tuples_on D)
proof
  let D be non empty set, x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 be Element of D;
  reconsider x12345 = <* x1,x2,x3,x4,x5 *> as Element of 5-tuples_on D
  by LMGSEQ5;
  reconsider x67890 = <* x6,x7,x8,x9,x10 *> as Element of 5-tuples_on D
  by LMGSEQ5;
  D c= D;
  hence thesis by FINSEQ_2:109;
end;

theorem LMGSEQ16:
  for D be non empty set, x1,x2,x3,x4,x5,x6,x7,x8 be Element of (4-tuples_on D)
  holds <* x1^x5,x2^x6,x3^x7,x4^x8 *> is
  Element of 4-tuples_on (8-tuples_on D)
proof
  let D be non empty set,
  x1,x2,x3,x4,x5,x6,x7,x8 be Element of (4-tuples_on D);
X1: D c= D;
  then
P1: x1^x5 is Element of 8-tuples_on D by FINSEQ_2:109;
P2: x2^x6 is Element of 8-tuples_on D by X1,FINSEQ_2:109;
P3: x3^x7 is Element of 8-tuples_on D by X1,FINSEQ_2:109;
  x4^x8 is Element of 8-tuples_on D by X1,FINSEQ_2:109;
  hence thesis by P1,P2,P3,LMGSEQ4;
end;

theorem
  for D be non empty set, x be Element of 4-tuples_on(4-tuples_on D),
  k be Element of NAT st k in Seg 4 holds
  ex x1,x2,x3,x4 be Element of D st x1 = (x.k).1 & x2 = (x.k).2 &
  x3 = (x.k).3 & x4 = (x.k).4
proof
  let D be non empty set, x be Element of 4-tuples_on(4-tuples_on D),
  k be Element of NAT;
  assume
AS: k in Seg 4;
  x in 4-tuples_on(4-tuples_on D);
  then ex s be Element of (4-tuples_on D)* st x = s & len s = 4;
  then k in dom x by AS,FINSEQ_1:def 3;
  then x.k in rng x by FUNCT_1:3;
  then x.k in 4-tuples_on (D);
  then
Q13: ex s be Element of D* st x.k = s & len s = 4;
  then reconsider xk = x.k as Element of D*;
  1 in Seg 4;
  then 1 in dom xk by Q13,FINSEQ_1:def 3;
  then xk.1 in rng xk by FUNCT_1:3;
  then reconsider x1 = xk.1 as Element of D;
  2 in Seg 4;
  then 2 in dom xk by Q13,FINSEQ_1:def 3;
  then xk.2 in rng xk by FUNCT_1:3;
  then reconsider x2 = xk.2 as Element of D;
  3 in Seg 4;
  then 3 in dom xk by Q13,FINSEQ_1:def 3;
  then xk.3 in rng xk by FUNCT_1:3;
  then reconsider x3 = xk.3 as Element of D;
  4 in Seg 4;
  then 4 in dom xk by Q13,FINSEQ_1:def 3;
  then xk.4 in rng xk by FUNCT_1:3;
  then reconsider x4 = xk.4 as Element of D;
  take x1,x2,x3,x4;
  thus thesis;
end;

theorem INV00:
  for X,Y be non empty set, f be Function of X,Y, g be Function of Y,X
  st (for x be Element of X holds g.(f.x) = x) &
  (for y be Element of Y holds f.(g.y) = y)
  holds f is one-to-one & f is onto & g is one-to-one & g is onto &
  g = f" & f = g"
proof
  let X,Y be non empty set, f be Function of X,Y, g be Function of Y,X;
  assume
A1: for x be Element of X holds g.(f.x) = x;
  assume
A2: for y be Element of Y holds f.(g.y) = y;
  now let x be Element of X;
    thus (g*f).x = g.(f.x) by FUNCT_2:15
      .= x by A1;
  end;
  then
P2: g*f = id X by FUNCT_2:124;
  now let y be Element of Y;
    thus (f*g).y = f.(g.y) by FUNCT_2:15
      .= y by A2;
  end;
  then
P4: f*g = id Y by FUNCT_2:124;
  thus
P5: f is one-to-one & f is onto by P2,P4,FUNCT_2:23;
  thus
P6: g is one-to-one & g is onto by P2,P4,FUNCT_2:23;
  rng f = Y by P5,FUNCT_2:def 3;
  hence g = f" by FUNCT_2:30,P2,FUNCT_2:23;
  rng g = X by P6,FUNCT_2:def 3;
  hence f = g" by FUNCT_2:30,P4,FUNCT_2:23;
end;

begin :: State array

definition
  func AES-Statearray -> Function of 128-tuples_on BOOLEAN,
  4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) means
  :DefStatearray:
  for input be Element of 128-tuples_on BOOLEAN
  for i,j be Nat st i in Seg 4 & j in Seg 4
  holds ((it.input).i).j = mid (input,1+(i-'1)*8+(j-'1)*32,
  1+(i-'1)*8+(j-'1)*32+7);
  existence
  proof
    defpred P0[Element of 128-tuples_on BOOLEAN,set] means
    ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st $2 = z & for i,j be Nat st i in Seg 4 & j in Seg 4
    holds (z.i).j = mid ($1,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7);
A1: for x being Element of 128-tuples_on BOOLEAN
    ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st P0[x,z]
    proof
      let x be Element of 128-tuples_on BOOLEAN;
      x in 128-tuples_on BOOLEAN;
      then
A01:  ex s be Element of (BOOLEAN)* st x = s & len s = 128;
      defpred P[Nat,set] means
      ex zi be Element of (4-tuples_on (8-tuples_on BOOLEAN))
      st $2 = zi & for j be Nat st j in Seg 4
      holds zi.j = mid (x,1+($1-'1)*8+(j-'1)*32,1+($1-'1)*8+(j-'1)*32+7);
Q1:   for k be Nat st k in Seg 4
      ex x being Element of (4-tuples_on (8-tuples_on BOOLEAN)) st P[k,x]
      proof
        let k be Nat;
        assume k in Seg 4;
        then
Q110:   1 <= k & k <= 4 by FINSEQ_1:1;
        then 1-1 <= k-1 by XREAL_1:9;
        then k-'1 = k-1 by XREAL_0:def 2;
        then k-'1 <= 4-1 by Q110,XREAL_1:9;
        then
Q112:   (k-'1)*8 <= 3*8 by XREAL_1:64;
        defpred Pi[Nat,set] means
        $2 = mid (x,1+(k-'1)*8+($1-'1)*32,1+(k-'1)*8+($1-'1)*32+7);
Q12:    for j be Nat st j in Seg 4
        ex xi being Element of (8-tuples_on BOOLEAN) st Pi[j,xi]
        proof
          let j be Nat;
          assume j in Seg 4;
          then
Q130:     1 <= j & j <= 4 by FINSEQ_1:1;
          then 1-1 <= j-1 by XREAL_1:9;
          then j-'1 = j-1 by XREAL_0:def 2;
          then j-'1 <= 4-1 by Q130,XREAL_1:9;
          then
Q133:     (j-'1)*32 <= 3*32 by XREAL_1:64;
          (k-'1)*8+(j-'1)*32 <= 24+96 by Q133,Q112,XREAL_1:7;
          then
Q134:     1+((k-'1)*8+(j-'1)*32) <= 1+120 by XREAL_1:7;
Q136:     (1+(k-'1)*8+(j-'1)*32)+7 <= 121+7 by Q134,XREAL_1:7;
          1+0 <= 1+((k-'1)*8+(j-'1)*32) by XREAL_1:7;
          then
Q14:      1 <= 1+(k-'1)*8+(j-'1)*32 & 1+(k-'1)*8+(j-'1)*32 <= len x
          by Q134,XXREAL_0:2,A01;
Q150:     1+0 <= 1+(k-'1)*8+(j-'1)*32+7 by XREAL_1:7;
          reconsider mmd = mid (x,1+(k-'1)*8+(j-'1)*32,
          1+(k-'1)*8+(j-'1)*32+7) as Element of (BOOLEAN)* by FINSEQ_1:def 11;
          1+(k-'1)*8+(j-'1)*32+0 <= 1+(k-'1)*8+(j-'1)*32+7 by XREAL_1:6;
          then len mid (x,1+(k-'1)*8+(j-'1)*32,1+(k-'1)*8+(j-'1)*32+7) =
          (1+(k-'1)*8+(j-'1)*32+7)-'(1+(k-'1)*8+(j-'1)*32)+1
          by FINSEQ_6:118,Q14,Q136,A01,Q150
            .= 7+1 by NAT_D:34
            .= 8;
          then mmd in (8-tuples_on BOOLEAN);
          then reconsider xi = mid (x,1+(k-'1)*8+(j-'1)*32,
          1+(k-'1)*8+(j-'1)*32+7) as Element of (8-tuples_on BOOLEAN);
          xi = mid (x,1+(k-'1)*8+(j-'1)*32,1+(k-'1)*8+(j-'1)*32+7);
          hence thesis;
        end;
        consider zi be FinSequence of (8-tuples_on BOOLEAN) such that
Q13:    dom zi = Seg 4 & for i be Nat st i in Seg 4
        holds Pi[i,zi.i] from FINSEQ_1:sch 5(Q12);
Q14:    len zi = 4 by Q13,FINSEQ_1:def 3;
        reconsider zi as Element of (8-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
        zi in 4-tuples_on (8-tuples_on BOOLEAN) by Q14;
        then reconsider zi as Element of 4-tuples_on (8-tuples_on BOOLEAN);
        for j be Nat st j in Seg 4
        holds zi.j = mid (x,1+(k-'1)*8+(j-'1)*32,1+(k-'1)*8+(j-'1)*32+7)
        by Q13;
        hence thesis;
      end;
      consider z be FinSequence of 4-tuples_on (8-tuples_on BOOLEAN) such that
Q2:   dom z = Seg 4 &
      for i be Nat st i in Seg 4 holds P[i,z.i] from FINSEQ_1:sch 5(Q1);
Q3:   len z = 4 by Q2,FINSEQ_1:def 3;
      reconsider z as Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      by FINSEQ_1:def 11;
      z in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))by Q3;
      then reconsider z as
      Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      for i,j be Nat st i in Seg 4 & j in Seg 4
      holds (z.i).j = mid (x,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)
      proof
        let i,j be Nat;
        assume
P11:    i in Seg 4 & j in Seg 4;
        then consider zi be Element of (4-tuples_on (8-tuples_on BOOLEAN))
        such that
P12:    z.i = zi & for j be Nat st j in Seg 4
        holds zi.j = mid (x,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7) by Q2;
        thus (z.i).j = mid (x,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)
        by P11,P12;
      end;
      hence ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
      st P0[x,z];
    end;
    consider I be Function of 128-tuples_on BOOLEAN,
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) such that
A2: for x being Element of 128-tuples_on BOOLEAN
    holds P0[x,I.x] from FUNCT_2:sch 3(A1);
    now let input be Element of 128-tuples_on BOOLEAN;
      ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
      st I.input = z & for i,j be Nat st i in Seg 4 & j in Seg 4
      holds (z.i).j = mid (input,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)
      by A2;
      hence for i,j be Nat st i in Seg 4 & j in Seg 4
      holds ((I.input).i).j = mid (input,1+(i-'1)*8+(j-'1)*32,
      1+(i-'1)*8+(j-'1)*32+7);
    end;
    hence thesis;
  end;
  uniqueness
  proof
    let H1,H2 be Function of 128-tuples_on BOOLEAN,
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    assume
A1: for input be Element of 128-tuples_on BOOLEAN
    for i,j be Nat st i in Seg 4 & j in Seg 4
    holds ((H1.input).i).j = mid (input,1+(i-'1)*8+(j-'1)*32,
    1+(i-'1)*8+(j-'1)*32+7);
    assume
A2: for input be Element of 128-tuples_on BOOLEAN
    for i,j be Nat st i in Seg 4 & j in Seg 4
    holds ((H2.input).i).j = mid (input,1+(i-'1)*8+(j-'1)*32,
    1+(i-'1)*8+(j-'1)*32+7);
    now let input be Element of 128-tuples_on BOOLEAN;
      (H1.input) in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      then
P3:   ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      st (H1.input) = s & len s = 4;
      (H2.input) in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      then
P4:   ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      st (H2.input) = s & len s = 4;
      now let i be Nat;
        assume 1 <=i & i <= len (H1.input);
        then
P6:     i in Seg 4 by P3;
        then i in dom(H1.input) by FINSEQ_1:def 3,P3;
        then (H1.input).i in rng (H1.input) by FUNCT_1:3;
        then (H1.input).i in 4-tuples_on (8-tuples_on BOOLEAN);
        then
P8:     ex s be Element of (8-tuples_on BOOLEAN)*
        st (H1.input).i = s & len s = 4;
        reconsider H1i = (H1.input).i as
        Element of (8-tuples_on BOOLEAN)* by P8;
        i in dom(H2.input) by FINSEQ_1:def 3,P4,P6;
        then (H2.input).i in rng (H2.input) by FUNCT_1:3;
        then (H2.input).i in 4-tuples_on (8-tuples_on BOOLEAN);
        then
P11:    ex s be Element of (8-tuples_on BOOLEAN)*
        st (H2.input).i = s & len s = 4;
        reconsider H2i = (H2.input).i as
        Element of (8-tuples_on BOOLEAN)* by P11;
        now let j be Nat;
          assume 1 <=j & j <= len H1i;
          then
P14:      j in Seg 4 by P8;
          then ((H1.input).i).j = mid (input,1+(i-'1)*8+(j-'1)*32,
          1+(i-'1)*8+(j-'1)*32+7) by A1,P6;
          hence H1i.j = H2i.j by A2,P6,P14;
        end;
        hence (H1.input).i = (H2.input).i by P8,P11,FINSEQ_1:def 18;
      end;
      hence H1.input = H2.input by P3,P4,FINSEQ_1:def 18;
    end;
    hence H1 = H2 by FUNCT_2:63;
  end;
end;

theorem LMStat0:
  for k be Nat st 1 <= k & k <= 128 ex i,j be Nat st i in Seg 4 & j in Seg 4 &
  1+(i-'1)*8+(j-'1)*32 <= k & k <= 1+(i-'1)*8+(j-'1)*32+7
proof
  let k be Nat;
  assume
A1: 1 <= k & k <= 128;
A3: k = 32*(k div 32)+(k mod 32) by NAT_D:2;
  reconsider m = k div 32 as Nat;
  reconsider n = k mod 32 as Nat;
  k div 32 <= (32*4) div 32 by A1,NAT_2:24;
  then
M1: m <= 4;
  per cases;
  suppose
A4: n = 0;
A5: 1 <= m
    proof
      assume not 1 <= m;
      then m = 0 by NAT_1:14;
      hence contradiction by A1,A3,A4;
    end;
    set j = m;
A8: j in Seg 4 by M1,A5;
    set i = 4;
A10: i in Seg 4;
A11: j-'1 = j-1 by XREAL_1:233,A5;
A13: k = 32*(k div 32)+(k mod 32) by NAT_D:2
      .= 32*(j-'1)+8*((i-1)+1) by A4,A11
      .= 32*(j-'1)+8*((i-'1)+1) by XREAL_1:233
      .= 1+(i-'1)*8+(j-'1)*32+7;
    1+(i-'1)*8+(j-'1)*32+0 <= 1+(i-'1)*8+(j-'1)*32+7 by XREAL_1:7;
    hence ex i,j be Nat st i in Seg 4 & j in Seg 4 &
    1+(i-'1)*8+(j-'1)*32 <= k & k <= 1+(i-'1)*8+(j-'1)*32+7 by A8,A10,A13;
  end;
  suppose
A14: n <> 0;
    then
XX0: 1 <= n by NAT_1:14;
XX1: n <= 32 by NAT_D:1;
    m <> 4
    proof
      assume
U1:   m = 4;
U2:   k = 32*4+n by NAT_D:2,U1
        .= 128+n;
      128+1 <= 128+n by XX0,XREAL_1:7;
      hence contradiction by U2,XXREAL_0:2,A1;
    end;
    then m < 4 by XXREAL_0:1,M1;
    then
A15: m+1 <= 4 by NAT_1:13;
A16: 1 <= m+1 by NAT_1:11;
    set j = m+1;
A18: j in Seg 4 by A15,A16;
A19: j-'1 = j-1 by XREAL_1:233,NAT_1:11
      .=m;
A20: k = 32*(j-'1)+n by NAT_D:2,A19;
A22: n = 8*(n div 8)+(n mod 8) by NAT_D:2;
    reconsider s = n div 8 as Nat;
    reconsider t = n mod 8 as Nat;
    n div 8 <= (8*4) div 8 by XX1,NAT_2:24;
    then
M2: n div 8 <= 4;
    now per cases;
    suppose
A23:  t = 0;
A24:  1 <= s
      proof
        assume not 1 <= s;
        then n = 8*0+0 by NAT_1:14,A22,A23;
        hence contradiction by A14;
      end;
      set i = s;
A28:  i in Seg 4 by M2,A24;
A29:  i-'1 = i-1 by XREAL_1:233,A24;
A30:  n = 8*s+0 by NAT_D:2,A23
        .= 8*(i-'1)+8*1 by A29;
      1+(i-'1)*8+(j-'1)*32+0 <= 1+(i-'1)*8+(j-'1)*32+7 by XREAL_1:7;
      hence ex i,j be Nat st i in Seg 4 & j in Seg 4 &
      1+(i-'1)*8+(j-'1)*32 <= k & k <= 1+(i-'1)*8+(j-'1)*32+7
      by A28,A18,A20,A30;
    end;
    suppose
      t <> 0;
      then
XX0:  1 <= t by NAT_1:14;
XXX1: t <= 8 by NAT_D:1;
      s <> 4
      proof
        assume
U1:     s = 4;
U2:     n = 8*4+t by NAT_D:2,U1
          .= 32+t;
        32+1 <= 32+t by XX0,XREAL_1:7;
        hence contradiction by U2,XXREAL_0:2,XX1;
      end;
      then s < 4 by XXREAL_0:1,M2;
      then
B15:  s+1 <= 4 by NAT_1:13;
B16:  1 <= s+1 by NAT_1:11;
      set i = s+1;
B18:  i in Seg 4 by B15,B16;
B19:  i-'1 = i-1 by XREAL_1:233,NAT_1:11
        .=s;
B20:  n = 8*(i-'1)+t by NAT_D:2,B19;
B220: 32*(j-'1)+8*(i-'1)+1 <= 32*(j-'1)+8*(i-'1)+t by XX0,XREAL_1:7;
      32*(j-'1)+8*(i-'1)+t <= 32*(j-'1)+8*(i-'1)+8 by XXX1,XREAL_1:7;
      then k <= 1+8*(i-'1)+32*(j-'1)+7 by A20,B20;
      hence ex i,j be Nat st i in Seg 4 & j in Seg 4 &
      1+(i-'1)*8+(j-'1)*32 <= k & k <= 1+(i-'1)*8+(j-'1)*32+7
      by B220,A20,B20,B18,A18;
    end;
  end;
  hence ex i,j be Nat st i in Seg 4 & j in Seg 4 & 1+(i-'1)*8+(j-'1)*32 <= k &
  k <= 1+(i-'1)*8+(j-'1)*32+7;
end;
end;

theorem LMStat2A:
  for i,j,i0,j0 be Nat st i in Seg 4 & j in Seg 4 & i0 in Seg 4 &
  j0 in Seg 4 & not (i = i0 & j = j0)
  holds {k where k is Nat : 1+(i-'1)*8+(j-'1)*32 <= k &
  k <= 8+(i-'1)*8+(j-'1)*32} /\ {k where k is Nat :
  1+(i0-'1)*8+(j0-'1)*32 <= k & k <= 8+(i0-'1)*8+(j0-'1)*32} = {}
proof
  let i,j,i0,j0 be Nat;
  assume
AS: i in Seg 4 & j in Seg 4 & i0 in Seg 4 &
  j0 in Seg 4 & not (i = i0 & j = j0);
  set A = {k where k is Nat : 1+(i-'1)*8+(j-'1)*32 <= k &
  k <= 8+(i-'1)*8+(j-'1)*32};
  set B = {k where k is Nat : 1+(i0-'1)*8+(j0-'1)*32 <= k &
  k <= 8+(i0-'1)*8+(j0-'1)*32};
A1: 1 <= j & j <= 4 by AS,FINSEQ_1:1;
A2: 1 <= i & i <= 4 by AS,FINSEQ_1:1;
B1: 1 <= j0 & j0 <= 4 by AS,FINSEQ_1:1;
B2: 1 <= i0 & i0 <= 4 by AS,FINSEQ_1:1;
P1: (j-'1) = j-1 by XREAL_1:233,A1;
P2: (i-'1) = i-1 by XREAL_1:233,A2;
P3: (j0-'1) = j0-1 by XREAL_1:233,B1;
P4: (i0-'1) = i0-1 by XREAL_1:233,B2;
  i-1 <= 4-1 by A2,XREAL_1:9;
  then
R2: i-'1 <= 3 by XREAL_1:233,A2;
  i0-1 <= 4-1 by B2,XREAL_1:9;
  then
R4: i0-'1 <= 3 by XREAL_1:233,B2;
  per cases;
  suppose
A2: j <> j0;
    now per cases by A2,XXREAL_0:1;
    suppose
      j < j0;
      then (j-'1) < (j0-'1) by XREAL_1:14,P1,P3;
      then (j-'1)+1 <= (j0-'1) by NAT_1:13;
      then
A12:  ((j-'1)+1)*32 <= (j0-'1)*32 by XREAL_1:64;
      (i-'1)*8 <= 3*8 by R2,XREAL_1:64;
      then 8+(i-'1)*8 <= 8+24 by XREAL_1:6;
      then 8+(i-'1)*8+(j-'1)*32 <= 32+(j-'1)*32 by XREAL_1:6;
      then
A13:  8+(i-'1)*8+(j-'1)*32 <= (j0-'1)*32 by A12,XXREAL_0:2;
      0+(j0-'1)*32 <= (i0-'1)*8+(j0-'1)*32 by XREAL_1:6;
      then (j0-'1)*32+0 < (i0-'1)*8+(j0-'1)*32+1 by XREAL_1:8;
      then
A14:  8+(i-'1)*8+(j-'1)*32 < 1+(i0-'1)*8+(j0-'1)*32 by A13,XXREAL_0:2;
      thus A /\ B = {}
      proof
        assume A /\ B <> {};
        then consider x be object such that
A150:   x in A /\ B by XBOOLE_0:def 1;
A15:    x in A & x in B by XBOOLE_0:def 4,A150;
        consider k1 be Nat such that
A16:    x = k1 & 1+(i-'1)*8+(j-'1)*32 <= k1 & k1 <= 8+(i-'1)*8+(j-'1)*32
        by A15;
        consider k2 be Nat such that
A17:    x = k2 & 1+(i0-'1)*8+(j0-'1)*32 <= k2 & k2 <= 8+(i0-'1)*8+(j0-'1)*32
        by A15;
        reconsider x as Nat by A16;
        thus contradiction by A17,A14,XXREAL_0:2,A16;
      end;
    end;
    suppose
      j0 < j;
      then (j0-'1) < (j-'1) by XREAL_1:14,P1,P3;
      then (j0-'1)+1 <= (j-'1) by NAT_1:13;
      then
A12:  ((j0-'1)+1)*32 <= (j-'1)*32 by XREAL_1:64;
      (i0-'1)*8 <= 3*8 by R4,XREAL_1:64;
      then 8+(i0-'1)*8 <= 8+24 by XREAL_1:6;
      then 8+(i0-'1)*8+(j0-'1)*32 <= 32+(j0-'1)*32 by XREAL_1:6;
      then
A13:  8+(i0-'1)*8+(j0-'1)*32 <= (j-'1)*32 by A12,XXREAL_0:2;
      0+(j-'1)*32 <= (i-'1)*8+(j-'1)*32 by XREAL_1:6;
      then (j-'1)*32+0 < (i-'1)*8+(j-'1)*32+1 by XREAL_1:8;
      then
A14:  8+(i0-'1)*8+(j0-'1)*32 < 1+(i-'1)*8+(j-'1)*32 by A13,XXREAL_0:2;
      thus A /\ B = {}
      proof
        assume A /\ B <> {};
        then consider x be object such that
A150:   x in A /\ B by XBOOLE_0:def 1;
A15:    x in A & x in B by XBOOLE_0:def 4,A150;
        consider k1 be Nat such that
A16:    x = k1 & 1+(i-'1)*8+(j-'1)*32 <= k1 & k1 <= 8+(i-'1)*8+(j-'1)*32
        by A15;
        consider k2 be Nat such that
A17:    x = k2 & 1+(i0-'1)*8+(j0-'1)*32 <= k2 & k2 <= 8+(i0-'1)*8+(j0-'1)*32
        by A15;
        reconsider x as Nat by A16;
        thus contradiction by A16,A14,XXREAL_0:2,A17;
      end;
    end;
  end;
  hence A /\ B = {};
  end;
  suppose
A2: j = j0;
    now per cases by A2,AS,XXREAL_0:1;
      suppose i < i0;
      then (i-'1) < (i0-'1) by XREAL_1:14,P2,P4;
      then (i-'1)+1 <= (i0-'1) by NAT_1:13;
      then ((i-'1)+1)*8 <= (i0-'1)*8 by XREAL_1:64;
      then
A13:  (i-'1)*8+8+(j-'1)*32 <= (i0-'1)*8+(j0-'1)*32 by A2,XREAL_1:6;
      (i0-'1)*8+(j0-'1)*32+0 < (i0-'1)*8+(j0-'1)*32+1 by XREAL_1:8;
      then
A14:  8+(i-'1)*8+(j-'1)*32 < 1+(i0-'1)*8+(j0-'1)*32 by A13,XXREAL_0:2;
      thus A /\ B = {}
      proof
        assume A /\ B <> {};
        then consider x be object such that
A150:   x in A /\ B by XBOOLE_0:def 1;
A15:    x in A & x in B by XBOOLE_0:def 4,A150;
        consider k1 be Nat such that
A16:    x = k1 & 1+(i-'1)*8+(j-'1)*32 <= k1 & k1 <= 8+(i-'1)*8+(j-'1)*32
        by A15;
        consider k2 be Nat such that
A17:    x = k2 & 1+(i0-'1)*8+(j0-'1)*32 <= k2 & k2 <= 8+(i0-'1)*8+(j0-'1)*32
        by A15;
        reconsider x as Nat by A16;
        thus contradiction by A16,A17,A14,XXREAL_0:2;
      end;
    end;
    suppose
      i0 < i;
      then (i0-'1) < (i-'1) by XREAL_1:14,P2,P4;
      then (i0-'1)+1 <= (i-'1) by NAT_1:13;
      then ((i0-'1)+1)*8 <= (i-'1)*8 by XREAL_1:64;
      then
A13:  (i0-'1)*8+8+(j0-'1)*32 <= (i-'1)*8+(j-'1)*32 by A2,XREAL_1:6;
      (i-'1)*8+(j-'1)*32+0 < (i-'1)*8+(j-'1)*32+1 by XREAL_1:8;
      then
A14:  8+(i0-'1)*8+(j0-'1)*32 < 1+(i-'1)*8+(j-'1)*32 by A13,XXREAL_0:2;
      thus A /\ B = {}
      proof
        assume A /\ B <> {};
        then consider x be object such that
A150:   x in A /\ B by XBOOLE_0:def 1;
A15:    x in A & x in B by XBOOLE_0:def 4,A150;
        consider k1 be Nat such that
A16:    x = k1 & 1+(i-'1)*8+(j-'1)*32 <= k1 & k1 <= 8+(i-'1)*8+(j-'1)*32
        by A15;
        consider k2 be Nat such that
A17:    x = k2 & 1+(i0-'1)*8+(j0-'1)*32 <= k2 & k2 <= 8+(i0-'1)*8+(j0-'1)*32
        by A15;
        reconsider x as Nat by A16;
        thus contradiction by A16,A14,XXREAL_0:2,A17;
      end;
    end;
  end;
  hence A /\ B = {};
end;
end;

theorem LMStat2:
  for k,i,j,i0,j0 be Nat st 1 <= k & k <= 128 & i in Seg 4 & j in Seg 4 &
  i0 in Seg 4 & j0 in Seg 4 & 1+(i-'1)*8+(j-'1)*32 <= k &
  k <= 1+(i-'1)*8+(j-'1)*32+7 & 1+(i0-'1)*8+(j0-'1)*32 <= k &
  k <= 1+(i0-'1)*8+(j0-'1)*32+7 holds i = i0 & j = j0
proof
  let k,i,j,i0,j0 be Nat;
  assume
AS: 1 <= k & k <= 128 & i in Seg 4 & j in Seg 4 & i0 in Seg 4 & j0 in Seg 4 &
  1+(i-'1)*8+(j-'1)*32 <= k & k <= 1+(i-'1)*8+(j-'1)*32+7 &
  1+(i0-'1)*8+(j0-'1)*32 <= k & k <= 1+(i0-'1)*8+(j0-'1)*32+7;
  assume not (i = i0 & j = j0);
  then
A2: {n where n is Nat : 1+(i-'1)*8+(j-'1)*32 <= n & n <= 8+(i-'1)*8+(j-'1)*32}
  /\ {n where n is Nat : 1+(i0-'1)*8+(j0-'1)*32 <= n &
  n <= 8+(i0-'1)*8+(j0-'1)*32} = {} by LMStat2A,AS;
A3: k in {n where n is Nat : 1+(i-'1)*8+(j-'1)*32 <= n &
  n <= 8+(i-'1)*8+(j-'1)*32} by AS;
  k in {n where n is Nat : 1+(i0-'1)*8+(j0-'1)*32 <= n &
  n <= 8+(i0-'1)*8+(j0-'1)*32} by AS;
  hence contradiction by A3,XBOOLE_0:def 4,A2;
end;

theorem LMStat1:
  AES-Statearray is one-to-one
proof
  for x1,x2 be object st x1 in 128-tuples_on BOOLEAN &
  x2 in 128-tuples_on BOOLEAN &
  (AES-Statearray).x1 = (AES-Statearray).x2 holds x1 = x2
  proof
    let x1,x2 be object;
    assume
A1: x1 in 128-tuples_on BOOLEAN & x2 in 128-tuples_on BOOLEAN &
    (AES-Statearray).x1 = (AES-Statearray).x2;
    then reconsider xx1 = x1,xx2 = x2 as Element of 128-tuples_on BOOLEAN;
P1: ex s be Element of (BOOLEAN)* st xx1 = s & len s = 128 by A1;
P2: ex s be Element of (BOOLEAN)* st xx2 = s & len s = 128 by A1;
    now let k be Nat;
      assume
P5:   1 <= k & k <= len xx1;
      consider i,j be Nat such that
A4:   i in Seg 4 & j in Seg 4 & 1+(i-'1)*8+(j-'1)*32 <= k &
      k <= 1+(i-'1)*8+(j-'1)*32+7 by LMStat0,P5,P1;
      mid (xx1,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7) is
      Element of (BOOLEAN)* by FINSEQ_1:def 11;
      then reconsider A1ij = (((AES-Statearray).xx1).i).j as
      FinSequence of (BOOLEAN) by DefStatearray,A4;
      mid (xx2,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7) is
      Element of (BOOLEAN)* by FINSEQ_1:def 11;
      then reconsider A2ij = (((AES-Statearray).xx2).i).j as
      FinSequence of (BOOLEAN) by DefStatearray,A4;
A50:  1+(i-'1)*8+(j-'1)*32-((i-'1)*8+(j-'1)*32) <= k-((i-'1)*8+(j-'1)*32)
      by A4,XREAL_1:9;
      then reconsider n = k-((i-'1)*8+(j-'1)*32) as Element of NAT by INT_1:3;
F41:  k-((i-'1)*8+(j-'1)*32) <= 1+(i-'1)*8+(j-'1)*32+7-((i-'1)*8+(j-'1)*32)
      by A4,XREAL_1:9;
F1:   1 <= 1+((i-'1)*8+(j-'1)*32) by NAT_1:11;
F2:   1+(i-'1)*8+(j-'1)*32 <= 1+(i-'1)*8+(j-'1)*32+7 by NAT_1:11;
Q110: 1 <= i & i <= 4 by A4,FINSEQ_1:1;
      then 1-1 <= i-1 by XREAL_1:9;
      then i-'1 = i-1 by XREAL_0:def 2;
      then i-'1 <= 4-1 by Q110,XREAL_1:9;
      then
Q112: (i-'1)*8 <= 3*8 by XREAL_1:64;
Q130: 1 <= j & j <= 4 by A4,FINSEQ_1:1;
      then 1-1 <= j-1 by XREAL_1:9;
      then j-'1 = j-1 by XREAL_0:def 2;
      then j-'1 <= 4-1 by Q130,XREAL_1:9;
      then
Q133: (j-'1)*32 <= 3*32 by XREAL_1:64;
      (i-'1)*8+(j-'1)*32 <= 24+96 by Q133,Q112,XREAL_1:7;
      then 1+((i-'1)*8+(j-'1)*32) <= 1+120 by XREAL_1:7;
      then
Q135: 1+(i-'1)*8+(j-'1)*32+7 <= 121+7 by XREAL_1:6;
F5:   n <= (1+(i-'1)*8+(j-'1)*32+7)-(1+(i-'1)*8+(j-'1)*32)+1 by F41;
A6:   k = n-1+(1+(i-'1)*8+(j-'1)*32);
      thus xx1.k = (mid (xx1,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)).n
      by F1,F2,Q135,P1,A50,F5,A6,FINSEQ_6:122
        .= A2ij.n by DefStatearray,A4,A1
        .= (mid (xx2,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)).n
        by DefStatearray,A4
        .= xx2.k by F1,F2,P2,Q135,A50,F5,A6,FINSEQ_6:122;
    end;
  hence thesis by P1,P2,FINSEQ_1:def 18;
end;
hence thesis by FUNCT_2:19;
end;

theorem LMStat3:
  AES-Statearray is onto
proof
  for y be object st y in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  ex x be object st x in 128-tuples_on BOOLEAN & y = AES-Statearray.x
  proof
    let y be object;
    assume y in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    then
B10:ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))*
    st y = s & len s = 4;
    then reconsider z = y as Element of (4-tuples_on (8-tuples_on BOOLEAN))*;
    defpred PK[Nat,set] means
    ex i,j,n be Nat, zij be Element of (8-tuples_on BOOLEAN)
    st i in Seg 4 & j in Seg 4 & n in Seg 8 & 1+(i-'1)*8+(j-'1)*32 <= $1 &
    $1 <= 1+(i-'1)*8+(j-'1)*32+7 & n = $1-((i-'1)*8+(j-'1)*32) & zij = (z.i).j
    & $2 = zij.n;
Q12: for k be Nat st k in Seg 128 ex z being Element of BOOLEAN st PK[k,z]
    proof
      let k be Nat;
      assume k in Seg 128;
      then 1 <= k & k <= 128 by FINSEQ_1:1;
      then consider i,j be Nat such that
A4:   i in Seg 4 & j in Seg 4 & 1+(i-'1)*8+(j-'1)*32 <= k &
      k <= 1+(i-'1)*8+(j-'1)*32+7 by LMStat0;
      i in dom z by FINSEQ_1:def 3,A4,B10;
      then z.i in rng z by FUNCT_1:3;
      then z.i in 4-tuples_on (8-tuples_on BOOLEAN);
      then
B10:  ex s be Element of (8-tuples_on BOOLEAN)* st z.i = s & len s = 4;
      then reconsider zi = z.i as Element of (8-tuples_on BOOLEAN)*;
      j in dom zi by B10,FINSEQ_1:def 3,A4;
      then (zi).j in rng zi by FUNCT_1:3;
      then reconsider zij = (z.i).j as Element of 8-tuples_on BOOLEAN;
A50:  1+(i-'1)*8+(j-'1)*32-((i-'1)*8+(j-'1)*32) <= k-((i-'1)*8+(j-'1)*32)
      by A4,XREAL_1:9;
      then reconsider n = k-((i-'1)*8+(j-'1)*32) as Element of NAT by INT_1:3;
      k-((i-'1)*8+(j-'1)*32) <= 1+(i-'1)*8+(j-'1)*32+7-((i-'1)*8+(j-'1)*32)
      by A4,XREAL_1:9;
      then
G4:   n in Seg 8 by A50;
      reconsider z = zij.n as Element of BOOLEAN;
      take z;
      thus thesis by A4,G4;
    end;
    consider x be FinSequence of BOOLEAN
    such that
Q13: dom x = Seg 128 & for i be Nat st i in Seg 128
    holds PK[i,x.i] from FINSEQ_1:sch 5(Q12);
Q14: len x = 128 by Q13,FINSEQ_1:def 3;
    reconsider x as Element of (BOOLEAN)* by FINSEQ_1:def 11;
    x in 128-tuples_on BOOLEAN by Q14;
    then reconsider x as Element of 128-tuples_on BOOLEAN;
P2: for i,j be Nat st i in Seg 4 & j in Seg 4
    holds (z.i).j = mid (x,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)
    proof
      let i,j be Nat;
      assume
P21:  i in Seg 4 & j in Seg 4;
      then i in dom z by FINSEQ_1:def 3,B10;
      then z.i in rng z by FUNCT_1:3;
      then z.i in 4-tuples_on (8-tuples_on BOOLEAN);
      then
P8:   ex s be Element of (8-tuples_on BOOLEAN)* st z.i = s & len s = 4;
      reconsider zi = z.i as Element of (8-tuples_on BOOLEAN)* by P8;
      j in dom zi by P8,FINSEQ_1:def 3,P21;
      then zi.j in rng zi by FUNCT_1:3;
      then zi.j in (8-tuples_on BOOLEAN);
      then
P11:  ex s be Element of (BOOLEAN)* st zi.j = s & len s = 8;
      reconsider zij = zi.j as Element of (BOOLEAN)* by P11;
Q110: 1 <= i & i <= 4 by P21,FINSEQ_1:1;
      then 1-1 <= i-1 by XREAL_1:9;
      then i-'1 = i-1 by XREAL_0:def 2;
      then i-'1 <= 4-1 by Q110,XREAL_1:9;
      then
Q112: (i-'1)*8 <= 3*8 by XREAL_1:64;
Q130: 1 <= j & j <= 4 by P21,FINSEQ_1:1;
      then 1-1 <= j-1 by XREAL_1:9;
      then j-'1 = j-1 by XREAL_0:def 2;
      then j-'1 <= 4-1 by Q130,XREAL_1:9;
      then
Q133: (j-'1)*32 <= 3*32 by XREAL_1:64;
      (i-'1)*8+(j-'1)*32 <= 24+96 by Q133,Q112,XREAL_1:7;
      then
Q134: 1+((i-'1)*8+(j-'1)*32) <= 1+120 by XREAL_1:7;
      then
G1:   1+((i-'1)*8+(j-'1)*32) <= len x by XXREAL_0:2,Q14;
G0:   1 <= 1+((i-'1)*8+(j-'1)*32) by NAT_1:11;
G2:   1 <= 1+((i-'1)*8+(j-'1)*32+7) by NAT_1:11;
G3:   1+((i-'1)*8+(j-'1)*32)+0 <= 1+(i-'1)*8+(j-'1)*32+7 by XREAL_1:7;
Q135: 1+(i-'1)*8+(j-'1)*32+7 <= 121+7 by XREAL_1:6,Q134;
      then
F3:   1+(i-'1)*8+(j-'1)*32+7 <= len x by Q13,FINSEQ_1:def 3;
P13:  len (mid (x,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)) =
      (1+(i-'1)*8+(j-'1)*32+7)-'(1+(i-'1)*8+(j-'1)*32)+1
      by G1,G2,G3,G0,F3,FINSEQ_6:118
        .= (1+(i-'1)*8+(j-'1)*32+7)-(1+(i-'1)*8+(j-'1)*32)+1 by G3,XREAL_1:233
        .= 8;
      now let n be Nat;
        assume
F40:    1 <= n & n <= len zij;
F1:     1 <= 1+((i-'1)*8+(j-'1)*32) by NAT_1:11;
F2:     1+(i-'1)*8+(j-'1)*32 <= 1+(i-'1)*8+(j-'1)*32+7 by NAT_1:11;
F5:     n <= (1+(i-'1)*8+(j-'1)*32+7)-(1+(i-'1)*8+(j-'1)*32)+1 by F40,P11;
        reconsider k = n+((i-'1)*8+(j-'1)*32) as Nat;
A6:     k = n-1+(1+(i-'1)*8+(j-'1)*32);
        n <= n+((i-'1)*8+(j-'1)*32) by NAT_1:11;
        then
H1:     1 <= k by F40,XXREAL_0:2;
        reconsider k = n+((i-'1)*8+(j-'1)*32) as Nat;
H3:     k <= 8+((i-'1)*8+(j-'1)*32) by F40,P11,XREAL_1:7;
        then
H2:     k <= 128 by Q135,XXREAL_0:2;
        then k in Seg 128 by H1;
        then consider i0,j0,n0 be Nat,
        zi0j0 be Element of (8-tuples_on BOOLEAN) such that
AA1:    i0 in Seg 4 & j0 in Seg 4 & n0 in Seg 8 & 1+(i0-'1)*8+(j0-'1)*32 <= k &
        k <= 1+(i0-'1)*8+(j0-'1)*32+7 & n0 = k-((i0-'1)*8+(j0-'1)*32) &
        zi0j0 = (z.i0).j0 & x.k = zi0j0.n0 by Q13;
        1+((i-'1)*8+(j-'1)*32) <= n+((i-'1)*8+(j-'1)*32) by F40,XREAL_1:7;
        then 1+(i-'1)*8+(j-'1)*32 <= k & k <= 1+(i-'1)*8+(j-'1)*32+7 by H3;
        then i = i0 & j = j0 by LMStat2,AA1,P21,H1,H2;
        hence zij.n = (mid (x,1+(i-'1)*8+(j-'1)*32,1+(i-'1)*8+(j-'1)*32+7)).n
        by AA1,F1,F2,F3,F40,F5,A6,FINSEQ_6:122;
      end;
      hence thesis by FINSEQ_1:def 18,P11,P13;
    end;
    (AES-Statearray.x) in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    then
P3: ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))*
    st (AES-Statearray.x) = s & len s = 4;
    now let i be Nat;
      assume 1 <= i & i <= len (AES-Statearray.x);
      then
P6:   i in Seg 4 by P3;
      then i in dom(AES-Statearray.x) by FINSEQ_1:def 3,P3;
      then (AES-Statearray.x).i in rng (AES-Statearray.x) by FUNCT_1:3;
      then (AES-Statearray.x).i in 4-tuples_on (8-tuples_on BOOLEAN);
      then
P8:   ex s be Element of (8-tuples_on BOOLEAN)*
      st (AES-Statearray.x).i = s & len s = 4;
      reconsider H1i = (AES-Statearray.x).i as
      Element of (8-tuples_on BOOLEAN)* by P8;
      i in dom z by FINSEQ_1:def 3,B10,P6;
      then z.i in rng z by FUNCT_1:3;
      then z.i in 4-tuples_on (8-tuples_on BOOLEAN);
      then
P11:  ex s be Element of (8-tuples_on BOOLEAN)*
      st z.i = s & len s = 4;
      reconsider H2i = z.i as Element of (8-tuples_on BOOLEAN)* by P11;
      now let j be Nat;
        assume 1 <= j & j <= len H1i;
        then
P14:    j in Seg 4 by P8;
        then ((AES-Statearray.x).i).j = mid (x,1+(i-'1)*8+(j-'1)*32,
        1+(i-'1)*8+(j-'1)*32+7) by DefStatearray,P6;
        hence H1i.j = H2i.j by P2,P6,P14;
      end;
      hence (AES-Statearray.x).i = z.i by P8,P11,FINSEQ_1:def 18;
    end;
    hence thesis by P3,B10,FINSEQ_1:def 18;
  end;
  then 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) =
  rng AES-Statearray by FUNCT_2:10;
  hence thesis by FUNCT_2:def 3;
end;

registration
  cluster AES-Statearray -> bijective;
  correctness by LMStat1,LMStat3;
end;

theorem LMINV1:
  for cipher be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds AES-Statearray.((AES-Statearray)".(cipher)) = cipher
proof
  let cipher be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  set f = AES-Statearray;
L0: rng AES-Statearray = 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  by FUNCT_2:def 3;
  then reconsider g = f" as Function of
  4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),128-tuples_on BOOLEAN
  by FUNCT_2:25;
L2: (f")*f = id (128-tuples_on BOOLEAN) & f*(f") =
  id (4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))) by FUNCT_2:29,L0;
  then g is one-to-one & rng g = 128-tuples_on BOOLEAN by FUNCT_2:18;
  then f = g" by FUNCT_2:30,L2;
  hence thesis by FUNCT_2:26;
end;

begin :: SubBytes

reserve SBT for Permutation of (8-tuples_on BOOLEAN);

definition
  let SBT;
  func SubBytes(SBT) ->
  Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) means
  :DefSubBytes:
  for input be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds for i,j be Nat st i in Seg 4 & j in Seg 4
  holds ex inputij be Element of 8-tuples_on BOOLEAN
  st inputij = (input.i).j & ((it.input).i).j = SBT.(inputij);
  existence
  proof
    defpred P0[Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))] means
    for i,j be Nat st i in Seg 4 & j in Seg 4
    holds ex inputij be Element of 8-tuples_on BOOLEAN
    st inputij = ($1.i).j & ($2.i).j = SBT.(inputij);
A1: for text being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st P0[text,z]
    proof
      let text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      text in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      then
Q01:  ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      st text = s & len s = 4;
      defpred P[Nat,set] means
      ex zk be Element of (4-tuples_on (8-tuples_on BOOLEAN))
      st $2 = zk & for j be Nat st j in Seg 4
      holds ex textij be Element of 8-tuples_on BOOLEAN
      st textij = (text.$1).j & zk.j = SBT.(textij);
Q1:   for k be Nat st k in Seg 4 ex zk being
      Element of (4-tuples_on (8-tuples_on BOOLEAN)) st P[k,zk]
      proof
        let k be Nat;
        assume k in Seg 4;
        then k in dom text by Q01,FINSEQ_1:def 3;
        then text.k in rng text by FUNCT_1:3;
        then text.k in 4-tuples_on (8-tuples_on BOOLEAN);
        then
Q13:    ex s be Element of (8-tuples_on BOOLEAN)* st text.k = s & len s = 4;
        then reconsider textk = text.k as Element of (8-tuples_on BOOLEAN)*;
        defpred Pi[Nat,set] means
        ex textij be Element of 8-tuples_on BOOLEAN st textij = (textk).$1 &
        $2 = SBT.(textij);
Q18:    for j be Nat st j in Seg 4 ex xi being Element of (8-tuples_on BOOLEAN)
        st Pi[j,xi]
        proof
          let j be Nat;
          assume j in Seg 4;
          then j in dom(textk) by Q13,FINSEQ_1:def 3;
          then (textk).j in rng (textk) by FUNCT_1:3;
          then reconsider textkj = (textk).j as Element of 8-tuples_on BOOLEAN;
          SBT.(textkj) = SBT.(textkj);
          hence thesis;
        end;
        consider zk be FinSequence of (8-tuples_on BOOLEAN) such that
Q22:    dom zk = Seg 4 & for j be Nat st j in Seg 4
        holds Pi[j,zk.j] from FINSEQ_1:sch 5(Q18);
Q23:    len zk = 4 by Q22,FINSEQ_1:def 3;
        reconsider zk as Element of (8-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
        zk in 4-tuples_on (8-tuples_on BOOLEAN) by Q23;
        then reconsider zk as Element of 4-tuples_on (8-tuples_on BOOLEAN);
        for j be Nat st j in Seg 4 holds
        ex textij be Element of 8-tuples_on BOOLEAN st textij = (textk).j &
        zk.j = SBT.(textij) by Q22;
        hence thesis;
      end;
      consider z be FinSequence of 4-tuples_on (8-tuples_on BOOLEAN) such that
Q2:   dom z = Seg 4 & for i be Nat st i in Seg 4
      holds P[i,z.i] from FINSEQ_1:sch 5(Q1);
Q3:   len z = 4 by Q2,FINSEQ_1:def 3;
      reconsider z as Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      by FINSEQ_1:def 11;
      z in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) by Q3;
      then reconsider z as Element of
      4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      take z;
      for i,j be Nat st i in Seg 4 & j in Seg 4 holds
      ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
      (z.i).j = SBT.(textij)
      proof
        let i,j be Nat;
        assume
Q4:     i in Seg 4 & j in Seg 4;
        then ex zi be Element of (4-tuples_on (8-tuples_on BOOLEAN))
        st z.i = zi & for j be Nat st j in Seg 4 holds
        ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
        zi.j = SBT.(textij) by Q2;
        hence ex textij be Element of 8-tuples_on BOOLEAN
        st textij = (text.i).j & (z.i).j = SBT.(textij) by Q4;
      end;
      hence thesis;
    end;
    consider I be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) such that
A2: for x being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds P0[x,I.x] from FUNCT_2:sch 3(A1);
    take I;
    thus thesis by A2;
  end;
  uniqueness
  proof
    let F1,F2 be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    assume
A1: for text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds for i,j be Nat st i in Seg 4 & j in Seg 4 holds
    ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
    ((F1.text).i).j = SBT.(textij);
    assume
A2: for text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds for i,j be Nat st i in Seg 4 & j in Seg 4 holds
    ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
    ((F2.text).i).j = SBT.(textij);
    now let text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      now let i,j be Nat;
        assume
A3:     i in Seg 4 & j in Seg 4;
        then
A4:     ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
        ((F1.text).i).j = SBT.(textij) by A1;
A5:     ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
        ((F2.text).i).j = SBT.(textij) by A3,A2;
        thus ((F1.text).i).j = ((F2.text).i).j by A4,A5;
      end;
      hence F1.text = F2.text by LM01;
    end;
    hence F1 = F2 by FUNCT_2:63;
  end;
end;

definition
  let SBT;
  func InvSubBytes(SBT) ->
  Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) means
  :DefInvSubBytes:
  for input be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds for i,j be Nat st i in Seg 4 & j in Seg 4 holds
  ex inputij be Element of 8-tuples_on BOOLEAN st inputij = (input.i).j &
  ((it.input).i).j = (SBT").(inputij);
  existence
  proof
    defpred P0[Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))] means
    for i,j be Nat st i in Seg 4 & j in Seg 4 holds
    ex inputij be Element of 8-tuples_on BOOLEAN st inputij = ($1.i).j &
    ($2.i).j = (SBT").(inputij);
A1: for text being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st P0[text,z]
    proof
      let text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      text in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      then
Q01:  ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))* st text = s &
      len s = 4;
      defpred P[Nat,set] means
      ex zk be Element of (4-tuples_on (8-tuples_on BOOLEAN)) st $2 = zk &
      for j be Nat st j in Seg 4 holds
      ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.$1).j &
      zk.j = (SBT").(textij);
Q1:   for k be Nat st k in Seg 4
      ex zk being Element of (4-tuples_on (8-tuples_on BOOLEAN)) st P[k,zk]
      proof
        let k be Nat;
        assume k in Seg 4;
        then k in dom text by Q01,FINSEQ_1:def 3;
        then text.k in rng text by FUNCT_1:3;
        then text.k in 4-tuples_on (8-tuples_on BOOLEAN);
        then
Q13:    ex s be Element of (8-tuples_on BOOLEAN)* st text.k = s & len s = 4;
        then reconsider textk = text.k as Element of (8-tuples_on BOOLEAN)*;
        defpred Pi[Nat,set] means
        ex textij be Element of 8-tuples_on BOOLEAN st textij = (textk).$1 &
        $2 = (SBT").(textij);
Q18:    for j be Nat st j in Seg 4 ex xi being Element of (8-tuples_on BOOLEAN)
        st Pi[j,xi]
        proof
          let j be Nat;
          assume j in Seg 4;
          then j in dom(textk) by Q13,FINSEQ_1:def 3;
          then (textk).j in rng (textk) by FUNCT_1:3;
          then reconsider textkj = (textk).j as Element of 8-tuples_on BOOLEAN;
          (SBT").(textkj) = (SBT").(textkj);
          hence thesis;
        end;
        consider zk be FinSequence of (8-tuples_on BOOLEAN) such that
Q22:    dom zk = Seg 4 & for j be Nat st j in Seg 4
        holds Pi[j,zk.j ] from FINSEQ_1:sch 5(Q18);
Q23:    len zk = 4 by Q22,FINSEQ_1:def 3;
        reconsider zk as Element of (8-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
        zk in 4-tuples_on (8-tuples_on BOOLEAN) by Q23;
        then reconsider zk as Element of 4-tuples_on (8-tuples_on BOOLEAN);
        for j be Nat st j in Seg 4 holds
        ex textij be Element of 8-tuples_on BOOLEAN st textij = (textk).j &
        zk.j = (SBT").(textij) by Q22;
        hence thesis;
      end;
      consider z be FinSequence of 4-tuples_on (8-tuples_on BOOLEAN) such that
Q2:   dom z = Seg 4 & for i be Nat st i in Seg 4
      holds P[i,z.i] from FINSEQ_1:sch 5(Q1);
Q3:   len z = 4 by Q2,FINSEQ_1:def 3;
      reconsider z as Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      by FINSEQ_1:def 11;
      z in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) by Q3;
      then reconsider z as
      Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      take z;
      for i,j be Nat st i in Seg 4 & j in Seg 4 holds
      ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
      (z.i).j = (SBT").(textij)
      proof
        let i,j be Nat;
        assume
Q4:     i in Seg 4 & j in Seg 4;
        then ex zi be Element of (4-tuples_on (8-tuples_on BOOLEAN))
        st z.i = zi & for j be Nat st j in Seg 4 holds
        ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
        zi.j = (SBT").(textij) by Q2;
        hence ex textij be Element of 8-tuples_on BOOLEAN
        st textij = (text.i).j & (z.i).j = (SBT").(textij) by Q4;
      end;
      hence thesis;
    end;
    consider I be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) such that
A2: for x being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds P0[x,I.x] from FUNCT_2:sch 3(A1);
    take I;
    thus thesis by A2;
  end;
  uniqueness
  proof
    let F1,F2 be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    assume
A1: for text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds for i,j be Nat st i in Seg 4 & j in Seg 4 holds
    ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
    ((F1.text).i).j = (SBT").(textij);
    assume
A2: for text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds for i,j be Nat st i in Seg 4 & j in Seg 4 holds
    ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
    ((F2.text).i).j = (SBT").(textij);
    now let text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      now let i,j be Nat;
        assume
A3:     i in Seg 4 & j in Seg 4;
        then
A4:     ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
        ((F1.text).i).j = (SBT").(textij) by A1;
A5:     ex textij be Element of 8-tuples_on BOOLEAN st textij = (text.i).j &
        ((F2.text).i).j = (SBT").(textij) by A3,A2;
        thus ((F1.text).i).j = ((F2.text).i).j by A4,A5;
      end;
      hence F1.text = F2.text by LM01;
    end;
    hence F1 = F2 by FUNCT_2:63;
  end;
end;

INV07A:
  for input be Element of 8-tuples_on BOOLEAN
  holds (SBT").(SBT.(input)) = input
proof
  let input be Element of 8-tuples_on BOOLEAN;
  thus (SBT").(SBT.(input)) = ((SBT")*SBT).input by FUNCT_2:15
    .= (id (8-tuples_on BOOLEAN)).input by FUNCT_2:61
    .= input;
end;

INV08A:
  for input be Element of 8-tuples_on BOOLEAN
  holds SBT.((SBT").(input)) = input
proof
  let input be Element of 8-tuples_on BOOLEAN;
  thus SBT.((SBT").(input)) = (SBT*(SBT")).input by FUNCT_2:15
    .= (id (8-tuples_on BOOLEAN)).input by FUNCT_2:61
    .= input;
end;

theorem INV07:
  for input be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds (InvSubBytes(SBT)).((SubBytes(SBT)).input) = input
proof
  let input be Element of::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).:: This code can be distributed under the GNU General Public Licence
  now :: http://creativecommons.java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 0
    assumeTARSKI, XBOOLE_0,ZFMISC_1, SUBSET_1, RELAT_1, FUNCT_1, ORDINAL1,
A3: i in Seg 4 & j in Seg 4;
    then consider outputij be Element of 8-tuples_on BOOLEAN such that
A4: outputij =((SubBytes(BT).input).i.j java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    (((,NAT_1 , XBOOLE_0  XREAL_0 FINSEQ_4;
    by ements BOOLE,SUBSET, NUMERALS, ARITHM, REAL;
     Elementof 8-tuples_on BOOLEAN such that
A5:inputij=(i)j  (SubBytes)...j =SBT.()
    by DefSubBytes,A3;
    (SBT)(SubBytes()).))i.  input.)j
    by A4,A5,INV07A;
  end;
  hence (InvSubBytes(SBT)).((SubBytes(SBT)).input) = input by LM01;
end;

theorem INV08:
  for output be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds (SubBytes(SBT)).((InvSubBytes(SBT)).output) = output
proof
  let input be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  now let i,j be Nat;
    assume
A3: i in Seg 4 & j in Seg 4;
    then consider outputij be Element of 8-tuples_on BOOLEAN such that
A4: outputij = (((InvSubBytes(SBT)).input).i).j &
    (((SubBytes(SBT)).((InvSubBytes(SBT)).input)).i).j = SBT.(outputij)
    by DefSubBytes;
    consider inputij be Element of 8-tuples_on BOOLEAN such that
A5: inputij=(.)j &
(((nvSubBytesS).nput.i. =().(inputij)by ,A3;
    thus (((SubBytes(SBTjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    by A4,A5,INV08A;
  end;
  hence (SubBytes(SBT)).((InvSubBytes(SBT)).input) = input by LM01;
end;

theorem
  SubBytes(SBT) is one-to-one & SubBytes(SBT) is onto &
  InvSubBytes(SBT) is one-to-one & InvSubBytes(SBT) is onto &
  InvSubBytes(SBT) = (SubBytes(SBT))" & SubBytes(SBT) = (InvSubBytes(SBT))"
proof
  set f = SubBytes(SBT);
  set g = InvSubBytes(SBT);
P1: for x be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds g.(f.x) = x by INV07;
P2: for y be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds f.(g.y) = y P2: (k+1) mod m = ((k mod(k1 mod  =(kmod m)+1) mod m by NAT_D:22;
  thus f is one-to-one & f is onto & g is one-to-one & g is onto &
  g = f" & f = g" by  proof
end;

begin :: ShiftRows contradiction by C1

definition
  func ShiftRows ->
  Function of ;
  -4(8tuples_on BOOLEAN))means
  :efShiftRows
  for inputassume
  holds (for i k =((1) div m *m+k+1)mod m)  INT_1:59,C1
  ex xi be Element of 4-tuples_on (8-tuples_on BOOLEAN) st xi = input.i &
  (it.input).i = Op-Shift(xi,5-i));
  existence
  proof
    defpred P0[Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))] means
    for i be Nat st i in Seg 4 holds
    ex xi be Element of 4-tuples_on (8-tuples_on BOOLEAN) st xi = $1.i &
    $2.i = Op-Shift(xi,5-i);
A1: for x being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    ex z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st P0[x,z]
    proof
      let x be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      x in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      then
Q01:  ex s be Element of (4-tuples_on (8-tuples_on BOOLEAN))* st x = s &
lens ;
      P[,set 
      ex xk be Element of 4-tuples_on (8-tuples_on BOOLEAN) st xk = x.$1 &
      $2 = Op-Shift(xk,5-$1);
Q1:   for k be Nat st k in Seg 4
      ex zk being Element of (4-tuples_on (8-tuples_on BOOLEAN)) st P[k,zk]
      proof
        let k be Nat;
        assume k in Seg 4;
        then k in dom x by Q01,FINSEQ_1:def 3;
        then
Q11:    x.k in rng x by FUNCT_1:3;
        then x.k in 4-tuples_on (8-tuples_on BOOLEAN);
        then
Q13:    ex s be Element of (8-tuples_on BOOLEAN)* st x.k = s & len s = 4;
        then reconsider xk = x.k as Element of (8-tuples_on BOOLEAN)*;
        reconsider xk1 = xk as Element of 4-tuples_on (8-tuples_on BOOLEAN)
        by Q11;
        reconsider zk = Op-Shift(xk,5-k) as
        FinSequence of (8-tuples_on BOOLEAN);
Q15:    len zk = 4 by Q13,DESCIP_1:def 3;
        reconsider zk as Element of (8-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
        zk in 4-tuples_on (8-tuples_on BOOLEAN) by Q15;
        then reconsider zk as Element of 4-tuples_on (8-tuples_on BOOLEAN);
        x beElement of4tuples_on (-tuples_on BOOLEAN) st = x.k &
          OpShift(xk1,5k;
        thesis;
      end;
 -tuples_on- BOOLEAN suchthat
Q2: (+)=(modm+ m NAT_D:java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
      holds P[i,z.i] from FINSEQ_1:sch 5(Q1);
Q3:   len z = 4 by Q2,FINSEQ_1:def 3;
      reconsider z as Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      by FINSEQ_1:  hence contradictionby P2,NAT_D:24,;
      z in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) by Q3;
      hence thesis by Q2;
    end;
    consider I be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) such that
A2: for x being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds P0[x,I.x] from FUNCT_2:sch 3(A1);
    take I;
    thus thesis by A2;
  end;
  uniqueness
  proof
    let H1,H2 be   for k,m be Nat st m   k1   = 0
    -tuples_on(-tuples_on (8tuples_on BOOLEAN))
    
A1:   then
    holds(forib Natstjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 43
  thus (k1 div m)(k  m)+1)m/m XCMPLX_1:,,P4P5
(H1input)i=Op-xi5i)
    assume
A2 forinput  Elementof 4-tuples_on(-tuples_on (-BOOLEAN)
    holds (for    holds o   61;
    ex xi be Element of 4-tuples_on (8-tuples_on BOOLEAN) st xi = input.i &
    (.input)i=OpShift(xi,-));
    letinput Element  -(4-tuples_on (-tuples_on BOOLEAN));
      H1.input intuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      .= (kdivm)1java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 be  of (4-tuples_on(-tuples_on)  H1java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 78
      len  X  java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 42
      H2end;
      then
P4:   ex s be Element of (4-tuples_on(st  eg m& in 
s=4;
      now let i be Nat;
        assume 1< i&i =len (H1.);
        
     Seg4by ;
        then
XX3:    java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 xi .  H1.  -Shiftx,5-i by A1;
XX4  F2 java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 42
        st xi = input.i & (      reconsider F2i .  java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 50
        thus end;
e;
      hence end;
    end;
    java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 32
  ;
end;

definition
funcjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 22
   x12345java.lang.StringIndexOutOfBoundsException: Range [33, 30) out of bounds for length 34
  4;
 :DefInvShiftRows
  for
 holds
  ex xi be b 

  existence

      LMGSEQ5
E  -tuples_on(-uples_on (- ) means
    for i beendjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
      let  empty set,
$i=Op-xi,-);
A1: for x being Element of 4-tuples_on x2^8Dby ,java.lang.StringIndexOutOfBoundsException: Range [56, 52) out of bounds for length 57
    ex z be Element of 4-tuples_on(4-tuples_on (8
    st P0[x,z]
   proof
      let x be x3 = (x.k).3 & x4 xk.4
       in-java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 58
      then
:exsbe of(-8-java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 72
       s=4;
      defpred P[Nat, Seg;
      ex xk be Element of 4    Seg;
      $2 = Op-  then reconsider  = .44as Element D;
:fork be Natstk  Seg 4
ex being  of 4-tuples_on 8tuples_on BOOLEAN)) st P[k,zk]
      proof
        let k be Nat;
        Seg4
        then k in dom x by Q01,FINSEQ_1:def 3;
        then
Q11:    x.k in rng x by FUNCT_1:3;
        then x.k in 4-tuples_on (8-tuples_on BOOLEAN);
        then
Q13:    ex s be Element of (8-tuples_on BOOLEAN)* st x.k = s & len s = 4;
        then reconsider xk = x.k as Element of (8-tuples_on BOOLEAN)*;
        reconsider xk1 = xk as Element of 4-tuples_on (8-tuples_on BOOLEAN)
        by Q11;
        reconsider zk = Op-Shift(xk,k-1) as
        FinSequence of (8-tuples_on BOOLEAN);
Q15:    len zk = 4 by Q13,DESCIP_1:def 3;
        reconsider zk as Element of (8-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
        zk in 4-tuples_on (8-tuples_on BOOLEAN) by Q15;
        then reconsider zk as Element of 4-tuples_on (8-tuples_on BOOLEAN);
        java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
zk -xk1,-1;
        hence thesis;
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 10
zbe   4tuples_on 8tuples_on   
Q2:   dom z = Seg 4 & for i be Nat st  
      P[i,z.i] from FINSEQ_1:sch 5(Q1);
Q3:   len z = 4 by Q2,FINSEQ_1:def 3;
      reconsider z as Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      by FINSEQ_1:def 11;
      z in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) by Q3;
      hence thesis by Q2;
    end;
    consider I be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) such that
A2: for x being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    holds P0[x,I.x] from FUNCT_2:sch 3(A1);
    take I;
    thus thesis by A2;
  end;
  uniqueness
  proof
    let H1,H2 be Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    -(-tuples_on (-tuples_on )
    assume
A1: for input be Element of 4-java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 4
    holds (for i be Nat st i   holds (it.input).i).j = mid (input,1+(i-'1)*8+(j-'1)*32,
    exdefpred P0[ of128tuples_on , 
(H1.input)i =Opjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 37
    assume
 Element of4-uples_on4tuples_on(-))
    holds (for i be Nat st i in Seg 4 holds
    ex xi be Element of 4-tuples_on (8-tuples_on BOOLEAN) st xi = input.i &
    (H2.input).i = Op-Shift(xi,i-1));
    now let input be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
      then
P3:   ex s be 
      len s = 4;
      H2.input      & <  :1
      then
P4:   ex s be Element of (4-tuples_on(8-          then j'1 = 41by Q130,XREAL_1:;
      lens= 4;

        assume 1 <= i & i <= len java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 14
        then
XX2:    ijava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
XX3:    exi Nat st holds [()
        (H1.input).i = Op-Shift(xi,i-1) by A1;
XX4:    ex xi be Element of 4-tuples_on (8-tuples_on BOOLEAN) st xi = input.i &
        def 11;
        thus (H1.input)  java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 26
      end;
            Seg4   ininSeg 4java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    ;
    hence H1 = H2 by FUNCT_2:63;
  end;
end;

      hence ex z beElement of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  for (8-tuples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  holds InvShiftRows.ShiftRows.input) = input
proof
  let input     now let injava.lang.StringIndexOutOfBoundsException: Range [31, 28) out of bounds for length 54
  InvShiftRows.(ShiftRows.input) in
  4-tuples_on(4(8tuples_on OOLEAN));
  then
P3: ex s be Element of (4-tuples_on(8-tuples_on       byA2;
  st InvShiftRows.S.input = s &len s =4;
  input in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  then
P4:exs be Element of (4-tuples_on(8-tuples_on BOOLEAN))*
  st input = s & len s = 4;
  now let i be Nat;
    assume 1 <= i '1)*32+7);
   
XX2: i in Seg 4 by P3;
then xibe  of 4-tuples_on-tuples_on BOOLEAN)such that
XX3java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    xi in       then
    then
YY1: ex s be Element of         1<=i < len (H1.input);
    iin Seg 4byP3;
XX4: yi = (ShiftRows.        then (H1.input).i(H1input3;
    
    by DefInvShiftRows,XX2;
    thus (InvShiftRowsjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 40
byXX3X,java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 30
      .= java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  end
hence ((java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 70
end


  for output be Element of 4-tuples_on(4-tuples_on (henceH1ij  .j  P14
  holds ShiftRows.(InvShiftRows      end
proof
  let output henceH1 = H2 by FUNCT_263;
  
  4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  then
P3: ex s be Element of (4-tuples_on(8-tuples_on BOOLEAN))*
  st ShiftRows.(InvShiftRows.output) = s & len s = 4;
  output in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  then
P4: ex s be Element of (4-tuples_on(8-tuples_on BOOLEAN))*
  st output = s & len s = 4;
  now let i be Nat;
    assume 1 <= i & i <= len (ShiftRows.(InvShiftRows.output));
    then
: i  Seg   P3
    then consider xi be java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 5
    such that
XX3:xi = output.i &
    (InvShiftRows.outputjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
          m   NAT_1:14;
    then
YY1: ex s java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 14
 Elementof4-tuples_on 8tuples_on BOOLEAN)such that
XX4: yi = (InvShiftRows.output).i &
    (ShiftRows.(InvShiftRows.output)=32*j-1)8(i-')) by 233
    thus (ShiftRows.(InvShiftRows.output)).i = Op-Shift(xi,i-1+(5-    ex i,j Natst iin 
byXX4DESCIP_110,
.= outputjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 41
  end;
  hence (ShiftRows.    m <> 
;

theorem
  ShiftRows java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 8
  java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 53
   -=byjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 39
  by INV00,INV04,INV05;

java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 20

definition
  java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 16
 java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 63
  4-tuples_on1+i-1j1*+ =+-)8(-1)327byXREAL_1:;
  4-tuples_on(4-tuples_on (8-tuples_on        i, be  stinSeg  & j   
  DefAddRoundKey:
  for text,key of4tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  holds for i,j be Nat st i java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 8
XX0: =tbyNAT_1:;
  java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 46
  ((it.(      proof
  existence
proof
           k< +*i'1+*j-')7by B20;
    of4tuples_on(- (-)
    Element of 4-tuples_on( endjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
    for i,j be Nat st i in Seg 4 &    =java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 30
holds textij,keyij    8tuples_onBOOLEAN
st textij =(1i&keyij = ($.)j&($3i.j =Op(textij,keyij)
A1: for text,key
Elementoftuples_on4tuples_on( BOOLEANjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
     z Element 4tuples_on(tuples_on (8-tuples_on BOOLEAN)
    ,keyz]
    java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 8
      let:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
         -uples_on(- (-java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 67
extin4tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      then+i0-1* =8  :6;
Q01:  ex s be Element      RELSET_1 ,FUNCT_2,BINOP_1NUMBERS      then
      st text = s & lenFINSEQ_6, ESCIP_1;
      key -4tuples_on 8-tuples_on ));
      then
 exsbe Element of (4-tuples_on (8-tuples_on BOOLEAN))*
      st key = s & equalities, FINSEQ_2
efpredP[s 
zk java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 61
st2    forkbe st  >0&k mod<0
s Nat 
       =(text$)  1.java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
=,)
Q1:  for thuscontradiction ,,:,
Element of(- henceA }

        let k be Nat;
        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    kinSeg 4;
        then k in dom text by Q01,FINSEQ_1:def 3;
thenby  :C;
k4java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 57
        then
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 28
        st text.k = s & x B by XBOOLE_0 ,
        reconsider  kas  8tuples_on
        k in dom(key) by Q02,FINSEQ_1:def 3,Q11;
        then key.k in rng key by FUNCT_1:3;
        then key.k in         xas Nat by A16;
        then
Q16     ss Element  of( Element f(-tuples_on )*
        stlet, be Nat;
C1 m
        defpred Pi[, 
         of 8')32+  :8java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        textij = (textk).$1 & keyij = (keyk).$1 & $2 = Op-XOR(textij,keyij);
 for in4  beingof(java.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 79


           jbeNat;
          assume
:in ;
          then j in
t()   t)FUNCT_1:java.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53
          then reconsider textkj = (textk).j as Element of 8-tuples_on BOOLEAN;
          j in dom(keyk) by Q16,FINSEQ_1:def 3,Q19;
          then (keyk).j in rng (keyk) by FUNCT_1:3;
          then reconsider keykj = (key.k).j as Element of 8-tuples_on BOOLEAN;
          Op-XOR(textkjkeykj)  -OR(,java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
;
        end;
          for k,i,j ,,i0 be Nat1< k &k = 128 i Seg4 &j Seg 4 java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
Q22:   =(-)+*+  +i-*+')<  java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        holds Pi[j,zk.j ij  ;
Q23:    len zk = 4 by Q22,FINSEQ_1:def 3;
        reconsider zk as Element of (8-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
        zk in 4-tuples_on (8-tuples_on BOOLEAN) by Q23;
thenreconsider zk as Element of 4-tuples_on (8-tuples_on BOOLEAN);
        for j be Nat st j in Seg 4
        holds ex textij,keyij be Element of 1*8+(0-'1)327;
        st textij = (textk).j & keyij = (keyk).j & zk.j = Op-XOR(textij,keyij)
        by Q22;
        hence thesis;
      end;
      consider z be FinSequencethen
:=      st
      holds  \{nwheren   :-1)8(-'1)*32 <= n &
 njava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 56
 nNat1(')*(-'1* =&
FINSEQ_11;
z4(tjava.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 64
      then reconsider z as
      Element of 4-java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
      take z;
      for i,j be Nat     ,2  objectjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
extextij,keyij Elementof- BOOLEAN textij java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
      (text.i).j &  Fx- Element ofmid(1('1)*('),+i')+j'))is
      proof
        leti, be
        
Q4:     i in Seg 4 & j   redefine func F.(x,y) -java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 52
 beof4 - java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 68
 z.i = zi & for j be Nat st j in Seg 4=k-((i-'1)*8+(j-'F1java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 52
h  textij,keyij         holds ex textij,keyij be8(-'1*32  java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 78
 keyij ()j&
        zithen
              A4,XREAL_19
        =text..j   key.&
        i.j= OpXORtextij,eyij) by Q4;
      end;
      hencethen  =.  Element *
    java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 35
    IFunction[--tuples_on (8-tuples_on BOOLEAN)),
    4-tuples_on(4-tuples_on      nowj bejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    4Q112 (i-'1* =* by64
A2: for x,y beingt1-<j1 java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 35
:schA)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
   java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    byA2;
  end;
       (')8j')327=+  java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 51
    i=F2.  P6,6FINSEQ_1:14;
    letend;
   -tuples_on(4-tuples_ontearrayA4Ajava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    4-tuples_on(4-tuples_on 4 by 7;
    assume
A1:;
    holds for,bein4   Seg
extij,keyijbe Element of  hence thesis by ,,FINSEQ_1def 18;
    st textij = (textjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
key)i)=textijeyij;
    assume
:forjava.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 5
    holds for i,j be Nat st i in Seg 4 & j in Seg 4
    holds ex ,keyij  roof
    st =<     assume  y -(-java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 63
    ((F2.(text,key)).java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 13
    now lettext,key be
    Elementof4-java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 62
      now let i,j be Nat;
        assume
A3    ex i,  Nat zij be Element of8java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
        then
A4:     ex textij,keyij be Element of 8-tuples_on BOOLEAN
st textij =(ext.i)j  keyij =(keyi). 
        ((F1.(text,key)).i).j = Op-XOR(textij,java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 29

        st   reconsider x123 = <*x1x2x3x,* Element  5- java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        (   c ;
        thus (end
      end;
        4-java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 40
    end;
    hence F1 = F2 by BINOP_1:2;
  end;
end;

begin :: Key Expansion

definition
  let iinSeg4 & jin Seg4& +i'(-'* = k &
  let x be Element of 4-tuples_on (8-tuples_on BOOLEAN);
  func SubWord(SBT,x) -> Element of 4-tuples_on (8-tuples_on BOOLEAN) means
  for i be Element of Seg 4 holds it.i = SBT.(x.i);
  existence
  proof
    defpred P[Nat,set] means ex xi be Element of 8tuples_on BOOLEAN
    st xi = x.$1 & $2 = SBT.(xi);
P1: for k be Nat st k in Seg 4 ex z being Element of 8-tuples_on BOOLEAN
    stP[,z
    proof
       k beNatjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      assume
ASk in  4;
      x in 4-  x.k in rng xby :3;
      thenjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
      14
      A50:  1+(i')8+j-')32(i')(j')32 =k(i'1*8(-'1*32
      then reconsider xk      by ,   Seg;
      SBT.(   xk. inrngxkF:
       thesis;
    end;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
P3: dom p = Seg 4 & for k  . inrngxkby  nt of BOOLEAN;
                4java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
     Element such that
    len   P3,    len p = 4 by P3,FINSEQ_1stiin  128
    thenpin- 8tuples_on BOOLEAN
t  java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 70
tpjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    now let i be Element of   holds f is one-to-one & f is onto & g is P2:fori,j be Nat  iin4& Seg
xi ofjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 74
      by P3;
      hence p.i = SBT zi.j in (8-tuples_on BOOLEAN);
    end;
    hence thesis;

  uniqueness
  proof
    let H1,H2 be Element of 4-tuples_on (8-tuples_on BOOLEAN);
    assume
A1: for i be Element of Seg 4 holds H1.i = SBT.(java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 35
  end;
2for tjava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
    H1 in 4-tuples_on (8-tuples_on BOOLEAN);
    then
P1: ex s be Q134: 1+((i-'1)*8+(j)*32) < +120XREAL_1:7
    in- 8 BOOLEAN;
then
P2  sbeElementof8tuples_onBOOLEAN*stH2s&lens =;
    now let i be Nat;
      assume 1 <= i & i <= len H1;
      then i in Seg 4 by P1;
      then reconsider j = i as Element of Seg 4;
      thus H1.i = (SBT).(x.j) by A1
        .= H2.i by A2;
    end;
    hence H1 = H2 by P1,P2,FINSEQ_1:14;
  end;
end;

definition
  let x be Element of 4-tuples_on (8-tuples_on BOOLEAN);
  func RotWord(x) -> Element of 4-tuples_on (8-tuples_on BOOLEAN) equals
  Op-LeftShift(x);
  correctness by DESCIP_1:6;
end;

definition
  letzi0j0  Element of(BOOLEAN) 
letstbeElement tuples_ontuples_on )
  func Opk<(-1*8(j0')*7&   -(-)*8+j0-1*32)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  for i be Element of Seg m holds it.i = Op-XOR(s.i,t.i);
  existence
  proof
   defpred P[at,et means
    ex si,ti be Element          AA1,F1,F3,,F5,A6,FINSEQ_6:22;
    $2 = Op-XOR(si,ti);
P1: for k be Nat st k in Seg m ex z being java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 46
    st P[k,z]
        AESStatearrayx) 4-(4-  BOOLEAN);
      let k be Nat;
      assume
:mjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
sjava.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 45
      then exP6:   i in  4 by ;
       k in dom s by FINSEQ_1:def 3,AS;
      then s.k in rng s by FUNCT_1:3;
      then reconsider sk = s.k as Element of n-tuples_on BOOLEAN;
      t in m-tuples_on (n-tuples_on BOOLEAN);
      then ex v be Element of (n-tuples_on BOOLEAN)* st t = v & len v = m;
      then k in dom t by FINSEQ_1:def 3,AS;
      then t.k in rng t by FUNCT_1:3;
      then reconsider tk = t.k as Element of n-tuples_on BOOLEAN;
      Op-XOR(sk,tk) is Element of n-tuples_on BOOLEAN;
      hence thesis;
    end;
    consider p being FinSequence of n-tuples_on BOOLEAN such that
P3: dom p = Seg m & for k be Nat st k in Seg m holds P[k,p.k]
    from FINSEQ_1:sch 5(P1);
P4: len p = m by P3,FINSEQ_1:def 3;
    p in (n-tuples_on BOOLEAN)* by FINSEQ_1:def 11;
    then p in m-tuples_on (n-tuples_on BOOLEAN) by P4;
    then reconsider p as Element of m-tuples_on (n-java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 47
    take p;
    now let i be Element of Seg m;
      ex si,ti be Element of n-tuples_on BOOLEAN st si = s.i & ti = t.i &
      p.  -(,i  java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
      hence p.i = Op-XOR(s.i,t.i);
    end;
    hence thesis;
  end;
  uniqueness
  proof
    let H1,H2 be Element      then
    assume
 foribe ElementSeg  . =OpXORs,t.)
    
A2:for  beElementof Seg holds H2.= -XOR(s.i,t.i);
    H1 in m-tuples_on (n-tuples_on BOOLEAN);
    then
P1: ex v be Element of (n-tuples_on BOOLEAN)* st H1 = v & len v = m;
    H2 in m-tuples_on (n-tuples_on BOOLEAN);
    then
P2: ex v be Element of (n-tuples_on BOOLEAN)* st H2 = v & len v = m;
    now let i be Nat;
      assume 1 <= i & i <= len H1;
      then i in Seg m by P1;
      then reconsider j = i as Element of Seg m;
      thus H1.i = Op-XOR(s.j,t.j) by A1
        .= H2.i by A2;
    end;
    hence H1 = H2 by P1,P2,FINSEQ_1:14;
;


definition
  func Rcon -> Element of 10-tuples_on (4-tuples_on (8-tuples_on BOOLEAN))
  means
  it.1 = <* <*0,0,0,0*>^<*0,0,0,1*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
  it.2 = <* <*0,0,0,0*>^<*0,0,1,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
  it.3 = <* <*0,0,0,0*>^<*0,1,0,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,    end
  it.4 = <* <*0,0,0,0*>^<*1,0,0,0*>,<*0,0,0,0*>^<*0,0,0,  end;
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
  it.  cluster AES-Statearray- bijective;
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
  it.6 = <* <*0,0,1,0*>^<*0,0,0,0*>,<*
<,,,*^,0*,*,,,*>^*,,,0*>* &
  it.7 = <* <*0,Statearray(A
0*><0,,,0><*0,,,*>^*0,,0,0* > &
  it.8 = <* <*1,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0  set f=AES-Statearray;;
  it.9 = <* <*0,0,0,1*>^<*1,0,1,1*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0*><*,0,0,0*>,<*,000>^*0,,0,*> * &
,1,>,<0000>,,,*java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
    <*0,0,0,0*>^<*0,0,0,0*L:(")f = id (-tuples_onBOOLEAN  f*f" =
existence
  proof
X0: 0 in BOOLEAN by TARSKI:def 2,MARGREL1:def 11;
X1: 1 in BOOLEAN by TARSKI:def 2,MARGREL1:def 11  hence thesis by FUNCT_2:;
P1:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
P2: <*0,0,0,1*> is Element of (4-tuples_onreserve SBT for Permutation of (8-tuples_on BOOLEAN);
P3: <*0,0,1,0*> is Element of (4-tuples_on BOOLEAN) by LMGSEQ4,X0,X1;
P4: <*0,1,0,0*> is  func SubBytes(SBT ->
P5: <*1,0,0,0  Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
R14 4tuples_on(-tuples_on (8-tuples_on BOOLEAN)) means
R2: <*0,0,1,1*> is java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 15
R3: <*0,1,1,0*> is Element of (4-tuples_on BOOLEAN) by LMGSEQ4,X0,X1;
    reconsider PP6 = <* <*0,0,0,0*>^<*0,0,0,1*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> as
Elementof-(-tuples_onBOOLEAN)by P1,2LMGSEQ16;
  **,,0*>^*,,,*,<000,0*^<0,,00>
    *,,,0*^*000*,<0,00><*0000>* as
   Elementof -tuples_on (8tuples_on BOOLEAN) by P1,P3,LMGSEQ16;
    reconsider PP8 = <* <  existence
    <*0,0,0,0*>^<*0    defpredP0Element 4tuples_on(-tuples_on (8-tuples_on BOOLEAN)),
    Element of4tuples_on (8-tuples_on BOOLEAN) by P1,P4,LMGSEQ16;
    reconsider PP9 = <* <*0,0,0,0*>^<*1,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    inputij = ($.)j &($2i.j = SBT(inputij)
    Element of 4-    ex z be Elementof -tuples_on(-tuples_on(8tuples_onBOOLEAN)
    reconsider PP10 = <* <*0,0java.lang.StringIndexOutOfBoundsException: Range [30, 9) out of bounds for length 9
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> as
    Element of 4-tuples_on (8-tuples_on Q01:  ex s be Element of (4-tuples_on (8-tuples_onjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
       reconsider PP11 = <* *0010*^<00,,*,*0,0,<0,,0,0*,      ex zk be of(4-tuples_on (-tuples_on )
    *0,,,0><0000*,<*,,,*>^*0,,0,*>* java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
Element  4- (8-tuples_onBOOLEAN)P3,;
reconsider   **,100^0,,*,*,,*>^00,,*java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    <begin :: State array
Element of 4tuples_on (8-tuples_on BOOLEAN
   PP13  *<        (- (java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 63
    <*,ist      java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 43
    Element of4-tuples_on (8-tuples_on BOOLEAN) by P1,P5,LMGSEQ16;
    reconsider PP14 = <* <*0,0,0,1*>^<*1,0,1,1        java.lang.StringIndexOutOfBoundsException: Range [59, 11) out of bounds for length 69
    <*(zi.  ((i-'1)then. rng by FUNCT_1:3;
    ElementA1:forx  Element of128tuples_on BOOLEAN
     Q13:exsbe Element 8uples_on BOOLEAN)  text = &len s =4;
<000>^*0,,0,*<00,*^*,,0, *a
    Element of 4-tuples_on (8-tuples_on java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 33
    reconsider Q0       java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 30
    holds zi.  mid (11')8        proof
    reconsider IT = Q0^Q1:for kbe j in 4;
java.lang.StringIndexOutOfBoundsException: Range [14, 11) out of bounds for length 76
 = P6&Q0  PP7&Q0.= PP8&Q0 =PP9 &then(.j in rng ()byFUNCT_1:;
    Q0.5 =           thenreconsider textkj =textk)jas  of 8-;
A2:len =5&.  PP11& Q1.2 =         then
    Q1.5 = PP15 by FINSEQ_4:78;
    1 in Seg 5;
    then 1 in dom Q0 by FINSEQ_1:def 3,A1;
    then
R1: IT.1 = PP6 by A1,        then k-'1 <= 4-1 by Q:;
     Seg ;
then  Q22    dom =Seg4&j Nat st inSeg java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
            
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
    3 in           '*(132=+96 Q112,:7
    hen3 indom Q0 by FINSEQ_1def 3,;
    thenQ136:(1        forjbeNat j in Seg4 
R3: IT3=P8 by A1,INSEQ_1:def 7;
    4 in Seg 5;
    then  then
    then
R4:IT   by A1,FINSEQ_1:def 7;
     Seg 5
    then 5            mid (1+')8(j'*,
    then
5 IT.PP10byA1d 7;
     Seg ;
    then 1 in Q2   dom z = Segz =  &for  beNat  i in Seg4
    then
) =Q1.1by Q3:   len z = 4 by Q2,FINSEQ_1:def
. java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
    2       by FINSEQ_1:ef11;
    then 2 in dom Q1 by FINSEQ_1:def 3,A2;
        thesis
R20: IT.(5+2) = Q1.2 by A1:    4&fori be Nat st i in  4
      .= PP12;
    3 in Seg 5;
    then 3 in dom Q1 by FINSEQ_1:def 3,         - 8-java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 55
    then
R30: IT.(5+ consid  beFinSequenceof 4-(-  that
      .= PP13        ,:;
    4 in Seg 5;
    then 4 in dom Q1  for j be Nat st j in Seg 4 holds

:.(54) =Q14by :ef7
P;
    5 in Seg 5;
    then 5 in dom Q1 by FINSEQ_1:def     assume
    then
R50: IT.(5+5) = Q1.5 by A1,FINSEQ_1:def 7
      .= PP15;
    thus thesis by R1,R2,R3,R4,R5,R10,R20,R30,R40,R50;
  end;
  uniqueness
  proof
    let R1,R2 be Element of 10-tuples_on (4-tuples_on (8-tuples_on BOOLEAN));
    assume
A1: R1.1 = <* <*0,0,0,0*>^<*0,0,0,1*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
    R1.2 = <* <*0,0,0,0*>^<*0,0,1,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
    R1.3 = <* <*0,0,0,0*>^<*0,1,0,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
    R1.4 = <* <*0,0,0,0*>^<*1,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
    R1.5 = <* <*0,0,0,1*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    *,0,*>^<0,,,0>,<*0,0,0,>^<*0,,0>* &
       in4tuples_on4 (-java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 63
    <*0,0,0,0*>^<*0,0,0,0*>      
    R1.7 = <* <*0,1,0,0*>^<*0,0,0,0*>,<
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
    by,P12   ;
    <*0,0,0,0*>^<java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    R1.9 = <* <*0,0,0,1*>^<*1,0,1,1*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
    R1.10 = <* <*0,0,1,1*>^<*0,1,1,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *>;
    assume
A2: R2.1 = <* <*0,0,0,0*>^<*0,0,0,1*>,<*0,0,0,0*>^<*0          set j = mj mjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0=*-+8(1+ ,
    R2.2 = <* <*0,0,0,0*>^<*0,0,1,0*>,<*0,0,0,0*>^<*0,0,0,0*>,
<0000><0000><00,0,0*^*,,0> *> &
R2 = <* <0,0,,*^*,,,*,<000,0><000,
    <*0,0,0  = 32 by1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    R2.4 = <* <*0,0,0,0*>^<*1,0,0,0      1< +nbyXX0,XREAL_1:7;
<*,,,0>^<*0,0,0*><0,,*><0000>&
    R2A15 +1  by13java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
    <*A19:j-'  -1 by:,java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 39
    .reconsiders=div  Nat
    <*0,0,0,0*>^<*0,. in texttext by:;
R2.  *<*,,,*>^*0,,,*>,<*00,>*,0,0*,
,,0><0000*,*,,,*^*000>*java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
    R2.8 = <* <*1         800  java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 43
    <*0,0,0,A:i1=i1:,;
            8i')81byA29;
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>      +(i')*8+(j-'*+ =1(i')*8+j')32+ by :7;
    .=< <0,,1**,,1,*,<*0,,,0><*0,00>java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0 by ,A20,;
     10tuples_on (4-tuples_on (8-tuples_on BOOLEAN));
    then
XP1: ex v be Element of (4-tuples_on      >4
    len v = 10;
    R2 in 10-tuples_on (4-tuples_on (8-tuples_on BOOLEAN));
    
XP2: ex v be Element of (4-tuples_on;
    len v = 10;
    for i be Nat   +;
    proof
      letB220 *j')8*i')1 <-)*')tby XREAL_17java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
      java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 34
      then i = 1 or ... or ibyA15
      hence thesis by A1,A2;
;
    hence R1 = R2 by XP1,XP2,FINSEQ_1:14;
  
end;

definition
  let SBT;
  mibe  Element(tjava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 70
assume AS:(  4 m= 6 orm= 8)  i < *(7+) &  = ;
func KeyExTempSBT,i,w) - Element of(4-tuples_on (8-tuples_on BOOLEAN))
  means
  (ex be Elementofjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 79
 =SBTw)T3)if ((i mod 0)
(it= SubWord(w) if m  & (  8 =4 otherwise it = w;
  existence
  proof
thus i m = implies exA
     Element 4(-java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 56
         (.nput).i=s&len s = 4;
    st T3 = Rcon.(i/m) & A = Op-WXOR(SubWord(SBT,RotWord(w)),T3))
    proof
      assume
A1:   (i mod m) = 0;
      m <> 0 & m divides i by A1,INT_1:62,AS;
      then
LTT0: i/m is Integer by WSIERP_1:17;
LTT1: (4*(7+m))/m = (28/m)+4 by AS;
LTT2: m/m <= i/m by AS,XREAL_1:72;
LTT4: i/m in NAT by INT_1:3,LTT0;
LTT5: i/m < 28/m+4 by AS,XREAL_1:74,LTT1;
      i/m <= 10
      proof
        nowreconsiderH2i  (.input)i 
          case m = 4t
            then i/m <10+1 by AS,XREAL_1:74,LTT1;
            hence thesis by NAT_1:13,LTT4;
;
casem = ;
            
end
          case m = 8;
            hence thesis by LTT5,XXREAL_0:2;
          end;
end
        hencethesis;
      end;
      then
Q0:   i/m in Seg 10 by AS,LTT2,LTT4;
      reconsider j = i/m as Nat by LTT4;
      Rcon in 10-tuples_on (4-tuples_on (8-tuples_on BOOLEAN));
        beof(-8)*
      st Rcon = v & len v   k  32<)   A1NAT_2
then dom=Seg 10 by FINSEQ_1 3;
ajava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 24
reconsider=Rcon.java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
      Element of (4-     =32(-1)8*(1 :java.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
      Op-WXOR(SubWord(SBT,RotWord(w)),T3) is
      Element of (4-tuples_on (8-tuples_on BOOLEAN));
      hence java.lang.StringIndexOutOfBoundsException: Range [53, 14) out of bounds for length 53
    endconsider zk be FinSequence of (8-tuples_on BOOLEAN) such that
    thus m = 8 & (i mod 8) = 4 implies ex A being
    Element of (4-tuples_on (8-tuples_on BOOLEAN)) st (A = SubWord(SBT,w));
thus not (im)=0)&notm  i  8)=4 
 of4tuples_on 8  exi Natst  Seg   in   
  end;
  uniqueness;
   reconsiderzk as Element of (tuples_on )bydef11



  let SBT;
  : s
  assume AS:             ex textij *0by:,A;
  func java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 16
tuples_on-java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 23
47m) (-(-tuples_onBOOLEAN
        (-18(-1*<k& k <1(-1*8(j-1*+java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
    
  & (for i be        ;
  ex P be Element of (4-tuples_on (8-tuples_on BOOLEAN)),
  Q be Element         hence contradiction;
  st P = (it.Key)java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  itKey).(eg  by,B16

  proof
    consider  Function  tuples_on(-uples_on(-BOOLEAN)
   of(*m)tuples_on 4java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 77
    (for:forxbeing        jbe Nat iinjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 54
    (oribeElement of NAT st m <= i & i < 4*(7+m) holds
    ex P    ;
    Q be Element of 4-tuples_on (8-tuples_on BOOLEAN)
    st P = $2
    $2.(i+1) = Op-WXOR(P,KeyExTemp(SBT,m,i,Q)));
A1: for x being Element of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    ex be  of (4*(7m)-tuples_on (4-tuples_on (8-tuples_on BOOLEAN))
    st P0[x,z]
    proof
letElement  -( 8tuples_onBOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
      ] means
exrt m-(- (-tuples_onBOOLEAN)
      st     assumeassume  let i,i0,0 be Nat;
      (ex P0,A1:  text be of  in  4 (   =j0;
.1  Q0  r.  t. =     fori best4  Seg4holds
fori Natst  <  &i<  
ex be Element  4tuples_on -,
(tuples_on java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
        =r(i+)& Q=t.
      t.(i+1) = Op-WXOR(P,KeyExTemp(SBT,m,m*$      - java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 72
      0+m=7+  XREAL_16java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
      then
LMMLT47M: 1*m <=  then
      reconsider N2 = (4*(7+m) div m )+1 as Nat;
YY1:  for k being Nat st 1 <= k & k < N2
      for s F2.text..  (SBT".textij)by A3,2java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
      ex      hence F1.=F2text  LM01;
      st PP[k,s,y]
      proof
        java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 4
        1 =k &k <N2;
        let s be Element of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
        defpred PX[Nat,set,set] means
            .= (id8-BOOLEAN). 61
        st P = s.($1+1) & Q = $2 &
        java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 4
        s in m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
        then ex v be Element   letinput Element tuples_on ;
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 29
        
       egm byFINSEQ_1:f3java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
XX1:    for
  of4 (- java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
st[,w
        proof
          let i be Nat;
          assume
      1<   i<m;
    (InvSubBytesSBT).(ubBytes(BT)input).. =".java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
          considerbe of8tuples_on java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 39
          then i+1 in Seg m;
          then s.(i+1) in rng s by QQ3,FUNCT_1:A17     =  1(')8(-'1)*2 <   =+i0-')8+j0--1)*2InvSubBytes).(ubBytes()).).i.  inputi).java.lang.StringIndexOutOfBoundsException: Range [73, 74) out of bounds for length 73
    then reconsider P=.i1)
Element of endjava.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
          reconsider Q = z as Element of 4-tuples_on (8-java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 0
          Op-R4: i0-'1 <= 3 by XREAL_1:233,B2;
          Element of (4-tuples_on  suppose
          
        java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
1in         1 in dom   hus \ ={
thens.in  sbyFUNCT_13java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
consider   s. 
        Element of 4-A13:  8+(i-'1)*8+(j-'1)*32 <'1)*  XXREAL_02
        m in dom s by AS,QQ3;
        then s.m in rng s by FUNCT_1:3;
      reconsider Q0 =.m 
        Element of 4-tuples_on (8      proof
        a< {;
A150     A \Bthus (((SubBytes(SBT.((InvSubBytes((SBT).input)i.j =(.ii.java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
 y;
        such that
:y=m&(1 =    0  xbe that
    PXy.yi1]from  XX1)
        y in (4  fis    one   
theninmtuples_on4java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        thesisAS,2;
endjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
      4-tuples_on-(-java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 54
FinSequenceforinputbeElementoftuples_on(-tuples_on (8-tuples_on BOOLEAN)
A2:   len z = N2 & (z.1 = x or java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  ,.,.(+)  RECDEF_1:4 Y)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
 proof
      ex i,j be Element of java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 10
bef-32  1 &1=+i1+(-)32
st ($ m)<  i  $1m+java.lang.StringIndexOutOfBoundsException: Range [17, 3) out of bounds for length 76
      (($1 mod m) = 0 implies i = ($1  reconsider  Nat byA16;
:  ;
ex wbeingof(java.lang.StringIndexOutOfBoundsException: Range [42, 40) out of bounds for length 74
      proof
        let k be Nat;


 =k &k  *  :;
        A16    x = k1 (')8(-1* =k1  k1 <=8+i')8(-1
QQ2:    k div        consider k2beNat such that
esjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
        suppose
C1:       (k mod m) <> 0;
          reconsider j = (k modi0   1(0'*(-1) =k k<1i-*+(-132         java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 75
reconsideri  =kdiv)1as Element NAT
          1 <= i &A2       '+=1  :;
theni in  N2;
t i in domz
          then z.i in rng z by FUNCT_1:3;
          then reconsider zi = z 
Element m- 8BOOLEAN;
          zi in m-tuples_on(4-thus+-)8(-*  { LMStat2AAS;
 beElement of(- (8-java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 70
          ziiA\XBOOLE_0d 1java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
          
 byINSEQ_1:;
        < &j        reconsiderxk = kasElement  (-BOOLEAN
           j java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
t zijin          java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 43
then reconsider x asby A16
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 10
          (  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
          ((k mod(-  ;
          w = zi
hence java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        end;

 (k mod m)=0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
     reconsider j = m as
          reconsider i =(A1 dom    &or  i be Nat sti in 4
 1 <=i by :24QQ1C2,:13,S
47 div m1byQQ2REAL_1:;
            assume java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 31
theniin java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 21
ituples_on(-ples_on-tuples_on BOOLEAN) y Q3;
henreconsider =z.i as
Element of -tuples_ontuples_on(-java.lang.StringIndexOutOfBoundsException: Range [57, 57) out of bounds for length 8
          zi  { 4 jin  4 &1i-1*+j132<= java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 59
          then ex v be Element of (4-tuples_on A2:for  being  java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
          st zi =v lenv  m;
thenreconsiderA2ij=(AES-java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 60
Q0:         (AES-Statea)x1=(  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
          j in Seg m by AS;
          A1: x1 in 128      then reconsider n=k(i')j'1* asElement NAT by INT_1:   assume
then reconsider w  zijas
     ( NatstF:   =(-+'*) java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 46
(kmodm)<  i =(  )1
          (k modm) = 0implies = (k div ) &j= m)& A2: for input be Element of 4-tuples_on(4-tuples_on (8-tuples_onjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 65
=ij ;
   xieElementjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 75
        end;          hen1=1       ,be  that
Q112i) =*by64java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
FinSequence of uples_on 8BOOLEAN)
      such that
YY3:dom    4(+))&for  be    
      holds Q0[k,u.k] from FINSEQ_1:sch 5(YY2);
      4*(7+m)(1*+j')32)       nput ,P4FINSEQ_1:14
      then
YY4:  len u = 4*       byF2P1,,5A6:
       (8-end;
))- (4-definition
      yYY42 byF1F250A,;
     reconsider 
      Element of (4*(7+m))-tuples_on (4-tuples_on (8-tuples_on BOOLEAN));
      +(1*,1(proof
:java.lang.StringIndexOutOfBoundsException: Range [26, 22) out of bounds for length 62
        existence
let   java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 7
        java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 21
        tAES isonto
   1 <java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 17
        <   =*7)LMMLT47M,:;
        then k+1 in java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 9

        zi beElement        assume -Shift(ii;
        that
LX34:   (((k+1) mod m) <> 0 implies i = ((k+1) div m then reconsider     Element  (4-tuples_on8java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 77
        j = (k+1) mod m) & (((k+1) mod m) = 0 implies
    i=(+1  m) &j = )&zi=zi&u1)=zijbyYY3;
        per cases;
      then
:(+1<0java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
C11:      (k+1) < m
          A50:1      =&k< 128 FINSEQ_11
            assume not (k+1) < m;
then( ,java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
 java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
          then (kthen.iin( BOOLEAN);
          hence u   proof
        end;
        
C2:       ((k+1) mod m) = 0;
          (k+1) = m
proof
                  x in 4-tuples_on(4-tuples_on (8-      then reconsider n = k-((i-'1)*8+(j-'1)Elementof by INT_1
,XXREAL_01;
,

henceu  .k1by ,,:49
        end;
      java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
      for k be Element of NAT st m <= k & k < 4*(7+m) holds
        Element of4-uples_on(8-uples_on BOOLEAN),
      Q be Element of 4-tuples_on (8-tuples_on BOOLEAN)
      st P = u.((k-m)+1) & Q = u.k & u.(k+1) = Op-WXOR(P,KeyExTemp(SBT,m,k,Q))

 beof

AS1:   m   k  4*7)
        then 1 <= k & k <= 4*(7+m) by XXREAL_0:2,AS;
in 4(+);
 ijbe NAT,
        zi be Element of m-tuples_on
such that
:(  < i  div)+    )&
(mod )=0mplies  kdivm)&j  )&zi=z. 
       u. zk=4y, 3
   < 1&k < *7m        
        then k 1     < byP21zki 4tuples_on (- )by java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
        then consider i1,j1 be Element of NAT,
        zi1 be ElementQ134: +(i-'1)*8(-'1)*32)< 1120by :7;
        such G1:   1+((i-'18(-1*)< len  byXXREAL_0:2,Q14;
 (+)mod -)+  1java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
 k) m &((+)= 0 impliesi (k+div     
         )
kas by,:,INT_1:;
    km1 m0 ojava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49
        k+1-m <= 4*(7+m)-0 by       [,.+i18j')32-1+(i-1*+j')+ G3,java.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 78
         1 <= km1 & km1 <= 4*(7+m) by NAT_1:;
        then km1 in Seg (4*(7+m));
 128F1:     1 <= 1+((i-'1)j'3)byNAT_1:
        i2 Element of--tuples_on (8tuples_onBOOLEAN))
        such that
LLX34:  ((km1 mod m) <> 0 implies i2 = (km1 div  holds (.i). = mid (,1+(i--')*8+(j'1)*32,    endeconsiderk = n+((i-'1)*+(j-'1*32 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
        ((km1 mod m)then   z byFINSEQ_1:def3B10;
zi2=z.i2 &.m1 = zi2.j2 by YY3;
        per cases;
        
C1:       (k
          reconsider i0 = k div m as        java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 7
 ) ((7)+byXREAL_1:8java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
          k    assume
&i0<N2y XXREAL_02ASNAT_2:
          then consider r,      4java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 75
Element -tuples_on(() 
        tz
          (ex P0,Q0 be Element         by ,,,;
stP0          the
          & for n be    - 4java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 75
          ex P be Elementthen1
          Q be Element of 4-tuples_on (' =4   let  Nat
          st       then
t(+)=   exElementof(--)*H1. = java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
          1 = j   then(ES-Q130:1=     <4 ,INSEQ_1;
          then consider P be Element of 4-tuples_on (8-tuples_on BOOLEAN),
) such that
C18:      P = r.(j+1) & Q =       then j-'1 <= 4-1 by Q130,XREAL_1 len s = 4java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
          t          i& =len(H1.input);
          perjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
         
NC1:        ((k+1) mod m) <> =  java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 29
NC16G2XX4  be n jbejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
,LX34,Cjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        k+mjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
LC12:       i2 = ((k+        (F1i1   . P3,,FINSEQ_1;
              .henceH1ij hence =H2 by FUNCT_263java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
       j2=LLX34C22X,,
 u.(k-m+1)= r.(j+1)
             . ;
C22:        k = i0end
thus   java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 12
Q be  4- (1(1*+j-)32< (-*-)*327F2:     1+(i-'1)*8+(j-'1)*32 <= 1+(i-'1)*8+(j-'1)*32+7 
            st P = u.((k-m)+1) & Q = u.k &
            u.(k+1) = A6k -(+-)+-*java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
            H1:     1 <= k,:;
          end;

MC1:                then
(f)f=128" java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
+1,,LX34
  now  i be Nat;
        thesis java.lang.StringIndexOutOfBoundsException: Range [29, 17) out of bounds for length 29
       i2 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  funcBT 
.
C19:        u.(e;
C22:        k = i0*m+j by AS,INT_1  java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
thus ex P be Element P3 x E of 4t(- inSeg
Qbeof-java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 61
            st P = u.((k-m)+1)      assu 1=i thus InvShiftRows.Sinput)i=-Shift(-i1)
u(+)  p-PKeyExTemp(SBT,,,)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
           19X34C16,C1,C21,22
         ;

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
C2:       (k mod m) =foroutput of4-java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 73
DD1:      ((4*(7+m)) div m)+0 < ((java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
          k div m <= (4*(7+m)) div m by AS1,NAT_2:24;
          then 1 <= i &   existence
           considerrt
 mtuples_on4--tuples_on BOOLEAN))
          ementof(uples_on-tuples_on java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 58
C16:      r = z      then z.i output in 4-tuples_on(4tuples_on 8tuples_on);
( 0be 4uples_on8tuples_on )
          st P0 = r.     bejava.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 69
          & for n be Nat st java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 9
ex bejava.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 8
           beof      stz.i = .i = s&len   ;    - 8java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 68
          P    (InvShiftRows..).  Op      2  for Nat stinegjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
+n,Q) byA2;
:     :exs Elementof(*stxi= s java.lang.StringIndexOutOfBoundsException: Range [57, 52) out of bounds for length 52
            .= 1 by NAT_D:14,AS;
C21:      u.(k      (-Statearray..)i=z. byP811java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 26
:java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 24
  (1  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
,;
C19:      u.(k-m+1) = r.1 by LLX34,XLMOD03,C22Xhence ShiftRows.java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 4
:  km*+   AS:java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            .= i*m by C2,LX34;
         exj in  ;
Qbe Element f - byI,NV04,
st  : 
  p,eyExTemp,,,java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 10
          by C19,LX34,C16,C21,C22;
        end;
     ;
nce P0xL2 f  java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 50
end
    consider IQ23:     =4 by ,  thenf "FUNCT_230;
    (4*(7+m))-tuples_on (         4tuples_on (8tuples_onbegin 
    that
A2        forjbeNat  jinSeg 4 holds
java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 45
take;
     thesisby;
  end;
  uniqueness
  proof
    let H1,H2 be Function of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),D:
    4*(      i.  .java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
    assumelet ij beNat;
AA1: for Key be Element of m-tuples_on(4-tuples_on      java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 69
     (or i be Element         s .i=zi&forjbeNat jin   holds
    & (for i be Element of NAT st m  let text, key
    ex P be Element of (4-tuples_on (8-tuples_on BOOLEAN)) st = text..  ..=(java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 62
     Element -java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 53
     (1.Key.  = (nput.i). &((t.).i).  .(inputij);
    (H1.Key).(i+1A2 xof4tjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 73
    assume
AA2: for Key be thusthesis ;
    holds     F1beFunction4-      be Element of 4-tuples_on(48uples_onjava.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 67
    & (for i be Element of 
    ex P be Element of (4-tuples_on (8-tuples_on BOOLEAN)),
Q    -uples_on 8-java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
    st P = (H2.Key).((i-m)+1) & Q = (H2.Key).i &
    (H2.Key).(i+1) =      java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 72
    now let input be
    Element of m-
      H1.nput) in(*( java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    defpred P0[ of -tuples_on(- (8-tuples_on BOOLEANBOOLEAN),
:exsbeElement of-tuples_on (- BOOLEAN        ((F2.text)i.  SBT(textij) by A3,;
 (.input   & len  = 47);
      reconsider H1i = (H1.input) as
      Element of (    inputij=(1i.j&(2i.j  (;
(.) 4(m)-4tuples_on(-)
      then
XX2:  ex s be Element of (     P0textjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
st(2.les_on(tuples_on 8tuples_on BOOLEAN))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
      reconsider H2i4(java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 61
      Element of (  4java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 72
      defpred PN      then
(<$ &$ Q01   Element (- tuples_onBOOLEAN)*
      st 1 <= k & k <= $  ((... ()ijava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
PN0  0;
PN1:  for i be Nat st      st text=s &len  =4;
      
        let i be Nat;
        
:    PNi]
        
A2:m <
        per      
        suppose
:=+java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
thusbeElementNATst<k&< + 
                  (-) text s&s= 4;
          proof
            let k be Element of NATuples_on       then
            java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
B1:         1 <= k & k <= i      Pset
            k-1 < k by XREAL_1:44;
            then
B2:      zkj  SBTt)
            reconsider k1 = k-1       ex zk being Element of (4-tu8tuples_on BOOLEAN) st [kz]
            thus (H1.input).k = input.(k1+1) by B2,AA1
              .=Q18:for  be Nat st j in Seg 4      holds keyijbe Element of 8-tuples_on BOOLEAN
          end;
        end;
        suppose m <> i+1;
thenjin tby ,java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
,XXREAL_0:1;
          i < i+      
          then
:i  4*(18:    jbeNat  4  8
java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 19
          (H1.input).k =           jNattext22     =   Nat j in Seg 4
         
letkjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 12
 textkj           in-8 java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
         < k=+;
            then reconsider k1henceex be    dom  ,
     perjava.lang.StringIndexOutOfBoundsException: Range [26, 21) out of bounds for length 10
A2forbeingElement of tuples_on(-consider I  f-tuples_on4-tuples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
  k1<;
thus(H1.input)k= input  
                .= (java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 51
            end;
            suppose
C15:          m <= k1;
              k-1<=i+1-1     , beNat sti        zkin- (tuples_on BOOLEAN)byQ23;
              then
:m< k1&k1<4(+m)by C11Z,XREAL_0:2,C15;
              then consider PP1 be
              Element of (4-tuples_on (8-tuples_on BOOLEAN)),
            java.lang.StringIndexOutOfBoundsException: Range [75, 20) out of bounds for length 75
 =H1.nput).(-)1)  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
              (H1.input).(k1+1) = Op  let  SBT;
              consider PP2 be ElementFunction of 4-tuples_on(A4     ex textij  of 8tuples_onjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
             be of4-tuples_on 8tuples_onBOOLEAN  (F2.))  S.textijby,;
C18:          PP2 = (H2.input).((k1-m)+1) & QQ2 = (H2.input for i,j be Nat st i in Seg 4 
              (H2.input).(k1+1) = Op    end;
              by AA2,C16;
C190:         k-1 <= i+1-1 by XREAL_1:9,C13;
              thus(SBT".(reconsiderz as Element of (4- 8-tuples_on BOOLEAN))*

C24X:         0 <= k1-m by C15,XREAL_1:48 beNat
   java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
C25X:         1+0 <= k1-m+1 by XREAL_1:6;
k1(1 <  byASXREAL_1g4holds
              then
C25:          1 <= (k1-m)+1 & (k1-m)+1 <= i by C190,XXREAL_0A4: outputij =((SubBytes(SBT).input)i).j&        zi.  Op-XOR(extij,keyij)by ;
         by ;
C21:          (proof
              thus (H1.input).k = (H2.input).k

            

        
      endjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
L10:  for i be        s P0[,y,I(,) rom BINOP_1p
L1:   now let i be Element of NAT;
        assume
A1:     m <=i & i <= 4*(7+m);
        1 <= i &  letF1,2 be  of :-(4tuples_on(-    (((SubBytes(SBT)).((InvSubBytes(SBT)).input)).i).j = SBT.(outpu
        input.  L10,1java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
      end;
       beNat;
        assume
P13:    1 <= i0 & i0 end
NT_1:3;
        now 
   esis;
    java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 51
i i0byXREAL_1:4st=textholds, 5java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 51
          then
C11:      i < m by C1,XXREAL_0:
          thus H1i.i0 = input.(i+1) by C11,AA1
            .= H2i.i0 by C11,AA2;
        end;
        suppose
C3 m< i0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
l   
                    hence Natsti in[i,.  java.lang.StringIndexOutOfBoundsException: Range [30, 11) out of bounds for length 50
end     z asElement of (4-tuples_onend;

eH1ii0= .i0

   consider being such that
;
  hence H1 = H2 by FUNCT_2:63;
end;lenp=   P3FINSEQ_1 ;
end;

definition
  let SBT;
  let m be Nat;
  func KeyExpansion(SBT,m) ->
  Function of m-tuples_on(4-tuples_on (8-tuples_on java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 8
    java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  for Key be Element of m-tuples_on(4-tuples_on     assume
ex be Element  4(+m)-tuples_on (-tuples_on (-tuples_on BOOLEAN))
stw K    consider I be Functof-uples_on( (8-java.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 77
  holds (it.Key).(i+1) = <*w.(4*i+1),w.(4*i+2),w.(4*A forof 4-uples_on(4tuples_on (8-tuples_on BOOLEAN))
  existence
  proof
 (8 s&s ;
    Element of (7+m)-tuples_on(4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)))]
    means
    ex w be Element of (    ex xi be Element of 4tuples_on (8-tuples_on BOOLEAN) st xi = input.i &
    st w = (KeyExpansionX(SBT,m)).$1 & for i be Nat st i < 7+m holds
    $2.(i+1) = <*w.(4*i+1),w.(4*i+    holds (for i be Nat st i in Seg     
A1: for x being Element of m-    holds for i,j be Nat st i in Seg 4     H2input)i =     hen iin eg 4by;
z
o  .=((.j     then
java.lang.StringIndexOutOfBoundsException: Range [19, 14) out of bounds for length 14
          en  4java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
       in 4-(- (-tuples_onBOOLEAN);
      reconsider w = (KeyExpansionX(SBT,m)).x as
      Element of (end;
      w in (4*(7+m))-tuples_on (4-tuples_on (8-tuples_on BOOLEAN));
      then
XX1:     lement of(4-uples_on 8tuples_on BOOLEAN))
      st w  Op-LeftShift(        then
     reconsider =w
     Element of (-tuples_on (-tuples_on BOOLEAN))*by XX1;
AL1:def 12;
      reconsider m47 = (4*(7+m))i by A1;
      defpred PNat,set]means
en Element of NAT st n =$1-1 &
$ = <.4n+),w(4*+,.n)w(*+4>
P1:   for k be Nat st k in Seg m7
      ex z being Element of 4-tuples_on (4-java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 8
      st P[  let n, be  zero Element of NAT;
      proof
        let k be Nat;
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 27
        then
ZZ1java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
        then  holds f ex si,ti be Element(-     .1for      -(-(8java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
ZZ3:    4P1 for  be java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 21
ZZ4:    0+1 <= 4*n    st P[,]
ZZ7:    4*n+1 <= 4*n+4 by XREAL_1:7;
ZZ8:    4*n+2 <= 4*n+4 by XREAL_1assume
ZZ9 4*+3< *+4 :;
        4*n+1 <= 4*m7 by ZZ7,ZZ3,XXREAL_0:2;
        then
 Seg  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
ZZ10:   1 <= 4end
4n<4 ZZ3;
              p
X2  
ZZ11:   1 <= 4*n+3 by ZZ4,XREAL_1:7;
        4*n+3 <= 4*m7 by ZZ9,ZZ3,XXREAL_0:2;
        then
X3:     (4*n+3) in Seg m47 by ZZ11;
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 36
X4    ;
X5:     dom w = Seg m47 java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 9
        w.(4*n+1) in rng w by X5,((java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 77
   .4n1 
 (-uples_on(8-tuples_onBOOLEAN));
        
       PNat,set]means
(        b Element ofSeg ;
         rng exsit beElement of-tuples_onset   (;
        then reconsider w3 = w.(4*n+3) as
        Element of (4-tuples_on (8-tuples_on BOOLEAN));
        w.(4*n      proof
        then reconsider NV08;
        Element of (4-tuples_on (8-tuples_on BOOLEAN));
        reconsider z = <*w1,w2,w3,w4*> as
4(java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 78
z=.4+1)4+,.4n)(*+4*java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
        hence thesis;
      D:
      consider p being
      FinSequence of 4-tuples_on (4-tuples_on (8-tuples_on BOOLEAN)) such that
P3:   dom p = Seg m7 & for k be Nat defpredP0[ of4    defpred P0[Element of 4-tuples_on
from s 5()
P4:   len p   of -BOOLEAN;
      p in (4-tuples_on (4-tuples_on (8-tuples_on BOOLEAN)))*
      by FINSEQ_1:def           BOOLEAN)     java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 73
then in      then
      by P4;
       p as Elementof
()tuples_on4tuples_on(-(-BOOLEAN);
      take p;
      now let i be  uniqueness
        assume i < 7+m;

AA2:    +1< 7+m  byFINSEQ_1:def 1;
        1 <=       z  4-uples_on(-uples_on(- then x.k in 4-tuples_on (8-tuples_on BOOLEAN
        theni1 in  m7  AA2
 NAT st  i+) &
        p(1  *.(4    or x being  of 4tuples_on(-tuples_on8uples_on BOOLEAN)
.4**>
      end;
 java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
    end;
    consider I be Function of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    (7+m)-tuples_on(4-java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 10
A2: for x being Element of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
         (or be Natst i Seg4holds      endjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 
thesis byA2java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  
  zin-tuples_on(-tuples_on (-
  
H1be ofletinputbe of-(-A2 forxbeing of44(tuples_on java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
     (8- BOOLEAN;
    assume
A1: for Key be     assume
ex  Element of(4(7m)tuples_on (4tuples_on (8-java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 16
    st w = (KeyExpansionX(SBT,m)).Key & for i be Nat st i < 7+m holds
    (H1.Key).(i+1) = <*w.(4*i+1),w.(4*i+2),w.(4*i+3),w.(4*i+4)
assume
Key  ofm(-(-BOOLEAN    for i     inSeg holds
     of4(+)-(- (8- )
 
H2.+) w*1*2,.4i)w.4i*;
    now let input be Element of m-tuples_on(4-java.lang.StringIndexOutOfBoundsException: Range [46, 10) out of bounds for length 10
      consider w1 be Element of
*+)-- tuples_on BOOLEAN) such that
P1    <,,>*000,,0*<,0,>*&
for be Nat sti<7m 
      (H1.input).(i+1) = <*w1.(4*i+1),w1.(4*i+2),w1.(4*i+3),w1.(4*i  for7= <*<*,00><0,,,>0,,><*,00>java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
      consider w2 be Element of
      (4*(7+m))-tuples_on (4-tuples_on (8-tuples_on BOOLEAN)) such that
P2:   w2 = (KeyExpansionX(SBT,m)).input4tuples_on(4tuples_on (8-tuples_on BOOLEAN));
      for i be Nat st i < 7+m holds
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 tinit   *0,><00,,0,0,0*^<0000,
      (7+m)-tuples_onjava.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 61
      then
:ex s be Element of (tuples_on (4-tuples_on (8-tuples_on BOOLEANthus (H1.)i=H2inputijava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 52
      st (H1.input) =     assume 1 = i& <00,  end;
(.
(+)tuples_on  4tuples_on(-tuples_on 8tuples_on BOOLEAN)));
      
:   P4:   ex   tuples_on(4-uples_on (8-uples_on BOOLEAN)
      st (H2.input) = s & len  then
     letibeNat;:*,1    -BOOLEAN  LMGSEQ4,0,;
        assume
P5:     1 <= i & i <= len (H1.input);
i1  :48,INT_1:    yDefInvShiftRows,XX2;
        then reconsider i0 = i-1 as Nat;
        i < (7+m)+1 by  . input.by 12YY1Xjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

P6:     i-1 < (7+m)+
        thus (H1.inputfor Element4-(-tuples_on(-tuples_onBOOLEAN))
          .= <*w2.(4*i0+1),w2.(4*i0+2),w2.(4*i0+3),w2.(4*i0+4java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 5
.=(.input.i01 by P6P2
          .= (H2.input).i;
      ;
      hence
      (H1.input  output 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    end;
    hence H1 = H2 by FUNCT_2:63;
  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
;;

begin :: Encryption and Decryption

reserve MCFunc for Permutation of
4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
      x    lement 8tuples_onBOOLEAN)     =4java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
of4-uples_on(4-uples_on (8tuples_on BOOLEAN);

definition
  let SBT;
             *,0<,0*<,,,*^00,*,
letmbeNat
Element4ShiftRows is one-to-one & ShiftRows
   Element (8);
  func AES-ENC(SBT,        reconsider zk,*^java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 65
 defENC
ex be         reconsider zk a Element of(-tuples_on BOOLEAN)byFINSEQ_1:def 11
  st len seq =7+- &(xKeyi1 be Element of
  4-tuples_on4tuples_on(-BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
in    in4
  seq.1 = AddRoundKey.(text,Keyi1)) &
  (for   (it.(,key))i.j = Op-XOR(extij,keyij);
  ex Keyi be Element of 4-tuples_on(  proof
  st Keyi = ((KeyExpansion(SBT,m)).(Key)).(i+1) &
  seq.(i+1) = AddRoundKey.((MCFunc*ShiftRows*SubBytes(SBT)).(seq.i) Elementof-tuples_on(-tuples_on 8-uples_on BOOLEAN)]means
exKeyNr be Element of4-tuples_on(4tuples_on (8-tuples_on BOOLEAN))
  st KeyNr = ((KeyExpansion(SBT,m)).(Key)).(7+m) &
  it = AddRoundKey.((ShiftRows*SubBytes(SBT)).(seq.(7+m-1)),     textij=(1i.j &keyij = (2i)j&(pan style='color: green'>3i).j =Op-OR(textij,keyij)
  existence
  roof
    1+0 < 7+m by XREAL_1:8;
    
N1 0<7+-1 byXREAL_1:50;
    then 7+m-1 in NAT by INT_1:3;
  Nr= +-1 asNatjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
ZZ1: (KeyExpansion(SBT,m)).(Key) in
    (Nr+1)-tuples_on(4-       zk beElement of (-tuples_on (-tuples_on BOOLEAN))
    holds k beElementof8-uples_on
    (Nr+1)-tuples_on(4-tuples_on(4-tuples_on (8- XORtk)java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
uples_on(-tuples_on (-tuples_on BOOLEAN)))*
    st kky = s & len s = (Nr      proof
    defpred         assum
    ex Keyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
(SBTm))().$1+)&
    $3 = AddRoundKey.((MCFunc*ShiftRows*        then text.k in 4-tuples_on (8-tuples_on BOOLEAN);
    1+0 <=Q13:exs   8tuples_on)
    then 1 in Seg (Nr+1);
    then 1 in dom (kky) by FINSEQ_1:def 3,XX12;
    then ((KeyExpansionthen key.k in 4-tuples_on (8-tuples_on BOOLEAN);
    then reconsider Keyi1 = ((KeyExpansion(SBT,m)).(Key)).1 as
Element of -uples_on(-uples_on (8-tuples_on BOOLEAN));
    reconsider I0 = AddRoundKey.(text,Keyi1) as
    Element of 4-tuples_on( ex textij,keyij be Element of 8-tuples_on BOOLEAN
  nbeing Natstjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 38
    reconsider  = *<0011><0,10><0000><,00stPi[,xi]
    holds ex y being Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
P[zyjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    proof
      letthen()jin  () byFUNCT_13;
      java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
Nr
          Q0.5  PP10 by FINSEQ_4:78java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
111 n < Nr by XREAL_1:,11java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      0+1 <= n+1 by XREAL_1:7;
+1in (r) by X111java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      then n+1 in dom (kky) by FINSEQ_1:def 3,XX12;
      then (Q23:   len zkbyA7
      then reconsider Keyi = ((KeyExpansion(SBT,m)).(Key)).(n+1) as
      Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
consider y = AddRoundKey.((MCFunc*ShiftRows*SubBytes(SBT)).z,Keyi) as
java.lang.StringIndexOutOfBoundsException: Range [39, 13) out of bounds for length 64
      take y;
       P]
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      be:for   Elementof4tuples_on4tuples_on(- ))
    FinSequence of 4-tuples_on(4-tuples_on (8-tuples_on  then
X2: len seq = Nr & (seq.1 = I0 or Nr = 0) &
    for i be Nat st 1 <= i & i < Nr holds P[i,seq.i,seq.(i+1)]
     RECDEF_1:sch 4(X1)
    Nr in Seg     then
    in
ef,;
    then seq.Nr in rng seq by FUNCT_1:3 .5)      ajava.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
    then reconsider seq10 = seq.Nr as
    Element of 4-tuples_on(4        (H2 ininSeg4& jinSeg4

    then Nr+1 in dom (kky) by FINSEQ_1:def 3,XX12;
    then ((KeyExpansion(SBT,m)).(Key)).(Nr+1) in rng kky by FUNCT_1:3;
    then reconsider KeyNr = ((KeyExpansion        st textij =(text.i).j& keyij =(key.). &
    Elementof-tuples_on(-tuples_on (-tuples_on BOOLEAN));
    java.lang.StringIndexOutOfBoundsException: Range [52, 5) out of bounds for length 52
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    w = AddRoundKey.((ShiftRows*SubBytes(SBT)). 4tuples_on4tuples_on 8-tuples_on    4 inSeg;
        4s_on-uples_on 8uples_on BOOLEAN)) such that
  end;
  uniqueness
  proof
    let s1,s2 be Element R50 IT.java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 7+  XREAL_1:;
    java.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
    thenlet R2be   10tuples_on 4java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 49
 Nr=7+m-1as ;
    assume
A1: ex seq be     ex textijk<,,*<*,0,<,00>*,00>>&
    st len seq = 7+m-1 &
  ,eybe
     Keyi1 = (KeyExpansion(SBT,)   R1.=<<0,,00>^*0,1,0,*,<0,0,,0><000*,
1 ..extKeyi1)  fori be Nat st1< i & i<7m1
           <<00*,
stKeyi = ((eyExpansion(SBT,).(ey)).(+)&
    seq.        then
    exjava.lang.StringIndexOutOfBoundsException: Range [7, 4) out of bounds for length 56
,m).Key))(+ R1 =< <00,,*^*,00>,<000*^*,,,0>
(ShiftRows*ubBytesS)       (.extkey     end;
    assume
    R1. = * <*,0,,*>^<*0,0,,*>,*0,,0,0*>^*0,0,*>
   st lenseq   +-&
-8)
    st Keyi1 = ((KeyExpansion( hence =H2  ;
   seq. =AddRoundKey.(ext,))  (or be java.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 6
    holds ex Keyi be Element of     <0,0*,*
    st Keyi = ((KeyExpansion(SBT,m)).(Key)).(i+1)     R1.9 =< *001>*,11><00**0
definition
exKeyNrbe  of4tuples_on(-tuples_on theorem NV04:
KeyNr Sm)Key.+ java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
s2 .(ShiftRowsubBytes()(seq.7m1)eyNr;
    consider seq1 be
    FinSequence of (4-tuples_on(4 8 java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 77
P1: len seq1 = Nr &
    (ex Keyi1 be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    R2  **000*<,,,*><0,0   java.lang.StringIndexOutOfBoundsException: Range [9, 2) out of bounds for length 58
    <0  in4-ples_on(uples_on(-java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 58
 exKeyi be Element of -tuples_onx in     then
 input .*,,00><*,,>*,*><,00>>&
    seq1.(i+1) =     R2.5 = <* <*0,0,0,1*>^<*0  inxFUNCT_13java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    & ex KeyNr be Element of 4-java.lang.StringIndexOutOfBoundsException: Range [62, 38) out of bounds for length 62
(SBTm. P,kfromsch (P1)
    s1      DefInvShiftRowsX
    consider seq2 be
    FinSequence of (4-tuples_on(4-tuples_on (8-java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 11
2 len seq2  fOOLEANx pS.
    (ex Keyi1 be Element        .i=SBT(.ijava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
=(m.ey).java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
seq2  java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 73
    holds      then
onSBT).Key  ShiftRows.(InvShiftRows.output) in
    seq2.(+1)=AddRoundKey.(    seq2.(i+1) = AddRoundKey.((MCFunc
    & ex KeyNr be Element of 4-tuples_on(4-tuples_on  assume
    st(SBT,m)(Key).(r+  then
    s2 = AddRoundKey.((ShiftRows*SubBytes(SBT)).(seq2.(Nr)),KeyNr) by A2;
    defpred EQ[Nat]   fori st1=i& R1R1  i
    1 <= $1 & $1 <= len
Q50: EQ[0];
Q51: for i be Nat st EQ[i] holds EQ[i+1]
    proof
      let i be Nat;
      assume
: EQ[];
     1 <=i+ & i+1 = len seq1;
      then
Q54:  1-1 <
Q550: (len   let x be Elem of4-tuples_on(-)
      mibe,w of(-8tuples_onjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 28
suppose
C1:     i = 0;
         seq1(+)= seq2.(i+1) by C1,P1,P2;
end
      suppose
Q560:   i <> 0;
        Nr-1 < Nr-0 by XREAL_1:15;
        then
    =i    byQ560,AT_1:,java.lang.StringIndexOutOfBoundsException: Range [43, 1) out of bounds for length 56
        then
Q60:    ex Keyi be Element of 4-tuples_on(4-tuples_on       etjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 19
stKeyi =((      s in m-tuples_on (n-tuples;
              thenkindoms       then
        ex Keyi be ElementLTT1 4*      reconsider  =.k as  of n-tuples_onBOOLEAN;
        st Keyi = ((KeyExpansion(SBT,m)).(Key)).(i+1) &  ShiftRowsjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 47
.(*(BT).(seq2.)Keyi)by P2,X1;
Fof:tuples_on4uples_on (8tuples_on BOOLEAN)),
14,550Q54XXREAL_02Q52,
      end;
    end;
    for i be Nat holds EQ[i](it.). = XORtextij    end;
 =s2 P1,FINSEQ_1:4java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 end;
end;

definition
 
  letj imbyjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  let m be Nat;
 beof-(-8);
letKeybe        T3 R.java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
AESDEC  be ofSegm H2  Xsti;
  Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN Element ( 8 ));
  :defDEC:
    (tuples_on4tuples_on (    of((-)st(  ,)

  (ex
  st = Rev(KeyExpansionSBTm)(Key).1      =  consistency;
  seq.1 = (InvSubBytes(SBT)*java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 8
  (for i be  end;
  ex Keyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN      then
  st Keyi = (Rev((KeyExpansion  func Rcon - Element of -tuples_on (4-tuples_on (8-tuples_on BOOLEAN))
  seq.(i       zk be Element of (-(  it.  Functionof -tuples_on(-uples_on (8tuples_on BOOLEAN)),
  (InvSubBytes(SBT)*InvShiftRows*(MCFunc      st $2 =zk&for be  st ji SegSegjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  ex KeyNr beElement of 4-tuples_on(-uples_on 8tuples_on BOOLEAN)
 KeyNr Rev(KeyExpansionSBTm)(ey).7m java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
  it = AddRoundKey.(seq.(7+m-1),KeyNr);
  existence
  proof
    1+0 < 7+m by XREAL_1:Q1     be   (.Key).(1 =OpS,mi)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    then
    [  m(-java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 73
     7+m- in NAT byINT_1:3
 java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 38
ZZ1: Rev((KeyExpansion(SBT,m)).(Key)) in
    (Nr+1)-tuples_on(4-tuples_on(4-tuples_on (8-java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 49
    reconsider kky     stP =$2.(-+  Q =($).java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
(48BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
XX12:     ex zbe Element of (4*(7+m))tuples_on 4 (8- )
    st kky = s & len    st [xz]
    defpred P[Nat,set,set] means
    ex Keyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
   st Keyi =Rev((eyExpansion(,)).Key)).$+1 &
    $ r  2   =3&
    1+0 <= 7+m by XREAL_1:7;
    then 1 in .  =rm .  WXOR,java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 76
    then 1 in dom (kky) by FINSEQ_1      for ibe Nat st1<= i  <mholds
    then (Rev((KeyExpansion(SBT,m)).(Key))).1 in rng kky by FUNCT_1:3;
reconsiderKeyi1  RevK(,)(ey)1as
ment4tuples_on(tuples_on (8- );
    reconsider I0 = (InvSubBytes+< +
    as Element of 4-tuples_onL * =4*7m XREAL_166
X1: for n being Nat st 1 <= n & n < Nr
    for z     <0,,,*>^*0,,,0* * &
    holds ex   it.8 = <* <*,,,0*^*0,,,*,<*0,,*><*0,000>
stPnyjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    proof
      let n be Nat;
      assume
X11:  1 <= n     <0000*><0000*>,<0000*^<000,>*;
      let z be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
:+1< Nr+ XREAL_1:,X11;
+1         m-4(-)
      then n+1 in Seg (Nr+1) by X111;
n1dom (ky) by FINSEQ_1:def 3,XX12;
      QQ3:dom s = Seg by def 3;
      
lementoftuples_on4tuples_on (8tuples_on BOOLEAN);
      reconsider y =
      (InvSubBytes(SBT)*InvShiftRows*(MCFunc")).(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
      Element tuples_onPP8=* *0,>*01,*<,,*^*,0>java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
      take y;

    end;
    consider seq be
    FinSequence of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) such that
2: len   &(eq1 I0orNr=0 java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    for i be    reconsiderPP11  *<0,0,1,*^<*0,0,,*,*,,,*^*,,,*,
fromRECDEF_1sch4()
    inSeg NrbyFINSEQ_13N;
     PP12= < *0,,0,0><0000><0000><*,,0,*,
    then
.Nr
    Element of 4-tuples_on(4reconsider PP13  * <1,,*^<*000><0,,0><000,0>,
    Nr+1 in Seg (Nr+1) by FINSEQ_1:3;
    Nr+   (kky)byFINSEQ_1d ,;
    then (Rev((KeyExpansion Element  4-uples_on(-        ;
    then reconsider KeyNr = (Rev    reconsider   * <,001><*,,1doms ,Q3;
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    reconsider w = AddRoundKey.((seq10),KeyNr) as
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
     =AddRoundKey.(seq.Nr,eyNr);
;
end;
  uniqueness
  proof
    let s1,s2 be Element of 4-tuples_on(4A1:lenQ0  =5&Q01=PP6&Q0.yle='color: green'>2=PP7 &Q03=PP8 &Q0. =PP9 &
    1+0 < 7+m by XREAL_1:8;
    then 0 < 7+m-1 by XREAL_1:50;
    then 7+m-1 in NAT by INT_1:3;
    then reconsider Nr = 7+m-1 as Nat;
    assume
A1: ex seq be FinSequence of (4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)))
   len seq = 7m1 &
    (ex Keyi1 be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st Keyi1 = (Rev((KeyExpansion(SBT,m)).(Key) then 2 in dom Q0 by INSEQ_1:def 3,A1;
    seq.1 = (InvSubBytes(SBT)*InvShiftRows).(AddRoundKey.(text,Keyi1))) &
    (for i be Nat st 1 <= i & i < 7+m-1 holds
    ex Keyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st Keyi = (Rev((KeyExpansion(java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 15
    seq.(i+1) =
    (InvSubBytes(SBT)*InvShiftRows*(MCFuncR4:IT4 =PP9 byA1,INSEQ_1:def 7;
 of 4-tuples_on(-tuples_on (-tuples_on BOOLEAN)
     KeyNr (ev(KeyExpansion(SBT,m).(ey))(+ &
 AddRoundKey(.7m)KeyNr)
    assume
A2: ex seq be FinSequence of (4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)))
:len z = N2 & (z.1 = x or N2 = 0) for  be Natst 1< k &
    (ex Keyi1 be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st Keyi1 = (Rev((KeyExpansion(SBT,m)).(Key))).1 &
    seq.1 = (InvSubBytes(SBT)*InvShiftRows).(AddRoundKey.(text,Keyi1))) &
    (for i be Nat st 1 <= i & i < 7+m    then 1 in dom Q1 by FINSEQ_1:def 3,2;
    ex Keyi be Element of 4-R10: IT.(5+1) = Q1.1 by A1,FINSEQ_1:def 7
    st YY2:  for kbe  stk inSeg (*(7m)
    seq. java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    (InvSubBytes(SBT)*InvShiftRows*(MCFunc")).(AddRoundKey.(seq.i,Keyi))) &
    ex KeyNr       . PP12;
   st KeyNr  (ev(KeyExpansion(SBT,m).java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    s2 = AddRoundKey.(seq.(7+m-1),KeyNr);
    consider seq1 be
   QQ2    kjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 47
P1percases
        then
    st Keyi1 = (Rev((KeyExpansion(SBT,m)).(Key))).1 &
    1=(nvSubBytesSBT)InvShiftRows.A.(textK))&
    (for i be Nat st 1 <= i & i < Nr holds
      beElement of 4-tuples_on(4-then j in dom(textk) by Q13,FINSEQ_1:def;
    st Keyi = (Rev((KeyExpansion(SBT,m)).(Key))).(i+1) &
    seq1.(i+1) =
*(MCFunc").AddRoundKey.(seq1.i,Keyi))&
    (4          ofm-tuples_on(-tuples_on (tuples_on BOOLEAN));
    st KeyNr = (Rev((KeyExpansion(SBT,m)).(Key))).(7+m) &
    s1 = AddRoundKey.(seq1.(7+m-1),KeyNr) by A1;
seq2 be
    FinSequence of (4-    dom  =Seg   j be  st j  Seg4
P2: len seq2 = Nr &
    (ex Keyi1 be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    st Keyi1 = (Rev((KeyExpansion(SBT,m)).(Key))).1 &
    seq2.1 = (InvSubBytes(SBT)*InvShiftRows).(AddRoundKey.(text,Keyi1))) &
fi  &java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 42
ex    4-(- (- BOOLEAN))
    st Keyi = (Rev((KeyExpansion(SBT,m)).(Key))).(i+1) &
    seq2.(i+1) =
    (InvSubBytes(SBT)*InvShiftRows*(           
java.lang.StringIndexOutOfBoundsException: Range [24, 6) out of bounds for length 73
    st KeyNr = (Rev((KeyExpansion(SBT,m)).(Key))).(7+m) &
    s2z in 4-tuples_on(-8tuples_on BOOLEAN)) by Q3;
    defpred EQ[Nat]means
    1 < $1Q3:1 <iNAT_D:,4uples_on8-uples_on BOOLEAN);
 EQ[];
Q51   <,00,*^00textijkeyij  lement of -tuples_on BOOLEAN st textij =
    proof
let beNat;
      assume
52  EQ[i;
      assume 1 <= i+1 & i+1 <= len seq1;
then
Q54:  1-1 <= i+1-1 & i+1-1 <= (len seq1)-1 by XREAL_1:9;
Q550zi.  java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 42
      per cases;
      supposezi.=OpXOR(keyij)by    <00                then
C1     i=java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        thus seq1.(i+1) = seq2.(i+1) by C1,P1,P2;
      end;
      
Q560:   i <> 0;
        Nr-1 < Nr-0 by XREAL_1:15;
then
:    < i  i <Nr  Q560,   R2. =< 0,,*><,0,,*><0,00>*0,,*>,
        then
Q60:    ex Keyi be Element of 4-    R2.3 = <* <*0,0,0,0*>^<*0,1,0,0*>,<*00          hence thesis;
         Keyi=(Rev(KeyExpansion(SBT,m)).(Key))).(i+1) &
        seq1.(i+1) =
        (InvSubBytes(SBT)*InvShiftRows*(MCFuncuniqueness
        by P1;
        ex Keyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
        t   (vKeyExpansion(SBTm).(Key)))(i+1)&
        seq2.(i+1) =
        (InvSubBytes(SBT)*InvShiftRows*(MCFunc")).(AddRoundKey.(seq2.i,Keyi))
        by,))* by FINSEQ_1:def java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
hence seq1.(+1)=seq2.i1java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        byA2:for ,key be Element of 4-tuples_on(-tuples_on (8tuples_on )
      ;
    end;
  holds[ fromNAT_1sch 2java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
s1 sb FINSEQ_1:,,;
 ;
   <*,0,,0*>^*0,,,*>,*0,0*>^*0,A3:     i inSeg 4 &jin SegLX31   1 = k+1&k1< m by AT_1:11NAT_1:;

theorem INV01:
or inputbelement of -uples_onjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 34
  (CFunc")MCFunc.input) = input
proof
  let input be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  thus (MCFunc").(MCFunc.(input)) = ((MCFunc")*MCFunc).input by FUNCT_2:15
    .= (id (4-java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 8
by FUNCT_2:
;
end;

theorem
  XP1:exv  end;;
  holds MCFuncjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
proof
  let output be Element of 4-tuples_on(          ;
   MCFunc)((CFunc".(output)  (CFunc*(CFunc").output by FUNCT_215
    .= (id (4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)))).output
:java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    .= output;
end;

theorem LAST01:
  for m
stPz]
  (InvSubBytes(SBT)*java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 9
proof
lbeNat,
  text  Element   t= pWXORubWord(,
  thus (InvSubBytes(SBT)*InvShiftRows).( end
  ((SBT)InvShiftRows).(ShiftRows.((SubBytes(SBT)).text))
  by FUNCT_2:15
    .= (InvSubBytes(SBT)).(InvShiftRows.(ShiftRows.((SubBytes(SBT)).text)))
    by FUNCT_2:15
    .= (InvSubBytes ofm(- 8-uples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
    .= text     .= text by m =0 implies i =(k divm &j=m & zi =zi&
end;

theorem LAST02:
  for m be Nat,
  text be Element of4tuples_on(4-tuples_on (8-tuples_on      by P3;
  (InvSubBytes(SBT)*InvShiftRows*(MCFunc")).
 (MCFunc*ShiftRows*SubBytes(SBT).text)= text
proof end
  let m be Nat,
les_on(4-tuples_on (-uples_on BOOLEAN);
  thus (InvSubBytes(SBT)*InvShiftRows*(MCFunc")).
  ((MCFunc*ShiftRows*SubBytes(SBT)).text) =
  (InvSubBytes(SBT)*InvShiftRows*(MCFunc")).
          considerj2 ElementofNAT,
()InvShiftRows*MCFunc").
    (MCFunc.(ShiftRows.((SubBytes(SBT)).text))) by       >0& m dividesiby,INT_1:62,S;
    .= (InvSubBytes(SBT)*InvShiftRows).((MCFunc").
    (MCFunc.(ShiftRows.((SubBytes(SBT)).text)))) by FUNCT_2:15
    .= (InvSubBytes(SBT)*InvShiftRows)LTT4 mNATbycases
     
    .= (InvSubBytes(SBT)).(InvShiftRows.(ShiftRows.((SubBytes(SBT)).text)))
    by FUNCT_2:15
    . (nvSubBytes()).(SubBytes(SBT)).text)by INV04
    ;
end;

theorem :
m Natjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  text be           forn Natby ,;
  beElementofm-4tuples_on(tuples_on)
 -4hence 
  st (m = 4 or m = 6 or m = 8)   existence
Q0:  i/m in           t.(n+1.n1)=WXOR(P,eyExTemp(   xsi, beElement of(-uples_on BOOLEAN) st si = s.$1 &&nbsp;ti = t.$1 &
  holds AddRoundKey.(AddRoundKey.(          1 <= j & j < m by AS,INT_1:58,C1,AT_1:14;
proof
  let m be Nat,
  text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 33
  dkeyi,ekeyi beproof
  
ASin      =ibyjava.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 53
  ekeyi  ekeyi     u(k+1)= t(j1 by NLX34NC16java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 43
setC22X       km1 = (+1)m
  KeyExpansion(SBT,))(key)-tuples_on BOOLEAN) st (  SubWord(SBT,));
  7m-(    thus not ((i m = 0              . i0 AS,XLMOD01,

B0: ex:u(k-m+1)= r  endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  st (KeyExpansion(BTm).key =s& len s =Optencyjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 XREAL_1:8;
  then 1 in Seg (7+m);
  then
B1: 1 in dom p by FINSEQ_1:def 3,B0;
A0: dkeyi = p.(            u(k+1)=OpWXOR(,KeyExTemp(SBT,m,Q)

 ,;
    
A3: i in Seg 4 & j in Seg 4;
    then              =j+1by AS,XLMOD02X,MC1,LX34
  = text.)j & ekeyij(ekeyi..&
    ((AddRoundKey.(text,ekeyi)).i).j = Op-XOR(etextij,ekeyij)

    consider dtextij,dkeyij be Element of 8-tuples_on(4*(7+)-tuples_on (4-tuples_on (8-tuples_on BOOLEAN)) means
A5 dtextij =(.text,ekeyi).. &dkeyij  dkeyi.)j&
    ((AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi)).i).j =
    Op-XOR(dtextij,dkeyij) by DefAddRoundKey,A3;
    thus ((AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi)).i).j = (text.i).j
    by A4,A5,A0,DESCIP_1:17;
  ;
   AddRoundKey(AddRoundKey.(extekeyi),dkeyi) = text by LM01;
end;

LAST04:
 mbeNat,
 BOOLEAN),
 m-4tuples_on (8-BOOLEAN))java.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
  Keyi1,KeyNr be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  st (m             eElement of -tuples_on (8-uples_on BOOLEAN)
  KeyNr = ((KeyExpansionstP= u.((k-m)+1)&Q=u. &
otext =AddRoundKey.(ShiftRows*SubBytes(SBT).text,KeyNr)
  holds (InvSubBytes(SBT)*InvShiftRows).(AddRoundKey.(otext,Keyi1)) = text

  let m be Nat,
  text,otext be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  Key be Element of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  Keyi1,KeyNr be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  assume
  m  8 & Keyi1 = (Rev((SBT,m)())1&
  KeyNr = ((KeyExpansion(SBT,m)).(Key)).(7+m) &
  =(().)
  (AddRoundKey.(otext,    <*0,0,0,0*>^<*0,0,0,0*>,<*0,0,0,0*>^<*0,0,0,0*> *> &
  hence (InvSubBytes(SBT)*InvShiftRows).(AddRoundKey. (otext,Keyi1))
     java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
end;

    0000><0000><000,><0,,*>* java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  m be java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
key be Element of m-tuples_on(-tuples_on (8-tuples_on BOOLEAN)),
  dkeyie   of4tuples_on4tuples_on 8tuples_onBOOLEAN)
  st (m = 4 or m = 6 or m = 8) & dkeyi = ((KeyExpansion(SBT,m)).(key)).1 &
  ekeyi = (Rev((KeyExpansion(SBT,m)).(       rtbe Element of m-tuples_on4tuples_on (8-tuples_on BOOLEAN))
dKey.AddRoundKey.(ext,)dkeyi)= text
proof
  let m be Nat,
:    TARSKIdef2,ARGREL1:11
 beElementof muples_on(4tuples_on 8tuples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  dkeyi,ekeyi be Element of 4-tuples_on(P: <*,,  by,X0,;
  assume
:m=4or  =6rm ) dkeyi=((SBT,).key). &
  ekeyi  (Rev((KeyExpansion(SBT,m)).(key))).(7+m);
  set p = (KeyExpansion(SBT,m)).(key);
  (KeyExpansion(SBT,m)).(key) in
7+-4(4tuples_on(-BOOLEAN);
  then
B0: ex s be Element of (4-tuples_on (4-tuples_on (8-tuples_on BOOLEAN)))*
  st (KeyExpansion(SBT,m)).(key) = s & len s = (7       N2 =(4*7m div m )1 asN;
10<7+  then consider, java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
   7min  (+)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  then
B1: 7+m in dom p by FINSEQ_1:def 3,B0;
A0:  p(l p-+)  AS58
    .= dkeyi by B0,AS;
  now let i,j be Nat;
    assume
R301,* Element of 4 BOOLEAN LMGSEQ4X0;
    then consider 0java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
A4: etextij = (text.i).j & ekeyij = (ekeyi.i).j &
    (AddRoundKey.(texteC19      .k-+)  .1by LLX34,C22XC16,java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
byjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    consider dtextij,dkeyij be Element of 8-tuples_on BOOLEAN such that
A5 =(AddRoundKey.(text,ekeyi)).i).j & dkeyij = (dkeyi.i).j &
    ((AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi)).i).j =
    Op-XOR(dtextij,dkeyij) by DefAddRoundKey,A3;
    thus ((AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi)).i).j =
    (text.i).j by A4,A5,A0,DESCIP_1:17;
  end;
  ence (AddRoundKey.(xt),keyi) =text LM01;
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 4

theorem
   mbe,
  otext  4-(tuples_on (-tuples_onBOOLEANjava.lang.StringIndexOutOfBoundsException: Range [71, 41) out of bounds for length 41
   (8-tuples_onBOOLEAN))
  Keyi1,KeyNr be Element of 4-tuples_on(4-tuples_on             of (- 8 )
  st (m rPP13 =<*<*,,,*^*0,        proof
  KeyNr = (Rev((AA1:      1<= i &i< m
iftRows*SubBytes(BT))text,eyNr)
  holdsIjava.lang.StringIndexOutOfBoundsException: Range [20, 16) out of bounds for length 46
proof
  let m be Nat,
  text,otext be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  Key be     reconsider Q0 = <*PP6,PP7,PP8,PP9,PP10*> as FinSequence;
  Keyi1,eyNrbeElement of -tuples_on(4-tuples_on (8-tuples_on BOOLEAN));

AS: (m = 4 or m = 6 or m = 8) & Keyi1 = ((KeyExpansion(SBT,m)).(Key)).1 &
  KeyNr = (Rev((KeyExpansion(SBT,m)).(Key))).(7+m) &
  otext = AddRoundKey.((        Element  4-tuples_on (-tuples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
((,)=(*(BT    
  ((    assume
  : Key  OpWXOR(,SBT,m,Q0)as
end;

 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  for m,i be Nat,
  ejava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 68
be mtuples_onFinSequence  m(tuples_on (8tuples_on BOOLEANAA2 for of-4tuples_on(uples_on )
  eKeyi,dKeyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
 ( =    (    st   i<* holds
  eKeyi = ((KeyExpansionex efpred N,]means
   =(Rev(KeyExpansion(SBT,m)   Q be  of4tuples_on(tuples_on)
 holds AddRoundKey.AddRoundKey.text,eKeyi)dKeyi) = ext
proof
  letmibe Nat,
Element of 4-tuples_on(-tuples_on (-tuples_on =;
be Element of m-4tuples_on(-uples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  ekeyi,dkeyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  assume
 m=QQ2:kdiv m< (*+m)divm by NAT_2:24java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
  ekeyi = (eyExpansion,m)key).7m)&
  dkeyi = (Rev((C1       ( modm) <> 0;
  set p = (KeyExpansion(SBT,m)).(key);
  (KeyExpansion(SBT,m)).(key) in
  (7+m)-tuples_on(4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)));
then
B0: ex s be Element of (4-tuples_on (4-tuples_on (8-tuples_on BOOLEAN)))*
             indom by ,:f 3java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  1 < 7+m-11byAS,:;
   thenreconsider  zi =zias
hen+ in Seg (+
  then
1:+ dom pbFINSEQ_1:def 3B;
0  zi    v =m;
      byB0,java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  now let          then   dom by Q0;
    assume

java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 49
        Element of-tuples_on(4-        end;
    by DefAddRoundKey;
    consider dtextij,dkeyij be Element of 8-tuples_on BOOLEAN such that
A5: dtextij = ((AddRoundKey.(text,ekeyi)).i).j & dkeyij = (dkeyi.i).j &
    ((AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi)).i).j =
    Op-XOR(dtextij,dkeyij) by DefAddRoundKey,A3;
    thus ((AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi)).i).j =
(text.)jby A4,5A0,DESCIP_1:7;
  end;
  hence AddRoundKey.(AddRoundKey.(text,ekeyi),dkeyi) = text by LM01;
end;

LAST07:
  for m be Nat,
  text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
 KeybeElement of -tuples_on(-tuples_on (tuples_on BOOLEAN))
  eKeyi,dKeyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on      defpred PNNat means
  st (m = 4 or m = 6 or m = 8) & eKeyi = ((KeyExpansion(SBT,m)).(Key)).1 &
  dKeyi  (Rev((eyExpansion(SBT,).(ey)).(+m)
  holds AddRoundKey.(AddRoundKey.(text,eKeyi),dKeyi) = text
proof
  let m be Nat,
  be  of 4-tuples_on(-tuples_on (-tuples_on BOOLEAN))
  Key be Element of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  , be Element of-4tuples_on(tuples_on);
  assume
AS: (m         assume
  dKeyi = (Rev((KeyExpansion(SBT,m)).(Key))).(7+m);
  1+0 < 7+m by XREAL_1:8;
  then 0 < 7+m-1 by XREAL_1:50;
  7m-  NAT byC10:     i+;
  hen reconsider =+- as Nat;
:eKeyi  ((eyExpansion(SBT,m).Key).(mi by AS;
  dKeyi = (Rev((KeyExpansion(SBT,m)).(Key))).(i+1) by AS;
 P2assume
end;

java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 m be Nat,
  text be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  Key be Element of m-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  st (m = 4 or m = 6 or m = 8)
   AESDECSBT,MCFunc,ES(SBT,MCFunc,ext    len v= 10;
proof
  let m be Nat;
lettext  of-4tuples_on (- BOOLEAN);
  let Key be Element.=(H2.)k B2,AA2;
10<7+m 8java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

N1:0 <7+-  XREAL_150;
  then 7+m-1 in NAT by INT_1:3;
  then reconsider Nr = 7+m-1 as Nat;
A0: 1 <= Nr       such 
  

  considereseqbe
  FinSequence
P1 len eseq =Nr &
 eKeyi1 be  -(-uples_on(-java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 72
  st Keyi1 =((BT,)).Key)S,)))
 eseq. =AddRoundKey.(text,Keyi1)) & (for i be Nat st 1       by YY4;
  ex Keyi be Element of 4-C18:          PP2 = (H2.input.(k1-m)1  QQ2  (H2.input).1
  st Keyi = ((KeyExpansion(SBT,m)).(Key)).(i+1) & eseq.(i+1) =
 .(MCFuncShiftRows*ubBytesSBT)(eseq.)Keyi) java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
  ex KeyNr be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  st KeyNr = ((KeyExpansion(SBT,m)).(Key)).(7+m) &
  AES-ENC(SBT,MCFunc,text,Keyy 6
  AddRoundKey.((ShiftRows*SubBytes(SBT)).(eseq.Nr),KeyNr) by defENC;
  consider dseq be
  FinSequence of (4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))) such that
P2: len dseq = Nr &
  (x Keyi1 be Element  4tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
Keyi1Rev(SBTm).K). 
  dseq.1 = (InvSubBytes(SBT)*InvShiftRows).
  (AddRoundKey.(AES-ENC(SBT,MCFunc,text,Key),Keyi1))) &
  (for i be Nat st 1 <= i & i < Nr holds
  ex Keyi be Element of 4      end;
  st Keyi = (Rev((KeyExpansion(SBT,m)).     now let i0 be Nat;
  dseq(+)=
SBT)InvShiftRows*(CFunc").AddRoundKey(i,Keyi))&
oftuples_on(4tuples_on(-tuples_on BOOLEAN))
KeyNr = (Rev((KeyExpansion(,).Key))).+)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
  tjava.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
  AddRoundKey.(dseq.Nr,KeyNr) by defDEC;
 beElement of4tuples_on(- (8- BOOLEAN)
  such that
P11: eKeyi1 = ((KeyExpansion(SBT,m)).(Key)).1 &
  eseq.1 = AddRoundKey.(text,eKeyi1) by P1;
  consider eKeyNr be Element of 4-tuples_on   (oribe Element  st    i..i+)=Key.i1)
  such that
P12: eKeyNr = ((KeyExpansion(SBT,m)).(Key)).(7+m) &
  AES-ENC(SBT,MCFunc,text,Key) =
  AddRoundKey.((ShiftRows*SubBytes(SBT)).(eseq.Nr),eKeyNr) by P1;
  consider dKeyi1 be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  such that
P21: dKeyi1 = (Rev((KeyExpansion(SBT,m)).(Key))).1 &
  dseq.1 = (InvSubBytes(SBT)*InvShiftRows).
  (AddRoundKey.(AES-ENC(SBT,MCFunc,text,Key),dKeyi1)) by P2;
  consider dKeyNr be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
  such that
P22    defpred P0[lement ofm-tuples_on(tuples_on(-tuples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
  AES-DEC(SBT,MCFunc,AES-ENC(SBT,MCFunc,text,Key),Key) =
 ,)as
  defpred PQ[Nat] means
 1 <implies.$+)=eseq(r
  Nr in Seg Nr by A0;
  then Nr in dom eseq by P1,FINSEQ_1:def 3;
  then eseq.Nr in rng eseq by FUNCT_1:3;
  then reconsider esqm = eseq.Nr as
  Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  dseq.(1+0) = esqm by   dseq.(1+0) = esqm by P12 n=$- java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    . eseq.(Nr-0)
  then
PN1: PQ[0];
PN2: for i be Nat st PQ[i] holds PQ[i+1]
  proof
    let i be Nat    proof
    let  java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 12
A1: PQ[i];
    assume
A2: i+1 < Nr;
A4: i <= i+1 by NAT_1:11;
    consider dKeyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    such that
A6: dKeyi = (Rev((KeyExpansion(SBT,m)).(Key))).((i+1)+1) &
    dseq.((ZZ7    4*n+ =4n by :;
    (InvSubBytes
java.lang.StringIndexOutOfBoundsException: Range [32, 22) out of bounds for length 22
X11:0 <Nr-i1)byA2,REAL_150java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    then Nr-(i+1) in NAT by INT_1:3;
    then reconsider m7i1 = Nr-(i+1) java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 10
    1 <= m7i1 by NAT_1:14,X11;
Y:  for   4n <*m7 by ZZ9,Z3XXREAL_0;
A9: 1 <= Nr-(i+1) & Nr-(i+1) < Nr by XREAL_1:44;
    consider eKeyi be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    such that
A10: eKeyi = ((KeyExpansion(SBT      
    eseq.(m7i1+1) =         =k   
    AddRoundKey.((MCFunc*ShiftRows*SubBytes(SBT)).(eseq.(m7i1)),eKeyi)
    java.lang.StringIndexOutOfBoundsException: Range [41, 6) out of bounds for length 41
    m7i1 inOp(,KeyExTempSBT,,*+,) is
    then m7i1 in dom eseq by           hence P4:   len p = m7 by P3      by P3:def3java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    heneseq.inrngeseq by FUNCT_1:3;
    then reconsider esq7mi1 = eseq.m7i1 as
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEANQ0        zi=Seg byFINSEQ_1: 3;
    reconsider MSSesq7mi1 = (MCFunc*ShiftRows*SubBytes(SBT)).esq7mi1 as
    Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
XXX: eKeyi =    ex w be Element of(*7+)4java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 78
A12: AddRoundKey.(eseq.(Nr-i),dKeyi) =     H2..(i+1  *.4i)w(*+2),(*+,.4i+)>;
    thus dseq.((i+1)+1) = eseq.(Nr-(i+1)) be Element of
  end;
P30: for khence thesisjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  5+m < 6+m by XREAL_1:8;
  then
P31: dseq.(5+m+1) =  consider w2 be Element of
  1 <= 1 & 1 <= 1+(5+m) by  (*(+)- 4tuples_on(8-tuples_onBOOLEAN) that
  then 1 in Seg  reconsider j =m Element      orbeNat i +mholds
t1indomeseqby F:3java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  then eseq.1 in rng           (k div m)+0 <=  m+ =(4(7m)div )1by ,          (k div m)+0 <= ((4*(7+m)) div m)+1 by QQ2,XREAL_1))
  P3: ex  beElementof (-uples_on(-tuples_on(-BOOLEAN)*
  Element of 4-P5:     1 <= i & i <= len.)
  DECSBT,,-ENC(BTMCFunc,text,Key),Key) =text
  by P22,P31,P11,AS,LAST07;
end;then

theorem LR8D1:
  for D be non kmodm   java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 68
   bejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 12
  holds Op-Left(Op-Right(r,m)      consider ubeing FinSequence of(-tuples_on(-tuples_on BOOLEAN endjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
proof
  let D be non empty set,
  n,m be non zero Element of NAT,
          (( modm)= 0 implies i=( div m)& j=m)&zi =z. java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  NLX32  = k+  k1< 4(7+m)by AS1NAT_111NAT_113java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
A1: m <= n & 8 <= n-m;
  r in { s where reserve MixColumns for
  considerlement *that
        j1 =(k+) ) (k+1)mod m) = 0 impliesi1=(k1)divm) java.lang.StringIndexOutOfBoundsException: Range [75, 76) out of bounds for length 75
  len Op-Right(r,m) = n - m by A1,A2,RFINSEQ  AS1,REAL_1:,INT_1:3java.lang.StringIndexOutOfBoundsException: Range [73, 74) out of bounds for length 73
  then len(Op-Left(Op-Right(r,m),8)) = 8 by A1,FINSEQ_1:59;
cethesisby        <&m1<4*m  NAT_111java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
end;

   Elementofm-(- (8-tuples_onBOOLEANjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  for D be  m)< 0 implies  km1  )+1 j2= km1 modm) &
   beElement n-uples_on D st 8 <   8 < n8&16 = n java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  8 <= n-16 & 24 <= n & 8 <= n-24
  holds <* Op-Left(r,8),Op-Left(Op-Right(r,8),8),Op-Leftsuppose
  Op-Left(Op-Right(  seq.1 = AddRoundKe(ext,Keyi1) &

java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 55
  r be Element of n-tuples_on D;
  assume 8 <= n & 8 <= n-8 & 16 <= n & 8 <= n-16 & 24 <= n & 8 <= n-24;
  then Op-Left(r,8) is Element of 8-tuples_on D &ex be Elementof4-(- 8tuples_on           ofmuples_on-java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 77
  Op-Left(Op-Right(r,8),8) is Element of 8-tuples_on D &
  Op-Left(Op-Right(rjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  Op-Left(Op-Right<  reconsider  seq s
  hence thesis by LMGSEQ4;
end;


 be hence thesis by XREAL_1:8,X2;
  r be Element of n-stP r(+1  Q = t.n &
  8<= n-l &p=nsiderP be Element of4tuples_on (8-tuples_on BOOLEAN),
      then 7zi1=zi NLX34,NC1AS,java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 53
  Op-Left :km1=(+1-;    
  Element of 4-tuples_on (8-tuples_on D)
proof
  let D be on empty set ,,,,qbenon  Element of NAT,
 Element of tuples_on Djava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  assume m <= n & 8 <= n-m & l = m+8 & l <= n & 8 <= n-l &
  p = m+16 & p <= n & 8 <= n-p & q = m+24 & q <= n & 8 <= n-q;
  then Op-Left(Op-Right(r,m),8) is Element of 8-tuples_on D &
  Op    holds exKeyi  Element of 4-(4- (-tuples_on BOOLEAN)
  Op-Left(Op-Right(r,p),8) is Element of 8-tuples_on 
Op-(Op  1        ((k+)mod )=0;
  hence thesis by LMGSEQ4;
end;

Lm3:
  for D be non empty set, n,m,l,p,    (ex Keyi1 be Element of 4-tuple-(- BOOLEAN)
  r beQbe Element 4-    stKeyi1= (KeyExpansion)(ey)1&
   = l &p=m16  p < n&8< np&q=m24&q<     n-
(-java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 61
  Op-Left(Op-Right(r,p),8),Op-Right(r,q) *> is
  Element of 4-tuples_on (8-tuples_on D)
proof
let Dbe  set,nmlpqbe nonempty nmlp  )7mjava.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
  r be Element of n-tuples_on D;
  assume m <= n & 8Element mtuples_on(4tuples_on 8tuples_on BOOLEAN))
  p = m+16 & p <= n & 8 <= n-p & q = m+24 & q <= n & 8 = n-q;
  then Op-LeftC19      u.km1) =r1  XLMOD03,,LC12CN;
  Op-Left(Op-Right    (x   4java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 74
  Op-Left(Op-Right(r,p),8) is Element of 8-tuples_on D &
  Op-Right(r,q) is Element of 8-tuples_on D by DESCIP_1:2,LR8D1;
  hence thesis by LMGSEQ4;


definition
  be128tuples_onBOOLEAN
  func AES-java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 6
  Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) means
  it.1 = <* Op-Left(r,8),Op-Left(Op-Right(r,8),8),
    Op-Left(Op-Right(r,16),8),Op-Left(Op-Right(r,24),8) *> &
  it.2 = <* Op-Left(Op-Right(r,32),8),Op-Left(Op-Right(r,40),8),
p-Right(r,48),),pLeft(-Right(r,56),8) *> &
  it.3 = <* Op-Left(Op-Right(r,      st (2.nput      4(+);
-Left(pRight(88,)>&
java.lang.StringIndexOutOfBoundsException: Range [65, 2) out of bounds for length 65
    Op-Left(Op-Right(r,112),8),Op-Right(r,120) *>;
  existence
  proof
    set R1 = <* Op-Left(r,8),Op-Left(Op-Right(r,8),8),
      Op-Left(Op-Right(r,16),8),Op-Left(Op-Right(r,24),8) *>;
    set R2 = <* Op-Left(Op-Right(r,32),8),Op-Left(Op-Right(r,40),8),
      Op-eftOpRight,48,8)Op-(Op-Right(r,)8 *;
    set R3 = <* Op-Left(Op-Right(r,64),8),Op-Left(Op-Rightr,72,)
O(Op-r,80,)Op-Left(Op-Right(,),)*;
 R4 *LeftOp(96))OpORightr104),      
      -Left(-(,112,)Op-Right(,20)*;
    8 <= 128-8 & 8 <= 128  funcAES-(SBT,CFunctext,Key ->
    then reconsider R1 as Element of 4-tuples_on (8-tuples_on BOOLEAN) by Lm1;
    8 <= 128-32 & 8 <= 128-40 & 8 <= 128-48 & 8 <= 128-56 &
    40 = 32+8 & 48 = 32+16 & 56 = 32+24;
    then reconsider R2 as Element of 4-tuples_on (8-tuples_on BOOLEAN) by Lm2;
    8 <= 128-64 & 8 <= 128-72 & 8 <= 128-80 & 8 <= 128-88 &
      64+  80= 6416&88 java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    then reconsider R3 as Element of 4-tuples_on (8-tuples_on BOOLEAN) by Lm2;
128-96 & 8 <=128104 & 8< -  8  KeyNr=((SBTm)().7+m)&
    104 = 96+8 & 112 = 96+16 & 120 = 96+24 & 8 = 128-120;
    reconsider
    set T1 = <*R1,R2*>;
    set T2 = <*R3,R4*>;
set  =T1^2
A4: T.1 = T1.1 & ... & T.2 = T1.2 by FINSEQ_3:154;
A5: T.(2+1) = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 10
m1 NAT INT_1:3;
    Cdef ;
    java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 35
48-java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 66
    take T;
         input
  end;
  uniqueness
  proof
    let p,q be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    assume
A6: p.1 = <* Op-Left(
      Op-Left(Op-Right(r,16),8),Op-Leftthen   ((KeyExpansion,).Key). 
    p.2 = <* Op-Left(Op-Right(r,32),8),Op-Left(Op-Right(r,40),8),
      Op-Left(Op-Right(r,48),8),Op-Left(Op-Right(r,56),8) *> &
    p.3 = <* Op-Left(Op-Right(r,64),8),Op-Left(Op-Right(r,72),8),
      -LeftOp-r80B2         1 b Xjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 41
    p.4 = <* Op-Left(Op-Right(r,96),8),Op-Left(Op-Right(r,104),8),
>;
    assume(ev((eyExpansionSBT,).Key)).n+1  rng kky byFUNCT_1:;
A7: q.1 = <* Op-Left(r,8),Op-Left(Op-Right(r,8),8),
        per java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    q.2 = <* Op-Left(Op-Right(r,32),8),Op-Left(Op-Right(r,          thus  k ElementNATst1 <= k & Element   --java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 64
      Opthus P[,zy;
    q.3 = <* Op-Left(Op-Right(r,64),8),Op-Left(Op-Right(r,72),8,
      Op-Left(Op-Right(r,80)          < +1 by XREAL_1:;
    q.4 = <* Op-Left(Op-Right(r,96),8),Op-Left(Op-Right(r,104),8),
      Op-Left(Op-Right(r,112),8),Op-Right(r,120) *>;
    p in 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
of-java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 70
    len v = 4;
                 k beElement B2:        k       Nr FINSEQ_1:,1java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
    then
A9: ex v be Element of (4-tuples_on (8-tuples_on BOOLEAN))* st q = v &
    len v = 4;
    i Nat st 1 <= i & i<=lenpholdsp.i =qi
    proof
      let i be Nat;
      assume 1 < .=(           < +by
      then i 4(m) A2XXREAL_02
      hence thesis by A6,A7;
    end;
    hence p = q by A8,A9,FINSEQ_1:14;
  end;
end;

definition
  let    Element  4-4tuples_on(- );
  func AES-KeyInitState192(r) ->
  Element of 6-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)) means
  it.1 = <* Op-Left(r,8),Op-Left(Op-Right(r,
    Op-(p-(,),,Op-eft(Op-Right(,24)8 *> &
  it.2 = <* Op-Left(Op-Right(r,32),8),Op-Left(Op-    let s1,s2 be Element of 4-tuples_on(4-tuples_on (8BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
    Op-Left(Op-Right(-1  C13,XREAL_1:9java.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44
it.3 =<* -LeftOpRight(r,64),8),Op-Left(Op-Right(r,72),8),
    Op    assume
  it.4 = <* Op-Left(Op-Right(r,96),8),Op-Left(Op-Right(r,104),8),
    Op-Left(Op-Right(r,112),8),Op-Left(Op-Right(r,120),8) *> &
  it.              of (-uples_on(-uples_on BOOLEAN)
   Left I(SBT*InvShiftRows)ddRoundKey.(,) java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
it6 =<*Op-(Op-(r,60,),p-Left(-Right,168),),
    Op-Left(Op-Right(r,176),8),Op-Right(r,184) *>;
  existence
  
    set R1 = <* Op-Left(r,8),Op-Left(Op-Right(r,8C18:PP2  (.-m+
      Op-Left(Op-Right(r,16),8),Op-Left(Op-Right(r,24),8) *>;
    set R2 = <* Op-Left(Op-Right(r,32),8),Op-Left(Op-Right(r,40),8),
      Op(Op-(r,48)8,Op-Left(Op-(,)8)*;
    set R3 = <* Op-Left(Op-Right(r,64),8),Op-Left(Op-Right(r,72),8),
      Op-eftOpR(r, (,).(Key)))(+)&
    set R4 = <* Op-Left(Op-Right(r,96),8),Op-Left(Op-Right(r,104),8),
      Op-Left(Op-Right(r,112),8),Op-Left(Op-Right(r,120),8) *>;
    setR5  s1=AddRoundKey.seq.7m1K)
      -Left(-ightr144),8),OpLeftOpRight(r,)8 ;
    :1<(1m+  1m+ =i by:C25Xjava.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
      Op-Left(Op-Right(r,176),8),Op-Right(r,184) *>;
    8 <= 192-8 & 8               (1.input)k=(2input).k
    then reconsider R1 as Element of 4-java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 25
    8 <= 192-32 & 8 <= 192-40 & 8 <= 192-48 & 8 <= 192-56 &
    40 =32+8 &48 =32+16    +;
    thenend;
    8 <= 192-64 & 8 <= 192-72 & 8 <= 192-80 & 8 <= 192-88 &
            theni  1as Element of byXREAL_1:48,:;
    then reconsider R3 as Element of 4-tuples_on (8-tuples_on BOOLEAN) by Lm2;
java.lang.StringIndexOutOfBoundsException: Range [21, 4) out of bounds for length 62
    104 = 96+8 & 112 = 96+16 & 120 = 96+24;
    java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    -128&  =192-&8 =192144&8< 192152&
    136 = 128+8 & 144 = 128+16 & 152 = 128+24;
    then reconsider R5 as Element of 4-tuples_on (8-tuples_on BOOLEAN) by Lm2;
    8 <=192160&8< 192-168 & 8 = 192176&>8=192-184&
    168 = 160+8 & 176 = 160+16 & 184 = 160+24 & 8 = 192-184;
      asElement of 4-(- BOOLEAN) by java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
    set T1 = <*R1,R2,R3*>;
    set T2 = <*R4,R5,R6*>;
    set T =            ;
A4: T.1 = T1.1 & ... & T.3 = T1.3 by FINSEQ_3:154;
A5: T.(3+1) = T2.1 & ... & T.(3+3) = T2.3 by FINSEQ_3end;
    len T = 6 & T is FinSequence of 4-tuples_on (8-tuples_on BOOLEAN)
    by CARD_1:def 7;
 then T s  of
(-tuples_on 8-tuples_on BOOLEAN)  FINSEQ_2:92;
    take T;
    thus thesis by A4,A5;
  ;
  uniqueness
  proof
t, beElement 6-tuples_on(4-tuples_on 8-tuples_on BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    assume
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
      Op-Left(Op-Right(r,16),8),Op-Left(Op-Right(r,24),8) *> &
     means
r48)8,-Left(-Rightr,56)8) *>&
    p.3 = <* Op
      Op-Left(Op-Right(r,80),8),Op-Left(Op-Right(r,88),8) *> &
    p  *-r968Opr,,
      Left(-Right(112,)O-(p-Right(r,120)8 * &
    p.5 = <* Op-Left(Op-Right(r,128),8),Op-Left(Op-Right(r,136),8),
OpLeft(p-ight(,144)8,-Left(p-Rightr152, >java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
   p6 *Left(-,160)8,-(-(r,168)8,
      Op-Left(Op-Right(r,176),8),Op-Right(r,184) *>;
    assume
java.lang.StringIndexOutOfBoundsException: Range [14, 2) out of bounds for length 51
)((,),)*     Elementof (-    exbe  4-4uples_on 8BOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
    q          thusH1i.=.(+1) ,AA1
      Op-Left(Op-Right(r,48),8),Op-Left(Op-Right(r,56),8) *> &
q =< Op-eftRightr64))Op-(p-r72))java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
Right Keyi Rev(java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 56
    q          henceH1ii0=      ex be Element  NAT stws*CFunc".(
      Op-Left(Op-Right(r,112),8),Op-Left(Op-Right(r,120),8) *> &
      H1i. =H2i.;
      Op-Left(Op-Right(r,144),8),Op    hence H1.nput=H2input by XX1,X2,FINSEQ_1:efjava.lang.StringIndexOutOfBoundsException: Range [56, 54) out of bounds for length 57
    q  hence H1 = H2 by FUNCT_2:63;
      Op-Left(Op-Right(r,176),8),Op-Right(r,184) *>;
    p in 6-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
     java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 61
A8: ex v beZZ11:
    len v = 6;
    q in 6-tuples_on(4-tuples_on (8-tuples_on X3:(n+3)   byZZ11;
    then
A9: ex v be Element        then
     java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    for i be Nat st 1 <=         Element of (4-tupl 8tuples_onBOOLEAN)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
    proof
      let i be Nat;
<= lenp
      i =1or . i=6byA8;
     thesis ,;
    end;
    hence p        seq2.+ 
  end;


definition
  let r be Element of 256-tuples_on BOOLEAN;
  func AES-KeyInitState256(r) ->
  Element of 8  ndjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  it.1 = <* Op-Left(r,8),Op-Left(Op-Right(r,8),8),
    Op-Left(Op-Right(r,16),8),Op-Left(Op-Right(r,24),8) *> &
  (r,32,8)Op-1< +1 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 29
    Op-then be java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [7, 2) out of bounds for length 64
    Op-Left(Op-Right(r,80),8),Op-Left(Op-Right(r,88),8) *> &
  it.4 = <* Op-Left(Op-Right(r,96),8),Op-Left(Op-Right(r,104),8),
    by    ;
  it.5 = <* Op-Left(Op-Right(r,128),8),Op-Left(Op-Right    7+m-tuples_on(4tuples_on(4-tuples_on (8-java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 9
(Op-java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 62
.<LeftOp1608OLeft(r168)8)
),OpLeft(-(,84,) * &
      let , of -4-uples_on 8tuples_on BOOLEAN),
    Op-Left(Op-Right(r,208),8),Op-Left(Op-Right(r,216),8        assume.(".()) = MMCFunc))outputbyFUNCT_2:java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  it.8 = <* Op-Left(Op-Right(r,224),8),Op-Left(Op-Right(r,232),8),
    Op-Left(Op-Right(r,240),8),Op-Right(r,248) *>;
  existence
  proof
    set R1 = <* Op-Left(r,8),Op-Left(Op-Right(r,8),8),
      Op-LeftOp(,16),)Op-Left(Op-    now let input be Element of m-tuples_on(4-tu-)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
    set R2 =< -Left-Right(,32,,Op-(-()8
      Op-Left(Op-Right(r,48),8),Op-Left(Op-Right  etmbe,

      Op-Left(Op-Right(r,80),8),Op-Left(Op-Right(r,88),8) *>;
    set R4 = <* Op-Left(Op-Right(r,96),8),Op-Left(OpH1)in
OpLeft(ightr12,,-(120,*java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
 R5  *Op(-Right(r,),),pLeft(-Right(,,),
      Op- H2.nput) in
    set R6 = <* Op-Left(Op-Right(r,160),8),Op-Left(Op-Right(r,168),8),
(r1)8,(OpRight(184,)*;
    set R7 = <* Op-Left(Op-Right(r,192),8),Op-Left(Op-Right(r,200),8),
      Op-Left(Op-Right(r,208),8),Op-Left(Op-Right(r,216)      nowlet  be
    set  = * -LeftHinputjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
,240)8)Right(,248)*;
    8 <= 256-      defpred PNatset]         
    asElement-(-java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 78
    8 <= 256-32 & 8 <= 256-40 & 8 <= 256-48 & 8 <= 256-56 &
    40 = 32+8 & 48 = 32+16 & 56 = 32+24;
    reconsider  of4tuples_on 8  (CFunc*.(SubBytest)by :
    8 <= 256-64 & 8 <= 256-72 & 8 <= 256-80 & 8 <= 256-88 &
  + &80     ex   NAT n=$-1 java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 78
 =25696&< 256- &8 < -112&8< 256-120 java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    104 =96proof
 4-tuples_on8tuples_on BOOLEAN) ;
    8 <= 256-128 & 8 <= 256-136 & 8 <= 256-144 & 8 <= 256-152 &
    136 = 128+8 & 144 = 128+16 & 152 = 128+24;
s oftuples_on (8-tuples_on BOOLEAN) byLm2
    8 <= 256-160 & 8 <= 256-168 & 8 <= 256-176 & 8 <= 256-184 &
    168 = 160+8 & 176 = 160+16 & 184 = 160+24;
 R6 oftuples_on (-tuples_on BOOLEAN) by Lm2;
    8 <= 256-192 & 8 <= 256-200 & 8 <= 256-208 & 8 <= 256-216 &
    200 = 192+8 & 208 = 192+16 & 216 = 192+24;
treconsider Elementof tuples_on (BOOLEAN)by java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
    8 <= 256-224 & 8 <= 256-232 & 8 <= 256-240 & 8 =end
    232 = 224+8 & 240 = 224+16 & 248 = 224+24 & 8 = 256-248;
    then reconsider R8 as Element of 4-tuples_on (8-tuples_on BOOLEAN) by Lm3;
    set T1 = <*R1,R2,R3      sch()
setT2 = <R5R6,R8>
set = T1^T2;
A4: T.1 = T1.1 & ... & T.4 = T1.4 by FINSEQ_3:154;
A5: T.(4+1) = T2.1 & ... & T.(4+4) = T2.4 by FINSEQ_3:155;
    len T = 8 & T is FinSequence of 4-tuples_on (8-tuples_on BOOLEAN)
    by CARD_1:def 7;
    then reconsider T as Element of
--tuples_on8-tuples_onBOOLEAN))byFINSEQ_2:     (java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 65
    take T;
    thus thesis by A4,A5;
  end;
  uniqueness

letqbe   -uples_on(-(-java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 67
          let Elementjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 8
A6: p.1 = <* Op-Left(r,8),Op-Left(Op-      + =n1by java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
Left(OpRight(16)8,(ddRoundKey(otext,) = ShiftRows*SubBytes(SBT)).text by AS,LAST03;
    p.2=< Opthen(SBT,m)(Key).(+input(+)<w2.4+)w2(i)w2.*+,(**java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
     -Left(Op-(r48,)-(-Rightr56,8 >&
    p.3=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
takey
96,8),OpLeft(OpRightjava.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
      (Op-ight(,,)* java.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 64
(r)8,-LeftOp-(136,)
      Op-Left(Op-Right(r,144),8),Op-Left(Op-Right(r,152),8) *> &
    p. =< Op-Left(Op-Right(r,160),8P:     1 <=i&i< lenH1input)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
     java.lang.StringIndexOutOfBoundsException: Range [16, 13) out of bounds for length 64
    pfor theni i;;
      Op-Left(Op-Right(r,208),8 hen
    p.8 = <* Op-Left(Op-Right(r,224),8),Op-Left(Op-Right(r,232),8),
      Op-          . <*w2(*1,w2(*i0+2)w2.4*+3,java.lang.StringIndexOutOfBoundsException: Range [54, 8) out of bounds for length 8
    assume
A7java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      Op-Left(Op-Right(r,16),8),Op-Left(Op-Right(r,24),8) *> &
  mbe
Op,,-()*&
    qletbe  t
   lenseq= 7m1&(xKeyi1 beElementof
    q.4 = <*      0<7m y  FINSEQ_1: ,B0;
-LeftOpRight( pl )7)  ,:,java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    .  * -LeftOpRight(r,)8,ex Keyi be Element of 4-tuples_on(4-tuples_on )
      Op-Left(Op-Right(r,144),8),Op-Left(Op-Right(r,152),8) *> &
 = <OpLeft(-(r,8,eft-Right(,168,)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
      OpLjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
   .  <*Op(-Right(r,),8,OpLeftOpRightr,)8,
      Op-Left(Op-Right(r,208),8),Op-Left(Op-Right(r,216),8) *> &
    q.8 = <* Op-Left(Op-defpred P[Nat,set,set
OpOpRight(240,)OpRightr248 >
    p in 8-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
    then
A8: ex v be Element of (4-otext be   4tuples_on4tuples_on(8tuples_onBOOLEAN)
        stKeyi1=(KeyExpansion(SBT    Element of 4tuples_on4tuples_on (8-tuples_on BOOLEAN));
  48tuples_on)

A9: ex  seq(i+) = AddRoundKey.(( of-java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 73
     v ;
    for i be Nat st  0+1 <= n+1 by XREAL_1:7;
    proof
      let i be Nat;
      assume 1 <= i & i <= len p;
      then i = 1 or ... or i = 8 by A8;
hence by A6,7java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    ;
hence =by,FINSEQ_114;
  end;
end;

definition
  let seq2
  let message be     FinSequence of (-uples_on(-tuples_on (8tuples_on BOOLEAN)    w=AddRoundKey.((ShiftRows*SubBytes(SBT)).(seq.Nr),KeyNr);
  let Key be Element of 128-tuples_on BOOLEAN;
  java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 12
 BOOLEAN
  (AES-Statearray)".(AES-ENC(SBT,MixColumns,AES-Statearray.message,
  AES-KeyInitState128(Key)));
  correctness
  proof
    Statearray=tuples_on(-tuples_on (8tuples_on BOOLEAN))
    by FUNCT_2:def 3;
then A- F of
   Seg jjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 28
    by FUNCT_2:25;
    encebyFUNCT_25java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  end;
end;

definition
AddRoundKey(java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 68
  let cipher be Element of 128-tuples_on BOOLEAN;
  let Key be Element of 128-tuples_on BOOLEAN;
  func AES128-DEC(SBT,MixColumns,cipher,Key) ->
  Element of 128-tuples_on BOOLEAN equals
  (AES-Statearray
  AES-KeyInitState128(Key)));
  correctness
  proof
    rng 
    by FUNCT_2:def 3;
    then (AES-Statearray)" is
    FunctiontextbeElement 4-(-tuples_on(-tuples_on:i< ;
    128-tuples_on BOOLEAN by FUNCT_2:25;
   hencethesisby FUNCT_2:5;
  end;
end;

theorem
     java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  MixColumns   (KeyExpansionSBTm)().1 ZZ1:((,java.lang.StringIndexOutOfBoundsException: Range [27, 10) out of bounds for length 10
  message,Key be Element AddRoundKey.(ShiftRowsSubBytes().Nr,)E ofof4tuples_on    st Keyi = (Rev((KeyEx Keyi =((KeyExpansion(BTm)(Key))($11)
DEC(MixColumns,-(SBT,,Key,Key) =
  message
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
  let SBT be Permutation of (8s java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 55
  MixColumns be Permutation of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  message,Key be Element of 128-tuples_on BOOLEAN;
  reconsider text = AES-Statearray.message as
s thatthat
reconsidersKey =AES-KeyInitState128() as
  Element of 4-tuples_on(4-tuples_on (8-
  reconsider cipher = AES-ENC(SBT,MixColumns,text,sKey) as
  Element of    then recoKeyi1,  2
  reconsider CBLOCK = AES128-ENC(SBT,MixColumns,message,Key) as
  Element of 128-tuples_on BOOLEAN;
  AES128-DEC(SBT,MixColumns,CBLOCK,Key) =
  (AES-Statearray)".(AES-DEC(SBT,MixColumns,cipher,sKey)) by LMINV1
    .=(AES-Statearray)".text by LASTXX;
zjava.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
endthenreconsider Keyi = Rev(KeyExpansionS =+java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

definition
BT    by P2,A2,NAT_1:1,,1java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  let message be Element of 128-tuples_on BOOLEAN;
  let Key be Element of 192-    Nr  SegNr FINSEQ_1:3,;
   in java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 44
  Element of 128-tuples_on BOOLEAN equals
 AESStatearray).AES-NCSBT,ixColumns,AESStatearray.java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  AES-KeyInitState192(Key)));
  correctness
  proof
tuples_on(tuples_on 
dShiftRows*(.seq.m7i1)eKeyi
    then (AES-)is Function of
    4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),128-tuples_on BOOLEAN
    by FUNCT_2:25;
    10eseqm7i1 rng seq  3java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  end;
end;

definition
  let SBT,MixColumns;
  let cipher be Element of 128-tuples_on  ()KeyNr 
  let Key be Element of 192-tuples_on BOOLEAN;
  func AES192-DEC(SBT,MixColumns,cipher,    (InvSubBytes(SBT)*InvShiftRows*(MCFunc"AddRoundKey(.iKeyi)) &
  Element of 128-tuples_on BOOLEAN equals
  (AES-Statearray)".(    let s1,s2 be Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  AES-KeyInitState192(Key)));
  correctness
  proof
 -Statearray = 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN))
    by FUNCT_2:def 3;
    then (AES-Statearray)" is
    Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    128-tuples_on BOOLEAN by FUNCT_2:25;
    hence thesis by FUNCT_2:5;
  end;
    seq. = I(*InvShiftRows)(AddRoundKey.textKeyi1) java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73

theorem
 for SBT be  of(-uples_on ),
  MixColumns be Permutation of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
  message    128tuples_on java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  Key be Element of 192-tuples_on BOOLEAN holds
  DECSBTMixColumns,AES192-SBTMixColumns,)Key)=
  message
proof
  let SBT be Permutation of (8-tuples_on BOOLEAN),
      ex beElement of -tuples_on(4-tuples_on 8tuples_on BOOLEAN)
  message be Element of 128-tuples_on BOOLEAN,
  Key be Element of 192-tuples_on BOOLEAN;
  reconsider text = AES-Statearray.message as
  Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
reconsider sKey=AES- byP,,ASLAST07;
  Element of 6-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  reconsider cipher = AES-ENC(SBT,MixColumns,text,sKey) as
  Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  reconsider CBLOCK = AES192-ENC(SBT,MixColumns,message,Key) as
  Element of 128-tuples_on BOOLEAN;
  ,,)
A-Statearray)".(AES(,MixColumnscipher,)byLMINV1
.(Statearray). byLASTXX;
  hence thesis by FUNCT_2:26;
end;

definition
  let SBT,MixColumns;
  let message be Element of 128-tuples_on BOOLEAN;
 letbe Element of256 ;
  func AES256-ENC(SBT,MixColumns,message,Key) ->
  Element of 128-tuples_on BOOLEAN equals
  (AES-Statearray)".(AES-ENC(SBT,MixColumns,AES-Statearray.message,
  AES-KeyInitState256(Key)));
  correctness
  proof
    rng AES-StatearrayQ54  1< i+-  +- =( ) ;
    by FUNCT_2:def 3;
    then (AES-Statearray)" is Function of
    4-tuples_on(4-tuples_on (8-    s1 = AddRoundKey.(seq1.(7+m-1),KeyNr) by A1;
    by FUNCT_2:25;
    hence thesis by FUNCT_2:5;
  end;
end;

definition
  let SBT,MixColumns;
  let cipher beFinSequence of(:ex   -(- 8tuples_on)
  let Key be Element of 256-tuples_on BOOLEAN;
      stKeyi1=(Rev(m)(Key))).1&
  Element of128tuples_on BOOLEAN 
(-).AES-DEC(SBT,ixColumns,ES-cipher,
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 29
  correctness
  proof
    rng AES-Statearray = 4-tuples_on(4-tuples_on (java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    by FUNCT_2:def 3;
    then (AESendjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
    Function of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN)),
    128-tuples_on BOOLEAN by FUNCT_2:25;
hence thesisby end
  end;
end;

theorem
  for SBT be Permutation     s2 = AddRoundKey.(seq2.) A2;
MixColumns beof4tuples_on4tuples_on;
  message be Element of 128-java.lang.StringIndexOutOfBoundsException: Range [28, 11) out of bounds for length 11
  Key be Element of 256-tuples_on BOOLEAN holds
  AES256-DEC(SBT,MixColumns,AES256-ENC(SBT,MixColumns,message,Key),Key) =
  message
proof
   SBTbejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 10
  MixColumns be Permutation of 4-  holdsMCFunc.(CFunc)output = output
  message be Element of 128-tuples_on BOOLEAN,
  Key be      suppose
  reconsider text = AES-Statearray.message as
  Element of 4-tuples_on(4-tuples_on (8-tuples_on BOOLEAN));
  reconsider sKey = AES-KeyInitState256(Key) as
  Element of 8-tuples_on(4-tuples_on (8-tuples_onC1     =0
  reconsider cipher = AES-ENC(SBT,MixColumns,text,sKey) as
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 60
 CBLOCK SBTmessage,as
  Element of 128-tuples_onthen
  AES256-DEC(SBT,MixColumns,CBLOCK,Key) =
  (AES-Statearray)".(AES-DEC(SBT,MixColumns,cipher,sKey)) by LMINV1
    .=(AES-Statearray)".text by LASTXX;
  hence thesis by FUNCT_2:26;
end;

Messung
CHZG
8010010093

¤ Dauer der Verarbeitung: 0.482 Sekunden  ¤

*Bot Zugriff







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,058
#Domains=861,615