The code below lists the axioms of each algebraic structure:
Lean code
importMathlib.Algebra.Ring.DefsnoncomputablesectionopaqueS:TypeuaxiomS_add:S→S→Sinstance:AddSwhereadd:=S_addaxiomS_add_assoc:∀abc:S,a+b+c=a+(b+c)instance:AddSemigroupSwhereadd:=S_addadd_assoc:=S_add_assocaxiomS_zero:Sinstance:ZeroSwherezero:=S_zeroaxiomS_zero_add:∀a:S,0+a=aaxiomS_add_zero:∀a:S,a+0=ainstance:AddMonoidSwhereadd:=S_addadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zeroaxiomS_add_comm:∀ab:S,a+b=b+ainstance:AddCommMonoidSwhereadd:=S_addadd_comm:=S_add_commadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zeroaxiomS_mul:S→S→Sinstance:MulSwheremul:=S_mulaxiomS_mul_assoc:∀abc:S,a*b*c=a*(b*c)instance:SemigroupSwheremul:=S_mulmul_assoc:=S_mul_assocaxiomS_one:Sinstance:OneSwhereone:=S_oneaxiomS_one_mul:∀a:S,1*a=aaxiomS_mul_one:∀a:S,a*1=ainstance:MonoidSwheremul:=S_mulmul_assoc:=S_mul_assocone:=S_oneone_mul:=S_one_mulmul_one:=S_mul_oneaxiomS_left_distrib:∀abc:S,a*(b+c)=a*b+a*caxiomS_right_distrib:∀abc:S,(a+b)*c=a*c+b*caxiomS_zero_mul:∀a:S,0*a=0axiomS_mul_zero:∀a:S,a*0=0instance:SemiringSwhere-- `(S, +)` is a commutative monoidadd:=S_addadd_comm:=S_add_commadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zero-- `(S, *)` is a monoidmul:=S_mulmul_assoc:=S_mul_assocone:=S_oneone_mul:=S_one_mulmul_one:=S_mul_one-- multiplication distributes over additionleft_distrib:=S_left_distribright_distrib:=S_right_distrib-- multiplication by `0` annihilates `S`zero_mul:=S_zero_mulmul_zero:=S_mul_zeroaxiomS_neg:S→Sinstance:NegSwhereneg:=S_negaxiomS_add_left_neg:∀a:S,-a+a=0instance:AddGroupSwhereadd:=S_addadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zeroneg:=S_negadd_left_neg:=S_add_left_negsub:=funab:S↦a+-binstance:AddCommGroupSwhereadd:=S_addadd_comm:=S_add_commadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zeroneg:=S_negadd_left_neg:=S_add_left_negsub:=funab:S↦a+-binstance:RingSwhere-- `(S, +)` is a commutative groupadd:=S_addadd_comm:=S_add_commadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zeroneg:=S_negadd_left_neg:=S_add_left_negsub:=funab:S↦a+-b-- `(S, *)` is a monoidmul:=S_mulmul_assoc:=S_mul_assocone:=S_oneone_mul:=S_one_mulmul_one:=S_mul_one-- multiplication distributes over additionleft_distrib:=S_left_distribright_distrib:=S_right_distrib-- multiplication by `0` annihilates `S`zero_mul:=S_zero_mulmul_zero:=S_mul_zeroaxiomS_mul_comm:∀ab:S,a*b=b*ainstance:CommRingSwhere-- `(S, +)` is a commutative groupadd:=S_addadd_comm:=S_add_commadd_assoc:=S_add_assoczero:=S_zerozero_add:=S_zero_addadd_zero:=S_add_zeroneg:=S_negadd_left_neg:=S_add_left_negsub:=funab:S↦a+-b-- `(S, *)` is a commutative monoidmul:=S_mulmul_comm:=S_mul_commmul_assoc:=S_mul_assocone:=S_oneone_mul:=S_one_mulmul_one:=S_mul_one-- multiplication distributes over additionleft_distrib:=S_left_distribright_distrib:=S_right_distrib-- multiplication by `0` annihilates `S`zero_mul:=S_zero_mulmul_zero:=S_mul_zeroend