data.int.parityMathlib.Data.Int.Parity

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -205,7 +205,7 @@ theorem Odd.of_mul_right (h : Odd (m * n)) : Odd n :=
 #print Int.even_pow /-
 @[parity_simps]
 theorem even_pow {n : ℕ} : Even (m ^ n) ↔ Even m ∧ n ≠ 0 := by
-  induction' n with n ih <;> simp [*, even_mul, pow_succ]; tauto
+  induction' n with n ih <;> simp [*, even_mul, pow_succ']; tauto
 #align int.even_pow Int.even_pow
 -/
 
@@ -299,7 +299,7 @@ theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) : 4 ∣
     rw [Int.even_add, ← Int.even_sub] at h
     obtain ⟨k, hk⟩ := h
     convert dvd_mul_right 4 k
-    rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel, ← two_mul, ← mul_assoc]
+    rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel_right, ← two_mul, ← mul_assoc]
     rfl
   · left
     obtain ⟨k, hk⟩ := h
Diff
@@ -296,7 +296,7 @@ theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) : 4 ∣
   obtain ⟨n, rfl⟩ := hb
   obtain h | h := Int.even_or_odd (m + n)
   · right
-    rw [Int.even_add, ← Int.even_sub] at h 
+    rw [Int.even_add, ← Int.even_sub] at h
     obtain ⟨k, hk⟩ := h
     convert dvd_mul_right 4 k
     rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel, ← two_mul, ← mul_assoc]
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
 -/
-import Mathbin.Data.Nat.Parity
+import Data.Nat.Parity
 
 #align_import data.int.parity from "leanprover-community/mathlib"@"a11f9106a169dd302a285019e5165f8ab32ff433"
 
Diff
@@ -281,10 +281,10 @@ theorem natAbs_odd : Odd n.natAbs ↔ Odd n := by
 #align int.nat_abs_odd Int.natAbs_odd
 -/
 
-alias nat_abs_even ↔ _ _root_.even.nat_abs
+alias ⟨_, _root_.even.nat_abs⟩ := nat_abs_even
 #align even.nat_abs Even.natAbs
 
-alias nat_abs_odd ↔ _ _root_.odd.nat_abs
+alias ⟨_, _root_.odd.nat_abs⟩ := nat_abs_odd
 #align odd.nat_abs Odd.natAbs
 
 attribute [protected] Even.natAbs Odd.natAbs
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2019 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
-
-! This file was ported from Lean 3 source module data.int.parity
-! leanprover-community/mathlib commit a11f9106a169dd302a285019e5165f8ab32ff433
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Nat.Parity
 
+#align_import data.int.parity from "leanprover-community/mathlib"@"a11f9106a169dd302a285019e5165f8ab32ff433"
+
 /-!
 # Parity of integers
 
Diff
@@ -50,33 +50,45 @@ theorem even_iff : Even n ↔ n % 2 = 0 :=
 #align int.even_iff Int.even_iff
 -/
 
+#print Int.odd_iff /-
 theorem odd_iff : Odd n ↔ n % 2 = 1 :=
   ⟨fun ⟨m, hm⟩ => by rw [hm, add_mod]; norm_num, fun h =>
     ⟨n / 2, (emod_add_ediv n 2).symm.trans (by rw [h]; abel)⟩⟩
 #align int.odd_iff Int.odd_iff
+-/
 
 #print Int.not_even_iff /-
 theorem not_even_iff : ¬Even n ↔ n % 2 = 1 := by rw [even_iff, mod_two_ne_zero]
 #align int.not_even_iff Int.not_even_iff
 -/
 
+#print Int.not_odd_iff /-
 theorem not_odd_iff : ¬Odd n ↔ n % 2 = 0 := by rw [odd_iff, mod_two_ne_one]
 #align int.not_odd_iff Int.not_odd_iff
+-/
 
+#print Int.even_iff_not_odd /-
 theorem even_iff_not_odd : Even n ↔ ¬Odd n := by rw [not_odd_iff, even_iff]
 #align int.even_iff_not_odd Int.even_iff_not_odd
+-/
 
+#print Int.odd_iff_not_even /-
 @[simp]
 theorem odd_iff_not_even : Odd n ↔ ¬Even n := by rw [not_even_iff, odd_iff]
 #align int.odd_iff_not_even Int.odd_iff_not_even
+-/
 
+#print Int.isCompl_even_odd /-
 theorem isCompl_even_odd : IsCompl {n : ℤ | Even n} {n | Odd n} := by
   simp [← Set.compl_setOf, isCompl_compl]
 #align int.is_compl_even_odd Int.isCompl_even_odd
+-/
 
+#print Int.even_or_odd /-
 theorem even_or_odd (n : ℤ) : Even n ∨ Odd n :=
   Or.imp_right odd_iff_not_even.2 <| em <| Even n
 #align int.even_or_odd Int.even_or_odd
+-/
 
 #print Int.even_or_odd' /-
 theorem even_or_odd' (n : ℤ) : ∃ k, n = 2 * k ∨ n = 2 * k + 1 := by
@@ -84,12 +96,14 @@ theorem even_or_odd' (n : ℤ) : ∃ k, n = 2 * k ∨ n = 2 * k + 1 := by
 #align int.even_or_odd' Int.even_or_odd'
 -/
 
+#print Int.even_xor'_odd /-
 theorem even_xor'_odd (n : ℤ) : Xor' (Even n) (Odd n) :=
   by
   cases' even_or_odd n with h
   · exact Or.inl ⟨h, even_iff_not_odd.mp h⟩
   · exact Or.inr ⟨h, odd_iff_not_even.mp h⟩
 #align int.even_xor_odd Int.even_xor'_odd
+-/
 
 #print Int.even_xor'_odd' /-
 theorem even_xor'_odd' (n : ℤ) : ∃ k, Xor' (n = 2 * k) (n = 2 * k + 1) :=
@@ -104,10 +118,12 @@ theorem even_xor'_odd' (n : ℤ) : ∃ k, Xor' (n = 2 * k) (n = 2 * k + 1) :=
 #align int.even_xor_odd' Int.even_xor'_odd'
 -/
 
+#print Int.two_dvd_ne_zero /-
 @[simp]
 theorem two_dvd_ne_zero : ¬2 ∣ n ↔ n % 2 = 1 :=
   even_iff_two_dvd.symm.Not.trans not_even_iff
 #align int.two_dvd_ne_zero Int.two_dvd_ne_zero
+-/
 
 instance : DecidablePred (Even : ℤ → Prop) := fun n => decidable_of_iff _ even_iff.symm
 
@@ -128,9 +144,11 @@ theorem even_add : Even (m + n) ↔ (Even m ↔ Even n) := by
 #align int.even_add Int.even_add
 -/
 
+#print Int.even_add' /-
 theorem even_add' : Even (m + n) ↔ (Odd m ↔ Odd n) := by
   rw [even_add, even_iff_not_odd, even_iff_not_odd, not_iff_not]
 #align int.even_add' Int.even_add'
+-/
 
 #print Int.not_even_bit1 /-
 @[simp]
@@ -138,8 +156,10 @@ theorem not_even_bit1 (n : ℤ) : ¬Even (bit1 n) := by simp [bit1, parity_simps
 #align int.not_even_bit1 Int.not_even_bit1
 -/
 
+#print Int.two_not_dvd_two_mul_add_one /-
 theorem two_not_dvd_two_mul_add_one (n : ℤ) : ¬2 ∣ 2 * n + 1 := by simp [add_mod]; rfl
 #align int.two_not_dvd_two_mul_add_one Int.two_not_dvd_two_mul_add_one
+-/
 
 #print Int.even_sub /-
 @[parity_simps]
@@ -147,9 +167,11 @@ theorem even_sub : Even (m - n) ↔ (Even m ↔ Even n) := by simp [sub_eq_add_n
 #align int.even_sub Int.even_sub
 -/
 
+#print Int.even_sub' /-
 theorem even_sub' : Even (m - n) ↔ (Odd m ↔ Odd n) := by
   rw [even_sub, even_iff_not_odd, even_iff_not_odd, not_iff_not]
 #align int.even_sub' Int.even_sub'
+-/
 
 #print Int.even_add_one /-
 @[parity_simps]
@@ -166,45 +188,65 @@ theorem even_mul : Even (m * n) ↔ Even m ∨ Even n := by
 #align int.even_mul Int.even_mul
 -/
 
+#print Int.odd_mul /-
 theorem odd_mul : Odd (m * n) ↔ Odd m ∧ Odd n := by simp [not_or, parity_simps]
 #align int.odd_mul Int.odd_mul
+-/
 
+#print Int.Odd.of_mul_left /-
 theorem Odd.of_mul_left (h : Odd (m * n)) : Odd m :=
   (odd_mul.mp h).1
 #align int.odd.of_mul_left Int.Odd.of_mul_left
+-/
 
+#print Int.Odd.of_mul_right /-
 theorem Odd.of_mul_right (h : Odd (m * n)) : Odd n :=
   (odd_mul.mp h).2
 #align int.odd.of_mul_right Int.Odd.of_mul_right
+-/
 
+#print Int.even_pow /-
 @[parity_simps]
 theorem even_pow {n : ℕ} : Even (m ^ n) ↔ Even m ∧ n ≠ 0 := by
   induction' n with n ih <;> simp [*, even_mul, pow_succ]; tauto
 #align int.even_pow Int.even_pow
+-/
 
+#print Int.even_pow' /-
 theorem even_pow' {n : ℕ} (h : n ≠ 0) : Even (m ^ n) ↔ Even m :=
   even_pow.trans <| and_iff_left h
 #align int.even_pow' Int.even_pow'
+-/
 
+#print Int.odd_add /-
 @[parity_simps]
 theorem odd_add : Odd (m + n) ↔ (Odd m ↔ Even n) := by
   rw [odd_iff_not_even, even_add, not_iff, odd_iff_not_even]
 #align int.odd_add Int.odd_add
+-/
 
+#print Int.odd_add' /-
 theorem odd_add' : Odd (m + n) ↔ (Odd n ↔ Even m) := by rw [add_comm, odd_add]
 #align int.odd_add' Int.odd_add'
+-/
 
+#print Int.ne_of_odd_add /-
 theorem ne_of_odd_add (h : Odd (m + n)) : m ≠ n := fun hnot => by simpa [hnot, parity_simps] using h
 #align int.ne_of_odd_add Int.ne_of_odd_add
+-/
 
+#print Int.odd_sub /-
 @[parity_simps]
 theorem odd_sub : Odd (m - n) ↔ (Odd m ↔ Even n) := by
   rw [odd_iff_not_even, even_sub, not_iff, odd_iff_not_even]
 #align int.odd_sub Int.odd_sub
+-/
 
+#print Int.odd_sub' /-
 theorem odd_sub' : Odd (m - n) ↔ (Odd n ↔ Even m) := by
   rw [odd_iff_not_even, even_sub, not_iff, not_iff_comm, odd_iff_not_even]
 #align int.odd_sub' Int.odd_sub'
+-/
 
 #print Int.even_mul_succ_self /-
 theorem even_mul_succ_self (n : ℤ) : Even (n * (n + 1)) :=
@@ -221,10 +263,12 @@ theorem even_coe_nat (n : ℕ) : Even (n : ℤ) ↔ Even n := by rw_mod_cast [ev
 #align int.even_coe_nat Int.even_coe_nat
 -/
 
+#print Int.odd_coe_nat /-
 @[simp, norm_cast]
 theorem odd_coe_nat (n : ℕ) : Odd (n : ℤ) ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, even_coe_nat]
 #align int.odd_coe_nat Int.odd_coe_nat
+-/
 
 #print Int.natAbs_even /-
 @[simp]
@@ -233,10 +277,12 @@ theorem natAbs_even : Even n.natAbs ↔ Even n := by
 #align int.nat_abs_even Int.natAbs_even
 -/
 
+#print Int.natAbs_odd /-
 @[simp]
 theorem natAbs_odd : Odd n.natAbs ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, nat_abs_even]
 #align int.nat_abs_odd Int.natAbs_odd
+-/
 
 alias nat_abs_even ↔ _ _root_.even.nat_abs
 #align even.nat_abs Even.natAbs
@@ -246,6 +292,7 @@ alias nat_abs_odd ↔ _ _root_.odd.nat_abs
 
 attribute [protected] Even.natAbs Odd.natAbs
 
+#print Int.four_dvd_add_or_sub_of_odd /-
 theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) : 4 ∣ a + b ∨ 4 ∣ a - b :=
   by
   obtain ⟨m, rfl⟩ := ha
@@ -265,6 +312,7 @@ theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) : 4 ∣
       mul_add]
     rfl
 #align int.four_dvd_add_or_sub_of_odd Int.four_dvd_add_or_sub_of_odd
+-/
 
 #print Int.two_mul_ediv_two_of_even /-
 theorem two_mul_ediv_two_of_even : Even n → 2 * (n / 2) = n := fun h =>
@@ -281,21 +329,29 @@ theorem ediv_two_mul_two_of_even : Even n → n / 2 * 2 = n :=
 #align int.div_two_mul_two_of_even Int.ediv_two_mul_two_of_even
 -/
 
+#print Int.two_mul_ediv_two_add_one_of_odd /-
 theorem two_mul_ediv_two_add_one_of_odd : Odd n → 2 * (n / 2) + 1 = n := by rintro ⟨c, rfl⟩;
   rw [mul_comm]; convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.two_mul_div_two_add_one_of_odd Int.two_mul_ediv_two_add_one_of_odd
+-/
 
+#print Int.ediv_two_mul_two_add_one_of_odd /-
 theorem ediv_two_mul_two_add_one_of_odd : Odd n → n / 2 * 2 + 1 = n := by rintro ⟨c, rfl⟩;
   convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.div_two_mul_two_add_one_of_odd Int.ediv_two_mul_two_add_one_of_odd
+-/
 
+#print Int.add_one_ediv_two_mul_two_of_odd /-
 theorem add_one_ediv_two_mul_two_of_odd : Odd n → 1 + n / 2 * 2 = n := by rintro ⟨c, rfl⟩;
   rw [add_comm]; convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.add_one_div_two_mul_two_of_odd Int.add_one_ediv_two_mul_two_of_odd
+-/
 
+#print Int.two_mul_ediv_two_of_odd /-
 theorem two_mul_ediv_two_of_odd (h : Odd n) : 2 * (n / 2) = n - 1 :=
   eq_sub_of_add_eq (two_mul_ediv_two_add_one_of_odd h)
 #align int.two_mul_div_two_of_odd Int.two_mul_ediv_two_of_odd
+-/
 
 -- Here are examples of how `parity_simps` can be used with `int`.
 example (m n : ℤ) (h : Even m) : ¬Even (n + 3) ↔ Even (m ^ 2 + m + n) := by
Diff
@@ -70,7 +70,7 @@ theorem even_iff_not_odd : Even n ↔ ¬Odd n := by rw [not_odd_iff, even_iff]
 theorem odd_iff_not_even : Odd n ↔ ¬Even n := by rw [not_even_iff, odd_iff]
 #align int.odd_iff_not_even Int.odd_iff_not_even
 
-theorem isCompl_even_odd : IsCompl { n : ℤ | Even n } { n | Odd n } := by
+theorem isCompl_even_odd : IsCompl {n : ℤ | Even n} {n | Odd n} := by
   simp [← Set.compl_setOf, isCompl_compl]
 #align int.is_compl_even_odd Int.isCompl_even_odd
 
Diff
@@ -252,7 +252,7 @@ theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) : 4 ∣
   obtain ⟨n, rfl⟩ := hb
   obtain h | h := Int.even_or_odd (m + n)
   · right
-    rw [Int.even_add, ← Int.even_sub] at h
+    rw [Int.even_add, ← Int.even_sub] at h 
     obtain ⟨k, hk⟩ := h
     convert dvd_mul_right 4 k
     rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel, ← two_mul, ← mul_assoc]
Diff
@@ -50,12 +50,6 @@ theorem even_iff : Even n ↔ n % 2 = 0 :=
 #align int.even_iff Int.even_iff
 -/
 
-/- warning: int.odd_iff -> Int.odd_iff is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, Iff (Odd.{0} Int Int.semiring n) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))))
-but is expected to have type
-  forall {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt n) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))
-Case conversion may be inaccurate. Consider using '#align int.odd_iff Int.odd_iffₓ'. -/
 theorem odd_iff : Odd n ↔ n % 2 = 1 :=
   ⟨fun ⟨m, hm⟩ => by rw [hm, add_mod]; norm_num, fun h =>
     ⟨n / 2, (emod_add_ediv n 2).symm.trans (by rw [h]; abel)⟩⟩
@@ -66,50 +60,20 @@ theorem not_even_iff : ¬Even n ↔ n % 2 = 1 := by rw [even_iff, mod_two_ne_zer
 #align int.not_even_iff Int.not_even_iff
 -/
 
-/- warning: int.not_odd_iff -> Int.not_odd_iff is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, Iff (Not (Odd.{0} Int Int.semiring n)) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))))
-but is expected to have type
-  forall {n : Int}, Iff (Not (Odd.{0} Int Int.instSemiringInt n)) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)))
-Case conversion may be inaccurate. Consider using '#align int.not_odd_iff Int.not_odd_iffₓ'. -/
 theorem not_odd_iff : ¬Odd n ↔ n % 2 = 0 := by rw [odd_iff, mod_two_ne_one]
 #align int.not_odd_iff Int.not_odd_iff
 
-/- warning: int.even_iff_not_odd -> Int.even_iff_not_odd is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, Iff (Even.{0} Int Int.hasAdd n) (Not (Odd.{0} Int Int.semiring n))
-but is expected to have type
-  forall {n : Int}, Iff (Even.{0} Int Int.instAddInt n) (Not (Odd.{0} Int Int.instSemiringInt n))
-Case conversion may be inaccurate. Consider using '#align int.even_iff_not_odd Int.even_iff_not_oddₓ'. -/
 theorem even_iff_not_odd : Even n ↔ ¬Odd n := by rw [not_odd_iff, even_iff]
 #align int.even_iff_not_odd Int.even_iff_not_odd
 
-/- warning: int.odd_iff_not_even -> Int.odd_iff_not_even is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, Iff (Odd.{0} Int Int.semiring n) (Not (Even.{0} Int Int.hasAdd n))
-but is expected to have type
-  forall {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt n) (Not (Even.{0} Int Int.instAddInt n))
-Case conversion may be inaccurate. Consider using '#align int.odd_iff_not_even Int.odd_iff_not_evenₓ'. -/
 @[simp]
 theorem odd_iff_not_even : Odd n ↔ ¬Even n := by rw [not_even_iff, odd_iff]
 #align int.odd_iff_not_even Int.odd_iff_not_even
 
-/- warning: int.is_compl_even_odd -> Int.isCompl_even_odd is a dubious translation:
-lean 3 declaration is
-  IsCompl.{0} (Set.{0} Int) (SemilatticeInf.toPartialOrder.{0} (Set.{0} Int) (Lattice.toSemilatticeInf.{0} (Set.{0} Int) (GeneralizedCoheytingAlgebra.toLattice.{0} (Set.{0} Int) (GeneralizedBooleanAlgebra.toGeneralizedCoheytingAlgebra.{0} (Set.{0} Int) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{0} (Set.{0} Int) (Set.booleanAlgebra.{0} Int)))))) (BooleanAlgebra.toBoundedOrder.{0} (Set.{0} Int) (Set.booleanAlgebra.{0} Int)) (setOf.{0} Int (fun (n : Int) => Even.{0} Int Int.hasAdd n)) (setOf.{0} Int (fun (n : Int) => Odd.{0} Int Int.semiring n))
-but is expected to have type
-  IsCompl.{0} (Set.{0} Int) (SemilatticeInf.toPartialOrder.{0} (Set.{0} Int) (Lattice.toSemilatticeInf.{0} (Set.{0} Int) (GeneralizedCoheytingAlgebra.toLattice.{0} (Set.{0} Int) (CoheytingAlgebra.toGeneralizedCoheytingAlgebra.{0} (Set.{0} Int) (BiheytingAlgebra.toCoheytingAlgebra.{0} (Set.{0} Int) (BooleanAlgebra.toBiheytingAlgebra.{0} (Set.{0} Int) (Set.instBooleanAlgebraSet.{0} Int))))))) (BooleanAlgebra.toBoundedOrder.{0} (Set.{0} Int) (Set.instBooleanAlgebraSet.{0} Int)) (setOf.{0} Int (fun (n : Int) => Even.{0} Int Int.instAddInt n)) (setOf.{0} Int (fun (n : Int) => Odd.{0} Int Int.instSemiringInt n))
-Case conversion may be inaccurate. Consider using '#align int.is_compl_even_odd Int.isCompl_even_oddₓ'. -/
 theorem isCompl_even_odd : IsCompl { n : ℤ | Even n } { n | Odd n } := by
   simp [← Set.compl_setOf, isCompl_compl]
 #align int.is_compl_even_odd Int.isCompl_even_odd
 
-/- warning: int.even_or_odd -> Int.even_or_odd is a dubious translation:
-lean 3 declaration is
-  forall (n : Int), Or (Even.{0} Int Int.hasAdd n) (Odd.{0} Int Int.semiring n)
-but is expected to have type
-  forall (n : Int), Or (Even.{0} Int Int.instAddInt n) (Odd.{0} Int Int.instSemiringInt n)
-Case conversion may be inaccurate. Consider using '#align int.even_or_odd Int.even_or_oddₓ'. -/
 theorem even_or_odd (n : ℤ) : Even n ∨ Odd n :=
   Or.imp_right odd_iff_not_even.2 <| em <| Even n
 #align int.even_or_odd Int.even_or_odd
@@ -120,12 +84,6 @@ theorem even_or_odd' (n : ℤ) : ∃ k, n = 2 * k ∨ n = 2 * k + 1 := by
 #align int.even_or_odd' Int.even_or_odd'
 -/
 
-/- warning: int.even_xor_odd -> Int.even_xor'_odd is a dubious translation:
-lean 3 declaration is
-  forall (n : Int), Xor' (Even.{0} Int Int.hasAdd n) (Odd.{0} Int Int.semiring n)
-but is expected to have type
-  forall (n : Int), Xor' (Even.{0} Int Int.instAddInt n) (Odd.{0} Int Int.instSemiringInt n)
-Case conversion may be inaccurate. Consider using '#align int.even_xor_odd Int.even_xor'_oddₓ'. -/
 theorem even_xor'_odd (n : ℤ) : Xor' (Even n) (Odd n) :=
   by
   cases' even_or_odd n with h
@@ -146,12 +104,6 @@ theorem even_xor'_odd' (n : ℤ) : ∃ k, Xor' (n = 2 * k) (n = 2 * k + 1) :=
 #align int.even_xor_odd' Int.even_xor'_odd'
 -/
 
-/- warning: int.two_dvd_ne_zero -> Int.two_dvd_ne_zero is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, Iff (Not (Dvd.Dvd.{0} Int (semigroupDvd.{0} Int Int.semigroup) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))) n)) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))))
-but is expected to have type
-  forall {n : Int}, Iff (Not (Dvd.dvd.{0} Int Int.instDvdInt (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) n)) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))
-Case conversion may be inaccurate. Consider using '#align int.two_dvd_ne_zero Int.two_dvd_ne_zeroₓ'. -/
 @[simp]
 theorem two_dvd_ne_zero : ¬2 ∣ n ↔ n % 2 = 1 :=
   even_iff_two_dvd.symm.Not.trans not_even_iff
@@ -176,12 +128,6 @@ theorem even_add : Even (m + n) ↔ (Even m ↔ Even n) := by
 #align int.even_add Int.even_add
 -/
 
-/- warning: int.even_add' -> Int.even_add' is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Even.{0} Int Int.hasAdd (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) m n)) (Iff (Odd.{0} Int Int.semiring m) (Odd.{0} Int Int.semiring n))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Even.{0} Int Int.instAddInt (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) m n)) (Iff (Odd.{0} Int Int.instSemiringInt m) (Odd.{0} Int Int.instSemiringInt n))
-Case conversion may be inaccurate. Consider using '#align int.even_add' Int.even_add'ₓ'. -/
 theorem even_add' : Even (m + n) ↔ (Odd m ↔ Odd n) := by
   rw [even_add, even_iff_not_odd, even_iff_not_odd, not_iff_not]
 #align int.even_add' Int.even_add'
@@ -192,12 +138,6 @@ theorem not_even_bit1 (n : ℤ) : ¬Even (bit1 n) := by simp [bit1, parity_simps
 #align int.not_even_bit1 Int.not_even_bit1
 -/
 
-/- warning: int.two_not_dvd_two_mul_add_one -> Int.two_not_dvd_two_mul_add_one is a dubious translation:
-lean 3 declaration is
-  forall (n : Int), Not (Dvd.Dvd.{0} Int (semigroupDvd.{0} Int Int.semigroup) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))) n) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
-but is expected to have type
-  forall (n : Int), Not (Dvd.dvd.{0} Int Int.instDvdInt (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) n) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
-Case conversion may be inaccurate. Consider using '#align int.two_not_dvd_two_mul_add_one Int.two_not_dvd_two_mul_add_oneₓ'. -/
 theorem two_not_dvd_two_mul_add_one (n : ℤ) : ¬2 ∣ 2 * n + 1 := by simp [add_mod]; rfl
 #align int.two_not_dvd_two_mul_add_one Int.two_not_dvd_two_mul_add_one
 
@@ -207,12 +147,6 @@ theorem even_sub : Even (m - n) ↔ (Even m ↔ Even n) := by simp [sub_eq_add_n
 #align int.even_sub Int.even_sub
 -/
 
-/- warning: int.even_sub' -> Int.even_sub' is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Even.{0} Int Int.hasAdd (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) m n)) (Iff (Odd.{0} Int Int.semiring m) (Odd.{0} Int Int.semiring n))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Even.{0} Int Int.instAddInt (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) m n)) (Iff (Odd.{0} Int Int.instSemiringInt m) (Odd.{0} Int Int.instSemiringInt n))
-Case conversion may be inaccurate. Consider using '#align int.even_sub' Int.even_sub'ₓ'. -/
 theorem even_sub' : Even (m - n) ↔ (Odd m ↔ Odd n) := by
   rw [even_sub, even_iff_not_odd, even_iff_not_odd, not_iff_not]
 #align int.even_sub' Int.even_sub'
@@ -232,102 +166,42 @@ theorem even_mul : Even (m * n) ↔ Even m ∨ Even n := by
 #align int.even_mul Int.even_mul
 -/
 
-/- warning: int.odd_mul -> Int.odd_mul is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.semiring (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) m n)) (And (Odd.{0} Int Int.semiring m) (Odd.{0} Int Int.semiring n))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) m n)) (And (Odd.{0} Int Int.instSemiringInt m) (Odd.{0} Int Int.instSemiringInt n))
-Case conversion may be inaccurate. Consider using '#align int.odd_mul Int.odd_mulₓ'. -/
 theorem odd_mul : Odd (m * n) ↔ Odd m ∧ Odd n := by simp [not_or, parity_simps]
 #align int.odd_mul Int.odd_mul
 
-/- warning: int.odd.of_mul_left -> Int.Odd.of_mul_left is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, (Odd.{0} Int Int.semiring (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) m n)) -> (Odd.{0} Int Int.semiring m)
-but is expected to have type
-  forall {m : Int} {n : Int}, (Odd.{0} Int Int.instSemiringInt (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) m n)) -> (Odd.{0} Int Int.instSemiringInt m)
-Case conversion may be inaccurate. Consider using '#align int.odd.of_mul_left Int.Odd.of_mul_leftₓ'. -/
 theorem Odd.of_mul_left (h : Odd (m * n)) : Odd m :=
   (odd_mul.mp h).1
 #align int.odd.of_mul_left Int.Odd.of_mul_left
 
-/- warning: int.odd.of_mul_right -> Int.Odd.of_mul_right is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, (Odd.{0} Int Int.semiring (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) m n)) -> (Odd.{0} Int Int.semiring n)
-but is expected to have type
-  forall {m : Int} {n : Int}, (Odd.{0} Int Int.instSemiringInt (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) m n)) -> (Odd.{0} Int Int.instSemiringInt n)
-Case conversion may be inaccurate. Consider using '#align int.odd.of_mul_right Int.Odd.of_mul_rightₓ'. -/
 theorem Odd.of_mul_right (h : Odd (m * n)) : Odd n :=
   (odd_mul.mp h).2
 #align int.odd.of_mul_right Int.Odd.of_mul_right
 
-/- warning: int.even_pow -> Int.even_pow is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Nat}, Iff (Even.{0} Int Int.hasAdd (HPow.hPow.{0, 0, 0} Int Nat Int (instHPow.{0, 0} Int Nat (Monoid.Pow.{0} Int Int.monoid)) m n)) (And (Even.{0} Int Int.hasAdd m) (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
-but is expected to have type
-  forall {m : Int} {n : Nat}, Iff (Even.{0} Int Int.instAddInt (HPow.hPow.{0, 0, 0} Int Nat Int Int.instHPowIntNat m n)) (And (Even.{0} Int Int.instAddInt m) (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
-Case conversion may be inaccurate. Consider using '#align int.even_pow Int.even_powₓ'. -/
 @[parity_simps]
 theorem even_pow {n : ℕ} : Even (m ^ n) ↔ Even m ∧ n ≠ 0 := by
   induction' n with n ih <;> simp [*, even_mul, pow_succ]; tauto
 #align int.even_pow Int.even_pow
 
-/- warning: int.even_pow' -> Int.even_pow' is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Nat}, (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> (Iff (Even.{0} Int Int.hasAdd (HPow.hPow.{0, 0, 0} Int Nat Int (instHPow.{0, 0} Int Nat (Monoid.Pow.{0} Int Int.monoid)) m n)) (Even.{0} Int Int.hasAdd m))
-but is expected to have type
-  forall {m : Int} {n : Nat}, (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> (Iff (Even.{0} Int Int.instAddInt (HPow.hPow.{0, 0, 0} Int Nat Int Int.instHPowIntNat m n)) (Even.{0} Int Int.instAddInt m))
-Case conversion may be inaccurate. Consider using '#align int.even_pow' Int.even_pow'ₓ'. -/
 theorem even_pow' {n : ℕ} (h : n ≠ 0) : Even (m ^ n) ↔ Even m :=
   even_pow.trans <| and_iff_left h
 #align int.even_pow' Int.even_pow'
 
-/- warning: int.odd_add -> Int.odd_add is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.semiring (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) m n)) (Iff (Odd.{0} Int Int.semiring m) (Even.{0} Int Int.hasAdd n))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) m n)) (Iff (Odd.{0} Int Int.instSemiringInt m) (Even.{0} Int Int.instAddInt n))
-Case conversion may be inaccurate. Consider using '#align int.odd_add Int.odd_addₓ'. -/
 @[parity_simps]
 theorem odd_add : Odd (m + n) ↔ (Odd m ↔ Even n) := by
   rw [odd_iff_not_even, even_add, not_iff, odd_iff_not_even]
 #align int.odd_add Int.odd_add
 
-/- warning: int.odd_add' -> Int.odd_add' is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.semiring (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) m n)) (Iff (Odd.{0} Int Int.semiring n) (Even.{0} Int Int.hasAdd m))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) m n)) (Iff (Odd.{0} Int Int.instSemiringInt n) (Even.{0} Int Int.instAddInt m))
-Case conversion may be inaccurate. Consider using '#align int.odd_add' Int.odd_add'ₓ'. -/
 theorem odd_add' : Odd (m + n) ↔ (Odd n ↔ Even m) := by rw [add_comm, odd_add]
 #align int.odd_add' Int.odd_add'
 
-/- warning: int.ne_of_odd_add -> Int.ne_of_odd_add is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, (Odd.{0} Int Int.semiring (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) m n)) -> (Ne.{1} Int m n)
-but is expected to have type
-  forall {m : Int} {n : Int}, (Odd.{0} Int Int.instSemiringInt (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) m n)) -> (Ne.{1} Int m n)
-Case conversion may be inaccurate. Consider using '#align int.ne_of_odd_add Int.ne_of_odd_addₓ'. -/
 theorem ne_of_odd_add (h : Odd (m + n)) : m ≠ n := fun hnot => by simpa [hnot, parity_simps] using h
 #align int.ne_of_odd_add Int.ne_of_odd_add
 
-/- warning: int.odd_sub -> Int.odd_sub is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.semiring (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) m n)) (Iff (Odd.{0} Int Int.semiring m) (Even.{0} Int Int.hasAdd n))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) m n)) (Iff (Odd.{0} Int Int.instSemiringInt m) (Even.{0} Int Int.instAddInt n))
-Case conversion may be inaccurate. Consider using '#align int.odd_sub Int.odd_subₓ'. -/
 @[parity_simps]
 theorem odd_sub : Odd (m - n) ↔ (Odd m ↔ Even n) := by
   rw [odd_iff_not_even, even_sub, not_iff, odd_iff_not_even]
 #align int.odd_sub Int.odd_sub
 
-/- warning: int.odd_sub' -> Int.odd_sub' is a dubious translation:
-lean 3 declaration is
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.semiring (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) m n)) (Iff (Odd.{0} Int Int.semiring n) (Even.{0} Int Int.hasAdd m))
-but is expected to have type
-  forall {m : Int} {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) m n)) (Iff (Odd.{0} Int Int.instSemiringInt n) (Even.{0} Int Int.instAddInt m))
-Case conversion may be inaccurate. Consider using '#align int.odd_sub' Int.odd_sub'ₓ'. -/
 theorem odd_sub' : Odd (m - n) ↔ (Odd n ↔ Even m) := by
   rw [odd_iff_not_even, even_sub, not_iff, not_iff_comm, odd_iff_not_even]
 #align int.odd_sub' Int.odd_sub'
@@ -347,12 +221,6 @@ theorem even_coe_nat (n : ℕ) : Even (n : ℤ) ↔ Even n := by rw_mod_cast [ev
 #align int.even_coe_nat Int.even_coe_nat
 -/
 
-/- warning: int.odd_coe_nat -> Int.odd_coe_nat is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat), Iff (Odd.{0} Int Int.semiring ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat Int (HasLiftT.mk.{1, 1} Nat Int (CoeTCₓ.coe.{1, 1} Nat Int (coeBase.{1, 1} Nat Int Int.hasCoe))) n)) (Odd.{0} Nat Nat.semiring n)
-but is expected to have type
-  forall (n : Nat), Iff (Odd.{0} Int Int.instSemiringInt (Nat.cast.{0} Int instNatCastInt n)) (Odd.{0} Nat Nat.semiring n)
-Case conversion may be inaccurate. Consider using '#align int.odd_coe_nat Int.odd_coe_natₓ'. -/
 @[simp, norm_cast]
 theorem odd_coe_nat (n : ℕ) : Odd (n : ℤ) ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, even_coe_nat]
@@ -365,12 +233,6 @@ theorem natAbs_even : Even n.natAbs ↔ Even n := by
 #align int.nat_abs_even Int.natAbs_even
 -/
 
-/- warning: int.nat_abs_odd -> Int.natAbs_odd is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, Iff (Odd.{0} Nat Nat.semiring (Int.natAbs n)) (Odd.{0} Int Int.semiring n)
-but is expected to have type
-  forall {n : Int}, Iff (Odd.{0} Nat Nat.semiring (Int.natAbs n)) (Odd.{0} Int Int.instSemiringInt n)
-Case conversion may be inaccurate. Consider using '#align int.nat_abs_odd Int.natAbs_oddₓ'. -/
 @[simp]
 theorem natAbs_odd : Odd n.natAbs ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, nat_abs_even]
@@ -379,23 +241,11 @@ theorem natAbs_odd : Odd n.natAbs ↔ Odd n := by
 alias nat_abs_even ↔ _ _root_.even.nat_abs
 #align even.nat_abs Even.natAbs
 
-/- warning: odd.nat_abs -> Odd.natAbs is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, (Odd.{0} Int Int.semiring n) -> (Odd.{0} Nat Nat.semiring (Int.natAbs n))
-but is expected to have type
-  forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Odd.{0} Nat Nat.semiring (Int.natAbs n))
-Case conversion may be inaccurate. Consider using '#align odd.nat_abs Odd.natAbsₓ'. -/
 alias nat_abs_odd ↔ _ _root_.odd.nat_abs
 #align odd.nat_abs Odd.natAbs
 
 attribute [protected] Even.natAbs Odd.natAbs
 
-/- warning: int.four_dvd_add_or_sub_of_odd -> Int.four_dvd_add_or_sub_of_odd is a dubious translation:
-lean 3 declaration is
-  forall {a : Int} {b : Int}, (Odd.{0} Int Int.semiring a) -> (Odd.{0} Int Int.semiring b) -> (Or (Dvd.Dvd.{0} Int (semigroupDvd.{0} Int Int.semigroup) (OfNat.ofNat.{0} Int 4 (OfNat.mk.{0} Int 4 (bit0.{0} Int Int.hasAdd (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a b)) (Dvd.Dvd.{0} Int (semigroupDvd.{0} Int Int.semigroup) (OfNat.ofNat.{0} Int 4 (OfNat.mk.{0} Int 4 (bit0.{0} Int Int.hasAdd (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) a b)))
-but is expected to have type
-  forall {a : Int} {b : Int}, (Odd.{0} Int Int.instSemiringInt a) -> (Odd.{0} Int Int.instSemiringInt b) -> (Or (Dvd.dvd.{0} Int Int.instDvdInt (OfNat.ofNat.{0} Int 4 (instOfNatInt 4)) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) a b)) (Dvd.dvd.{0} Int Int.instDvdInt (OfNat.ofNat.{0} Int 4 (instOfNatInt 4)) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) a b)))
-Case conversion may be inaccurate. Consider using '#align int.four_dvd_add_or_sub_of_odd Int.four_dvd_add_or_sub_of_oddₓ'. -/
 theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) : 4 ∣ a + b ∨ 4 ∣ a - b :=
   by
   obtain ⟨m, rfl⟩ := ha
@@ -431,42 +281,18 @@ theorem ediv_two_mul_two_of_even : Even n → n / 2 * 2 = n :=
 #align int.div_two_mul_two_of_even Int.ediv_two_mul_two_of_even
 -/
 
-/- warning: int.two_mul_div_two_add_one_of_odd -> Int.two_mul_ediv_two_add_one_of_odd is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, (Odd.{0} Int Int.semiring n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.hasDiv) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))))) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) n)
-but is expected to have type
-  forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) n)
-Case conversion may be inaccurate. Consider using '#align int.two_mul_div_two_add_one_of_odd Int.two_mul_ediv_two_add_one_of_oddₓ'. -/
 theorem two_mul_ediv_two_add_one_of_odd : Odd n → 2 * (n / 2) + 1 = n := by rintro ⟨c, rfl⟩;
   rw [mul_comm]; convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.two_mul_div_two_add_one_of_odd Int.two_mul_ediv_two_add_one_of_odd
 
-/- warning: int.div_two_mul_two_add_one_of_odd -> Int.ediv_two_mul_two_add_one_of_odd is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, (Odd.{0} Int Int.semiring n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.hasDiv) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) n)
-but is expected to have type
-  forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) n)
-Case conversion may be inaccurate. Consider using '#align int.div_two_mul_two_add_one_of_odd Int.ediv_two_mul_two_add_one_of_oddₓ'. -/
 theorem ediv_two_mul_two_add_one_of_odd : Odd n → n / 2 * 2 + 1 = n := by rintro ⟨c, rfl⟩;
   convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.div_two_mul_two_add_one_of_odd Int.ediv_two_mul_two_add_one_of_odd
 
-/- warning: int.add_one_div_two_mul_two_of_odd -> Int.add_one_ediv_two_mul_two_of_odd is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, (Odd.{0} Int Int.semiring n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.hasDiv) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne))))) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))))) n)
-but is expected to have type
-  forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)))) n)
-Case conversion may be inaccurate. Consider using '#align int.add_one_div_two_mul_two_of_odd Int.add_one_ediv_two_mul_two_of_oddₓ'. -/
 theorem add_one_ediv_two_mul_two_of_odd : Odd n → 1 + n / 2 * 2 = n := by rintro ⟨c, rfl⟩;
   rw [add_comm]; convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.add_one_div_two_mul_two_of_odd Int.add_one_ediv_two_mul_two_of_odd
 
-/- warning: int.two_mul_div_two_of_odd -> Int.two_mul_ediv_two_of_odd is a dubious translation:
-lean 3 declaration is
-  forall {n : Int}, (Odd.{0} Int Int.semiring n) -> (Eq.{1} Int (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.hasMul) (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.hasDiv) n (OfNat.ofNat.{0} Int 2 (OfNat.mk.{0} Int 2 (bit0.{0} Int Int.hasAdd (One.one.{0} Int Int.hasOne)))))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) n (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
-but is expected to have type
-  forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) n (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
-Case conversion may be inaccurate. Consider using '#align int.two_mul_div_two_of_odd Int.two_mul_ediv_two_of_oddₓ'. -/
 theorem two_mul_ediv_two_of_odd (h : Odd n) : 2 * (n / 2) = n - 1 :=
   eq_sub_of_add_eq (two_mul_ediv_two_add_one_of_odd h)
 #align int.two_mul_div_two_of_odd Int.two_mul_ediv_two_of_odd
Diff
@@ -57,14 +57,8 @@ but is expected to have type
   forall {n : Int}, Iff (Odd.{0} Int Int.instSemiringInt n) (Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))
 Case conversion may be inaccurate. Consider using '#align int.odd_iff Int.odd_iffₓ'. -/
 theorem odd_iff : Odd n ↔ n % 2 = 1 :=
-  ⟨fun ⟨m, hm⟩ => by
-    rw [hm, add_mod]
-    norm_num, fun h =>
-    ⟨n / 2,
-      (emod_add_ediv n 2).symm.trans
-        (by
-          rw [h]
-          abel)⟩⟩
+  ⟨fun ⟨m, hm⟩ => by rw [hm, add_mod]; norm_num, fun h =>
+    ⟨n / 2, (emod_add_ediv n 2).symm.trans (by rw [h]; abel)⟩⟩
 #align int.odd_iff Int.odd_iff
 
 #print Int.not_even_iff /-
@@ -204,10 +198,7 @@ lean 3 declaration is
 but is expected to have type
   forall (n : Int), Not (Dvd.dvd.{0} Int Int.instDvdInt (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) n) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
 Case conversion may be inaccurate. Consider using '#align int.two_not_dvd_two_mul_add_one Int.two_not_dvd_two_mul_add_oneₓ'. -/
-theorem two_not_dvd_two_mul_add_one (n : ℤ) : ¬2 ∣ 2 * n + 1 :=
-  by
-  simp [add_mod]
-  rfl
+theorem two_not_dvd_two_mul_add_one (n : ℤ) : ¬2 ∣ 2 * n + 1 := by simp [add_mod]; rfl
 #align int.two_not_dvd_two_mul_add_one Int.two_not_dvd_two_mul_add_one
 
 #print Int.even_sub /-
@@ -277,10 +268,8 @@ but is expected to have type
   forall {m : Int} {n : Nat}, Iff (Even.{0} Int Int.instAddInt (HPow.hPow.{0, 0, 0} Int Nat Int Int.instHPowIntNat m n)) (And (Even.{0} Int Int.instAddInt m) (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
 Case conversion may be inaccurate. Consider using '#align int.even_pow Int.even_powₓ'. -/
 @[parity_simps]
-theorem even_pow {n : ℕ} : Even (m ^ n) ↔ Even m ∧ n ≠ 0 :=
-  by
-  induction' n with n ih <;> simp [*, even_mul, pow_succ]
-  tauto
+theorem even_pow {n : ℕ} : Even (m ^ n) ↔ Even m ∧ n ≠ 0 := by
+  induction' n with n ih <;> simp [*, even_mul, pow_succ]; tauto
 #align int.even_pow Int.even_pow
 
 /- warning: int.even_pow' -> Int.even_pow' is a dubious translation:
@@ -448,12 +437,8 @@ lean 3 declaration is
 but is expected to have type
   forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) n)
 Case conversion may be inaccurate. Consider using '#align int.two_mul_div_two_add_one_of_odd Int.two_mul_ediv_two_add_one_of_oddₓ'. -/
-theorem two_mul_ediv_two_add_one_of_odd : Odd n → 2 * (n / 2) + 1 = n :=
-  by
-  rintro ⟨c, rfl⟩
-  rw [mul_comm]
-  convert Int.div_add_mod' _ _
-  simpa [Int.add_emod]
+theorem two_mul_ediv_two_add_one_of_odd : Odd n → 2 * (n / 2) + 1 = n := by rintro ⟨c, rfl⟩;
+  rw [mul_comm]; convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.two_mul_div_two_add_one_of_odd Int.two_mul_ediv_two_add_one_of_odd
 
 /- warning: int.div_two_mul_two_add_one_of_odd -> Int.ediv_two_mul_two_add_one_of_odd is a dubious translation:
@@ -462,11 +447,8 @@ lean 3 declaration is
 but is expected to have type
   forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) n)
 Case conversion may be inaccurate. Consider using '#align int.div_two_mul_two_add_one_of_odd Int.ediv_two_mul_two_add_one_of_oddₓ'. -/
-theorem ediv_two_mul_two_add_one_of_odd : Odd n → n / 2 * 2 + 1 = n :=
-  by
-  rintro ⟨c, rfl⟩
-  convert Int.div_add_mod' _ _
-  simpa [Int.add_emod]
+theorem ediv_two_mul_two_add_one_of_odd : Odd n → n / 2 * 2 + 1 = n := by rintro ⟨c, rfl⟩;
+  convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.div_two_mul_two_add_one_of_odd Int.ediv_two_mul_two_add_one_of_odd
 
 /- warning: int.add_one_div_two_mul_two_of_odd -> Int.add_one_ediv_two_mul_two_of_odd is a dubious translation:
@@ -475,12 +457,8 @@ lean 3 declaration is
 but is expected to have type
   forall {n : Int}, (Odd.{0} Int Int.instSemiringInt n) -> (Eq.{1} Int (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)) (HMul.hMul.{0, 0, 0} Int Int Int (instHMul.{0} Int Int.instMulInt) (HDiv.hDiv.{0, 0, 0} Int Int Int (instHDiv.{0} Int Int.instDivInt_1) n (OfNat.ofNat.{0} Int 2 (instOfNatInt 2))) (OfNat.ofNat.{0} Int 2 (instOfNatInt 2)))) n)
 Case conversion may be inaccurate. Consider using '#align int.add_one_div_two_mul_two_of_odd Int.add_one_ediv_two_mul_two_of_oddₓ'. -/
-theorem add_one_ediv_two_mul_two_of_odd : Odd n → 1 + n / 2 * 2 = n :=
-  by
-  rintro ⟨c, rfl⟩
-  rw [add_comm]
-  convert Int.div_add_mod' _ _
-  simpa [Int.add_emod]
+theorem add_one_ediv_two_mul_two_of_odd : Odd n → 1 + n / 2 * 2 = n := by rintro ⟨c, rfl⟩;
+  rw [add_comm]; convert Int.div_add_mod' _ _; simpa [Int.add_emod]
 #align int.add_one_div_two_mul_two_of_odd Int.add_one_ediv_two_mul_two_of_odd
 
 /- warning: int.two_mul_div_two_of_odd -> Int.two_mul_ediv_two_of_odd is a dubious translation:
Diff
@@ -362,7 +362,7 @@ theorem even_coe_nat (n : ℕ) : Even (n : ℤ) ↔ Even n := by rw_mod_cast [ev
 lean 3 declaration is
   forall (n : Nat), Iff (Odd.{0} Int Int.semiring ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat Int (HasLiftT.mk.{1, 1} Nat Int (CoeTCₓ.coe.{1, 1} Nat Int (coeBase.{1, 1} Nat Int Int.hasCoe))) n)) (Odd.{0} Nat Nat.semiring n)
 but is expected to have type
-  forall (n : Nat), Iff (Odd.{0} Int Int.instSemiringInt (Nat.cast.{0} Int Int.instNatCastInt n)) (Odd.{0} Nat Nat.semiring n)
+  forall (n : Nat), Iff (Odd.{0} Int Int.instSemiringInt (Nat.cast.{0} Int instNatCastInt n)) (Odd.{0} Nat Nat.semiring n)
 Case conversion may be inaccurate. Consider using '#align int.odd_coe_nat Int.odd_coe_natₓ'. -/
 @[simp, norm_cast]
 theorem odd_coe_nat (n : ℕ) : Odd (n : ℤ) ↔ Odd n := by

Changes in mathlib4

mathlib3
mathlib4
chore: refactor to avoid importing Ring for Group topics (#11913)

This is a far from a complete success at the PR title, but it makes a fair bit of progress, and then guards this with appropriate assert_not_exists Ring statements.

It also breaks apart the Mathlib.GroupTheory.Subsemigroup.[Center|Centralizer] files, to pull the Set.center and Set.centralizer declarations into their own files not depending on Subsemigroup.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -3,9 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
 -/
-import Mathlib.Algebra.Ring.Int
-import Mathlib.Data.Int.Sqrt
 import Mathlib.Data.Nat.Parity
+import Mathlib.Algebra.Group.Int
+import Mathlib.Data.Int.Sqrt
 import Mathlib.Tactic.Abel
 
 #align_import data.int.parity from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
chore(Data/Nat/Defs): Integrate Nat.sqrt material (#11866)

Move the content of Data.Nat.ForSqrt and Data.Nat.Sqrt to Data.Nat.Defs by using Nat-specific Std lemmas rather than the mathlib general ones. This makes it ready to move to Std if wanted.

Diff
@@ -3,8 +3,9 @@ Copyright (c) 2019 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
 -/
-import Mathlib.Data.Nat.Parity
 import Mathlib.Algebra.Ring.Int
+import Mathlib.Data.Int.Sqrt
+import Mathlib.Data.Nat.Parity
 import Mathlib.Tactic.Abel
 
 #align_import data.int.parity from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
@@ -95,6 +96,11 @@ instance : DecidablePred (Even : ℤ → Prop) := fun _ => decidable_of_iff _ ev
 
 instance : DecidablePred (Odd : ℤ → Prop) := fun _ => decidable_of_iff _ odd_iff_not_even.symm
 
+/-- `IsSquare` can be decided on `ℤ` by checking against the square root. -/
+instance : DecidablePred (IsSquare : ℤ → Prop) :=
+  fun m ↦ decidable_of_iff' (sqrt m * sqrt m = m) <| by
+    simp_rw [← exists_mul_self m, IsSquare, eq_comm]
+
 @[simp]
 theorem not_even_one : ¬Even (1 : ℤ) := by
   rw [even_iff]
chore: Split Data.{Nat,Int}{.Order}.Basic in group vs ring instances (#11924)

Scatter the content of Data.Nat.Basic across:

  • Data.Nat.Defs for the lemmas having no dependencies
  • Algebra.Group.Nat for the monoid instances and the few miscellaneous lemmas needing them.
  • Algebra.Ring.Nat for the semiring instance and the few miscellaneous lemmas following it.

Similarly, scatter

  • Data.Int.Basic across Data.Int.Defs, Algebra.Group.Int, Algebra.Ring.Int
  • Data.Nat.Order.Basic across Data.Nat.Defs, Algebra.Order.Group.Nat, Algebra.Order.Ring.Nat
  • Data.Int.Order.Basic across Data.Int.Defs, Algebra.Order.Group.Int, Algebra.Order.Ring.Int

Also move a few lemmas from Data.Nat.Order.Lemmas to Data.Nat.Defs.

Before pre_11924

After post_11924

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
 -/
 import Mathlib.Data.Nat.Parity
-import Mathlib.Data.Int.Basic
+import Mathlib.Algebra.Ring.Int
 import Mathlib.Tactic.Abel
 
 #align_import data.int.parity from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
chore(Data/Int): Rename coe_nat to natCast (#11637)

Reduce the diff of #11499

Renames

All in the Int namespace:

  • ofNat_eq_castofNat_eq_natCast
  • cast_eq_cast_iff_NatnatCast_inj
  • natCast_eq_ofNatofNat_eq_natCast
  • coe_nat_subnatCast_sub
  • coe_nat_nonnegnatCast_nonneg
  • sign_coe_add_onesign_natCast_add_one
  • nat_succ_eq_int_succnatCast_succ
  • succ_neg_nat_succsucc_neg_natCast_succ
  • coe_pred_of_posnatCast_pred_of_pos
  • coe_nat_divnatCast_div
  • coe_nat_edivnatCast_ediv
  • sign_coe_nat_of_nonzerosign_natCast_of_ne_zero
  • toNat_coe_nattoNat_natCast
  • toNat_coe_nat_add_onetoNat_natCast_add_one
  • coe_nat_dvdnatCast_dvd_natCast
  • coe_nat_dvd_leftnatCast_dvd
  • coe_nat_dvd_rightdvd_natCast
  • le_coe_nat_suble_natCast_sub
  • succ_coe_nat_possucc_natCast_pos
  • coe_nat_modEq_iffnatCast_modEq_iff
  • coe_natAbsnatCast_natAbs
  • coe_nat_eq_zeronatCast_eq_zero
  • coe_nat_ne_zeronatCast_ne_zero
  • coe_nat_ne_zero_iff_posnatCast_ne_zero_iff_pos
  • abs_coe_natabs_natCast
  • coe_nat_nonpos_iffnatCast_nonpos_iff

Also rename Nat.coe_nat_dvd to Nat.cast_dvd_cast

Diff
@@ -217,7 +217,7 @@ theorem odd_coe_nat (n : ℕ) : Odd (n : ℤ) ↔ Odd n := by
 
 @[simp]
 theorem natAbs_even : Even n.natAbs ↔ Even n := by
-  simp [even_iff_two_dvd, dvd_natAbs, coe_nat_dvd_left.symm]
+  simp [even_iff_two_dvd, dvd_natAbs, natCast_dvd.symm]
 #align int.nat_abs_even Int.natAbs_even
 
 -- Porting note (#10618): was simp. simp can prove this.
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
@@ -245,7 +245,7 @@ theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) :
     rw [Int.even_add, ← Int.even_sub] at h
     obtain ⟨k, hk⟩ := h
     convert dvd_mul_right 4 k using 1
-    rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel, ← two_mul, ← mul_assoc]
+    rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel_right, ← two_mul, ← mul_assoc]
     rfl
   · left
     obtain ⟨k, hk⟩ := h
chore: classify simp can do this porting notes (#10619)

Classify by adding issue number (#10618) to porting notes claiming anything semantically equivalent to simp can prove this or simp can simplify this.

Diff
@@ -209,7 +209,7 @@ theorem even_coe_nat (n : ℕ) : Even (n : ℤ) ↔ Even n := by
   rw_mod_cast [even_iff, Nat.even_iff]
 #align int.even_coe_nat Int.even_coe_nat
 
--- Porting note: was simp. simp can prove this.
+-- Porting note (#10618): was simp. simp can prove this.
 @[norm_cast]
 theorem odd_coe_nat (n : ℕ) : Odd (n : ℤ) ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, even_coe_nat]
@@ -220,7 +220,7 @@ theorem natAbs_even : Even n.natAbs ↔ Even n := by
   simp [even_iff_two_dvd, dvd_natAbs, coe_nat_dvd_left.symm]
 #align int.nat_abs_even Int.natAbs_even
 
--- Porting note: was simp. simp can prove this.
+-- Porting note (#10618): was simp. simp can prove this.
 --@[simp]
 theorem natAbs_odd : Odd n.natAbs ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, natAbs_even]
feat: add lake exe shake to CI (#9751)

This checks files for unused imports. The output here is piped through gh-problem-matcher-wrap so that it will show up as annotations.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
 -/
 import Mathlib.Data.Nat.Parity
+import Mathlib.Data.Int.Basic
 import Mathlib.Tactic.Abel
 
 #align_import data.int.parity from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
feat: Int.{even_sub_one,even_mul_pred_self} (#9859)

Also rename Nat.even_mul_self_pred for consistency with Nat.even_mul_succ_self.

Diff
@@ -135,6 +135,10 @@ theorem even_add_one : Even (n + 1) ↔ ¬Even n := by
   simp [even_add]
 #align int.even_add_one Int.even_add_one
 
+@[parity_simps]
+theorem even_sub_one : Even (n - 1) ↔ ¬Even n := by
+  simp [even_sub]
+
 @[parity_simps]
 theorem even_mul : Even (m * n) ↔ Even m ∨ Even n := by
   cases' emod_two_eq_zero_or_one m with h₁ h₁ <;>
@@ -196,6 +200,9 @@ theorem even_mul_succ_self (n : ℤ) : Even (n * (n + 1)) := by
   simpa [even_mul, parity_simps] using n.even_or_odd
 #align int.even_mul_succ_self Int.even_mul_succ_self
 
+theorem even_mul_pred_self (n : ℤ) : Even (n * (n - 1)) := by
+  simpa [even_mul, parity_simps] using n.even_or_odd
+
 @[simp, norm_cast]
 theorem even_coe_nat (n : ℕ) : Even (n : ℤ) ↔ Even n := by
   rw_mod_cast [even_iff, Nat.even_iff]
chore: tidy various files (#8818)
Diff
@@ -104,8 +104,7 @@ theorem not_even_one : ¬Even (1 : ℤ) := by
 theorem even_add : Even (m + n) ↔ (Even m ↔ Even n) := by
   cases' emod_two_eq_zero_or_one m with h₁ h₁ <;>
   cases' emod_two_eq_zero_or_one n with h₂ h₂ <;>
-  simp [even_iff, h₁, h₂, Int.add_emod]
-  rfl
+  simp [even_iff, h₁, h₂, Int.add_emod, one_add_one_eq_two, emod_self]
 #align int.even_add Int.even_add
 
 theorem even_add' : Even (m + n) ↔ (Odd m ↔ Odd n) := by
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -27,6 +27,9 @@ theorem emod_two_ne_one : ¬n % 2 = 1 ↔ n % 2 = 0 := by
   cases' emod_two_eq_zero_or_one n with h h <;> simp [h]
 #align int.mod_two_ne_one Int.emod_two_ne_one
 
+@[simp]
+theorem one_emod_two : (1 : Int) % 2 = 1 := rfl
+
 -- `EuclideanDomain.mod_eq_zero` uses (2 ∣ n) as normal form
 @[local simp]
 theorem emod_two_ne_zero : ¬n % 2 = 0 ↔ n % 2 = 1 := by
@@ -102,6 +105,7 @@ theorem even_add : Even (m + n) ↔ (Even m ↔ Even n) := by
   cases' emod_two_eq_zero_or_one m with h₁ h₁ <;>
   cases' emod_two_eq_zero_or_one n with h₂ h₂ <;>
   simp [even_iff, h₁, h₂, Int.add_emod]
+  rfl
 #align int.even_add Int.even_add
 
 theorem even_add' : Even (m + n) ↔ (Odd m ↔ Odd n) := by
@@ -279,8 +283,8 @@ theorem two_mul_ediv_two_of_odd (h : Odd n) : 2 * (n / 2) = n - 1 :=
 
 -- Here are examples of how `parity_simps` can be used with `Int`.
 example (m n : ℤ) (h : Even m) : ¬Even (n + 3) ↔ Even (m ^ 2 + m + n) := by
-  simp [*, (by decide : ¬2 = 0), parity_simps]
+  simp (config := {decide := true}) [*, (by decide : ¬2 = 0), parity_simps]
 
-example : ¬Even (25394535 : ℤ) := by simp
+example : ¬Even (25394535 : ℤ) := by decide
 
 end Int
feat: patch for new alias command (#6172)
Diff
@@ -215,10 +215,10 @@ theorem natAbs_odd : Odd n.natAbs ↔ Odd n := by
   rw [odd_iff_not_even, Nat.odd_iff_not_even, natAbs_even]
 #align int.nat_abs_odd Int.natAbs_odd
 
-alias natAbs_even ↔ _ _root_.Even.natAbs
+alias ⟨_, _root_.Even.natAbs⟩ := natAbs_even
 #align even.nat_abs Even.natAbs
 
-alias natAbs_odd ↔ _ _root_.Odd.natAbs
+alias ⟨_, _root_.Odd.natAbs⟩ := natAbs_odd
 #align odd.nat_abs Odd.natAbs
 
 -- Porting note: "protected"-attribute not implemented yet.
chore: tidy various files (#6158)
Diff
@@ -27,8 +27,7 @@ theorem emod_two_ne_one : ¬n % 2 = 1 ↔ n % 2 = 0 := by
   cases' emod_two_eq_zero_or_one n with h h <;> simp [h]
 #align int.mod_two_ne_one Int.emod_two_ne_one
 
--- Porting note: This comment from mathlib3 refers to a future file, revisit it once ported:
--- euclidean_domain.mod_eq_zero uses (2 ∣ n) as normal form
+-- `EuclideanDomain.mod_eq_zero` uses (2 ∣ n) as normal form
 @[local simp]
 theorem emod_two_ne_zero : ¬n % 2 = 0 ↔ n % 2 = 1 := by
   cases' emod_two_eq_zero_or_one n with h h <;> simp [h]
@@ -278,7 +277,7 @@ theorem two_mul_ediv_two_of_odd (h : Odd n) : 2 * (n / 2) = n - 1 :=
   eq_sub_of_add_eq (two_mul_ediv_two_add_one_of_odd h)
 #align int.two_mul_div_two_of_odd Int.two_mul_ediv_two_of_odd
 
--- Here are examples of how `parity_simps` can be used with `int`.
+-- Here are examples of how `parity_simps` can be used with `Int`.
 example (m n : ℤ) (h : Even m) : ¬Even (n + 3) ↔ Even (m ^ 2 + m + n) := by
   simp [*, (by decide : ¬2 = 0), parity_simps]
 
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,15 +2,12 @@
 Copyright (c) 2019 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Benjamin Davidson
-
-! This file was ported from Lean 3 source module data.int.parity
-! leanprover-community/mathlib commit e3d9ab8faa9dea8f78155c6c27d62a621f4c152d
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Nat.Parity
 import Mathlib.Tactic.Abel
 
+#align_import data.int.parity from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d"
+
 /-!
 # Parity of integers
 
feat: Int.odd_pow (#3402)

analogous to Int.even_pow and Int.even_pow'

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -164,6 +164,13 @@ theorem even_pow' {n : ℕ} (h : n ≠ 0) : Even (m ^ n) ↔ Even m :=
   even_pow.trans <| and_iff_left h
 #align int.even_pow' Int.even_pow'
 
+@[parity_simps]
+theorem odd_pow {n : ℕ} : Odd (m ^ n) ↔ Odd m ∨ n = 0 := by
+  rw [← not_iff_not, ← Int.even_iff_not_odd, not_or, ← Int.even_iff_not_odd, Int.even_pow]
+
+theorem odd_pow' {n : ℕ} (h : n ≠ 0) : Odd (m ^ n) ↔ Odd m :=
+  odd_pow.trans <| or_iff_left h
+
 @[parity_simps]
 theorem odd_add : Odd (m + n) ↔ (Odd m ↔ Even n) := by
   rw [odd_iff_not_even, even_add, not_iff, odd_iff_not_even]
feat: improvements to congr! and convert (#2606)
  • There is now configuration for congr!, convert, and convert_to to control parts of the congruence algorithm, in particular transparency settings when applying congruence lemmas.
  • congr! now applies congruence lemmas with reducible transparency by default. This prevents it from unfolding definitions when applying congruence lemmas. It also now tries both the LHS-biased and RHS-biased simp congruence lemmas, with a configuration option to set which it should try first.
  • There is now a new HEq congruence lemma generator that gives each hypothesis access to the proofs of previous hypotheses. This means that if you have an equality ⊢ ⟨a, x⟩ = ⟨b, y⟩ of sigma types, congr! turns this into goals ⊢ a = b and ⊢ a = b → HEq x y (note that congr! will also auto-introduce a = b for you in the second goal). This congruence lemma generator applies to more cases than the simp congruence lemma generator does.
  • congr! (and hence convert) are more careful about applying lemmas that don't force definitions to unfold. There were a number of cases in mathlib where the implementation of congr was being abused to unfold definitions.
  • With set_option trace.congr! true you can see what congr! sees when it is deciding on congruence lemmas.
  • There is also a bug fix in convert_to to do using 1 when there is no using clause, to match its documentation.

Note that congr! is more capable than congr at finding a way to equate left-hand sides and right-hand sides, so you will frequently need to limit its depth with a using clause. However, there is also a new heuristic to prevent considering unlikely-to-be-provable type equalities (controlled by the typeEqs option), which can help limit the depth automatically.

There is also a predefined configuration that you can invoke with, for example, convert (config := .unfoldSameFun) h, that causes it to behave more like congr, including using default transparency when unfolding.

Diff
@@ -68,13 +68,8 @@ theorem even_or_odd (n : ℤ) : Even n ∨ Odd n :=
   Or.imp_right odd_iff_not_even.2 <| em <| Even n
 #align int.even_or_odd Int.even_or_odd
 
--- Porting note: TODO. I'm struggling that `Even` uses `k + k` while Odd uses `2 * k`,
--- does this proof need golfing?
--- mathlib3 port: `simpa only [← two_mul, exists_or, ← Odd, ← Even] using even_or_odd n`
 theorem even_or_odd' (n : ℤ) : ∃ k, n = 2 * k ∨ n = 2 * k + 1 := by
-  rw [exists_or]
-  convert even_or_odd n
-  rw [two_mul]
+  simpa only [two_mul, exists_or, Odd, Even] using even_or_odd n
 #align int.even_or_odd' Int.even_or_odd'
 
 theorem even_xor'_odd (n : ℤ) : Xor' (Even n) (Odd n) := by
@@ -192,9 +187,7 @@ theorem odd_sub' : Odd (m - n) ↔ (Odd n ↔ Even m) := by
 #align int.odd_sub' Int.odd_sub'
 
 theorem even_mul_succ_self (n : ℤ) : Even (n * (n + 1)) := by
-  rw [even_mul]
-  convert n.even_or_odd
-  simp [parity_simps]
+  simpa [even_mul, parity_simps] using n.even_or_odd
 #align int.even_mul_succ_self Int.even_mul_succ_self
 
 @[simp, norm_cast]
@@ -237,12 +230,12 @@ theorem four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) :
   · right
     rw [Int.even_add, ← Int.even_sub] at h
     obtain ⟨k, hk⟩ := h
-    convert dvd_mul_right 4 k
+    convert dvd_mul_right 4 k using 1
     rw [eq_add_of_sub_eq hk, mul_add, add_assoc, add_sub_cancel, ← two_mul, ← mul_assoc]
     rfl
   · left
     obtain ⟨k, hk⟩ := h
-    convert dvd_mul_right 4 (k + 1)
+    convert dvd_mul_right 4 (k + 1) using 1
     rw [eq_sub_of_add_eq hk, add_right_comm, ← add_sub, mul_add, mul_sub, add_assoc, add_assoc,
       sub_add, add_assoc, ← sub_sub (2 * n), sub_self, zero_sub, sub_neg_eq_add, ← mul_assoc,
       mul_add]
feat: tactic congr! and improvement to convert (#2566)

This introduces a tactic congr! that is an analogue to mathlib 3's congr'. It is a more insistent version of congr that makes use of more congruence lemmas (including user congruence lemmas), propext, funext, and Subsingleton instances. It also has a feature to lift reflexive relations to equalities. Along with funext, the tactic does intros, allowing congr! to get access to function bodies; the introduced variables can be named using rename_i if needed.

This also modifies convert to use congr! rather than congr, which makes it work more like the mathlib3 version of the tactic.

Diff
@@ -74,7 +74,6 @@ theorem even_or_odd (n : ℤ) : Even n ∨ Odd n :=
 theorem even_or_odd' (n : ℤ) : ∃ k, n = 2 * k ∨ n = 2 * k + 1 := by
   rw [exists_or]
   convert even_or_odd n
-  funext i
   rw [two_mul]
 #align int.even_or_odd' Int.even_or_odd'
 
feat: port Data.Int.Parity (#1836)

Dependencies 3 + 130

131 files ported (97.8%)
52722 lines ported (98.1%)
Show graph

The unported dependencies are