:: RAT_1 semantic presentation

E1: one = succ 0 by ORDINAL2:def 4
.= 1 ;

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+ st b2 = b1 holds
c1 - b2 = - b1
proof end;

Lemma4: for b1 being set st b1 in RAT holds
ex b2, b3 being Integer st b1 = b2 / b3
proof end;

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

Lemma6: for b1 being set
for b2, b3 being Integer st b1 = b2 / b3 holds
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 st b1 in RAT holds
ex b2, b3 being Integer st
( b3 <> 0 & b1 = b2 / b3 )
proof end;

theorem Th2: :: RAT_1:2
canceled;

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

registration
cluster rational -> real set ;
coherence
for b1 being number st b1 is rational holds
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 st ex b2, b3 being Integer st b1 = b2 / b3 holds
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 st b1 is integer holds
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 st b1 < b2 holds
ex b3 being Rational st
( b1 < b3 & b3 < b2 )
proof end;

theorem Th23: :: RAT_1:23
canceled;

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

theorem Th25: :: RAT_1:25
for b1 being Rational ex b2 being Integerex b3 being Nat st
( b3 <> 0 & b1 = b2 / b3 & ( for b4 being Integer
for b5 being Nat st b5 <> 0 & b1 = b4 / b5 holds
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 st b2 <> 0 & a1 = b1 / b2 holds
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 st b3 <> 0 & c2 = b2 / b3 holds
b1 <= b3 ) )
proof end;
uniqueness
for b1, b2 being Nat st b1 <> 0 & ex b3 being Integer st c2 = b3 / b1 & ( for b3 being Integer
for b4 being Nat st b4 <> 0 & c2 = b3 / b4 holds
b1 <= b4 ) & b2 <> 0 & ex b3 being Integer st c2 = b3 / b2 & ( for b3 being Integer
for b4 being Nat st b4 <> 0 & c2 = b3 / b4 holds
b2 <= b4 ) holds
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 st b4 <> 0 & b1 = b3 / b4 holds
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 st b1 <> 0 holds
denominator b1 = (numerator b1) / b1
proof end;

theorem Th39: :: RAT_1:39
canceled;

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

theorem Th41: :: RAT_1:41
for b1 being Rational st ( numerator b1 = b1 or denominator b1 = 1 ) holds
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 st ( numerator b1 = b1 or denominator b1 = 1 ) & 0 <= b1 holds
b1 is Nat
proof end;

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

Lemma26: 1 " = 1
;

theorem Th46: :: RAT_1:46
for b1 being Rational holds
( 1 > (denominator b1) " iff not b1 is integer )
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 st b1 <> 0 holds
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 st b1 <> 0 & b3 = b2 / b1 holds
ex b4 being Nat st
( b2 = (numerator b3) * b4 & b1 = (denominator b3) * b4 )
proof end;

theorem Th61: :: RAT_1:61
for b1, b2 being Integer
for b3 being Rational st b3 = b1 / b2 & b2 <> 0 holds
ex b4 being Integer st
( 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 or for b3 being Integer
for b4 being Nat holds
( not numerator b1 = b3 * b2 or not denominator b1 = b4 * b2 ) )
proof end;

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

theorem Th64: :: RAT_1:64
for b1 being Rational holds
( b1 < - 1 iff numerator b1 < - (denominator b1) )
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
( b1 < - 1 iff denominator b1 < - (numerator b1) )
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
( b1 < 1 iff numerator b1 < denominator b1 )
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
( b1 < 0 iff numerator 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
( b1 < b2 iff b1 * (denominator b2) < numerator 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 st denominator b1 = denominator b2 & numerator b1 = numerator b2 holds
b1 = b2
proof end;

theorem Th85: :: RAT_1:85
canceled;

theorem Th86: :: RAT_1:86
for b1, b2 being Rational holds
( b1 < b2 iff (numerator b1) * (denominator b2) < (numerator b2) * (denominator b1) )
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 iff ( numerator b2 = denominator b1 & denominator b2 = numerator b1 ) )
proof end;

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