let r be Real; :: thesis: for n being non zero Nat
for p being Element of (EMINFTY n) holds Ball (p,r) = product (Intervals ((@ p),r))

let n be non zero Nat; :: thesis: for p being Element of (EMINFTY n) holds Ball (p,r) = product (Intervals ((@ p),r))
let p be Element of (EMINFTY n); :: thesis: Ball (p,r) = product (Intervals ((@ p),r))
consider x being Element of REAL n such that
A1: @ p = x ;
per cases ( r <= 0 or r > 0 ) ;
suppose r <= 0 ; :: thesis: Ball (p,r) = product (Intervals ((@ p),r))
then ( Ball (p,r) = {} & product (Intervals (x,r)) = {} ) by Th67, TBSP_1:12;
hence Ball (p,r) = product (Intervals ((@ p),r)) by A1; :: thesis: verum
end;
suppose A2: r > 0 ; :: thesis: Ball (p,r) = product (Intervals ((@ p),r))
A3: { q where q is Element of (EMINFTY n) : dist (p,q) < r } c= product (Intervals (x,r))
proof
let t be object ; :: according to TARSKI:def 3 :: thesis: ( not t in { q where q is Element of (EMINFTY n) : dist (p,q) < r } or t in product (Intervals (x,r)) )
assume t in { q where q is Element of (EMINFTY n) : dist (p,q) < r } ; :: thesis: t in product (Intervals (x,r))
then consider q being Element of (EMINFTY n) such that
A4: t = q and
A5: dist (p,q) < r ;
reconsider pr = p, qr = q as Element of REAL n ;
consider S being ext-real-membered set such that
A6: S = { |.((pr . i) - (qr . i)).| where i is Element of Seg n : verum } and
A7: (Infty_dist n) . (pr,qr) = sup S by Th57;
(Infty_dist n) . (p,q) in REAL by BINOP_1:17;
then reconsider s = (Infty_dist n) . (p,q) as Real ;
reconsider f = Intervals (x,r) as Function ;
now :: thesis: ( dom qr = dom f & ( for y being object st y in dom f holds
qr . y in f . y ) )
A8: dom f = dom x by EUCLID_9:def 3
.= Seg n by FINSEQ_1:89 ;
hence dom qr = dom f by FINSEQ_1:89; :: thesis: for y being object st y in dom f holds
qr . y in f . y

thus for y being object st y in dom f holds
qr . y in f . y :: thesis: verum
proof
let y be object ; :: thesis: ( y in dom f implies qr . y in f . y )
assume A9: y in dom f ; :: thesis: qr . y in f . y
then A10: y in dom x by A8, FINSEQ_1:89;
reconsider y1 = y as Element of Seg n by A9, A8;
|.((pr . y1) - (qr . y1)).| in S by A6;
then ( |.((pr . y1) - (qr . y1)).| <= sup S & sup S < r ) by A7, A5, XXREAL_2:4;
then A11: |.((x . y) - (qr . y)).| < r by A1, XXREAL_0:2;
( (x . y) - r < qr . y & qr . y < (x . y) + r )
proof
per cases ( (x . y) - (qr . y) >= 0 or (x . y) - (qr . y) < 0 ) ;
suppose A12: (x . y) - (qr . y) >= 0 ; :: thesis: ( (x . y) - r < qr . y & qr . y < (x . y) + r )
then (x . y) - (qr . y) < r by A11, COMPLEX1:43;
then ((x . y) - (qr . y)) + (qr . y) < (qr . y) + r by XREAL_1:8;
then (x . y) - r < ((qr . y) + r) - r by XREAL_1:8;
hence (x . y) - r < qr . y ; :: thesis: qr . y < (x . y) + r
0 + (qr . y) <= ((x . y) - (qr . y)) + (qr . y) by A12, XREAL_1:7;
hence qr . y < (x . y) + r by A2, XREAL_1:8; :: thesis: verum
end;
suppose A13: (x . y) - (qr . y) < 0 ; :: thesis: ( (x . y) - r < qr . y & qr . y < (x . y) + r )
then ((x . y) - (qr . y)) + (qr . y) < 0 + (qr . y) by XREAL_1:8;
then (x . y) - r < (qr . y) - 0 by A2, XREAL_1:15;
hence (x . y) - r < qr . y ; :: thesis: qr . y < (x . y) + r
|.((x . y) - (qr . y)).| = - ((x . y) - (qr . y)) by A13, COMPLEX1:70
.= (qr . y) - (x . y) ;
then ((qr . y) - (x . y)) + (x . y) < r + (x . y) by A11, XREAL_1:8;
hence qr . y < (x . y) + r ; :: thesis: verum
end;
end;
end;
then qr . y in ].((x . y) - r),((x . y) + r).[ by XXREAL_1:4;
hence qr . y in f . y by A10, EUCLID_9:def 3; :: thesis: verum
end;
end;
hence t in product (Intervals (x,r)) by A4, CARD_3:9; :: thesis: verum
end;
product (Intervals (x,r)) c= { q where q is Element of (EMINFTY n) : dist (p,q) < r }
proof
let t be object ; :: according to TARSKI:def 3 :: thesis: ( not t in product (Intervals (x,r)) or t in { q where q is Element of (EMINFTY n) : dist (p,q) < r } )
assume t in product (Intervals (x,r)) ; :: thesis: t in { q where q is Element of (EMINFTY n) : dist (p,q) < r }
then consider g being Function such that
A14: t = g and
A15: dom g = dom (Intervals (x,r)) and
A16: for y being object st y in dom (Intervals (x,r)) holds
g . y in (Intervals (x,r)) . y by CARD_3:def 5;
A17: dom (Intervals (x,r)) = dom x by EUCLID_9:def 3
.= Seg n by FINSEQ_1:89 ;
rng g c= REAL
proof
let u be object ; :: according to TARSKI:def 3 :: thesis: ( not u in rng g or u in REAL )
assume u in rng g ; :: thesis: u in REAL
then consider t being object such that
A18: t in dom g and
A19: u = g . t by FUNCT_1:def 3;
A20: u in (Intervals (x,r)) . t by A18, A19, A15, A16;
t in dom x by A18, A17, A15, FINSEQ_1:89;
then u in ].((x . t) - r),((x . t) + r).[ by A20, EUCLID_9:def 3;
hence u in REAL ; :: thesis: verum
end;
then g in Funcs ((Seg n),REAL) by A17, A15, FUNCT_2:def 2;
then reconsider g0 = g as Element of (EMINFTY n) by FINSEQ_2:93;
dist (p,g0) < r
proof
reconsider p1 = p, g1 = g0 as Element of REAL n ;
consider S being ext-real-membered set such that
S = { |.((p1 . i) - (g1 . i)).| where i is Element of Seg n : verum } and
A21: (Infty_dist n) . (p1,g1) = sup S by Th57;
sup S < r
proof
assume A22: r <= sup S ; :: thesis: contradiction
set md = max_diff_index (p1,g1);
A23: r <= (abs (p1 - g1)) . (max_diff_index (p1,g1)) by A22, A21, Th58;
A24: max_diff_index (p1,g1) in dom x by A1, EUCLID_9:4;
then max_diff_index (p1,g1) in dom (Intervals (x,r)) by EUCLID_9:def 3;
then g1 . (max_diff_index (p1,g1)) in (Intervals (x,r)) . (max_diff_index (p1,g1)) by A16;
then A25: g1 . (max_diff_index (p1,g1)) in ].((p1 . (max_diff_index (p1,g1))) - r),((p1 . (max_diff_index (p1,g1))) + r).[ by A24, A1, EUCLID_9:def 3;
A26: ( (p1 . (max_diff_index (p1,g1))) - r < g1 . (max_diff_index (p1,g1)) & g1 . (max_diff_index (p1,g1)) < (p1 . (max_diff_index (p1,g1))) + r ) by A25, XXREAL_1:4;
((p1 . (max_diff_index (p1,g1))) - r) + r < (g1 . (max_diff_index (p1,g1))) + r by A26, XREAL_1:8;
then A27: (p1 . (max_diff_index (p1,g1))) - (g1 . (max_diff_index (p1,g1))) < ((g1 . (max_diff_index (p1,g1))) + r) - (g1 . (max_diff_index (p1,g1))) by XREAL_1:14;
(g1 . (max_diff_index (p1,g1))) - (p1 . (max_diff_index (p1,g1))) < ((p1 . (max_diff_index (p1,g1))) + r) - (p1 . (max_diff_index (p1,g1))) by A26, XREAL_1:14;
then A28: ( (p1 . (max_diff_index (p1,g1))) - (g1 . (max_diff_index (p1,g1))) < r & - ((p1 . (max_diff_index (p1,g1))) - (g1 . (max_diff_index (p1,g1)))) < r ) by A27;
then A29: ( (p1 - g1) . (max_diff_index (p1,g1)) < r & - ((p1 - g1) . (max_diff_index (p1,g1))) < r ) by RVSUM_1:27;
set pg = (p1 - g1) . (max_diff_index (p1,g1));
|.((p1 - g1) . (max_diff_index (p1,g1))).| < r
proof
per cases ( (p1 - g1) . (max_diff_index (p1,g1)) < 0 or 0 <= (p1 - g1) . (max_diff_index (p1,g1)) ) ;
suppose (p1 - g1) . (max_diff_index (p1,g1)) < 0 ; :: thesis: |.((p1 - g1) . (max_diff_index (p1,g1))).| < r
then |.((p1 - g1) . (max_diff_index (p1,g1))).| = - ((p1 - g1) . (max_diff_index (p1,g1))) by COMPLEX1:70;
hence |.((p1 - g1) . (max_diff_index (p1,g1))).| < r by A28, RVSUM_1:27; :: thesis: verum
end;
suppose 0 <= (p1 - g1) . (max_diff_index (p1,g1)) ; :: thesis: |.((p1 - g1) . (max_diff_index (p1,g1))).| < r
hence |.((p1 - g1) . (max_diff_index (p1,g1))).| < r by A29, COMPLEX1:43; :: thesis: verum
end;
end;
end;
hence contradiction by A23, VALUED_1:18; :: thesis: verum
end;
hence dist (p,g0) < r by A21; :: thesis: verum
end;
hence t in { q where q is Element of (EMINFTY n) : dist (p,q) < r } by A14; :: thesis: verum
end;
hence Ball (p,r) = product (Intervals ((@ p),r)) by A1, A3, METRIC_1:def 14; :: thesis: verum
end;
end;