group_theory.divisibleMathlib.GroupTheory.Divisible

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -5,7 +5,7 @@ Authors: Jujian Zhang
 -/
 import GroupTheory.Subgroup.Pointwise
 import GroupTheory.QuotientGroup
-import Algebra.Group.Pi
+import Algebra.Group.Pi.Lemmas
 
 #align_import group_theory.divisible from "leanprover-community/mathlib"@"b6da1a0b3e7cd83b1f744c49ce48ef8c6307d2f6"
 
@@ -216,7 +216,7 @@ instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [
   div q n := q / n
   div_zero q := by norm_num
   div_cancel n q hn := by
-    rw [zsmul_eq_mul, (Int.cast_commute n _).Eq, div_mul_cancel q (int.cast_ne_zero.mpr hn)]
+    rw [zsmul_eq_mul, (Int.cast_commute n _).Eq, div_mul_cancel₀ q (int.cast_ne_zero.mpr hn)]
 #align divisible_by_int_of_char_zero divisibleByIntOfCharZero
 -/
 
Diff
@@ -241,7 +241,7 @@ def rootableByIntOfRootableByNat [RootableBy A ℕ] : RootableBy A ℤ
     · change RootableBy.root a _ ^ _ = a
       norm_num
       rw [RootableBy.root_cancel]
-      rw [Int.ofNat_eq_coe] at hn 
+      rw [Int.ofNat_eq_coe] at hn
       exact_mod_cast hn
     · change (RootableBy.root a _)⁻¹ ^ _ = a
       norm_num
@@ -263,7 +263,7 @@ def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ
   root_cancel n a hn :=
     by
     have := RootableBy.root_cancel a (show (n : ℤ) ≠ 0 by exact_mod_cast hn)
-    norm_num at this 
+    norm_num at this
     exact this
 #align group.rootable_by_nat_of_rootable_by_int Group.rootableByNatOfRootableByInt
 #align add_group.divisible_by_nat_of_divisible_by_int AddGroup.divisibleByNatOfDivisibleByInt
Diff
@@ -132,8 +132,11 @@ noncomputable def rootableByOfPowLeftSurj
     (H : ∀ {n : α}, n ≠ 0 → Function.Surjective (fun a => a ^ n : A → A)) : RootableBy A α
     where
   root a n := @dite _ (n = 0) (Classical.dec _) (fun _ => (1 : A)) fun hn => (H hn a).some
-  root_zero _ := by classical
-  root_cancel n a hn := by classical
+  root_zero _ := by classical exact dif_pos rfl
+  root_cancel n a hn := by
+    classical
+    rw [dif_neg hn]
+    exact (H hn a).choose_spec
 #align rootable_by_of_pow_left_surj rootableByOfPowLeftSurj
 #align divisible_by_of_smul_right_surj divisibleByOfSMulRightSurj
 -/
Diff
@@ -132,11 +132,8 @@ noncomputable def rootableByOfPowLeftSurj
     (H : ∀ {n : α}, n ≠ 0 → Function.Surjective (fun a => a ^ n : A → A)) : RootableBy A α
     where
   root a n := @dite _ (n = 0) (Classical.dec _) (fun _ => (1 : A)) fun hn => (H hn a).some
-  root_zero _ := by classical exact dif_pos rfl
-  root_cancel n a hn := by
-    classical
-    rw [dif_neg hn]
-    exact (H hn a).choose_spec
+  root_zero _ := by classical
+  root_cancel n a hn := by classical
 #align rootable_by_of_pow_left_surj rootableByOfPowLeftSurj
 #align divisible_by_of_smul_right_surj divisibleByOfSMulRightSurj
 -/
Diff
@@ -192,10 +192,10 @@ theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n
 #align add_comm_group.smul_top_eq_top_of_divisible_by_int AddCommGroup.smul_top_eq_top_of_divisibleBy_int
 -/
 
-#print AddCommGroup.divisibleByIntOfSmulTopEqTop /-
+#print AddCommGroup.divisibleByIntOfSMulTopEqTop /-
 /-- If for all `n ≠ 0 ∈ ℤ`, `n • A = A`, then `A` is divisible.
 -/
-noncomputable def divisibleByIntOfSmulTopEqTop
+noncomputable def divisibleByIntOfSMulTopEqTop
     (H : ∀ {n : ℤ} (hn : n ≠ 0), n • (⊤ : AddSubgroup A) = ⊤) : DivisibleBy A ℤ
     where
   div a n :=
@@ -205,7 +205,7 @@ noncomputable def divisibleByIntOfSmulTopEqTop
     rw [dif_neg hn]
     generalize_proofs h1
     exact h1.some_spec.2
-#align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSmulTopEqTop
+#align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSMulTopEqTop
 -/
 
 end AddCommGroup
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jujian Zhang
 -/
-import Mathbin.GroupTheory.Subgroup.Pointwise
-import Mathbin.GroupTheory.QuotientGroup
-import Mathbin.Algebra.Group.Pi
+import GroupTheory.Subgroup.Pointwise
+import GroupTheory.QuotientGroup
+import Algebra.Group.Pi
 
 #align_import group_theory.divisible from "leanprover-community/mathlib"@"b6da1a0b3e7cd83b1f744c49ce48ef8c6307d2f6"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Jujian Zhang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jujian Zhang
-
-! This file was ported from Lean 3 source module group_theory.divisible
-! leanprover-community/mathlib commit b6da1a0b3e7cd83b1f744c49ce48ef8c6307d2f6
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.GroupTheory.Subgroup.Pointwise
 import Mathbin.GroupTheory.QuotientGroup
 import Mathbin.Algebra.Group.Pi
 
+#align_import group_theory.divisible from "leanprover-community/mathlib"@"b6da1a0b3e7cd83b1f744c49ce48ef8c6307d2f6"
+
 /-!
 # Divisible Group and rootable group
 
Diff
@@ -115,12 +115,14 @@ class RootableBy where
 #align divisible_by DivisibleBy
 -/
 
+#print pow_left_surj_of_rootableBy /-
 @[to_additive smul_right_surj_of_divisibleBy]
 theorem pow_left_surj_of_rootableBy [RootableBy A α] {n : α} (hn : n ≠ 0) :
     Function.Surjective (fun a => pow a n : A → A) := fun x =>
   ⟨RootableBy.root x n, RootableBy.root_cancel _ hn⟩
 #align pow_left_surj_of_rootable_by pow_left_surj_of_rootableBy
 #align smul_right_surj_of_divisible_by smul_right_surj_of_divisibleBy
+-/
 
 #print rootableByOfPowLeftSurj /-
 /--
@@ -167,6 +169,7 @@ variable {β B B' : Type _} [Pow B β] [Pow B' β]
 
 variable [Zero β] [Monoid B] [Monoid B'] [RootableBy B β] [RootableBy B' β]
 
+#print Prod.rootableBy /-
 @[to_additive]
 instance Prod.rootableBy : RootableBy (B × B') β
     where
@@ -175,6 +178,7 @@ instance Prod.rootableBy : RootableBy (B × B') β
   root_cancel n p hn := Prod.ext (RootableBy.root_cancel _ hn) (RootableBy.root_cancel _ hn)
 #align prod.rootable_by Prod.rootableBy
 #align prod.divisible_by Prod.divisibleBy
+-/
 
 end Prod
 
@@ -184,11 +188,14 @@ namespace AddCommGroup
 
 variable (A : Type _) [AddCommGroup A]
 
+#print AddCommGroup.smul_top_eq_top_of_divisibleBy_int /-
 theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n ≠ 0) :
     n • (⊤ : AddSubgroup A) = ⊤ :=
   AddSubgroup.map_top_of_surjective _ fun a => ⟨DivisibleBy.div a n, DivisibleBy.div_cancel _ hn⟩
 #align add_comm_group.smul_top_eq_top_of_divisible_by_int AddCommGroup.smul_top_eq_top_of_divisibleBy_int
+-/
 
+#print AddCommGroup.divisibleByIntOfSmulTopEqTop /-
 /-- If for all `n ≠ 0 ∈ ℤ`, `n • A = A`, then `A` is divisible.
 -/
 noncomputable def divisibleByIntOfSmulTopEqTop
@@ -202,9 +209,11 @@ noncomputable def divisibleByIntOfSmulTopEqTop
     generalize_proofs h1
     exact h1.some_spec.2
 #align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSmulTopEqTop
+-/
 
 end AddCommGroup
 
+#print divisibleByIntOfCharZero /-
 instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [CharZero 𝕜] :
     DivisibleBy 𝕜 ℤ where
   div q n := q / n
@@ -212,6 +221,7 @@ instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [
   div_cancel n q hn := by
     rw [zsmul_eq_mul, (Int.cast_commute n _).Eq, div_mul_cancel q (int.cast_ne_zero.mpr hn)]
 #align divisible_by_int_of_char_zero divisibleByIntOfCharZero
+-/
 
 namespace Group
 
@@ -286,12 +296,14 @@ noncomputable def Function.Surjective.rootableBy (hf : Function.Surjective f)
 #align function.surjective.rootable_by Function.Surjective.rootableByₓ
 #align function.surjective.divisible_by Function.Surjective.divisibleByₓ
 
+#print RootableBy.surjective_pow /-
 @[to_additive DivisibleBy.surjective_smul]
 theorem RootableBy.surjective_pow (A α : Type _) [Monoid A] [Pow A α] [Zero α] [RootableBy A α]
     {n : α} (hn : n ≠ 0) : Function.Surjective fun a : A => a ^ n := fun a =>
   ⟨RootableBy.root a n, RootableBy.root_cancel a hn⟩
 #align rootable_by.surjective_pow RootableBy.surjective_pow
 #align divisible_by.surjective_smul DivisibleBy.surjective_smul
+-/
 
 end Hom
 
Diff
@@ -136,8 +136,8 @@ noncomputable def rootableByOfPowLeftSurj
   root_zero _ := by classical exact dif_pos rfl
   root_cancel n a hn := by
     classical
-      rw [dif_neg hn]
-      exact (H hn a).choose_spec
+    rw [dif_neg hn]
+    exact (H hn a).choose_spec
 #align rootable_by_of_pow_left_surj rootableByOfPowLeftSurj
 #align divisible_by_of_smul_right_surj divisibleByOfSMulRightSurj
 -/
Diff
@@ -234,7 +234,7 @@ def rootableByIntOfRootableByNat [RootableBy A ℕ] : RootableBy A ℤ
     · change RootableBy.root a _ ^ _ = a
       norm_num
       rw [RootableBy.root_cancel]
-      rw [Int.ofNat_eq_coe] at hn
+      rw [Int.ofNat_eq_coe] at hn 
       exact_mod_cast hn
     · change (RootableBy.root a _)⁻¹ ^ _ = a
       norm_num
@@ -256,7 +256,7 @@ def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ
   root_cancel n a hn :=
     by
     have := RootableBy.root_cancel a (show (n : ℤ) ≠ 0 by exact_mod_cast hn)
-    norm_num at this
+    norm_num at this 
     exact this
 #align group.rootable_by_nat_of_rootable_by_int Group.rootableByNatOfRootableByInt
 #align add_group.divisible_by_nat_of_divisible_by_int AddGroup.divisibleByNatOfDivisibleByInt
Diff
@@ -74,7 +74,7 @@ TODO: Show that divisibility implies injectivity in the category of `AddCommGrou
 -/
 
 
-open Pointwise
+open scoped Pointwise
 
 section AddMonoid
 
Diff
@@ -115,12 +115,6 @@ class RootableBy where
 #align divisible_by DivisibleBy
 -/
 
-/- warning: pow_left_surj_of_rootable_by -> pow_left_surj_of_rootableBy is a dubious translation:
-lean 3 declaration is
-  forall (A : Type.{u1}) (α : Type.{u2}) [_inst_1 : Monoid.{u1} A] [_inst_2 : Pow.{u1, u2} A α] [_inst_3 : Zero.{u2} α] [_inst_4 : RootableBy.{u1, u2} A α _inst_1 _inst_2 _inst_3] {n : α}, (Ne.{succ u2} α n (OfNat.ofNat.{u2} α 0 (OfNat.mk.{u2} α 0 (Zero.zero.{u2} α _inst_3)))) -> (Function.Surjective.{succ u1, succ u1} A A (fun (a : A) => HPow.hPow.{u1, u2, u1} A α A (instHPow.{u1, u2} A α _inst_2) a n))
-but is expected to have type
-  forall (A : Type.{u2}) (α : Type.{u1}) [_inst_1 : Monoid.{u2} A] [_inst_2 : Pow.{u2, u1} A α] [_inst_3 : Zero.{u1} α] [_inst_4 : RootableBy.{u2, u1} A α _inst_1 _inst_2 _inst_3] {n : α}, (Ne.{succ u1} α n (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_3))) -> (Function.Surjective.{succ u2, succ u2} A A (fun (a : A) => HPow.hPow.{u2, u1, u2} A α A (instHPow.{u2, u1} A α _inst_2) a n))
-Case conversion may be inaccurate. Consider using '#align pow_left_surj_of_rootable_by pow_left_surj_of_rootableByₓ'. -/
 @[to_additive smul_right_surj_of_divisibleBy]
 theorem pow_left_surj_of_rootableBy [RootableBy A α] {n : α} (hn : n ≠ 0) :
     Function.Surjective (fun a => pow a n : A → A) := fun x =>
@@ -173,12 +167,6 @@ variable {β B B' : Type _} [Pow B β] [Pow B' β]
 
 variable [Zero β] [Monoid B] [Monoid B'] [RootableBy B β] [RootableBy B' β]
 
-/- warning: prod.rootable_by -> Prod.rootableBy is a dubious translation:
-lean 3 declaration is
-  forall {β : Type.{u1}} {B : Type.{u2}} {B' : Type.{u3}} [_inst_4 : Pow.{u2, u1} B β] [_inst_5 : Pow.{u3, u1} B' β] [_inst_6 : Zero.{u1} β] [_inst_7 : Monoid.{u2} B] [_inst_8 : Monoid.{u3} B'] [_inst_9 : RootableBy.{u2, u1} B β _inst_7 _inst_4 _inst_6] [_inst_10 : RootableBy.{u3, u1} B' β _inst_8 _inst_5 _inst_6], RootableBy.{max u2 u3, u1} (Prod.{u2, u3} B B') β (Prod.monoid.{u2, u3} B B' _inst_7 _inst_8) (Prod.pow.{u1, u2, u3} β B B' _inst_4 _inst_5) _inst_6
-but is expected to have type
-  forall {β : Type.{u1}} {B : Type.{u2}} {B' : Type.{u3}} [_inst_4 : Pow.{u2, u1} B β] [_inst_5 : Pow.{u3, u1} B' β] [_inst_6 : Zero.{u1} β] [_inst_7 : Monoid.{u2} B] [_inst_8 : Monoid.{u3} B'] [_inst_9 : RootableBy.{u2, u1} B β _inst_7 _inst_4 _inst_6] [_inst_10 : RootableBy.{u3, u1} B' β _inst_8 _inst_5 _inst_6], RootableBy.{max u3 u2, u1} (Prod.{u2, u3} B B') β (Prod.instMonoidProd.{u2, u3} B B' _inst_7 _inst_8) (Prod.pow.{u1, u2, u3} β B B' _inst_4 _inst_5) _inst_6
-Case conversion may be inaccurate. Consider using '#align prod.rootable_by Prod.rootableByₓ'. -/
 @[to_additive]
 instance Prod.rootableBy : RootableBy (B × B') β
     where
@@ -196,23 +184,11 @@ namespace AddCommGroup
 
 variable (A : Type _) [AddCommGroup A]
 
-/- warning: add_comm_group.smul_top_eq_top_of_divisible_by_int -> AddCommGroup.smul_top_eq_top_of_divisibleBy_int is a dubious translation:
-lean 3 declaration is
-  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A] [_inst_2 : DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) Int.hasZero] {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero)))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (SMul.smul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toHasSmul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (Module.toDistribMulAction.{0, u1} Int A Int.semiring (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1)))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))
-but is expected to have type
-  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A] [_inst_2 : DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))))] {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (instOfNatInt 0))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (HSMul.hSMul.{0, u1, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (instHSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) Int.instMonoidInt (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) Int.instMonoidInt (Module.toDistribMulAction.{0, u1} Int A (CommSemiring.toSemiring.{0} Int (CommRing.toCommSemiring.{0} Int Int.instCommRingInt)) (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1))))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))
-Case conversion may be inaccurate. Consider using '#align add_comm_group.smul_top_eq_top_of_divisible_by_int AddCommGroup.smul_top_eq_top_of_divisibleBy_intₓ'. -/
 theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n ≠ 0) :
     n • (⊤ : AddSubgroup A) = ⊤ :=
   AddSubgroup.map_top_of_surjective _ fun a => ⟨DivisibleBy.div a n, DivisibleBy.div_cancel _ hn⟩
 #align add_comm_group.smul_top_eq_top_of_divisible_by_int AddCommGroup.smul_top_eq_top_of_divisibleBy_int
 
-/- warning: add_comm_group.divisible_by_int_of_smul_top_eq_top -> AddCommGroup.divisibleByIntOfSmulTopEqTop is a dubious translation:
-lean 3 declaration is
-  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A], (forall {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero)))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (SMul.smul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toHasSmul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (Module.toDistribMulAction.{0, u1} Int A Int.semiring (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1)))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))) -> (DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) Int.hasZero)
-but is expected to have type
-  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A], (forall {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (instOfNatInt 0))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (HSMul.hSMul.{0, u1, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (instHSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) Int.instMonoidInt (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) Int.instMonoidInt (Module.toDistribMulAction.{0, u1} Int A (CommSemiring.toSemiring.{0} Int (CommRing.toCommSemiring.{0} Int Int.instCommRingInt)) (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1))))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))) -> (DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))
-Case conversion may be inaccurate. Consider using '#align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSmulTopEqTopₓ'. -/
 /-- If for all `n ≠ 0 ∈ ℤ`, `n • A = A`, then `A` is divisible.
 -/
 noncomputable def divisibleByIntOfSmulTopEqTop
@@ -229,12 +205,6 @@ noncomputable def divisibleByIntOfSmulTopEqTop
 
 end AddCommGroup
 
-/- warning: divisible_by_int_of_char_zero -> divisibleByIntOfCharZero is a dubious translation:
-lean 3 declaration is
-  forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (AddCommGroupWithOne.toAddGroupWithOne.{u1} 𝕜 (Ring.toAddCommGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (AddCommGroupWithOne.toAddGroupWithOne.{u1} 𝕜 (Ring.toAddCommGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (AddCommGroupWithOne.toAddGroupWithOne.{u1} 𝕜 (Ring.toAddCommGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))))) Int.hasZero
-but is expected to have type
-  forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))))
-Case conversion may be inaccurate. Consider using '#align divisible_by_int_of_char_zero divisibleByIntOfCharZeroₓ'. -/
 instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [CharZero 𝕜] :
     DivisibleBy 𝕜 ℤ where
   div q n := q / n
@@ -316,12 +286,6 @@ noncomputable def Function.Surjective.rootableBy (hf : Function.Surjective f)
 #align function.surjective.rootable_by Function.Surjective.rootableByₓ
 #align function.surjective.divisible_by Function.Surjective.divisibleByₓ
 
-/- warning: rootable_by.surjective_pow -> RootableBy.surjective_pow is a dubious translation:
-lean 3 declaration is
-  forall (A : Type.{u1}) (α : Type.{u2}) [_inst_7 : Monoid.{u1} A] [_inst_8 : Pow.{u1, u2} A α] [_inst_9 : Zero.{u2} α] [_inst_10 : RootableBy.{u1, u2} A α _inst_7 _inst_8 _inst_9] {n : α}, (Ne.{succ u2} α n (OfNat.ofNat.{u2} α 0 (OfNat.mk.{u2} α 0 (Zero.zero.{u2} α _inst_9)))) -> (Function.Surjective.{succ u1, succ u1} A A (fun (a : A) => HPow.hPow.{u1, u2, u1} A α A (instHPow.{u1, u2} A α _inst_8) a n))
-but is expected to have type
-  forall (A : Type.{u2}) (α : Type.{u1}) [_inst_7 : Monoid.{u2} A] [_inst_8 : Pow.{u2, u1} A α] [_inst_9 : Zero.{u1} α] [_inst_10 : RootableBy.{u2, u1} A α _inst_7 _inst_8 _inst_9] {n : α}, (Ne.{succ u1} α n (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_9))) -> (Function.Surjective.{succ u2, succ u2} A A (fun (a : A) => HPow.hPow.{u2, u1, u2} A α A (instHPow.{u2, u1} A α _inst_8) a n))
-Case conversion may be inaccurate. Consider using '#align rootable_by.surjective_pow RootableBy.surjective_powₓ'. -/
 @[to_additive DivisibleBy.surjective_smul]
 theorem RootableBy.surjective_pow (A α : Type _) [Monoid A] [Pow A α] [Zero α] [RootableBy A α]
     {n : α} (hn : n ≠ 0) : Function.Surjective fun a : A => a ^ n := fun a =>
Diff
@@ -200,7 +200,7 @@ variable (A : Type _) [AddCommGroup A]
 lean 3 declaration is
   forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A] [_inst_2 : DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) Int.hasZero] {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero)))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (SMul.smul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toHasSmul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (Module.toDistribMulAction.{0, u1} Int A Int.semiring (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1)))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))
 but is expected to have type
-  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A] [_inst_2 : DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))))] {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (instOfNatInt 0))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (HSMul.hSMul.{0, u1, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (instHSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) Int.instMonoidInt (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) Int.instMonoidInt (Module.toDistribMulAction.{0, u1} Int A (Ring.toSemiring.{0} Int (CommRing.toRing.{0} Int Int.instCommRingInt)) (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1))))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))
+  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A] [_inst_2 : DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))))] {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (instOfNatInt 0))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (HSMul.hSMul.{0, u1, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (instHSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) Int.instMonoidInt (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) Int.instMonoidInt (Module.toDistribMulAction.{0, u1} Int A (CommSemiring.toSemiring.{0} Int (CommRing.toCommSemiring.{0} Int Int.instCommRingInt)) (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1))))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))
 Case conversion may be inaccurate. Consider using '#align add_comm_group.smul_top_eq_top_of_divisible_by_int AddCommGroup.smul_top_eq_top_of_divisibleBy_intₓ'. -/
 theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n ≠ 0) :
     n • (⊤ : AddSubgroup A) = ⊤ :=
@@ -211,7 +211,7 @@ theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n
 lean 3 declaration is
   forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A], (forall {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero)))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (SMul.smul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toHasSmul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) (MonoidWithZero.toMonoid.{0} Int (Semiring.toMonoidWithZero.{0} Int Int.semiring)) (Module.toDistribMulAction.{0, u1} Int A Int.semiring (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1)))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.hasTop.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))) -> (DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) Int.hasZero)
 but is expected to have type
-  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A], (forall {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (instOfNatInt 0))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (HSMul.hSMul.{0, u1, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (instHSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) Int.instMonoidInt (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) Int.instMonoidInt (Module.toDistribMulAction.{0, u1} Int A (Ring.toSemiring.{0} Int (CommRing.toRing.{0} Int Int.instCommRingInt)) (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1))))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))) -> (DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))
+  forall (A : Type.{u1}) [_inst_1 : AddCommGroup.{u1} A], (forall {n : Int}, (Ne.{1} Int n (OfNat.ofNat.{0} Int 0 (instOfNatInt 0))) -> (Eq.{succ u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (HSMul.hSMul.{0, u1, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (instHSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (MulAction.toSMul.{0, u1} Int (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) Int.instMonoidInt (AddSubgroup.pointwiseMulAction.{0, u1} Int A (AddCommGroup.toAddGroup.{u1} A _inst_1) Int.instMonoidInt (Module.toDistribMulAction.{0, u1} Int A (CommSemiring.toSemiring.{0} Int (CommRing.toCommSemiring.{0} Int Int.instCommRingInt)) (AddCommGroup.toAddCommMonoid.{u1} A _inst_1) (AddCommGroup.intModule.{u1} A _inst_1))))) n (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)))) (Top.top.{u1} (AddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1)) (AddSubgroup.instTopAddSubgroup.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))))) -> (DivisibleBy.{u1, 0} A Int (SubNegMonoid.toAddMonoid.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (SubNegMonoid.SMulInt.{u1} A (AddGroup.toSubNegMonoid.{u1} A (AddCommGroup.toAddGroup.{u1} A _inst_1))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))
 Case conversion may be inaccurate. Consider using '#align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSmulTopEqTopₓ'. -/
 /-- If for all `n ≠ 0 ∈ ℤ`, `n • A = A`, then `A` is divisible.
 -/
Diff
@@ -231,7 +231,7 @@ end AddCommGroup
 
 /- warning: divisible_by_int_of_char_zero -> divisibleByIntOfCharZero is a dubious translation:
 lean 3 declaration is
-  forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (NonAssocRing.toAddGroupWithOne.{u1} 𝕜 (Ring.toNonAssocRing.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (NonAssocRing.toAddGroupWithOne.{u1} 𝕜 (Ring.toNonAssocRing.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (NonAssocRing.toAddGroupWithOne.{u1} 𝕜 (Ring.toNonAssocRing.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))))) Int.hasZero
+  forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (AddCommGroupWithOne.toAddGroupWithOne.{u1} 𝕜 (Ring.toAddCommGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (AddCommGroupWithOne.toAddGroupWithOne.{u1} 𝕜 (Ring.toAddCommGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (AddCommGroupWithOne.toAddGroupWithOne.{u1} 𝕜 (Ring.toAddCommGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))))) Int.hasZero
 but is expected to have type
   forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))))
 Case conversion may be inaccurate. Consider using '#align divisible_by_int_of_char_zero divisibleByIntOfCharZeroₓ'. -/
Diff
@@ -229,7 +229,12 @@ noncomputable def divisibleByIntOfSmulTopEqTop
 
 end AddCommGroup
 
-#print divisibleByIntOfCharZero /-
+/- warning: divisible_by_int_of_char_zero -> divisibleByIntOfCharZero is a dubious translation:
+lean 3 declaration is
+  forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (NonAssocRing.toAddGroupWithOne.{u1} 𝕜 (Ring.toNonAssocRing.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (NonAssocRing.toAddGroupWithOne.{u1} 𝕜 (Ring.toNonAssocRing.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (NonAssocRing.toAddGroupWithOne.{u1} 𝕜 (Ring.toNonAssocRing.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))))) Int.hasZero
+but is expected to have type
+  forall {𝕜 : Type.{u1}} [_inst_1 : DivisionRing.{u1} 𝕜] [_inst_2 : CharZero.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))], DivisibleBy.{u1, 0} 𝕜 Int (AddMonoidWithOne.toAddMonoid.{u1} 𝕜 (AddGroupWithOne.toAddMonoidWithOne.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1)))) (SubNegMonoid.SMulInt.{u1} 𝕜 (AddGroup.toSubNegMonoid.{u1} 𝕜 (AddGroupWithOne.toAddGroup.{u1} 𝕜 (Ring.toAddGroupWithOne.{u1} 𝕜 (DivisionRing.toRing.{u1} 𝕜 _inst_1))))) (CommMonoidWithZero.toZero.{0} Int (CancelCommMonoidWithZero.toCommMonoidWithZero.{0} Int (IsDomain.toCancelCommMonoidWithZero.{0} Int Int.instCommSemiringInt (LinearOrderedRing.isDomain.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))))
+Case conversion may be inaccurate. Consider using '#align divisible_by_int_of_char_zero divisibleByIntOfCharZeroₓ'. -/
 instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [CharZero 𝕜] :
     DivisibleBy 𝕜 ℤ where
   div q n := q / n
@@ -237,7 +242,6 @@ instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [
   div_cancel n q hn := by
     rw [zsmul_eq_mul, (Int.cast_commute n _).Eq, div_mul_cancel q (int.cast_ne_zero.mpr hn)]
 #align divisible_by_int_of_char_zero divisibleByIntOfCharZero
--/
 
 namespace Group
 

Changes in mathlib4

mathlib3
mathlib4
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -201,7 +201,7 @@ instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [
   div q n := q / n
   div_zero q := by norm_num
   div_cancel {n} q hn := by
-    rw [zsmul_eq_mul, (Int.cast_commute n _).eq, div_mul_cancel q (Int.cast_ne_zero.mpr hn)]
+    rw [zsmul_eq_mul, (Int.cast_commute n _).eq, div_mul_cancel₀ q (Int.cast_ne_zero.mpr hn)]
 #align divisible_by_int_of_char_zero divisibleByIntOfCharZero
 
 namespace Group
chore: Rename zpow_coe_nat to zpow_natCast (#11528)

... and add a deprecated alias for the old name. This is mostly just me discovering the power of F2

Diff
@@ -240,7 +240,7 @@ def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ where
   root_zero a := RootableBy.root_zero a
   root_cancel {n} a hn := by
     -- Porting note: replaced `norm_num`
-    simpa only [zpow_coe_nat] using RootableBy.root_cancel a (show (n : ℤ) ≠ 0 from mod_cast hn)
+    simpa only [zpow_natCast] using RootableBy.root_cancel a (show (n : ℤ) ≠ 0 from mod_cast hn)
 #align group.rootable_by_nat_of_rootable_by_int Group.rootableByNatOfRootableByInt
 #align add_group.divisible_by_nat_of_divisible_by_int AddGroup.divisibleByNatOfDivisibleByInt
 
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -133,7 +133,6 @@ noncomputable def rootableByOfPowLeftSurj
 section Pi
 
 variable {ι β : Type*} (B : ι → Type*) [∀ i : ι, Pow (B i) β]
-
 variable [Zero β] [∀ i : ι, Monoid (B i)] [∀ i, RootableBy (B i) β]
 
 @[to_additive]
@@ -149,7 +148,6 @@ end Pi
 section Prod
 
 variable {β B B' : Type*} [Pow B β] [Pow B' β]
-
 variable [Zero β] [Monoid B] [Monoid B'] [RootableBy B β] [RootableBy B' β]
 
 @[to_additive]
@@ -252,9 +250,7 @@ section Hom
 
 -- Porting note: reordered variables to fix `to_additive` on `QuotientGroup.rootableBy`
 variable {A B α : Type*}
-
 variable [Zero α] [Monoid A] [Monoid B] [Pow A α] [Pow B α] [RootableBy A α]
-
 variable (f : A → B)
 
 /--
move: Algebraic pi instances (#10693)

Rename

  • Data.Pi.Algebra to Algebra.Group.Pi.Basic
  • Algebra.Group.Pi to Algebra.Group.Pi.Lemmas

Move a few instances from the latter to the former, the goal being that Algebra.Group.Pi.Basic is about all the pi instances of the classes defined in Algebra.Group.Defs. Algebra.Group.Pi.Lemmas will need further rearranging.

Diff
@@ -3,10 +3,10 @@ Copyright (c) 2022 Jujian Zhang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jujian Zhang
 -/
-import Mathlib.GroupTheory.Subgroup.Pointwise
-import Mathlib.GroupTheory.QuotientGroup
-import Mathlib.Algebra.Group.Pi
+import Mathlib.Algebra.Group.Pi.Lemmas
 import Mathlib.Algebra.Group.ULift
+import Mathlib.GroupTheory.QuotientGroup
+import Mathlib.GroupTheory.Subgroup.Pointwise
 
 #align_import group_theory.divisible from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
 
chore: Nsmul -> NSMul, Zpow -> ZPow, etc (#9067)

Normalising to naming convention rule number 6.

Diff
@@ -40,7 +40,7 @@ For additive monoids and groups:
   by nat divisiblity.
 * `AddGroup.divisibleByNatOfDivisibleByInt` : for additive groups, nat divisiblity is implied
   by int divisiblity.
-* `AddCommGroup.divisibleByIntOfSmulTopEqTop`: the constructive definition of divisiblity
+* `AddCommGroup.divisibleByIntOfSMulTopEqTop`: the constructive definition of divisiblity
   is implied by the condition that `n • A = A` for all `n ≠ 0`.
 * `AddCommGroup.smul_top_eq_top_of_divisibleBy_int`: the constructive definition of divisiblity
   implies the condition that `n • A = A` for all `n ≠ 0`.
@@ -185,7 +185,7 @@ theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n
 
 /-- If for all `n ≠ 0 ∈ ℤ`, `n • A = A`, then `A` is divisible.
 -/
-noncomputable def divisibleByIntOfSmulTopEqTop
+noncomputable def divisibleByIntOfSMulTopEqTop
     (H : ∀ {n : ℤ} (_hn : n ≠ 0), n • (⊤ : AddSubgroup A) = ⊤) : DivisibleBy A ℤ where
   div a n :=
     if hn : n = 0 then 0 else (show a ∈ n • (⊤ : AddSubgroup A) by rw [H hn]; trivial).choose
@@ -194,7 +194,7 @@ noncomputable def divisibleByIntOfSmulTopEqTop
     simp_rw [dif_neg hn]
     generalize_proofs h1
     exact h1.choose_spec.2
-#align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSmulTopEqTop
+#align add_comm_group.divisible_by_int_of_smul_top_eq_top AddCommGroup.divisibleByIntOfSMulTopEqTop
 
 end AddCommGroup
 
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -226,7 +226,7 @@ def rootableByIntOfRootableByNat [RootableBy A ℕ] : RootableBy A ℤ where
       norm_num
       rw [RootableBy.root_cancel]
       rw [Int.ofNat_eq_coe] at hn
-      exact_mod_cast hn
+      exact mod_cast hn
     · change (RootableBy.root a _)⁻¹ ^ _ = a
       norm_num
       rw [RootableBy.root_cancel]
@@ -242,7 +242,7 @@ def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ where
   root_zero a := RootableBy.root_zero a
   root_cancel {n} a hn := by
     -- Porting note: replaced `norm_num`
-    simpa only [zpow_coe_nat] using RootableBy.root_cancel a (show (n : ℤ) ≠ 0 by exact_mod_cast hn)
+    simpa only [zpow_coe_nat] using RootableBy.root_cancel a (show (n : ℤ) ≠ 0 from mod_cast hn)
 #align group.rootable_by_nat_of_rootable_by_int Group.rootableByNatOfRootableByInt
 #align add_group.divisible_by_nat_of_divisible_by_int AddGroup.divisibleByNatOfDivisibleByInt
 
feat : Abelian groups has enough injectives (#7157)
Diff
@@ -6,6 +6,7 @@ Authors: Jujian Zhang
 import Mathlib.GroupTheory.Subgroup.Pointwise
 import Mathlib.GroupTheory.QuotientGroup
 import Mathlib.Algebra.Group.Pi
+import Mathlib.Algebra.Group.ULift
 
 #align_import group_theory.divisible from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
 
@@ -161,6 +162,16 @@ instance Prod.rootableBy : RootableBy (B × B') β where
 
 end Prod
 
+section ULift
+
+@[to_additive]
+instance ULift.instRootableBy [RootableBy A α] : RootableBy (ULift A) α where
+  root x a := ULift.up <| RootableBy.root x.down a
+  root_zero x := ULift.ext _ _ <| RootableBy.root_zero x.down
+  root_cancel _ h := ULift.ext _ _ <| RootableBy.root_cancel _ h
+
+end ULift
+
 end Monoid
 
 namespace AddCommGroup
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -72,7 +72,7 @@ open Pointwise
 
 section AddMonoid
 
-variable (A α : Type _) [AddMonoid A] [SMul α A] [Zero α]
+variable (A α : Type*) [AddMonoid A] [SMul α A] [Zero α]
 
 /--
 An `AddMonoid A` is `α`-divisible iff `n • x = a` has a solution for all `n ≠ 0 ∈ α` and `a ∈ A`.
@@ -90,7 +90,7 @@ end AddMonoid
 
 section Monoid
 
-variable (A α : Type _) [Monoid A] [Pow A α] [Zero α]
+variable (A α : Type*) [Monoid A] [Pow A α] [Zero α]
 
 /-- A `Monoid A` is `α`-rootable iff `xⁿ = a` has a solution for all `n ≠ 0 ∈ α` and `a ∈ A`.
 Here we adopt a constructive approach where we ask an explicit `root : A → α → A` function such that
@@ -131,7 +131,7 @@ noncomputable def rootableByOfPowLeftSurj
 
 section Pi
 
-variable {ι β : Type _} (B : ι → Type _) [∀ i : ι, Pow (B i) β]
+variable {ι β : Type*} (B : ι → Type*) [∀ i : ι, Pow (B i) β]
 
 variable [Zero β] [∀ i : ι, Monoid (B i)] [∀ i, RootableBy (B i) β]
 
@@ -147,7 +147,7 @@ end Pi
 
 section Prod
 
-variable {β B B' : Type _} [Pow B β] [Pow B' β]
+variable {β B B' : Type*} [Pow B β] [Pow B' β]
 
 variable [Zero β] [Monoid B] [Monoid B'] [RootableBy B β] [RootableBy B' β]
 
@@ -165,7 +165,7 @@ end Monoid
 
 namespace AddCommGroup
 
-variable (A : Type _) [AddCommGroup A]
+variable (A : Type*) [AddCommGroup A]
 
 theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n ≠ 0) :
     n • (⊤ : AddSubgroup A) = ⊤ :=
@@ -197,7 +197,7 @@ instance (priority := 100) divisibleByIntOfCharZero {𝕜} [DivisionRing 𝕜] [
 
 namespace Group
 
-variable (A : Type _) [Group A]
+variable (A : Type*) [Group A]
 
 open Int in
 /-- A group is `ℤ`-rootable if it is `ℕ`-rootable.
@@ -240,7 +240,7 @@ end Group
 section Hom
 
 -- Porting note: reordered variables to fix `to_additive` on `QuotientGroup.rootableBy`
-variable {A B α : Type _}
+variable {A B α : Type*}
 
 variable [Zero α] [Monoid A] [Monoid B] [Pow A α] [Pow B α] [RootableBy A α]
 
@@ -262,7 +262,7 @@ noncomputable def Function.Surjective.rootableBy (hf : Function.Surjective f)
 #align function.surjective.divisible_by Function.Surjective.divisibleByₓ
 
 @[to_additive DivisibleBy.surjective_smul]
-theorem RootableBy.surjective_pow (A α : Type _) [Monoid A] [Pow A α] [Zero α] [RootableBy A α]
+theorem RootableBy.surjective_pow (A α : Type*) [Monoid A] [Pow A α] [Zero α] [RootableBy A α]
     {n : α} (hn : n ≠ 0) : Function.Surjective fun a : A => a ^ n := fun a =>
   ⟨RootableBy.root a n, RootableBy.root_cancel a hn⟩
 #align rootable_by.surjective_pow RootableBy.surjective_pow
@@ -272,7 +272,7 @@ end Hom
 
 section Quotient
 
-variable (α : Type _) {A : Type _} [CommGroup A] (B : Subgroup A)
+variable (α : Type*) {A : Type*} [CommGroup A] (B : Subgroup A)
 
 /-- Any quotient group of a rootable group is rootable. -/
 @[to_additive "Any quotient group of a divisible group is divisible"]
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Jujian Zhang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jujian Zhang
-
-! This file was ported from Lean 3 source module group_theory.divisible
-! leanprover-community/mathlib commit 0a0ec35061ed9960bf0e7ffb0335f44447b58977
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.GroupTheory.Subgroup.Pointwise
 import Mathlib.GroupTheory.QuotientGroup
 import Mathlib.Algebra.Group.Pi
 
+#align_import group_theory.divisible from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
+
 /-!
 # Divisible Group and rootable group
 
chore: fix many typos (#4967)

These are all doc fixes

Diff
@@ -37,7 +37,7 @@ For additive monoids and groups:
 * `smul_right_surj_of_divisibleBy` : the constructive definition of divisiblity implies
   the condition that `n • x = a` has solutions for all `n ≠ 0` and `a ∈ A`.
 * `Prod.divisibleBy` : `A × B` is divisible for any two divisible additive monoids.
-* `Pi.divisibleBy` : any product of divisble additive monoids is divisible.
+* `Pi.divisibleBy` : any product of divisible additive monoids is divisible.
 * `AddGroup.divisibleByIntOfDivisibleByNat` : for additive groups, int divisiblity is implied
   by nat divisiblity.
 * `AddGroup.divisibleByNatOfDivisibleByInt` : for additive groups, nat divisiblity is implied
feat: port GroupTheory.Divisible (#2149)

Dependencies 8 + 302

303 files ported (97.4%)
127619 lines ported (97.6%)
Show graph

The unported dependencies are