Multiplicative opposite and algebraic operations on it #
In this file we define MulOpposite α = αᵐᵒᵖ
to be the multiplicative opposite of α
. It inherits
all additive algebraic structures on α
(in other files), and reverses the order of multipliers in
multiplicative structures, i.e., op (x * y) = op y * op x
, where MulOpposite.op
is the
canonical map from α
to αᵐᵒᵖ
.
We also define AddOpposite α = αᵃᵒᵖ
to be the additive opposite of α
. It inherits all
multiplicative algebraic structures on α
(in other files), and reverses the order of summands in
additive structures, i.e. op (x + y) = op y + op x
, where AddOpposite.op
is the canonical map
from α
to αᵃᵒᵖ
.
Notation #
αᵐᵒᵖ = MulOpposite α
αᵃᵒᵖ = AddOpposite α
Implementation notes #
In mathlib3 αᵐᵒᵖ
was just a type synonym for α
, marked irreducible after the API
was developed. In mathlib4 we use a structure with one field, because it is not possible
to change the reducibility of a declaration after its definition, and because Lean 4 has
definitional eta reduction for structures (Lean 3 does not).
Tags #
multiplicative opposite, additive opposite
Auxiliary type to implement MulOpposite
and AddOpposite
.
It turns out to be convenient to have MulOpposite α = AddOpposite α
true by definition, in the
same way that it is convenient to have Additive α = α
; this means that we also get the defeq
AddOpposite (Additive α) = MulOpposite α
, which is convenient when working with quotients.
This is a compromise between making MulOpposite α = AddOpposite α = α
(what we had in Lean 3) and
having no defeqs within those three types (which we had as of https://github.com/leanprover-community/mathlib4/pull/1036).
- op' :: (
- unop' : α
The element of
α
represented byx : PreOpposite α
. - )
Instances For
Multiplicative opposite of a type. This type inherits all additive structures on α
and
reverses left and right in multiplication.
Equations
- αᵐᵒᵖ = PreOpposite α
Instances For
Additive opposite of a type. This type inherits all multiplicative structures on α
and
reverses left and right in addition.
Equations
- αᵃᵒᵖ = PreOpposite α
Instances For
Multiplicative opposite of a type.
Equations
- «term_ᵐᵒᵖ» = Lean.ParserDescr.trailingNode `«term_ᵐᵒᵖ» 1024 1024 (Lean.ParserDescr.symbol "ᵐᵒᵖ")
Instances For
Additive opposite of a type.
Equations
- «term_ᵃᵒᵖ» = Lean.ParserDescr.trailingNode `«term_ᵃᵒᵖ» 1024 1024 (Lean.ParserDescr.symbol "ᵃᵒᵖ")
Instances For
The element of MulOpposite α
that represents x : α
.
Equations
- MulOpposite.op = PreOpposite.op'
Instances For
A recursor for MulOpposite
. Use as induction x
.
Equations
- MulOpposite.rec' h X = h (MulOpposite.unop X)
Instances For
A recursor for AddOpposite
. Use as induction x
.
Equations
- AddOpposite.rec' h X = h (AddOpposite.unop X)
Instances For
Equations
- MulOpposite.instInhabited = { default := MulOpposite.op default }
Equations
- AddOpposite.instInhabited = { default := AddOpposite.op default }
Equations
- MulOpposite.instUnique = Unique.mk' αᵐᵒᵖ
Equations
- AddOpposite.instUnique = Unique.mk' αᵃᵒᵖ
Equations
- MulOpposite.instDecidableEq = ⋯.decidableEq
Equations
- AddOpposite.instDecidableEq = ⋯.decidableEq
Equations
- MulOpposite.instZero = { zero := MulOpposite.op 0 }
Equations
- MulOpposite.instOne = { one := MulOpposite.op 1 }
Equations
- AddOpposite.instZero = { zero := AddOpposite.op 0 }
Equations
- MulOpposite.instAdd = { add := fun (x y : αᵐᵒᵖ) => MulOpposite.op (MulOpposite.unop x + MulOpposite.unop y) }
Equations
- MulOpposite.instSub = { sub := fun (x y : αᵐᵒᵖ) => MulOpposite.op (MulOpposite.unop x - MulOpposite.unop y) }
Equations
- MulOpposite.instNeg = { neg := fun (x : αᵐᵒᵖ) => MulOpposite.op (-MulOpposite.unop x) }
Equations
- MulOpposite.instInvolutiveNeg = InvolutiveNeg.mk ⋯
Equations
- MulOpposite.instMul = { mul := fun (x y : αᵐᵒᵖ) => MulOpposite.op (MulOpposite.unop y * MulOpposite.unop x) }
Equations
- AddOpposite.instAdd = { add := fun (x y : αᵃᵒᵖ) => AddOpposite.op (AddOpposite.unop y + AddOpposite.unop x) }
Equations
- MulOpposite.instInv = { inv := fun (x : αᵐᵒᵖ) => MulOpposite.op (MulOpposite.unop x)⁻¹ }
Equations
- AddOpposite.instNeg = { neg := fun (x : αᵃᵒᵖ) => AddOpposite.op (-AddOpposite.unop x) }
Equations
- MulOpposite.instInvolutiveInv = InvolutiveInv.mk ⋯
Equations
- AddOpposite.instInvolutiveNeg = InvolutiveNeg.mk ⋯
Equations
- MulOpposite.instSMul = { smul := fun (c : α) (x : βᵐᵒᵖ) => MulOpposite.op (c • MulOpposite.unop x) }
Equations
- AddOpposite.instVAdd = { vadd := fun (c : α) (x : βᵃᵒᵖ) => AddOpposite.op (c +ᵥ AddOpposite.unop x) }
Equations
- AddOpposite.instOne = { one := AddOpposite.op 1 }
Equations
- AddOpposite.instMul = { mul := fun (a b : αᵃᵒᵖ) => AddOpposite.op (AddOpposite.unop a * AddOpposite.unop b) }
Equations
- AddOpposite.instInv = { inv := fun (a : αᵃᵒᵖ) => AddOpposite.op (AddOpposite.unop a)⁻¹ }
Equations
- AddOpposite.instInvolutiveInv = InvolutiveInv.mk ⋯
Equations
- AddOpposite.instDiv = { div := fun (a b : αᵃᵒᵖ) => AddOpposite.op (AddOpposite.unop a / AddOpposite.unop b) }