module Algebra.Ring.Reasoning {β} (R : Ring β) where
Reasoning combinators for ringsπ
*-zerol : 0r * x β‘ 0r *-zerol {x} = 0r * x β‘β¨ a.introl a.inversel β©β‘ (- 0r * x) + 0r * x + 0r * x β‘β¨ a.pullr (sym *-distribr) β©β‘ (- 0r * x) + (0r + 0r) * x β‘β¨ apβ _+_ refl (ap (_* x) a.idl) β©β‘ (- 0r * x) + 0r * x β‘β¨ a.inversel β©β‘ 0r β *-zeror : x * 0r β‘ 0r *-zeror {x} = x * 0r β‘β¨ a.intror a.inverser β©β‘ x * 0r + (x * 0r - x * 0r) β‘β¨ a.pulll (sym *-distribl) β©β‘ x * (0r + 0r) - x * 0r β‘β¨ apβ _-_ (ap (x *_) a.idl) refl β©β‘ x * 0r - x * 0r β‘β¨ a.inverser β©β‘ 0r β *-negatel : (- x) * y β‘ - (x * y) *-negatel {x} {y} = monoid-inverse-unique a.has-is-monoid (x * y) ((- x) * y) (- (x * y)) (sym *-distribr Β·Β· ap (_* y) a.inversel Β·Β· *-zerol) a.inverser *-negater : x * (- y) β‘ - (x * y) *-negater {x} {y} = monoid-inverse-unique a.has-is-monoid (x * y) (x * (- y)) (- (x * y)) (sym *-distribl Β·Β· ap (x *_) a.inversel Β·Β· *-zeror) a.inverser