 reserve x,y,z for object,
   i,j,k,l,n,m for Nat,
   D,E for non empty set;
 reserve M for Matrix of D;
 reserve L for Matrix of E;
 reserve k,t,i,j,m,n for Nat,
   D for non empty set;
 reserve V for free Z_Module;
 reserve a for Element of INT.Ring,
   W for Element of V;
 reserve KL1,KL2,KL3 for Linear_Combination of V,
   X for Subset of V;
 reserve V for finite-rank free Z_Module,
   W for Element of V;
 reserve KL1,KL2,KL3 for Linear_Combination of V,
   X for Subset of V;
 reserve s for FinSequence,
   V1,V2,V3 for finite-rank free Z_Module,
   f,f1,f2 for Function of V1,V2,
   g for Function of V2,V3,
   b1 for OrdBasis of V1,
   b2 for OrdBasis of V2,
   b3 for OrdBasis of V3,
   v1,v2 for Vector of V2,
   v,w for Element of V1;
 reserve p2,F for FinSequence of V1,
   p1,d for FinSequence of INT.Ring,
   KL for Linear_Combination of V1;

theorem LMThMBF1X0:
  for V being finite-rank free Z_Module,
  F being linear-Functional of V,
  y being FinSequence of V,
  x being FinSequence of INT.Ring,
  X, Y being FinSequence of INT.Ring
  st X = x & len y = len x & len X = len Y &
  (for k being Nat st k in Seg len x holds Y.k = F.(y/.k))
  holds X "*" Y = F.(Sum lmlt (x,y))
  proof
    let V be finite-rank free Z_Module,
    F be linear-Functional of V;
    defpred P[FinSequence of V] means
    for x being FinSequence of INT.Ring,
    X, Y being FinSequence of INT.Ring
    st X = x & len $1 = len x & len X = len Y &
    (for k being Nat st k in Seg len x holds Y.k = F.($1/.k))
    holds X "*" Y = F.(Sum lmlt (x,$1));
    A2: for y being FinSequence of V
    for w being Element of V st P[y] holds P[y^<*w*>]
    proof
      let y be FinSequence of V;
      let w be Element of V such that
      P1: for x being FinSequence of INT.Ring,
      X, Y being FinSequence of INT.Ring
      st X = x & len y = len x & len X = len Y &
      (for k being Nat st k in Seg len x holds Y.k = F.(y/.k))
      holds X "*" Y = F.(Sum lmlt (x,y));
      thus for x being FinSequence of INT.Ring,
      X, Y being FinSequence of INT.Ring
      st X = x & len (y^<*w*>) = len x & len X = len Y &
      (for k being Nat st k in Seg len x holds Y.k = F.((y^<*w*>)/.k))
      holds X "*" Y = F.(Sum lmlt (x,y^<*w*>))
      proof
        let x be FinSequence of INT.Ring,
        X, Y be FinSequence of INT.Ring;
        assume that
        R1: X = x and
        R2: len (y^<*w*>) = len x and
        R3: len X = len Y and
        R4: for k being Nat st k in Seg len x holds Y.k = F.((y^<*w*>)/.k);
        X1: F is additive;
        X2: F is homogeneous;
        set n = len y;
        set X0 = X | n;
        set Y0 = Y | n;
        set x0 = x | n;
        Q0: len (y^<*w*>) = len y + len <*w*> by FINSEQ_1:22
        .= n + 1 by FINSEQ_1:39;
        LN4: len x0 = n by Q0,R2,FINSEQ_1:59,NAT_1:11;
        LN5: len X0 = n by Q0,R1,R2,FINSEQ_1:59,NAT_1:11;
        LN6: len Y0 = n by Q0,R1,R2,R3,FINSEQ_1:59,NAT_1:11;
        LN7: n+1 in Seg (n+1) by FINSEQ_1:4;
        W1: X0 = X | Seg n by FINSEQ_1:def 16;
        W2: Y0 = Y | Seg n by FINSEQ_1:def 16;
        W3: x0 = x | Seg n by FINSEQ_1:def 16;
        Q2: len y = len x0 by Q0,R2,FINSEQ_1:59,NAT_1:11;
        Q3: len X0 = len Y0 by LN5,Q0,R1,R2,R3,FINSEQ_1:59,NAT_1:11;
        for k being Nat st k in Seg len x0 holds Y0.k = F.(y/.k)
        proof
          let k be Nat;
          assume Q31: k in Seg len x0;
          then
          Q34: k in dom y by LN4,FINSEQ_1:def 3;
          Q32: Seg len x0 c= Seg len x by FINSEQ_3:18,Q0,R2,LN4;
          then k in Seg len x by Q31;
          then
          Q33: k in dom (y^<*w*>) by R2,FINSEQ_1:def 3;
          Q35: (y^<*w*>)/.k = (y^<*w*>).k by Q33,PARTFUN1:def 6
          .= y.k by FINSEQ_1:def 7,Q34
          .= y/.k by Q34,PARTFUN1:def 6;
          thus Y0.k = Y.k by W2,LN4,Q31,FUNCT_1:49
          .= F.(y/.k) by R4,Q31,Q32,Q35;
        end; then
        Q4: X0 "*" Y0 = F.(Sum lmlt (x0,y)) by R1,Q2,Q3,P1;
        Q51: n+1 in dom X by LN7,Q0,R1,R2,FINSEQ_1:def 3;
        Q61: n+1 in dom Y by LN7,Q0,R1,R2,R3,FINSEQ_1:def 3;
        Q71: n+1 in dom x by LN7,Q0,R2,FINSEQ_1:def 3;
        Q9: X/.(n+1) = X.(n+1) by Q51,PARTFUN1:def 6
        .= x/.(n+1) by R1,Q71,PARTFUN1:def 6;
        Q103: n+1 in dom (y^<*w*>) by LN7,Q0,FINSEQ_1:def 3;
        Q102: (y^<*w*>)/.(n+1) = (y^<*w*>).(n+1) by Q103,PARTFUN1:def 6
        .= w by FINSEQ_1:42;
        Y/.(n+1) = Y.(n+1) by Q61,PARTFUN1:def 6
         .= F.w by Q0,Q102,R2,R4,FINSEQ_1:4; then
        Q11: X/.(n+1)* Y/.(n+1) = x/.(n+1) * F.w by Q9
        .= F.((x/.(n+1))*w) by X2;
        len mlt (X,Y) = n+1 by Q0,R1,R2,R3,MATRIX_3:6;
        then
        Q85: dom (mlt (X,Y)) = Seg (n+1) by FINSEQ_1:def 3;
        Q82: len mlt (X0,Y0) = n by LN5,LN6,MATRIX_3:6;
        Q88: len ((mlt (X0,Y0)) ^<* X/.(n+1)* Y/.(n+1) *> )
        = len (mlt (X0,Y0)) + len ( <* X/.(n+1)* Y/.(n+1) *> ) by FINSEQ_1:22
        .= n+1 by Q82,FINSEQ_1:39;
        for k being Nat st k in dom (mlt (X,Y))
        holds (mlt (X,Y)).k = ((mlt (X0,Y0)) ^<* X/.(n+1)* Y/.(n+1) *>).k
        proof
          let k be Nat;
          assume V1: k in dom mlt (X,Y); then
          V2: 1<=k & k <= n + 1 by Q85,FINSEQ_1:1;
          set f=((mlt (X0,Y0)) ^<* X/.(n+1)* Y/.(n+1) *>);
AA:       rng X0 c= the carrier of INT.Ring by RELAT_1:def 19;
AB:       rng Y0 c= the carrier of INT.Ring by RELAT_1:def 19;
          per cases;
          suppose k <= n; then
            V3: k in Seg n by FINSEQ_1:1,V2; then
            V4: k in dom (mlt (X0,Y0)) by Q82,FINSEQ_1:def 3;
            V5: k in dom X0 by LN5,V3,FINSEQ_1:def 3;
            V6: k in dom Y0 by LN6,V3,FINSEQ_1:def 3;
            X0.k in rng X0 by V5,FUNCT_1:3;
            then reconsider X0k = X0.k as Element of INT.Ring by AA;
            Y0.k in rng Y0 by V6,FUNCT_1:3;
            then reconsider Y0k = Y0.k as Element of INT.Ring by AB;
            k in dom X by V1,Q0,Q85,R1,R2,FINSEQ_1:def 3;
            then X.k in rng X by FUNCT_1:3;
            then reconsider Xk = X.k as Element of INT.Ring;
            k in dom Y by V1,Q0,Q85,R1,R2,R3,FINSEQ_1:def 3;
            then Y.k in rng Y by FUNCT_1:3;
            then reconsider Yk = Y.k as Element of INT.Ring;
            f.k = (mlt (X0,Y0)).k by V4,FINSEQ_1:def 7
            .= X0k*Y0k by V4,FVSUM_1:60
            .= (X.k)*(Y0.k) by W1,V5,FUNCT_1:47
            .= Xk*Yk by W2,V6,FUNCT_1:47
            .= (mlt (X,Y)).k by V1,FVSUM_1:60;
            hence thesis;
          end;
          suppose not k <= n;
            then n+1 <= k by NAT_1:13;
            then V8: k=n+1 by XXREAL_0:1,V2;
            Seg 1 = dom (<* X/.(n+1)* Y/.(n+1) *>) by FINSEQ_1:38;
            then
            V10: 1 in dom (<* X/.(n+1)* Y/.(n+1) *>) by FINSEQ_1:3;
            Q9: X/.(n+1) = X.(n+1) by Q51,PARTFUN1:def 6;
            then reconsider Xn = X.(n+1) as Element of INT.Ring;
            Q10: Y/.(n+1) = Y.(n+1) by Q61,PARTFUN1:def 6;
            then reconsider Yn = Y.(n+1) as Element of INT.Ring;
            f.k = (<* X/.(n+1)* Y/.(n+1) *>).1
            by Q82,FINSEQ_1:def 7,V8,V10
            .= X/.(n+1)* Y/.(n+1)
            .= (mlt (X,Y)).k by Q9,Q10,V1,V8,FVSUM_1:60;
            hence thesis;
          end;
        end;
        then
        Q8: mlt (X,Y) =(mlt (X0,Y0)) ^<* X/.(n+1)* Y/.(n+1) *>
        by Q85,Q88,FINSEQ_1:def 3;
        QX121: dom x = Seg (n+1) by Q0,R2,FINSEQ_1:def 3
        .= dom (y^<*w*>) by Q0,FINSEQ_1:def 3;
        then
        Q121: dom (lmlt (x,y^<*w*>)) = dom x by Th12;
        dom x0 = Seg n by FINSEQ_1:def 3,LN4
        .= dom y by FINSEQ_1:def 3;
        then
        dom (lmlt (x0,y)) = dom x0 by Th12;
        then
        Q124: dom (lmlt (x0,y)) = Seg n by LN4,FINSEQ_1:def 3;
        then
        Q125: len lmlt (x0,y) = n by FINSEQ_1:def 3;
        len ((lmlt (x0,y)) ^ <* (x/.(n+1))*w *> )
        = len (lmlt (x0,y)) + len ( <* (x/.(n+1))*w *> ) by FINSEQ_1:22
        .= n+1 by Q125,FINSEQ_1:39;
        then
        Q126: dom ((lmlt (x0,y)) ^ <* (x/.(n+1))*w *> )
        = Seg (n+1) by FINSEQ_1:def 3;
        for k being Nat st k in dom (lmlt (x,y^<*w*>))
        holds (lmlt (x,y^<*w*> )).k
        = ((lmlt (x0,y)) ^ <* (x/.(n+1))*w *> ).k
        proof
          let k be Nat;
          assume V1: k in dom (lmlt (x,y^<*w*>));
          then
          V0: k in Seg (n+1) by Q121,Q0,R2,FINSEQ_1:def 3;
          then
          V2: 1<=k & k <= n + 1 by FINSEQ_1:1;
          set f = (lmlt (x0,y)) ^<* (x/.(n+1))*w *>;
          per cases;
          suppose VX3: k <= n; then
            V3: k in Seg n by V2,FINSEQ_1:1;
            V5: k in dom x0 by V3,LN4,FINSEQ_1:def 3;
            V6: k in dom y by V3,FINSEQ_1:def 3;
            XX1: x0.k in rng x0 by V5,FUNCT_1:3;
            rng x0 c= the carrier of INT.Ring by RELAT_1:def 19;
            then reconsider x0k = x0.k as Element of INT.Ring by XX1;
            y.k in rng y by V6,FUNCT_1:3;
            then reconsider y0k = y.k as Element of V;
            k in dom x by V1,QX121,Th12; then
            XX2: x.k in rng x by FUNCT_1:3;
            reconsider xk = x.k as Element of INT.Ring by XX2;
            k in dom (y^<*w*>) by V0,Q0,FINSEQ_1:def 3;
            then (y^<*w*>).k in rng (y^<*w*>) by FUNCT_1:3;
            then reconsider yk = (y^<*w*>).k as Element of V;
W:          y0k = (y^<*w*>).k by FINSEQ_1:def 7,V6 .= yk;
            f.k = (lmlt (x0,y)).k by V3,Q124,FINSEQ_1:def 7
            .= x0k*y0k by V2,VX3,Q124,FUNCOP_1:22,FINSEQ_1:1
            .= (xk)*y0k by V5,W3,FUNCT_1:47
            .= (lmlt (x,y^<*w*>)).k by W,V1,FUNCOP_1:22;
            hence thesis;
          end;
          suppose not k <= n;
            then n+1 <= k by NAT_1:13;
            then
            V8: k=n+1 by XXREAL_0:1,V2;
            Seg 1 = dom (<* (x/.(n+1))*w *>) by FINSEQ_1:38;
            then V10: 1 in dom (<* (x/.(n+1))*w *>) by FINSEQ_1:3;
            Seg 1 = dom ( <*w*> ) by FINSEQ_1:38;
            then
            V11: 1 in dom ( <*w*> ) by FINSEQ_1:3;
            Q9: x/.(n+1) = x.(n+1) by Q71,PARTFUN1:def 6;
            then reconsider xn = x.(n+1) as Element of INT.Ring;
            (y^<*w*>)/.(n+1) = (y^<*w*>).(n+1) by Q103,PARTFUN1:def 6;
            then reconsider yn = (y^<*w*>).(n+1) as Element of V;
            Q11: (y^<*w*>).(n+1) = (<*w*>).1 by V11,FINSEQ_1:def 7
            .= w;
            f.k = (<* (x/.(n+1))*w *>).1 by Q125,V8,V10,FINSEQ_1:def 7
            .= xn*w by Q9
            .= (lmlt (x,y^<*w*>)).k by Q11,V1,V8,FUNCOP_1:22;
            hence thesis;
          end;
        end;
        then
        Q12: lmlt (x,y^<*w*>) = (lmlt (x0,y)) ^ <* (x/.(n+1))*w *>
        by Q0,Q121,Q126,R2,FINSEQ_1:def 3;
        thus X "*" Y = Sum (mlt (X0,Y0)) + X/.(n+1)* Y/.(n+1) by FVSUM_1:71,Q8
        .= F.(Sum lmlt (x0,y) + (x/.(n+1))*w) by Q4,Q11,X1
        .= F.(Sum lmlt (x,y^<*w*>)) by FVSUM_1:71,Q12;
      end;
    end;
    A4: P[<*>(the carrier of V)]
    proof
      let x be FinSequence of INT.Ring,
      X, Y be FinSequence of INT.Ring;
      assume that
      R1: X = x and
      R2: len (<*>(the carrier of V)) = len x and
      len X = len Y and
      for k being Nat st k in Seg len x
      holds Y.k = F.((<*>(the carrier of V))/.k);
      set y = <*>(the carrier of V);
      Q2: X = <*>(the carrier of INT.Ring) by R1,R2;
      Q4: mlt (X,Y) = (the multF of INT.Ring) * <:X,Y:> by FUNCOP_1:def 3
      .= <*>(the carrier of INT.Ring) by Q2;
      Q5: lmlt (x,y) = (the lmult of V) * <:x,y:> by FUNCOP_1:def 3
      .= <*>(the carrier of V);
      reconsider I0 = 0 as Element of INT.Ring;
      X1: F is additive;
      X2: F.(0.V) = F.(0.V+0.V)
      .= F.(0.V) + F.(0.V) by X1;
      thus X "*" Y = 0.INT.Ring by Q4,RLVECT_1:43
      .= F.(Sum lmlt (x,y)) by Q5,X2,RLVECT_1:43;
    end;
    for p being FinSequence of V holds P[p] from FINSEQ_2:sch 2(A4,A2);
    hence thesis;
  end;
