algebra.group.ulift
⟷
Mathlib.Algebra.Group.ULift
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)
(last sync)
This is a fix to match mathlib 4 https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Group/ULift.html#ULift.addCancelCommMonoid
@@ -161,7 +161,7 @@ instance cancel_monoid [cancel_monoid α] :
cancel_monoid (ulift α) :=
equiv.ulift.injective.cancel_monoid _ rfl (λ _ _, rfl) (λ _ _, rfl)
-@[to_additive add_cancel_monoid]
+@[to_additive add_cancel_comm_monoid]
instance cancel_comm_monoid [cancel_comm_monoid α] :
cancel_comm_monoid (ulift α) :=
equiv.ulift.injective.cancel_comm_monoid _ rfl (λ _ _, rfl) (λ _ _, rfl)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
Move field-like instances on ulift
from algebra.ring.ulift
to a new file algebra.field.ulift
. Golf them by declaring the has_nat_cast
and has_int_cast
instances earlier.
@@ -77,20 +77,27 @@ equiv.ulift.injective.mul_zero_one_class _ rfl rfl $ λ x y, rfl
instance monoid [monoid α] : monoid (ulift α) :=
equiv.ulift.injective.monoid _ rfl (λ _ _, rfl) (λ _ _, rfl)
-instance add_monoid_with_one [add_monoid_with_one α] : add_monoid_with_one (ulift α) :=
-{ nat_cast := λ n, ⟨n⟩,
- nat_cast_zero := congr_arg ulift.up nat.cast_zero,
- nat_cast_succ := λ n, congr_arg ulift.up (nat.cast_succ _),
- .. ulift.has_one, .. ulift.add_monoid }
-
-@[simp] lemma nat_cast_down [add_monoid_with_one α] (n : ℕ) :
- (n : ulift α).down = n :=
-rfl
-
@[to_additive]
instance comm_monoid [comm_monoid α] : comm_monoid (ulift α) :=
equiv.ulift.injective.comm_monoid _ rfl (λ _ _, rfl) (λ _ _, rfl)
+instance [has_nat_cast α] : has_nat_cast (ulift α) := ⟨λ n, up n⟩
+instance [has_int_cast α] : has_int_cast (ulift α) := ⟨λ n, up n⟩
+
+@[simp, norm_cast] lemma up_nat_cast [has_nat_cast α] (n : ℕ) : up (n : α) = n := rfl
+@[simp, norm_cast] lemma up_int_cast [has_int_cast α] (n : ℤ) : up (n : α) = n := rfl
+@[simp, norm_cast] lemma down_nat_cast [has_nat_cast α] (n : ℕ) : down (n : ulift α) = n := rfl
+@[simp, norm_cast] lemma down_int_cast [has_int_cast α] (n : ℤ) : down (n : ulift α) = n := rfl
+
+instance add_monoid_with_one [add_monoid_with_one α] : add_monoid_with_one (ulift α) :=
+{ nat_cast_zero := congr_arg ulift.up nat.cast_zero,
+ nat_cast_succ := λ n, congr_arg ulift.up (nat.cast_succ _),
+ .. ulift.has_one, .. ulift.add_monoid, ..ulift.has_nat_cast }
+
+instance add_comm_monoid_with_one [add_comm_monoid_with_one α] :
+ add_comm_monoid_with_one (ulift α) :=
+{ ..ulift.add_monoid_with_one, .. ulift.add_comm_monoid }
+
instance monoid_with_zero [monoid_with_zero α] : monoid_with_zero (ulift α) :=
equiv.ulift.injective.monoid_with_zero _ rfl rfl (λ _ _, rfl) (λ _ _, rfl)
@@ -107,20 +114,19 @@ instance group [group α] : group (ulift α) :=
equiv.ulift.injective.group _ rfl (λ _ _, rfl) (λ _, rfl)
(λ _ _, rfl) (λ _ _, rfl) (λ _ _, rfl)
+@[to_additive]
+instance comm_group [comm_group α] : comm_group (ulift α) :=
+equiv.ulift.injective.comm_group _ rfl (λ _ _, rfl) (λ _, rfl)
+ (λ _ _, rfl) (λ _ _, rfl) (λ _ _, rfl)
+
instance add_group_with_one [add_group_with_one α] : add_group_with_one (ulift α) :=
{ int_cast := λ n, ⟨n⟩,
int_cast_of_nat := λ n, congr_arg ulift.up (int.cast_of_nat _),
int_cast_neg_succ_of_nat := λ n, congr_arg ulift.up (int.cast_neg_succ_of_nat _),
.. ulift.add_monoid_with_one, .. ulift.add_group }
-@[simp] lemma int_cast_down [add_group_with_one α] (n : ℤ) :
- (n : ulift α).down = n :=
-rfl
-
-@[to_additive]
-instance comm_group [comm_group α] : comm_group (ulift α) :=
-equiv.ulift.injective.comm_group _ rfl (λ _ _, rfl) (λ _, rfl)
- (λ _ _, rfl) (λ _ _, rfl) (λ _ _, rfl)
+instance add_comm_group_with_one [add_comm_group_with_one α] : add_comm_group_with_one (ulift α) :=
+{ ..ulift.add_group_with_one, .. ulift.add_comm_group }
instance group_with_zero [group_with_zero α] : group_with_zero (ulift α) :=
equiv.ulift.injective.group_with_zero _ rfl rfl (λ _ _, rfl) (λ _, rfl) (λ _ _, rfl) (λ _ _, rfl)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -221,7 +221,7 @@ theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
#print ULift.addMonoidWithOne /-
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
{ ULift.one, ULift.addMonoid,
- ULift.natCast with
+ ULift.instNatCast with
natCast_zero := congr_arg ULift.up Nat.cast_zero
natCast_succ := fun n => congr_arg ULift.up (Nat.cast_succ _) }
#align ulift.add_monoid_with_one ULift.addMonoidWithOne
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -277,7 +277,7 @@ instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
{ ULift.addMonoidWithOne,
ULift.addGroup with
intCast := fun n => ⟨n⟩
- intCast_ofNat := fun n => congr_arg ULift.up (Int.cast_ofNat _)
+ intCast_ofNat := fun n => congr_arg ULift.up (Int.cast_natCast _)
intCast_negSucc := fun n => congr_arg ULift.up (Int.cast_negSucc _) }
#align ulift.add_group_with_one ULift.addGroupWithOne
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
import Data.Int.Cast.Defs
-import Algebra.Hom.Equiv.Basic
+import Algebra.Group.Equiv.Basic
import Algebra.GroupWithZero.InjSurj
#align_import algebra.group.ulift from "leanprover-community/mathlib"@"564bcc44d2b394a50c0cd6340c14a6b02a50a99a"
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
-import Mathbin.Data.Int.Cast.Defs
-import Mathbin.Algebra.Hom.Equiv.Basic
-import Mathbin.Algebra.GroupWithZero.InjSurj
+import Data.Int.Cast.Defs
+import Algebra.Hom.Equiv.Basic
+import Algebra.GroupWithZero.InjSurj
#align_import algebra.group.ulift from "leanprover-community/mathlib"@"564bcc44d2b394a50c0cd6340c14a6b02a50a99a"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module algebra.group.ulift
-! leanprover-community/mathlib commit 564bcc44d2b394a50c0cd6340c14a6b02a50a99a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Int.Cast.Defs
import Mathbin.Algebra.Hom.Equiv.Basic
import Mathbin.Algebra.GroupWithZero.InjSurj
+#align_import algebra.group.ulift from "leanprover-community/mathlib"@"564bcc44d2b394a50c0cd6340c14a6b02a50a99a"
+
/-!
# `ulift` instances for groups and monoids
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -43,11 +43,13 @@ instance one [One α] : One (ULift α) :=
#align ulift.has_zero ULift.zero
-/
+#print ULift.one_down /-
@[simp, to_additive]
theorem one_down [One α] : (1 : ULift α).down = 1 :=
rfl
#align ulift.one_down ULift.one_down
#align ulift.zero_down ULift.zero_down
+-/
#print ULift.mul /-
@[to_additive]
@@ -105,11 +107,13 @@ instance smul [SMul α β] : SMul α (ULift β) :=
#align ulift.has_vadd ULift.vadd
-/
+#print ULift.smul_down /-
@[simp, to_additive]
theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a • b.down :=
rfl
#align ulift.smul_down ULift.smul_down
#align ulift.vadd_down ULift.vadd_down
+-/
#print ULift.pow /-
@[to_additive SMul, to_additive_reorder 1]
@@ -119,11 +123,13 @@ instance pow [Pow α β] : Pow (ULift α) β :=
#align ulift.has_smul ULift.smul
-/
+#print ULift.pow_down /-
@[simp, to_additive smul_down, to_additive_reorder 1]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b :=
rfl
#align ulift.pow_down ULift.pow_down
#align ulift.smul_down ULift.smul_down
+-/
#print MulEquiv.ulift /-
/-- The multiplicative equivalence between `ulift α` and `α`.
@@ -187,25 +193,33 @@ instance [NatCast α] : NatCast (ULift α) :=
instance [IntCast α] : IntCast (ULift α) :=
⟨fun n => up n⟩
+#print ULift.up_natCast /-
@[simp, norm_cast]
theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n :=
rfl
#align ulift.up_nat_cast ULift.up_natCast
+-/
+#print ULift.up_intCast /-
@[simp, norm_cast]
theorem up_intCast [IntCast α] (n : ℤ) : up (n : α) = n :=
rfl
#align ulift.up_int_cast ULift.up_intCast
+-/
+#print ULift.down_natCast /-
@[simp, norm_cast]
theorem down_natCast [NatCast α] (n : ℕ) : down (n : ULift α) = n :=
rfl
#align ulift.down_nat_cast ULift.down_natCast
+-/
+#print ULift.down_intCast /-
@[simp, norm_cast]
theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
rfl
#align ulift.down_int_cast ULift.down_intCast
+-/
#print ULift.addMonoidWithOne /-
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -43,12 +43,6 @@ instance one [One α] : One (ULift α) :=
#align ulift.has_zero ULift.zero
-/
-/- warning: ulift.one_down -> ULift.one_down is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : One.{u1} α], Eq.{succ u1} α (ULift.down.{u2, u1} α (OfNat.ofNat.{max u1 u2} (ULift.{u2, u1} α) 1 (OfNat.mk.{max u1 u2} (ULift.{u2, u1} α) 1 (One.one.{max u1 u2} (ULift.{u2, u1} α) (ULift.one.{u1, u2} α _inst_1))))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_1)))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : One.{u2} α], Eq.{succ u2} α (ULift.down.{u1, u2} α (OfNat.ofNat.{max u2 u1} (ULift.{u1, u2} α) 1 (One.toOfNat1.{max u2 u1} (ULift.{u1, u2} α) (ULift.one.{u2, u1} α _inst_1)))) (OfNat.ofNat.{u2} α 1 (One.toOfNat1.{u2} α _inst_1))
-Case conversion may be inaccurate. Consider using '#align ulift.one_down ULift.one_downₓ'. -/
@[simp, to_additive]
theorem one_down [One α] : (1 : ULift α).down = 1 :=
rfl
@@ -111,12 +105,6 @@ instance smul [SMul α β] : SMul α (ULift β) :=
#align ulift.has_vadd ULift.vadd
-/
-/- warning: ulift.smul_down -> ULift.smul_down is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u3}} [_inst_1 : SMul.{u1, u3} α β] (a : α) (b : ULift.{u2, u3} β), Eq.{succ u3} β (ULift.down.{u2, u3} β (SMul.smul.{u1, max u3 u2} α (ULift.{u2, u3} β) (ULift.smul.{u1, u3, u2} α β _inst_1) a b)) (SMul.smul.{u1, u3} α β _inst_1 a (ULift.down.{u2, u3} β b))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : SMul.{u2, u1} α β] (a : α) (b : ULift.{u3, u1} β), Eq.{succ u1} β (ULift.down.{u3, u1} β (HSMul.hSMul.{u2, max u3 u1, max u3 u1} α (ULift.{u3, u1} β) (ULift.{u3, u1} β) (instHSMul.{u2, max u3 u1} α (ULift.{u3, u1} β) (ULift.smul.{u2, u1, u3} α β _inst_1)) a b)) (HSMul.hSMul.{u2, u1, u1} α β β (instHSMul.{u2, u1} α β _inst_1) a (ULift.down.{u3, u1} β b))
-Case conversion may be inaccurate. Consider using '#align ulift.smul_down ULift.smul_downₓ'. -/
@[simp, to_additive]
theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a • b.down :=
rfl
@@ -131,12 +119,6 @@ instance pow [Pow α β] : Pow (ULift α) β :=
#align ulift.has_smul ULift.smul
-/
-/- warning: ulift.pow_down -> ULift.pow_down is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u3}} [_inst_1 : Pow.{u1, u3} α β] (a : ULift.{u2, u1} α) (b : β), Eq.{succ u1} α (ULift.down.{u2, u1} α (HPow.hPow.{max u1 u2, u3, max u1 u2} (ULift.{u2, u1} α) β (ULift.{u2, u1} α) (instHPow.{max u1 u2, u3} (ULift.{u2, u1} α) β (ULift.pow.{u1, u3, u2} α β _inst_1)) a b)) (HPow.hPow.{u1, u3, u1} α β α (instHPow.{u1, u3} α β _inst_1) (ULift.down.{u2, u1} α a) b)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Pow.{u2, u1} α β] (a : ULift.{u3, u2} α) (b : β), Eq.{succ u2} α (ULift.down.{u3, u2} α (HPow.hPow.{max u2 u3, u1, max u2 u3} (ULift.{u3, u2} α) β (ULift.{u3, u2} α) (instHPow.{max u2 u3, u1} (ULift.{u3, u2} α) β (ULift.pow.{u2, u1, u3} α β _inst_1)) a b)) (HPow.hPow.{u2, u1, u2} α β α (instHPow.{u2, u1} α β _inst_1) (ULift.down.{u3, u2} α a) b)
-Case conversion may be inaccurate. Consider using '#align ulift.pow_down ULift.pow_downₓ'. -/
@[simp, to_additive smul_down, to_additive_reorder 1]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b :=
rfl
@@ -205,45 +187,21 @@ instance [NatCast α] : NatCast (ULift α) :=
instance [IntCast α] : IntCast (ULift α) :=
⟨fun n => up n⟩
-/- warning: ulift.up_nat_cast -> ULift.up_natCast is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : NatCast.{u1} α] (n : Nat), Eq.{succ (max u1 u2)} (ULift.{u2, u1} α) (ULift.up.{u2, u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat α (HasLiftT.mk.{1, succ u1} Nat α (CoeTCₓ.coe.{1, succ u1} Nat α (Nat.castCoe.{u1} α _inst_1))) n)) ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Nat (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (Nat.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.natCast.{u1, u2} α _inst_1)))) n)
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : NatCast.{u2} α] (n : Nat), Eq.{max (succ u2) (succ u1)} (ULift.{u1, u2} α) (ULift.up.{u1, u2} α (Nat.cast.{u2} α _inst_1 n)) (Nat.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.natCast.{u2, u1} α _inst_1) n)
-Case conversion may be inaccurate. Consider using '#align ulift.up_nat_cast ULift.up_natCastₓ'. -/
@[simp, norm_cast]
theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n :=
rfl
#align ulift.up_nat_cast ULift.up_natCast
-/- warning: ulift.up_int_cast -> ULift.up_intCast is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : IntCast.{u1} α] (n : Int), Eq.{succ (max u1 u2)} (ULift.{u2, u1} α) (ULift.up.{u2, u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int α (HasLiftT.mk.{1, succ u1} Int α (CoeTCₓ.coe.{1, succ u1} Int α (Int.castCoe.{u1} α _inst_1))) n)) ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Int (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (Int.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.intCast.{u1, u2} α _inst_1)))) n)
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : IntCast.{u2} α] (n : Int), Eq.{max (succ u2) (succ u1)} (ULift.{u1, u2} α) (ULift.up.{u1, u2} α (Int.cast.{u2} α _inst_1 n)) (Int.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.intCast.{u2, u1} α _inst_1) n)
-Case conversion may be inaccurate. Consider using '#align ulift.up_int_cast ULift.up_intCastₓ'. -/
@[simp, norm_cast]
theorem up_intCast [IntCast α] (n : ℤ) : up (n : α) = n :=
rfl
#align ulift.up_int_cast ULift.up_intCast
-/- warning: ulift.down_nat_cast -> ULift.down_natCast is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : NatCast.{u1} α] (n : Nat), Eq.{succ u1} α (ULift.down.{u2, u1} α ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Nat (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (Nat.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.natCast.{u1, u2} α _inst_1)))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat α (HasLiftT.mk.{1, succ u1} Nat α (CoeTCₓ.coe.{1, succ u1} Nat α (Nat.castCoe.{u1} α _inst_1))) n)
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : NatCast.{u2} α] (n : Nat), Eq.{succ u2} α (ULift.down.{u1, u2} α (Nat.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.natCast.{u2, u1} α _inst_1) n)) (Nat.cast.{u2} α _inst_1 n)
-Case conversion may be inaccurate. Consider using '#align ulift.down_nat_cast ULift.down_natCastₓ'. -/
@[simp, norm_cast]
theorem down_natCast [NatCast α] (n : ℕ) : down (n : ULift α) = n :=
rfl
#align ulift.down_nat_cast ULift.down_natCast
-/- warning: ulift.down_int_cast -> ULift.down_intCast is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : IntCast.{u1} α] (n : Int), Eq.{succ u1} α (ULift.down.{u2, u1} α ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Int (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (Int.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.intCast.{u1, u2} α _inst_1)))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int α (HasLiftT.mk.{1, succ u1} Int α (CoeTCₓ.coe.{1, succ u1} Int α (Int.castCoe.{u1} α _inst_1))) n)
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : IntCast.{u2} α] (n : Int), Eq.{succ u2} α (ULift.down.{u1, u2} α (Int.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.intCast.{u2, u1} α _inst_1) n)) (Int.cast.{u2} α _inst_1 n)
-Case conversion may be inaccurate. Consider using '#align ulift.down_int_cast ULift.down_intCastₓ'. -/
@[simp, norm_cast]
theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
rfl
mathlib commit https://github.com/leanprover-community/mathlib/commit/2651125b48fc5c170ab1111afd0817c903b1fc6c
@@ -143,20 +143,20 @@ theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down
#align ulift.pow_down ULift.pow_down
#align ulift.smul_down ULift.smul_down
-#print ULift.MulEquiv.ulift /-
+#print MulEquiv.ulift /-
/-- The multiplicative equivalence between `ulift α` and `α`.
-/
@[to_additive "The additive equivalence between `ulift α` and `α`."]
-def ULift.MulEquiv.ulift [Mul α] : ULift α ≃* α :=
+def MulEquiv.ulift [Mul α] : ULift α ≃* α :=
{ Equiv.ulift with map_mul' := fun x y => rfl }
-#align mul_equiv.ulift ULift.MulEquiv.ulift
+#align mul_equiv.ulift MulEquiv.ulift
#align add_equiv.ulift AddEquiv.ulift
-/
#print ULift.semigroup /-
@[to_additive]
instance semigroup [Semigroup α] : Semigroup (ULift α) :=
- ULift.MulEquiv.ulift.Injective.Semigroup _ fun x y => rfl
+ MulEquiv.ulift.Injective.Semigroup _ fun x y => rfl
#align ulift.semigroup ULift.semigroup
#align ulift.add_semigroup ULift.addSemigroup
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
! This file was ported from Lean 3 source module algebra.group.ulift
-! leanprover-community/mathlib commit 13e18cfa070ea337ea960176414f5ae3a1534aae
+! leanprover-community/mathlib commit 564bcc44d2b394a50c0cd6340c14a6b02a50a99a
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -374,7 +374,7 @@ instance cancelMonoid [CancelMonoid α] : CancelMonoid (ULift α) :=
-/
#print ULift.cancelCommMonoid /-
-@[to_additive AddCancelMonoid]
+@[to_additive AddCancelCommMonoid]
instance cancelCommMonoid [CancelCommMonoid α] : CancelCommMonoid (ULift α) :=
Equiv.ulift.Injective.CancelCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl
#align ulift.cancel_comm_monoid ULift.cancelCommMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/02ba8949f486ebecf93fe7460f1ed0564b5e442c
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
! This file was ported from Lean 3 source module algebra.group.ulift
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
+! leanprover-community/mathlib commit 13e18cfa070ea337ea960176414f5ae3a1534aae
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -191,26 +191,77 @@ instance monoid [Monoid α] : Monoid (ULift α) :=
#align ulift.add_monoid ULift.addMonoid
-/
+#print ULift.commMonoid /-
+@[to_additive]
+instance commMonoid [CommMonoid α] : CommMonoid (ULift α) :=
+ Equiv.ulift.Injective.CommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl
+#align ulift.comm_monoid ULift.commMonoid
+#align ulift.add_comm_monoid ULift.addCommMonoid
+-/
+
+instance [NatCast α] : NatCast (ULift α) :=
+ ⟨fun n => up n⟩
+
+instance [IntCast α] : IntCast (ULift α) :=
+ ⟨fun n => up n⟩
+
+/- warning: ulift.up_nat_cast -> ULift.up_natCast is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : NatCast.{u1} α] (n : Nat), Eq.{succ (max u1 u2)} (ULift.{u2, u1} α) (ULift.up.{u2, u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat α (HasLiftT.mk.{1, succ u1} Nat α (CoeTCₓ.coe.{1, succ u1} Nat α (Nat.castCoe.{u1} α _inst_1))) n)) ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Nat (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (Nat.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.natCast.{u1, u2} α _inst_1)))) n)
+but is expected to have type
+ forall {α : Type.{u2}} [_inst_1 : NatCast.{u2} α] (n : Nat), Eq.{max (succ u2) (succ u1)} (ULift.{u1, u2} α) (ULift.up.{u1, u2} α (Nat.cast.{u2} α _inst_1 n)) (Nat.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.natCast.{u2, u1} α _inst_1) n)
+Case conversion may be inaccurate. Consider using '#align ulift.up_nat_cast ULift.up_natCastₓ'. -/
+@[simp, norm_cast]
+theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n :=
+ rfl
+#align ulift.up_nat_cast ULift.up_natCast
+
+/- warning: ulift.up_int_cast -> ULift.up_intCast is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : IntCast.{u1} α] (n : Int), Eq.{succ (max u1 u2)} (ULift.{u2, u1} α) (ULift.up.{u2, u1} α ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int α (HasLiftT.mk.{1, succ u1} Int α (CoeTCₓ.coe.{1, succ u1} Int α (Int.castCoe.{u1} α _inst_1))) n)) ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Int (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (Int.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.intCast.{u1, u2} α _inst_1)))) n)
+but is expected to have type
+ forall {α : Type.{u2}} [_inst_1 : IntCast.{u2} α] (n : Int), Eq.{max (succ u2) (succ u1)} (ULift.{u1, u2} α) (ULift.up.{u1, u2} α (Int.cast.{u2} α _inst_1 n)) (Int.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.intCast.{u2, u1} α _inst_1) n)
+Case conversion may be inaccurate. Consider using '#align ulift.up_int_cast ULift.up_intCastₓ'. -/
+@[simp, norm_cast]
+theorem up_intCast [IntCast α] (n : ℤ) : up (n : α) = n :=
+ rfl
+#align ulift.up_int_cast ULift.up_intCast
+
+/- warning: ulift.down_nat_cast -> ULift.down_natCast is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : NatCast.{u1} α] (n : Nat), Eq.{succ u1} α (ULift.down.{u2, u1} α ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Nat (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (Nat.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.natCast.{u1, u2} α _inst_1)))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat α (HasLiftT.mk.{1, succ u1} Nat α (CoeTCₓ.coe.{1, succ u1} Nat α (Nat.castCoe.{u1} α _inst_1))) n)
+but is expected to have type
+ forall {α : Type.{u2}} [_inst_1 : NatCast.{u2} α] (n : Nat), Eq.{succ u2} α (ULift.down.{u1, u2} α (Nat.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.natCast.{u2, u1} α _inst_1) n)) (Nat.cast.{u2} α _inst_1 n)
+Case conversion may be inaccurate. Consider using '#align ulift.down_nat_cast ULift.down_natCastₓ'. -/
+@[simp, norm_cast]
+theorem down_natCast [NatCast α] (n : ℕ) : down (n : ULift α) = n :=
+ rfl
+#align ulift.down_nat_cast ULift.down_natCast
+
+/- warning: ulift.down_int_cast -> ULift.down_intCast is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : IntCast.{u1} α] (n : Int), Eq.{succ u1} α (ULift.down.{u2, u1} α ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Int (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (Int.castCoe.{max u1 u2} (ULift.{u2, u1} α) (ULift.intCast.{u1, u2} α _inst_1)))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int α (HasLiftT.mk.{1, succ u1} Int α (CoeTCₓ.coe.{1, succ u1} Int α (Int.castCoe.{u1} α _inst_1))) n)
+but is expected to have type
+ forall {α : Type.{u2}} [_inst_1 : IntCast.{u2} α] (n : Int), Eq.{succ u2} α (ULift.down.{u1, u2} α (Int.cast.{max u2 u1} (ULift.{u1, u2} α) (ULift.intCast.{u2, u1} α _inst_1) n)) (Int.cast.{u2} α _inst_1 n)
+Case conversion may be inaccurate. Consider using '#align ulift.down_int_cast ULift.down_intCastₓ'. -/
+@[simp, norm_cast]
+theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
+ rfl
+#align ulift.down_int_cast ULift.down_intCast
+
#print ULift.addMonoidWithOne /-
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
- { ULift.one, ULift.addMonoid with
- natCast := fun n => ⟨n⟩
+ { ULift.one, ULift.addMonoid,
+ ULift.natCast with
natCast_zero := congr_arg ULift.up Nat.cast_zero
natCast_succ := fun n => congr_arg ULift.up (Nat.cast_succ _) }
#align ulift.add_monoid_with_one ULift.addMonoidWithOne
-/
-@[simp]
-theorem nat_cast_down [AddMonoidWithOne α] (n : ℕ) : (n : ULift α).down = n :=
- rfl
-#align ulift.nat_cast_down ULift.nat_cast_down
-
-#print ULift.commMonoid /-
-@[to_additive]
-instance commMonoid [CommMonoid α] : CommMonoid (ULift α) :=
- Equiv.ulift.Injective.CommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl
-#align ulift.comm_monoid ULift.commMonoid
-#align ulift.add_comm_monoid ULift.addCommMonoid
+#print ULift.addCommMonoidWithOne /-
+instance addCommMonoidWithOne [AddCommMonoidWithOne α] : AddCommMonoidWithOne (ULift α) :=
+ { ULift.addMonoidWithOne, ULift.addCommMonoid with }
+#align ulift.add_comm_monoid_with_one ULift.addCommMonoidWithOne
-/
#print ULift.monoidWithZero /-
@@ -243,6 +294,15 @@ instance group [Group α] : Group (ULift α) :=
#align ulift.add_group ULift.addGroup
-/
+#print ULift.commGroup /-
+@[to_additive]
+instance commGroup [CommGroup α] : CommGroup (ULift α) :=
+ Equiv.ulift.Injective.CommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
+ (fun _ _ => rfl) fun _ _ => rfl
+#align ulift.comm_group ULift.commGroup
+#align ulift.add_comm_group ULift.addCommGroup
+-/
+
#print ULift.addGroupWithOne /-
instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
{ ULift.addMonoidWithOne,
@@ -253,18 +313,10 @@ instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
#align ulift.add_group_with_one ULift.addGroupWithOne
-/
-@[simp]
-theorem int_cast_down [AddGroupWithOne α] (n : ℤ) : (n : ULift α).down = n :=
- rfl
-#align ulift.int_cast_down ULift.int_cast_down
-
-#print ULift.commGroup /-
-@[to_additive]
-instance commGroup [CommGroup α] : CommGroup (ULift α) :=
- Equiv.ulift.Injective.CommGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
- (fun _ _ => rfl) fun _ _ => rfl
-#align ulift.comm_group ULift.commGroup
-#align ulift.add_comm_group ULift.addCommGroup
+#print ULift.addCommGroupWithOne /-
+instance addCommGroupWithOne [AddCommGroupWithOne α] : AddCommGroupWithOne (ULift α) :=
+ { ULift.addGroupWithOne, ULift.addCommGroup with }
+#align ulift.add_comm_group_with_one ULift.addCommGroupWithOne
-/
#print ULift.groupWithZero /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/da3fc4a33ff6bc75f077f691dc94c217b8d41559
@@ -200,12 +200,6 @@ instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
#align ulift.add_monoid_with_one ULift.addMonoidWithOne
-/
-/- warning: ulift.nat_cast_down -> ULift.nat_cast_down is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddMonoidWithOne.{u1} α] (n : Nat), Eq.{succ u1} α (ULift.down.{u2, u1} α ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Nat (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Nat (ULift.{u2, u1} α) (Nat.castCoe.{max u1 u2} (ULift.{u2, u1} α) (AddMonoidWithOne.toNatCast.{max u1 u2} (ULift.{u2, u1} α) (ULift.addMonoidWithOne.{u1, u2} α _inst_1))))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat α (HasLiftT.mk.{1, succ u1} Nat α (CoeTCₓ.coe.{1, succ u1} Nat α (Nat.castCoe.{u1} α (AddMonoidWithOne.toNatCast.{u1} α _inst_1)))) n)
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : AddMonoidWithOne.{u2} α] (n : Nat), Eq.{succ u2} α (ULift.down.{u1, u2} α (Nat.cast.{max u2 u1} (ULift.{u1, u2} α) (AddMonoidWithOne.toNatCast.{max u2 u1} (ULift.{u1, u2} α) (ULift.addMonoidWithOne.{u2, u1} α _inst_1)) n)) (Nat.cast.{u2} α (AddMonoidWithOne.toNatCast.{u2} α _inst_1) n)
-Case conversion may be inaccurate. Consider using '#align ulift.nat_cast_down ULift.nat_cast_downₓ'. -/
@[simp]
theorem nat_cast_down [AddMonoidWithOne α] (n : ℕ) : (n : ULift α).down = n :=
rfl
@@ -259,12 +253,6 @@ instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
#align ulift.add_group_with_one ULift.addGroupWithOne
-/
-/- warning: ulift.int_cast_down -> ULift.int_cast_down is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddGroupWithOne.{u1} α] (n : Int), Eq.{succ u1} α (ULift.down.{u2, u1} α ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Int (ULift.{u2, u1} α) (HasLiftT.mk.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (CoeTCₓ.coe.{1, succ (max u1 u2)} Int (ULift.{u2, u1} α) (Int.castCoe.{max u1 u2} (ULift.{u2, u1} α) (AddGroupWithOne.toHasIntCast.{max u1 u2} (ULift.{u2, u1} α) (ULift.addGroupWithOne.{u1, u2} α _inst_1))))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int α (HasLiftT.mk.{1, succ u1} Int α (CoeTCₓ.coe.{1, succ u1} Int α (Int.castCoe.{u1} α (AddGroupWithOne.toHasIntCast.{u1} α _inst_1)))) n)
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : AddGroupWithOne.{u2} α] (n : Int), Eq.{succ u2} α (ULift.down.{u1, u2} α (Int.cast.{max u2 u1} (ULift.{u1, u2} α) (AddGroupWithOne.toIntCast.{max u2 u1} (ULift.{u1, u2} α) (ULift.addGroupWithOne.{u2, u1} α _inst_1)) n)) (Int.cast.{u2} α (AddGroupWithOne.toIntCast.{u2} α _inst_1) n)
-Case conversion may be inaccurate. Consider using '#align ulift.int_cast_down ULift.int_cast_downₓ'. -/
@[simp]
theorem int_cast_down [AddGroupWithOne α] (n : ℤ) : (n : ULift α).down = n :=
rfl
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Int
and Rat
instances (#12235)
Fix a few names and deduplicate the AddCommGroup ℤ
instance
@@ -143,10 +143,10 @@ instance commMonoid [CommMonoid α] : CommMonoid (ULift α) :=
#align ulift.comm_monoid ULift.commMonoid
#align ulift.add_comm_monoid ULift.addCommMonoid
-instance natCast [NatCast α] : NatCast (ULift α) := ⟨(up ·)⟩
-#align ulift.has_nat_cast ULift.natCast
-instance intCast [IntCast α] : IntCast (ULift α) := ⟨(up ·)⟩
-#align ulift.has_int_cast ULift.intCast
+instance instNatCast [NatCast α] : NatCast (ULift α) := ⟨(up ·)⟩
+instance instIntCast [IntCast α] : IntCast (ULift α) := ⟨(up ·)⟩
+#align ulift.has_nat_cast ULift.instNatCast
+#align ulift.has_int_cast ULift.instIntCast
@[simp, norm_cast]
theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n :=
OfNat
and Nat.cast
lemmas (#11861)
This renames
Int.cast_ofNat
to Int.cast_natCast
Int.int_cast_ofNat
to Int.cast_ofNat
I think the history here is that this lemma was previously about Int.ofNat
, before we globally fixed the simp-normal form to be Nat.cast
.
Since the Int.cast_ofNat
name is repurposed, it can't be deprecated. Int.int_cast_ofNat
is such a wonky name that it was probably never used.
@@ -223,7 +223,7 @@ instance commGroup [CommGroup α] : CommGroup (ULift α) :=
instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
{ ULift.addMonoidWithOne, ULift.addGroup with
intCast := (⟨·⟩),
- intCast_ofNat := fun _ => congr_arg ULift.up (Int.cast_ofNat _),
+ intCast_ofNat := fun _ => congr_arg ULift.up (Int.cast_natCast _),
intCast_negSucc := fun _ => congr_arg ULift.up (Int.cast_negSucc _) }
#align ulift.add_group_with_one ULift.addGroupWithOne
λ
by fun
(#11301)
Per the style guidelines, λ
is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.
Notes
=>
to ↦
.Mathlib/Order/SupClosed
.λ x,
, which I also replaced.@@ -143,9 +143,9 @@ instance commMonoid [CommMonoid α] : CommMonoid (ULift α) :=
#align ulift.comm_monoid ULift.commMonoid
#align ulift.add_comm_monoid ULift.addCommMonoid
-instance natCast [NatCast α] : NatCast (ULift α) := ⟨λ a ↦ up a⟩
+instance natCast [NatCast α] : NatCast (ULift α) := ⟨(up ·)⟩
#align ulift.has_nat_cast ULift.natCast
-instance intCast [IntCast α] : IntCast (ULift α) := ⟨λ a ↦ up a⟩
+instance intCast [IntCast α] : IntCast (ULift α) := ⟨(up ·)⟩
#align ulift.has_int_cast ULift.intCast
@[simp, norm_cast]
@@ -182,7 +182,7 @@ theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
{ ULift.one, ULift.addMonoid with
- natCast := fun n => ⟨n⟩
+ natCast := (⟨·⟩)
natCast_zero := congr_arg ULift.up Nat.cast_zero,
natCast_succ := fun _ => congr_arg ULift.up (Nat.cast_succ _) }
#align ulift.add_monoid_with_one ULift.addMonoidWithOne
@@ -222,7 +222,7 @@ instance commGroup [CommGroup α] : CommGroup (ULift α) :=
instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
{ ULift.addMonoidWithOne, ULift.addGroup with
- intCast := fun n => ⟨n⟩,
+ intCast := (⟨·⟩),
intCast_ofNat := fun _ => congr_arg ULift.up (Int.cast_ofNat _),
intCast_negSucc := fun _ => congr_arg ULift.up (Int.cast_negSucc _) }
#align ulift.add_group_with_one ULift.addGroupWithOne
I loogled for every occurrence of "cast", Nat
and "natCast"
and where the casted nat was n
, and made sure there were corresponding @[simp]
lemmas for 0
, 1
, and OfNat.ofNat n
. This is necessary in general for simp confluence. Example:
import Mathlib
variable {α : Type*} [LinearOrderedRing α] (m n : ℕ) [m.AtLeastTwo] [n.AtLeastTwo]
example : ((OfNat.ofNat m : ℕ) : α) ≤ ((OfNat.ofNat n : ℕ) : α) ↔ (OfNat.ofNat m : ℕ) ≤ (OfNat.ofNat n : ℕ) := by
simp only [Nat.cast_le] -- this `@[simp]` lemma can apply
example : ((OfNat.ofNat m : ℕ) : α) ≤ ((OfNat.ofNat n : ℕ) : α) ↔ (OfNat.ofNat m : α) ≤ (OfNat.ofNat n : α) := by
simp only [Nat.cast_ofNat] -- and so can this one
example : (OfNat.ofNat m : α) ≤ (OfNat.ofNat n : α) ↔ (OfNat.ofNat m : ℕ) ≤ (OfNat.ofNat n : ℕ) := by
simp -- fails! `simp` doesn't have a lemma to bridge their results. confluence issue.
As far as I know, the only file this PR leaves with ofNat
gaps is PartENat.lean
. #8002 is addressing that file in parallel.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -153,6 +153,12 @@ theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n :=
rfl
#align ulift.up_nat_cast ULift.up_natCast
+-- See note [no_index around OfNat.ofNat]
+@[simp]
+theorem up_ofNat [NatCast α] (n : ℕ) [n.AtLeastTwo] :
+ up (no_index (OfNat.ofNat n : α)) = OfNat.ofNat n :=
+ rfl
+
@[simp, norm_cast]
theorem up_intCast [IntCast α] (n : ℤ) : up (n : α) = n :=
rfl
@@ -163,6 +169,12 @@ theorem down_natCast [NatCast α] (n : ℕ) : down (n : ULift α) = n :=
rfl
#align ulift.down_nat_cast ULift.down_natCast
+-- See note [no_index around OfNat.ofNat]
+@[simp]
+theorem down_ofNat [NatCast α] (n : ℕ) [n.AtLeastTwo] :
+ down (no_index (OfNat.ofNat n : ULift α)) = OfNat.ofNat n :=
+ rfl
+
@[simp, norm_cast]
theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
rfl
@@ -104,7 +104,7 @@ def _root_.MulEquiv.ulift [Mul α] : ULift α ≃* α :=
{ Equiv.ulift with map_mul' := fun _ _ => rfl }
#align mul_equiv.ulift MulEquiv.ulift
--- porting notes: below failed due to error above, manually added
+-- Porting note: below failed due to error above, manually added
--@[to_additive]
instance semigroup [Semigroup α] : Semigroup (ULift α) :=
(MulEquiv.ulift.injective.semigroup _) fun _ _ => rfl
Hom
and file name (#8095)
I believe the file defining a type of morphisms belongs alongside the file defining the structure this morphism works on. So I would like to reorganize the files in the Mathlib.Algebra.Hom
folder so that e.g. Mathlib.Algebra.Hom.Ring
becomes Mathlib.Algebra.Ring.Hom
and Mathlib.Algebra.Hom.NonUnitalAlg
becomes Mathlib.Algebra.Algebra.NonUnitalHom
.
While fixing the imports I went ahead and sorted them for good luck.
The full list of changes is: renamed: Mathlib/Algebra/Hom/NonUnitalAlg.lean -> Mathlib/Algebra/Algebra/NonUnitalHom.lean renamed: Mathlib/Algebra/Hom/Aut.lean -> Mathlib/Algebra/Group/Aut.lean renamed: Mathlib/Algebra/Hom/Commute.lean -> Mathlib/Algebra/Group/Commute/Hom.lean renamed: Mathlib/Algebra/Hom/Embedding.lean -> Mathlib/Algebra/Group/Embedding.lean renamed: Mathlib/Algebra/Hom/Equiv/Basic.lean -> Mathlib/Algebra/Group/Equiv/Basic.lean renamed: Mathlib/Algebra/Hom/Equiv/TypeTags.lean -> Mathlib/Algebra/Group/Equiv/TypeTags.lean renamed: Mathlib/Algebra/Hom/Equiv/Units/Basic.lean -> Mathlib/Algebra/Group/Units/Equiv.lean renamed: Mathlib/Algebra/Hom/Equiv/Units/GroupWithZero.lean -> Mathlib/Algebra/GroupWithZero/Units/Equiv.lean renamed: Mathlib/Algebra/Hom/Freiman.lean -> Mathlib/Algebra/Group/Freiman.lean renamed: Mathlib/Algebra/Hom/Group/Basic.lean -> Mathlib/Algebra/Group/Hom/Basic.lean renamed: Mathlib/Algebra/Hom/Group/Defs.lean -> Mathlib/Algebra/Group/Hom/Defs.lean renamed: Mathlib/Algebra/Hom/GroupAction.lean -> Mathlib/GroupTheory/GroupAction/Hom.lean renamed: Mathlib/Algebra/Hom/GroupInstances.lean -> Mathlib/Algebra/Group/Hom/Instances.lean renamed: Mathlib/Algebra/Hom/Iterate.lean -> Mathlib/Algebra/GroupPower/IterateHom.lean renamed: Mathlib/Algebra/Hom/Centroid.lean -> Mathlib/Algebra/Ring/CentroidHom.lean renamed: Mathlib/Algebra/Hom/Ring/Basic.lean -> Mathlib/Algebra/Ring/Hom/Basic.lean renamed: Mathlib/Algebra/Hom/Ring/Defs.lean -> Mathlib/Algebra/Ring/Hom/Defs.lean renamed: Mathlib/Algebra/Hom/Units.lean -> Mathlib/Algebra/Group/Units/Hom.lean
Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Reorganizing.20.60Mathlib.2EAlgebra.2EHom.60
@@ -3,10 +3,10 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
-import Mathlib.Logic.Nontrivial.Basic
-import Mathlib.Data.Int.Cast.Defs
-import Mathlib.Algebra.Hom.Equiv.Basic
+import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Algebra.GroupWithZero.InjSurj
+import Mathlib.Data.Int.Cast.Defs
+import Mathlib.Logic.Nontrivial.Basic
#align_import algebra.group.ulift from "leanprover-community/mathlib"@"564bcc44d2b394a50c0cd6340c14a6b02a50a99a"
@@ -3,6 +3,7 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
+import Mathlib.Logic.Nontrivial.Basic
import Mathlib.Data.Int.Cast.Defs
import Mathlib.Algebra.Hom.Equiv.Basic
import Mathlib.Algebra.GroupWithZero.InjSurj
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -22,7 +22,7 @@ We also provide `MulEquiv.ulift : ULift R ≃* R` (and its additive analogue).
universe u v
-variable {α : Type u} {β : Type _} {x y : ULift.{v} α}
+variable {α : Type u} {β : Type*} {x y : ULift.{v} α}
namespace ULift
@@ -2,16 +2,13 @@
Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module algebra.group.ulift
-! leanprover-community/mathlib commit 564bcc44d2b394a50c0cd6340c14a6b02a50a99a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Int.Cast.Defs
import Mathlib.Algebra.Hom.Equiv.Basic
import Mathlib.Algebra.GroupWithZero.InjSurj
+#align_import algebra.group.ulift from "leanprover-community/mathlib"@"564bcc44d2b394a50c0cd6340c14a6b02a50a99a"
+
/-!
# `ULift` instances for groups and monoids
to_additive
(#3632)
applyReplacementFun
now treats applications f x_1 ... x_n
as atomic, and recurses directly into f
and x_i
(before it recursed on the partial appliations f x_1 ... x_j
)to_additive
reorders arguments, so at the same time I also made it more flexible. We can now reorder with an arbitrary permutation, and you have to specify this by providing a permutation using cycle notation (e.g. (reorder := 1 2 3, 8 9)
means we're permuting the first three arguments and swapping arguments 8 and 9). This implements the first item of #1074.additiveTest
now memorizes the test on previously-visited subexpressions. Thanks to @kmill for this suggestion!The performance on (one of) the slowest declaration(s) to additivize (MonoidLocalization.lift
) is summarized below (note: dsimp only
refers to adding a single dsimp only
tactic in the declaration, which was done in #3580)
original: 27400ms
better applyReplacementFun: 1550ms
better applyReplacementFun + better additiveTest: 176ms
dsimp only: 6710ms
better applyReplacementFun + dsimp only: 425ms
better applyReplacementFun + better additiveTest + dsimp only: 128ms
@@ -89,12 +89,12 @@ theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a
#align ulift.smul_down ULift.smul_down
#align ulift.vadd_down ULift.vadd_down
-@[to_additive existing (reorder := 1) smul]
+@[to_additive existing (reorder := 1 2) smul]
instance pow [Pow α β] : Pow (ULift α) β :=
⟨fun x n => up (x.down ^ n)⟩
#align ulift.has_pow ULift.pow
-@[to_additive existing (attr := simp) (reorder := 1) smul_down]
+@[to_additive existing (attr := simp) (reorder := 1 2) smul_down]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b :=
rfl
#align ulift.pow_down ULift.pow_down
_root_
(#3630)
Mathport doesn't understand this, and apparently nor do many of the humans fixing the errors it creates.
If your #align
statement complains the def doesn't exist, don't change the #align; work out why it doesn't exist instead.
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@@ -101,11 +101,10 @@ theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down
/-- The multiplicative equivalence between `ULift α` and `α`.
-/
--- porting note: below errors: to_additive: can't transport `ULift.MulEquiv.ulift` to itself.
--- @[to_additive "The additive equivalence between `ULift α` and `α`."]
-def MulEquiv.ulift [Mul α] : ULift α ≃* α :=
+@[to_additive "The additive equivalence between `ULift α` and `α`."]
+def _root_.MulEquiv.ulift [Mul α] : ULift α ≃* α :=
{ Equiv.ulift with map_mul' := fun _ _ => rfl }
-#align mul_equiv.ulift ULift.MulEquiv.ulift
+#align mul_equiv.ulift MulEquiv.ulift
-- porting notes: below failed due to error above, manually added
--@[to_additive]
algebra.group.ulift
: this is a change that was already backported in leanprover-community/mathlib#18268 to match mathlib4, only the SHA needs to be updated.
set_theory.cardinal.basic
: the changes from leanprover-community/mathlib#18771 were already forward-ported in #3343, but the sha was not updated. Here I've also inlined all by
s and generally tidied up the formatting.
order.rel_iso.basic
(leanprover-community/mathlib#18699, leanprover-community/mathlib#18758) is now fully forward-ported too.
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
! This file was ported from Lean 3 source module algebra.group.ulift
-! leanprover-community/mathlib commit 13e18cfa070ea337ea960176414f5ae3a1534aae
+! leanprover-community/mathlib commit 564bcc44d2b394a50c0cd6340c14a6b02a50a99a
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
ulift
field instances (#2911)
Match https://github.com/leanprover-community/mathlib/pull/18590 and https://github.com/leanprover-community/mathlib/pull/18596
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
! This file was ported from Lean 3 source module algebra.group.ulift
-! leanprover-community/mathlib commit 655994e298904d7e5bbd1e18c95defd7b543eb94
+! leanprover-community/mathlib commit 13e18cfa070ea337ea960176414f5ae3a1534aae
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -140,6 +140,37 @@ instance monoid [Monoid α] : Monoid (ULift α) :=
#align ulift.monoid ULift.monoid
#align ulift.add_monoid ULift.addMonoid
+@[to_additive]
+instance commMonoid [CommMonoid α] : CommMonoid (ULift α) :=
+ Equiv.ulift.injective.commMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl
+#align ulift.comm_monoid ULift.commMonoid
+#align ulift.add_comm_monoid ULift.addCommMonoid
+
+instance natCast [NatCast α] : NatCast (ULift α) := ⟨λ a ↦ up a⟩
+#align ulift.has_nat_cast ULift.natCast
+instance intCast [IntCast α] : IntCast (ULift α) := ⟨λ a ↦ up a⟩
+#align ulift.has_int_cast ULift.intCast
+
+@[simp, norm_cast]
+theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n :=
+ rfl
+#align ulift.up_nat_cast ULift.up_natCast
+
+@[simp, norm_cast]
+theorem up_intCast [IntCast α] (n : ℤ) : up (n : α) = n :=
+ rfl
+#align ulift.up_int_cast ULift.up_intCast
+
+@[simp, norm_cast]
+theorem down_natCast [NatCast α] (n : ℕ) : down (n : ULift α) = n :=
+ rfl
+#align ulift.down_nat_cast ULift.down_natCast
+
+@[simp, norm_cast]
+theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n :=
+ rfl
+#align ulift.down_int_cast ULift.down_intCast
+
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
{ ULift.one, ULift.addMonoid with
natCast := fun n => ⟨n⟩
@@ -147,16 +178,9 @@ instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (ULift α) :=
natCast_succ := fun _ => congr_arg ULift.up (Nat.cast_succ _) }
#align ulift.add_monoid_with_one ULift.addMonoidWithOne
-@[simp]
-theorem nat_cast_down [AddMonoidWithOne α] (n : ℕ) : (n : ULift α).down = n :=
- rfl
-#align ulift.nat_cast_down ULift.nat_cast_down
-
-@[to_additive]
-instance commMonoid [CommMonoid α] : CommMonoid (ULift α) :=
- Equiv.ulift.injective.commMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl
-#align ulift.comm_monoid ULift.commMonoid
-#align ulift.add_comm_monoid ULift.addCommMonoid
+instance addCommMonoidWithOne [AddCommMonoidWithOne α] : AddCommMonoidWithOne (ULift α) :=
+ { ULift.addMonoidWithOne, ULift.addCommMonoid with }
+#align ulift.add_comm_monoid_with_one ULift.addCommMonoidWithOne
instance monoidWithZero [MonoidWithZero α] : MonoidWithZero (ULift α) :=
Equiv.ulift.injective.monoidWithZero _ rfl rfl (fun _ _ => rfl) fun _ _ => rfl
@@ -180,6 +204,13 @@ instance group [Group α] : Group (ULift α) :=
#align ulift.group ULift.group
#align ulift.add_group ULift.addGroup
+@[to_additive]
+instance commGroup [CommGroup α] : CommGroup (ULift α) :=
+ Equiv.ulift.injective.commGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
+ (fun _ _ => rfl) fun _ _ => rfl
+#align ulift.comm_group ULift.commGroup
+#align ulift.add_comm_group ULift.addCommGroup
+
instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
{ ULift.addMonoidWithOne, ULift.addGroup with
intCast := fun n => ⟨n⟩,
@@ -187,17 +218,9 @@ instance addGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (ULift α) :=
intCast_negSucc := fun _ => congr_arg ULift.up (Int.cast_negSucc _) }
#align ulift.add_group_with_one ULift.addGroupWithOne
-@[simp]
-theorem int_cast_down [AddGroupWithOne α] (n : ℤ) : (n : ULift α).down = n :=
- rfl
-#align ulift.int_cast_down ULift.int_cast_down
-
-@[to_additive]
-instance commGroup [CommGroup α] : CommGroup (ULift α) :=
- Equiv.ulift.injective.commGroup _ rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
- (fun _ _ => rfl) fun _ _ => rfl
-#align ulift.comm_group ULift.commGroup
-#align ulift.add_comm_group ULift.addCommGroup
+instance addCommGroupWithOne [AddCommGroupWithOne α] : AddCommGroupWithOne (ULift α) :=
+ { ULift.addGroupWithOne, ULift.addCommGroup with }
+#align ulift.add_comm_group_with_one ULift.addCommGroupWithOne
instance groupWithZero [GroupWithZero α] : GroupWithZero (ULift α) :=
Equiv.ulift.injective.groupWithZero _ rfl rfl (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
@@ -89,12 +89,12 @@ theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a
#align ulift.smul_down ULift.smul_down
#align ulift.vadd_down ULift.vadd_down
-@[to_additive (reorder := 1) smul]
+@[to_additive existing (reorder := 1) smul]
instance pow [Pow α β] : Pow (ULift α) β :=
⟨fun x n => up (x.down ^ n)⟩
#align ulift.has_pow ULift.pow
-@[to_additive (attr := simp) (reorder := 1) smul_down]
+@[to_additive existing (attr := simp) (reorder := 1) smul_down]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b :=
rfl
#align ulift.pow_down ULift.pow_down
smul
in #715, but that was a bad decisionsmul
now use nsmul
. This doesn't raise an error unless they are aligned or explicitly used elsewhere.smul
to nsmul
.Co-authored-by: Reid Barton <rwbarton@gmail.com>
@@ -89,12 +89,12 @@ theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a
#align ulift.smul_down ULift.smul_down
#align ulift.vadd_down ULift.vadd_down
-@[to_additive (reorder := 1)]
+@[to_additive (reorder := 1) smul]
instance pow [Pow α β] : Pow (ULift α) β :=
⟨fun x n => up (x.down ^ n)⟩
#align ulift.has_pow ULift.pow
-@[to_additive (attr := simp) (reorder := 1)]
+@[to_additive (attr := simp) (reorder := 1) smul_down]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b :=
rfl
#align ulift.pow_down ULift.pow_down
@@ -112,11 +112,10 @@ def MulEquiv.ulift [Mul α] : ULift α ≃* α :=
instance semigroup [Semigroup α] : Semigroup (ULift α) :=
(MulEquiv.ulift.injective.semigroup _) fun _ _ => rfl
#align ulift.semigroup ULift.semigroup
-#align ulift.add_semigroup ULift.semigroup
instance addSemigroup [AddSemigroup α] : AddSemigroup (ULift α) :=
(Equiv.ulift.injective.addSemigroup _) fun _ _ => rfl
-#align add_semigroup.ulift ULift.addSemigroup
+#align ulift.add_semigroup ULift.addSemigroup
@[to_additive]
@@ -244,7 +243,7 @@ instance cancelMonoid [CancelMonoid α] : CancelMonoid (ULift α) :=
instance cancelCommMonoid [CancelCommMonoid α] : CancelCommMonoid (ULift α) :=
Equiv.ulift.injective.cancelCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl
#align ulift.cancel_comm_monoid ULift.cancelCommMonoid
-#align ulift.add_cancel_comm_monoid ULift.addCancelMonoid
+#align ulift.add_cancel_comm_monoid ULift.addCancelCommMonoid
instance nontrivial [Nontrivial α] : Nontrivial (ULift α) :=
Equiv.ulift.symm.injective.nontrivial
to_additive
is @[to_additive (attrs := simp, ext, simps)]
simp
and simps
attributes to the to_additive
-dictionary.simp
-attributes). In particular it's possible that norm_cast
might generate some auxiliary declarations.to_additive
and simps
from the Simps
file to the toAdditive
file for uniformity.@[reassoc]
Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -35,7 +35,7 @@ instance one [One α] : One (ULift α) :=
#align ulift.has_one ULift.one
#align ulift.has_zero ULift.zero
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem one_down [One α] : (1 : ULift α).down = 1 :=
rfl
#align ulift.one_down ULift.one_down
@@ -47,7 +47,7 @@ instance mul [Mul α] : Mul (ULift α) :=
#align ulift.has_mul ULift.mul
#align ulift.has_add ULift.add
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem mul_down [Mul α] : (x * y).down = x.down * y.down :=
rfl
#align ulift.mul_down ULift.mul_down
@@ -59,7 +59,7 @@ instance div [Div α] : Div (ULift α) :=
#align ulift.has_div ULift.div
#align ulift.has_sub ULift.sub
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem div_down [Div α] : (x / y).down = x.down / y.down :=
rfl
#align ulift.div_down ULift.div_down
@@ -71,7 +71,7 @@ instance inv [Inv α] : Inv (ULift α) :=
#align ulift.has_inv ULift.inv
#align ulift.has_neg ULift.neg
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem inv_down [Inv α] : x⁻¹.down = x.down⁻¹ :=
rfl
#align ulift.inv_down ULift.inv_down
@@ -83,7 +83,7 @@ instance smul [SMul α β] : SMul α (ULift β) :=
#align ulift.has_smul ULift.smul
#align ulift.has_vadd ULift.vadd
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem smul_down [SMul α β] (a : α) (b : ULift.{v} β) : (a • b).down = a • b.down :=
rfl
#align ulift.smul_down ULift.smul_down
@@ -94,7 +94,7 @@ instance pow [Pow α β] : Pow (ULift α) β :=
⟨fun x n => up (x.down ^ n)⟩
#align ulift.has_pow ULift.pow
-@[simp, to_additive (reorder := 1)]
+@[to_additive (attr := simp) (reorder := 1)]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b :=
rfl
#align ulift.pow_down ULift.pow_down
Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2
, add_monoid_hom --> AddMonoidHom
Remove \n
from to_additive
docstrings that were inserted by mathport.
Move files and directories with Gcd
and Smul
to GCD
and SMul
@@ -19,7 +19,7 @@ This file defines instances for group, monoid, semigroup and related structures
(Recall `ULift α` is just a "copy" of a type `α` in a higher universe.)
-We also provide `ULift.mul_equiv : ULift R ≃* R` (and its additive analogue).
+We also provide `MulEquiv.ulift : ULift R ≃* R` (and its additive analogue).
-/
@@ -101,7 +101,7 @@ theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down
/-- The multiplicative equivalence between `ULift α` and `α`.
-/
--- porting note: below errors: to_additive: can't transport ULift.MulEquiv.ulift to itself.
+-- porting note: below errors: to_additive: can't transport `ULift.MulEquiv.ulift` to itself.
-- @[to_additive "The additive equivalence between `ULift α` and `α`."]
def MulEquiv.ulift [Mul α] : ULift α ≃* α :=
{ Equiv.ulift with map_mul' := fun _ _ => rfl }
@@ -127,12 +127,12 @@ instance commSemigroup [CommSemigroup α] : CommSemigroup (ULift α) :=
@[to_additive]
instance mulOneClass [MulOneClass α] : MulOneClass (ULift α) :=
- (Equiv.ulift.injective.mulOneClass _ rfl) fun _ _ => rfl
+ Equiv.ulift.injective.mulOneClass _ rfl (by intros; rfl)
#align ulift.mul_one_class ULift.mulOneClass
#align ulift.add_zero_class ULift.addZeroClass
instance mulZeroOneClass [MulZeroOneClass α] : MulZeroOneClass (ULift α) :=
- (Equiv.ulift.injective.mulZeroOneClass _ rfl rfl) fun _ _ => rfl
+ Equiv.ulift.injective.mulZeroOneClass _ rfl rfl (by intros; rfl)
#align ulift.mul_zero_one_class ULift.mulZeroOneClass
@[to_additive]
The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md
@@ -2,6 +2,11 @@
Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
+
+! This file was ported from Lean 3 source module algebra.group.ulift
+! leanprover-community/mathlib commit 655994e298904d7e5bbd1e18c95defd7b543eb94
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Data.Int.Cast.Defs
import Mathlib.Algebra.Hom.Equiv.Basic
All dependencies are ported!