
theorem LM83:
  for A be non empty closed_interval Subset of REAL,
      a,b be Real st A=[.a,b.]
  ex x be Function of A, BoundedFunctions(A)
    st for s be Real st s in [.a,b.]
         holds
          (s = a implies x.s = [.a,b.] --> 0)
         &
          (s <> a implies x.s = ([.a,s.] --> 1) +* (].s,b.] --> 0))
proof
  let A be non empty closed_interval Subset of REAL,
      a,b be Real;
  assume
A2: A = [.a,b.];
  defpred C[object] means $1 = a;
  deffunc F(object) = [.a,b.] --> 0;
  deffunc G(object) = ([.a,In($1,REAL) .] --> 1)
                      +* (].In($1,REAL),b.] --> 0);
  set B = BoundedFunctions(A);
A3: for s being object st s in [.a,b.]
      holds (C[s] implies F(s) in B) & (not C[s] implies G(s) in B)
  proof
    let s be object;
    assume A4: s in [.a,b.]; then
    reconsider r=s as Real;
    thus C[s] implies F(s) in B
    proof
      assume C[s];
      set f1 = [.a,b.] --> 0;
A7:   dom f1 = A by A2,FUNCOP_1:13;
      rng f1 c= REAL; then
      reconsider f = [.a,b.] --> 0 as Function of A,REAL by A7,FUNCT_2:2;
      reconsider r0=0 as Real;
      for r be ExtReal st r in PreNorms f holds r <= r0
      proof
        let r be ExtReal;
        assume r in PreNorms f; then
        consider t be Element of A such that
A8:       r = |.f.t.|;
        f.t = 0 by A2,FUNCOP_1:7;
        hence r <= r0 by A8;
      end; then
      r0 is UpperBound of PreNorms f by XXREAL_2:def 1; then
      PreNorms f is bounded_above by XXREAL_2:def 10; then
      f|A is bounded by C0SP1:18;
      hence F(s) in B;
    end;
    G(s) in B
    proof
      set g1 = [.a,In(s,REAL) .] --> 1;
      set g2 = ].In(s,REAL),b.] --> 0;
B9:   a <= r & r <= b by A4,XXREAL_1:1;
A10:  dom g1 = [.a,In(s,REAL).] & dom g2 = ].In(s,REAL),b.]
                 by FUNCOP_1:13; then
A11:  dom g1 \/ dom g2 = A by A2,B9,XXREAL_1:167; then
A12:  dom(g1+*g2) = A by FUNCT_4:def 1;
      rng(g1+*g2) c= REAL; then
      reconsider f = ([.a,In(s,REAL) .] --> 1) +* (].In(s,REAL),b.] --> 0)
        as Function of A,REAL by A12,FUNCT_2:2;
      reconsider r0=1 as Real;
      for c being object st c in dom g1 /\ dom f holds |.f.c.|<=r0
      proof
        let c be object;
        assume c in dom g1 /\ dom f; then
A16:    c in dom g1 by FUNCT_4:10,XBOOLE_1:28; then
        |.g1.c.| = 1 by FUNCOP_1:7; then
        |. (f|dom g1).c.| = 1 by FUNCT_4:33,A10,XXREAL_1:90;
        hence |.f.c.| <= r0 by A16,FUNCT_1:49;
      end; then
A17:  f|(dom g1) is bounded by RFUNCT_1:73;
      reconsider s0=0 as Real;
      for c being object st c in dom g2 /\ dom f holds |.f.c.|<=s0
      proof
        let c be object;
        assume c in dom g2 /\ dom f; then
A18:    c in dom g2 by FUNCT_4:10,XBOOLE_1:28; then
        |.g2.c.| = 0 by FUNCOP_1:7; then
        |. (f|dom g2).c.| = 0 by FUNCT_4:23;
        hence |.f.c.| <= s0 by A18,FUNCT_1:49;
      end; then
      f|(dom g2) is bounded by RFUNCT_1:73; then
      f|A is bounded by A11,A17,RFUNCT_1:87;
      hence G(s) in B;
    end;
    hence thesis;
  end;
  consider x being Function of [.a,b.], B such that
A19: for s being object st s in [.a,b.]
       holds (C[s] implies x.s = F(s))
         & ( not C[s] implies x.s = G(s)) from FUNCT_2:sch 5(A3);
  reconsider x as Function of A,B by A2;
  take x;
  for s be Real st s in [.a,b.] holds
      (s = a implies x.s = [.a,b.] --> 0)
    &
      (s <> a implies x.s = ([.a,s.] --> 1) +* (].s,b.] --> 0 ))
  proof
    let s be Real;
    assume A20: s in [.a,b.];
    In(s,REAL) = s;
    hence thesis by A19,A20;
  end;
  hence thesis;
end;
