:: RING_1 semantic presentation

registration
let c1 be non empty 1-sorted ;
cluster [#] a1 -> non proper ;
coherence
not [#] c1 is proper
proof end;
end;

theorem Th1: :: RING_1:1
for b1 being non empty add-associative right_zeroed right_complementable LoopStr
for b2, b3 being Element of b1 holds (b2 - b3) + b3 = b2
proof end;

theorem Th2: :: RING_1:2
for b1 being non empty Abelian add-associative right_zeroed right_complementable LoopStr
for b2, b3 being Element of b1 holds b3 = b2 - (b2 - b3)
proof end;

theorem Th3: :: RING_1:3
for b1 being non empty Abelian add-associative right_zeroed right_complementable LoopStr
for b2, b3, b4 being Element of b1 holds (b2 - b3) - (b4 - b3) = b2 - b4
proof end;

definition
let c1 be non empty HGrStr ;
let c2 be Subset of c1;
attr a2 is quasi-prime means :Def1: :: RING_1:def 1
for b1, b2 being Element of a1 holds
( not b1 * b2 in a2 or b1 in a2 or b2 in a2 );
end;

:: deftheorem Def1 defines quasi-prime RING_1:def 1 :
for b1 being non empty HGrStr
for b2 being Subset of b1 holds
( b2 is quasi-prime iff for b3, b4 being Element of b1 holds
( not b3 * b4 in b2 or b3 in b2 or b4 in b2 ) );

definition
let c1 be non empty multLoopStr ;
let c2 be Subset of c1;
attr a2 is prime means :Def2: :: RING_1:def 2
( a2 is proper & a2 is quasi-prime );
end;

:: deftheorem Def2 defines prime RING_1:def 2 :
for b1 being non empty multLoopStr
for b2 being Subset of b1 holds
( b2 is prime iff ( b2 is proper & b2 is quasi-prime ) );

definition
let c1 be non empty doubleLoopStr ;
let c2 be Subset of c1;
attr a2 is quasi-maximal means :Def3: :: RING_1:def 3
for b1 being Ideal of a1 holds
( not a2 c= b1 or b1 = a2 or not b1 is proper );
end;

:: deftheorem Def3 defines quasi-maximal RING_1:def 3 :
for b1 being non empty doubleLoopStr
for b2 being Subset of b1 holds
( b2 is quasi-maximal iff for b3 being Ideal of b1 holds
( not b2 c= b3 or b3 = b2 or not b3 is proper ) );

definition
let c1 be non empty doubleLoopStr ;
let c2 be Subset of c1;
attr a2 is maximal means :Def4: :: RING_1:def 4
( a2 is proper & a2 is quasi-maximal );
end;

:: deftheorem Def4 defines maximal RING_1:def 4 :
for b1 being non empty doubleLoopStr
for b2 being Subset of b1 holds
( b2 is maximal iff ( b2 is proper & b2 is quasi-maximal ) );

registration
let c1 be non empty multLoopStr ;
cluster prime -> proper quasi-prime Element of K40(the carrier of a1);
coherence
for b1 being Subset of c1 st b1 is prime holds
( b1 is proper & b1 is quasi-prime )
by Def2;
cluster proper quasi-prime -> prime Element of K40(the carrier of a1);
coherence
for b1 being Subset of c1 st b1 is proper & b1 is quasi-prime holds
b1 is prime
by Def2;
end;

registration
let c1 be non empty doubleLoopStr ;
cluster maximal -> proper quasi-maximal Element of K40(the carrier of a1);
coherence
for b1 being Subset of c1 st b1 is maximal holds
( b1 is proper & b1 is quasi-maximal )
by Def4;
cluster proper quasi-maximal -> maximal Element of K40(the carrier of a1);
coherence
for b1 being Subset of c1 st b1 is proper & b1 is quasi-maximal holds
b1 is maximal
by Def4;
end;

registration
let c1 be non empty LoopStr ;
cluster [#] a1 -> add-closed non proper ;
coherence
[#] c1 is add-closed
proof end;
end;

registration
let c1 be non empty HGrStr ;
cluster [#] a1 -> left-ideal right-ideal non proper ;
coherence
( [#] c1 is left-ideal & [#] c1 is right-ideal )
proof end;
end;

theorem Th4: :: RING_1:4
for b1 being domRing holds {(0. b1)} is prime
proof end;

Lemma8: for b1 being Ring
for b2 being Ideal of b1ex b3 being Equivalence_Relation of the carrier of b1 st
for b4, b5 being set holds
( [b4,b5] in b3 iff ( b4 in the carrier of b1 & b5 in the carrier of b1 & ex b6, b7 being Element of b1 st
( b6 = b4 & b7 = b5 & b6 - b7 in b2 ) ) )
proof end;

definition
let c1 be Ring;
let c2 be Ideal of c1;
func EqRel c1,c2 -> Relation of a1 means :Def5: :: RING_1:def 5
for b1, b2 being Element of a1 holds
( [b1,b2] in a3 iff b1 - b2 in a2 );
existence
ex b1 being Relation of c1 st
for b2, b3 being Element of c1 holds
( [b2,b3] in b1 iff b2 - b3 in c2 )
proof end;
uniqueness
for b1, b2 being Relation of c1 st ( for b3, b4 being Element of c1 holds
( [b3,b4] in b1 iff b3 - b4 in c2 ) ) & ( for b3, b4 being Element of c1 holds
( [b3,b4] in b2 iff b3 - b4 in c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines EqRel RING_1:def 5 :
for b1 being Ring
for b2 being Ideal of b1
for b3 being Relation of b1 holds
( b3 = EqRel b1,b2 iff for b4, b5 being Element of b1 holds
( [b4,b5] in b3 iff b4 - b5 in b2 ) );

registration
let c1 be Ring;
let c2 be Ideal of c1;
cluster EqRel a1,a2 -> non empty symmetric transitive total ;
coherence
( not EqRel c1,c2 is empty & EqRel c1,c2 is total & EqRel c1,c2 is symmetric & EqRel c1,c2 is transitive )
proof end;
end;

theorem Th5: :: RING_1:5
for b1 being Ring
for b2 being Ideal of b1
for b3, b4 being Element of b1 holds
( b3 in Class (EqRel b1,b2),b4 iff b3 - b4 in b2 )
proof end;

theorem Th6: :: RING_1:6
for b1 being Ring
for b2 being Ideal of b1
for b3, b4 being Element of b1 holds
( Class (EqRel b1,b2),b3 = Class (EqRel b1,b2),b4 iff b3 - b4 in b2 )
proof end;

theorem Th7: :: RING_1:7
for b1 being Ring
for b2 being Element of b1 holds Class (EqRel b1,([#] b1)),b2 = the carrier of b1
proof end;

theorem Th8: :: RING_1:8
for b1 being Ring holds Class (EqRel b1,([#] b1)) = {the carrier of b1}
proof end;

theorem Th9: :: RING_1:9
for b1 being Ring
for b2 being Element of b1 holds Class (EqRel b1,{(0. b1)}),b2 = {b2}
proof end;

theorem Th10: :: RING_1:10
for b1 being Ring holds Class (EqRel b1,{(0. b1)}) = rng (singleton the carrier of b1)
proof end;

definition
let c1 be Ring;
let c2 be Ideal of c1;
func QuotientRing c1,c2 -> strict doubleLoopStr means :Def6: :: RING_1:def 6
( the carrier of a3 = Class (EqRel a1,a2) & the unity of a3 = Class (EqRel a1,a2),(1. a1) & the Zero of a3 = Class (EqRel a1,a2),(0. a1) & ( for b1, b2 being Element of a3ex b3, b4 being Element of a1 st
( b1 = Class (EqRel a1,a2),b3 & b2 = Class (EqRel a1,a2),b4 & the add of a3 . b1,b2 = Class (EqRel a1,a2),(b3 + b4) ) ) & ( for b1, b2 being Element of a3ex b3, b4 being Element of a1 st
( b1 = Class (EqRel a1,a2),b3 & b2 = Class (EqRel a1,a2),b4 & the mult of a3 . b1,b2 = Class (EqRel a1,a2),(b3 * b4) ) ) );
existence
ex b1 being strict doubleLoopStr st
( the carrier of b1 = Class (EqRel c1,c2) & the unity of b1 = Class (EqRel c1,c2),(1. c1) & the Zero of b1 = Class (EqRel c1,c2),(0. c1) & ( for b2, b3 being Element of b1ex b4, b5 being Element of c1 st
( b2 = Class (EqRel c1,c2),b4 & b3 = Class (EqRel c1,c2),b5 & the add of b1 . b2,b3 = Class (EqRel c1,c2),(b4 + b5) ) ) & ( for b2, b3 being Element of b1ex b4, b5 being Element of c1 st
( b2 = Class (EqRel c1,c2),b4 & b3 = Class (EqRel c1,c2),b5 & the mult of b1 . b2,b3 = Class (EqRel c1,c2),(b4 * b5) ) ) )
proof end;
uniqueness
for b1, b2 being strict doubleLoopStr st the carrier of b1 = Class (EqRel c1,c2) & the unity of b1 = Class (EqRel c1,c2),(1. c1) & the Zero of b1 = Class (EqRel c1,c2),(0. c1) & ( for b3, b4 being Element of b1ex b5, b6 being Element of c1 st
( b3 = Class (EqRel c1,c2),b5 & b4 = Class (EqRel c1,c2),b6 & the add of b1 . b3,b4 = Class (EqRel c1,c2),(b5 + b6) ) ) & ( for b3, b4 being Element of b1ex b5, b6 being Element of c1 st
( b3 = Class (EqRel c1,c2),b5 & b4 = Class (EqRel c1,c2),b6 & the mult of b1 . b3,b4 = Class (EqRel c1,c2),(b5 * b6) ) ) & the carrier of b2 = Class (EqRel c1,c2) & the unity of b2 = Class (EqRel c1,c2),(1. c1) & the Zero of b2 = Class (EqRel c1,c2),(0. c1) & ( for b3, b4 being Element of b2ex b5, b6 being Element of c1 st
( b3 = Class (EqRel c1,c2),b5 & b4 = Class (EqRel c1,c2),b6 & the add of b2 . b3,b4 = Class (EqRel c1,c2),(b5 + b6) ) ) & ( for b3, b4 being Element of b2ex b5, b6 being Element of c1 st
( b3 = Class (EqRel c1,c2),b5 & b4 = Class (EqRel c1,c2),b6 & the mult of b2 . b3,b4 = Class (EqRel c1,c2),(b5 * b6) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines QuotientRing RING_1:def 6 :
for b1 being Ring
for b2 being Ideal of b1
for b3 being strict doubleLoopStr holds
( b3 = QuotientRing b1,b2 iff ( the carrier of b3 = Class (EqRel b1,b2) & the unity of b3 = Class (EqRel b1,b2),(1. b1) & the Zero of b3 = Class (EqRel b1,b2),(0. b1) & ( for b4, b5 being Element of b3ex b6, b7 being Element of b1 st
( b4 = Class (EqRel b1,b2),b6 & b5 = Class (EqRel b1,b2),b7 & the add of b3 . b4,b5 = Class (EqRel b1,b2),(b6 + b7) ) ) & ( for b4, b5 being Element of b3ex b6, b7 being Element of b1 st
( b4 = Class (EqRel b1,b2),b6 & b5 = Class (EqRel b1,b2),b7 & the mult of b3 . b4,b5 = Class (EqRel b1,b2),(b6 * b7) ) ) ) );

notation
let c1 be Ring;
let c2 be Ideal of c1;
synonym c1 / c2 for QuotientRing c1,c2;
end;

registration
let c1 be Ring;
let c2 be Ideal of c1;
cluster QuotientRing a1,a2 -> non empty strict ;
coherence
not c1 / c2 is empty
proof end;
end;

theorem Th11: :: RING_1:11
for b1 being Ring
for b2 being Ideal of b1
for b3 being Element of (b1 / b2)ex b4 being Element of b1 st b3 = Class (EqRel b1,b2),b4
proof end;

theorem Th12: :: RING_1:12
for b1 being Ring
for b2 being Ideal of b1
for b3 being Element of b1 holds Class (EqRel b1,b2),b3 is Element of (b1 / b2)
proof end;

theorem Th13: :: RING_1:13
for b1 being Ring
for b2 being Ideal of b1
for b3, b4 being Element of b1
for b5, b6 being Element of (b1 / b2) st b5 = Class (EqRel b1,b2),b3 & b6 = Class (EqRel b1,b2),b4 holds
b5 + b6 = Class (EqRel b1,b2),(b3 + b4)
proof end;

theorem Th14: :: RING_1:14
for b1 being Ring
for b2 being Ideal of b1
for b3, b4 being Element of b1
for b5, b6 being Element of (b1 / b2) st b5 = Class (EqRel b1,b2),b3 & b6 = Class (EqRel b1,b2),b4 holds
b5 * b6 = Class (EqRel b1,b2),(b3 * b4)
proof end;

E19: now
let c1 be Ring;
let c2 be Ideal of c1;
set c3 = EqRel c1,c2;
let c4 be Element of (c1 / c2);
assume E20: c4 = Class (EqRel c1,c2),(1. c1) ;
let c5 be Element of (c1 / c2);
consider c6 being Element of c1 such that
E21: c4 = Class (EqRel c1,c2),c6 by Th11;
consider c7 being Element of c1 such that
E22: c5 = Class (EqRel c1,c2),c7 by Th11;
E23: c6 - (1. c1) in c2 by E20, E21, Th6;
then E24: c7 * (c6 - (1. c1)) in c2 by IDEAL_1:def 2;
E25: c7 * (c6 - (1. c1)) = (c7 * c6) - (c7 * (1. c1)) by VECTSP_1:43
.= (c7 * c6) - c7 by VECTSP_1:def 13 ;
thus c5 * c4 = Class (EqRel c1,c2),(c7 * c6) by E21, E22, Th14
.= c5 by E22, E24, E25, Th6 ;
E26: (c6 - (1. c1)) * c7 in c2 by E23, IDEAL_1:def 3;
E27: (c6 - (1. c1)) * c7 = (c6 * c7) - ((1. c1) * c7) by VECTSP_1:45
.= (c6 * c7) - c7 by VECTSP_1:def 19 ;
thus c4 * c5 = Class (EqRel c1,c2),(c6 * c7) by E21, E22, Th14
.= c5 by E22, E27, E26, Th6 ;
end;

E20: now
let c1 be Ring;
let c2 be Ideal of c1;
thus c1 / c2 is unital
proof
reconsider c3 = Class (EqRel c1,c2),(1. c1) as Element of (c1 / c2) by Def6;
take c3 ; :: according to GROUP_1:def 2
thus for b1 being Element of the carrier of (c1 / c2) holds
( b1 * c3 = b1 & c3 * b1 = b1 ) by Lemma19;
end;
end;

theorem Th15: :: RING_1:15
for b1 being Ring
for b2 being Ideal of b1 holds Class (EqRel b1,b2),(1. b1) = 1. (b1 / b2)
proof end;

registration
let c1 be Ring;
let c2 be Ideal of c1;
cluster QuotientRing a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable associative strict right_unital distributive left_unital ;
coherence
( c1 / c2 is Abelian & c1 / c2 is add-associative & c1 / c2 is right_zeroed & c1 / c2 is right_complementable & c1 / c2 is associative & c1 / c2 is left_unital & c1 / c2 is right_unital & c1 / c2 is distributive )
proof end;
end;

registration
let c1 be commutative Ring;
let c2 be Ideal of c1;
cluster QuotientRing a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable associative commutative strict right_unital distributive left_unital ;
coherence
c1 / c2 is commutative
proof end;
end;

theorem Th16: :: RING_1:16
for b1 being Ring
for b2 being Ideal of b1 holds
( b2 is proper iff not b1 / b2 is degenerated )
proof end;

theorem Th17: :: RING_1:17
for b1 being Ring
for b2 being Ideal of b1 holds
( b2 is quasi-prime iff b1 / b2 is domRing-like )
proof end;

theorem Th18: :: RING_1:18
for b1 being commutative Ring
for b2 being Ideal of b1 holds
( b2 is prime iff b1 / b2 is domRing )
proof end;

theorem Th19: :: RING_1:19
for b1 being Ring
for b2 being Ideal of b1 st b1 is commutative & b2 is quasi-maximal holds
b1 / b2 is Field-like
proof end;

theorem Th20: :: RING_1:20
for b1 being Ring
for b2 being Ideal of b1 st b1 / b2 is Field-like holds
b2 is quasi-maximal
proof end;

theorem Th21: :: RING_1:21
for b1 being commutative Ring
for b2 being Ideal of b1 holds
( b2 is maximal iff b1 / b2 is Skew-Field )
proof end;

registration
let c1 be commutative non degenerated Ring;
cluster maximal -> proper quasi-prime prime Element of K40(the carrier of a1);
coherence
for b1 being Ideal of c1 st b1 is maximal holds
b1 is prime
proof end;
end;

registration
let c1 be non degenerated Ring;
cluster proper quasi-maximal maximal Element of K40(the carrier of a1);
existence
ex b1 being Ideal of c1 st b1 is maximal
proof end;
end;

registration
let c1 be commutative non degenerated Ring;
cluster proper quasi-prime prime quasi-maximal maximal Element of K40(the carrier of a1);
existence
ex b1 being Ideal of c1 st b1 is maximal
proof end;
end;

registration
let c1 be commutative non degenerated Ring;
let c2 be quasi-prime Ideal of c1;
cluster QuotientRing a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable associative commutative strict right_unital distributive left_unital domRing-like ;
coherence
c1 / c2 is domRing-like
by Th17;
end;

registration
let c1 be commutative non degenerated Ring;
let c2 be quasi-maximal Ideal of c1;
cluster QuotientRing a1,a2 -> non empty Abelian add-associative right_zeroed right_complementable associative commutative strict right_unital distributive left_unital Field-like ;
coherence
c1 / c2 is Field-like
by Th19;
end;