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UTPDGDPQUEKVQC Y25HAVMY4WAD43DQ5PHLHUPDKW7X6DWJVP3VKYVQ3AE25S6ESSXAC 2DQ47UENKWPVS6XYO73Q2KCHTNG6GQVP2CKP24V2OQ4F4T3KAFMAC RUIGRXTKM6BQ532W7KU3RKDXMRNRGDVGMA2ODMX2D2F3PCLF3GAQC WJJ6PMS6GYR5NIQI6Q6YH6WQSTJ3U56F3KZJOSYHTRAZ5MKIPXAAC YEPLQQC3GXCKIMKHMG4QF42ZVEBE3AV2P7MXD2FBA4XAJSQNIBEQC LKG7V6OC5VYTHY3YWWYMIDP5O6OQCWWSMHTMJKALLNQNPOVY375AC AXIWYERYL2PU4JVN5WBIGTOLCVB2R7DVILTRJHU7WNMYPWPJNAOAC proofMultRightDistributesPlus : (x, y, z : Natural)-> mult (plus x y) z = plus (mult x z) (mult y z)proofMultRightDistributesPlus x y z =rewrite proofMultCommutative (plus x y) z inrewrite proofMultLeftDistributesPlus z x y inrewrite proofMultCommutative z x inrewrite proofMultCommutative z y inRefl
public exportSemiring Natural where(+) = plus(*) = multzero = 0one = 1proofSumZero = proofRightIdentity @{NaturalSumMonoid}proofSumCommutative = proofCommutative @{NaturalSumCommutativeMagma}proofSumAssociative = proofAssociative @{NaturalSumSemigroup}proofMultOneLeft = proofLeftIdentity @{NaturalMultMonoid}proofMultOneRight = proofRightIdentity @{NaturalMultMonoid}proofMultAssociative = proofAssociative @{NaturalMultSemigroup}proofMultDistributesSumLeft = proofMultLeftDistributesPlusproofMultDistributesSumRight = proofMultRightDistributesPluszeroAnnihilatorLeft = proofMultLeftAnnihilationzeroAnnihilatorRight = proofMultRightAnnihilation
proofAssociativity Nil f g = ReflproofAssociativity (x::xs) f g with (f x)proofAssociativity (x::xs) f g | Nil = rewrite proofAssociativity xs f g in ReflproofAssociativity (x::xs) f g | (r::rs) = ?holeAssociativity
proofAssociative Nil f g = ReflproofAssociative (x::xs) f g with (f x)proofAssociative (x::xs) f g | Nil = rewrite proofAssociative xs f g in ReflproofAssociative (x::xs) f g | (r::rs) = ?holeAssociative
module Algebra.Ring.Semiringimport Builtinimport Algebra.Group.Magmaimport Algebra.Group.Monoidinfixl 5 +infixl 6 *public exportinterface Semiring t where(+) : t -> t -> t(*) : t -> t -> tzero : tone : tproofSumZero : (x : t) -> x + zero = xproofSumCommutative : (x, y : t) -> x + y = y + xproofSumAssociative : (x, y, z : t) -> x + (y + z) = (x + y) + zproofMultOneLeft : (x : t) -> one * x = xproofMultOneRight : (x : t) -> x * one = xproofMultAssociative : (x, y, z : t) -> x * (y * z) = (x * y) * zproofMultDistributesSumLeft : (x, y, z : t) -> x * (y + z) = x * y + x * zproofMultDistributesSumRight : (x, y, z : t) -> (x + y) * z = x * z + y * zzeroAnnihilatorLeft : (x : t) -> zero * x = zerozeroAnnihilatorRight : (x : t) -> x * zero = zero