data.sign
⟷
Mathlib.Data.Sign
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)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(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)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -3,7 +3,7 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-/
-import Algebra.BigOperators.Order
+import Algebra.Order.BigOperators.Group.Finset
import Data.Fintype.BigOperators
import Data.Int.Lemmas
import Tactic.DeriveFintype
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -557,7 +557,7 @@ theorem sign_eq_sign (n : ℤ) : n.sign = SignType.sign n :=
by
obtain (_ | _) | _ := n
· exact congr_arg coe sign_zero.symm
- · exact congr_arg coe (sign_pos <| Int.succ_coe_nat_pos _).symm
+ · exact congr_arg coe (sign_pos <| Int.succ_natCast_pos _).symm
· exact congr_arg coe (_root_.sign_neg <| neg_succ_lt_zero _).symm
#align int.sign_eq_sign Int.sign_eq_sign
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -375,8 +375,8 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
by
refine' ⟨fun h => _, fun h => sign_pos h⟩
by_contra hn
- rw [sign_apply, if_neg hn] at h
- split_ifs at h <;> simpa using h
+ rw [sign_apply, if_neg hn] at h
+ split_ifs at h <;> simpa using h
#align sign_eq_one_iff sign_eq_one_iff
-/
@@ -384,8 +384,8 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
by
refine' ⟨fun h => _, fun h => sign_neg h⟩
- rw [sign_apply] at h
- split_ifs at h
+ rw [sign_apply] at h
+ split_ifs at h
· simpa using h
· exact h_2
· simpa using h
@@ -403,8 +403,8 @@ variable [Zero α] [LinearOrder α] {a : α}
theorem sign_eq_zero_iff : SignType.sign a = 0 ↔ a = 0 :=
by
refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
- rw [sign_apply] at h
- split_ifs at h <;> cases h
+ rw [sign_apply] at h
+ split_ifs at h <;> cases h
exact (le_of_not_lt h_1).eq_of_not_lt h_2
#align sign_eq_zero_iff sign_eq_zero_iff
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -316,7 +316,9 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
-/
#print SignType.range_eq /-
-theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by classical
+theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
+ classical simpa only [← Finset.coe_singleton, ← Finset.image_singleton, ← Fintype.coe_image_univ,
+ Finset.coe_image, ← Set.image_insert_eq]
#align sign_type.range_eq SignType.range_eq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -316,9 +316,7 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
-/
#print SignType.range_eq /-
-theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
- classical simpa only [← Finset.coe_singleton, ← Finset.image_singleton, ← Fintype.coe_image_univ,
- Finset.coe_image, ← Set.image_insert_eq]
+theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by classical
#align sign_type.range_eq SignType.range_eq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-/
-import Mathbin.Algebra.BigOperators.Order
-import Mathbin.Data.Fintype.BigOperators
-import Mathbin.Data.Int.Lemmas
-import Mathbin.Tactic.DeriveFintype
+import Algebra.BigOperators.Order
+import Data.Fintype.BigOperators
+import Data.Int.Lemmas
+import Tactic.DeriveFintype
#align_import data.sign from "leanprover-community/mathlib"@"e46da4e335b8671848ac711ccb34b42538c0d800"
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -126,8 +126,8 @@ instance : BoundedOrder SignType where
instance : HasDistribNeg SignType :=
{ SignType.hasNeg with
neg_neg := fun x => by cases x <;> rfl
- neg_mul := fun x y => by casesm*_ <;> rfl
- mul_neg := fun x y => by casesm*_ <;> rfl }
+ neg_hMul := fun x y => by casesm*_ <;> rfl
+ hMul_neg := fun x y => by casesm*_ <;> rfl }
#print SignType.fin3Equiv /-
/-- `sign_type` is equivalent to `fin 3`. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/63721b2c3eba6c325ecf8ae8cca27155a4f6306f
@@ -74,19 +74,19 @@ instance : Mul SignType :=
| zero => zero
| Pos => y⟩
-#print SignType.Le /-
+#print SignType.LE /-
/-- The less-than relation on signs. -/
-inductive Le : SignType → SignType → Prop
+inductive LE : SignType → SignType → Prop
| of_neg (a) : le neg a
| zero : le zero zero
| of_pos (a) : le a pos
-#align sign_type.le SignType.Le
+#align sign_type.le SignType.LE
-/
instance : LE SignType :=
- ⟨Le⟩
+ ⟨LE⟩
-instance : DecidableRel Le := fun a b => by
+instance : DecidableRel LE := fun a b => by
cases a <;> cases b <;>
first
| exact is_false (by rintro ⟨⟩)
@@ -115,13 +115,13 @@ instance : LinearOrder SignType where
le_total a b := by casesm*_ <;> decide
le_antisymm a b ha hb := by casesm*_ <;> rfl
le_trans a b c hab hbc := by casesm*_ <;> constructor
- decidableLe := Le.decidableRel
+ decidableLe := LE.decidableRel
instance : BoundedOrder SignType where
top := 1
- le_top := Le.of_pos
+ le_top := LE.of_pos
bot := -1
- bot_le := Le.of_neg
+ bot_le := LE.of_neg
instance : HasDistribNeg SignType :=
{ SignType.hasNeg with
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module data.sign
-! leanprover-community/mathlib commit e46da4e335b8671848ac711ccb34b42538c0d800
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.BigOperators.Order
import Mathbin.Data.Fintype.BigOperators
import Mathbin.Data.Int.Lemmas
import Mathbin.Tactic.DeriveFintype
+#align_import data.sign from "leanprover-community/mathlib"@"e46da4e335b8671848ac711ccb34b42538c0d800"
+
/-!
# Sign function
mathlib commit https://github.com/leanprover-community/mathlib/commit/9240e8be927a0955b9a82c6c85ef499ee3a626b8
@@ -582,7 +582,7 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
SignType.sign (f a.1), fun a => a.1, fun a => a.1.Prop, _, _⟩
· simp [@sum_attach _ _ _ _ fun a => (f a).natAbs]
· intro x hx
- simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm (|f _|),
+ simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm |f _|,
@sum_attach _ _ _ _ fun a => ∑ j in range (f a).natAbs, if a = x then (f a).sign else 0]
#print exists_signed_sum /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -166,8 +166,10 @@ theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by decide
#align sign_type.nonneg_iff_ne_neg_one SignType.nonneg_iff_ne_neg_one
-/
+#print SignType.neg_one_lt_iff /-
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by decide!
#align sign_type.neg_one_lt_iff SignType.neg_one_lt_iff
+-/
#print SignType.nonpos_iff /-
theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0 := by decide!
@@ -179,12 +181,16 @@ theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by decide!
#align sign_type.nonpos_iff_ne_one SignType.nonpos_iff_ne_one
-/
+#print SignType.lt_one_iff /-
theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by decide!
#align sign_type.lt_one_iff SignType.lt_one_iff
+-/
+#print SignType.neg_iff /-
@[simp]
theorem neg_iff {a : SignType} : a < 0 ↔ a = -1 := by decide!
#align sign_type.neg_iff SignType.neg_iff
+-/
#print SignType.le_neg_one_iff /-
@[simp]
@@ -193,9 +199,11 @@ theorem le_neg_one_iff {a : SignType} : a ≤ -1 ↔ a = -1 :=
#align sign_type.le_neg_one_iff SignType.le_neg_one_iff
-/
+#print SignType.pos_iff /-
@[simp]
theorem pos_iff {a : SignType} : 0 < a ↔ a = 1 := by decide!
#align sign_type.pos_iff SignType.pos_iff
+-/
#print SignType.one_le_iff /-
@[simp]
@@ -218,15 +226,19 @@ theorem le_one (a : SignType) : a ≤ 1 :=
#align sign_type.le_one SignType.le_one
-/
+#print SignType.not_lt_neg_one /-
@[simp]
theorem not_lt_neg_one (a : SignType) : ¬a < -1 :=
not_lt_bot
#align sign_type.not_lt_neg_one SignType.not_lt_neg_one
+-/
+#print SignType.not_one_lt /-
@[simp]
theorem not_one_lt (a : SignType) : ¬1 < a :=
not_top_lt
#align sign_type.not_one_lt SignType.not_one_lt
+-/
#print SignType.self_eq_neg_iff /-
@[simp]
@@ -240,10 +252,12 @@ theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by decide!
#align sign_type.neg_eq_self_iff SignType.neg_eq_self_iff
-/
+#print SignType.neg_one_lt_one /-
@[simp]
theorem neg_one_lt_one : (-1 : SignType) < 1 :=
bot_lt_top
#align sign_type.neg_one_lt_one SignType.neg_one_lt_one
+-/
end CaseBashing
@@ -292,6 +306,7 @@ theorem coe_neg_one : ↑(-1 : SignType) = (-1 : α) :=
end cast
+#print SignType.castHom /-
/-- `sign_type.cast` as a `mul_with_zero_hom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
@@ -301,6 +316,7 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
map_one' := rfl
map_mul' x y := by cases x <;> cases y <;> simp
#align sign_type.cast_hom SignType.castHom
+-/
#print SignType.range_eq /-
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
@@ -319,6 +335,7 @@ section Preorder
variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)] {a : α}
+#print SignType.sign /-
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h =>
@@ -329,6 +346,7 @@ def SignType.sign : α →o SignType :=
· cases h₂ (h₁.trans_le h)
· cases h₄ (h.trans_lt h₃)⟩
#align sign SignType.sign
+-/
#print sign_apply /-
theorem sign_apply : SignType.sign a = ite (0 < a) 1 (ite (a < 0) (-1) 0) :=
@@ -428,10 +446,12 @@ section OrderedSemiring
variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [Nontrivial α]
+#print sign_one /-
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
sign_pos zero_lt_one
#align sign_one sign_one
+-/
end OrderedSemiring
@@ -443,13 +463,16 @@ variable [LinearOrderedRing α] {a b : α}
113488-general/topic/type.20class.20inference.20issues/near/276937942 -/
attribute [local instance] LinearOrderedRing.decidableLt
+#print sign_mul /-
theorem sign_mul (x y : α) : SignType.sign (x * y) = SignType.sign x * SignType.sign y := by
rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
simp only [sign_zero, MulZeroClass.mul_zero, MulZeroClass.zero_mul, sign_pos, sign_neg, hx, hy,
mul_one, neg_one_mul, neg_neg, one_mul, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos,
neg_zero, mul_neg_of_pos_of_neg, mul_pos]
#align sign_mul sign_mul
+-/
+#print signHom /-
/-- `sign` as a `monoid_with_zero_hom` for a nontrivial ordered semiring. Note that linearity
is required; consider ℂ with the order `z ≤ w` iff they have the same imaginary part and
`z - w ≤ 0` in the reals; then `1 + i` and `1 - i` are incomparable to zero, and thus we have:
@@ -460,12 +483,15 @@ def signHom : α →*₀ SignType where
map_one' := sign_one
map_mul' := sign_mul
#align sign_hom signHom
+-/
+#print sign_pow /-
theorem sign_pow (x : α) (n : ℕ) : SignType.sign (x ^ n) = SignType.sign x ^ n :=
by
change signHom (x ^ n) = signHom x ^ n
exact map_pow _ _ _
#align sign_pow sign_pow
+-/
end LinearOrderedRing
@@ -473,6 +499,7 @@ section AddGroup
variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
+#print Left.sign_neg /-
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
by
@@ -483,7 +510,9 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
· simp
· simp
#align left.sign_neg Left.sign_neg
+-/
+#print Right.sign_neg /-
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
by
@@ -494,6 +523,7 @@ theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)
· simp
· simp
#align right.sign_neg Right.sign_neg
+-/
end AddGroup
@@ -507,6 +537,7 @@ variable [LinearOrderedAddCommGroup α]
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Decidable.20vs.20decidable_rel -/
attribute [local instance] LinearOrderedAddCommGroup.decidableLt
+#print sign_sum /-
theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
(h : ∀ i ∈ s, SignType.sign (f i) = t) : SignType.sign (∑ i in s, f i) = t :=
by
@@ -518,6 +549,7 @@ theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty)
· simp_rw [pos_eq_one, sign_eq_one_iff] at h ⊢
exact Finset.sum_pos h hs
#align sign_sum sign_sum
+-/
end LinearOrderedAddCommGroup
@@ -553,6 +585,7 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm (|f _|),
@sum_attach _ _ _ _ fun a => ∑ j in range (f a).natAbs, if a = x then (f a).sign else 0]
+#print exists_signed_sum /-
/-- We can decompose a sum of absolute value `n` into a sum of `n` signs. -/
theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
@@ -563,7 +596,9 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
⟨t, inferInstance, fun b => sgn b, fun b => g b, fun b => hg b, by simp [ht], fun a ha =>
(@sum_attach _ _ t _ fun b => ite (g b = a) (sgn b : ℤ) 0).trans <| hf _ ha⟩
#align exists_signed_sum exists_signed_sum
+-/
+#print exists_signed_sum' /-
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ)
(h : ∑ i in s, (f i).natAbs ≤ n) :
@@ -580,4 +615,5 @@ theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f :
· cases hb (hg _)
· rfl
#align exists_signed_sum' exists_signed_sum'
+-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -542,7 +542,7 @@ open scoped BigOperators
private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α → ℤ) :
∃ (β : Type u_1) (t : Finset β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∈ s) ∧
- (t.card = ∑ a in s, (f a).natAbs) ∧
+ t.card = ∑ a in s, (f a).natAbs ∧
∀ a ∈ s, (∑ b in t, if g b = a then (sgn b : ℤ) else 0) = f a :=
by
refine'
@@ -557,7 +557,7 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∈ s) ∧
- (Fintype.card β = ∑ a in s, (f a).natAbs) ∧
+ Fintype.card β = ∑ a in s, (f a).natAbs ∧
∀ a ∈ s, (∑ b, if g b = a then (sgn b : ℤ) else 0) = f a :=
let ⟨β, t, sgn, g, hg, ht, hf⟩ := exists_signed_sum_aux s f
⟨t, inferInstance, fun b => sgn b, fun b => g b, fun b => hg b, by simp [ht], fun a ha =>
@@ -566,7 +566,7 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ)
- (h : (∑ i in s, (f i).natAbs) ≤ n) :
+ (h : ∑ i in s, (f i).natAbs ≤ n) :
∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∉ s → sgn b = 0) ∧
Fintype.card β = n ∧ ∀ a ∈ s, (∑ i, if g i = a then (sgn i : ℤ) else 0) = f a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -305,7 +305,7 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
#print SignType.range_eq /-
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
classical simpa only [← Finset.coe_singleton, ← Finset.image_singleton, ← Fintype.coe_image_univ,
- Finset.coe_image, ← Set.image_insert_eq]
+ Finset.coe_image, ← Set.image_insert_eq]
#align sign_type.range_eq SignType.range_eq
-/
@@ -361,7 +361,7 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
refine' ⟨fun h => _, fun h => sign_pos h⟩
by_contra hn
rw [sign_apply, if_neg hn] at h
- split_ifs at h <;> simpa using h
+ split_ifs at h <;> simpa using h
#align sign_eq_one_iff sign_eq_one_iff
-/
@@ -370,7 +370,7 @@ theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
by
refine' ⟨fun h => _, fun h => sign_neg h⟩
rw [sign_apply] at h
- split_ifs at h
+ split_ifs at h
· simpa using h
· exact h_2
· simpa using h
@@ -389,7 +389,7 @@ theorem sign_eq_zero_iff : SignType.sign a = 0 ↔ a = 0 :=
by
refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
rw [sign_apply] at h
- split_ifs at h <;> cases h
+ split_ifs at h <;> cases h
exact (le_of_not_lt h_1).eq_of_not_lt h_2
#align sign_eq_zero_iff sign_eq_zero_iff
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -90,7 +90,10 @@ instance : LE SignType :=
⟨Le⟩
instance : DecidableRel Le := fun a b => by
- cases a <;> cases b <;> first |exact is_false (by rintro ⟨⟩)|exact is_true (by constructor)
+ cases a <;> cases b <;>
+ first
+ | exact is_false (by rintro ⟨⟩)
+ | exact is_true (by constructor)
/- We can define a `field` instance on `sign_type`, but it's not mathematically sensible,
so we only define the `comm_group_with_zero`. -/
@@ -357,8 +360,8 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
by
refine' ⟨fun h => _, fun h => sign_pos h⟩
by_contra hn
- rw [sign_apply, if_neg hn] at h
- split_ifs at h <;> simpa using h
+ rw [sign_apply, if_neg hn] at h
+ split_ifs at h <;> simpa using h
#align sign_eq_one_iff sign_eq_one_iff
-/
@@ -366,8 +369,8 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
by
refine' ⟨fun h => _, fun h => sign_neg h⟩
- rw [sign_apply] at h
- split_ifs at h
+ rw [sign_apply] at h
+ split_ifs at h
· simpa using h
· exact h_2
· simpa using h
@@ -385,8 +388,8 @@ variable [Zero α] [LinearOrder α] {a : α}
theorem sign_eq_zero_iff : SignType.sign a = 0 ↔ a = 0 :=
by
refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
- rw [sign_apply] at h
- split_ifs at h <;> cases h
+ rw [sign_apply] at h
+ split_ifs at h <;> cases h
exact (le_of_not_lt h_1).eq_of_not_lt h_2
#align sign_eq_zero_iff sign_eq_zero_iff
-/
@@ -508,11 +511,11 @@ theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty)
(h : ∀ i ∈ s, SignType.sign (f i) = t) : SignType.sign (∑ i in s, f i) = t :=
by
cases t
- · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h⊢
+ · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
exact Finset.sum_eq_zero h
- · simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h⊢
+ · simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h ⊢
exact Finset.sum_neg h hs
- · simp_rw [pos_eq_one, sign_eq_one_iff] at h⊢
+ · simp_rw [pos_eq_one, sign_eq_one_iff] at h ⊢
exact Finset.sum_pos h hs
#align sign_sum sign_sum
@@ -537,13 +540,13 @@ open Finset Nat
open scoped BigOperators
private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α → ℤ) :
- ∃ (β : Type u_1)(t : Finset β)(sgn : β → SignType)(g : β → α),
+ ∃ (β : Type u_1) (t : Finset β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∈ s) ∧
(t.card = ∑ a in s, (f a).natAbs) ∧
∀ a ∈ s, (∑ b in t, if g b = a then (sgn b : ℤ) else 0) = f a :=
by
refine'
- ⟨Σa : { x // x ∈ s }, ℕ, finset.univ.sigma fun a => range (f a).natAbs, fun a =>
+ ⟨Σ a : { x // x ∈ s }, ℕ, finset.univ.sigma fun a => range (f a).natAbs, fun a =>
SignType.sign (f a.1), fun a => a.1, fun a => a.1.Prop, _, _⟩
· simp [@sum_attach _ _ _ _ fun a => (f a).natAbs]
· intro x hx
@@ -552,7 +555,7 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
/-- We can decompose a sum of absolute value `n` into a sum of `n` signs. -/
theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
- ∃ (β : Type u_1)(_ : Fintype β)(sgn : β → SignType)(g : β → α),
+ ∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∈ s) ∧
(Fintype.card β = ∑ a in s, (f a).natAbs) ∧
∀ a ∈ s, (∑ b, if g b = a then (sgn b : ℤ) else 0) = f a :=
@@ -564,7 +567,7 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ)
(h : (∑ i in s, (f i).natAbs) ≤ n) :
- ∃ (β : Type u_1)(_ : Fintype β)(sgn : β → SignType)(g : β → α),
+ ∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∉ s → sgn b = 0) ∧
Fintype.card β = n ∧ ∀ a ∈ s, (∑ i, if g i = a then (sgn i : ℤ) else 0) = f a :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -327,23 +327,32 @@ def SignType.sign : α →o SignType :=
· cases h₄ (h.trans_lt h₃)⟩
#align sign SignType.sign
+#print sign_apply /-
theorem sign_apply : SignType.sign a = ite (0 < a) 1 (ite (a < 0) (-1) 0) :=
rfl
#align sign_apply sign_apply
+-/
+#print sign_zero /-
@[simp]
theorem sign_zero : SignType.sign (0 : α) = 0 := by simp [sign_apply]
#align sign_zero sign_zero
+-/
+#print sign_pos /-
@[simp]
theorem sign_pos (ha : 0 < a) : SignType.sign a = 1 := by rwa [sign_apply, if_pos]
#align sign_pos sign_pos
+-/
+#print sign_neg /-
@[simp]
theorem sign_neg (ha : a < 0) : SignType.sign a = -1 := by
rwa [sign_apply, if_neg <| asymm ha, if_pos]
#align sign_neg sign_neg
+-/
+#print sign_eq_one_iff /-
theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
by
refine' ⟨fun h => _, fun h => sign_pos h⟩
@@ -351,7 +360,9 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
rw [sign_apply, if_neg hn] at h
split_ifs at h <;> simpa using h
#align sign_eq_one_iff sign_eq_one_iff
+-/
+#print sign_eq_neg_one_iff /-
theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
by
refine' ⟨fun h => _, fun h => sign_neg h⟩
@@ -361,6 +372,7 @@ theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
· exact h_2
· simpa using h
#align sign_eq_neg_one_iff sign_eq_neg_one_iff
+-/
end Preorder
@@ -484,7 +496,7 @@ end AddGroup
section LinearOrderedAddCommGroup
-open BigOperators
+open scoped BigOperators
variable [LinearOrderedAddCommGroup α]
@@ -522,7 +534,7 @@ end Int
open Finset Nat
-open BigOperators
+open scoped BigOperators
private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α → ℤ) :
∃ (β : Type u_1)(t : Finset β)(sgn : β → SignType)(g : β → α),
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -163,12 +163,6 @@ theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by decide
#align sign_type.nonneg_iff_ne_neg_one SignType.nonneg_iff_ne_neg_one
-/
-/- warning: sign_type.neg_one_lt_iff -> SignType.neg_one_lt_iff is a dubious translation:
-lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) a) (LE.le.{0} SignType SignType.hasLe (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))) a)
-but is expected to have type
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) a) (LE.le.{0} SignType SignType.instLESignType (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)) a)
-Case conversion may be inaccurate. Consider using '#align sign_type.neg_one_lt_iff SignType.neg_one_lt_iffₓ'. -/
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by decide!
#align sign_type.neg_one_lt_iff SignType.neg_one_lt_iff
@@ -182,21 +176,9 @@ theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by decide!
#align sign_type.nonpos_iff_ne_one SignType.nonpos_iff_ne_one
-/
-/- warning: sign_type.lt_one_iff -> SignType.lt_one_iff is a dubious translation:
-lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (LE.le.{0} SignType SignType.hasLe a (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))))
-but is expected to have type
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) a (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (LE.le.{0} SignType SignType.instLESignType a (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)))
-Case conversion may be inaccurate. Consider using '#align sign_type.lt_one_iff SignType.lt_one_iffₓ'. -/
theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by decide!
#align sign_type.lt_one_iff SignType.lt_one_iff
-/- warning: sign_type.neg_iff -> SignType.neg_iff is a dubious translation:
-lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))) (Eq.{1} SignType a (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
-but is expected to have type
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) a (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType))) (Eq.{1} SignType a (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))))
-Case conversion may be inaccurate. Consider using '#align sign_type.neg_iff SignType.neg_iffₓ'. -/
@[simp]
theorem neg_iff {a : SignType} : a < 0 ↔ a = -1 := by decide!
#align sign_type.neg_iff SignType.neg_iff
@@ -208,12 +190,6 @@ theorem le_neg_one_iff {a : SignType} : a ≤ -1 ↔ a = -1 :=
#align sign_type.le_neg_one_iff SignType.le_neg_one_iff
-/
-/- warning: sign_type.pos_iff -> SignType.pos_iff is a dubious translation:
-lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))) a) (Eq.{1} SignType a (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))
-but is expected to have type
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)) a) (Eq.{1} SignType a (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)))
-Case conversion may be inaccurate. Consider using '#align sign_type.pos_iff SignType.pos_iffₓ'. -/
@[simp]
theorem pos_iff {a : SignType} : 0 < a ↔ a = 1 := by decide!
#align sign_type.pos_iff SignType.pos_iff
@@ -239,23 +215,11 @@ theorem le_one (a : SignType) : a ≤ 1 :=
#align sign_type.le_one SignType.le_one
-/
-/- warning: sign_type.not_lt_neg_one -> SignType.not_lt_neg_one is a dubious translation:
-lean 3 declaration is
- forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
-but is expected to have type
- forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) a (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))))
-Case conversion may be inaccurate. Consider using '#align sign_type.not_lt_neg_one SignType.not_lt_neg_oneₓ'. -/
@[simp]
theorem not_lt_neg_one (a : SignType) : ¬a < -1 :=
not_lt_bot
#align sign_type.not_lt_neg_one SignType.not_lt_neg_one
-/- warning: sign_type.not_one_lt -> SignType.not_one_lt is a dubious translation:
-lean 3 declaration is
- forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))) a)
-but is expected to have type
- forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)) a)
-Case conversion may be inaccurate. Consider using '#align sign_type.not_one_lt SignType.not_one_ltₓ'. -/
@[simp]
theorem not_one_lt (a : SignType) : ¬1 < a :=
not_top_lt
@@ -273,12 +237,6 @@ theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by decide!
#align sign_type.neg_eq_self_iff SignType.neg_eq_self_iff
-/
-/- warning: sign_type.neg_one_lt_one -> SignType.neg_one_lt_one is a dubious translation:
-lean 3 declaration is
- LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
-but is expected to have type
- LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
-Case conversion may be inaccurate. Consider using '#align sign_type.neg_one_lt_one SignType.neg_one_lt_oneₓ'. -/
@[simp]
theorem neg_one_lt_one : (-1 : SignType) < 1 :=
bot_lt_top
@@ -331,12 +289,6 @@ theorem coe_neg_one : ↑(-1 : SignType) = (-1 : α) :=
end cast
-/- warning: sign_type.cast_hom -> SignType.castHom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : MulZeroOneClass.{u1} α] [_inst_2 : HasDistribNeg.{u1} α (MulZeroClass.toHasMul.{u1} α (MulZeroOneClass.toMulZeroClass.{u1} α _inst_1))], MonoidWithZeroHom.{0, u1} SignType α (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.commGroupWithZero))) _inst_1
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : MulZeroOneClass.{u1} α] [_inst_2 : HasDistribNeg.{u1} α (MulZeroClass.toMul.{u1} α (MulZeroOneClass.toMulZeroClass.{u1} α _inst_1))], MonoidWithZeroHom.{0, u1} SignType α (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType))) _inst_1
-Case conversion may be inaccurate. Consider using '#align sign_type.cast_hom SignType.castHomₓ'. -/
/-- `sign_type.cast` as a `mul_with_zero_hom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
@@ -364,12 +316,6 @@ section Preorder
variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)] {a : α}
-/- warning: sign -> SignType.sign is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.4988 : α) (x._@.Mathlib.Data.Sign._hyg.4990 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.4988 x._@.Mathlib.Data.Sign._hyg.4990)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
-Case conversion may be inaccurate. Consider using '#align sign SignType.signₓ'. -/
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h =>
@@ -381,53 +327,23 @@ def SignType.sign : α →o SignType :=
· cases h₄ (h.trans_lt h₃)⟩
#align sign SignType.sign
-/- warning: sign_apply -> sign_apply is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a) (_inst_3 (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) (_inst_3 a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5196 : α) (x._@.Mathlib.Data.Sign._hyg.5198 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5196 x._@.Mathlib.Data.Sign._hyg.5198)] {a : α}, Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a) (_inst_3 (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) (_inst_3 a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType))))
-Case conversion may be inaccurate. Consider using '#align sign_apply sign_applyₓ'. -/
theorem sign_apply : SignType.sign a = ite (0 < a) 1 (ite (a < 0) (-1) 0) :=
rfl
#align sign_apply sign_apply
-/- warning: sign_zero -> sign_zero is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5263 : α) (x._@.Mathlib.Data.Sign._hyg.5265 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5263 x._@.Mathlib.Data.Sign._hyg.5265)], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType))
-Case conversion may be inaccurate. Consider using '#align sign_zero sign_zeroₓ'. -/
@[simp]
theorem sign_zero : SignType.sign (0 : α) = 0 := by simp [sign_apply]
#align sign_zero sign_zero
-/- warning: sign_pos -> sign_pos is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5311 : α) (x._@.Mathlib.Data.Sign._hyg.5313 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5311 x._@.Mathlib.Data.Sign._hyg.5313)] {a : α}, (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)))
-Case conversion may be inaccurate. Consider using '#align sign_pos sign_posₓ'. -/
@[simp]
theorem sign_pos (ha : 0 < a) : SignType.sign a = 1 := by rwa [sign_apply, if_pos]
#align sign_pos sign_pos
-/- warning: sign_neg -> sign_neg is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5392 : α) (x._@.Mathlib.Data.Sign._hyg.5394 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5392 x._@.Mathlib.Data.Sign._hyg.5394)] {a : α}, (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))))
-Case conversion may be inaccurate. Consider using '#align sign_neg sign_negₓ'. -/
@[simp]
theorem sign_neg (ha : a < 0) : SignType.sign a = -1 := by
rwa [sign_apply, if_neg <| asymm ha, if_pos]
#align sign_neg sign_neg
-/- warning: sign_eq_one_iff -> sign_eq_one_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, Iff (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5479 : α) (x._@.Mathlib.Data.Sign._hyg.5481 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5479 x._@.Mathlib.Data.Sign._hyg.5481)] {a : α}, Iff (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a)
-Case conversion may be inaccurate. Consider using '#align sign_eq_one_iff sign_eq_one_iffₓ'. -/
theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
by
refine' ⟨fun h => _, fun h => sign_pos h⟩
@@ -436,12 +352,6 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
split_ifs at h <;> simpa using h
#align sign_eq_one_iff sign_eq_one_iff
-/- warning: sign_eq_neg_one_iff -> sign_eq_neg_one_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, Iff (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5592 : α) (x._@.Mathlib.Data.Sign._hyg.5594 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5592 x._@.Mathlib.Data.Sign._hyg.5594)] {a : α}, Iff (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)))
-Case conversion may be inaccurate. Consider using '#align sign_eq_neg_one_iff sign_eq_neg_one_iffₓ'. -/
theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
by
refine' ⟨fun h => _, fun h => sign_neg h⟩
@@ -503,12 +413,6 @@ section OrderedSemiring
variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [Nontrivial α]
-/- warning: sign_one -> sign_one is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5947 : α) (x._@.Mathlib.Data.Sign._hyg.5949 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5947 x._@.Mathlib.Data.Sign._hyg.5949)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
-Case conversion may be inaccurate. Consider using '#align sign_one sign_oneₓ'. -/
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
sign_pos zero_lt_one
@@ -524,12 +428,6 @@ variable [LinearOrderedRing α] {a b : α}
113488-general/topic/type.20class.20inference.20issues/near/276937942 -/
attribute [local instance] LinearOrderedRing.decidableLt
-/- warning: sign_mul -> sign_mul is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (y : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (Distrib.toHasMul.{u1} α (Ring.toDistrib.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) x y)) (HMul.hMul.{0, 0, 0} SignType SignType SignType (instHMul.{0} SignType SignType.hasMul) (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) x) (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) y))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (y : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (NonUnitalNonAssocRing.toMul.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))))) x y)) (HMul.hMul.{0, 0, 0} SignType SignType SignType (instHMul.{0} SignType SignType.instMulSignType) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) x) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) y))
-Case conversion may be inaccurate. Consider using '#align sign_mul sign_mulₓ'. -/
theorem sign_mul (x y : α) : SignType.sign (x * y) = SignType.sign x * SignType.sign y := by
rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
simp only [sign_zero, MulZeroClass.mul_zero, MulZeroClass.zero_mul, sign_pos, sign_neg, hx, hy,
@@ -537,12 +435,6 @@ theorem sign_mul (x y : α) : SignType.sign (x * y) = SignType.sign x * SignType
neg_zero, mul_neg_of_pos_of_neg, mul_pos]
#align sign_mul sign_mul
-/- warning: sign_hom -> signHom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α], MonoidWithZeroHom.{u1, 0} α SignType (NonAssocSemiring.toMulZeroOneClass.{u1} α (NonAssocRing.toNonAssocSemiring.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.commGroupWithZero)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α], MonoidWithZeroHom.{u1, 0} α SignType (NonAssocSemiring.toMulZeroOneClass.{u1} α (Semiring.toNonAssocSemiring.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType)))
-Case conversion may be inaccurate. Consider using '#align sign_hom signHomₓ'. -/
/-- `sign` as a `monoid_with_zero_hom` for a nontrivial ordered semiring. Note that linearity
is required; consider ℂ with the order `z ≤ w` iff they have the same imaginary part and
`z - w ≤ 0` in the reals; then `1 + i` and `1 - i` are incomparable to zero, and thus we have:
@@ -554,12 +446,6 @@ def signHom : α →*₀ SignType where
map_mul' := sign_mul
#align sign_hom signHom
-/- warning: sign_pow -> sign_pow is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (n : Nat), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (Ring.toMonoid.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) x n)) (HPow.hPow.{0, 0, 0} SignType Nat SignType (instHPow.{0, 0} SignType Nat (Monoid.Pow.{0} SignType (MonoidWithZero.toMonoid.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.commGroupWithZero))))) (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) x) n)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (n : Nat), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))))) x n)) (HPow.hPow.{0, 0, 0} SignType Nat SignType (instHPow.{0, 0} SignType Nat (Monoid.Pow.{0} SignType (MonoidWithZero.toMonoid.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType))))) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) x) n)
-Case conversion may be inaccurate. Consider using '#align sign_pow sign_powₓ'. -/
theorem sign_pow (x : α) (n : ℕ) : SignType.sign (x ^ n) = SignType.sign x ^ n :=
by
change signHom (x ^ n) = signHom x ^ n
@@ -572,12 +458,6 @@ section AddGroup
variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
-/- warning: left.sign_neg -> Left.sign_neg is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6468 : α) (x._@.Mathlib.Data.Sign._hyg.6470 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6468 x._@.Mathlib.Data.Sign._hyg.6470)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6487 : α) (x._@.Mathlib.Data.Sign._hyg.6489 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6487 x._@.Mathlib.Data.Sign._hyg.6489) (fun (x._@.Mathlib.Data.Sign._hyg.6502 : α) (x._@.Mathlib.Data.Sign._hyg.6504 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6502 x._@.Mathlib.Data.Sign._hyg.6504)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
-Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
by
@@ -589,12 +469,6 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
· simp
#align left.sign_neg Left.sign_neg
-/- warning: right.sign_neg -> Right.sign_neg is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6586 : α) (x._@.Mathlib.Data.Sign._hyg.6588 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6586 x._@.Mathlib.Data.Sign._hyg.6588)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6608 : α) (x._@.Mathlib.Data.Sign._hyg.6610 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6608 x._@.Mathlib.Data.Sign._hyg.6610)) (fun (x._@.Mathlib.Data.Sign._hyg.6623 : α) (x._@.Mathlib.Data.Sign._hyg.6625 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6623 x._@.Mathlib.Data.Sign._hyg.6625)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
-Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
by
@@ -618,12 +492,6 @@ variable [LinearOrderedAddCommGroup α]
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Decidable.20vs.20decidable_rel -/
attribute [local instance] LinearOrderedAddCommGroup.decidableLt
-/- warning: sign_sum -> sign_sum is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedAddCommGroup.{u1} α] {ι : Type.{u2}} {s : Finset.{u2} ι} {f : ι -> α}, (Finset.Nonempty.{u2} ι s) -> (forall (t : SignType), (forall (i : ι), (Membership.Mem.{u2, u2} ι (Finset.{u2} ι) (Finset.hasMem.{u2} ι) i s) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α (AddCommGroup.toAddGroup.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLt.{u1} α _inst_1 a b)) (f i)) t)) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α (AddCommGroup.toAddGroup.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLt.{u1} α _inst_1 a b)) (Finset.sum.{u1, u2} α ι (AddCommGroup.toAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) s (fun (i : ι) => f i))) t))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedAddCommGroup.{u1} α] {ι : Type.{u2}} {s : Finset.{u2} ι} {f : ι -> α}, (Finset.Nonempty.{u2} ι s) -> (forall (t : SignType), (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (SubtractionCommMonoid.toSubtractionMonoid.{u1} α (AddCommGroup.toDivisionAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLT.{u1} α _inst_1 a b)) (f i)) t)) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (SubtractionCommMonoid.toSubtractionMonoid.{u1} α (AddCommGroup.toDivisionAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLT.{u1} α _inst_1 a b)) (Finset.sum.{u1, u2} α ι (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} α (LinearOrderedCancelAddCommMonoid.toOrderedCancelAddCommMonoid.{u1} α (LinearOrderedAddCommGroup.toLinearOrderedAddCancelCommMonoid.{u1} α _inst_1))) s (fun (i : ι) => f i))) t))
-Case conversion may be inaccurate. Consider using '#align sign_sum sign_sumₓ'. -/
theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
(h : ∀ i ∈ s, SignType.sign (f i) = t) : SignType.sign (∑ i in s, f i) = t :=
by
@@ -670,9 +538,6 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm (|f _|),
@sum_attach _ _ _ _ fun a => ∑ j in range (f a).natAbs, if a = x then (f a).sign else 0]
-/- warning: exists_signed_sum -> exists_signed_sum is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align exists_signed_sum exists_signed_sumₓ'. -/
/-- We can decompose a sum of absolute value `n` into a sum of `n` signs. -/
theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
∃ (β : Type u_1)(_ : Fintype β)(sgn : β → SignType)(g : β → α),
@@ -684,9 +549,6 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
(@sum_attach _ _ t _ fun b => ite (g b = a) (sgn b : ℤ) 0).trans <| hf _ ha⟩
#align exists_signed_sum exists_signed_sum
-/- warning: exists_signed_sum' -> exists_signed_sum' is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align exists_signed_sum' exists_signed_sum'ₓ'. -/
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ)
(h : (∑ i in s, (f i).natAbs) ≤ n) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -669,13 +669,9 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
· intro x hx
simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm (|f _|),
@sum_attach _ _ _ _ fun a => ∑ j in range (f a).natAbs, if a = x then (f a).sign else 0]
-#align exists_signed_sum_aux exists_signed_sum_aux
/- warning: exists_signed_sum -> exists_signed_sum is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int), Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) (g b) s) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (a : α) => Int.natAbs (f a)))) (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.addCommMonoid (Finset.univ.{u1} β _x) (fun (b : β) => ite.{1} Int (Eq.{succ u1} α (g b) a) (_inst_1 (g b) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) SignType Int (HasLiftT.mk.{1, 1} SignType Int (CoeTCₓ.coe.{1, 1} SignType Int (SignType.hasCoeT.{0} Int Int.hasZero Int.hasOne Int.hasNeg))) (sgn b)) (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))))) (f a))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int), Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) (g b) s) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (a : α) => Int.natAbs (f a)))) (forall (a : α), (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.instAddCommMonoidInt (Finset.univ.{u1} β _x) (fun (b : β) => ite.{1} Int (Eq.{succ u1} α (g b) a) (_inst_1 (g b) a) (SignType.cast.{0} Int (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (Semiring.toOne.{0} Int Int.instSemiringInt) Int.instNegInt (sgn b)) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))) (f a))))))))
+<too large>
Case conversion may be inaccurate. Consider using '#align exists_signed_sum exists_signed_sumₓ'. -/
/-- We can decompose a sum of absolute value `n` into a sum of `n` signs. -/
theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
@@ -689,10 +685,7 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
#align exists_signed_sum exists_signed_sum
/- warning: exists_signed_sum' -> exists_signed_sum' is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Nonempty.{succ u1} α] [_inst_2 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int) (n : Nat), (LE.le.{0} Nat Nat.hasLe (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (i : α) => Int.natAbs (f i))) n) -> (Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), (Not (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) (g b) s)) -> (Eq.{1} SignType (sgn b) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))))) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) n) (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.addCommMonoid (Finset.univ.{u1} β _x) (fun (i : β) => ite.{1} Int (Eq.{succ u1} α (g i) a) (_inst_2 (g i) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) SignType Int (HasLiftT.mk.{1, 1} SignType Int (CoeTCₓ.coe.{1, 1} SignType Int (SignType.hasCoeT.{0} Int Int.hasZero Int.hasOne Int.hasNeg))) (sgn i)) (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))))) (f a)))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Nonempty.{succ u1} α] [_inst_2 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int) (n : Nat), (LE.le.{0} Nat instLENat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (i : α) => Int.natAbs (f i))) n) -> (Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), (Not (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) (g b) s)) -> (Eq.{1} SignType (sgn b) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)))) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) n) (forall (a : α), (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.instAddCommMonoidInt (Finset.univ.{u1} β _x) (fun (i : β) => ite.{1} Int (Eq.{succ u1} α (g i) a) (_inst_2 (g i) a) (SignType.cast.{0} Int (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (Semiring.toOne.{0} Int Int.instSemiringInt) Int.instNegInt (sgn i)) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))) (f a)))))))))
+<too large>
Case conversion may be inaccurate. Consider using '#align exists_signed_sum' exists_signed_sum'ₓ'. -/
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ)
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -165,7 +165,7 @@ theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by decide
/- warning: sign_type.neg_one_lt_iff -> SignType.neg_one_lt_iff is a dubious translation:
lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) a) (LE.le.{0} SignType SignType.hasLe (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))) a)
+ forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) a) (LE.le.{0} SignType SignType.hasLe (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))) a)
but is expected to have type
forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) a) (LE.le.{0} SignType SignType.instLESignType (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)) a)
Case conversion may be inaccurate. Consider using '#align sign_type.neg_one_lt_iff SignType.neg_one_lt_iffₓ'. -/
@@ -184,7 +184,7 @@ theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by decide!
/- warning: sign_type.lt_one_iff -> SignType.lt_one_iff is a dubious translation:
lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (LE.le.{0} SignType SignType.hasLe a (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))))
+ forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (LE.le.{0} SignType SignType.hasLe a (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))))
but is expected to have type
forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) a (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (LE.le.{0} SignType SignType.instLESignType a (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)))
Case conversion may be inaccurate. Consider using '#align sign_type.lt_one_iff SignType.lt_one_iffₓ'. -/
@@ -193,7 +193,7 @@ theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by decide!
/- warning: sign_type.neg_iff -> SignType.neg_iff is a dubious translation:
lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))) (Eq.{1} SignType a (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
+ forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))) (Eq.{1} SignType a (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
but is expected to have type
forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) a (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType))) (Eq.{1} SignType a (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))))
Case conversion may be inaccurate. Consider using '#align sign_type.neg_iff SignType.neg_iffₓ'. -/
@@ -210,7 +210,7 @@ theorem le_neg_one_iff {a : SignType} : a ≤ -1 ↔ a = -1 :=
/- warning: sign_type.pos_iff -> SignType.pos_iff is a dubious translation:
lean 3 declaration is
- forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))) a) (Eq.{1} SignType a (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))
+ forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))) a) (Eq.{1} SignType a (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))
but is expected to have type
forall {a : SignType}, Iff (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)) a) (Eq.{1} SignType a (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)))
Case conversion may be inaccurate. Consider using '#align sign_type.pos_iff SignType.pos_iffₓ'. -/
@@ -241,7 +241,7 @@ theorem le_one (a : SignType) : a ≤ 1 :=
/- warning: sign_type.not_lt_neg_one -> SignType.not_lt_neg_one is a dubious translation:
lean 3 declaration is
- forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
+ forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) a (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
but is expected to have type
forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) a (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))))
Case conversion may be inaccurate. Consider using '#align sign_type.not_lt_neg_one SignType.not_lt_neg_oneₓ'. -/
@@ -252,7 +252,7 @@ theorem not_lt_neg_one (a : SignType) : ¬a < -1 :=
/- warning: sign_type.not_one_lt -> SignType.not_one_lt is a dubious translation:
lean 3 declaration is
- forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))) a)
+ forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))) a)
but is expected to have type
forall (a : SignType), Not (LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)) a)
Case conversion may be inaccurate. Consider using '#align sign_type.not_one_lt SignType.not_one_ltₓ'. -/
@@ -275,7 +275,7 @@ theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by decide!
/- warning: sign_type.neg_one_lt_one -> SignType.neg_one_lt_one is a dubious translation:
lean 3 declaration is
- LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
+ LT.lt.{0} SignType (Preorder.toHasLt.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
but is expected to have type
LT.lt.{0} SignType (Preorder.toLT.{0} SignType (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
Case conversion may be inaccurate. Consider using '#align sign_type.neg_one_lt_one SignType.neg_one_lt_oneₓ'. -/
@@ -366,9 +366,9 @@ variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
/- warning: sign -> SignType.sign is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.4987 : α) (x._@.Mathlib.Data.Sign._hyg.4989 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.4987 x._@.Mathlib.Data.Sign._hyg.4989)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.4988 : α) (x._@.Mathlib.Data.Sign._hyg.4990 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.4988 x._@.Mathlib.Data.Sign._hyg.4990)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
Case conversion may be inaccurate. Consider using '#align sign SignType.signₓ'. -/
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
@@ -381,32 +381,53 @@ def SignType.sign : α →o SignType :=
· cases h₄ (h.trans_lt h₃)⟩
#align sign SignType.sign
-#print sign_apply /-
+/- warning: sign_apply -> sign_apply is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a) (_inst_3 (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) (_inst_3 a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5196 : α) (x._@.Mathlib.Data.Sign._hyg.5198 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5196 x._@.Mathlib.Data.Sign._hyg.5198)] {a : α}, Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a) (_inst_3 (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)) (ite.{1} SignType (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) (_inst_3 a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType))))
+Case conversion may be inaccurate. Consider using '#align sign_apply sign_applyₓ'. -/
theorem sign_apply : SignType.sign a = ite (0 < a) 1 (ite (a < 0) (-1) 0) :=
rfl
#align sign_apply sign_apply
--/
-#print sign_zero /-
+/- warning: sign_zero -> sign_zero is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero)))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5263 : α) (x._@.Mathlib.Data.Sign._hyg.5265 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5263 x._@.Mathlib.Data.Sign._hyg.5265)], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType))
+Case conversion may be inaccurate. Consider using '#align sign_zero sign_zeroₓ'. -/
@[simp]
theorem sign_zero : SignType.sign (0 : α) = 0 := by simp [sign_apply]
#align sign_zero sign_zero
--/
-#print sign_pos /-
+/- warning: sign_pos -> sign_pos is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5311 : α) (x._@.Mathlib.Data.Sign._hyg.5313 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5311 x._@.Mathlib.Data.Sign._hyg.5313)] {a : α}, (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)))
+Case conversion may be inaccurate. Consider using '#align sign_pos sign_posₓ'. -/
@[simp]
theorem sign_pos (ha : 0 < a) : SignType.sign a = 1 := by rwa [sign_apply, if_pos]
#align sign_pos sign_pos
--/
-#print sign_neg /-
+/- warning: sign_neg -> sign_neg is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1)))) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5392 : α) (x._@.Mathlib.Data.Sign._hyg.5394 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5392 x._@.Mathlib.Data.Sign._hyg.5394)] {a : α}, (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1))) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))))
+Case conversion may be inaccurate. Consider using '#align sign_neg sign_negₓ'. -/
@[simp]
theorem sign_neg (ha : a < 0) : SignType.sign a = -1 := by
rwa [sign_apply, if_neg <| asymm ha, if_pos]
#align sign_neg sign_neg
--/
-#print sign_eq_one_iff /-
+/- warning: sign_eq_one_iff -> sign_eq_one_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, Iff (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) a)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5479 : α) (x._@.Mathlib.Data.Sign._hyg.5481 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5479 x._@.Mathlib.Data.Sign._hyg.5481)] {a : α}, Iff (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) a)
+Case conversion may be inaccurate. Consider using '#align sign_eq_one_iff sign_eq_one_iffₓ'. -/
theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
by
refine' ⟨fun h => _, fun h => sign_pos h⟩
@@ -414,9 +435,13 @@ theorem sign_eq_one_iff : SignType.sign a = 1 ↔ 0 < a :=
rw [sign_apply, if_neg hn] at h
split_ifs at h <;> simpa using h
#align sign_eq_one_iff sign_eq_one_iff
--/
-#print sign_eq_neg_one_iff /-
+/- warning: sign_eq_neg_one_iff -> sign_eq_neg_one_iff is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] {a : α}, Iff (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.hasNeg (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne))))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5592 : α) (x._@.Mathlib.Data.Sign._hyg.5594 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5592 x._@.Mathlib.Data.Sign._hyg.5594)] {a : α}, Iff (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α _inst_1 _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a) (Neg.neg.{0} SignType SignType.instNegSignType (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType)))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) a (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)))
+Case conversion may be inaccurate. Consider using '#align sign_eq_neg_one_iff sign_eq_neg_one_iffₓ'. -/
theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
by
refine' ⟨fun h => _, fun h => sign_neg h⟩
@@ -426,7 +451,6 @@ theorem sign_eq_neg_one_iff : SignType.sign a = -1 ↔ a < 0 :=
· exact h_2
· simpa using h
#align sign_eq_neg_one_iff sign_eq_neg_one_iff
--/
end Preorder
@@ -481,9 +505,9 @@ variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [N
/- warning: sign_one -> sign_one is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
+ forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5946 : α) (x._@.Mathlib.Data.Sign._hyg.5948 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5946 x._@.Mathlib.Data.Sign._hyg.5948)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
+ forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5947 : α) (x._@.Mathlib.Data.Sign._hyg.5949 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5947 x._@.Mathlib.Data.Sign._hyg.5949)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
Case conversion may be inaccurate. Consider using '#align sign_one sign_oneₓ'. -/
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
@@ -550,9 +574,9 @@ variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Pr
/- warning: left.sign_neg -> Left.sign_neg is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6467 : α) (x._@.Mathlib.Data.Sign._hyg.6469 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6467 x._@.Mathlib.Data.Sign._hyg.6469)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6486 : α) (x._@.Mathlib.Data.Sign._hyg.6488 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6486 x._@.Mathlib.Data.Sign._hyg.6488) (fun (x._@.Mathlib.Data.Sign._hyg.6501 : α) (x._@.Mathlib.Data.Sign._hyg.6503 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6501 x._@.Mathlib.Data.Sign._hyg.6503)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6468 : α) (x._@.Mathlib.Data.Sign._hyg.6470 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6468 x._@.Mathlib.Data.Sign._hyg.6470)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6487 : α) (x._@.Mathlib.Data.Sign._hyg.6489 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6487 x._@.Mathlib.Data.Sign._hyg.6489) (fun (x._@.Mathlib.Data.Sign._hyg.6502 : α) (x._@.Mathlib.Data.Sign._hyg.6504 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6502 x._@.Mathlib.Data.Sign._hyg.6504)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
@@ -567,9 +591,9 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
/- warning: right.sign_neg -> Right.sign_neg is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6585 : α) (x._@.Mathlib.Data.Sign._hyg.6587 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6585 x._@.Mathlib.Data.Sign._hyg.6587)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6607 : α) (x._@.Mathlib.Data.Sign._hyg.6609 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6607 x._@.Mathlib.Data.Sign._hyg.6609)) (fun (x._@.Mathlib.Data.Sign._hyg.6622 : α) (x._@.Mathlib.Data.Sign._hyg.6624 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6622 x._@.Mathlib.Data.Sign._hyg.6624)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6586 : α) (x._@.Mathlib.Data.Sign._hyg.6588 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6586 x._@.Mathlib.Data.Sign._hyg.6588)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6608 : α) (x._@.Mathlib.Data.Sign._hyg.6610 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6608 x._@.Mathlib.Data.Sign._hyg.6610)) (fun (x._@.Mathlib.Data.Sign._hyg.6623 : α) (x._@.Mathlib.Data.Sign._hyg.6625 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6623 x._@.Mathlib.Data.Sign._hyg.6625)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/7ad820c4997738e2f542f8a20f32911f52020e26
@@ -504,7 +504,7 @@ attribute [local instance] LinearOrderedRing.decidableLt
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (y : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (Distrib.toHasMul.{u1} α (Ring.toDistrib.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) x y)) (HMul.hMul.{0, 0, 0} SignType SignType SignType (instHMul.{0} SignType SignType.hasMul) (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) x) (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) y))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (y : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidable_lt.{u1} α _inst_1 a b)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (NonUnitalNonAssocRing.toMul.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))))) x y)) (HMul.hMul.{0, 0, 0} SignType SignType SignType (instHMul.{0} SignType SignType.instMulSignType) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidable_lt.{u1} α _inst_1 a b)) x) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidable_lt.{u1} α _inst_1 a b)) y))
+ forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (y : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (NonUnitalNonAssocRing.toMul.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))))) x y)) (HMul.hMul.{0, 0, 0} SignType SignType SignType (instHMul.{0} SignType SignType.instMulSignType) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) x) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) y))
Case conversion may be inaccurate. Consider using '#align sign_mul sign_mulₓ'. -/
theorem sign_mul (x y : α) : SignType.sign (x * y) = SignType.sign x * SignType.sign y := by
rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
@@ -534,7 +534,7 @@ def signHom : α →*₀ SignType where
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (n : Nat), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (Ring.toMonoid.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) x n)) (HPow.hPow.{0, 0, 0} SignType Nat SignType (instHPow.{0, 0} SignType Nat (Monoid.Pow.{0} SignType (MonoidWithZero.toMonoid.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.commGroupWithZero))))) (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring.{u1} α (NonAssocRing.toNonUnitalNonAssocRing.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (StrictOrderedRing.toOrderedAddCommGroup.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1)))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLt.{u1} α _inst_1 a b)) x) n)
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (n : Nat), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidable_lt.{u1} α _inst_1 a b)) (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))))) x n)) (HPow.hPow.{0, 0, 0} SignType Nat SignType (instHPow.{0, 0} SignType Nat (Monoid.Pow.{0} SignType (MonoidWithZero.toMonoid.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType))))) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidable_lt.{u1} α _inst_1 a b)) x) n)
+ forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α] (x : α) (n : Nat), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) (HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (MonoidWithZero.toMonoid.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))))) x n)) (HPow.hPow.{0, 0, 0} SignType Nat SignType (instHPow.{0, 0} SignType Nat (Monoid.Pow.{0} SignType (MonoidWithZero.toMonoid.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType))))) (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (StrictOrderedRing.toPartialOrder.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedRing.decidableLT.{u1} α _inst_1 a b)) x) n)
Case conversion may be inaccurate. Consider using '#align sign_pow sign_powₓ'. -/
theorem sign_pow (x : α) (n : ℕ) : SignType.sign (x ^ n) = SignType.sign x ^ n :=
by
@@ -598,7 +598,7 @@ attribute [local instance] LinearOrderedAddCommGroup.decidableLt
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : LinearOrderedAddCommGroup.{u1} α] {ι : Type.{u2}} {s : Finset.{u2} ι} {f : ι -> α}, (Finset.Nonempty.{u2} ι s) -> (forall (t : SignType), (forall (i : ι), (Membership.Mem.{u2, u2} ι (Finset.{u2} ι) (Finset.hasMem.{u2} ι) i s) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α (AddCommGroup.toAddGroup.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLt.{u1} α _inst_1 a b)) (f i)) t)) -> (Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α (AddCommGroup.toAddGroup.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLt.{u1} α _inst_1 a b)) (Finset.sum.{u1, u2} α ι (AddCommGroup.toAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) s (fun (i : ι) => f i))) t))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedAddCommGroup.{u1} α] {ι : Type.{u2}} {s : Finset.{u2} ι} {f : ι -> α}, (Finset.Nonempty.{u2} ι s) -> (forall (t : SignType), (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (SubtractionCommMonoid.toSubtractionMonoid.{u1} α (AddCommGroup.toDivisionAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidable_lt.{u1} α _inst_1 a b)) (f i)) t)) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (SubtractionCommMonoid.toSubtractionMonoid.{u1} α (AddCommGroup.toDivisionAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidable_lt.{u1} α _inst_1 a b)) (Finset.sum.{u1, u2} α ι (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} α (LinearOrderedCancelAddCommMonoid.toOrderedCancelAddCommMonoid.{u1} α (LinearOrderedAddCommGroup.toLinearOrderedAddCancelCommMonoid.{u1} α _inst_1))) s (fun (i : ι) => f i))) t))
+ forall {α : Type.{u1}} [_inst_1 : LinearOrderedAddCommGroup.{u1} α] {ι : Type.{u2}} {s : Finset.{u2} ι} {f : ι -> α}, (Finset.Nonempty.{u2} ι s) -> (forall (t : SignType), (forall (i : ι), (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (SubtractionCommMonoid.toSubtractionMonoid.{u1} α (AddCommGroup.toDivisionAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLT.{u1} α _inst_1 a b)) (f i)) t)) -> (Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (SubtractionCommMonoid.toSubtractionMonoid.{u1} α (AddCommGroup.toDivisionAddCommMonoid.{u1} α (OrderedAddCommGroup.toAddCommGroup.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommGroup.toPartialOrder.{u1} α (LinearOrderedAddCommGroup.toOrderedAddCommGroup.{u1} α _inst_1))) (fun (a : α) (b : α) => LinearOrderedAddCommGroup.decidableLT.{u1} α _inst_1 a b)) (Finset.sum.{u1, u2} α ι (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} α (LinearOrderedCancelAddCommMonoid.toOrderedCancelAddCommMonoid.{u1} α (LinearOrderedAddCommGroup.toLinearOrderedAddCancelCommMonoid.{u1} α _inst_1))) s (fun (i : ι) => f i))) t))
Case conversion may be inaccurate. Consider using '#align sign_sum sign_sumₓ'. -/
theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
(h : ∀ i ∈ s, SignType.sign (f i) = t) : SignType.sign (∑ i in s, f i) = t :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/08e1d8d4d989df3a6df86f385e9053ec8a372cc1
@@ -517,7 +517,7 @@ theorem sign_mul (x y : α) : SignType.sign (x * y) = SignType.sign x * SignType
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α], MonoidWithZeroHom.{u1, 0} α SignType (NonAssocSemiring.toMulZeroOneClass.{u1} α (NonAssocRing.toNonAssocSemiring.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.commGroupWithZero)))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α], MonoidWithZeroHom.{u1, 0} α SignType (NonAssocSemiring.toMulZeroOneClass.{u1} α (NonAssocRing.toNonAssocSemiring.{u1} α (Ring.toNonAssocRing.{u1} α (StrictOrderedRing.toRing.{u1} α (LinearOrderedRing.toStrictOrderedRing.{u1} α _inst_1))))) (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType)))
+ forall {α : Type.{u1}} [_inst_1 : LinearOrderedRing.{u1} α], MonoidWithZeroHom.{u1, 0} α SignType (NonAssocSemiring.toMulZeroOneClass.{u1} α (Semiring.toNonAssocSemiring.{u1} α (StrictOrderedSemiring.toSemiring.{u1} α (LinearOrderedSemiring.toStrictOrderedSemiring.{u1} α (LinearOrderedRing.toLinearOrderedSemiring.{u1} α _inst_1))))) (MonoidWithZero.toMulZeroOneClass.{0} SignType (GroupWithZero.toMonoidWithZero.{0} SignType (CommGroupWithZero.toGroupWithZero.{0} SignType SignType.instCommGroupWithZeroSignType)))
Case conversion may be inaccurate. Consider using '#align sign_hom signHomₓ'. -/
/-- `sign` as a `monoid_with_zero_hom` for a nontrivial ordered semiring. Note that linearity
is required; consider ℂ with the order `z ≤ w` iff they have the same imaginary part and
@@ -651,7 +651,7 @@ private theorem exists_signed_sum_aux [DecidableEq α] (s : Finset α) (f : α
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int), Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) (g b) s) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (a : α) => Int.natAbs (f a)))) (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.addCommMonoid (Finset.univ.{u1} β _x) (fun (b : β) => ite.{1} Int (Eq.{succ u1} α (g b) a) (_inst_1 (g b) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) SignType Int (HasLiftT.mk.{1, 1} SignType Int (CoeTCₓ.coe.{1, 1} SignType Int (SignType.hasCoeT.{0} Int Int.hasZero Int.hasOne Int.hasNeg))) (sgn b)) (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))))) (f a))))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int), Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) (g b) s) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (a : α) => Int.natAbs (f a)))) (forall (a : α), (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.instAddCommMonoidInt (Finset.univ.{u1} β _x) (fun (b : β) => ite.{1} Int (Eq.{succ u1} α (g b) a) (_inst_1 (g b) a) (SignType.cast.{0} Int (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (NonAssocRing.toOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.instRingInt)) Int.instNegInt (sgn b)) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))) (f a))))))))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int), Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) (g b) s) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (a : α) => Int.natAbs (f a)))) (forall (a : α), (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.instAddCommMonoidInt (Finset.univ.{u1} β _x) (fun (b : β) => ite.{1} Int (Eq.{succ u1} α (g b) a) (_inst_1 (g b) a) (SignType.cast.{0} Int (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (Semiring.toOne.{0} Int Int.instSemiringInt) Int.instNegInt (sgn b)) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))) (f a))))))))
Case conversion may be inaccurate. Consider using '#align exists_signed_sum exists_signed_sumₓ'. -/
/-- We can decompose a sum of absolute value `n` into a sum of `n` signs. -/
theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
@@ -668,7 +668,7 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Nonempty.{succ u1} α] [_inst_2 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int) (n : Nat), (LE.le.{0} Nat Nat.hasLe (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (i : α) => Int.natAbs (f i))) n) -> (Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), (Not (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) (g b) s)) -> (Eq.{1} SignType (sgn b) (OfNat.ofNat.{0} SignType 0 (OfNat.mk.{0} SignType 0 (Zero.zero.{0} SignType SignType.hasZero))))) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) n) (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.addCommMonoid (Finset.univ.{u1} β _x) (fun (i : β) => ite.{1} Int (Eq.{succ u1} α (g i) a) (_inst_2 (g i) a) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) SignType Int (HasLiftT.mk.{1, 1} SignType Int (CoeTCₓ.coe.{1, 1} SignType Int (SignType.hasCoeT.{0} Int Int.hasZero Int.hasOne Int.hasNeg))) (sgn i)) (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))))) (f a)))))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Nonempty.{succ u1} α] [_inst_2 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int) (n : Nat), (LE.le.{0} Nat instLENat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (i : α) => Int.natAbs (f i))) n) -> (Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), (Not (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) (g b) s)) -> (Eq.{1} SignType (sgn b) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)))) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) n) (forall (a : α), (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.instAddCommMonoidInt (Finset.univ.{u1} β _x) (fun (i : β) => ite.{1} Int (Eq.{succ u1} α (g i) a) (_inst_2 (g i) a) (SignType.cast.{0} Int (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (NonAssocRing.toOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.instRingInt)) Int.instNegInt (sgn i)) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))) (f a)))))))))
+ forall {α : Type.{u1}} [_inst_1 : Nonempty.{succ u1} α] [_inst_2 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (f : α -> Int) (n : Nat), (LE.le.{0} Nat instLENat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (i : α) => Int.natAbs (f i))) n) -> (Exists.{succ (succ u1)} Type.{u1} (fun (β : Type.{u1}) => Exists.{succ u1} (Fintype.{u1} β) (fun (_x : Fintype.{u1} β) => Exists.{succ u1} (β -> SignType) (fun (sgn : β -> SignType) => Exists.{succ u1} (β -> α) (fun (g : β -> α) => And (forall (b : β), (Not (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) (g b) s)) -> (Eq.{1} SignType (sgn b) (OfNat.ofNat.{0} SignType 0 (Zero.toOfNat0.{0} SignType SignType.instZeroSignType)))) (And (Eq.{1} Nat (Fintype.card.{u1} β _x) n) (forall (a : α), (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) -> (Eq.{1} Int (Finset.sum.{0, u1} Int β Int.instAddCommMonoidInt (Finset.univ.{u1} β _x) (fun (i : β) => ite.{1} Int (Eq.{succ u1} α (g i) a) (_inst_2 (g i) a) (SignType.cast.{0} Int (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (Semiring.toOne.{0} Int Int.instSemiringInt) Int.instNegInt (sgn i)) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))) (f a)))))))))
Case conversion may be inaccurate. Consider using '#align exists_signed_sum' exists_signed_sum'ₓ'. -/
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ)
mathlib commit https://github.com/leanprover-community/mathlib/commit/36b8aa61ea7c05727161f96a0532897bd72aedab
@@ -569,7 +569,7 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6587 : α) (x._@.Mathlib.Data.Sign._hyg.6589 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6587 x._@.Mathlib.Data.Sign._hyg.6589)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6609 : α) (x._@.Mathlib.Data.Sign._hyg.6611 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6609 x._@.Mathlib.Data.Sign._hyg.6611)) (fun (x._@.Mathlib.Data.Sign._hyg.6624 : α) (x._@.Mathlib.Data.Sign._hyg.6626 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6624 x._@.Mathlib.Data.Sign._hyg.6626)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6585 : α) (x._@.Mathlib.Data.Sign._hyg.6587 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6585 x._@.Mathlib.Data.Sign._hyg.6587)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6607 : α) (x._@.Mathlib.Data.Sign._hyg.6609 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6607 x._@.Mathlib.Data.Sign._hyg.6609)) (fun (x._@.Mathlib.Data.Sign._hyg.6622 : α) (x._@.Mathlib.Data.Sign._hyg.6624 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6622 x._@.Mathlib.Data.Sign._hyg.6624)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/728baa2f54e6062c5879a3e397ac6bac323e506f
@@ -368,7 +368,7 @@ variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.4949 : α) (x._@.Mathlib.Data.Sign._hyg.4951 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.4949 x._@.Mathlib.Data.Sign._hyg.4951)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.4987 : α) (x._@.Mathlib.Data.Sign._hyg.4989 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.4987 x._@.Mathlib.Data.Sign._hyg.4989)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
Case conversion may be inaccurate. Consider using '#align sign SignType.signₓ'. -/
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
@@ -483,7 +483,7 @@ variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [N
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5908 : α) (x._@.Mathlib.Data.Sign._hyg.5910 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5908 x._@.Mathlib.Data.Sign._hyg.5910)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
+ forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5946 : α) (x._@.Mathlib.Data.Sign._hyg.5948 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5946 x._@.Mathlib.Data.Sign._hyg.5948)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
Case conversion may be inaccurate. Consider using '#align sign_one sign_oneₓ'. -/
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
@@ -552,7 +552,7 @@ variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Pr
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6429 : α) (x._@.Mathlib.Data.Sign._hyg.6431 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6429 x._@.Mathlib.Data.Sign._hyg.6431)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6448 : α) (x._@.Mathlib.Data.Sign._hyg.6450 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6448 x._@.Mathlib.Data.Sign._hyg.6450) (fun (x._@.Mathlib.Data.Sign._hyg.6463 : α) (x._@.Mathlib.Data.Sign._hyg.6465 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6463 x._@.Mathlib.Data.Sign._hyg.6465)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6467 : α) (x._@.Mathlib.Data.Sign._hyg.6469 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6467 x._@.Mathlib.Data.Sign._hyg.6469)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6486 : α) (x._@.Mathlib.Data.Sign._hyg.6488 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6486 x._@.Mathlib.Data.Sign._hyg.6488) (fun (x._@.Mathlib.Data.Sign._hyg.6501 : α) (x._@.Mathlib.Data.Sign._hyg.6503 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6501 x._@.Mathlib.Data.Sign._hyg.6503)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
@@ -569,7 +569,7 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6549 : α) (x._@.Mathlib.Data.Sign._hyg.6551 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6549 x._@.Mathlib.Data.Sign._hyg.6551)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6571 : α) (x._@.Mathlib.Data.Sign._hyg.6573 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6571 x._@.Mathlib.Data.Sign._hyg.6573)) (fun (x._@.Mathlib.Data.Sign._hyg.6586 : α) (x._@.Mathlib.Data.Sign._hyg.6588 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6586 x._@.Mathlib.Data.Sign._hyg.6588)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6587 : α) (x._@.Mathlib.Data.Sign._hyg.6589 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6587 x._@.Mathlib.Data.Sign._hyg.6589)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6609 : α) (x._@.Mathlib.Data.Sign._hyg.6611 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6609 x._@.Mathlib.Data.Sign._hyg.6611)) (fun (x._@.Mathlib.Data.Sign._hyg.6624 : α) (x._@.Mathlib.Data.Sign._hyg.6626 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6624 x._@.Mathlib.Data.Sign._hyg.6626)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/57e09a1296bfb4330ddf6624f1028ba186117d82
@@ -368,7 +368,7 @@ variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5020 : α) (x._@.Mathlib.Data.Sign._hyg.5022 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5020 x._@.Mathlib.Data.Sign._hyg.5022)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.4949 : α) (x._@.Mathlib.Data.Sign._hyg.4951 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.4949 x._@.Mathlib.Data.Sign._hyg.4951)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
Case conversion may be inaccurate. Consider using '#align sign SignType.signₓ'. -/
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
@@ -483,7 +483,7 @@ variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [N
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5979 : α) (x._@.Mathlib.Data.Sign._hyg.5981 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5979 x._@.Mathlib.Data.Sign._hyg.5981)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
+ forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5908 : α) (x._@.Mathlib.Data.Sign._hyg.5910 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5908 x._@.Mathlib.Data.Sign._hyg.5910)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
Case conversion may be inaccurate. Consider using '#align sign_one sign_oneₓ'. -/
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
@@ -552,7 +552,7 @@ variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Pr
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6500 : α) (x._@.Mathlib.Data.Sign._hyg.6502 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6500 x._@.Mathlib.Data.Sign._hyg.6502)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6519 : α) (x._@.Mathlib.Data.Sign._hyg.6521 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6519 x._@.Mathlib.Data.Sign._hyg.6521) (fun (x._@.Mathlib.Data.Sign._hyg.6534 : α) (x._@.Mathlib.Data.Sign._hyg.6536 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6534 x._@.Mathlib.Data.Sign._hyg.6536)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6429 : α) (x._@.Mathlib.Data.Sign._hyg.6431 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6429 x._@.Mathlib.Data.Sign._hyg.6431)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6448 : α) (x._@.Mathlib.Data.Sign._hyg.6450 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6448 x._@.Mathlib.Data.Sign._hyg.6450) (fun (x._@.Mathlib.Data.Sign._hyg.6463 : α) (x._@.Mathlib.Data.Sign._hyg.6465 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6463 x._@.Mathlib.Data.Sign._hyg.6465)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
@@ -569,7 +569,7 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6620 : α) (x._@.Mathlib.Data.Sign._hyg.6622 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6620 x._@.Mathlib.Data.Sign._hyg.6622)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6642 : α) (x._@.Mathlib.Data.Sign._hyg.6644 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6642 x._@.Mathlib.Data.Sign._hyg.6644)) (fun (x._@.Mathlib.Data.Sign._hyg.6657 : α) (x._@.Mathlib.Data.Sign._hyg.6659 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6657 x._@.Mathlib.Data.Sign._hyg.6659)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6549 : α) (x._@.Mathlib.Data.Sign._hyg.6551 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6549 x._@.Mathlib.Data.Sign._hyg.6551)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6571 : α) (x._@.Mathlib.Data.Sign._hyg.6573 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6571 x._@.Mathlib.Data.Sign._hyg.6573)) (fun (x._@.Mathlib.Data.Sign._hyg.6586 : α) (x._@.Mathlib.Data.Sign._hyg.6588 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6586 x._@.Mathlib.Data.Sign._hyg.6588)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -368,7 +368,7 @@ variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5019 : α) (x._@.Mathlib.Data.Sign._hyg.5021 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5019 x._@.Mathlib.Data.Sign._hyg.5021)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5020 : α) (x._@.Mathlib.Data.Sign._hyg.5022 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5020 x._@.Mathlib.Data.Sign._hyg.5022)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
Case conversion may be inaccurate. Consider using '#align sign SignType.signₓ'. -/
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
@@ -483,7 +483,7 @@ variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [N
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5968 : α) (x._@.Mathlib.Data.Sign._hyg.5970 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5968 x._@.Mathlib.Data.Sign._hyg.5970)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
+ forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5979 : α) (x._@.Mathlib.Data.Sign._hyg.5981 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5979 x._@.Mathlib.Data.Sign._hyg.5981)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
Case conversion may be inaccurate. Consider using '#align sign_one sign_oneₓ'. -/
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
@@ -552,7 +552,7 @@ variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Pr
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6480 : α) (x._@.Mathlib.Data.Sign._hyg.6482 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6480 x._@.Mathlib.Data.Sign._hyg.6482)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6499 : α) (x._@.Mathlib.Data.Sign._hyg.6501 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6499 x._@.Mathlib.Data.Sign._hyg.6501) (fun (x._@.Mathlib.Data.Sign._hyg.6514 : α) (x._@.Mathlib.Data.Sign._hyg.6516 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6514 x._@.Mathlib.Data.Sign._hyg.6516)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6500 : α) (x._@.Mathlib.Data.Sign._hyg.6502 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6500 x._@.Mathlib.Data.Sign._hyg.6502)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6519 : α) (x._@.Mathlib.Data.Sign._hyg.6521 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6519 x._@.Mathlib.Data.Sign._hyg.6521) (fun (x._@.Mathlib.Data.Sign._hyg.6534 : α) (x._@.Mathlib.Data.Sign._hyg.6536 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6534 x._@.Mathlib.Data.Sign._hyg.6536)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
@@ -569,7 +569,7 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6598 : α) (x._@.Mathlib.Data.Sign._hyg.6600 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6598 x._@.Mathlib.Data.Sign._hyg.6600)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6620 : α) (x._@.Mathlib.Data.Sign._hyg.6622 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6620 x._@.Mathlib.Data.Sign._hyg.6622)) (fun (x._@.Mathlib.Data.Sign._hyg.6635 : α) (x._@.Mathlib.Data.Sign._hyg.6637 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6635 x._@.Mathlib.Data.Sign._hyg.6637)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6620 : α) (x._@.Mathlib.Data.Sign._hyg.6622 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6620 x._@.Mathlib.Data.Sign._hyg.6622)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6642 : α) (x._@.Mathlib.Data.Sign._hyg.6644 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6642 x._@.Mathlib.Data.Sign._hyg.6644)) (fun (x._@.Mathlib.Data.Sign._hyg.6657 : α) (x._@.Mathlib.Data.Sign._hyg.6659 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6657 x._@.Mathlib.Data.Sign._hyg.6659)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -508,9 +508,9 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align sign_mul sign_mulₓ'. -/
theorem sign_mul (x y : α) : SignType.sign (x * y) = SignType.sign x * SignType.sign y := by
rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
- simp only [sign_zero, mul_zero, zero_mul, sign_pos, sign_neg, hx, hy, mul_one, neg_one_mul,
- neg_neg, one_mul, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, neg_zero,
- mul_neg_of_pos_of_neg, mul_pos]
+ simp only [sign_zero, MulZeroClass.mul_zero, MulZeroClass.zero_mul, sign_pos, sign_neg, hx, hy,
+ mul_one, neg_one_mul, neg_neg, one_mul, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos,
+ neg_zero, mul_neg_of_pos_of_neg, mul_pos]
#align sign_mul sign_mul
/- warning: sign_hom -> signHom is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/3b267e70a936eebb21ab546f49a8df34dd300b25
@@ -368,7 +368,7 @@ variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5013 : α) (x._@.Mathlib.Data.Sign._hyg.5015 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5013 x._@.Mathlib.Data.Sign._hyg.5015)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5019 : α) (x._@.Mathlib.Data.Sign._hyg.5021 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.5019 x._@.Mathlib.Data.Sign._hyg.5021)], OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType)))))
Case conversion may be inaccurate. Consider using '#align sign SignType.signₓ'. -/
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
@@ -483,7 +483,7 @@ variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [N
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1)))))] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (OrderedSemiring.toOrderedAddCommMonoid.{u1} α _inst_1))) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (AddMonoidWithOne.toOne.{u1} α (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} α (NonAssocSemiring.toAddCommMonoidWithOne.{u1} α (Semiring.toNonAssocSemiring.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))))))) (OfNat.ofNat.{0} SignType 1 (OfNat.mk.{0} SignType 1 (One.one.{0} SignType SignType.hasOne)))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5962 : α) (x._@.Mathlib.Data.Sign._hyg.5964 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5962 x._@.Mathlib.Data.Sign._hyg.5964)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
+ forall {α : Type.{u1}} [_inst_1 : OrderedSemiring.{u1} α] [_inst_2 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.5968 : α) (x._@.Mathlib.Data.Sign._hyg.5970 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Data.Sign._hyg.5968 x._@.Mathlib.Data.Sign._hyg.5970)] [_inst_3 : Nontrivial.{u1} α], Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))) (PartialOrder.toPreorder.{u1} α (OrderedSemiring.toPartialOrder.{u1} α _inst_1)) (fun (a : α) (b : α) => _inst_2 a b)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α (Semiring.toOne.{u1} α (OrderedSemiring.toSemiring.{u1} α _inst_1))))) (OfNat.ofNat.{0} SignType 1 (One.toOfNat1.{0} SignType SignType.instOneSignType))
Case conversion may be inaccurate. Consider using '#align sign_one sign_oneₓ'. -/
@[simp]
theorem sign_one : SignType.sign (1 : α) = 1 :=
@@ -552,7 +552,7 @@ variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Pr
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6474 : α) (x._@.Mathlib.Data.Sign._hyg.6476 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6474 x._@.Mathlib.Data.Sign._hyg.6476)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6493 : α) (x._@.Mathlib.Data.Sign._hyg.6495 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6493 x._@.Mathlib.Data.Sign._hyg.6495) (fun (x._@.Mathlib.Data.Sign._hyg.6508 : α) (x._@.Mathlib.Data.Sign._hyg.6510 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6508 x._@.Mathlib.Data.Sign._hyg.6510)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6480 : α) (x._@.Mathlib.Data.Sign._hyg.6482 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6480 x._@.Mathlib.Data.Sign._hyg.6482)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6499 : α) (x._@.Mathlib.Data.Sign._hyg.6501 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6499 x._@.Mathlib.Data.Sign._hyg.6501) (fun (x._@.Mathlib.Data.Sign._hyg.6514 : α) (x._@.Mathlib.Data.Sign._hyg.6516 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6514 x._@.Mathlib.Data.Sign._hyg.6516)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
@@ -569,7 +569,7 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6592 : α) (x._@.Mathlib.Data.Sign._hyg.6594 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6592 x._@.Mathlib.Data.Sign._hyg.6594)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6614 : α) (x._@.Mathlib.Data.Sign._hyg.6616 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6614 x._@.Mathlib.Data.Sign._hyg.6616)) (fun (x._@.Mathlib.Data.Sign._hyg.6629 : α) (x._@.Mathlib.Data.Sign._hyg.6631 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6629 x._@.Mathlib.Data.Sign._hyg.6631)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6598 : α) (x._@.Mathlib.Data.Sign._hyg.6600 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6598 x._@.Mathlib.Data.Sign._hyg.6600)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6620 : α) (x._@.Mathlib.Data.Sign._hyg.6622 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6620 x._@.Mathlib.Data.Sign._hyg.6622)) (fun (x._@.Mathlib.Data.Sign._hyg.6635 : α) (x._@.Mathlib.Data.Sign._hyg.6637 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6635 x._@.Mathlib.Data.Sign._hyg.6637)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/9da1b3534b65d9661eb8f42443598a92bbb49211
@@ -552,7 +552,7 @@ variable [AddGroup α] [Preorder α] [DecidableRel ((· < ·) : α → α → Pr
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6253 : α) (x._@.Mathlib.Data.Sign._hyg.6255 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6253 x._@.Mathlib.Data.Sign._hyg.6255)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6272 : α) (x._@.Mathlib.Data.Sign._hyg.6274 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6272 x._@.Mathlib.Data.Sign._hyg.6274) (fun (x._@.Mathlib.Data.Sign._hyg.6287 : α) (x._@.Mathlib.Data.Sign._hyg.6289 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6287 x._@.Mathlib.Data.Sign._hyg.6289)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6474 : α) (x._@.Mathlib.Data.Sign._hyg.6476 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6474 x._@.Mathlib.Data.Sign._hyg.6476)] [_inst_4 : CovariantClass.{u1, u1} α α (fun (x._@.Mathlib.Data.Sign._hyg.6493 : α) (x._@.Mathlib.Data.Sign._hyg.6495 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6493 x._@.Mathlib.Data.Sign._hyg.6495) (fun (x._@.Mathlib.Data.Sign._hyg.6508 : α) (x._@.Mathlib.Data.Sign._hyg.6510 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6508 x._@.Mathlib.Data.Sign._hyg.6510)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align left.sign_neg Left.sign_negₓ'. -/
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
@@ -569,7 +569,7 @@ theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))))) (LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2))] (a : α), Eq.{1} SignType (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (SubNegMonoid.toHasNeg.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)) a)) (Neg.neg.{0} SignType SignType.hasNeg (coeFn.{succ u1, succ u1} (OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (fun (_x : OrderHom.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) => α -> SignType) (OrderHom.hasCoeToFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (LinearOrder.toLattice.{0} SignType SignType.linearOrder))))) (SignType.sign.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6371 : α) (x._@.Mathlib.Data.Sign._hyg.6373 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6371 x._@.Mathlib.Data.Sign._hyg.6373)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6393 : α) (x._@.Mathlib.Data.Sign._hyg.6395 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6393 x._@.Mathlib.Data.Sign._hyg.6395)) (fun (x._@.Mathlib.Data.Sign._hyg.6408 : α) (x._@.Mathlib.Data.Sign._hyg.6410 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6408 x._@.Mathlib.Data.Sign._hyg.6410)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
+ forall {α : Type.{u1}} [_inst_1 : AddGroup.{u1} α] [_inst_2 : Preorder.{u1} α] [_inst_3 : DecidableRel.{succ u1} α (fun (x._@.Mathlib.Data.Sign._hyg.6592 : α) (x._@.Mathlib.Data.Sign._hyg.6594 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6592 x._@.Mathlib.Data.Sign._hyg.6594)] [_inst_4 : CovariantClass.{u1, u1} α α (Function.swap.{succ u1, succ u1, succ u1} α α (fun (ᾰ : α) (ᾰ : α) => α) (fun (x._@.Mathlib.Data.Sign._hyg.6614 : α) (x._@.Mathlib.Data.Sign._hyg.6616 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (SubNegMonoid.toAddMonoid.{u1} α (AddGroup.toSubNegMonoid.{u1} α _inst_1))))) x._@.Mathlib.Data.Sign._hyg.6614 x._@.Mathlib.Data.Sign._hyg.6616)) (fun (x._@.Mathlib.Data.Sign._hyg.6629 : α) (x._@.Mathlib.Data.Sign._hyg.6631 : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_2) x._@.Mathlib.Data.Sign._hyg.6629 x._@.Mathlib.Data.Sign._hyg.6631)] (a : α), Eq.{1} SignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) (Neg.neg.{u1} α (NegZeroClass.toNeg.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) a)) (Neg.neg.{0} SignType SignType.instNegSignType (OrderHom.toFun.{u1, 0} α SignType _inst_2 (PartialOrder.toPreorder.{0} SignType (SemilatticeInf.toPartialOrder.{0} SignType (Lattice.toSemilatticeInf.{0} SignType (DistribLattice.toLattice.{0} SignType (instDistribLattice.{0} SignType SignType.instLinearOrderSignType))))) (SignType.sign.{u1} α (NegZeroClass.toZero.{u1} α (SubNegZeroMonoid.toNegZeroClass.{u1} α (SubtractionMonoid.toSubNegZeroMonoid.{u1} α (AddGroup.toSubtractionMonoid.{u1} α _inst_1)))) _inst_2 (fun (a : α) (b : α) => _inst_3 a b)) a))
Case conversion may be inaccurate. Consider using '#align right.sign_neg Right.sign_negₓ'. -/
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
SignType.sign (-a) = -SignType.sign a :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -361,7 +361,7 @@ theorem sign_eq_neg_one_iff : sign a = -1 ↔ a < 0 := by
refine' ⟨fun h => _, fun h => sign_neg h⟩
rw [sign_apply] at h
split_ifs at h
- · assumption
+ assumption
#align sign_eq_neg_one_iff sign_eq_neg_one_iff
end Preorder
@@ -146,14 +146,12 @@ def fin3Equiv : SignType ≃* Fin 3 where
| ⟨0, _⟩ => 0
| ⟨1, _⟩ => 1
| ⟨2, _⟩ => -1
- | ⟨n + 3, h⟩ => (h.not_le le_add_self).elim
left_inv a := by cases a <;> rfl
right_inv a :=
match a with
| ⟨0, _⟩ => by simp
| ⟨1, _⟩ => by simp
| ⟨2, _⟩ => by simp
- | ⟨n + 3, h⟩ => by simp at h
map_mul' a b := by
cases a <;> cases b <;> rfl
#align sign_type.fin3_equiv SignType.fin3Equiv
@@ -430,16 +428,18 @@ theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
#align sign_mul sign_mul
@[simp] theorem sign_mul_abs (x : α) : (sign x * |x| : α) = x := by
- rcases lt_trichotomy x 0 with (hx | rfl | hx)
- · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, neg_one_mul, neg_neg]
- · rw [abs_zero, mul_zero]
- · rw [sign_pos hx, abs_of_pos hx, coe_one, one_mul]
+ rcases lt_trichotomy x 0 with hx | rfl | hx <;> simp [*, abs_of_pos, abs_of_neg]
@[simp] theorem abs_mul_sign (x : α) : (|x| * sign x : α) = x := by
- rcases lt_trichotomy x 0 with (hx | rfl | hx)
- · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, mul_neg_one, neg_neg]
- · rw [abs_zero, zero_mul]
- · rw [sign_pos hx, abs_of_pos hx, coe_one, mul_one]
+ rcases lt_trichotomy x 0 with hx | rfl | hx <;> simp [*, abs_of_pos, abs_of_neg]
+
+@[simp]
+theorem sign_mul_self (x : α) : sign x * x = |x| := by
+ rcases lt_trichotomy x 0 with hx | rfl | hx <;> simp [*, abs_of_pos, abs_of_neg]
+
+@[simp]
+theorem self_mul_sign (x : α) : x * sign x = |x| := by
+ rcases lt_trichotomy x 0 with hx | rfl | hx <;> simp [*, abs_of_pos, abs_of_neg]
/-- `SignType.sign` as a `MonoidWithZeroHom` for a nontrivial ordered semiring. Note that linearity
is required; consider ℂ with the order `z ≤ w` iff they have the same imaginary part and
Take the content of
Algebra.BigOperators.List.Basic
Algebra.BigOperators.List.Lemmas
Algebra.BigOperators.Multiset.Basic
Algebra.BigOperators.Multiset.Lemmas
Algebra.BigOperators.Multiset.Order
Algebra.BigOperators.Order
and sort it into six files:
Algebra.Order.BigOperators.Group.List
. I credit Yakov for https://github.com/leanprover-community/mathlib/pull/8543.Algebra.Order.BigOperators.Group.Multiset
. Copyright inherited from Algebra.BigOperators.Multiset.Order
.Algebra.Order.BigOperators.Group.Finset
. Copyright inherited from Algebra.BigOperators.Order
.Algebra.Order.BigOperators.Ring.List
. I credit Stuart for https://github.com/leanprover-community/mathlib/pull/10184.Algebra.Order.BigOperators.Ring.Multiset
. I credit Ruben for https://github.com/leanprover-community/mathlib/pull/8787.Algebra.Order.BigOperators.Ring.Finset
. I credit Floris for https://github.com/leanprover-community/mathlib/pull/1294.Here are the design decisions at play:
Data.Nat.Order.Basic
in a few List
files.Algebra.Order.BigOperators
instead of Algebra.BigOperators.Order
because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.Algebra.Order.BigOperators.Group
should be additivisable (except a few Nat
- or Int
-specific lemmas). In contrast, things under Algebra.Order.BigOperators.Ring
are more prone to having heavy imports.List
vs Multiset
vs Finset
. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the AbsoluteValue
lemmas from Algebra.Order.BigOperators.Ring.Finset
to a file Algebra.Order.BigOperators.Ring.AbsoluteValue
and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset
, Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset
, etc...Finsupp
big operator and finprod
/finsum
order lemmas also belong in Algebra.Order.BigOperators
. I haven't done so in this PR because the diff is big enough like that.@@ -3,7 +3,8 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-/
-import Mathlib.Algebra.BigOperators.Order
+import Mathlib.Algebra.GroupWithZero.Units.Lemmas
+import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Fintype.BigOperators
#align_import data.sign from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c"
@@ -293,7 +293,7 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α w
map_mul' x y := by cases x <;> cases y <;> simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
#align sign_type.cast_hom SignType.castHom
--- Porting note: new theorem
+-- Porting note (#10756): new theorem
theorem univ_eq : (Finset.univ : Finset SignType) = {0, -1, 1} := by
decide
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -293,7 +293,7 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α w
map_mul' x y := by cases x <;> cases y <;> simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
#align sign_type.cast_hom SignType.castHom
---Porting note: new theorem
+-- Porting note: new theorem
theorem univ_eq : (Finset.univ : Finset SignType) = {0, -1, 1} := by
decide
@@ -14,7 +14,7 @@ This file defines the sign function for types with zero and a decidable less-tha
proves some basic theorems about it.
-/
--- Porting note: Cannot automatically derive Fintype, added manually
+-- Porting note (#11081): cannot automatically derive Fintype, added manually
/-- The type of signs. -/
inductive SignType
| zero
SignType
(#10920)
Since Real.sign
etc are being deprecated in favour of the generic SignType.sign
, this PR adds some more API for the latter: in particular, compatibility of the canonical maps in and out of SignType
with maps satisfying suitable assumptions. This is a prerequisite for #10011.
@@ -250,6 +250,18 @@ instance : CoeTC SignType α :=
-- Porting note: `cast_eq_coe` removed, syntactic equality
+/-- Casting out of `SignType` respects composition with functions preserving `0, 1, -1`. -/
+lemma map_cast' {β : Type*} [One β] [Neg β] [Zero β]
+ (f : α → β) (h₁ : f 1 = 1) (h₂ : f 0 = 0) (h₃ : f (-1) = -1) (s : SignType) :
+ f s = s := by
+ cases s <;> simp only [SignType.cast, h₁, h₂, h₃]
+
+/-- Casting out of `SignType` respects composition with suitable bundled homomorphism types. -/
+lemma map_cast {α β F : Type*} [AddGroupWithOne α] [One β] [SubtractionMonoid β]
+ [FunLike F α β] [AddMonoidHomClass F α β] [OneHomClass F α β] (f : F) (s : SignType) :
+ f s = s := by
+ apply map_cast' <;> simp
+
@[simp]
theorem coe_zero : ↑(0 : SignType) = (0 : α) :=
rfl
@@ -265,6 +277,11 @@ theorem coe_neg_one : ↑(-1 : SignType) = (-1 : α) :=
rfl
#align sign_type.coe_neg_one SignType.coe_neg_one
+@[simp, norm_cast]
+lemma coe_neg {α : Type*} [One α] [SubtractionMonoid α] (s : SignType) :
+ (↑(-s) : α) = -↑s := by
+ cases s <;> simp
+
end cast
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@@ -354,6 +371,12 @@ section LinearOrder
variable [Zero α] [LinearOrder α] {a : α}
+/-- `SignType.sign` respects strictly monotone zero-preserving maps. -/
+lemma StrictMono.sign_comp {β F : Type*} [Zero β] [Preorder β] [DecidableRel ((· < ·) : β → β → _)]
+ [FunLike F α β] [ZeroHomClass F α β] {f : F} (hf : StrictMono f) (a : α) :
+ sign (f a) = sign a := by
+ simp only [sign_apply, ← map_zero f, hf.lt_iff_lt]
+
@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0 := by
refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
@@ -389,7 +389,7 @@ section OrderedSemiring
variable [OrderedSemiring α] [DecidableRel ((· < ·) : α → α → Prop)] [Nontrivial α]
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem sign_one : sign (1 : α) = 1 :=
sign_pos zero_lt_one
#align sign_one sign_one
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -111,7 +111,7 @@ private lemma le_antisymm (a b : SignType) (_ : a ≤ b) (_: b ≤ a) : a = b :=
cases a <;> cases b <;> trivial
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
- cases a <;> cases b <;> cases c <;> first | tauto | constructor
+ cases a <;> cases b <;> cases c <;> tauto
instance : LinearOrder SignType where
le := (· ≤ ·)
@@ -5,7 +5,6 @@ Authors: Eric Rodriguez
-/
import Mathlib.Algebra.BigOperators.Order
import Mathlib.Data.Fintype.BigOperators
-import Mathlib.Data.Int.Lemmas
#align_import data.sign from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c"
/-!
Lemmas around this were a mess, throth in terms of names, statement and location. This PR standardises everything to be in Algebra.BigOperators.Basic
and changes the lemmas to take in InjOn
and SurjOn
assumptions where possible (and where impossible make sure the hypotheses are taken in the correct order) and moves the equality of functions hypothesis last.
Also add a few lemmas that help fix downstream uses by golfing.
From LeanAPAP and LeanCamCombi
@@ -518,7 +518,7 @@ theorem exists_signed_sum {α : Type u_1} [DecidableEq α] (s : Finset α) (f :
∀ a ∈ s, (∑ b, if g b = a then (sgn b : ℤ) else 0) = f a :=
let ⟨β, t, sgn, g, hg, ht, hf⟩ := exists_signed_sum_aux s f
⟨t, inferInstance, fun b => sgn b, fun b => g b, fun b => hg b, by simp [ht], fun a ha =>
- (@sum_attach _ _ t _ fun b => ite (g b = a) (sgn b : ℤ) 0).trans <| hf _ ha⟩
+ (sum_attach t fun b ↦ ite (g b = a) (sgn b : ℤ) 0).trans <| hf _ ha⟩
#align exists_signed_sum exists_signed_sum
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
This adds three simp
and norm_cast
lemmas for SignType
.
@@ -286,6 +286,18 @@ theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f po
classical simp [Finset.coe_insert]
#align sign_type.range_eq SignType.range_eq
+@[simp, norm_cast] lemma coe_mul {α} [MulZeroOneClass α] [HasDistribNeg α] (a b : SignType) :
+ ↑(a * b) = (a : α) * b :=
+ map_mul SignType.castHom _ _
+
+@[simp, norm_cast] lemma coe_pow {α} [MonoidWithZero α] [HasDistribNeg α] (a : SignType) (k : ℕ) :
+ ↑(a ^ k) = (a : α) ^ k :=
+ map_pow SignType.castHom _ _
+
+@[simp, norm_cast] lemma coe_zpow {α} [GroupWithZero α] [HasDistribNeg α] (a : SignType) (k : ℤ) :
+ ↑(a ^ k) = (a : α) ^ k :=
+ map_zpow₀ SignType.castHom _ _
+
end SignType
variable {α : Type*}
@@ -389,10 +401,6 @@ section LinearOrderedRing
variable [LinearOrderedRing α] {a b : α}
-/- I'm not sure why this is necessary, see https://leanprover.zulipchat.com/#narrow/stream/
-113488-general/topic/type.20class.20inference.20issues/near/276937942 -/
-attribute [local instance] LinearOrderedRing.decidableLT
-
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
@@ -34,7 +34,7 @@ namespace SignType
-- Porting note: Added Fintype SignType manually
instance : Fintype SignType :=
- Fintype.ofMultiset (zero :: neg :: pos :: List.nil) (fun x ↦ by cases x <;> decide)
+ Fintype.ofMultiset (zero :: neg :: pos :: List.nil) (fun x ↦ by cases x <;> simp)
instance : Zero SignType :=
⟨zero⟩
@@ -360,7 +360,7 @@ theorem sign_ne_zero : sign a ≠ 0 ↔ a ≠ 0 :=
theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a := by
rcases lt_trichotomy 0 a with (h | h | h)
· simp [h, h.le]
- · simp [←h]
+ · simp [← h]
· simp [h, h.not_le]
#align sign_nonneg_iff sign_nonneg_iff
@@ -368,7 +368,7 @@ theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a := by
theorem sign_nonpos_iff : sign a ≤ 0 ↔ a ≤ 0 := by
rcases lt_trichotomy 0 a with (h | h | h)
· simp [h, h.not_le]
- · simp [←h]
+ · simp [← h]
· simp [h, h.le]
#align sign_nonpos_iff sign_nonpos_iff
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -34,7 +34,7 @@ namespace SignType
-- Porting note: Added Fintype SignType manually
instance : Fintype SignType :=
- Fintype.ofMultiset (zero :: neg :: pos :: List.nil) (fun x ↦ by cases x <;> simp only)
+ Fintype.ofMultiset (zero :: neg :: pos :: List.nil) (fun x ↦ by cases x <;> decide)
instance : Zero SignType :=
⟨zero⟩
@@ -155,7 +155,7 @@ def fin3Equiv : SignType ≃* Fin 3 where
| ⟨2, _⟩ => by simp
| ⟨n + 3, h⟩ => by simp at h
map_mul' a b := by
- cases a <;> cases b <;> simp
+ cases a <;> cases b <;> rfl
#align sign_type.fin3_equiv SignType.fin3Equiv
section CaseBashing
@@ -515,7 +515,7 @@ theorem exists_signed_sum {α : Type u_1} [DecidableEq α] (s : Finset α) (f :
/-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/
theorem exists_signed_sum' {α : Type u_1} [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ)
- (n : ℕ) (h : (∑ i in s, (f i).natAbs) ≤ n) :
+ (n : ℕ) (h : (∑ i in s, (f i).natAbs) ≤ n) :
∃ (β : Type u_1) (_ : Fintype β) (sgn : β → SignType) (g : β → α),
(∀ b, g b ∉ s → sgn b = 0) ∧
Fintype.card β = n ∧ ∀ a ∈ s, (∑ i, if g i = a then (sgn i : ℤ) else 0) = f a := by
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -234,7 +234,7 @@ end CaseBashing
section cast
-variable {α : Type _} [Zero α] [One α] [Neg α]
+variable {α : Type*} [Zero α] [One α] [Neg α]
/-- Turn a `SignType` into zero, one, or minus one. This is a coercion instance, but note it is
only a `CoeTC` instance: see note [use has_coe_t]. -/
@@ -288,7 +288,7 @@ theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f po
end SignType
-variable {α : Type _}
+variable {α : Type*}
open SignType
@@ -462,7 +462,7 @@ https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Decidable.2
-/
attribute [local instance] LinearOrderedAddCommGroup.decidableLT
-theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
+theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
(h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
cases t
· simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
@@ -71,17 +71,17 @@ instance : Mul SignType :=
| zero => zero
| pos => y⟩
-/-- The less-than relation on signs. -/
-inductive Le : SignType → SignType → Prop
- | of_neg (a) : Le neg a
- | zero : Le zero zero
- | of_pos (a) : Le a pos
-#align sign_type.le SignType.Le
+/-- The less-than-or-equal relation on signs. -/
+protected inductive LE : SignType → SignType → Prop
+ | of_neg (a) : SignType.LE neg a
+ | zero : SignType.LE zero zero
+ | of_pos (a) : SignType.LE a pos
+#align sign_type.le SignType.LE
instance : LE SignType :=
- ⟨Le⟩
+ ⟨SignType.LE⟩
-instance Le.decidableRel : DecidableRel Le := fun a b => by
+instance LE.decidableRel : DecidableRel SignType.LE := fun a b => by
cases a <;> cases b <;> first | exact isTrue (by constructor)| exact isFalse (by rintro ⟨_⟩)
instance decidableEq : DecidableEq SignType := fun a b => by
@@ -120,14 +120,14 @@ instance : LinearOrder SignType where
le_total a b := by cases a <;> cases b <;> first | left; constructor | right; constructor
le_antisymm := le_antisymm
le_trans := le_trans
- decidableLE := Le.decidableRel
+ decidableLE := LE.decidableRel
decidableEq := SignType.decidableEq
instance : BoundedOrder SignType where
top := 1
- le_top := Le.of_pos
+ le_top := LE.of_pos
bot := -1
- bot_le := Le.of_neg
+ bot_le := LE.of_neg
instance : HasDistribNeg SignType :=
{ neg_neg := fun x => by cases x <;> rfl
@@ -135,8 +135,7 @@ instance : HasDistribNeg SignType :=
mul_neg := fun x y => by cases x <;> cases y <;> rfl }
/-- `SignType` is equivalent to `Fin 3`. -/
-def fin3Equiv : SignType ≃* Fin 3
- where
+def fin3Equiv : SignType ≃* Fin 3 where
toFun a :=
match a with
| 0 => ⟨0, by simp⟩
@@ -271,8 +270,7 @@ end cast
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
-def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
- where
+def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
toFun := cast
map_zero' := rfl
map_one' := rfl
@@ -280,8 +278,8 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
#align sign_type.cast_hom SignType.castHom
--Porting note: new theorem
-theorem univ_eq : (Finset.univ : Finset SignType) = {0, -1, 1} :=
- by decide
+theorem univ_eq : (Finset.univ : Finset SignType) = {0, -1, 1} := by
+ decide
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
classical rw [← Fintype.coe_image_univ, univ_eq]
@@ -2,15 +2,12 @@
Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module data.sign
-! leanprover-community/mathlib commit 2445c98ae4b87eabebdde552593519b9b6dc350c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.BigOperators.Order
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Int.Lemmas
+
+#align_import data.sign from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c"
/-!
# Sign function
@@ -279,7 +279,7 @@ def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α
toFun := cast
map_zero' := rfl
map_one' := rfl
- map_mul' x y := by cases x <;> cases y <;> simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
+ map_mul' x y := by cases x <;> cases y <;> simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
#align sign_type.cast_hom SignType.castHom
--Porting note: new theorem
@@ -504,7 +504,7 @@ private theorem exists_signed_sum_aux {α : Type u_1} [DecidableEq α] (s : Fins
fun a => sign (f a.1), fun a => a.1, fun a => a.1.2, _, _⟩
· simp [sum_attach (f := fun a => (f a).natAbs)]
· intro x hx
- simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm (|f _|),
+ simp [sum_sigma, hx, ← Int.sign_eq_sign, Int.sign_mul_abs, mul_comm |f _|,
sum_attach (s := s) (f := fun y => if y = x then f y else 0)]
/-- We can decompose a sum of absolute value `n` into a sum of `n` signs. -/
at
and goals (#5387)
Changes are of the form
some_tactic at h⊢
-> some_tactic at h ⊢
some_tactic at h
-> some_tactic at h
@@ -470,11 +470,11 @@ attribute [local instance] LinearOrderedAddCommGroup.decidableLT
theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
(h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
cases t
- · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h⊢
+ · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
exact Finset.sum_eq_zero h
- · simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h⊢
+ · simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h ⊢
exact Finset.sum_neg h hs
- · simp_rw [pos_eq_one, sign_eq_one_iff] at h⊢
+ · simp_rw [pos_eq_one, sign_eq_one_iff] at h ⊢
exact Finset.sum_pos h hs
#align sign_sum sign_sum
fix-comments.py
on all files.@@ -241,7 +241,7 @@ section cast
variable {α : Type _} [Zero α] [One α] [Neg α]
/-- Turn a `SignType` into zero, one, or minus one. This is a coercion instance, but note it is
-only a `has_coe_t` instance: see note [use has_coe_t]. -/
+only a `CoeTC` instance: see note [use has_coe_t]. -/
@[coe]
def cast : SignType → α
| zero => 0
@@ -415,10 +415,11 @@ theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
· rw [abs_zero, zero_mul]
· rw [sign_pos hx, abs_of_pos hx, coe_one, mul_one]
-/-- `sign` as a `MonoidWithZeroHom` for a nontrivial ordered semiring. Note that linearity
+/-- `SignType.sign` as a `MonoidWithZeroHom` for a nontrivial ordered semiring. Note that linearity
is required; consider ℂ with the order `z ≤ w` iff they have the same imaginary part and
-`z - w ≤ 0` in the reals; then `1 + i` and `1 - i` are incomparable to zero, and thus we have:
-`0 * 0 = sign (1 + i) * sign (1 - i) ≠ sign 2 = 1`. (`Complex.orderedCommRing`) -/
+`z - w ≤ 0` in the reals; then `1 + I` and `1 - I` are incomparable to zero, and thus we have:
+`0 * 0 = SignType.sign (1 + I) * SignType.sign (1 - I) ≠ SignType.sign 2 = 1`.
+(`Complex.orderedCommRing`) -/
def signHom : α →*₀ SignType where
toFun := sign
map_zero' := sign_zero
LinearOrder
decidable fields (#4006)
This renames
decidable_eq
to decidableEq
decidable_lt
to decidableLT
decidable_le
to decidableLE
decidableLT_of_decidableLE
to decidableLTOfDecidableLE
decidableEq_of_decidableLE
to decidableEqOfDecidableLE
These fields are data not proofs, so they should be lowerCamelCased
.
@@ -123,8 +123,8 @@ instance : LinearOrder SignType where
le_total a b := by cases a <;> cases b <;> first | left; constructor | right; constructor
le_antisymm := le_antisymm
le_trans := le_trans
- decidable_le := Le.decidableRel
- decidable_eq := SignType.decidableEq
+ decidableLE := Le.decidableRel
+ decidableEq := SignType.decidableEq
instance : BoundedOrder SignType where
top := 1
@@ -396,7 +396,7 @@ variable [LinearOrderedRing α] {a b : α}
/- I'm not sure why this is necessary, see https://leanprover.zulipchat.com/#narrow/stream/
113488-general/topic/type.20class.20inference.20issues/near/276937942 -/
-attribute [local instance] LinearOrderedRing.decidable_lt
+attribute [local instance] LinearOrderedRing.decidableLT
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
@@ -464,7 +464,7 @@ variable [LinearOrderedAddCommGroup α]
/- I'm not sure why this is necessary, see
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Decidable.20vs.20decidable_rel
-/
-attribute [local instance] LinearOrderedAddCommGroup.decidable_lt
+attribute [local instance] LinearOrderedAddCommGroup.decidableLT
theorem sign_sum {ι : Type _} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
(h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -304,8 +304,7 @@ variable [Zero α] [Preorder α] [DecidableRel ((· < ·) : α → α → Prop)]
-- Porting note: needed to rename this from sign to SignType.sign to avoid ambiguity with Int.sign
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
- ⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h =>
- by
+ ⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h => by
dsimp
split_ifs with h₁ h₂ h₃ h₄ _ _ h₂ h₃ <;> try constructor
· cases lt_irrefl 0 (h₁.trans <| h.trans_lt h₃)
This single file uses more than twice as much RAM as the next largest file in mathlib, see https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/mathlib4.20speedcenter/near/342595677. A simple out-lining fixes the issue.
@@ -90,9 +90,10 @@ instance Le.decidableRel : DecidableRel Le := fun a b => by
instance decidableEq : DecidableEq SignType := fun a b => by
cases a <;> cases b <;> first | exact isTrue (by constructor)| exact isFalse (by rintro ⟨_⟩)
+private lemma mul_comm : ∀ (a b : SignType), a * b = b * a := by rintro ⟨⟩ ⟨⟩ <;> rfl
+private lemma mul_assoc : ∀ (a b c : SignType), (a * b) * c = a * (b * c) := by
+ rintro ⟨⟩ ⟨⟩ ⟨⟩ <;> rfl
-set_option maxHeartbeats 0
--- Porting note: This takes too long, likely fixed by lean4#2003
/- We can define a `Field` instance on `SignType`, but it's not mathematically sensible,
so we only define the `CommGroupWithZero`. -/
instance : CommGroupWithZero SignType where
@@ -105,17 +106,23 @@ instance : CommGroupWithZero SignType where
mul_one a := by cases a <;> rfl
one_mul a := by cases a <;> rfl
mul_inv_cancel a ha := by cases a <;> trivial
- mul_comm a b := by cases a <;> cases b <;> rfl
- mul_assoc a b c := by cases a <;> cases b <;> cases c <;> rfl
+ mul_comm := mul_comm
+ mul_assoc := mul_assoc
exists_pair_ne := ⟨0, 1, by rintro ⟨_⟩⟩
inv_zero := rfl
+private lemma le_antisymm (a b : SignType) (_ : a ≤ b) (_: b ≤ a) : a = b := by
+ cases a <;> cases b <;> trivial
+
+private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
+ cases a <;> cases b <;> cases c <;> first | tauto | constructor
+
instance : LinearOrder SignType where
le := (· ≤ ·)
le_refl a := by cases a <;> constructor
le_total a b := by cases a <;> cases b <;> first | left; constructor | right; constructor
- le_antisymm a b ha hb := by cases a <;> cases b <;> trivial
- le_trans a b c hab hbc := by cases a <;> cases b <;> cases c <;> first | tauto | constructor
+ le_antisymm := le_antisymm
+ le_trans := le_trans
decidable_le := Le.decidableRel
decidable_eq := SignType.decidableEq
@@ -397,6 +397,18 @@ theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
#align sign_mul sign_mul
+@[simp] theorem sign_mul_abs (x : α) : (sign x * |x| : α) = x := by
+ rcases lt_trichotomy x 0 with (hx | rfl | hx)
+ · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, neg_one_mul, neg_neg]
+ · rw [abs_zero, mul_zero]
+ · rw [sign_pos hx, abs_of_pos hx, coe_one, one_mul]
+
+@[simp] theorem abs_mul_sign (x : α) : (|x| * sign x : α) = x := by
+ rcases lt_trichotomy x 0 with (hx | rfl | hx)
+ · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, mul_neg_one, neg_neg]
+ · rw [abs_zero, zero_mul]
+ · rw [sign_pos hx, abs_of_pos hx, coe_one, mul_one]
+
/-- `sign` as a `MonoidWithZeroHom` for a nontrivial ordered semiring. Note that linearity
is required; consider ℂ with the order `z ≤ w` iff they have the same imaginary part and
`z - w ≤ 0` in the reals; then `1 + i` and `1 - i` are incomparable to zero, and thus we have:
@@ -408,9 +420,7 @@ def signHom : α →*₀ SignType where
map_mul' := sign_mul
#align sign_hom signHom
-theorem sign_pow (x : α) (n : ℕ) : sign (x ^ n) = sign x ^ n := by
- change signHom (x ^ n) = signHom x ^ n
- exact map_pow _ _ _
+theorem sign_pow (x : α) (n : ℕ) : sign (x ^ n) = sign x ^ n := map_pow signHom x n
#align sign_pow sign_pow
end LinearOrderedRing
This is now done, but had some difficulties.
decide!
, which is not yet implemented.deriving FinType
does not work yet, manually inserted that instancecasesm
and casesm*
, which appear to work differently than they did in lean3 (see also this zulip thread).DecidableEq
for SignType, manually inserted that instance as well.Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>
The unported dependencies are