reserve a,b,c,d,e for Real;
reserve X,Y for set,
          Z for non empty set,
          r for Real,
          s for ExtReal,
          A for Subset of REAL,
          f for real-valued Function;

theorem Th16:
  for f be Function of Z,REAL holds (f is constant iff
  (ex r be Real st f = r (#) chi(Z,Z)))
  proof
    let f be Function of Z,REAL;
    hereby
      assume
A1:   f is constant;
      set y = the Element of rng f;
      consider x be object such that
A2:   x in dom f and
A3:   y = f.x by FUNCT_1:def 3;
      reconsider r = y as Real;
      take r;
      now
        thus
A3BIS:  dom (r (#) chi (Z,Z)) = dom chi(Z,Z) by VALUED_1:def 5
                             .= Z by FUNCT_3:def 3
                             .= dom f by PARTFUN1:def 2;
        thus for z be object st z in dom f holds f.z = (r (#) chi(Z,Z)).z
        proof
          let z be object;
          assume
A4:       z in dom f;
          then (r (#) chi(Z,Z)).z = r * (chi(Z,Z).z) by A3BIS,VALUED_1:def 5
                                 .= r * 1 by A4,FUNCT_3:def 3
                                 .= f.z by A3,A1,A4,A2;
          hence thesis;
        end;
      end;
      hence f = r (#) chi(Z,Z);
    end;
    assume ex r be Real st f = r (#) chi(Z,Z);
    then consider r be Real such that
A5: f = r (#) chi(Z,Z);
    for x,y be object st x in dom f & y in dom f holds f.x = f.y
    proof
      let x,y be object;
      assume that
A6:   x in dom f and
A7:   y in dom f;
      f.x = r * (chi(Z,Z).x) by A5,A6,VALUED_1:def 5
         .= r * 1 by A6,FUNCT_3:def 3
         .= r * (chi(Z,Z).y) by A7,FUNCT_3:def 3
         .= f.y by A5,A7,VALUED_1:def 5;
      hence thesis;
    end;
    hence f is constant;
  end;
