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
- op' :: (
- unop' : α
The element of
α
represented byx : PreOpposite α
. - )
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 mathlib4#1036).
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. This type inherits all additive structures on α
and
reverses left and right in multiplication.
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 AddOpposite
. Use as induction x using AddOpposite.rec'
.
Equations
- AddOpposite.rec' h X = h (AddOpposite.unop X)
Instances For
A recursor for MulOpposite
. Use as induction x using MulOpposite.rec'
.
Equations
- MulOpposite.rec' h X = h (MulOpposite.unop X)
Instances For
The canonical bijection between α
and αᵃᵒᵖ
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The canonical bijection between α
and αᵐᵒᵖ
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- AddOpposite.inhabited α = { default := AddOpposite.op default }
Equations
- MulOpposite.inhabited α = { default := MulOpposite.op default }
Equations
Equations
Equations
- MulOpposite.zero α = { zero := MulOpposite.op 0 }
Equations
- AddOpposite.zero α = { zero := AddOpposite.op 0 }
Equations
- MulOpposite.one α = { one := MulOpposite.op 1 }
Equations
- MulOpposite.add α = { add := fun x y => MulOpposite.op (MulOpposite.unop x + MulOpposite.unop y) }
Equations
- MulOpposite.sub α = { sub := fun x y => MulOpposite.op (MulOpposite.unop x - MulOpposite.unop y) }
Equations
- MulOpposite.neg α = { neg := fun x => MulOpposite.op (-MulOpposite.unop x) }
Equations
- MulOpposite.involutiveNeg α = let src := MulOpposite.neg α; InvolutiveNeg.mk (_ : ∀ (x : αᵐᵒᵖ), - -x = x)
Equations
- AddOpposite.add α = { add := fun x y => AddOpposite.op (AddOpposite.unop y + AddOpposite.unop x) }
Equations
- MulOpposite.mul α = { mul := fun x y => MulOpposite.op (MulOpposite.unop y * MulOpposite.unop x) }
Equations
- AddOpposite.neg α = { neg := fun x => AddOpposite.op (-AddOpposite.unop x) }
Equations
- MulOpposite.inv α = { inv := fun x => MulOpposite.op (MulOpposite.unop x)⁻¹ }
Equations
- AddOpposite.involutiveNeg α = let src := AddOpposite.neg α; InvolutiveNeg.mk (_ : ∀ (x : αᵃᵒᵖ), - -x = x)
Equations
- MulOpposite.involutiveInv α = let src := MulOpposite.inv α; InvolutiveInv.mk (_ : ∀ (x : αᵐᵒᵖ), x⁻¹⁻¹ = x)
Equations
- AddOpposite.vadd α R = { vadd := fun c x => AddOpposite.op (c +ᵥ AddOpposite.unop x) }
Equations
- MulOpposite.smul α R = { smul := fun c x => MulOpposite.op (c • MulOpposite.unop x) }
Equations
- AddOpposite.one = { one := AddOpposite.op 1 }
Equations
- AddOpposite.mul = { mul := fun a b => AddOpposite.op (AddOpposite.unop a * AddOpposite.unop b) }
Equations
- AddOpposite.inv = { inv := fun a => AddOpposite.op (AddOpposite.unop a)⁻¹ }
Equations
- AddOpposite.div = { div := fun a b => AddOpposite.op (AddOpposite.unop a / AddOpposite.unop b) }