:: XXREAL_0 semantic presentation

definition
let c1 be set ;
attr a1 is ext-real means :Def1: :: XXREAL_0:def 1
a1 in ExtREAL ;
end;

:: deftheorem Def1 defines ext-real XXREAL_0:def 1 :
for b1 being set holds
( b1 is ext-real iff b1 in ExtREAL );

registration
cluster ext-real set ;
existence
ex b1 being number st b1 is ext-real
proof end;
cluster -> ext-real Element of ExtREAL ;
coherence
for b1 being Element of ExtREAL holds b1 is ext-real
by Def1;
end;

definition
func +infty -> set equals :: XXREAL_0:def 2
REAL ;
coherence
REAL is set
;
func -infty -> set equals :: XXREAL_0:def 3
[0,REAL ];
coherence
[0,REAL ] is set
;
end;

:: deftheorem Def2 defines +infty XXREAL_0:def 2 :
+infty = REAL ;

:: deftheorem Def3 defines -infty XXREAL_0:def 3 :
-infty = [0,REAL ];

definition
redefine func ExtREAL -> set equals :: XXREAL_0:def 4
REAL \/ {+infty ,-infty };
compatibility
for b1 being set holds
( b1 = ExtREAL iff b1 = REAL \/ {+infty ,-infty } )
;
end;

:: deftheorem Def4 defines ExtREAL XXREAL_0:def 4 :
ExtREAL = REAL \/ {+infty ,-infty };

registration
cluster +infty -> ext-real ;
coherence
+infty is ext-real
proof end;
cluster -infty -> ext-real ;
coherence
-infty is ext-real
proof end;
end;

definition
let c1, c2 be ext-real number ;
pred c1 <= c2 means :Def5: :: XXREAL_0:def 5
ex b1, b2 being Element of REAL+ st
( a1 = b1 & a2 = b2 & b1 <=' b2 ) if ( a1 in REAL+ & a2 in REAL+ )
ex b1, b2 being Element of REAL+ st
( a1 = [0,b1] & a2 = [0,b2] & b2 <=' b1 ) if ( a1 in [:{0},REAL+ :] & a2 in [:{0},REAL+ :] )
otherwise not ( not ( a2 in REAL+ & a1 in [:{0},REAL+ :] ) & not a1 = -infty & not a2 = +infty );
consistency
( c1 in REAL+ & c2 in REAL+ & c1 in [:{0},REAL+ :] & c2 in [:{0},REAL+ :] implies ( not ( ex b1, b2 being Element of REAL+ st
( c1 = b1 & c2 = b2 & b1 <=' b2 ) & ( for b1, b2 being Element of REAL+ holds
not ( c1 = [0,b1] & c2 = [0,b2] & b2 <=' b1 ) ) ) & not ( ex b1, b2 being Element of REAL+ st
( c1 = [0,b1] & c2 = [0,b2] & b2 <=' b1 ) & ( for b1, b2 being Element of REAL+ holds
not ( c1 = b1 & c2 = b2 & b1 <=' b2 ) ) ) ) )
by ARYTM_0:5, XBOOLE_0:3;
reflexivity
for b1 being ext-real number holds
( not ( b1 in REAL+ & b1 in REAL+ & ( for b2, b3 being Element of REAL+ holds
not ( b1 = b2 & b1 = b3 & b2 <=' b3 ) ) ) & not ( b1 in [:{0},REAL+ :] & b1 in [:{0},REAL+ :] & ( for b2, b3 being Element of REAL+ holds
not ( b1 = [0,b2] & b1 = [0,b3] & b3 <=' b2 ) ) ) & not ( not ( b1 in REAL+ & b1 in REAL+ ) & not ( b1 in [:{0},REAL+ :] & b1 in [:{0},REAL+ :] ) & not ( b1 in REAL+ & b1 in [:{0},REAL+ :] ) & not b1 = -infty & not b1 = +infty ) )
proof end;
connectedness
for b1, b2 being ext-real number holds
( not ( not ( b1 in REAL+ & b2 in REAL+ & ( for b3, b4 being Element of REAL+ holds
not ( b1 = b3 & b2 = b4 & b3 <=' b4 ) ) ) & not ( b1 in [:{0},REAL+ :] & b2 in [:{0},REAL+ :] & ( for b3, b4 being Element of REAL+ holds
not ( b1 = [0,b3] & b2 = [0,b4] & b4 <=' b3 ) ) ) & not ( not ( b1 in REAL+ & b2 in REAL+ ) & not ( b1 in [:{0},REAL+ :] & b2 in [:{0},REAL+ :] ) & not ( b2 in REAL+ & b1 in [:{0},REAL+ :] ) & not b1 = -infty & not b2 = +infty ) ) implies ( not ( b2 in REAL+ & b1 in REAL+ & ( for b3, b4 being Element of REAL+ holds
not ( b2 = b3 & b1 = b4 & b3 <=' b4 ) ) ) & not ( b2 in [:{0},REAL+ :] & b1 in [:{0},REAL+ :] & ( for b3, b4 being Element of REAL+ holds
not ( b2 = [0,b3] & b1 = [0,b4] & b4 <=' b3 ) ) ) & not ( not ( b2 in REAL+ & b1 in REAL+ ) & not ( b2 in [:{0},REAL+ :] & b1 in [:{0},REAL+ :] ) & not ( b1 in REAL+ & b2 in [:{0},REAL+ :] ) & not b2 = -infty & not b1 = +infty ) ) )
proof end;
end;

:: deftheorem Def5 defines <= XXREAL_0:def 5 :
for b1, b2 being ext-real number holds
( ( b1 in REAL+ & b2 in REAL+ implies ( b1 <= b2 iff ex b3, b4 being Element of REAL+ st
( b1 = b3 & b2 = b4 & b3 <=' b4 ) ) ) & ( b1 in [:{0},REAL+ :] & b2 in [:{0},REAL+ :] implies ( b1 <= b2 iff ex b3, b4 being Element of REAL+ st
( b1 = [0,b3] & b2 = [0,b4] & b4 <=' b3 ) ) ) & ( not ( b1 in REAL+ & b2 in REAL+ ) & not ( b1 in [:{0},REAL+ :] & b2 in [:{0},REAL+ :] ) implies ( b1 <= b2 iff not ( not ( b2 in REAL+ & b1 in [:{0},REAL+ :] ) & not b1 = -infty & not b2 = +infty ) ) ) );

notation
let c1, c2 be ext-real number ;
synonym c2 >= c1 for c1 <= c2;
antonym c2 < c1 for c1 <= c2;
antonym c1 > c2 for c1 <= c2;
end;

Lemma3: +infty <> [0,0]
proof end;

Lemma4: not +infty in REAL+
by ARYTM_0:1, ORDINAL1:7;

Lemma5: not -infty in REAL+
proof end;

Lemma6: not +infty in [:{0},REAL+ :]
proof end;

Lemma7: not -infty in [:{0},REAL+ :]
proof end;

Lemma8: -infty < +infty
proof end;

theorem Th1: :: XXREAL_0:1
for b1, b2 being ext-real number holds
( b1 <= b2 & b2 <= b1 implies b1 = b2 )
proof end;

Lemma10: for b1 being ext-real number holds
( -infty >= b1 implies b1 = -infty )
proof end;

Lemma11: for b1 being ext-real number holds
( +infty <= b1 implies b1 = +infty )
proof end;

theorem Th2: :: XXREAL_0:2
for b1, b2, b3 being ext-real number holds
( b1 <= b2 & b2 <= b3 implies b1 <= b3 )
proof end;

theorem Th3: :: XXREAL_0:3
for b1 being ext-real number holds b1 <= +infty by Def5, Lemma4, Lemma6;

theorem Th4: :: XXREAL_0:4
for b1 being ext-real number holds
( +infty <= b1 implies b1 = +infty ) by Lemma11;

theorem Th5: :: XXREAL_0:5
for b1 being ext-real number holds b1 >= -infty by Def5, Lemma5, Lemma7;

theorem Th6: :: XXREAL_0:6
for b1 being ext-real number holds
( -infty >= b1 implies b1 = -infty ) by Lemma10;

theorem Th7: :: XXREAL_0:7
-infty < +infty by Lemma8;

theorem Th8: :: XXREAL_0:8
not +infty in REAL ;

Lemma15: for b1 being ext-real number holds
not ( not b1 in REAL & not b1 = +infty & not b1 = -infty )
proof end;

theorem Th9: :: XXREAL_0:9
for b1 being ext-real number holds
not ( b1 in REAL & not +infty > b1 )
proof end;

theorem Th10: :: XXREAL_0:10
for b1, b2 being ext-real number holds
not ( b1 in REAL & b2 >= b1 & not b2 in REAL & not b2 = +infty )
proof end;

theorem Th11: :: XXREAL_0:11
not -infty in REAL
proof end;

theorem Th12: :: XXREAL_0:12
for b1 being ext-real number holds
not ( b1 in REAL & not -infty < b1 )
proof end;

theorem Th13: :: XXREAL_0:13
for b1, b2 being ext-real number holds
not ( b1 in REAL & b2 <= b1 & not b2 in REAL & not b2 = -infty )
proof end;

theorem Th14: :: XXREAL_0:14
for b1 being ext-real number holds
not ( not b1 in REAL & not b1 = +infty & not b1 = -infty ) by Lemma15;

registration
cluster natural -> ext-real set ;
coherence
for b1 being number holds
( b1 is natural implies b1 is ext-real )
proof end;
end;

definition
let c1 be ext-real number ;
attr a1 is positive means :: XXREAL_0:def 6
a1 > 0;
attr a1 is negative means :: XXREAL_0:def 7
a1 < 0;
end;

:: deftheorem Def6 defines positive XXREAL_0:def 6 :
for b1 being ext-real number holds
( b1 is positive iff b1 > 0 );

:: deftheorem Def7 defines negative XXREAL_0:def 7 :
for b1 being ext-real number holds
( b1 is negative iff b1 < 0 );

notation
let c1 be number ;
synonym zero c1 for empty c1;
end;

registration
cluster ext-real positive -> non zero ext-real non negative set ;
coherence
for b1 being ext-real number holds
( b1 is positive implies ( not b1 is negative & not b1 is zero ) )
proof end;
cluster non zero ext-real non negative -> ext-real positive set ;
coherence
for b1 being ext-real number holds
( not b1 is negative & not b1 is zero implies b1 is positive )
proof end;
cluster ext-real negative -> non zero ext-real non positive set ;
coherence
for b1 being ext-real number holds
( b1 is negative implies ( not b1 is positive & not b1 is zero ) )
proof end;
cluster non zero ext-real non positive -> ext-real negative set ;
coherence
for b1 being ext-real number holds
( not b1 is positive & not b1 is zero implies b1 is negative )
proof end;
cluster zero ext-real -> ext-real non positive non negative set ;
coherence
for b1 being ext-real number holds
( b1 is zero implies ( not b1 is negative & not b1 is positive ) )
proof end;
cluster ext-real non positive non negative -> zero ext-real set ;
coherence
for b1 being ext-real number holds
( not b1 is negative & not b1 is positive implies b1 is zero )
proof end;
end;

registration
cluster +infty -> non zero ext-real positive non negative ;
coherence
+infty is positive
proof end;
cluster -infty -> non zero ext-real non positive negative ;
coherence
-infty is negative
proof end;
end;

registration
cluster non zero ext-real positive non negative set ;
existence
ex b1 being ext-real number st b1 is positive
proof end;
cluster non zero ext-real non positive negative set ;
existence
ex b1 being ext-real number st b1 is negative
proof end;
cluster zero ext-real non positive non negative set ;
existence
ex b1 being ext-real number st b1 is zero
proof end;
end;

definition
let c1, c2 be ext-real number ;
func min c1,c2 -> set equals :Def8: :: XXREAL_0:def 8
a1 if a1 <= a2
otherwise a2;
correctness
coherence
( ( c1 <= c2 implies c1 is set ) & ( not c1 <= c2 implies c2 is set ) )
;
consistency
for b1 being set holds
verum
;
;
commutativity
for b1 being set
for b2, b3 being ext-real number holds
( ( b2 <= b3 implies b1 = b2 ) & ( not b2 <= b3 implies b1 = b3 ) implies ( ( b3 <= b2 implies b1 = b3 ) & ( not b3 <= b2 implies b1 = b2 ) ) )
by Th1;
idempotence
for b1 being ext-real number holds
( ( b1 <= b1 implies b1 = b1 ) & ( not b1 <= b1 implies b1 = b1 ) )
;
func max c1,c2 -> set equals :Def9: :: XXREAL_0:def 9
a1 if a2 <= a1
otherwise a2;
correctness
coherence
( ( c2 <= c1 implies c1 is set ) & ( not c2 <= c1 implies c2 is set ) )
;
consistency
for b1 being set holds
verum
;
;
commutativity
for b1 being set
for b2, b3 being ext-real number holds
( ( b3 <= b2 implies b1 = b2 ) & ( not b3 <= b2 implies b1 = b3 ) implies ( ( b2 <= b3 implies b1 = b3 ) & ( not b2 <= b3 implies b1 = b2 ) ) )
by Th1;
idempotence
for b1 being ext-real number holds
( ( b1 <= b1 implies b1 = b1 ) & ( not b1 <= b1 implies b1 = b1 ) )
;
end;

:: deftheorem Def8 defines min XXREAL_0:def 8 :
for b1, b2 being ext-real number holds
( ( b1 <= b2 implies min b1,b2 = b1 ) & ( not b1 <= b2 implies min b1,b2 = b2 ) );

:: deftheorem Def9 defines max XXREAL_0:def 9 :
for b1, b2 being ext-real number holds
( ( b2 <= b1 implies max b1,b2 = b1 ) & ( not b2 <= b1 implies max b1,b2 = b2 ) );

theorem Th15: :: XXREAL_0:15
for b1, b2 being ext-real number holds
( min b1,b2 = b1 or min b1,b2 = b2 )
proof end;

theorem Th16: :: XXREAL_0:16
for b1, b2 being ext-real number holds
( max b1,b2 = b1 or max b1,b2 = b2 )
proof end;

registration
let c1, c2 be ext-real number ;
cluster min a1,a2 -> ext-real ;
coherence
min c1,c2 is ext-real
by Th15;
cluster max a1,a2 -> ext-real ;
coherence
max c1,c2 is ext-real
by Th16;
end;

theorem Th17: :: XXREAL_0:17
for b1, b2 being ext-real number holds min b1,b2 <= b1
proof end;

theorem Th18: :: XXREAL_0:18
for b1, b2, b3, b4 being ext-real number holds
( b1 <= b2 & b3 <= b4 implies min b1,b3 <= min b2,b4 )
proof end;

theorem Th19: :: XXREAL_0:19
for b1, b2, b3, b4 being ext-real number holds
not ( b1 < b2 & b3 < b4 & not min b1,b3 < min b2,b4 )
proof end;

theorem Th20: :: XXREAL_0:20
for b1, b2, b3 being ext-real number holds
( b1 <= b2 & b1 <= b3 implies b1 <= min b2,b3 ) by Th15;

theorem Th21: :: XXREAL_0:21
for b1, b2, b3 being ext-real number holds
not ( b1 < b2 & b1 < b3 & not b1 < min b2,b3 ) by Th15;

theorem Th22: :: XXREAL_0:22
for b1, b2, b3 being ext-real number holds
( b1 <= min b2,b3 implies b1 <= b2 )
proof end;

theorem Th23: :: XXREAL_0:23
for b1, b2, b3 being ext-real number holds
not ( b1 < min b2,b3 & not b1 < b2 )
proof end;

theorem Th24: :: XXREAL_0:24
for b1, b2, b3 being ext-real number holds
( b1 <= b2 & b1 <= b3 & ( for b4 being ext-real number holds
( b4 <= b2 & b4 <= b3 implies b4 <= b1 ) ) implies b1 = min b2,b3 )
proof end;

theorem Th25: :: XXREAL_0:25
for b1, b2 being ext-real number holds b1 <= max b1,b2
proof end;

theorem Th26: :: XXREAL_0:26
for b1, b2, b3, b4 being ext-real number holds
( b1 <= b2 & b3 <= b4 implies max b1,b3 <= max b2,b4 )
proof end;

theorem Th27: :: XXREAL_0:27
for b1, b2, b3, b4 being ext-real number holds
not ( b1 < b2 & b3 < b4 & not max b1,b3 < max b2,b4 )
proof end;

theorem Th28: :: XXREAL_0:28
for b1, b2, b3 being ext-real number holds
( b1 <= b2 & b3 <= b2 implies max b1,b3 <= b2 ) by Th16;

theorem Th29: :: XXREAL_0:29
for b1, b2, b3 being ext-real number holds
not ( b1 < b2 & b3 < b2 & not max b1,b3 < b2 ) by Th16;

theorem Th30: :: XXREAL_0:30
for b1, b2, b3 being ext-real number holds
( max b1,b2 <= b3 implies b1 <= b3 )
proof end;

theorem Th31: :: XXREAL_0:31
for b1, b2, b3 being ext-real number holds
not ( max b1,b2 < b3 & not b1 < b3 )
proof end;

theorem Th32: :: XXREAL_0:32
for b1, b2, b3 being ext-real number holds
( b1 <= b2 & b3 <= b2 & ( for b4 being ext-real number holds
( b1 <= b4 & b3 <= b4 implies b2 <= b4 ) ) implies b2 = max b1,b3 )
proof end;

theorem Th33: :: XXREAL_0:33
for b1, b2, b3 being ext-real number holds min (min b1,b2),b3 = min b1,(min b2,b3)
proof end;

theorem Th34: :: XXREAL_0:34
for b1, b2, b3 being ext-real number holds max (max b1,b2),b3 = max b1,(max b2,b3)
proof end;

theorem Th35: :: XXREAL_0:35
for b1, b2 being ext-real number holds min (max b1,b2),b2 = b2
proof end;

theorem Th36: :: XXREAL_0:36
for b1, b2 being ext-real number holds max (min b1,b2),b2 = b2
proof end;

theorem Th37: :: XXREAL_0:37
for b1, b2, b3 being ext-real number holds
( b1 <= b2 implies max b1,(min b3,b2) = min (max b1,b3),b2 )
proof end;

theorem Th38: :: XXREAL_0:38
for b1, b2, b3 being ext-real number holds min b1,(max b2,b3) = max (min b1,b2),(min b1,b3)
proof end;

theorem Th39: :: XXREAL_0:39
for b1, b2, b3 being ext-real number holds max b1,(min b2,b3) = min (max b1,b2),(max b1,b3)
proof end;

theorem Th40: :: XXREAL_0:40
for b1, b2, b3 being ext-real number holds max (max (min b1,b2),(min b2,b3)),(min b3,b1) = min (min (max b1,b2),(max b2,b3)),(max b3,b1)
proof end;

theorem Th41: :: XXREAL_0:41
for b1 being ext-real number holds max b1,+infty = +infty
proof end;

theorem Th42: :: XXREAL_0:42
for b1 being ext-real number holds min b1,+infty = b1
proof end;

theorem Th43: :: XXREAL_0:43
for b1 being ext-real number holds max b1,-infty = b1
proof end;

theorem Th44: :: XXREAL_0:44
for b1 being ext-real number holds min b1,-infty = -infty
proof end;