reserve x,y for set,
        r,s for Real,
        n for Nat,
        V for RealLinearSpace,
        v,u,w,p for VECTOR of V,
        A,B for Subset of V,
        Af for finite Subset of V,
        I for affinely-independent Subset of V,
        If for finite affinely-independent Subset of V,
        F for Subset-Family of V,
        L1,L2 for Linear_Combination of V;

theorem Th24:
  Sum L1 <> Sum L2 & sum L1 = sum L2 implies ex v st L1.v > L2.v
  proof
    assume that
    A1: Sum L1<>Sum L2 and
    A2: sum L1=sum L2;
    consider F be FinSequence such that
    A3: rng F=Carrier(L1)\/Carrier(L2) and
    A4: F is one-to-one by FINSEQ_4:58;
    reconsider F as FinSequence of V by A3,FINSEQ_1:def 4;
    A5: len(L2*F)=len F by FINSEQ_2:33;
    A6: len(L1*F)=len F by FINSEQ_2:33;
    then reconsider L1F=L1*F,L2F=L2*F as Element of len F-tuples_on REAL
      by A5,FINSEQ_2:92;
    A7: len(L2F-L1F)=len F by CARD_1:def 7;
    assume A8: for v be Element of V holds L1.v<=L2.v;
    A9: for i be Nat st i in dom(L2F-L1F) holds 0<=(L2F-L1F).i
    proof
      let i be Nat;
      L2.(F/.i)>=L1.(F/.i) by A8;
      then A10: L2.(F/.i)-L1.(F/.i)>=L1.(F/.i)-L1.(F/.i) by XREAL_1:9;
      assume A11: i in dom(L2F-L1F);
      then i in dom F by A7,FINSEQ_3:29;
      then A12: F/.i=F.i by PARTFUN1:def 6;
      i in dom L2F by A5,A7,A11,FINSEQ_3:29;
      then A13: L2F.i=L2.(F.i) by FUNCT_1:12;
      i in dom L1F by A6,A7,A11,FINSEQ_3:29;
      then L1F.i=L1.(F.i) by FUNCT_1:12;
      hence thesis by A10,A12,A13,RVSUM_1:27;
    end;
    A14: Sum(L2F-L1F)=Sum L2F-Sum L1F by RVSUM_1:90
                    .=sum L2-Sum L1F by A3,A4,RLAFFIN1:30,XBOOLE_1:7
                    .=sum L2-sum L1 by A3,A4,RLAFFIN1:30,XBOOLE_1:7
                    .=0 by A2;
    now let v be Element of V;
      now per cases by A3,XBOOLE_0:def 3;
        suppose A15: not v in Carrier(L1) & not v in Carrier(L2);
          then L1.v=0;
          hence L1.v=L2.v by A15;
        end;
        suppose v in rng F;
          then consider i be object such that
          A16: i in dom F and
          A17: F.i=v by FUNCT_1:def 3;
          reconsider i as Nat by A16;
          i in dom L2F by A5,A16,FINSEQ_3:29;
          then A18: (L2F-L1F).i=L2F.i-L1F.i & L2F.i=L2.v
            by A17,FUNCT_1:12,RVSUM_1:27;
          i in dom L1F by A6,A16,FINSEQ_3:29;
          then A19: L1F.i=L1.v by A17,FUNCT_1:12;
          A20: i in dom(L2F-L1F) by A7,A16,FINSEQ_3:29;
          then L2.v-L1.v<=0 by A9,A14,A18,A19,RVSUM_1:85;
          then L2.v-L1.v=0 by A9,A18,A19,A20;
          hence L1.v=L2.v;
        end;
      end;
      hence L1.v=L2.v;
    end;
    hence contradiction by A1,RLVECT_2:def 9;
  end;
