reserve k,i for Nat;
reserve D for non empty set;

theorem
  for a,b being FinSequence of REAL, n being Nat st len a=len b & n>len
  a holds |(a,b)| = inner_prd_prg(FS2XFS*(a,n),FS2XFS*(b,n))
proof
  let a,b be FinSequence of REAL, n2 be Nat;
  assume that
A1: len a=len b and
A2: n2>len a;
  reconsider rb=b as Element of (len a)-tuples_on REAL by A1,FINSEQ_2:92;
  reconsider ra=a as Element of (len a)-tuples_on REAL by FINSEQ_2:92;
  set ri= inner_prd_prg(FS2XFS*(a,n2),FS2XFS*(b,n2));
  set pa= FS2XFS*(a,n2);
  set pb= FS2XFS*(b,n2);
A3: len b = (pb.0) by A1,A2,AFINSQ_1:def 10,NUMBERS:19;
  len pa=n2 by A2,AFINSQ_1:def 10,NUMBERS:19;
  then consider s being XFinSequence of REAL, n being Integer such that
  len s=len pa and
A4: s.0=0 and
A5: n=pb.0 and
A6: n<>0 implies for i being Nat st i<n holds s.(i+1)=s.i + (pa.(i+1))*
  (pb.(i+1)) and
A7: ri=s.n by A1,A2,A3,Def3;
A8: len mlt(ra,rb)=len a by CARD_1:def 7;
  for i st i<len mlt(a,b) holds s.(i+1)=s.i+(mlt(a,b)).(i+1)
  proof
    let i;
    assume
A9: i<len mlt(a,b);
    then
 1<=i+1 & i+1<=len a by A8,NAT_1:11,13;
then A10: pa.(i+1)=a.(i+1) & pb.(i+1)=b.(i+1)
            by A1,A2,AFINSQ_1:def 10,NUMBERS:19;
A11: i<n by A1,A2,A5,A8,A9,AFINSQ_1:def 10,NUMBERS:19;
    now
      per cases;
      case n<>0;
        s.(i+1)=s.i + (pa.(i+1))*(pb.(i+1)) by A6,A11
          .=s.i+(mlt(a,b)).(i+1) by A10,RVSUM_1:59;
        hence thesis;
      end;
      case n=0;
        hence contradiction by A1,A2,A5,A8,A9,AFINSQ_1:def 10,NUMBERS:19;
      end;
    end;
    hence thesis;
  end;
  then Sum mlt(a,b) =s.n by A1,A3,A4,A5,A8,Th3;
  hence thesis by A7,RVSUM_1:def 16;
end;
