 reserve x for set,
         n,m,k for Nat,
         r for Real,
         V for RealLinearSpace,
         v,u,w,t for VECTOR of V,
         Av for finite Subset of V,
         Affv for finite affinely-independent Subset of V;
reserve pn for Point of TOP-REAL n,
        An for Subset of TOP-REAL n,
        Affn for affinely-independent Subset of TOP-REAL n,
        Ak for Subset of TOP-REAL k;
reserve EV for Enumeration of Affv,
        EN for Enumeration of Affn;
reserve pnA for Element of(TOP-REAL n)|Affin Affn;

theorem Th31:
  |--(Affn,x)|Affin Affn is continuous Function of (TOP-REAL n)|Affin Affn,R^1
 proof
  reconsider Z=0 as Element of R^1 by Lm5,TOPMETR:17;
  set TRn=TOP-REAL n;
  set AA=Affin Affn;
  set Ax=|--(Affn,x);
  set AxA=Ax|AA;
  A1: [#]TRn/\AA=AA by XBOOLE_1:28;
  A2: AA=[#](TRn|AA) by PRE_TOPC:def 5;
  then reconsider AxA as Function of TRn|AA,R^1 by FUNCT_2:32;
  A3: dom AxA=AA by A2,FUNCT_2:def 1;
  per cases;
  suppose not x in Affn;
   then Ax=[#]TRn-->Z by Th29;
   then AxA  =(TRn|AA)-->Z by A2,A1,FUNCOP_1:12;
   hence thesis;
  end;
  suppose A4: x in Affn & card Affn=1;
   A5: rng AxA c=the carrier of R^1 by RELAT_1:def 19;
   consider y be object such that
    A6: Affn={y} by A4,CARD_2:42;
   A7: x=y by A4,A6,TARSKI:def 1;
   then Affn is Affine by A4,A6,RUSUB_4:23;
   then A8: AA=Affn by RLAFFIN1:50;
   then AxA.x in rng AxA by A3,A4,FUNCT_1:def 3;
   then reconsider b=AxA.x as Element of R^1 by A5;
   rng AxA={AxA.x} by A3,A6,A7,A8,FUNCT_1:4;
   then AxA =(TRn|AA)-->b by A2,A3,FUNCOP_1:9;
   hence thesis;
  end;
  suppose A9: x in Affn & card Affn<>1;
   set P2=the Enumeration of Affn\{x};
   set P1=<*x*>;
   set P12=P1^P2;
   A10: rng P1={x} & rng P2=Affn\{x} by Def1,FINSEQ_1:39;
   (P1 is one-to-one) & {x}misses Affn\{x} by FINSEQ_3:93,XBOOLE_1:79;
   then A11: P12 is one-to-one by A10,FINSEQ_3:91;
   rng P12=rng P1\/rng P2 by FINSEQ_1:31;
   then rng P12=Affn by A9,A10,ZFMISC_1:116;
   then reconsider P12 as Enumeration of Affn by A11,Def1;
   set TR1=TOP-REAL 1;
   consider Pro being Function of TR1,R^1 such that
    A12: for p being Element of TR1 holds Pro.p=p/.1 by JORDAN2B:1;
   A13: Pro is being_homeomorphism by A12,JORDAN2B:28;
   card Affn>=1 by A9,NAT_1:14;
   then A14: card Affn>1 by A9,XXREAL_0:1;
   now A15: dom P1 c=dom P12 by FINSEQ_1:26;
    let P be Subset of R^1;
    set B={v where v is Element of TRn|AA:(v|--P12)|1 in Pro"P};
    A16: 1 in {1} by FINSEQ_1:2;
    assume P is closed;
    then A17: Pro"P is closed by A13,TOPGRP_1:24;
    A18: dom P1=Seg 1 by FINSEQ_1:38;
    then A19: P12.1=P1.1 by A16,FINSEQ_1:2,def 7
     .=x;
    A20: AA is non empty by A9;
    A21: B c=AxA"P
    proof
     let y be object;
     assume y in B;
     then consider v be Element of TRn|AA such that
      A22: y=v and
      A23: (v|--P12)|1 in Pro"P;
     set vP=v|--P12;
     reconsider vP1=vP|1 as Element of TR1 by A23;
     A24: v in AA by A2,A20;
     len vP1=1 by CARD_1:def 7;
     then dom vP1=Seg 1 by FINSEQ_1:def 3;
     then A25: 1 in dom vP1;
     then A26: 1 in dom vP by RELAT_1:57;
     Pro.vP1=vP1/.1 by A12
      .=vP1.1 by A25,PARTFUN1:def 6
      .=vP.1 by A25,FUNCT_1:47
      .=(v|--Affn).x by A19,A26,FUNCT_1:12
      .=Ax.v by A24,Def3;
     then Ax.v in P by A23,FUNCT_1:def 7;
     then AxA.v in P by A2,A3,A9,FUNCT_1:47;
     hence thesis by A2,A3,A9,A22,FUNCT_1:def 7;
    end;
    A27: dom Pro=[#]TR1 by A13,TOPGRP_1:24;
    AxA"P c=B
    proof
     let y be object;
     set yP=y|--P12;
     len yP=card Affn by Th16;
     then A28: len(yP|1)=1 by A9,FINSEQ_1:59,NAT_1:14;
     then reconsider yP1=yP|1 as Element of TR1 by TOPREAL3:46;
     A29: dom yP1=Seg 1 by A28,FINSEQ_1:def 3;
     assume A30: y in AxA"P;
     then A31: y in dom AxA by FUNCT_1:def 7;
     then AxA.y=Ax.y by FUNCT_1:47
      .=(y|--Affn).(P12.1) by A19,A3,A31,Def3
      .=yP.1 by A18,A16,A15,FINSEQ_1:2,FUNCT_1:13
      .=yP1.1 by A16,A29,FINSEQ_1:2,FUNCT_1:47
      .=yP1/.1 by A16,A29,FINSEQ_1:2,PARTFUN1:def 6
      .=Pro.yP1 by A12;
     then Pro.yP1 in P by A30,FUNCT_1:def 7;
     then yP1 in Pro"P by A27,FUNCT_1:def 7;
     hence thesis by A30;
    end;
    then B=AxA"P by A21;
    hence AxA"P is closed by A14,A17,Th28;
   end;
   hence thesis by PRE_TOPC:def 6;
  end;
 end;
