reserve i,j,k,n,n1,n2,m for Nat;
reserve a,r,x,y for Real;
reserve A for non empty closed_interval Subset of REAL;
reserve C for non empty set;
reserve X for set;

theorem Th3:
  for f being PartFunc of A,REAL, r holds f is total & rng f = {r}
  iff f=r(#)chi(A,A)
proof
  let f be PartFunc of A,REAL;
  let r;
A1: f=r(#)chi(A,A) implies f is total & rng f={r}
  proof
    assume
A2: f=r(#)chi(A,A);
A3: chi(A,A) is total by RFUNCT_1:62;
    hence f is total by A2;
A4: dom f = A by A2,A3,PARTFUN1:def 2;
    for x being object st x in {r} holds x in rng f
    proof
      let x be object;
      assume x in {r};
      then
A5:   x = r by TARSKI:def 1;
      consider a being Element of REAL such that
A6:   a in dom f by A4,SUBSET_1:4;
      chi(A,A).a = 1 by A6,RFUNCT_1:63;
      then f.a = r*1 by A2,A6,VALUED_1:def 5;
      hence thesis by A5,A6,FUNCT_1:def 3;
    end;
    then
A7: {r} c= rng f by TARSKI:def 3;
    for x being object st x in rng f holds x in {r}
    proof
      let x be object;
      assume x in rng f;
      then consider a being Element of A such that
A8:   a in dom f and
A9:   f.a=x by PARTFUN1:3;
      chi(A,A).a = 1 by RFUNCT_1:63;
      then x = r*1 by A2,A8,A9,VALUED_1:def 5
        .= r;
      hence thesis by TARSKI:def 1;
    end;
    then rng f c= {r} by TARSKI:def 3;
    hence thesis by A7,XBOOLE_0:def 10;
  end;
  f is total & rng f={r} implies f=r(#)chi(A,A)
  proof
    reconsider g=r(#)chi(A,A) as PartFunc of A,REAL;
    assume
A10: f is total;
A11: chi(A,A) is total by RFUNCT_1:62;
A12: dom g = dom chi(A,A) by VALUED_1:def 5
      .= A by A11,PARTFUN1:def 2;
    assume
A13: rng f = {r};
A14: for x being Element of A st x in dom f holds f/.x=g/.x
    proof
      let x be Element of A;
      assume
A15:  x in dom f;
      then f/.x=f.x by PARTFUN1:def 6;
      then
A16:  f/.x in rng f by A15,FUNCT_1:def 3;
      g/.x=g.x by A12,PARTFUN1:def 6
        .= r*chi(A,A).x by A12,VALUED_1:def 5
        .= r*1 by RFUNCT_1:63
        .= r;
      hence thesis by A13,A16,TARSKI:def 1;
    end;
    dom f = dom g by A10,A12,PARTFUN1:def 2;
    hence thesis by A14,PARTFUN2:1;
  end;
  hence thesis by A1;
end;
