Article COMPL_SP, MML version 4.99.1005

:: COMPL_SP:attrnot 1 => COMPL_SP:attr 1
definition
  let a1 be non empty MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
  attr a2 is bounded means
    for b1 being natural set holds
       a2 . b1 is bounded(a1);
end;

:: COMPL_SP:dfs 1
definiens
  let a1 be non empty MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
To prove
     a2 is bounded
it is sufficient to prove
  thus for b1 being natural set holds
       a2 . b1 is bounded(a1);

:: COMPL_SP:def 1
theorem
for b1 being non empty MetrStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1 holds
      b2 is bounded(b1)
   iff
      for b3 being natural set holds
         b2 . b3 is bounded(b1);

:: COMPL_SP:exreg 1
registration
  let a1 be non empty Reflexive MetrStruct;
  cluster Relation-like non-empty Function-like non empty quasi_total total bounded Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:funcnot 1 => COMPL_SP:func 1
definition
  let a1 be non empty Reflexive MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
  func diameter A2 -> Function-like quasi_total Relation of NAT,REAL means
    for b1 being natural set holds
       it . b1 = diameter (a2 . b1);
end;

:: COMPL_SP:def 2
theorem
for b1 being non empty Reflexive MetrStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1
for b3 being Function-like quasi_total Relation of NAT,REAL holds
      b3 = diameter b2
   iff
      for b4 being natural set holds
         b3 . b4 = diameter (b2 . b4);

:: COMPL_SP:th 1
theorem
for b1 being non empty Reflexive MetrStruct
for b2 being Function-like quasi_total bounded Relation of NAT,bool the carrier of b1 holds
   diameter b2 is bounded_below;

:: COMPL_SP:th 2
theorem
for b1 being non empty Reflexive MetrStruct
for b2 being Function-like quasi_total bounded Relation of NAT,bool the carrier of b1
      st b2 is descending(the carrier of b1)
   holds diameter b2 is bounded_above & diameter b2 is non-increasing;

:: COMPL_SP:th 3
theorem
for b1 being non empty Reflexive MetrStruct
for b2 being Function-like quasi_total bounded Relation of NAT,bool the carrier of b1
      st b2 is ascending(the carrier of b1)
   holds diameter b2 is non-decreasing;

:: COMPL_SP:th 4
theorem
for b1 being non empty Reflexive MetrStruct
for b2 being Function-like quasi_total bounded Relation of NAT,bool the carrier of b1
   st b2 is descending(the carrier of b1) & lim diameter b2 = 0
for b3 being Function-like quasi_total Relation of NAT,the carrier of b1
      st for b4 being natural set holds
           b3 . b4 in b2 . b4
   holds b3 is Cauchy(b1);

:: COMPL_SP:th 5
theorem
for b1 being Element of REAL
for b2 being non empty Reflexive symmetric triangle MetrStruct
for b3 being Element of the carrier of b2
      st 0 <= b1
   holds diameter cl_Ball(b3,b1) <= 2 * b1;

:: COMPL_SP:attrnot 2 => COMPL_SP:attr 2
definition
  let a1 be MetrStruct;
  let a2 be Element of bool the carrier of a1;
  attr a2 is open means
    a2 in Family_open_set a1;
end;

:: COMPL_SP:dfs 3
definiens
  let a1 be MetrStruct;
  let a2 be Element of bool the carrier of a1;
To prove
     a2 is open
it is sufficient to prove
  thus a2 in Family_open_set a1;

:: COMPL_SP:def 3
theorem
for b1 being MetrStruct
for b2 being Element of bool the carrier of b1 holds
      b2 is open(b1)
   iff
      b2 in Family_open_set b1;

:: COMPL_SP:attrnot 3 => COMPL_SP:attr 3
definition
  let a1 be MetrStruct;
  let a2 be Element of bool the carrier of a1;
  attr a2 is closed means
    a2 ` is open(a1);
end;

:: COMPL_SP:dfs 4
definiens
  let a1 be MetrStruct;
  let a2 be Element of bool the carrier of a1;
To prove
     a2 is closed
it is sufficient to prove
  thus a2 ` is open(a1);

:: COMPL_SP:def 4
theorem
for b1 being MetrStruct
for b2 being Element of bool the carrier of b1 holds
      b2 is closed(b1)
   iff
      b2 ` is open(b1);

:: COMPL_SP:exreg 2
registration
  let a1 be MetrStruct;
  cluster empty open Element of bool the carrier of a1;
end;

:: COMPL_SP:exreg 3
registration
  let a1 be MetrStruct;
  cluster empty closed Element of bool the carrier of a1;
end;

:: COMPL_SP:exreg 4
registration
  let a1 be non empty MetrStruct;
  cluster non empty open Element of bool the carrier of a1;
end;

:: COMPL_SP:exreg 5
registration
  let a1 be non empty MetrStruct;
  cluster non empty closed Element of bool the carrier of a1;
end;

:: COMPL_SP:th 6
theorem
for b1 being MetrStruct
for b2 being Element of bool the carrier of b1
for b3 being Element of bool the carrier of TopSpaceMetr b1
      st b3 = b2
   holds (b2 is open(b1) implies b3 is open(TopSpaceMetr b1)) & (b3 is open(TopSpaceMetr b1) implies b2 is open(b1)) & (b2 is closed(b1) implies b3 is closed(TopSpaceMetr b1)) & (b3 is closed(TopSpaceMetr b1) implies b2 is closed(b1));

:: COMPL_SP:attrnot 4 => COMPL_SP:attr 4
definition
  let a1 be TopStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
  attr a2 is open means
    for b1 being natural set holds
       a2 . b1 is open(a1);
end;

:: COMPL_SP:dfs 5
definiens
  let a1 be TopStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
To prove
     a2 is open
it is sufficient to prove
  thus for b1 being natural set holds
       a2 . b1 is open(a1);

:: COMPL_SP:def 5
theorem
for b1 being TopStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1 holds
      b2 is open(b1)
   iff
      for b3 being natural set holds
         b2 . b3 is open(b1);

:: COMPL_SP:attrnot 5 => COMPL_SP:attr 5
definition
  let a1 be TopStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
  attr a2 is closed means
    for b1 being natural set holds
       a2 . b1 is closed(a1);
end;

:: COMPL_SP:dfs 6
definiens
  let a1 be TopStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
To prove
     a2 is closed
it is sufficient to prove
  thus for b1 being natural set holds
       a2 . b1 is closed(a1);

:: COMPL_SP:def 6
theorem
for b1 being TopStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1 holds
      b2 is closed(b1)
   iff
      for b3 being natural set holds
         b2 . b3 is closed(b1);

:: COMPL_SP:exreg 6
registration
  let a1 be TopSpace-like TopStruct;
  cluster Relation-like Function-like non empty quasi_total total open Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:exreg 7
registration
  let a1 be TopSpace-like TopStruct;
  cluster Relation-like Function-like non empty quasi_total total closed Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:exreg 8
registration
  let a1 be non empty TopSpace-like TopStruct;
  cluster Relation-like non-empty Function-like non empty quasi_total total open Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:exreg 9
registration
  let a1 be non empty TopSpace-like TopStruct;
  cluster Relation-like non-empty Function-like non empty quasi_total total closed Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:attrnot 6 => COMPL_SP:attr 6
definition
  let a1 be MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
  attr a2 is open means
    for b1 being natural set holds
       a2 . b1 is open(a1);
end;

:: COMPL_SP:dfs 7
definiens
  let a1 be MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
To prove
     a2 is open
it is sufficient to prove
  thus for b1 being natural set holds
       a2 . b1 is open(a1);

:: COMPL_SP:def 7
theorem
for b1 being MetrStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1 holds
      b2 is open(b1)
   iff
      for b3 being natural set holds
         b2 . b3 is open(b1);

:: COMPL_SP:attrnot 7 => COMPL_SP:attr 7
definition
  let a1 be MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
  attr a2 is closed means
    for b1 being natural set holds
       a2 . b1 is closed(a1);
end;

:: COMPL_SP:dfs 8
definiens
  let a1 be MetrStruct;
  let a2 be Function-like quasi_total Relation of NAT,bool the carrier of a1;
To prove
     a2 is closed
it is sufficient to prove
  thus for b1 being natural set holds
       a2 . b1 is closed(a1);

:: COMPL_SP:def 8
theorem
for b1 being MetrStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1 holds
      b2 is closed(b1)
   iff
      for b3 being natural set holds
         b2 . b3 is closed(b1);

:: COMPL_SP:exreg 10
registration
  let a1 be non empty Reflexive discerning symmetric triangle MetrStruct;
  cluster Relation-like non-empty Function-like non empty quasi_total total bounded open Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:exreg 11
registration
  let a1 be non empty Reflexive discerning symmetric triangle MetrStruct;
  cluster Relation-like non-empty Function-like non empty quasi_total total bounded closed Relation of NAT,bool the carrier of a1;
end;

:: COMPL_SP:th 7
theorem
for b1 being MetrStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1
for b3 being Function-like quasi_total Relation of NAT,bool the carrier of TopSpaceMetr b1
      st b3 = b2
   holds (b2 is open(b1) implies b3 is open(TopSpaceMetr b1)) & (b3 is open(TopSpaceMetr b1) implies b2 is open(b1)) & (b2 is closed(b1) implies b3 is closed(TopSpaceMetr b1)) & (b3 is closed(TopSpaceMetr b1) implies b2 is closed(b1));

:: COMPL_SP:th 8
theorem
for b1 being non empty Reflexive symmetric triangle MetrStruct
for b2, b3 being Element of bool the carrier of b1
   st b2 is bounded(b1)
for b4 being Element of bool the carrier of TopSpaceMetr b1
      st b2 = b4 & b3 = Cl b4
   holds b3 is bounded(b1) & diameter b2 = diameter b3;

:: COMPL_SP:th 9
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
for b2 being Function-like quasi_total Relation of NAT,the carrier of b1 holds
   ex b3 being non-empty Function-like quasi_total closed Relation of NAT,bool the carrier of b1 st
      b3 is descending(the carrier of b1) &
       (b2 is Cauchy(b1) implies b3 is bounded(b1) & lim diameter b3 = 0) &
       (for b4 being natural set holds
          ex b5 being Element of bool the carrier of TopSpaceMetr b1 st
             b5 = {b2 . b6 where b6 is Element of NAT: b4 <= b6} &
              b3 . b4 = Cl b5);

:: COMPL_SP:th 10
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct holds
      b1 is complete
   iff
      for b2 being non-empty Function-like quasi_total bounded closed Relation of NAT,bool the carrier of b1
            st b2 is descending(the carrier of b1) & lim diameter b2 = 0
         holds meet b2 is not empty;

:: COMPL_SP:th 11
theorem
for b1 being non empty TopSpace-like TopStruct
for b2 being non-empty Function-like quasi_total Relation of NAT,bool the carrier of b1
   st b2 is descending(the carrier of b1)
for b3 being Element of bool bool the carrier of b1
      st b3 = rng b2
   holds b3 is centered;

:: COMPL_SP:th 12
theorem
for b1 being non empty MetrStruct
for b2 being Function-like quasi_total Relation of NAT,bool the carrier of b1
for b3 being Element of bool bool the carrier of TopSpaceMetr b1
      st b3 = rng b2
   holds (b2 is open(b1) implies b3 is open(TopSpaceMetr b1)) & (b2 is closed(b1) implies b3 is closed(TopSpaceMetr b1));

:: COMPL_SP:th 13
theorem
for b1 being non empty TopSpace-like TopStruct
for b2 being Element of bool bool the carrier of b1
for b3 being Function-like quasi_total Relation of NAT,bool the carrier of b1
      st rng b3 c= b2
   holds ex b4 being Function-like quasi_total Relation of NAT,bool the carrier of b1 st
      b4 is descending(the carrier of b1) &
       (b2 is centered implies b4 is non-empty) &
       (b2 is open(b1) implies b4 is open(b1)) &
       (b2 is closed(b1) implies b4 is closed(b1)) &
       (for b5 being natural set holds
          b4 . b5 = meet {b3 . b6 where b6 is Element of NAT: b6 <= b5});

:: COMPL_SP:th 14
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct holds
      b1 is complete
   iff
      for b2 being Element of bool bool the carrier of TopSpaceMetr b1
            st b2 is closed(TopSpaceMetr b1) &
               b2 is centered &
               (for b3 being Element of REAL
                     st 0 < b3
                  holds ex b4 being Element of bool the carrier of b1 st
                     b4 in b2 & b4 is bounded(b1) & diameter b4 < b3)
         holds meet b2 is not empty;

:: COMPL_SP:th 15
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
for b2 being non empty Element of bool the carrier of b1
for b3 being Element of bool the carrier of b1
for b4 being Element of bool the carrier of b1 | b2
      st b3 = b4
   holds    b4 is bounded(b1 | b2)
   iff
      b3 is bounded(b1);

:: COMPL_SP:th 16
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
for b2 being non empty Element of bool the carrier of b1
for b3 being Element of bool the carrier of b1
for b4 being Element of bool the carrier of b1 | b2
      st b3 = b4 & b3 is bounded(b1)
   holds diameter b4 <= diameter b3;

:: COMPL_SP:th 17
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
for b2 being non empty Element of bool the carrier of b1
for b3 being Function-like quasi_total Relation of NAT,the carrier of b1 | b2 holds
   b3 is Function-like quasi_total Relation of NAT,the carrier of b1;

:: COMPL_SP:th 18
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
for b2 being non empty Element of bool the carrier of b1
for b3 being Function-like quasi_total Relation of NAT,the carrier of b1 | b2
for b4 being Function-like quasi_total Relation of NAT,the carrier of b1
      st b3 = b4
   holds    b4 is Cauchy(b1)
   iff
      b3 is Cauchy(b1 | b2);

:: COMPL_SP:th 19
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
   st b1 is complete
for b2 being non empty Element of bool the carrier of b1
for b3 being Element of bool the carrier of TopSpaceMetr b1
      st b2 = b3
   holds    b1 | b2 is complete
   iff
      b3 is closed(TopSpaceMetr b1);

:: COMPL_SP:attrnot 8 => COMPL_SP:attr 8
definition
  let a1 be TopStruct;
  attr a1 is countably_compact means
    for b1 being Element of bool bool the carrier of a1
          st b1 is_a_cover_of a1 & b1 is open(a1) & b1 is countable
       holds ex b2 being Element of bool bool the carrier of a1 st
          b2 c= b1 & b2 is_a_cover_of a1 & b2 is finite;
end;

:: COMPL_SP:dfs 9
definiens
  let a1 be TopStruct;
To prove
     a1 is countably_compact
it is sufficient to prove
  thus for b1 being Element of bool bool the carrier of a1
          st b1 is_a_cover_of a1 & b1 is open(a1) & b1 is countable
       holds ex b2 being Element of bool bool the carrier of a1 st
          b2 c= b1 & b2 is_a_cover_of a1 & b2 is finite;

:: COMPL_SP:def 9
theorem
for b1 being TopStruct holds
      b1 is countably_compact
   iff
      for b2 being Element of bool bool the carrier of b1
            st b2 is_a_cover_of b1 & b2 is open(b1) & b2 is countable
         holds ex b3 being Element of bool bool the carrier of b1 st
            b3 c= b2 & b3 is_a_cover_of b1 & b3 is finite;

:: COMPL_SP:th 20
theorem
for b1 being TopStruct
      st b1 is compact
   holds b1 is countably_compact;

:: COMPL_SP:th 21
theorem
for b1 being non empty TopSpace-like TopStruct holds
      b1 is countably_compact
   iff
      for b2 being Element of bool bool the carrier of b1
            st b2 is centered & b2 is closed(b1) & b2 is countable
         holds meet b2 <> {};

:: COMPL_SP:th 22
theorem
for b1 being non empty TopSpace-like TopStruct holds
      b1 is countably_compact
   iff
      for b2 being non-empty Function-like quasi_total closed Relation of NAT,bool the carrier of b1
            st b2 is descending(the carrier of b1)
         holds meet b2 <> {};

:: COMPL_SP:th 23
theorem
for b1 being non empty TopSpace-like TopStruct
for b2 being Element of bool bool the carrier of b1
for b3 being Function-like quasi_total Relation of NAT,bool the carrier of b1
      st rng b3 c= b2 & b3 is non-empty
   holds ex b4 being non-empty Function-like quasi_total closed Relation of NAT,bool the carrier of b1 st
      b4 is descending(the carrier of b1) &
       (b2 is locally_finite(b1) & b3 is one-to-one implies meet b4 = {}) &
       (for b5 being natural set holds
          ex b6 being Element of bool bool the carrier of b1 st
             b4 . b5 = Cl union b6 &
              b6 = {b3 . b7 where b7 is Element of NAT: b5 <= b7});

:: COMPL_SP:th 24
theorem
for b1 being Relation-like Function-like set
      st proj1 b1 is infinite & proj2 b1 is finite
   holds ex b2 being set st
      b2 in proj2 b1 & b1 " {b2} is infinite;

:: COMPL_SP:th 25
theorem
for b1 being non empty set
for b2 being Function-like quasi_total Relation of NAT,bool b1
   st b2 is descending(b1)
for b3 being Function-like quasi_total Relation of NAT,b1
      st (for b4 being natural set holds
            b3 . b4 in b2 . b4) &
         rng b3 is finite
   holds meet b2 is not empty;

:: COMPL_SP:th 26
theorem
for b1 being non empty TopSpace-like TopStruct holds
      b1 is countably_compact
   iff
      for b2 being Element of bool bool the carrier of b1
            st b2 is locally_finite(b1) & b2 is with_non-empty_elements
         holds b2 is finite;

:: COMPL_SP:th 27
theorem
for b1 being non empty TopSpace-like TopStruct holds
      b1 is countably_compact
   iff
      for b2 being Element of bool bool the carrier of b1
            st b2 is locally_finite(b1) &
               (for b3 being Element of bool the carrier of b1
                     st b3 in b2
                  holds Card b3 = 1)
         holds b2 is finite;

:: COMPL_SP:th 28
theorem
for b1 being non empty TopSpace-like being_T1 TopStruct holds
      b1 is countably_compact
   iff
      for b2 being Element of bool the carrier of b1
            st b2 is infinite
         holds Der b2 is not empty;

:: COMPL_SP:th 29
theorem
for b1 being non empty TopSpace-like being_T1 TopStruct holds
      b1 is countably_compact
   iff
      for b2 being Element of bool the carrier of b1
            st b2 is infinite & b2 is countable
         holds Der b2 is not empty;

:: COMPL_SP:sch 1
scheme COMPL_SP:sch 1
{F1 -> non empty set}:
ex b1 being Element of bool F1() st
   (for b2, b3 being Element of F1()
          st b2 in b1 & b3 in b1 & b2 <> b3
       holds P1[b2, b3]) &
    (for b2 being Element of F1() holds
       ex b3 being Element of F1() st
          b3 in b1 & not (P1[b2, b3]))
provided
   for b1, b2 being Element of F1() holds
      P1[b1, b2]
   iff
      P1[b2, b1]
and
   for b1 being Element of F1() holds
      not (P1[b1, b1]);


:: COMPL_SP:th 30
theorem
for b1 being non empty Reflexive symmetric MetrStruct
for b2 being Element of REAL
      st 0 < b2
   holds ex b3 being Element of bool the carrier of b1 st
      (for b4, b5 being Element of the carrier of b1
             st b4 <> b5 & b4 in b3 & b5 in b3
          holds b2 <= dist(b4,b5)) &
       (for b4 being Element of the carrier of b1 holds
          ex b5 being Element of the carrier of b1 st
             b5 in b3 & b4 in Ball(b5,b2));

:: COMPL_SP:th 31
theorem
for b1 being non empty Reflexive symmetric triangle MetrStruct holds
      b1 is totally_bounded
   iff
      for b2 being Element of REAL
      for b3 being Element of bool the carrier of b1
            st 0 < b2 &
               (for b4, b5 being Element of the carrier of b1
                     st b4 <> b5 & b4 in b3 & b5 in b3
                  holds b2 <= dist(b4,b5))
         holds b3 is finite;

:: COMPL_SP:th 32
theorem
for b1 being non empty Reflexive symmetric triangle MetrStruct
      st TopSpaceMetr b1 is countably_compact
   holds b1 is totally_bounded;

:: COMPL_SP:th 33
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct
      st b1 is totally_bounded
   holds TopSpaceMetr b1 is second-countable;

:: COMPL_SP:th 34
theorem
for b1 being non empty TopSpace-like TopStruct
   st b1 is second-countable
for b2 being Element of bool bool the carrier of b1
      st b2 is_a_cover_of b1 & b2 is open(b1)
   holds ex b3 being Element of bool bool the carrier of b1 st
      b3 c= b2 & b3 is_a_cover_of b1 & b3 is countable;

:: COMPL_SP:th 35
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct holds
      TopSpaceMetr b1 is compact
   iff
      TopSpaceMetr b1 is countably_compact;

:: COMPL_SP:th 36
theorem
for b1 being set
for b2 being Element of bool bool b1
   st b2 is finite
for b3 being Element of bool b1
      st b3 is infinite & b3 c= union b2
   holds ex b4 being Element of bool b1 st
      b4 in b2 & b4 /\ b3 is infinite;

:: COMPL_SP:th 37
theorem
for b1 being non empty Reflexive discerning symmetric triangle MetrStruct holds
      TopSpaceMetr b1 is compact
   iff
      b1 is totally_bounded & b1 is complete;

:: COMPL_SP:funcnot 2 => COMPL_SP:func 2
definition
  let a1 be set;
  let a2 be Function-like quasi_total Relation of NAT,a1;
  let a3 be natural set;
  redefine func a2 . a3 -> Element of a1;
end;

:: COMPL_SP:th 38
theorem
for b1 being set
for b2 being MetrStruct
for b3 being Element of the carrier of b2
for b4 being set holds
      b4 in [:b1,(the carrier of b2) \ {b3}:] \/ {[b1,b3]}
   iff
      ex b5 being set st
         ex b6 being Element of the carrier of b2 st
            b4 = [b5,b6] &
             (b5 in b1 & b6 <> b3 or b5 = b1 & b6 = b3);

:: COMPL_SP:funcnot 3 => COMPL_SP:func 3
definition
  let a1 be MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  func well_dist(A2,A3) -> Function-like quasi_total Relation of [:[:a3,(the carrier of a1) \ {a2}:] \/ {[a3,a2]},[:a3,(the carrier of a1) \ {a2}:] \/ {[a3,a2]}:],REAL means
    for b1, b2 being Element of [:a3,(the carrier of a1) \ {a2}:] \/ {[a3,a2]}
    for b3, b4 being set
    for b5, b6 being Element of the carrier of a1
          st b1 = [b3,b5] & b2 = [b4,b6]
       holds (b3 = b4 implies it .(b1,b2) = dist(b5,b6)) &
        (b3 = b4 or it .(b1,b2) = (dist(b5,a2)) + dist(a2,b6));
end;

:: COMPL_SP:def 10
theorem
for b1 being MetrStruct
for b2 being Element of the carrier of b1
for b3 being set
for b4 being Function-like quasi_total Relation of [:[:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]},[:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}:],REAL holds
      b4 = well_dist(b2,b3)
   iff
      for b5, b6 being Element of [:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}
      for b7, b8 being set
      for b9, b10 being Element of the carrier of b1
            st b5 = [b7,b9] & b6 = [b8,b10]
         holds (b7 = b8 implies b4 .(b5,b6) = dist(b9,b10)) &
          (b7 = b8 or b4 .(b5,b6) = (dist(b9,b2)) + dist(b2,b10));

:: COMPL_SP:th 39
theorem
for b1 being MetrStruct
for b2 being Element of the carrier of b1
for b3 being non empty set holds
   (well_dist(b2,b3) is Reflexive([:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}) implies b1 is Reflexive) &
    (well_dist(b2,b3) is symmetric([:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}) implies b1 is symmetric) &
    (well_dist(b2,b3) is triangle([:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}) &
     well_dist(b2,b3) is Reflexive([:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}) implies b1 is triangle) &
    (well_dist(b2,b3) is discerning([:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}) &
     well_dist(b2,b3) is Reflexive([:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]}) implies b1 is discerning);

:: COMPL_SP:funcnot 4 => COMPL_SP:func 4
definition
  let a1 be MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  func WellSpace(A2,A3) -> strict MetrStruct equals
    MetrStruct(#[:a3,(the carrier of a1) \ {a2}:] \/ {[a3,a2]},well_dist(a2,a3)#);
end;

:: COMPL_SP:def 11
theorem
for b1 being MetrStruct
for b2 being Element of the carrier of b1
for b3 being set holds
   WellSpace(b2,b3) = MetrStruct(#[:b3,(the carrier of b1) \ {b2}:] \/ {[b3,b2]},well_dist(b2,b3)#);

:: COMPL_SP:funcreg 1
registration
  let a1 be MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  cluster WellSpace(a2,a3) -> non empty strict;
end;

:: COMPL_SP:funcreg 2
registration
  let a1 be Reflexive MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  cluster WellSpace(a2,a3) -> strict Reflexive;
end;

:: COMPL_SP:funcreg 3
registration
  let a1 be symmetric MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  cluster WellSpace(a2,a3) -> strict symmetric;
end;

:: COMPL_SP:funcreg 4
registration
  let a1 be Reflexive symmetric triangle MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  cluster WellSpace(a2,a3) -> strict triangle;
end;

:: COMPL_SP:funcreg 5
registration
  let a1 be Reflexive discerning symmetric triangle MetrStruct;
  let a2 be Element of the carrier of a1;
  let a3 be set;
  cluster WellSpace(a2,a3) -> strict discerning;
end;

:: COMPL_SP:th 40
theorem
for b1 being non empty Reflexive triangle MetrStruct
for b2 being Element of the carrier of b1
for b3 being non empty set
      st WellSpace(b2,b3) is complete
   holds b1 is complete;

:: COMPL_SP:th 41
theorem
for b1 being set
for b2 being non empty Reflexive symmetric triangle MetrStruct
for b3 being Element of the carrier of b2
for b4 being Function-like quasi_total Relation of NAT,the carrier of WellSpace(b3,b1)
      st b4 is Cauchy(WellSpace(b3,b1)) &
         (ex b5 being Element of the carrier of WellSpace(b3,b1) st
            b5 = [b1,b3] &
             (ex b6 being Element of REAL st
                0 < b6 &
                 (for b7 being natural set holds
                    ex b8 being natural set st
                       b7 <= b8 & b6 <= dist(b4 . b8,b5))))
   holds ex b5 being natural set st
      ex b6 being set st
         for b7 being natural set
               st b5 <= b7
            holds ex b8 being Element of the carrier of b2 st
               b4 . b7 = [b6,b8];

:: COMPL_SP:th 42
theorem
for b1 being set
for b2 being non empty Reflexive symmetric triangle MetrStruct
for b3 being Element of the carrier of b2
      st b2 is complete
   holds WellSpace(b3,b1) is complete;

:: COMPL_SP:th 43
theorem
for b1 being non empty Reflexive symmetric triangle MetrStruct
   st b1 is complete
for b2 being Element of the carrier of b1
   st ex b3 being Element of the carrier of b1 st
        dist(b2,b3) <> 0
for b3 being infinite set holds
   WellSpace(b2,b3) is complete &
    (ex b4 being non-empty Function-like quasi_total bounded Relation of NAT,bool the carrier of WellSpace(b2,b3) st
       b4 is closed(WellSpace(b2,b3)) & b4 is descending(the carrier of WellSpace(b2,b3)) & meet b4 is empty);

:: COMPL_SP:th 44
theorem
ex b1 being non empty Reflexive discerning symmetric triangle MetrStruct st
   b1 is complete &
    (ex b2 being non-empty Function-like quasi_total bounded Relation of NAT,bool the carrier of b1 st
       b2 is closed(b1) & b2 is descending(the carrier of b1) & meet b2 is empty);