:: RAT_1 semantic presentation

Lemma1: 1 = succ 0
;

Lemma2: for b1, b2 being Nat holds quotient b1,b2 = b1 / b2
proof end;

0 in omega
;

then reconsider c1 = 0 as Element of REAL+ by ARYTM_2:2;

Lemma3: for b1 being real number
for b2 being Element of REAL+ holds
( b2 = b1 implies c1 - b2 = - b1 )
proof end;

Lemma4: for b1 being set holds
not ( b1 in RAT & ( for b2, b3 being Integer holds
not b1 = b2 / b3 ) )
proof end;

Lemma5: for b1 being set
for b2 being Nat
for b3 being Integer holds
( b1 = b3 / b2 implies b1 in RAT )
proof end;

Lemma6: for b1 being set
for b2, b3 being Integer holds
( b1 = b2 / b3 implies b1 in RAT )
proof end;

definition
redefine func RAT -> set means :Def1: :: RAT_1:def 1
for b1 being set holds
( b1 in a1 iff ex b2, b3 being Integer st b1 = b2 / b3 );
compatibility
for b1 being set holds
( b1 = RAT iff for b2 being set holds
( b2 in b1 iff ex b3, b4 being Integer st b2 = b3 / b4 ) )
proof end;
end;

:: deftheorem Def1 defines RAT RAT_1:def 1 :
for b1 being set holds
( b1 = RAT iff for b2 being set holds
( b2 in b1 iff ex b3, b4 being Integer st b2 = b3 / b4 ) );

definition
let c2 be number ;
attr a1 is rational means :Def2: :: RAT_1:def 2
a1 in RAT ;
end;

:: deftheorem Def2 defines rational RAT_1:def 2 :
for b1 being number holds
( b1 is rational iff b1 in RAT );

registration
cluster rational Element of REAL ;
existence
ex b1 being Real st b1 is rational
proof end;
end;

registration
cluster rational set ;
existence
ex b1 being number st b1 is rational
proof end;
end;

definition
mode Rational is rational number ;
end;

theorem Th1: :: RAT_1:1
for b1 being set holds
not ( b1 in RAT & ( for b2, b3 being Integer holds
not ( b3 <> 0 & b1 = b2 / b3 ) ) )
proof end;

theorem Th2: :: RAT_1:2
canceled;

theorem Th3: :: RAT_1:3
for b1 being set holds
not ( b1 is Rational & ( for b2, b3 being Integer holds
not ( b3 <> 0 & b1 = b2 / b3 ) ) )
proof end;

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

theorem Th4: :: RAT_1:4
canceled;

theorem Th5: :: RAT_1:5
canceled;

theorem Th6: :: RAT_1:6
for b1 being set holds
( ex b2, b3 being Integer st b1 = b2 / b3 implies b1 is rational )
proof end;

theorem Th7: :: RAT_1:7
for b1 being Integer holds
b1 is Rational
proof end;

registration
cluster integer -> real rational set ;
coherence
for b1 being number holds
( b1 is integer implies b1 is rational )
by Th7;
end;

registration
let c2, c3 be Rational;
cluster a1 * a2 -> rational ;
coherence
c2 * c3 is rational
proof end;
cluster a1 + a2 -> rational ;
coherence
c2 + c3 is rational
proof end;
cluster a1 - a2 -> rational ;
coherence
c2 - c3 is rational
proof end;
end;

registration
let c2 be Rational;
let c3 be Integer;
cluster a1 + a2 -> rational ;
coherence
c2 + c3 is rational
;
cluster a1 - a2 -> rational ;
coherence
c2 - c3 is rational
;
cluster a1 * a2 -> rational ;
coherence
c2 * c3 is rational
;
end;

registration
let c2 be Integer;
let c3 be Rational;
cluster a1 + a2 -> rational ;
coherence
c2 + c3 is rational
;
cluster a1 - a2 -> rational ;
coherence
c2 - c3 is rational
;
cluster a1 * a2 -> rational ;
coherence
c2 * c3 is rational
;
end;

registration
let c2 be Rational;
let c3 be Nat;
cluster a1 + a2 -> rational ;
coherence
c2 + c3 is rational
;
cluster a1 - a2 -> rational ;
coherence
c2 - c3 is rational
;
cluster a1 * a2 -> rational ;
coherence
c2 * c3 is rational
;
end;

registration
let c2 be Nat;
let c3 be Rational;
cluster a1 + a2 -> rational ;
coherence
c2 + c3 is rational
;
cluster a1 - a2 -> rational ;
coherence
c2 - c3 is rational
;
cluster a1 * a2 -> rational ;
coherence
c2 * c3 is rational
;
end;

registration
let c2 be Rational;
cluster - a1 -> rational ;
coherence
- c2 is rational
proof end;
end;

theorem Th8: :: RAT_1:8
canceled;

theorem Th9: :: RAT_1:9
canceled;

theorem Th10: :: RAT_1:10
canceled;

theorem Th11: :: RAT_1:11
canceled;

theorem Th12: :: RAT_1:12
canceled;

theorem Th13: :: RAT_1:13
canceled;

theorem Th14: :: RAT_1:14
canceled;

theorem Th15: :: RAT_1:15
canceled;

theorem Th16: :: RAT_1:16
for b1, b2 being Rational holds
b1 / b2 is Rational
proof end;

registration
let c2, c3 be rational number ;
cluster a1 / a2 -> rational ;
coherence
c2 / c3 is rational
by Th16;
end;

theorem Th17: :: RAT_1:17
canceled;

theorem Th18: :: RAT_1:18
canceled;

theorem Th19: :: RAT_1:19
canceled;

theorem Th20: :: RAT_1:20
canceled;

theorem Th21: :: RAT_1:21
for b1 being Rational holds
b1 " is Rational
proof end;

registration
let c2 be rational number ;
cluster a1 " -> rational ;
coherence
c2 " is rational
by Th21;
end;

theorem Th22: :: RAT_1:22
for b1, b2 being real number holds
not ( b1 < b2 & ( for b3 being Rational holds
not ( b1 < b3 & b3 < b2 ) ) )
proof end;

theorem Th23: :: RAT_1:23
canceled;

theorem Th24: :: RAT_1:24
for b1 being Rational holds
ex b2 being Integerex b3 being Nat st
( b3 <> 0 & b1 = b2 / b3 )
proof end;

theorem Th25: :: RAT_1:25
for b1 being Rational holds
ex b2 being Integerex b3 being Nat st
( b3 <> 0 & b1 = b2 / b3 & ( for b4 being Integer
for b5 being Nat holds
( b5 <> 0 & b1 = b4 / b5 implies b3 <= b5 ) ) )
proof end;

definition
let c2 be Rational;
func denominator c1 -> Nat means :Def3: :: RAT_1:def 3
( a2 <> 0 & ex b1 being Integer st a1 = b1 / a2 & ( for b1 being Integer
for b2 being Nat holds
( b2 <> 0 & a1 = b1 / b2 implies a2 <= b2 ) ) );
existence
ex b1 being Nat st
( b1 <> 0 & ex b2 being Integer st c2 = b2 / b1 & ( for b2 being Integer
for b3 being Nat holds
( b3 <> 0 & c2 = b2 / b3 implies b1 <= b3 ) ) )
proof end;
uniqueness
for b1, b2 being Nat holds
( b1 <> 0 & ex b3 being Integer st c2 = b3 / b1 & ( for b3 being Integer
for b4 being Nat holds
( b4 <> 0 & c2 = b3 / b4 implies b1 <= b4 ) ) & b2 <> 0 & ex b3 being Integer st c2 = b3 / b2 & ( for b3 being Integer
for b4 being Nat holds
( b4 <> 0 & c2 = b3 / b4 implies b2 <= b4 ) ) implies b1 = b2 )
proof end;
end;

:: deftheorem Def3 defines denominator RAT_1:def 3 :
for b1 being Rational
for b2 being Nat holds
( b2 = denominator b1 iff ( b2 <> 0 & ex b3 being Integer st b1 = b3 / b2 & ( for b3 being Integer
for b4 being Nat holds
( b4 <> 0 & b1 = b3 / b4 implies b2 <= b4 ) ) ) );

definition
let c2 be Rational;
func numerator c1 -> Integer equals :: RAT_1:def 4
(denominator a1) * a1;
coherence
(denominator c2) * c2 is Integer
proof end;
end;

:: deftheorem Def4 defines numerator RAT_1:def 4 :
for b1 being Rational holds numerator b1 = (denominator b1) * b1;

theorem Th26: :: RAT_1:26
canceled;

theorem Th27: :: RAT_1:27
for b1 being Rational holds
0 < denominator b1
proof end;

theorem Th28: :: RAT_1:28
canceled;

theorem Th29: :: RAT_1:29
for b1 being Rational holds 1 <= denominator b1
proof end;

theorem Th30: :: RAT_1:30
for b1 being Rational holds
0 < (denominator b1) "
proof end;

theorem Th31: :: RAT_1:31
canceled;

theorem Th32: :: RAT_1:32
canceled;

theorem Th33: :: RAT_1:33
canceled;

theorem Th34: :: RAT_1:34
for b1 being Rational holds 1 >= (denominator b1) "
proof end;

theorem Th35: :: RAT_1:35
canceled;

theorem Th36: :: RAT_1:36
for b1 being Rational holds
( numerator b1 = 0 iff b1 = 0 )
proof end;

theorem Th37: :: RAT_1:37
for b1 being Rational holds
( b1 = (numerator b1) / (denominator b1) & b1 = (numerator b1) * ((denominator b1) " ) & b1 = ((denominator b1) " ) * (numerator b1) )
proof end;

theorem Th38: :: RAT_1:38
for b1 being Rational holds
( b1 <> 0 implies denominator b1 = (numerator b1) / b1 )
proof end;

theorem Th39: :: RAT_1:39
canceled;

theorem Th40: :: RAT_1:40
for b1 being Rational holds
( b1 is Integer implies ( denominator b1 = 1 & numerator b1 = b1 ) )
proof end;

theorem Th41: :: RAT_1:41
for b1 being Rational holds
( ( numerator b1 = b1 or denominator b1 = 1 ) implies b1 is Integer )
proof end;

theorem Th42: :: RAT_1:42
for b1 being Rational holds
( numerator b1 = b1 iff denominator b1 = 1 ) by Th40;

theorem Th43: :: RAT_1:43
canceled;

theorem Th44: :: RAT_1:44
for b1 being Rational holds
( ( numerator b1 = b1 or denominator b1 = 1 ) & 0 <= b1 implies b1 is Nat )
proof end;

theorem Th45: :: RAT_1:45
for b1 being Rational holds
( not ( 1 < denominator b1 & b1 is integer ) & not ( not b1 is integer & not 1 < denominator b1 ) )
proof end;

Lemma26: 1 " = 1
;

theorem Th46: :: RAT_1:46
for b1 being Rational holds
( not ( 1 > (denominator b1) " & b1 is integer ) & not ( not b1 is integer & not 1 > (denominator b1) " ) )
proof end;

theorem Th47: :: RAT_1:47
for b1 being Rational holds
( numerator b1 = denominator b1 iff b1 = 1 )
proof end;

theorem Th48: :: RAT_1:48
for b1 being Rational holds
( numerator b1 = - (denominator b1) iff b1 = - 1 )
proof end;

theorem Th49: :: RAT_1:49
for b1 being Rational holds
( - (numerator b1) = denominator b1 iff b1 = - 1 )
proof end;

theorem Th50: :: RAT_1:50
for b1 being Integer
for b2 being Rational holds
( b1 <> 0 implies b2 = ((numerator b2) * b1) / ((denominator b2) * b1) )
proof end;

theorem Th51: :: RAT_1:51
canceled;

theorem Th52: :: RAT_1:52
canceled;

theorem Th53: :: RAT_1:53
canceled;

theorem Th54: :: RAT_1:54
canceled;

theorem Th55: :: RAT_1:55
canceled;

theorem Th56: :: RAT_1:56
canceled;

theorem Th57: :: RAT_1:57
canceled;

theorem Th58: :: RAT_1:58
canceled;

theorem Th59: :: RAT_1:59
canceled;

theorem Th60: :: RAT_1:60
for b1 being Nat
for b2 being Integer
for b3 being Rational holds
not ( b1 <> 0 & b3 = b2 / b1 & ( for b4 being Nat holds
not ( b2 = (numerator b3) * b4 & b1 = (denominator b3) * b4 ) ) )
proof end;

theorem Th61: :: RAT_1:61
for b1, b2 being Integer
for b3 being Rational holds
not ( b3 = b1 / b2 & b2 <> 0 & ( for b4 being Integer holds
not ( b1 = (numerator b3) * b4 & b2 = (denominator b3) * b4 ) ) )
proof end;

theorem Th62: :: RAT_1:62
for b1 being Rational
for b2 being Nat holds
not ( 1 < b2 & ex b3 being Integerex b4 being Nat st
( numerator b1 = b3 * b2 & denominator b1 = b4 * b2 ) )
proof end;

theorem Th63: :: RAT_1:63
for b1 being Nat
for b2 being Integer
for b3 being Rational holds
( b3 = b2 / b1 & b1 <> 0 & ( for b4 being Nat holds
not ( 1 < b4 & ex b5 being Integerex b6 being Nat st
( b2 = b5 * b4 & b1 = b6 * b4 ) ) ) implies ( b1 = denominator b3 & b2 = numerator b3 ) )
proof end;

theorem Th64: :: RAT_1:64
for b1 being Rational holds
( not ( b1 < - 1 & not numerator b1 < - (denominator b1) ) & not ( numerator b1 < - (denominator b1) & not b1 < - 1 ) )
proof end;

theorem Th65: :: RAT_1:65
for b1 being Rational holds
( b1 <= - 1 iff numerator b1 <= - (denominator b1) )
proof end;

theorem Th66: :: RAT_1:66
for b1 being Rational holds
( not ( b1 < - 1 & not denominator b1 < - (numerator b1) ) & not ( denominator b1 < - (numerator b1) & not b1 < - 1 ) )
proof end;

theorem Th67: :: RAT_1:67
for b1 being Rational holds
( b1 <= - 1 iff denominator b1 <= - (numerator b1) )
proof end;

theorem Th68: :: RAT_1:68
canceled;

theorem Th69: :: RAT_1:69
canceled;

theorem Th70: :: RAT_1:70
canceled;

theorem Th71: :: RAT_1:71
canceled;

theorem Th72: :: RAT_1:72
for b1 being Rational holds
( not ( b1 < 1 & not numerator b1 < denominator b1 ) & not ( numerator b1 < denominator b1 & not b1 < 1 ) )
proof end;

theorem Th73: :: RAT_1:73
for b1 being Rational holds
( b1 <= 1 iff numerator b1 <= denominator b1 )
proof end;

theorem Th74: :: RAT_1:74
canceled;

theorem Th75: :: RAT_1:75
canceled;

theorem Th76: :: RAT_1:76
for b1 being Rational holds
( not ( b1 < 0 & not numerator b1 < 0 ) & not ( numerator b1 < 0 & not b1 < 0 ) )
proof end;

theorem Th77: :: RAT_1:77
for b1 being Rational holds
( b1 <= 0 iff numerator b1 <= 0 )
proof end;

theorem Th78: :: RAT_1:78
canceled;

theorem Th79: :: RAT_1:79
canceled;

theorem Th80: :: RAT_1:80
for b1 being real number
for b2 being Rational holds
( not ( b1 < b2 & not b1 * (denominator b2) < numerator b2 ) & not ( b1 * (denominator b2) < numerator b2 & not b1 < b2 ) )
proof end;

theorem Th81: :: RAT_1:81
for b1 being real number
for b2 being Rational holds
( b1 <= b2 iff b1 * (denominator b2) <= numerator b2 )
proof end;

theorem Th82: :: RAT_1:82
canceled;

theorem Th83: :: RAT_1:83
canceled;

theorem Th84: :: RAT_1:84
for b1, b2 being Rational holds
( denominator b1 = denominator b2 & numerator b1 = numerator b2 implies b1 = b2 )
proof end;

theorem Th85: :: RAT_1:85
canceled;

theorem Th86: :: RAT_1:86
for b1, b2 being Rational holds
( not ( b1 < b2 & not (numerator b1) * (denominator b2) < (numerator b2) * (denominator b1) ) & not ( (numerator b1) * (denominator b2) < (numerator b2) * (denominator b1) & not b1 < b2 ) )
proof end;

theorem Th87: :: RAT_1:87
for b1 being Rational holds
( denominator (- b1) = denominator b1 & numerator (- b1) = - (numerator b1) )
proof end;

theorem Th88: :: RAT_1:88
for b1, b2 being Rational holds
( ( 0 < b1 & b2 = 1 / b1 implies ( numerator b2 = denominator b1 & denominator b2 = numerator b1 ) ) & ( numerator b2 = denominator b1 & denominator b2 = numerator b1 implies ( 0 < b1 & b2 = 1 / b1 ) ) )
proof end;

theorem Th89: :: RAT_1:89
for b1, b2 being Rational holds
( ( b1 < 0 & b2 = 1 / b1 implies ( numerator b2 = - (denominator b1) & denominator b2 = - (numerator b1) ) ) & ( numerator b2 = - (denominator b1) & denominator b2 = - (numerator b1) implies ( b1 < 0 & b2 = 1 / b1 ) ) )
proof end;