Article METRIC_1, MML version 4.99.1005
:: METRIC_1:structnot 1 => METRIC_1:struct 1
definition
struct(1-sorted) MetrStruct(#
carrier -> set,
distance -> Function-like quasi_total Relation of [:the carrier of it,the carrier of it:],REAL
#);
end;
:: METRIC_1:attrnot 1 => METRIC_1:attr 1
definition
let a1 be MetrStruct;
attr a1 is strict;
end;
:: METRIC_1:exreg 1
registration
cluster strict MetrStruct;
end;
:: METRIC_1:aggrnot 1 => METRIC_1:aggr 1
definition
let a1 be set;
let a2 be Function-like quasi_total Relation of [:a1,a1:],REAL;
aggr MetrStruct(#a1,a2#) -> strict MetrStruct;
end;
:: METRIC_1:selnot 1 => METRIC_1:sel 1
definition
let a1 be MetrStruct;
sel the distance of a1 -> Function-like quasi_total Relation of [:the carrier of a1,the carrier of a1:],REAL;
end;
:: METRIC_1:exreg 2
registration
cluster non empty strict MetrStruct;
end;
:: METRIC_1:funcnot 1 => METRIC_1:func 1
definition
let a1, a2 be set;
let a3 be Function-like Relation of [:a1,a2:],REAL;
let a4 be Element of a1;
let a5 be Element of a2;
redefine func a3 .(a4,a5) -> Element of REAL;
end;
:: METRIC_1:funcnot 2 => METRIC_1:func 2
definition
let a1 be MetrStruct;
let a2, a3 be Element of the carrier of a1;
func dist(A2,A3) -> Element of REAL equals
(the distance of a1) .(a2,a3);
end;
:: METRIC_1:def 1
theorem
for b1 being MetrStruct
for b2, b3 being Element of the carrier of b1 holds
dist(b2,b3) = (the distance of b1) .(b2,b3);
:: METRIC_1:funcnot 3 => FUNCT_5:func 7
notation
synonym Empty^2-to-zero for op2;
end;
:: METRIC_1:funcnot 4 => METRIC_1:func 3
definition
redefine func Empty^2-to-zero -> Function-like quasi_total Relation of [:1,1:],REAL;
end;
:: METRIC_1:funcreg 1
registration
cluster op2 -> Relation-like Function-like natural-valued;
end;
:: METRIC_1:funcreg 2
registration
let a1 be Relation-like Function-like natural-valued set;
let a2, a3 be set;
cluster a1 .(a2,a3) -> natural;
end;
:: METRIC_1:attrnot 2 => METRIC_1:attr 2
definition
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
attr a2 is Reflexive means
for b1 being Element of a1 holds
a2 .(b1,b1) = 0;
end;
:: METRIC_1:dfs 2
definiens
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
To prove
a2 is Reflexive
it is sufficient to prove
thus for b1 being Element of a1 holds
a2 .(b1,b1) = 0;
:: METRIC_1:def 3
theorem
for b1 being set
for b2 being Function-like Relation of [:b1,b1:],REAL holds
b2 is Reflexive(b1)
iff
for b3 being Element of b1 holds
b2 .(b3,b3) = 0;
:: METRIC_1:attrnot 3 => METRIC_1:attr 3
definition
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
attr a2 is discerning means
for b1, b2 being Element of a1
st a2 .(b1,b2) = 0
holds b1 = b2;
end;
:: METRIC_1:dfs 3
definiens
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
To prove
a2 is discerning
it is sufficient to prove
thus for b1, b2 being Element of a1
st a2 .(b1,b2) = 0
holds b1 = b2;
:: METRIC_1:def 4
theorem
for b1 being set
for b2 being Function-like Relation of [:b1,b1:],REAL holds
b2 is discerning(b1)
iff
for b3, b4 being Element of b1
st b2 .(b3,b4) = 0
holds b3 = b4;
:: METRIC_1:attrnot 4 => METRIC_1:attr 4
definition
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
attr a2 is symmetric means
for b1, b2 being Element of a1 holds
a2 .(b1,b2) = a2 .(b2,b1);
end;
:: METRIC_1:dfs 4
definiens
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
To prove
a2 is symmetric
it is sufficient to prove
thus for b1, b2 being Element of a1 holds
a2 .(b1,b2) = a2 .(b2,b1);
:: METRIC_1:def 5
theorem
for b1 being set
for b2 being Function-like Relation of [:b1,b1:],REAL holds
b2 is symmetric(b1)
iff
for b3, b4 being Element of b1 holds
b2 .(b3,b4) = b2 .(b4,b3);
:: METRIC_1:attrnot 5 => METRIC_1:attr 5
definition
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
attr a2 is triangle means
for b1, b2, b3 being Element of a1 holds
a2 .(b1,b3) <= (a2 .(b1,b2)) + (a2 .(b2,b3));
end;
:: METRIC_1:dfs 5
definiens
let a1 be set;
let a2 be Function-like Relation of [:a1,a1:],REAL;
To prove
a2 is triangle
it is sufficient to prove
thus for b1, b2, b3 being Element of a1 holds
a2 .(b1,b3) <= (a2 .(b1,b2)) + (a2 .(b2,b3));
:: METRIC_1:def 6
theorem
for b1 being set
for b2 being Function-like Relation of [:b1,b1:],REAL holds
b2 is triangle(b1)
iff
for b3, b4, b5 being Element of b1 holds
b2 .(b3,b5) <= (b2 .(b3,b4)) + (b2 .(b4,b5));
:: METRIC_1:attrnot 6 => METRIC_1:attr 6
definition
let a1 be MetrStruct;
attr a1 is Reflexive means
the distance of a1 is Reflexive(the carrier of a1);
end;
:: METRIC_1:dfs 6
definiens
let a1 be MetrStruct;
To prove
a1 is Reflexive
it is sufficient to prove
thus the distance of a1 is Reflexive(the carrier of a1);
:: METRIC_1:def 7
theorem
for b1 being MetrStruct holds
b1 is Reflexive
iff
the distance of b1 is Reflexive(the carrier of b1);
:: METRIC_1:attrnot 7 => METRIC_1:attr 7
definition
let a1 be MetrStruct;
attr a1 is discerning means
the distance of a1 is discerning(the carrier of a1);
end;
:: METRIC_1:dfs 7
definiens
let a1 be MetrStruct;
To prove
a1 is discerning
it is sufficient to prove
thus the distance of a1 is discerning(the carrier of a1);
:: METRIC_1:def 8
theorem
for b1 being MetrStruct holds
b1 is discerning
iff
the distance of b1 is discerning(the carrier of b1);
:: METRIC_1:attrnot 8 => METRIC_1:attr 8
definition
let a1 be MetrStruct;
attr a1 is symmetric means
the distance of a1 is symmetric(the carrier of a1);
end;
:: METRIC_1:dfs 8
definiens
let a1 be MetrStruct;
To prove
a1 is symmetric
it is sufficient to prove
thus the distance of a1 is symmetric(the carrier of a1);
:: METRIC_1:def 9
theorem
for b1 being MetrStruct holds
b1 is symmetric
iff
the distance of b1 is symmetric(the carrier of b1);
:: METRIC_1:attrnot 9 => METRIC_1:attr 9
definition
let a1 be MetrStruct;
attr a1 is triangle means
the distance of a1 is triangle(the carrier of a1);
end;
:: METRIC_1:dfs 9
definiens
let a1 be MetrStruct;
To prove
a1 is triangle
it is sufficient to prove
thus the distance of a1 is triangle(the carrier of a1);
:: METRIC_1:def 10
theorem
for b1 being MetrStruct holds
b1 is triangle
iff
the distance of b1 is triangle(the carrier of b1);
:: METRIC_1:exreg 3
registration
cluster non empty strict Reflexive discerning symmetric triangle MetrStruct;
end;
:: METRIC_1:modenot 1
definition
mode MetrSpace is Reflexive discerning symmetric triangle MetrStruct;
end;
:: METRIC_1:th 1
theorem
for b1 being MetrStruct holds
for b2 being Element of the carrier of b1 holds
dist(b2,b2) = 0
iff
b1 is Reflexive;
:: METRIC_1:th 2
theorem
for b1 being MetrStruct holds
for b2, b3 being Element of the carrier of b1
st dist(b2,b3) = 0
holds b2 = b3
iff
b1 is discerning;
:: METRIC_1:th 3
theorem
for b1 being MetrStruct holds
for b2, b3 being Element of the carrier of b1 holds
dist(b2,b3) = dist(b3,b2)
iff
b1 is symmetric;
:: METRIC_1:th 4
theorem
for b1 being MetrStruct holds
for b2, b3, b4 being Element of the carrier of b1 holds
dist(b2,b4) <= (dist(b2,b3)) + dist(b3,b4)
iff
b1 is triangle;
:: METRIC_1:funcnot 5 => METRIC_1:func 4
definition
let a1 be symmetric MetrStruct;
let a2, a3 be Element of the carrier of a1;
redefine func dist(a2,a3) -> Element of REAL;
commutativity;
:: for a1 being symmetric MetrStruct
:: for a2, a3 being Element of the carrier of a1 holds
:: dist(a2,a3) = dist(a3,a2);
end;
:: METRIC_1:th 5
theorem
for b1 being Reflexive symmetric triangle MetrStruct
for b2, b3 being Element of the carrier of b1 holds
0 <= dist(b2,b3);
:: METRIC_1:th 6
theorem
for b1 being MetrStruct
st for b2, b3, b4 being Element of the carrier of b1 holds
(dist(b2,b3) = 0 implies b2 = b3) &
(b2 = b3 implies dist(b2,b3) = 0) &
dist(b2,b3) = dist(b3,b2) &
dist(b2,b4) <= (dist(b2,b3)) + dist(b3,b4)
holds b1 is Reflexive discerning symmetric triangle MetrStruct;
:: METRIC_1:funcnot 6 => METRIC_1:func 5
definition
let a1 be set;
func discrete_dist A1 -> Function-like quasi_total Relation of [:a1,a1:],REAL means
for b1, b2 being Element of a1 holds
it .(b1,b1) = 0 & (b1 = b2 or it .(b1,b2) = 1);
end;
:: METRIC_1:def 11
theorem
for b1 being set
for b2 being Function-like quasi_total Relation of [:b1,b1:],REAL holds
b2 = discrete_dist b1
iff
for b3, b4 being Element of b1 holds
b2 .(b3,b3) = 0 & (b3 = b4 or b2 .(b3,b4) = 1);
:: METRIC_1:funcnot 7 => METRIC_1:func 6
definition
let a1 be set;
func DiscreteSpace A1 -> strict MetrStruct equals
MetrStruct(#a1,discrete_dist a1#);
end;
:: METRIC_1:def 12
theorem
for b1 being set holds
DiscreteSpace b1 = MetrStruct(#b1,discrete_dist b1#);
:: METRIC_1:funcreg 3
registration
let a1 be non empty set;
cluster DiscreteSpace a1 -> non empty strict;
end;
:: METRIC_1:funcreg 4
registration
let a1 be set;
cluster DiscreteSpace a1 -> strict Reflexive discerning symmetric triangle;
end;
:: METRIC_1:funcnot 8 => METRIC_1:func 7
definition
func real_dist -> Function-like quasi_total Relation of [:REAL,REAL:],REAL means
for b1, b2 being Element of REAL holds
it .(b1,b2) = abs (b1 - b2);
end;
:: METRIC_1:def 13
theorem
for b1 being Function-like quasi_total Relation of [:REAL,REAL:],REAL holds
b1 = real_dist
iff
for b2, b3 being Element of REAL holds
b1 .(b2,b3) = abs (b2 - b3);
:: METRIC_1:th 9
theorem
for b1, b2 being Element of REAL holds
real_dist .(b1,b2) = 0
iff
b1 = b2;
:: METRIC_1:th 10
theorem
for b1, b2 being Element of REAL holds
real_dist .(b1,b2) = real_dist .(b2,b1);
:: METRIC_1:th 11
theorem
for b1, b2, b3 being Element of REAL holds
real_dist .(b1,b2) <= (real_dist .(b1,b3)) + (real_dist .(b3,b2));
:: METRIC_1:funcnot 9 => METRIC_1:func 8
definition
func RealSpace -> strict MetrStruct equals
MetrStruct(#REAL,real_dist#);
end;
:: METRIC_1:def 14
theorem
RealSpace = MetrStruct(#REAL,real_dist#);
:: METRIC_1:funcreg 5
registration
cluster RealSpace -> non empty strict;
end;
:: METRIC_1:funcreg 6
registration
cluster RealSpace -> strict Reflexive discerning symmetric triangle;
end;
:: METRIC_1:funcnot 10 => METRIC_1:func 9
definition
let a1 be MetrStruct;
let a2 be Element of the carrier of a1;
let a3 be real set;
func Ball(A2,A3) -> Element of bool the carrier of a1 means
ex b1 being non empty MetrStruct st
ex b2 being Element of the carrier of b1 st
b1 = a1 &
b2 = a2 &
it = {b3 where b3 is Element of the carrier of b1: dist(b2,b3) < a3}
if a1 is not empty
otherwise it is empty;
end;
:: METRIC_1:def 15
theorem
for b1 being MetrStruct
for b2 being Element of the carrier of b1
for b3 being real set
for b4 being Element of bool the carrier of b1 holds
(b1 is empty or (b4 = Ball(b2,b3)
iff
ex b5 being non empty MetrStruct st
ex b6 being Element of the carrier of b5 st
b5 = b1 &
b6 = b2 &
b4 = {b7 where b7 is Element of the carrier of b5: dist(b6,b7) < b3})) &
(b1 is empty implies (b4 = Ball(b2,b3)
iff
b4 is empty));
:: METRIC_1:funcnot 11 => METRIC_1:func 10
definition
let a1 be MetrStruct;
let a2 be Element of the carrier of a1;
let a3 be real set;
func cl_Ball(A2,A3) -> Element of bool the carrier of a1 means
ex b1 being non empty MetrStruct st
ex b2 being Element of the carrier of b1 st
b1 = a1 &
b2 = a2 &
it = {b3 where b3 is Element of the carrier of b1: dist(b2,b3) <= a3}
if a1 is not empty
otherwise it is empty;
end;
:: METRIC_1:def 16
theorem
for b1 being MetrStruct
for b2 being Element of the carrier of b1
for b3 being real set
for b4 being Element of bool the carrier of b1 holds
(b1 is empty or (b4 = cl_Ball(b2,b3)
iff
ex b5 being non empty MetrStruct st
ex b6 being Element of the carrier of b5 st
b5 = b1 &
b6 = b2 &
b4 = {b7 where b7 is Element of the carrier of b5: dist(b6,b7) <= b3})) &
(b1 is empty implies (b4 = cl_Ball(b2,b3)
iff
b4 is empty));
:: METRIC_1:funcnot 12 => METRIC_1:func 11
definition
let a1 be MetrStruct;
let a2 be Element of the carrier of a1;
let a3 be real set;
func Sphere(A2,A3) -> Element of bool the carrier of a1 means
ex b1 being non empty MetrStruct st
ex b2 being Element of the carrier of b1 st
b1 = a1 &
b2 = a2 &
it = {b3 where b3 is Element of the carrier of b1: dist(b2,b3) = a3}
if a1 is not empty
otherwise it is empty;
end;
:: METRIC_1:def 17
theorem
for b1 being MetrStruct
for b2 being Element of the carrier of b1
for b3 being real set
for b4 being Element of bool the carrier of b1 holds
(b1 is empty or (b4 = Sphere(b2,b3)
iff
ex b5 being non empty MetrStruct st
ex b6 being Element of the carrier of b5 st
b5 = b1 &
b6 = b2 &
b4 = {b7 where b7 is Element of the carrier of b5: dist(b6,b7) = b3})) &
(b1 is empty implies (b4 = Sphere(b2,b3)
iff
b4 is empty));
:: METRIC_1:th 12
theorem
for b1 being real set
for b2 being MetrStruct
for b3, b4 being Element of the carrier of b2 holds
b4 in Ball(b3,b1)
iff
b2 is not empty & dist(b3,b4) < b1;
:: METRIC_1:th 13
theorem
for b1 being real set
for b2 being MetrStruct
for b3, b4 being Element of the carrier of b2 holds
b4 in cl_Ball(b3,b1)
iff
b2 is not empty & dist(b3,b4) <= b1;
:: METRIC_1:th 14
theorem
for b1 being real set
for b2 being MetrStruct
for b3, b4 being Element of the carrier of b2 holds
b4 in Sphere(b3,b1)
iff
b2 is not empty & dist(b3,b4) = b1;
:: METRIC_1:th 15
theorem
for b1 being real set
for b2 being MetrStruct
for b3 being Element of the carrier of b2 holds
Ball(b3,b1) c= cl_Ball(b3,b1);
:: METRIC_1:th 16
theorem
for b1 being real set
for b2 being MetrStruct
for b3 being Element of the carrier of b2 holds
Sphere(b3,b1) c= cl_Ball(b3,b1);
:: METRIC_1:th 17
theorem
for b1 being real set
for b2 being MetrStruct
for b3 being Element of the carrier of b2 holds
(Sphere(b3,b1)) \/ Ball(b3,b1) = cl_Ball(b3,b1);
:: METRIC_1:th 18
theorem
for b1 being real set
for b2 being non empty MetrStruct
for b3 being Element of the carrier of b2 holds
Ball(b3,b1) = {b4 where b4 is Element of the carrier of b2: dist(b3,b4) < b1};
:: METRIC_1:th 19
theorem
for b1 being real set
for b2 being non empty MetrStruct
for b3 being Element of the carrier of b2 holds
cl_Ball(b3,b1) = {b4 where b4 is Element of the carrier of b2: dist(b3,b4) <= b1};
:: METRIC_1:th 20
theorem
for b1 being real set
for b2 being non empty MetrStruct
for b3 being Element of the carrier of b2 holds
Sphere(b3,b1) = {b4 where b4 is Element of the carrier of b2: dist(b3,b4) = b1};