algebra.field.opposite
⟷
Mathlib.Algebra.Field.Opposite
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
Fix naming errors and non-defeq diamonds recently introduced. Those were discovered during the port.
@@ -53,7 +53,8 @@ instance [division_semiring α] : division_semiring αᵃᵒᵖ :=
{ ..add_opposite.group_with_zero α, ..add_opposite.semiring α }
instance [division_ring α] : division_ring αᵃᵒᵖ :=
-{ ..add_opposite.group_with_zero α, ..add_opposite.ring α }
+{ rat_cast_mk := λ a b hb h, by rw ←div_eq_mul_inv; exact congr_arg op (rat.cast_def _),
+ ..add_opposite.ring α, ..add_opposite.group_with_zero α, ..add_opposite.has_rat_cast α }
instance [semifield α] : semifield αᵃᵒᵖ :=
{ ..add_opposite.division_semiring α, ..add_opposite.comm_semiring α }
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
A few missing instances about nat.cast
/int.cast
/rat.cast
and mul_opposite
/add_opposite
.
Also add the (weirdly) missing add_comm_group_with_one → add_comm_monoid_with_one
.
Finally, this changes the defeq of rat.cast
on mul_opposite
to be simpler.
@@ -5,6 +5,7 @@ Authors: Kenny Lau
-/
import algebra.field.defs
import algebra.ring.opposite
+import data.int.cast.lemmas
/-!
# Field structure on the multiplicative/additive opposite
@@ -15,11 +16,28 @@ import algebra.ring.opposite
variables (α : Type*)
+namespace mul_opposite
+
+@[to_additive] instance [has_rat_cast α] : has_rat_cast αᵐᵒᵖ := ⟨λ n, op n⟩
+
+variables {α}
+
+@[simp, norm_cast, to_additive]
+lemma op_rat_cast [has_rat_cast α] (q : ℚ) : op (q : α) = q := rfl
+
+@[simp, norm_cast, to_additive]
+lemma unop_rat_cast [has_rat_cast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q := rfl
+
+variables (α)
+
instance [division_semiring α] : division_semiring αᵐᵒᵖ :=
{ .. mul_opposite.group_with_zero α, .. mul_opposite.semiring α }
instance [division_ring α] : division_ring αᵐᵒᵖ :=
-{ .. mul_opposite.group_with_zero α, .. mul_opposite.ring α }
+{ rat_cast := λ q, op q,
+ rat_cast_mk := λ a b hb h, by { rw [rat.cast_def, op_div, op_nat_cast, op_int_cast],
+ exact int.commute_cast _ _ },
+ ..mul_opposite.division_semiring α, ..mul_opposite.ring α }
instance [semifield α] : semifield αᵐᵒᵖ :=
{ .. mul_opposite.division_semiring α, .. mul_opposite.comm_semiring α }
@@ -27,6 +45,10 @@ instance [semifield α] : semifield αᵐᵒᵖ :=
instance [field α] : field αᵐᵒᵖ :=
{ .. mul_opposite.division_ring α, .. mul_opposite.comm_ring α }
+end mul_opposite
+
+namespace add_opposite
+
instance [division_semiring α] : division_semiring αᵃᵒᵖ :=
{ ..add_opposite.group_with_zero α, ..add_opposite.semiring α }
@@ -38,3 +60,5 @@ instance [semifield α] : semifield αᵃᵒᵖ :=
instance [field α] : field αᵃᵒᵖ :=
{ ..add_opposite.division_ring α, ..add_opposite.comm_ring α }
+
+end add_opposite
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -52,7 +52,7 @@ instance [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
{ MulOpposite.divisionSemiring α,
MulOpposite.ring α with
ratCast := fun q => op q
- ratCast_mk := fun a b hb h =>
+ ratCast_def := fun a b hb h =>
by
rw [Rat.cast_def, op_div, op_nat_cast, op_int_cast]
exact Int.commute_cast _ _ }
@@ -72,7 +72,8 @@ instance [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
instance [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
{ AddOpposite.ring α, AddOpposite.groupWithZero α, AddOpposite.hasRatCast α with
- ratCast_mk := fun a b hb h => by rw [← div_eq_mul_inv] <;> exact congr_arg op (Rat.cast_def _) }
+ ratCast_def := fun a b hb h => by
+ rw [← div_eq_mul_inv] <;> exact congr_arg op (Rat.cast_def _) }
instance [Semifield α] : Semifield αᵃᵒᵖ :=
{ AddOpposite.divisionSemiring α, AddOpposite.commSemiring α with }
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
-/
-import Mathbin.Algebra.Field.Defs
-import Mathbin.Algebra.Ring.Opposite
-import Mathbin.Data.Int.Cast.Lemmas
+import Algebra.Field.Defs
+import Algebra.Ring.Opposite
+import Data.Int.Cast.Lemmas
#align_import algebra.field.opposite from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
-
-! This file was ported from Lean 3 source module algebra.field.opposite
-! leanprover-community/mathlib commit 76de8ae01554c3b37d66544866659ff174e66e1f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.Field.Defs
import Mathbin.Algebra.Ring.Opposite
import Mathbin.Data.Int.Cast.Lemmas
+#align_import algebra.field.opposite from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f"
+
/-!
# Field structure on the multiplicative/additive opposite
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -30,17 +30,21 @@ instance [HasRatCast α] : HasRatCast αᵐᵒᵖ :=
variable {α}
+#print MulOpposite.op_ratCast /-
@[simp, norm_cast, to_additive]
theorem op_ratCast [HasRatCast α] (q : ℚ) : op (q : α) = q :=
rfl
#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
#align add_opposite.op_rat_cast AddOpposite.op_ratCast
+-/
+#print MulOpposite.unop_ratCast /-
@[simp, norm_cast, to_additive]
theorem unop_ratCast [HasRatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
rfl
#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
#align add_opposite.unop_rat_cast AddOpposite.unop_ratCast
+-/
variable (α)
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -30,24 +30,12 @@ instance [HasRatCast α] : HasRatCast αᵐᵒᵖ :=
variable {α}
-/- warning: mul_opposite.op_rat_cast -> MulOpposite.op_ratCast is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : RatCast.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α (Rat.cast.{u1} α _inst_1 q)) (Rat.cast.{u1} (MulOpposite.{u1} α) (MulOpposite.ratCast.{u1} α _inst_1) q)
-Case conversion may be inaccurate. Consider using '#align mul_opposite.op_rat_cast MulOpposite.op_ratCastₓ'. -/
@[simp, norm_cast, to_additive]
theorem op_ratCast [HasRatCast α] (q : ℚ) : op (q : α) = q :=
rfl
#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
#align add_opposite.op_rat_cast AddOpposite.op_ratCast
-/- warning: mul_opposite.unop_rat_cast -> MulOpposite.unop_ratCast is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : RatCast.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α (Rat.cast.{u1} (MulOpposite.{u1} α) (MulOpposite.ratCast.{u1} α _inst_1) q)) (Rat.cast.{u1} α _inst_1 q)
-Case conversion may be inaccurate. Consider using '#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCastₓ'. -/
@[simp, norm_cast, to_additive]
theorem unop_ratCast [HasRatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
rfl
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce86f4e05e9a9b8da5e316b22c76ce76440c56a1
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
! This file was ported from Lean 3 source module algebra.field.opposite
-! leanprover-community/mathlib commit acebd8d49928f6ed8920e502a6c90674e75bd441
+! leanprover-community/mathlib commit 76de8ae01554c3b37d66544866659ff174e66e1f
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -82,7 +82,8 @@ instance [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
{ AddOpposite.groupWithZero α, AddOpposite.semiring α with }
instance [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
- { AddOpposite.groupWithZero α, AddOpposite.ring α with }
+ { AddOpposite.ring α, AddOpposite.groupWithZero α, AddOpposite.hasRatCast α with
+ ratCast_mk := fun a b hb h => by rw [← div_eq_mul_inv] <;> exact congr_arg op (Rat.cast_def _) }
instance [Semifield α] : Semifield αᵃᵒᵖ :=
{ AddOpposite.divisionSemiring α, AddOpposite.commSemiring α with }
mathlib commit https://github.com/leanprover-community/mathlib/commit/b19481deb571022990f1baa9cbf9172e6757a479
@@ -34,25 +34,25 @@ variable {α}
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)) (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.divisionRing.{u1} α _inst_1)) q)
+ forall {α : Type.{u1}} [_inst_1 : RatCast.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α (Rat.cast.{u1} α _inst_1 q)) (Rat.cast.{u1} (MulOpposite.{u1} α) (MulOpposite.ratCast.{u1} α _inst_1) q)
Case conversion may be inaccurate. Consider using '#align mul_opposite.op_rat_cast MulOpposite.op_ratCastₓ'. -/
@[simp, norm_cast, to_additive]
theorem op_ratCast [HasRatCast α] (q : ℚ) : op (q : α) = q :=
rfl
#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
-#align add_opposite.op_rat_cast AddOpposite.op_rat_cast
+#align add_opposite.op_rat_cast AddOpposite.op_ratCast
/- warning: mul_opposite.unop_rat_cast -> MulOpposite.unop_ratCast is a dubious translation:
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.divisionRing.{u1} α _inst_1)) q)) (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)
+ forall {α : Type.{u1}} [_inst_1 : RatCast.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α (Rat.cast.{u1} (MulOpposite.{u1} α) (MulOpposite.ratCast.{u1} α _inst_1) q)) (Rat.cast.{u1} α _inst_1 q)
Case conversion may be inaccurate. Consider using '#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCastₓ'. -/
@[simp, norm_cast, to_additive]
theorem unop_ratCast [HasRatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
rfl
#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
-#align add_opposite.unop_rat_cast AddOpposite.unop_rat_cast
+#align add_opposite.unop_rat_cast AddOpposite.unop_ratCast
variable (α)
mathlib commit https://github.com/leanprover-community/mathlib/commit/b19481deb571022990f1baa9cbf9172e6757a479
@@ -34,7 +34,7 @@ variable {α}
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)) (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.instDivisionRingMulOpposite.{u1} α _inst_1)) q)
+ forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)) (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.divisionRing.{u1} α _inst_1)) q)
Case conversion may be inaccurate. Consider using '#align mul_opposite.op_rat_cast MulOpposite.op_ratCastₓ'. -/
@[simp, norm_cast, to_additive]
theorem op_ratCast [HasRatCast α] (q : ℚ) : op (q : α) = q :=
@@ -46,7 +46,7 @@ theorem op_ratCast [HasRatCast α] (q : ℚ) : op (q : α) = q :=
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.instDivisionRingMulOpposite.{u1} α _inst_1)) q)) (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)
+ forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.divisionRing.{u1} α _inst_1)) q)) (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)
Case conversion may be inaccurate. Consider using '#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCastₓ'. -/
@[simp, norm_cast, to_additive]
theorem unop_ratCast [HasRatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/1f4705ccdfe1e557fc54a0ce081a05e33d2e6240
@@ -4,12 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
! This file was ported from Lean 3 source module algebra.field.opposite
-! leanprover-community/mathlib commit c3291da49cfa65f0d43b094750541c0731edc932
+! leanprover-community/mathlib commit acebd8d49928f6ed8920e502a6c90674e75bd441
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Algebra.Field.Defs
import Mathbin.Algebra.Ring.Opposite
+import Mathbin.Data.Int.Cast.Lemmas
/-!
# Field structure on the multiplicative/additive opposite
@@ -21,11 +22,51 @@ import Mathbin.Algebra.Ring.Opposite
variable (α : Type _)
+namespace MulOpposite
+
+@[to_additive]
+instance [HasRatCast α] : HasRatCast αᵐᵒᵖ :=
+ ⟨fun n => op n⟩
+
+variable {α}
+
+/- warning: mul_opposite.op_rat_cast -> MulOpposite.op_ratCast is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} (MulOpposite.{u1} α) (MulOpposite.op.{u1} α (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)) (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.instDivisionRingMulOpposite.{u1} α _inst_1)) q)
+Case conversion may be inaccurate. Consider using '#align mul_opposite.op_rat_cast MulOpposite.op_ratCastₓ'. -/
+@[simp, norm_cast, to_additive]
+theorem op_ratCast [HasRatCast α] (q : ℚ) : op (q : α) = q :=
+ rfl
+#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
+#align add_opposite.op_rat_cast AddOpposite.op_rat_cast
+
+/- warning: mul_opposite.unop_rat_cast -> MulOpposite.unop_ratCast is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : HasRatCast.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat (MulOpposite.{u1} α) (HasLiftT.mk.{1, succ u1} Rat (MulOpposite.{u1} α) (CoeTCₓ.coe.{1, succ u1} Rat (MulOpposite.{u1} α) (Rat.castCoe.{u1} (MulOpposite.{u1} α) (MulOpposite.hasRatCast.{u1} α _inst_1)))) q)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Rat α (HasLiftT.mk.{1, succ u1} Rat α (CoeTCₓ.coe.{1, succ u1} Rat α (Rat.castCoe.{u1} α _inst_1))) q)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : DivisionRing.{u1} α] (q : Rat), Eq.{succ u1} α (MulOpposite.unop.{u1} α (Rat.cast.{u1} (MulOpposite.{u1} α) (DivisionRing.toRatCast.{u1} (MulOpposite.{u1} α) (MulOpposite.instDivisionRingMulOpposite.{u1} α _inst_1)) q)) (Rat.cast.{u1} α (DivisionRing.toRatCast.{u1} α _inst_1) q)
+Case conversion may be inaccurate. Consider using '#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCastₓ'. -/
+@[simp, norm_cast, to_additive]
+theorem unop_ratCast [HasRatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
+ rfl
+#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
+#align add_opposite.unop_rat_cast AddOpposite.unop_rat_cast
+
+variable (α)
+
instance [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
{ MulOpposite.groupWithZero α, MulOpposite.semiring α with }
instance [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
- { MulOpposite.groupWithZero α, MulOpposite.ring α with }
+ { MulOpposite.divisionSemiring α,
+ MulOpposite.ring α with
+ ratCast := fun q => op q
+ ratCast_mk := fun a b hb h =>
+ by
+ rw [Rat.cast_def, op_div, op_nat_cast, op_int_cast]
+ exact Int.commute_cast _ _ }
instance [Semifield α] : Semifield αᵐᵒᵖ :=
{ MulOpposite.divisionSemiring α, MulOpposite.commSemiring α with }
@@ -33,6 +74,10 @@ instance [Semifield α] : Semifield αᵐᵒᵖ :=
instance [Field α] : Field αᵐᵒᵖ :=
{ MulOpposite.divisionRing α, MulOpposite.commRing α with }
+end MulOpposite
+
+namespace AddOpposite
+
instance [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
{ AddOpposite.groupWithZero α, AddOpposite.semiring α with }
@@ -45,3 +90,5 @@ instance [Semifield α] : Semifield αᵃᵒᵖ :=
instance [Field α] : Field αᵃᵒᵖ :=
{ AddOpposite.divisionRing α, AddOpposite.commRing α with }
+end AddOpposite
+
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
NNRat.cast
(#11203)
Define the canonical coercion from the nonnegative rationals to any division semiring.
From LeanAPAP
@@ -17,23 +17,31 @@ variable {α : Type*}
namespace MulOpposite
+@[to_additive] instance instNNRatCast [NNRatCast α] : NNRatCast αᵐᵒᵖ := ⟨fun q ↦ op q⟩
@[to_additive] instance instRatCast [RatCast α] : RatCast αᵐᵒᵖ := ⟨fun q ↦ op q⟩
@[to_additive (attr := simp, norm_cast)]
-theorem op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q :=
- rfl
+lemma op_nnratCast [NNRatCast α] (q : ℚ≥0) : op (q : α) = q := rfl
+
+@[to_additive (attr := simp, norm_cast)]
+lemma unop_nnratCast [NNRatCast α] (q : ℚ≥0) : unop (q : αᵐᵒᵖ) = q := rfl
+
+@[to_additive (attr := simp, norm_cast)]
+lemma op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q := rfl
#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
#align add_opposite.op_rat_cast AddOpposite.op_ratCast
@[to_additive (attr := simp, norm_cast)]
-theorem unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
- rfl
+lemma unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q := rfl
#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
#align add_opposite.unop_rat_cast AddOpposite.unop_ratCast
instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ where
__ := instSemiring
__ := instGroupWithZero
+ nnqsmul := _
+ nnratCast_def q := unop_injective $ by rw [unop_nnratCast, unop_div, unop_natCast, unop_natCast,
+ NNRat.cast_def, div_eq_mul_inv, Nat.cast_comm]
instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ where
__ := instRing
@@ -57,6 +65,9 @@ namespace AddOpposite
instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ where
__ := instSemiring
__ := instGroupWithZero
+ nnqsmul := _
+ nnratCast_def q := unop_injective $ by rw [unop_nnratCast, unop_div, unop_natCast, unop_natCast,
+ NNRat.cast_def, div_eq_mul_inv]
instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ where
__ := instRing
NNRat.cast
(#12360)
This is the parts of the diff of #11203 which don't mention NNRat.cast
.
where
notation.qsmul := _
instead of qsmul := qsmulRec _
to make the instances more robust to definition changes.qsmulRec
.qsmul
before ratCast_def
in instance declarations.rat_smul
to qsmul
.@@ -38,9 +38,9 @@ instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒ
instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ where
__ := instRing
__ := instDivisionSemiring
+ qsmul := _
ratCast_def q := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_div,
unop_natCast, unop_intCast, Int.commute_cast, div_eq_mul_inv]
- qsmul := qsmulRec _
instance instSemifield [Semifield α] : Semifield αᵐᵒᵖ where
__ := instCommSemiring
@@ -61,9 +61,9 @@ instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒ
instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ where
__ := instRing
__ := instDivisionSemiring
+ qsmul := _
ratCast_def q := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_div, unop_natCast,
unop_intCast, div_eq_mul_inv]
- qsmul := qsmulRec _
instance instSemifield [Semifield α] : Semifield αᵃᵒᵖ where
__ := instCommSemiring
Rat
internals in the definition of Field
(#11639)
Soon, there will be NNRat
analogs of the Rat
fields in the definition of Field
. NNRat
is less nicely a structure than Rat
, hence there is a need to reduce the dependency of Field
on the internals of Rat
.
This PR achieves this by restating Field.ratCast_mk'
in terms of Rat.num
, Rat.den
. This requires fixing a few downstream instances.
Reduce the diff of #11203.
Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com>
@@ -17,9 +17,7 @@ variable {α : Type*}
namespace MulOpposite
-@[to_additive]
-instance ratCast [RatCast α] : RatCast αᵐᵒᵖ :=
- ⟨fun n => op n⟩
+@[to_additive] instance instRatCast [RatCast α] : RatCast αᵐᵒᵖ := ⟨fun q ↦ op q⟩
@[to_additive (attr := simp, norm_cast)]
theorem op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q :=
@@ -40,7 +38,7 @@ instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒ
instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ where
__ := instRing
__ := instDivisionSemiring
- ratCast_mk a b hb h := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv,
+ ratCast_def q := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_div,
unop_natCast, unop_intCast, Int.commute_cast, div_eq_mul_inv]
qsmul := qsmulRec _
@@ -63,9 +61,9 @@ instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒ
instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ where
__ := instRing
__ := instDivisionSemiring
- ratCast_mk a b hb h := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv,
- unop_natCast, unop_intCast, div_eq_mul_inv]
- qsmul := _
+ ratCast_def q := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_div, unop_natCast,
+ unop_intCast, div_eq_mul_inv]
+ qsmul := qsmulRec _
instance instSemifield [Semifield α] : Semifield αᵃᵒᵖ where
__ := instCommSemiring
@@ -13,16 +13,14 @@ import Mathlib.Data.Int.Cast.Lemmas
# Field structure on the multiplicative/additive opposite
-/
-namespace MulOpposite
+variable {α : Type*}
-variable (α : Type*)
+namespace MulOpposite
@[to_additive]
instance ratCast [RatCast α] : RatCast αᵐᵒᵖ :=
⟨fun n => op n⟩
-variable {α}
-
@[to_additive (attr := simp, norm_cast)]
theorem op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q :=
rfl
@@ -35,44 +33,46 @@ theorem unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
#align add_opposite.unop_rat_cast AddOpposite.unop_ratCast
-variable (α)
+instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ where
+ __ := instSemiring
+ __ := instGroupWithZero
-instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
- { MulOpposite.instGroupWithZero α, MulOpposite.instSemiring α with }
+instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ where
+ __ := instRing
+ __ := instDivisionSemiring
+ ratCast_mk a b hb h := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv,
+ unop_natCast, unop_intCast, Int.commute_cast, div_eq_mul_inv]
+ qsmul := qsmulRec _
-instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
- { MulOpposite.instDivisionSemiring α, MulOpposite.instRing α, MulOpposite.ratCast α with
- ratCast_mk := fun a b hb h => unop_injective <| by
- rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
- Int.commute_cast, div_eq_mul_inv]
- qsmul := qsmulRec _ }
+instance instSemifield [Semifield α] : Semifield αᵐᵒᵖ where
+ __ := instCommSemiring
+ __ := instDivisionSemiring
-instance instSemifield [Semifield α] : Semifield αᵐᵒᵖ :=
- { MulOpposite.instDivisionSemiring α, MulOpposite.instCommSemiring α with }
-
-instance instField [Field α] : Field αᵐᵒᵖ :=
- { MulOpposite.instDivisionRing α, MulOpposite.instCommRing α with }
+instance instField [Field α] : Field αᵐᵒᵖ where
+ __ := instCommRing
+ __ := instDivisionRing
end MulOpposite
namespace AddOpposite
-variable {α : Type*}
-
-instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
- { AddOpposite.instGroupWithZero α, AddOpposite.instSemiring α with }
+instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ where
+ __ := instSemiring
+ __ := instGroupWithZero
-instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
- { AddOpposite.instRing α, AddOpposite.instGroupWithZero α, AddOpposite.ratCast α with
- ratCast_mk := fun a b hb h => unop_injective <| by
- rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
- div_eq_mul_inv]
- qsmul := qsmulRec _ }
+instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ where
+ __ := instRing
+ __ := instDivisionSemiring
+ ratCast_mk a b hb h := unop_injective <| by rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv,
+ unop_natCast, unop_intCast, div_eq_mul_inv]
+ qsmul := _
-instance instSemifield [Semifield α] : Semifield αᵃᵒᵖ :=
- { AddOpposite.instDivisionSemiring, AddOpposite.instCommSemiring α with }
+instance instSemifield [Semifield α] : Semifield αᵃᵒᵖ where
+ __ := instCommSemiring
+ __ := instDivisionSemiring
-instance instField [Field α] : Field αᵃᵒᵖ :=
- { AddOpposite.instDivisionRing, AddOpposite.instCommRing α with }
+instance instField [Field α] : Field αᵃᵒᵖ where
+ __ := instCommRing
+ __ := instDivisionRing
end AddOpposite
@@ -37,21 +37,21 @@ theorem unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
variable (α)
-instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
- { MulOpposite.groupWithZero α, MulOpposite.semiring α with }
+instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
+ { MulOpposite.instGroupWithZero α, MulOpposite.instSemiring α with }
-instance divisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
- { MulOpposite.divisionSemiring α, MulOpposite.ring α, MulOpposite.ratCast α with
+instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
+ { MulOpposite.instDivisionSemiring α, MulOpposite.instRing α, MulOpposite.ratCast α with
ratCast_mk := fun a b hb h => unop_injective <| by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
Int.commute_cast, div_eq_mul_inv]
qsmul := qsmulRec _ }
-instance semifield [Semifield α] : Semifield αᵐᵒᵖ :=
- { MulOpposite.divisionSemiring α, MulOpposite.commSemiring α with }
+instance instSemifield [Semifield α] : Semifield αᵐᵒᵖ :=
+ { MulOpposite.instDivisionSemiring α, MulOpposite.instCommSemiring α with }
-instance field [Field α] : Field αᵐᵒᵖ :=
- { MulOpposite.divisionRing α, MulOpposite.commRing α with }
+instance instField [Field α] : Field αᵐᵒᵖ :=
+ { MulOpposite.instDivisionRing α, MulOpposite.instCommRing α with }
end MulOpposite
@@ -59,20 +59,20 @@ namespace AddOpposite
variable {α : Type*}
-instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
- { AddOpposite.groupWithZero α, AddOpposite.semiring α with }
+instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
+ { AddOpposite.instGroupWithZero α, AddOpposite.instSemiring α with }
-instance divisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
- { AddOpposite.ring α, AddOpposite.groupWithZero α, AddOpposite.ratCast α with
+instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
+ { AddOpposite.instRing α, AddOpposite.instGroupWithZero α, AddOpposite.ratCast α with
ratCast_mk := fun a b hb h => unop_injective <| by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
div_eq_mul_inv]
qsmul := qsmulRec _ }
-instance semifield [Semifield α] : Semifield αᵃᵒᵖ :=
- { AddOpposite.divisionSemiring, AddOpposite.commSemiring α with }
+instance instSemifield [Semifield α] : Semifield αᵃᵒᵖ :=
+ { AddOpposite.instDivisionSemiring, AddOpposite.instCommSemiring α with }
-instance field [Field α] : Field αᵃᵒᵖ :=
- { AddOpposite.divisionRing, AddOpposite.commRing α with }
+instance instField [Field α] : Field αᵃᵒᵖ :=
+ { AddOpposite.instDivisionRing, AddOpposite.instCommRing α with }
end AddOpposite
... or reduce its scope (the full removal is not as obvious).
@@ -13,8 +13,6 @@ import Mathlib.Data.Int.Cast.Lemmas
# Field structure on the multiplicative/additive opposite
-/
-set_option autoImplicit true
-
namespace MulOpposite
variable (α : Type*)
@@ -59,6 +57,8 @@ end MulOpposite
namespace AddOpposite
+variable {α : Type*}
+
instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
{ AddOpposite.groupWithZero α, AddOpposite.semiring α with }
@@ -46,7 +46,8 @@ instance divisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
{ MulOpposite.divisionSemiring α, MulOpposite.ring α, MulOpposite.ratCast α with
ratCast_mk := fun a b hb h => unop_injective <| by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
- Int.commute_cast, div_eq_mul_inv] }
+ Int.commute_cast, div_eq_mul_inv]
+ qsmul := qsmulRec _ }
instance semifield [Semifield α] : Semifield αᵐᵒᵖ :=
{ MulOpposite.divisionSemiring α, MulOpposite.commSemiring α with }
@@ -65,7 +66,8 @@ instance divisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
{ AddOpposite.ring α, AddOpposite.groupWithZero α, AddOpposite.ratCast α with
ratCast_mk := fun a b hb h => unop_injective <| by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
- div_eq_mul_inv] }
+ div_eq_mul_inv]
+ qsmul := qsmulRec _ }
instance semifield [Semifield α] : Semifield αᵃᵒᵖ :=
{ AddOpposite.divisionSemiring, AddOpposite.commSemiring α with }
$
with <|
(#9319)
See Zulip thread for the discussion.
@@ -44,7 +44,7 @@ instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :
instance divisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
{ MulOpposite.divisionSemiring α, MulOpposite.ring α, MulOpposite.ratCast α with
- ratCast_mk := fun a b hb h => unop_injective $ by
+ ratCast_mk := fun a b hb h => unop_injective <| by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
Int.commute_cast, div_eq_mul_inv] }
@@ -63,7 +63,7 @@ instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :
instance divisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
{ AddOpposite.ring α, AddOpposite.groupWithZero α, AddOpposite.ratCast α with
- ratCast_mk := fun a b hb h => unop_injective $ by
+ ratCast_mk := fun a b hb h => unop_injective <| by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
div_eq_mul_inv] }
Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.
The intent of this PR is to make autoImplicit
opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true
in the few files that rely on it.
That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.
I claim that many of the uses of autoImplicit
in these files are accidental; situations such as:
variables
are in scope, but pasting the lemma in the wrong sectionHaving set_option autoImplicit false
as the default prevents these types of mistake being made in the 90% of files where autoImplicit
s are not used at all, and causes them to be caught by CI during review.
I think there were various points during the port where we encouraged porters to delete the universes u v
lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.
A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18
as the no:dontcare:yes
vote ratio.
While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true
has been placed locally within a section, rather than at the top of the file.
@@ -13,6 +13,8 @@ import Mathlib.Data.Int.Cast.Lemmas
# Field structure on the multiplicative/additive opposite
-/
+set_option autoImplicit true
+
namespace MulOpposite
variable (α : Type*)
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -15,7 +15,7 @@ import Mathlib.Data.Int.Cast.Lemmas
namespace MulOpposite
-variable (α : Type _)
+variable (α : Type*)
@[to_additive]
instance ratCast [RatCast α] : RatCast αᵐᵒᵖ :=
@@ -2,16 +2,13 @@
Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
-
-! This file was ported from Lean 3 source module algebra.field.opposite
-! leanprover-community/mathlib commit 76de8ae01554c3b37d66544866659ff174e66e1f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.Field.Defs
import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Int.Cast.Lemmas
+#align_import algebra.field.opposite from "leanprover-community/mathlib"@"76de8ae01554c3b37d66544866659ff174e66e1f"
+
/-!
# Field structure on the multiplicative/additive opposite
-/
cast
mistakes (#3141)
Match https://github.com/leanprover-community/mathlib/pull/18654
algebra.group.opposite
@acebd8d49928f6ed8920e502a6c90674e75bd441
..76de8ae01554c3b37d66544866659ff174e66e1f
algebra.ring.defs
@314d3a578607dbd2eb2481ab15fceeb62b36cbdb
..76de8ae01554c3b37d66544866659ff174e66e1f
algebra.ring.opposite
@acebd8d49928f6ed8920e502a6c90674e75bd441
..76de8ae01554c3b37d66544866659ff174e66e1f
algebra.field.opposite
@acebd8d49928f6ed8920e502a6c90674e75bd441
..76de8ae01554c3b37d66544866659ff174e66e1f
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
! This file was ported from Lean 3 source module algebra.field.opposite
-! leanprover-community/mathlib commit acebd8d49928f6ed8920e502a6c90674e75bd441
+! leanprover-community/mathlib commit 76de8ae01554c3b37d66544866659ff174e66e1f
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -63,8 +63,7 @@ instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :
{ AddOpposite.groupWithZero α, AddOpposite.semiring α with }
instance divisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
- { -- porting note: added `ratCast` override
- AddOpposite.groupWithZero α, AddOpposite.ring α, AddOpposite.ratCast α with
+ { AddOpposite.ring α, AddOpposite.groupWithZero α, AddOpposite.ratCast α with
ratCast_mk := fun a b hb h => unop_injective $ by
rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
div_eq_mul_inv] }
Match https://github.com/leanprover-community/mathlib/pull/18602
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -4,12 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
! This file was ported from Lean 3 source module algebra.field.opposite
-! leanprover-community/mathlib commit aba57d4d3dae35460225919dcd82fe91355162f9
+! leanprover-community/mathlib commit acebd8d49928f6ed8920e502a6c90674e75bd441
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Algebra.Field.Defs
import Mathlib.Algebra.Ring.Opposite
+import Mathlib.Data.Int.Cast.Lemmas
/-!
# Field structure on the multiplicative/additive opposite
@@ -19,11 +20,34 @@ namespace MulOpposite
variable (α : Type _)
+@[to_additive]
+instance ratCast [RatCast α] : RatCast αᵐᵒᵖ :=
+ ⟨fun n => op n⟩
+
+variable {α}
+
+@[to_additive (attr := simp, norm_cast)]
+theorem op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q :=
+ rfl
+#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
+#align add_opposite.op_rat_cast AddOpposite.op_ratCast
+
+@[to_additive (attr := simp, norm_cast)]
+theorem unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
+ rfl
+#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
+#align add_opposite.unop_rat_cast AddOpposite.unop_ratCast
+
+variable (α)
+
instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
{ MulOpposite.groupWithZero α, MulOpposite.semiring α with }
instance divisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
- { MulOpposite.groupWithZero α, MulOpposite.ring α with }
+ { MulOpposite.divisionSemiring α, MulOpposite.ring α, MulOpposite.ratCast α with
+ ratCast_mk := fun a b hb h => unop_injective $ by
+ rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
+ Int.commute_cast, div_eq_mul_inv] }
instance semifield [Semifield α] : Semifield αᵐᵒᵖ :=
{ MulOpposite.divisionSemiring α, MulOpposite.commSemiring α with }
@@ -39,7 +63,11 @@ instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :
{ AddOpposite.groupWithZero α, AddOpposite.semiring α with }
instance divisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
- { AddOpposite.groupWithZero α, AddOpposite.ring α with }
+ { -- porting note: added `ratCast` override
+ AddOpposite.groupWithZero α, AddOpposite.ring α, AddOpposite.ratCast α with
+ ratCast_mk := fun a b hb h => unop_injective $ by
+ rw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast,
+ div_eq_mul_inv] }
instance semifield [Semifield α] : Semifield αᵃᵒᵖ :=
{ AddOpposite.divisionSemiring, AddOpposite.commSemiring α with }
@@ -19,32 +19,32 @@ namespace MulOpposite
variable (α : Type _)
-instance [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
- { instGroupWithZeroMulOpposite α, instSemiringMulOpposite α with }
+instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ :=
+ { MulOpposite.groupWithZero α, MulOpposite.semiring α with }
-instance [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
- { instGroupWithZeroMulOpposite α, instRingMulOpposite α with }
+instance divisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ :=
+ { MulOpposite.groupWithZero α, MulOpposite.ring α with }
-instance [Semifield α] : Semifield αᵐᵒᵖ :=
- { instDivisionSemiringMulOpposite α, MulOpposite.instCommSemiringMulOpposite α with }
+instance semifield [Semifield α] : Semifield αᵐᵒᵖ :=
+ { MulOpposite.divisionSemiring α, MulOpposite.commSemiring α with }
-instance [Field α] : Field αᵐᵒᵖ :=
- { instDivisionRingMulOpposite α, instCommRingMulOpposite α with }
+instance field [Field α] : Field αᵐᵒᵖ :=
+ { MulOpposite.divisionRing α, MulOpposite.commRing α with }
end MulOpposite
namespace AddOpposite
-instance [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
- { instGroupWithZeroAddOpposite α, instSemiringAddOpposite α with }
+instance divisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ :=
+ { AddOpposite.groupWithZero α, AddOpposite.semiring α with }
-instance [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
- { instGroupWithZeroAddOpposite α, instRingAddOpposite α with }
+instance divisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ :=
+ { AddOpposite.groupWithZero α, AddOpposite.ring α with }
-instance [Semifield α] : Semifield αᵃᵒᵖ :=
- { instDivisionSemiringAddOpposite, instCommSemiringAddOpposite α with }
+instance semifield [Semifield α] : Semifield αᵃᵒᵖ :=
+ { AddOpposite.divisionSemiring, AddOpposite.commSemiring α with }
-instance [Field α] : Field αᵃᵒᵖ :=
- { instDivisionRingAddOpposite, instCommRingAddOpposite α with }
+instance field [Field α] : Field αᵃᵒᵖ :=
+ { AddOpposite.divisionRing, AddOpposite.commRing α with }
end AddOpposite
The unported dependencies are