data.int.intervalMathlib.Data.Int.Interval

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)

(last sync)

feat(data/*/interval): finset.uIcc on concrete structures (#18838)

Calculate the size of finset.uIcc in , , fin, prod, pi, multiset, finset...

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -92,18 +92,18 @@ lemma Ioc_eq_finset_map :
 lemma Ioo_eq_finset_map :
   Ioo a b = (finset.range (b - a - 1).to_nat).map
     (nat.cast_embedding.trans $ add_left_embedding (a + 1)) := rfl
+lemma uIcc_eq_finset_map : uIcc a b = (range (max a b + 1 - min a b).to_nat).map
+    (nat.cast_embedding.trans $ add_left_embedding $ min a b) := rfl
 
-@[simp] lemma card_Icc : (Icc a b).card = (b + 1 - a).to_nat :=
-by { change (finset.map _ _).card = _, rw [finset.card_map, finset.card_range] }
+@[simp] lemma card_Icc : (Icc a b).card = (b + 1 - a).to_nat := (card_map _).trans $ card_range _
+@[simp] lemma card_Ico : (Ico a b).card = (b - a).to_nat := (card_map _).trans $ card_range _
+@[simp] lemma card_Ioc : (Ioc a b).card = (b - a).to_nat := (card_map _).trans $ card_range _
+@[simp] lemma card_Ioo : (Ioo a b).card = (b - a - 1).to_nat := (card_map _).trans $ card_range _
 
-@[simp] lemma card_Ico : (Ico a b).card = (b - a).to_nat :=
-by { change (finset.map _ _).card = _, rw [finset.card_map, finset.card_range] }
-
-@[simp] lemma card_Ioc : (Ioc a b).card = (b - a).to_nat :=
-by { change (finset.map _ _).card = _, rw [finset.card_map, finset.card_range] }
-
-@[simp] lemma card_Ioo : (Ioo a b).card = (b - a - 1).to_nat :=
-by { change (finset.map _ _).card = _, rw [finset.card_map, finset.card_range] }
+@[simp] lemma card_uIcc : (uIcc a b).card = (b - a).nat_abs + 1 :=
+(card_map _).trans $ int.coe_nat_inj $ by rw [card_range, sup_eq_max, inf_eq_min,
+  int.to_nat_of_nonneg (sub_nonneg_of_le $ le_add_one min_le_max), int.coe_nat_add, int.coe_nat_abs,
+  add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, int.coe_nat_one]
 
 lemma card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a :=
 by rw [card_Icc, to_nat_sub_of_le h]
@@ -129,6 +129,9 @@ by rw [←card_Ioc, fintype.card_of_finset]
 @[simp] lemma card_fintype_Ioo : fintype.card (set.Ioo a b) = (b - a - 1).to_nat :=
 by rw [←card_Ioo, fintype.card_of_finset]
 
+@[simp] lemma card_fintype_uIcc : fintype.card (set.uIcc a b) = (b - a).nat_abs + 1 :=
+by rw [←card_uIcc, fintype.card_of_finset]
+
 lemma card_fintype_Icc_of_le (h : a ≤ b + 1) : (fintype.card (set.Icc a b) : ℤ) = b + 1 - a :=
 by rw [card_fintype_Icc, to_nat_sub_of_le h]
 

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
 import Algebra.CharZero.Lemmas
-import Order.LocallyFinite
-import Data.Finset.LocallyFinite.Basic
+import Order.Interval.Finset.Defs
+import Order.Interval.Finset.Basic
 
 #align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
Diff
@@ -5,7 +5,7 @@ Authors: Yaël Dillies
 -/
 import Algebra.CharZero.Lemmas
 import Order.LocallyFinite
-import Data.Finset.LocallyFinite
+import Data.Finset.LocallyFinite.Basic
 
 #align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
@@ -43,7 +43,7 @@ instance : LocallyFiniteOrder ℤ
       use(x - a).toNat
       rw [← lt_add_one_iff] at hb
       rw [to_nat_sub_of_le ha]
-      exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
+      exact ⟨sub_lt_sub_right hb _, add_sub_cancel _ _⟩
   finset_mem_Ico a b x :=
     by
     simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
@@ -54,7 +54,7 @@ instance : LocallyFiniteOrder ℤ
     · rintro ⟨ha, hb⟩
       use(x - a).toNat
       rw [to_nat_sub_of_le ha]
-      exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
+      exact ⟨sub_lt_sub_right hb _, add_sub_cancel _ _⟩
   finset_mem_Ioc a b x :=
     by
     simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
@@ -65,8 +65,8 @@ instance : LocallyFiniteOrder ℤ
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use(x - (a + 1)).toNat
-      rw [to_nat_sub_of_le ha, ← add_one_le_iff, sub_add, add_sub_cancel]
-      exact ⟨sub_le_sub_right hb _, add_sub_cancel'_right _ _⟩
+      rw [to_nat_sub_of_le ha, ← add_one_le_iff, sub_add, add_sub_cancel_right]
+      exact ⟨sub_le_sub_right hb _, add_sub_cancel _ _⟩
   finset_mem_Ioo a b x :=
     by
     simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
@@ -78,7 +78,7 @@ instance : LocallyFiniteOrder ℤ
     · rintro ⟨ha, hb⟩
       use(x - (a + 1)).toNat
       rw [to_nat_sub_of_le ha, sub_sub]
-      exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
+      exact ⟨sub_lt_sub_right hb _, add_sub_cancel _ _⟩
 
 namespace Int
 
@@ -159,7 +159,7 @@ theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
     Int.ofNat.inj <| by
       rw [card_range, sup_eq_max, inf_eq_min,
         Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
-        Int.coe_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
+        Int.natCast_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
 #align int.card_uIcc Int.card_uIcc
 -/
 
Diff
@@ -37,11 +37,11 @@ instance : LocallyFiniteOrder ℤ
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
-      rw [lt_sub_iff_add_lt, Int.lt_add_one_iff, add_comm] at h 
+      rw [lt_sub_iff_add_lt, Int.lt_add_one_iff, add_comm] at h
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use(x - a).toNat
-      rw [← lt_add_one_iff] at hb 
+      rw [← lt_add_one_iff] at hb
       rw [to_nat_sub_of_le ha]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ico a b x :=
@@ -61,7 +61,7 @@ instance : LocallyFiniteOrder ℤ
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
-      rw [← add_one_le_iff, le_sub_iff_add_le', add_comm _ (1 : ℤ), ← add_assoc] at h 
+      rw [← add_one_le_iff, le_sub_iff_add_le', add_comm _ (1 : ℤ), ← add_assoc] at h
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use(x - (a + 1)).toNat
@@ -73,7 +73,7 @@ instance : LocallyFiniteOrder ℤ
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
-      rw [sub_sub, lt_sub_iff_add_lt'] at h 
+      rw [sub_sub, lt_sub_iff_add_lt'] at h
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use(x - (a + 1)).toNat
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Algebra.CharZero.Lemmas
-import Mathbin.Order.LocallyFinite
-import Mathbin.Data.Finset.LocallyFinite
+import Algebra.CharZero.Lemmas
+import Order.LocallyFinite
+import Data.Finset.LocallyFinite
 
 #align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
Diff
@@ -40,7 +40,7 @@ instance : LocallyFiniteOrder ℤ
       rw [lt_sub_iff_add_lt, Int.lt_add_one_iff, add_comm] at h 
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
-      use (x - a).toNat
+      use(x - a).toNat
       rw [← lt_add_one_iff] at hb 
       rw [to_nat_sub_of_le ha]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
@@ -52,7 +52,7 @@ instance : LocallyFiniteOrder ℤ
     · rintro ⟨a, h, rfl⟩
       exact ⟨Int.le.intro rfl, lt_sub_iff_add_lt'.mp h⟩
     · rintro ⟨ha, hb⟩
-      use (x - a).toNat
+      use(x - a).toNat
       rw [to_nat_sub_of_le ha]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ioc a b x :=
@@ -64,7 +64,7 @@ instance : LocallyFiniteOrder ℤ
       rw [← add_one_le_iff, le_sub_iff_add_le', add_comm _ (1 : ℤ), ← add_assoc] at h 
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
-      use (x - (a + 1)).toNat
+      use(x - (a + 1)).toNat
       rw [to_nat_sub_of_le ha, ← add_one_le_iff, sub_add, add_sub_cancel]
       exact ⟨sub_le_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ioo a b x :=
@@ -76,7 +76,7 @@ instance : LocallyFiniteOrder ℤ
       rw [sub_sub, lt_sub_iff_add_lt'] at h 
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
-      use (x - (a + 1)).toNat
+      use(x - (a + 1)).toNat
       rw [to_nat_sub_of_le ha, sub_sub]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.int.interval
-! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.CharZero.Lemmas
 import Mathbin.Order.LocallyFinite
 import Mathbin.Data.Finset.LocallyFinite
 
+#align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
+
 /-!
 # Finite intervals of integers
 
Diff
@@ -118,12 +118,14 @@ theorem Ioo_eq_finset_map :
 #align int.Ioo_eq_finset_map Int.Ioo_eq_finset_map
 -/
 
+#print Int.uIcc_eq_finset_map /-
 theorem uIcc_eq_finset_map :
     uIcc a b =
       (range (max a b + 1 - min a b).toNat).map
         (Nat.castEmbedding.trans <| addLeftEmbedding <| min a b) :=
   rfl
 #align int.uIcc_eq_finset_map Int.uIcc_eq_finset_map
+-/
 
 #print Int.card_Icc /-
 @[simp]
@@ -153,6 +155,7 @@ theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat :=
 #align int.card_Ioo Int.card_Ioo
 -/
 
+#print Int.card_uIcc /-
 @[simp]
 theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
   (card_map _).trans <|
@@ -161,6 +164,7 @@ theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
         Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
         Int.coe_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
 #align int.card_uIcc Int.card_uIcc
+-/
 
 #print Int.card_Icc_of_le /-
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
@@ -214,10 +218,12 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
 -/
 
+#print Int.card_fintype_uIcc /-
 @[simp]
-theorem card_fintypeUIcc : Fintype.card (Set.uIcc a b) = (b - a).natAbs + 1 := by
+theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a).natAbs + 1 := by
   rw [← card_uIcc, Fintype.card_ofFinset]
-#align int.card_fintype_uIcc Int.card_fintypeUIcc
+#align int.card_fintype_uIcc Int.card_fintype_uIcc
+-/
 
 #print Int.card_fintype_Icc_of_le /-
 theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a := by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.int.interval
-! leanprover-community/mathlib commit fac369018417f980cec5fcdafc766a69f88d8cfe
+! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -118,34 +118,50 @@ theorem Ioo_eq_finset_map :
 #align int.Ioo_eq_finset_map Int.Ioo_eq_finset_map
 -/
 
+theorem uIcc_eq_finset_map :
+    uIcc a b =
+      (range (max a b + 1 - min a b).toNat).map
+        (Nat.castEmbedding.trans <| addLeftEmbedding <| min a b) :=
+  rfl
+#align int.uIcc_eq_finset_map Int.uIcc_eq_finset_map
+
 #print Int.card_Icc /-
 @[simp]
-theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := by change (Finset.map _ _).card = _;
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat :=
+  (card_map _).trans <| card_range _
 #align int.card_Icc Int.card_Icc
 -/
 
 #print Int.card_Ico /-
 @[simp]
-theorem card_Ico : (Ico a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Ico : (Ico a b).card = (b - a).toNat :=
+  (card_map _).trans <| card_range _
 #align int.card_Ico Int.card_Ico
 -/
 
 #print Int.card_Ioc /-
 @[simp]
-theorem card_Ioc : (Ioc a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Ioc : (Ioc a b).card = (b - a).toNat :=
+  (card_map _).trans <| card_range _
 #align int.card_Ioc Int.card_Ioc
 -/
 
 #print Int.card_Ioo /-
 @[simp]
-theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := by change (Finset.map _ _).card = _;
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat :=
+  (card_map _).trans <| card_range _
 #align int.card_Ioo Int.card_Ioo
 -/
 
+@[simp]
+theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
+  (card_map _).trans <|
+    Int.ofNat.inj <| by
+      rw [card_range, sup_eq_max, inf_eq_min,
+        Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
+        Int.coe_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
+#align int.card_uIcc Int.card_uIcc
+
 #print Int.card_Icc_of_le /-
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
   rw [card_Icc, to_nat_sub_of_le h]
@@ -198,6 +214,11 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
 -/
 
+@[simp]
+theorem card_fintypeUIcc : Fintype.card (Set.uIcc a b) = (b - a).natAbs + 1 := by
+  rw [← card_uIcc, Fintype.card_ofFinset]
+#align int.card_fintype_uIcc Int.card_fintypeUIcc
+
 #print Int.card_fintype_Icc_of_le /-
 theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a := by
   rw [card_fintype_Icc, to_nat_sub_of_le h]
Diff
@@ -87,101 +87,142 @@ namespace Int
 
 variable (a b : ℤ)
 
+#print Int.Icc_eq_finset_map /-
 theorem Icc_eq_finset_map :
     Icc a b =
       (Finset.range (b + 1 - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding a) :=
   rfl
 #align int.Icc_eq_finset_map Int.Icc_eq_finset_map
+-/
 
+#print Int.Ico_eq_finset_map /-
 theorem Ico_eq_finset_map :
     Ico a b = (Finset.range (b - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding a) :=
   rfl
 #align int.Ico_eq_finset_map Int.Ico_eq_finset_map
+-/
 
+#print Int.Ioc_eq_finset_map /-
 theorem Ioc_eq_finset_map :
     Ioc a b =
       (Finset.range (b - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)) :=
   rfl
 #align int.Ioc_eq_finset_map Int.Ioc_eq_finset_map
+-/
 
+#print Int.Ioo_eq_finset_map /-
 theorem Ioo_eq_finset_map :
     Ioo a b =
       (Finset.range (b - a - 1).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)) :=
   rfl
 #align int.Ioo_eq_finset_map Int.Ioo_eq_finset_map
+-/
 
+#print Int.card_Icc /-
 @[simp]
 theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Icc Int.card_Icc
+-/
 
+#print Int.card_Ico /-
 @[simp]
 theorem card_Ico : (Ico a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ico Int.card_Ico
+-/
 
+#print Int.card_Ioc /-
 @[simp]
 theorem card_Ioc : (Ioc a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ioc Int.card_Ioc
+-/
 
+#print Int.card_Ioo /-
 @[simp]
 theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ioo Int.card_Ioo
+-/
 
+#print Int.card_Icc_of_le /-
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
   rw [card_Icc, to_nat_sub_of_le h]
 #align int.card_Icc_of_le Int.card_Icc_of_le
+-/
 
+#print Int.card_Ico_of_le /-
 theorem card_Ico_of_le (h : a ≤ b) : ((Ico a b).card : ℤ) = b - a := by
   rw [card_Ico, to_nat_sub_of_le h]
 #align int.card_Ico_of_le Int.card_Ico_of_le
+-/
 
+#print Int.card_Ioc_of_le /-
 theorem card_Ioc_of_le (h : a ≤ b) : ((Ioc a b).card : ℤ) = b - a := by
   rw [card_Ioc, to_nat_sub_of_le h]
 #align int.card_Ioc_of_le Int.card_Ioc_of_le
+-/
 
+#print Int.card_Ioo_of_lt /-
 theorem card_Ioo_of_lt (h : a < b) : ((Ioo a b).card : ℤ) = b - a - 1 := by
   rw [card_Ioo, sub_sub, to_nat_sub_of_le h]
 #align int.card_Ioo_of_lt Int.card_Ioo_of_lt
+-/
 
+#print Int.card_fintype_Icc /-
 @[simp]
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = (b + 1 - a).toNat := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align int.card_fintype_Icc Int.card_fintype_Icc
+-/
 
+#print Int.card_fintype_Ico /-
 @[simp]
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = (b - a).toNat := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align int.card_fintype_Ico Int.card_fintype_Ico
+-/
 
+#print Int.card_fintype_Ioc /-
 @[simp]
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = (b - a).toNat := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align int.card_fintype_Ioc Int.card_fintype_Ioc
+-/
 
+#print Int.card_fintype_Ioo /-
 @[simp]
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
+-/
 
+#print Int.card_fintype_Icc_of_le /-
 theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a := by
   rw [card_fintype_Icc, to_nat_sub_of_le h]
 #align int.card_fintype_Icc_of_le Int.card_fintype_Icc_of_le
+-/
 
+#print Int.card_fintype_Ico_of_le /-
 theorem card_fintype_Ico_of_le (h : a ≤ b) : (Fintype.card (Set.Ico a b) : ℤ) = b - a := by
   rw [card_fintype_Ico, to_nat_sub_of_le h]
 #align int.card_fintype_Ico_of_le Int.card_fintype_Ico_of_le
+-/
 
+#print Int.card_fintype_Ioc_of_le /-
 theorem card_fintype_Ioc_of_le (h : a ≤ b) : (Fintype.card (Set.Ioc a b) : ℤ) = b - a := by
   rw [card_fintype_Ioc, to_nat_sub_of_le h]
 #align int.card_fintype_Ioc_of_le Int.card_fintype_Ioc_of_le
+-/
 
+#print Int.card_fintype_Ioo_of_lt /-
 theorem card_fintype_Ioo_of_lt (h : a < b) : (Fintype.card (Set.Ioo a b) : ℤ) = b - a - 1 := by
   rw [card_fintype_Ioo, sub_sub, to_nat_sub_of_le h]
 #align int.card_fintype_Ioo_of_lt Int.card_fintype_Ioo_of_lt
+-/
 
+#print Int.image_Ico_emod /-
 theorem image_Ico_emod (n a : ℤ) (h : 0 ≤ a) : (Ico n (n + a)).image (· % a) = Ico 0 a :=
   by
   obtain rfl | ha := eq_or_lt_of_le h
@@ -208,6 +249,7 @@ theorem image_Ico_emod (n a : ℤ) (h : 0 ≤ a) : (Ico n (n + a)).image (· % a
       exact Int.emod_nonneg n (ne_of_gt ha)
     · rw [Int.add_mul_emod_self_left, Int.emod_eq_of_lt hia.left hia.right]
 #align int.image_Ico_mod Int.image_Ico_emod
+-/
 
 end Int
 
Diff
@@ -40,11 +40,11 @@ instance : LocallyFiniteOrder ℤ
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
-      rw [lt_sub_iff_add_lt, Int.lt_add_one_iff, add_comm] at h
+      rw [lt_sub_iff_add_lt, Int.lt_add_one_iff, add_comm] at h 
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use (x - a).toNat
-      rw [← lt_add_one_iff] at hb
+      rw [← lt_add_one_iff] at hb 
       rw [to_nat_sub_of_le ha]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ico a b x :=
@@ -64,7 +64,7 @@ instance : LocallyFiniteOrder ℤ
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
-      rw [← add_one_le_iff, le_sub_iff_add_le', add_comm _ (1 : ℤ), ← add_assoc] at h
+      rw [← add_one_le_iff, le_sub_iff_add_le', add_comm _ (1 : ℤ), ← add_assoc] at h 
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use (x - (a + 1)).toNat
@@ -76,7 +76,7 @@ instance : LocallyFiniteOrder ℤ
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
-      rw [sub_sub, lt_sub_iff_add_lt'] at h
+      rw [sub_sub, lt_sub_iff_add_lt'] at h 
       exact ⟨Int.le.intro rfl, h⟩
     · rintro ⟨ha, hb⟩
       use (x - (a + 1)).toNat
Diff
@@ -87,227 +87,101 @@ namespace Int
 
 variable (a b : ℤ)
 
-/- warning: int.Icc_eq_finset_map -> Int.Icc_eq_finset_map is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))))
-Case conversion may be inaccurate. Consider using '#align int.Icc_eq_finset_map Int.Icc_eq_finset_mapₓ'. -/
 theorem Icc_eq_finset_map :
     Icc a b =
       (Finset.range (b + 1 - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding a) :=
   rfl
 #align int.Icc_eq_finset_map Int.Icc_eq_finset_map
 
-/- warning: int.Ico_eq_finset_map -> Int.Ico_eq_finset_map is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))))
-Case conversion may be inaccurate. Consider using '#align int.Ico_eq_finset_map Int.Ico_eq_finset_mapₓ'. -/
 theorem Ico_eq_finset_map :
     Ico a b = (Finset.range (b - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding a) :=
   rfl
 #align int.Ico_eq_finset_map Int.Ico_eq_finset_map
 
-/- warning: int.Ioc_eq_finset_map -> Int.Ioc_eq_finset_map is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) a (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))))
-Case conversion may be inaccurate. Consider using '#align int.Ioc_eq_finset_map Int.Ioc_eq_finset_mapₓ'. -/
 theorem Ioc_eq_finset_map :
     Ioc a b =
       (Finset.range (b - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)) :=
   rfl
 #align int.Ioc_eq_finset_map Int.Ioc_eq_finset_map
 
-/- warning: int.Ioo_eq_finset_map -> Int.Ioo_eq_finset_map is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) a (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))))
-Case conversion may be inaccurate. Consider using '#align int.Ioo_eq_finset_map Int.Ioo_eq_finset_mapₓ'. -/
 theorem Ioo_eq_finset_map :
     Ioo a b =
       (Finset.range (b - a - 1).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)) :=
   rfl
 #align int.Ioo_eq_finset_map Int.Ioo_eq_finset_map
 
-/- warning: int.card_Icc -> Int.card_Icc is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
-Case conversion may be inaccurate. Consider using '#align int.card_Icc Int.card_Iccₓ'. -/
 @[simp]
 theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Icc Int.card_Icc
 
-/- warning: int.card_Ico -> Int.card_Ico is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_Ico Int.card_Icoₓ'. -/
 @[simp]
 theorem card_Ico : (Ico a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ico Int.card_Ico
 
-/- warning: int.card_Ioc -> Int.card_Ioc is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_Ioc Int.card_Iocₓ'. -/
 @[simp]
 theorem card_Ioc : (Ioc a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ioc Int.card_Ioc
 
-/- warning: int.card_Ioo -> Int.card_Ioo is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
-Case conversion may be inaccurate. Consider using '#align int.card_Ioo Int.card_Iooₓ'. -/
 @[simp]
 theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ioo Int.card_Ioo
 
-/- warning: int.card_Icc_of_le -> Int.card_Icc_of_le is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))))) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))
-but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
-Case conversion may be inaccurate. Consider using '#align int.card_Icc_of_le Int.card_Icc_of_leₓ'. -/
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
   rw [card_Icc, to_nat_sub_of_le h]
 #align int.card_Icc_of_le Int.card_Icc_of_le
 
-/- warning: int.card_Ico_of_le -> Int.card_Ico_of_le is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_Ico_of_le Int.card_Ico_of_leₓ'. -/
 theorem card_Ico_of_le (h : a ≤ b) : ((Ico a b).card : ℤ) = b - a := by
   rw [card_Ico, to_nat_sub_of_le h]
 #align int.card_Ico_of_le Int.card_Ico_of_le
 
-/- warning: int.card_Ioc_of_le -> Int.card_Ioc_of_le is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_Ioc_of_le Int.card_Ioc_of_leₓ'. -/
 theorem card_Ioc_of_le (h : a ≤ b) : ((Ioc a b).card : ℤ) = b - a := by
   rw [card_Ioc, to_nat_sub_of_le h]
 #align int.card_Ioc_of_le Int.card_Ioc_of_le
 
-/- warning: int.card_Ioo_of_lt -> Int.card_Ioo_of_lt is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.hasLt a b) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
-but is expected to have type
-  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.instLTInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
-Case conversion may be inaccurate. Consider using '#align int.card_Ioo_of_lt Int.card_Ioo_of_ltₓ'. -/
 theorem card_Ioo_of_lt (h : a < b) : ((Ioo a b).card : ℤ) = b - a - 1 := by
   rw [card_Ioo, sub_sub, to_nat_sub_of_le h]
 #align int.card_Ioo_of_lt Int.card_Ioo_of_lt
 
-/- warning: int.card_fintype_Icc -> Int.card_fintype_Icc is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} Int (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Icc Int.card_fintype_Iccₓ'. -/
 @[simp]
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = (b + 1 - a).toNat := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align int.card_fintype_Icc Int.card_fintype_Icc
 
-/- warning: int.card_fintype_Ico -> Int.card_fintype_Ico is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ico Int.card_fintype_Icoₓ'. -/
 @[simp]
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = (b - a).toNat := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align int.card_fintype_Ico Int.card_fintype_Ico
 
-/- warning: int.card_fintype_Ioc -> Int.card_fintype_Ioc is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ioc Int.card_fintype_Iocₓ'. -/
 @[simp]
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = (b - a).toNat := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align int.card_fintype_Ioc Int.card_fintype_Ioc
 
-/- warning: int.card_fintype_Ioo -> Int.card_fintype_Ioo is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
-but is expected to have type
-  forall (a : Int) (b : Int), Eq.{1} Nat (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ioo Int.card_fintype_Iooₓ'. -/
 @[simp]
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
 
-/- warning: int.card_fintype_Icc_of_le -> Int.card_fintype_Icc_of_le is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))))) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))
-but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Icc_of_le Int.card_fintype_Icc_of_leₓ'. -/
 theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a := by
   rw [card_fintype_Icc, to_nat_sub_of_le h]
 #align int.card_fintype_Icc_of_le Int.card_fintype_Icc_of_le
 
-/- warning: int.card_fintype_Ico_of_le -> Int.card_fintype_Ico_of_le is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ico_of_le Int.card_fintype_Ico_of_leₓ'. -/
 theorem card_fintype_Ico_of_le (h : a ≤ b) : (Fintype.card (Set.Ico a b) : ℤ) = b - a := by
   rw [card_fintype_Ico, to_nat_sub_of_le h]
 #align int.card_fintype_Ico_of_le Int.card_fintype_Ico_of_le
 
-/- warning: int.card_fintype_Ioc_of_le -> Int.card_fintype_Ioc_of_le is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
-but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ioc_of_le Int.card_fintype_Ioc_of_leₓ'. -/
 theorem card_fintype_Ioc_of_le (h : a ≤ b) : (Fintype.card (Set.Ioc a b) : ℤ) = b - a := by
   rw [card_fintype_Ioc, to_nat_sub_of_le h]
 #align int.card_fintype_Ioc_of_le Int.card_fintype_Ioc_of_le
 
-/- warning: int.card_fintype_Ioo_of_lt -> Int.card_fintype_Ioo_of_lt is a dubious translation:
-lean 3 declaration is
-  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.hasLt a b) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
-but is expected to have type
-  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.instLTInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
-Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ioo_of_lt Int.card_fintype_Ioo_of_ltₓ'. -/
 theorem card_fintype_Ioo_of_lt (h : a < b) : (Fintype.card (Set.Ioo a b) : ℤ) = b - a - 1 := by
   rw [card_fintype_Ioo, sub_sub, to_nat_sub_of_le h]
 #align int.card_fintype_Ioo_of_lt Int.card_fintype_Ioo_of_lt
 
-/- warning: int.image_Ico_mod -> Int.image_Ico_emod is a dubious translation:
-lean 3 declaration is
-  forall (n : Int) (a : Int), (LE.le.{0} Int Int.hasLe (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))) a) -> (Eq.{1} (Finset.{0} Int) (Finset.image.{0, 0} Int Int (fun (a : Int) (b : Int) => Int.decidableEq a b) (fun (_x : Int) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) _x a) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder n (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) n a))) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder (OfNat.ofNat.{0} Int 0 (OfNat.mk.{0} Int 0 (Zero.zero.{0} Int Int.hasZero))) a))
-but is expected to have type
-  forall (n : Int) (a : Int), (LE.le.{0} Int Int.instLEInt (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)) a) -> (Eq.{1} (Finset.{0} Int) (Finset.image.{0, 0} Int Int (fun (a : Int) (b : Int) => Int.instDecidableEqInt a b) (fun (_x : Int) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) _x a) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing n (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) n a))) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing (OfNat.ofNat.{0} Int 0 (instOfNatInt 0)) a))
-Case conversion may be inaccurate. Consider using '#align int.image_Ico_mod Int.image_Ico_emodₓ'. -/
 theorem image_Ico_emod (n a : ℤ) (h : 0 ≤ a) : (Ico n (n + a)).image (· % a) = Ico 0 a :=
   by
   obtain rfl | ha := eq_or_lt_of_le h
Diff
@@ -141,9 +141,7 @@ but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
 Case conversion may be inaccurate. Consider using '#align int.card_Icc Int.card_Iccₓ'. -/
 @[simp]
-theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat :=
-  by
-  change (Finset.map _ _).card = _
+theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Icc Int.card_Icc
 
@@ -154,9 +152,7 @@ but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
 Case conversion may be inaccurate. Consider using '#align int.card_Ico Int.card_Icoₓ'. -/
 @[simp]
-theorem card_Ico : (Ico a b).card = (b - a).toNat :=
-  by
-  change (Finset.map _ _).card = _
+theorem card_Ico : (Ico a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ico Int.card_Ico
 
@@ -167,9 +163,7 @@ but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
 Case conversion may be inaccurate. Consider using '#align int.card_Ioc Int.card_Iocₓ'. -/
 @[simp]
-theorem card_Ioc : (Ioc a b).card = (b - a).toNat :=
-  by
-  change (Finset.map _ _).card = _
+theorem card_Ioc : (Ioc a b).card = (b - a).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ioc Int.card_Ioc
 
@@ -180,9 +174,7 @@ but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} Nat (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b)) (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
 Case conversion may be inaccurate. Consider using '#align int.card_Ioo Int.card_Iooₓ'. -/
 @[simp]
-theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat :=
-  by
-  change (Finset.map _ _).card = _
+theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := by change (Finset.map _ _).card = _;
   rw [Finset.card_map, Finset.card_range]
 #align int.card_Ioo Int.card_Ioo
 
@@ -323,8 +315,7 @@ theorem image_Ico_emod (n a : ℤ) (h : 0 ≤ a) : (Ico n (n + a)).image (· % a
   ext i
   simp only [mem_image, exists_prop, mem_range, mem_Ico]
   constructor
-  · rintro ⟨i, h, rfl⟩
-    exact ⟨mod_nonneg i (ne_of_gt ha), mod_lt_of_pos i ha⟩
+  · rintro ⟨i, h, rfl⟩; exact ⟨mod_nonneg i (ne_of_gt ha), mod_lt_of_pos i ha⟩
   intro hia
   have hn := Int.emod_add_ediv n a
   obtain hi | hi := lt_or_le i (n % a)
Diff
@@ -89,7 +89,7 @@ variable (a b : ℤ)
 
 /- warning: int.Icc_eq_finset_map -> Int.Icc_eq_finset_map is a dubious translation:
 lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (NonAssocRing.toAddGroupWithOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))))
+  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))))
 but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))))
 Case conversion may be inaccurate. Consider using '#align int.Icc_eq_finset_map Int.Icc_eq_finset_mapₓ'. -/
@@ -101,7 +101,7 @@ theorem Icc_eq_finset_map :
 
 /- warning: int.Ico_eq_finset_map -> Int.Ico_eq_finset_map is a dubious translation:
 lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (NonAssocRing.toAddGroupWithOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))))
+  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))))
 but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) a)) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))))
 Case conversion may be inaccurate. Consider using '#align int.Ico_eq_finset_map Int.Ico_eq_finset_mapₓ'. -/
@@ -112,7 +112,7 @@ theorem Ico_eq_finset_map :
 
 /- warning: int.Ioc_eq_finset_map -> Int.Ioc_eq_finset_map is a dubious translation:
 lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (NonAssocRing.toAddGroupWithOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))))
+  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))))
 but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) a (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))))
 Case conversion may be inaccurate. Consider using '#align int.Ioc_eq_finset_map Int.Ioc_eq_finset_mapₓ'. -/
@@ -124,7 +124,7 @@ theorem Ioc_eq_finset_map :
 
 /- warning: int.Ioo_eq_finset_map -> Int.Ioo_eq_finset_map is a dubious translation:
 lean 3 declaration is
-  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (NonAssocRing.toAddGroupWithOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))))
+  forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (AddCommGroupWithOne.toAddGroupWithOne.{0} Int (Ring.toAddCommGroupWithOne.{0} Int Int.ring))) (StrictOrderedSemiring.to_charZero.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (StrictOrderedRing.toStrictOrderedSemiring.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) a (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))))
 but is expected to have type
   forall (a : Int) (b : Int), Eq.{1} (Finset.{0} Int) (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b) (Finset.map.{0, 0} Nat Int (Function.Embedding.trans.{1, 1, 1} Nat Int Int (Nat.castEmbedding.{0} Int (AddGroupWithOne.toAddMonoidWithOne.{0} Int (Ring.toAddGroupWithOne.{0} Int Int.instRingInt)) (StrictOrderedSemiring.to_charZero.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))) (addLeftEmbedding.{0} Int (AddLeftCancelMonoid.toAddLeftCancelSemigroup.{0} Int (AddCancelCommMonoid.toAddLeftCancelMonoid.{0} Int (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{0} Int (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Int (LinearOrderedSemiring.toStrictOrderedSemiring.{0} Int (LinearOrderedCommSemiring.toLinearOrderedSemiring.{0} Int (LinearOrderedCommRing.toLinearOrderedCommSemiring.{0} Int Int.linearOrderedCommRing))))))) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) a (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))) (Finset.range (Int.toNat (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))))
 Case conversion may be inaccurate. Consider using '#align int.Ioo_eq_finset_map Int.Ioo_eq_finset_mapₓ'. -/
Diff
@@ -190,7 +190,7 @@ theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat :=
 lean 3 declaration is
   forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))))) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))
 but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
+  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
 Case conversion may be inaccurate. Consider using '#align int.card_Icc_of_le Int.card_Icc_of_leₓ'. -/
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
   rw [card_Icc, to_nat_sub_of_le h]
@@ -200,7 +200,7 @@ theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a :=
 lean 3 declaration is
   forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
 but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
+  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
 Case conversion may be inaccurate. Consider using '#align int.card_Ico_of_le Int.card_Ico_of_leₓ'. -/
 theorem card_Ico_of_le (h : a ≤ b) : ((Ico a b).card : ℤ) = b - a := by
   rw [card_Ico, to_nat_sub_of_le h]
@@ -210,7 +210,7 @@ theorem card_Ico_of_le (h : a ≤ b) : ((Ico a b).card : ℤ) = b - a := by
 lean 3 declaration is
   forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
 but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
+  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
 Case conversion may be inaccurate. Consider using '#align int.card_Ioc_of_le Int.card_Ioc_of_leₓ'. -/
 theorem card_Ioc_of_le (h : a ≤ b) : ((Ioc a b).card : ℤ) = b - a := by
   rw [card_Ioc, to_nat_sub_of_le h]
@@ -220,7 +220,7 @@ theorem card_Ioc_of_le (h : a ≤ b) : ((Ioc a b).card : ℤ) = b - a := by
 lean 3 declaration is
   forall (a : Int) (b : Int), (LT.lt.{0} Int Int.hasLt a b) -> (Eq.{1} Int ((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))) (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
 but is expected to have type
-  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.instLTInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
+  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.instLTInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Finset.card.{0} Int (Finset.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
 Case conversion may be inaccurate. Consider using '#align int.card_Ioo_of_lt Int.card_Ioo_of_ltₓ'. -/
 theorem card_Ioo_of_lt (h : a < b) : ((Ioo a b).card : ℤ) = b - a - 1 := by
   rw [card_Ioo, sub_sub, to_nat_sub_of_le h]
@@ -274,7 +274,7 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
 lean 3 declaration is
   forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne))))) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.hasAdd) b (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))) a))
 but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
+  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1)))) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Icc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIcc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HAdd.hAdd.{0, 0, 0} Int Int Int (instHAdd.{0} Int Int.instAddInt) b (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))) a))
 Case conversion may be inaccurate. Consider using '#align int.card_fintype_Icc_of_le Int.card_fintype_Icc_of_leₓ'. -/
 theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a := by
   rw [card_fintype_Icc, to_nat_sub_of_le h]
@@ -284,7 +284,7 @@ theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) :
 lean 3 declaration is
   forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
 but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
+  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ico.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIco.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
 Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ico_of_le Int.card_fintype_Ico_of_leₓ'. -/
 theorem card_fintype_Ico_of_le (h : a ≤ b) : (Fintype.card (Set.Ico a b) : ℤ) = b - a := by
   rw [card_fintype_Ico, to_nat_sub_of_le h]
@@ -294,7 +294,7 @@ theorem card_fintype_Ico_of_le (h : a ≤ b) : (Fintype.card (Set.Ico a b) : ℤ
 lean 3 declaration is
   forall (a : Int) (b : Int), (LE.le.{0} Int Int.hasLe a b) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a))
 but is expected to have type
-  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
+  forall (a : Int) (b : Int), (LE.le.{0} Int Int.instLEInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoc.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a))
 Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ioc_of_le Int.card_fintype_Ioc_of_leₓ'. -/
 theorem card_fintype_Ioc_of_le (h : a ≤ b) : (Fintype.card (Set.Ioc a b) : ℤ) = b - a := by
   rw [card_fintype_Ioc, to_nat_sub_of_le h]
@@ -304,7 +304,7 @@ theorem card_fintype_Ioc_of_le (h : a ≤ b) : (Fintype.card (Set.Ioc a b) : ℤ
 lean 3 declaration is
   forall (a : Int) (b : Int), (LT.lt.{0} Int Int.hasLt a b) -> (Eq.{1} Int ((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))) (Fintype.card.{0} (coeSort.{1, 2} (Set.{0} Int) Type (Set.hasCoeToSort.{0} Int) (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (OrderedAddCommGroup.toPartialOrder.{0} Int (StrictOrderedRing.toOrderedAddCommGroup.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing))))) Int.locallyFiniteOrder a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.hasSub) b a) (OfNat.ofNat.{0} Int 1 (OfNat.mk.{0} Int 1 (One.one.{0} Int Int.hasOne)))))
 but is expected to have type
-  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.instLTInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int Int.instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
+  forall (a : Int) (b : Int), (LT.lt.{0} Int Int.instLTInt a b) -> (Eq.{1} Int (Nat.cast.{0} Int instNatCastInt (Fintype.card.{0} (Set.Elem.{0} Int (Set.Ioo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) a b)) (Set.fintypeIoo.{0} Int (PartialOrder.toPreorder.{0} Int (StrictOrderedRing.toPartialOrder.{0} Int (LinearOrderedRing.toStrictOrderedRing.{0} Int (LinearOrderedCommRing.toLinearOrderedRing.{0} Int Int.linearOrderedCommRing)))) instLocallyFiniteOrderIntToPreorderToPartialOrderToStrictOrderedRingToLinearOrderedRingLinearOrderedCommRing a b))) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) (HSub.hSub.{0, 0, 0} Int Int Int (instHSub.{0} Int Int.instSubInt) b a) (OfNat.ofNat.{0} Int 1 (instOfNatInt 1))))
 Case conversion may be inaccurate. Consider using '#align int.card_fintype_Ioo_of_lt Int.card_fintype_Ioo_of_ltₓ'. -/
 theorem card_fintype_Ioo_of_lt (h : a < b) : (Fintype.card (Set.Ioo a b) : ℤ) = b - a - 1 := by
   rw [card_fintype_Ioo, sub_sub, to_nat_sub_of_le h]

Changes in mathlib4

mathlib3
mathlib4
chore: Move intervals (#11765)

Move Set.Ixx, Finset.Ixx, Multiset.Ixx together under two different folders:

  • Order.Interval for their definition and basic properties
  • Algebra.Order.Interval for their algebraic properties

Move the definitions of Multiset.Ixx to what is now Order.Interval.Multiset. I believe we could just delete this file in a later PR as nothing uses it (and I already had doubts when defining Multiset.Ixx three years ago).

Move the algebraic results out of what is now Order.Interval.Finset.Basic to a new file Algebra.Order.Interval.Finset.Basic.

Diff
@@ -4,8 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
 import Mathlib.Algebra.CharZero.Lemmas
-import Mathlib.Order.LocallyFinite
-import Mathlib.Data.Finset.LocallyFinite.Basic
+import Mathlib.Order.Interval.Finset.Basic
 
 #align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
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
@@ -128,7 +128,7 @@ theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
       change ((↑) : ℕ → ℤ) _ = ((↑) : ℕ → ℤ) _
       rw [card_range, sup_eq_max, inf_eq_min,
         Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
-        Int.coe_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
+        Int.natCast_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
 #align int.card_uIcc Int.card_uIcc
 
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
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
@@ -40,7 +40,7 @@ instance instLocallyFiniteOrder : LocallyFiniteOrder ℤ where
       use (x - a).toNat
       rw [← lt_add_one_iff] at hb
       rw [toNat_sub_of_le ha]
-      exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
+      exact ⟨sub_lt_sub_right hb _, add_sub_cancel _ _⟩
   finset_mem_Ico a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
@@ -50,7 +50,7 @@ instance instLocallyFiniteOrder : LocallyFiniteOrder ℤ where
     · rintro ⟨ha, hb⟩
       use (x - a).toNat
       rw [toNat_sub_of_le ha]
-      exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
+      exact ⟨sub_lt_sub_right hb _, add_sub_cancel _ _⟩
   finset_mem_Ioc a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
@@ -60,8 +60,8 @@ instance instLocallyFiniteOrder : LocallyFiniteOrder ℤ where
       exact ⟨Int.le.intro a rfl, h⟩
     · rintro ⟨ha, hb⟩
       use (x - (a + 1)).toNat
-      rw [toNat_sub_of_le ha, ← add_one_le_iff, sub_add, add_sub_cancel]
-      exact ⟨sub_le_sub_right hb _, add_sub_cancel'_right _ _⟩
+      rw [toNat_sub_of_le ha, ← add_one_le_iff, sub_add, add_sub_cancel_right]
+      exact ⟨sub_le_sub_right hb _, add_sub_cancel _ _⟩
   finset_mem_Ioo a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
@@ -72,7 +72,7 @@ instance instLocallyFiniteOrder : LocallyFiniteOrder ℤ where
     · rintro ⟨ha, hb⟩
       use (x - (a + 1)).toNat
       rw [toNat_sub_of_le ha, sub_sub]
-      exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
+      exact ⟨sub_lt_sub_right hb _, add_sub_cancel _ _⟩
 
 variable (a b : ℤ)
 
chore: classify todo porting notes (#11216)

Classifies by adding issue number #11215 to porting notes claiming "TODO".

Diff
@@ -124,7 +124,7 @@ theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := (card_map _).trans <| c
 theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
   (card_map _).trans <|
     Int.ofNat.inj <| by
-      -- Porting note: TODO: Restore `int.coe_nat_inj` and remove the `change`
+      -- Porting note (#11215): TODO: Restore `int.coe_nat_inj` and remove the `change`
       change ((↑) : ℕ → ℤ) _ = ((↑) : ℕ → ℤ) _
       rw [card_range, sup_eq_max, inf_eq_min,
         Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
chore: classify @[simp] removed porting notes (#11184)

Classifying by adding issue number #11119 to porting notes claiming anything semantically equivalent to:

  • "@[simp] removed [...]"
  • "@[simp] removed [...]"
  • "removed simp attribute"
Diff
@@ -147,22 +147,22 @@ theorem card_Ioo_of_lt (h : a < b) : ((Ioo a b).card : ℤ) = b - a - 1 := by
   rw [card_Ioo, sub_sub, toNat_sub_of_le h]
 #align int.card_Ioo_of_lt Int.card_Ioo_of_lt
 
--- Porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = (b + 1 - a).toNat := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align int.card_fintype_Icc Int.card_fintype_Icc
 
--- Porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = (b - a).toNat := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align int.card_fintype_Ico Int.card_fintype_Ico
 
--- Porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = (b - a).toNat := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align int.card_fintype_Ioc Int.card_fintype_Ioc
 
--- Porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -124,7 +124,7 @@ theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := (card_map _).trans <| c
 theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
   (card_map _).trans <|
     Int.ofNat.inj <| by
-      -- porting note: TODO: Restore `int.coe_nat_inj` and remove the `change`
+      -- Porting note: TODO: Restore `int.coe_nat_inj` and remove the `change`
       change ((↑) : ℕ → ℤ) _ = ((↑) : ℕ → ℤ) _
       rw [card_range, sup_eq_max, inf_eq_min,
         Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
@@ -147,22 +147,22 @@ theorem card_Ioo_of_lt (h : a < b) : ((Ioo a b).card : ℤ) = b - a - 1 := by
   rw [card_Ioo, sub_sub, toNat_sub_of_le h]
 #align int.card_Ioo_of_lt Int.card_Ioo_of_lt
 
--- porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note: removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = (b + 1 - a).toNat := by
   rw [← card_Icc, Fintype.card_ofFinset]
 #align int.card_fintype_Icc Int.card_fintype_Icc
 
--- porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note: removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = (b - a).toNat := by
   rw [← card_Ico, Fintype.card_ofFinset]
 #align int.card_fintype_Ico Int.card_fintype_Ico
 
--- porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note: removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = (b - a).toNat := by
   rw [← card_Ioc, Fintype.card_ofFinset]
 #align int.card_fintype_Ioc Int.card_fintype_Ioc
 
--- porting note: removed `simp` attribute because `simpNF` says it can prove it
+-- Porting note: removed `simp` attribute because `simpNF` says it can prove it
 theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
chore: Rename LocallyFiniteOrder instances (#11076)

The generated names were too long

Diff
@@ -19,8 +19,9 @@ intervals as finsets and fintypes.
 
 open Finset Int
 
-instance : LocallyFiniteOrder ℤ
-    where
+namespace Int
+
+instance instLocallyFiniteOrder : LocallyFiniteOrder ℤ where
   finsetIcc a b :=
     (Finset.range (b + 1 - a).toNat).map <| Nat.castEmbedding.trans <| addLeftEmbedding a
   finsetIco a b := (Finset.range (b - a).toNat).map <| Nat.castEmbedding.trans <| addLeftEmbedding a
@@ -73,8 +74,6 @@ instance : LocallyFiniteOrder ℤ
       rw [toNat_sub_of_le ha, sub_sub]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
 
-namespace Int
-
 variable (a b : ℤ)
 
 theorem Icc_eq_finset_map :
feat: Boxes in locally finite ordered rings (#10506)

Define the sequence of "hollow boxes" indexed by natural numbers as the successive differences of the "boxes" Icc (-n) n.

Diff
@@ -5,7 +5,7 @@ Authors: Yaël Dillies
 -/
 import Mathlib.Algebra.CharZero.Lemmas
 import Mathlib.Order.LocallyFinite
-import Mathlib.Data.Finset.LocallyFinite
+import Mathlib.Data.Finset.LocallyFinite.Basic
 
 #align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
 
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -102,23 +102,23 @@ theorem Ioo_eq_finset_map :
 
 theorem uIcc_eq_finset_map :
     uIcc a b = (range (max a b + 1 - min a b).toNat).map
-      (Nat.castEmbedding.trans <| addLeftEmbedding $ min a b) := rfl
+      (Nat.castEmbedding.trans <| addLeftEmbedding <| min a b) := rfl
 #align int.uIcc_eq_finset_map Int.uIcc_eq_finset_map
 
 @[simp]
-theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := (card_map _).trans $ card_range _
+theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := (card_map _).trans <| card_range _
 #align int.card_Icc Int.card_Icc
 
 @[simp]
-theorem card_Ico : (Ico a b).card = (b - a).toNat := (card_map _).trans $ card_range _
+theorem card_Ico : (Ico a b).card = (b - a).toNat := (card_map _).trans <| card_range _
 #align int.card_Ico Int.card_Ico
 
 @[simp]
-theorem card_Ioc : (Ioc a b).card = (b - a).toNat := (card_map _).trans $ card_range _
+theorem card_Ioc : (Ioc a b).card = (b - a).toNat := (card_map _).trans <| card_range _
 #align int.card_Ioc Int.card_Ioc
 
 @[simp]
-theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := (card_map _).trans $ card_range _
+theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := (card_map _).trans <| card_range _
 #align int.card_Ioo Int.card_Ioo
 
 @[simp]
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) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.int.interval
-! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.CharZero.Lemmas
 import Mathlib.Order.LocallyFinite
 import Mathlib.Data.Finset.LocallyFinite
 
+#align_import data.int.interval from "leanprover-community/mathlib"@"1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29"
+
 /-!
 # Finite intervals of integers
 
feat: finset.uIcc on concrete structures (#5946)

Match https://github.com/leanprover-community/mathlib/pull/18838

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

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.int.interval
-! leanprover-community/mathlib commit f93c11933efbc3c2f0299e47b8ff83e9b539cbf6
+! leanprover-community/mathlib commit 1d29de43a5ba4662dd33b5cfeecfc2a27a5a8a29
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -103,30 +103,38 @@ theorem Ioo_eq_finset_map :
   rfl
 #align int.Ioo_eq_finset_map Int.Ioo_eq_finset_map
 
+theorem uIcc_eq_finset_map :
+    uIcc a b = (range (max a b + 1 - min a b).toNat).map
+      (Nat.castEmbedding.trans <| addLeftEmbedding $ min a b) := rfl
+#align int.uIcc_eq_finset_map Int.uIcc_eq_finset_map
+
 @[simp]
-theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := by
-  change (Finset.map _ _).card = _
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Icc : (Icc a b).card = (b + 1 - a).toNat := (card_map _).trans $ card_range _
 #align int.card_Icc Int.card_Icc
 
 @[simp]
-theorem card_Ico : (Ico a b).card = (b - a).toNat := by
-  change (Finset.map _ _).card = _
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Ico : (Ico a b).card = (b - a).toNat := (card_map _).trans $ card_range _
 #align int.card_Ico Int.card_Ico
 
 @[simp]
-theorem card_Ioc : (Ioc a b).card = (b - a).toNat := by
-  change (Finset.map _ _).card = _
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Ioc : (Ioc a b).card = (b - a).toNat := (card_map _).trans $ card_range _
 #align int.card_Ioc Int.card_Ioc
 
 @[simp]
-theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := by
-  change (Finset.map _ _).card = _
-  rw [Finset.card_map, Finset.card_range]
+theorem card_Ioo : (Ioo a b).card = (b - a - 1).toNat := (card_map _).trans $ card_range _
 #align int.card_Ioo Int.card_Ioo
 
+@[simp]
+theorem card_uIcc : (uIcc a b).card = (b - a).natAbs + 1 :=
+  (card_map _).trans <|
+    Int.ofNat.inj <| by
+      -- porting note: TODO: Restore `int.coe_nat_inj` and remove the `change`
+      change ((↑) : ℕ → ℤ) _ = ((↑) : ℕ → ℤ) _
+      rw [card_range, sup_eq_max, inf_eq_min,
+        Int.toNat_of_nonneg (sub_nonneg_of_le <| le_add_one min_le_max), Int.ofNat_add,
+        Int.coe_natAbs, add_comm, add_sub_assoc, max_sub_min_eq_abs, add_comm, Int.ofNat_one]
+#align int.card_uIcc Int.card_uIcc
+
 theorem card_Icc_of_le (h : a ≤ b + 1) : ((Icc a b).card : ℤ) = b + 1 - a := by
   rw [card_Icc, toNat_sub_of_le h]
 #align int.card_Icc_of_le Int.card_Icc_of_le
@@ -163,6 +171,10 @@ theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = (b - a - 1).toNat := by
   rw [← card_Ioo, Fintype.card_ofFinset]
 #align int.card_fintype_Ioo Int.card_fintype_Ioo
 
+theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a).natAbs + 1 := by
+  rw [← card_uIcc, Fintype.card_ofFinset]
+#align int.card_fintype_uIcc Int.card_fintype_uIcc
+
 theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a := by
   rw [card_fintype_Icc, toNat_sub_of_le h]
 #align int.card_fintype_Icc_of_le Int.card_fintype_Icc_of_le
chore: bye-bye, solo bys! (#3825)

This PR puts, with one exception, every single remaining by that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh. The exception is when the by begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.

Essentially this is s/\n *by$/ by/g, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated bys".

Diff
@@ -31,8 +31,7 @@ instance : LocallyFiniteOrder ℤ
     (Finset.range (b - a).toNat).map <| Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)
   finsetIoo a b :=
     (Finset.range (b - a - 1).toNat).map <| Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)
-  finset_mem_Icc a b x :=
-    by
+  finset_mem_Icc a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
@@ -44,8 +43,7 @@ instance : LocallyFiniteOrder ℤ
       rw [← lt_add_one_iff] at hb
       rw [toNat_sub_of_le ha]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
-  finset_mem_Ico a b x :=
-    by
+  finset_mem_Ico a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
@@ -55,8 +53,7 @@ instance : LocallyFiniteOrder ℤ
       use (x - a).toNat
       rw [toNat_sub_of_le ha]
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
-  finset_mem_Ioc a b x :=
-    by
+  finset_mem_Ioc a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
@@ -67,8 +64,7 @@ instance : LocallyFiniteOrder ℤ
       use (x - (a + 1)).toNat
       rw [toNat_sub_of_le ha, ← add_one_le_iff, sub_add, add_sub_cancel]
       exact ⟨sub_le_sub_right hb _, add_sub_cancel'_right _ _⟩
-  finset_mem_Ioo a b x :=
-    by
+  finset_mem_Ioo a b x := by
     simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
Diff
@@ -33,7 +33,7 @@ instance : LocallyFiniteOrder ℤ
     (Finset.range (b - a - 1).toNat).map <| Nat.castEmbedding.trans <| addLeftEmbedding (a + 1)
   finset_mem_Icc a b x :=
     by
-    simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
+    simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
@@ -46,7 +46,7 @@ instance : LocallyFiniteOrder ℤ
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ico a b x :=
     by
-    simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
+    simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
@@ -57,7 +57,7 @@ instance : LocallyFiniteOrder ℤ
       exact ⟨sub_lt_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ioc a b x :=
     by
-    simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
+    simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
@@ -69,7 +69,7 @@ instance : LocallyFiniteOrder ℤ
       exact ⟨sub_le_sub_right hb _, add_sub_cancel'_right _ _⟩
   finset_mem_Ioo a b x :=
     by
-    simp_rw [mem_map, exists_prop, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
+    simp_rw [mem_map, mem_range, Int.lt_toNat, Function.Embedding.trans_apply,
       Nat.castEmbedding_apply, addLeftEmbedding_apply]
     constructor
     · rintro ⟨a, h, rfl⟩
@@ -187,7 +187,7 @@ theorem image_Ico_emod (n a : ℤ) (h : 0 ≤ a) : (Ico n (n + a)).image (· % a
   obtain rfl | ha := eq_or_lt_of_le h
   · simp
   ext i
-  simp only [mem_image, exists_prop, mem_range, mem_Ico]
+  simp only [mem_image, mem_range, mem_Ico]
   constructor
   · rintro ⟨i, _, rfl⟩
     exact ⟨emod_nonneg i ha.ne', emod_lt_of_pos i ha⟩
feat: port Data.Int.Interval (#1869)

Dependencies 7 + 228

229 files ported (97.0%)
100495 lines ported (97.1%)
Show graph

The unported dependencies are