reserve x,y for set,
  n,m for Nat,
  r,s for Real;

theorem
  for R be real-valued FinSequence, n be Nat holds MIM(R) /^ n = MIM(R/^n)
proof
  let R be real-valued FinSequence,n;
  set mf = MIM(R), fn = R/^n, mn = MIM(fn);
A1: len mf = len R by Def2;
A2: len mn = len fn by Def2;
  now
    per cases;
    case
A3:   len R<n;
      then mf /^ n = <*>REAL by A1,Def1;
      hence thesis by A3,Def1,Th12;
    end;
    case
A4:   n<=len R;
      then
A5:   len(mf/^n) = len R - n by A1,Def1;
A6:   len mn = len fn by Def2;
      then
A7:   dom mn = Seg len fn by FINSEQ_1:def 3;
A8:   Seg len(mf/^n) = dom(mf/^n) by FINSEQ_1:def 3;
A9:   len fn = len R - n by A4,Def1;
A10:  Seg len fn = dom fn by FINSEQ_1:def 3;
      now
        let m be Nat;
        set r1 = R.(m+n);
        assume
A11:    m in dom mn;
        then
A12:    1<=m by A7,FINSEQ_1:1;
A13:    m<=len fn by A7,A11,FINSEQ_1:1;
A14:    fn.m = r1 by A4,A10,A7,A11,Def1;
        m<=m+n by NAT_1:11;
        then
A15:    1<=m+n by A12,XXREAL_0:2;
        now
          per cases;
          case
A16:        m = len fn;
            thus (mf/^n).m = mf.(m+n) by A1,A4,A5,A9,A8,A7,A11,Def1
              .= r1 by A1,A9,A16,Def2
              .= mn.m by A6,A14,A16,Def2;
          end;
          case
            m <> len fn;
            then m<len fn by A13,XXREAL_0:1;
            then
A17:        m+1<=len fn by NAT_1:13;
            then
A18:        m<=len fn - 1 by XREAL_1:19;
            set r2 = R.(m+1+n);
A19:        m+1+n = m+n+1;
            1<=m+1 by NAT_1:11;
            then m+1 in dom fn by A17,FINSEQ_3:25;
            then
A20:        fn.(m+1) = r2 by A4,Def1;
            m+1+n<=len R by A9,A17,XREAL_1:19;
            then
A21:        m+n<=len R - 1 by A19,XREAL_1:19;
            thus (mf/^n).m = mf.(m+n) by A1,A4,A5,A9,A8,A7,A11,Def1
              .= r1-r2 by A1,A15,A19,A21,Def2
              .= mn.m by A2,A12,A14,A18,A20,Def2;
          end;
        end;
        hence (mf/^n).m = mn.m;
      end;
      hence thesis by A5,A9,A6,FINSEQ_2:9;
    end;
  end;
  hence thesis;
end;
