data.list.intervalsMathlib.Data.List.Intervals

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2019 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 -/
-import Mathbin.Data.List.Lattice
-import Mathbin.Data.List.Range
+import Data.List.Lattice
+import Data.List.Range
 
 #align_import data.list.intervals from "leanprover-community/mathlib"@"d64d67d000b974f0d86a2be7918cf800be6271c8"
 
Diff
@@ -128,7 +128,7 @@ theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] :=
   by
   apply eq_nil_iff_forall_not_mem.2
   intro a
-  simp only [and_imp, not_and, not_lt, List.mem_inter, List.Ico.mem]
+  simp only [and_imp, not_and, not_lt, List.mem_inter_iff, List.Ico.mem]
   intro h₁ h₂ h₃
   exfalso
   exact not_lt_of_ge h₃ h₂
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2019 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module data.list.intervals
-! leanprover-community/mathlib commit d64d67d000b974f0d86a2be7918cf800be6271c8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.List.Lattice
 import Mathbin.Data.List.Range
 
+#align_import data.list.intervals from "leanprover-community/mathlib"@"d64d67d000b974f0d86a2be7918cf800be6271c8"
+
 /-!
 # Intervals in ℕ
 
Diff
@@ -125,6 +125,7 @@ theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) : Ico n
 #align list.Ico.append_consecutive List.Ico.append_consecutive
 -/
 
+#print List.Ico.inter_consecutive /-
 @[simp]
 theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] :=
   by
@@ -135,11 +136,14 @@ theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] :=
   exfalso
   exact not_lt_of_ge h₃ h₂
 #align list.Ico.inter_consecutive List.Ico.inter_consecutive
+-/
 
+#print List.Ico.bagInter_consecutive /-
 @[simp]
 theorem bagInter_consecutive (n m l : ℕ) : List.bagInter (Ico n m) (Ico m l) = [] :=
   (bagInter_nil_iff_inter_nil _ _).2 (inter_consecutive n m l)
 #align list.Ico.bag_inter_consecutive List.Ico.bagInter_consecutive
+-/
 
 #print List.Ico.succ_singleton /-
 @[simp]
@@ -181,15 +185,20 @@ theorem not_mem_top {n m : ℕ} : m ∉ Ico n m := by simp
 #align list.Ico.not_mem_top List.Ico.not_mem_top
 -/
 
+#print List.Ico.filter_lt_of_top_le /-
 theorem filter_lt_of_top_le {n m l : ℕ} (hml : m ≤ l) :
     ((Ico n m).filterₓ fun x => x < l) = Ico n m :=
   filter_eq_self.2 fun k hk => lt_of_lt_of_le (mem.1 hk).2 hml
 #align list.Ico.filter_lt_of_top_le List.Ico.filter_lt_of_top_le
+-/
 
+#print List.Ico.filter_lt_of_le_bot /-
 theorem filter_lt_of_le_bot {n m l : ℕ} (hln : l ≤ n) : ((Ico n m).filterₓ fun x => x < l) = [] :=
   filter_eq_nil.2 fun k hk => not_lt_of_le <| le_trans hln <| (mem.1 hk).1
 #align list.Ico.filter_lt_of_le_bot List.Ico.filter_lt_of_le_bot
+-/
 
+#print List.Ico.filter_lt_of_ge /-
 theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) : ((Ico n m).filterₓ fun x => x < l) = Ico n l :=
   by
   cases' le_total n l with hnl hln
@@ -198,7 +207,9 @@ theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) : ((Ico n m).filterₓ fun
       filter_lt_of_le_bot (le_refl l), append_nil]
   · rw [eq_nil_of_le hln, filter_lt_of_le_bot hln]
 #align list.Ico.filter_lt_of_ge List.Ico.filter_lt_of_ge
+-/
 
+#print List.Ico.filter_lt /-
 @[simp]
 theorem filter_lt (n m l : ℕ) : ((Ico n m).filterₓ fun x => x < l) = Ico n (min m l) :=
   by
@@ -206,16 +217,22 @@ theorem filter_lt (n m l : ℕ) : ((Ico n m).filterₓ fun x => x < l) = Ico n (
   · rw [min_eq_left hml, filter_lt_of_top_le hml]
   · rw [min_eq_right hlm, filter_lt_of_ge hlm]
 #align list.Ico.filter_lt List.Ico.filter_lt
+-/
 
+#print List.Ico.filter_le_of_le_bot /-
 theorem filter_le_of_le_bot {n m l : ℕ} (hln : l ≤ n) :
     ((Ico n m).filterₓ fun x => l ≤ x) = Ico n m :=
   filter_eq_self.2 fun k hk => le_trans hln (mem.1 hk).1
 #align list.Ico.filter_le_of_le_bot List.Ico.filter_le_of_le_bot
+-/
 
+#print List.Ico.filter_le_of_top_le /-
 theorem filter_le_of_top_le {n m l : ℕ} (hml : m ≤ l) : ((Ico n m).filterₓ fun x => l ≤ x) = [] :=
   filter_eq_nil.2 fun k hk => not_le_of_gt (lt_of_lt_of_le (mem.1 hk).2 hml)
 #align list.Ico.filter_le_of_top_le List.Ico.filter_le_of_top_le
+-/
 
+#print List.Ico.filter_le_of_le /-
 theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico l m :=
   by
   cases' le_total l m with hlm hml
@@ -224,7 +241,9 @@ theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) : ((Ico n m).filterₓ fun
       filter_le_of_le_bot (le_refl l), nil_append]
   · rw [eq_nil_of_le hml, filter_le_of_top_le hml]
 #align list.Ico.filter_le_of_le List.Ico.filter_le_of_le
+-/
 
+#print List.Ico.filter_le /-
 @[simp]
 theorem filter_le (n m l : ℕ) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico (max n l) m :=
   by
@@ -232,20 +251,25 @@ theorem filter_le (n m l : ℕ) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico (
   · rw [max_eq_right hnl, filter_le_of_le hnl]
   · rw [max_eq_left hln, filter_le_of_le_bot hln]
 #align list.Ico.filter_le List.Ico.filter_le
+-/
 
+#print List.Ico.filter_lt_of_succ_bot /-
 theorem filter_lt_of_succ_bot {n m : ℕ} (hnm : n < m) :
     ((Ico n m).filterₓ fun x => x < n + 1) = [n] :=
   by
   have r : min m (n + 1) = n + 1 := (@inf_eq_right _ _ m (n + 1)).mpr hnm
   simp [filter_lt n m (n + 1), r]
 #align list.Ico.filter_lt_of_succ_bot List.Ico.filter_lt_of_succ_bot
+-/
 
+#print List.Ico.filter_le_of_bot /-
 @[simp]
 theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((Ico n m).filterₓ fun x => x ≤ n) = [n] :=
   by
   rw [← filter_lt_of_succ_bot hnm]
   exact filter_congr' fun _ _ => lt_succ_iff.symm
 #align list.Ico.filter_le_of_bot List.Ico.filter_le_of_bot
+-/
 
 #print List.Ico.trichotomy /-
 /-- For any natural numbers n, a, and b, one of the following holds:
Diff
@@ -125,12 +125,6 @@ theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) : Ico n
 #align list.Ico.append_consecutive List.Ico.append_consecutive
 -/
 
-/- warning: list.Ico.inter_consecutive -> List.Ico.inter_consecutive is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (Inter.inter.{0} (List.{0} Nat) (List.hasInter.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b)) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
-but is expected to have type
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (Inter.inter.{0} (List.{0} Nat) (List.instInterList.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
-Case conversion may be inaccurate. Consider using '#align list.Ico.inter_consecutive List.Ico.inter_consecutiveₓ'. -/
 @[simp]
 theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] :=
   by
@@ -142,12 +136,6 @@ theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] :=
   exact not_lt_of_ge h₃ h₂
 #align list.Ico.inter_consecutive List.Ico.inter_consecutive
 
-/- warning: list.Ico.bag_inter_consecutive -> List.Ico.bagInter_consecutive is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.bagInterₓ.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
-but is expected to have type
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.bagInter.{0} Nat (instBEq.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
-Case conversion may be inaccurate. Consider using '#align list.Ico.bag_inter_consecutive List.Ico.bagInter_consecutiveₓ'. -/
 @[simp]
 theorem bagInter_consecutive (n m l : ℕ) : List.bagInter (Ico n m) (Ico m l) = [] :=
   (bagInter_nil_iff_inter_nil _ _).2 (inter_consecutive n m l)
@@ -193,33 +181,15 @@ theorem not_mem_top {n m : ℕ} : m ∉ Ico n m := by simp
 #align list.Ico.not_mem_top List.Ico.not_mem_top
 -/
 
-/- warning: list.Ico.filter_lt_of_top_le -> List.Ico.filter_lt_of_top_le is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe m l) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.Ico n m))
-but is expected to have type
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat m l) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.Ico n m))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_top_le List.Ico.filter_lt_of_top_leₓ'. -/
 theorem filter_lt_of_top_le {n m l : ℕ} (hml : m ≤ l) :
     ((Ico n m).filterₓ fun x => x < l) = Ico n m :=
   filter_eq_self.2 fun k hk => lt_of_lt_of_le (mem.1 hk).2 hml
 #align list.Ico.filter_lt_of_top_le List.Ico.filter_lt_of_top_le
 
-/- warning: list.Ico.filter_lt_of_le_bot -> List.Ico.filter_lt_of_le_bot is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe l n) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.nil.{0} Nat))
-but is expected to have type
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat l n) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.nil.{0} Nat))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_le_bot List.Ico.filter_lt_of_le_botₓ'. -/
 theorem filter_lt_of_le_bot {n m l : ℕ} (hln : l ≤ n) : ((Ico n m).filterₓ fun x => x < l) = [] :=
   filter_eq_nil.2 fun k hk => not_lt_of_le <| le_trans hln <| (mem.1 hk).1
 #align list.Ico.filter_lt_of_le_bot List.Ico.filter_lt_of_le_bot
 
-/- warning: list.Ico.filter_lt_of_ge -> List.Ico.filter_lt_of_ge is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe l m) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.Ico n l))
-but is expected to have type
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat l m) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.Ico n l))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_ge List.Ico.filter_lt_of_geₓ'. -/
 theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) : ((Ico n m).filterₓ fun x => x < l) = Ico n l :=
   by
   cases' le_total n l with hnl hln
@@ -229,12 +199,6 @@ theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) : ((Ico n m).filterₓ fun
   · rw [eq_nil_of_le hln, filter_lt_of_le_bot hln]
 #align list.Ico.filter_lt_of_ge List.Ico.filter_lt_of_ge
 
-/- warning: list.Ico.filter_lt -> List.Ico.filter_lt is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.Ico n (LinearOrder.min.{0} Nat Nat.linearOrder m l))
-but is expected to have type
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.Ico n (Min.min.{0} Nat instMinNat m l))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt List.Ico.filter_ltₓ'. -/
 @[simp]
 theorem filter_lt (n m l : ℕ) : ((Ico n m).filterₓ fun x => x < l) = Ico n (min m l) :=
   by
@@ -243,33 +207,15 @@ theorem filter_lt (n m l : ℕ) : ((Ico n m).filterₓ fun x => x < l) = Ico n (
   · rw [min_eq_right hlm, filter_lt_of_ge hlm]
 #align list.Ico.filter_lt List.Ico.filter_lt
 
-/- warning: list.Ico.filter_le_of_le_bot -> List.Ico.filter_le_of_le_bot is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe l n) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.Ico n m))
-but is expected to have type
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat l n) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.Ico n m))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_le_bot List.Ico.filter_le_of_le_botₓ'. -/
 theorem filter_le_of_le_bot {n m l : ℕ} (hln : l ≤ n) :
     ((Ico n m).filterₓ fun x => l ≤ x) = Ico n m :=
   filter_eq_self.2 fun k hk => le_trans hln (mem.1 hk).1
 #align list.Ico.filter_le_of_le_bot List.Ico.filter_le_of_le_bot
 
-/- warning: list.Ico.filter_le_of_top_le -> List.Ico.filter_le_of_top_le is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe m l) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.nil.{0} Nat))
-but is expected to have type
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat m l) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.nil.{0} Nat))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_top_le List.Ico.filter_le_of_top_leₓ'. -/
 theorem filter_le_of_top_le {n m l : ℕ} (hml : m ≤ l) : ((Ico n m).filterₓ fun x => l ≤ x) = [] :=
   filter_eq_nil.2 fun k hk => not_le_of_gt (lt_of_lt_of_le (mem.1 hk).2 hml)
 #align list.Ico.filter_le_of_top_le List.Ico.filter_le_of_top_le
 
-/- warning: list.Ico.filter_le_of_le -> List.Ico.filter_le_of_le is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe n l) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.Ico l m))
-but is expected to have type
-  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat n l) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.Ico l m))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_le List.Ico.filter_le_of_leₓ'. -/
 theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico l m :=
   by
   cases' le_total l m with hlm hml
@@ -279,12 +225,6 @@ theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) : ((Ico n m).filterₓ fun
   · rw [eq_nil_of_le hml, filter_le_of_top_le hml]
 #align list.Ico.filter_le_of_le List.Ico.filter_le_of_le
 
-/- warning: list.Ico.filter_le -> List.Ico.filter_le is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.Ico (LinearOrder.max.{0} Nat Nat.linearOrder n l) m)
-but is expected to have type
-  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.Ico (Max.max.{0} Nat Nat.instMaxNat n l) m)
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le List.Ico.filter_leₓ'. -/
 @[simp]
 theorem filter_le (n m l : ℕ) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico (max n l) m :=
   by
@@ -293,12 +233,6 @@ theorem filter_le (n m l : ℕ) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico (
   · rw [max_eq_left hln, filter_le_of_le_bot hln]
 #align list.Ico.filter_le List.Ico.filter_le
 
-/- warning: list.Ico.filter_lt_of_succ_bot -> List.Ico.filter_lt_of_succ_bot is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat Nat.hasLt n m) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (a : Nat) => Nat.decidableLt a (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
-but is expected to have type
-  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat instLTNat n m) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Nat.decLt a (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_succ_bot List.Ico.filter_lt_of_succ_botₓ'. -/
 theorem filter_lt_of_succ_bot {n m : ℕ} (hnm : n < m) :
     ((Ico n m).filterₓ fun x => x < n + 1) = [n] :=
   by
@@ -306,12 +240,6 @@ theorem filter_lt_of_succ_bot {n m : ℕ} (hnm : n < m) :
   simp [filter_lt n m (n + 1), r]
 #align list.Ico.filter_lt_of_succ_bot List.Ico.filter_lt_of_succ_bot
 
-/- warning: list.Ico.filter_le_of_bot -> List.Ico.filter_le_of_bot is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat Nat.hasLt n m) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe x n) (fun (a : Nat) => Nat.decidableLe a n) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
-but is expected to have type
-  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat instLTNat n m) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat a n) (Nat.decLe a n)) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
-Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_bot List.Ico.filter_le_of_botₓ'. -/
 @[simp]
 theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((Ico n m).filterₓ fun x => x ≤ n) = [n] :=
   by
Diff
@@ -54,26 +54,18 @@ theorem zero_bot (n : ℕ) : Ico 0 n = range n := by rw [Ico, tsub_zero, range_e
 
 #print List.Ico.length /-
 @[simp]
-theorem length (n m : ℕ) : length (Ico n m) = m - n :=
-  by
-  dsimp [Ico]
-  simp only [length_range']
+theorem length (n m : ℕ) : length (Ico n m) = m - n := by dsimp [Ico]; simp only [length_range']
 #align list.Ico.length List.Ico.length
 -/
 
 #print List.Ico.pairwise_lt /-
-theorem pairwise_lt (n m : ℕ) : Pairwise (· < ·) (Ico n m) :=
-  by
-  dsimp [Ico]
+theorem pairwise_lt (n m : ℕ) : Pairwise (· < ·) (Ico n m) := by dsimp [Ico];
   simp only [pairwise_lt_range']
 #align list.Ico.pairwise_lt List.Ico.pairwise_lt
 -/
 
 #print List.Ico.nodup /-
-theorem nodup (n m : ℕ) : Nodup (Ico n m) :=
-  by
-  dsimp [Ico]
-  simp only [nodup_range']
+theorem nodup (n m : ℕ) : Nodup (Ico n m) := by dsimp [Ico]; simp only [nodup_range']
 #align list.Ico.nodup List.Ico.nodup
 -/
 
@@ -163,36 +155,26 @@ theorem bagInter_consecutive (n m l : ℕ) : List.bagInter (Ico n m) (Ico m l) =
 
 #print List.Ico.succ_singleton /-
 @[simp]
-theorem succ_singleton {n : ℕ} : Ico n (n + 1) = [n] :=
-  by
-  dsimp [Ico]
-  simp [add_tsub_cancel_left]
+theorem succ_singleton {n : ℕ} : Ico n (n + 1) = [n] := by dsimp [Ico]; simp [add_tsub_cancel_left]
 #align list.Ico.succ_singleton List.Ico.succ_singleton
 -/
 
 #print List.Ico.succ_top /-
-theorem succ_top {n m : ℕ} (h : n ≤ m) : Ico n (m + 1) = Ico n m ++ [m] :=
-  by
-  rwa [← succ_singleton, append_consecutive]
-  exact Nat.le_succ _
+theorem succ_top {n m : ℕ} (h : n ≤ m) : Ico n (m + 1) = Ico n m ++ [m] := by
+  rwa [← succ_singleton, append_consecutive]; exact Nat.le_succ _
 #align list.Ico.succ_top List.Ico.succ_top
 -/
 
 #print List.Ico.eq_cons /-
-theorem eq_cons {n m : ℕ} (h : n < m) : Ico n m = n :: Ico (n + 1) m :=
-  by
-  rw [← append_consecutive (Nat.le_succ n) h, succ_singleton]
-  rfl
+theorem eq_cons {n m : ℕ} (h : n < m) : Ico n m = n :: Ico (n + 1) m := by
+  rw [← append_consecutive (Nat.le_succ n) h, succ_singleton]; rfl
 #align list.Ico.eq_cons List.Ico.eq_cons
 -/
 
 #print List.Ico.pred_singleton /-
 @[simp]
-theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] :=
-  by
-  dsimp [Ico]
-  rw [tsub_tsub_cancel_of_le (succ_le_of_lt h)]
-  simp
+theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] := by dsimp [Ico];
+  rw [tsub_tsub_cancel_of_le (succ_le_of_lt h)]; simp
 #align list.Ico.pred_singleton List.Ico.pred_singleton
 -/
 
@@ -200,10 +182,8 @@ theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] :=
 theorem chain'_succ (n m : ℕ) : Chain' (fun a b => b = succ a) (Ico n m) :=
   by
   by_cases n < m
-  · rw [eq_cons h]
-    exact chain_succ_range' _ _
-  · rw [eq_nil_of_le (le_of_not_gt h)]
-    trivial
+  · rw [eq_cons h]; exact chain_succ_range' _ _
+  · rw [eq_nil_of_le (le_of_not_gt h)]; trivial
 #align list.Ico.chain'_succ List.Ico.chain'_succ
 -/
 
@@ -348,15 +328,11 @@ theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((Ico n m).filterₓ fun x
 theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b :=
   by
   by_cases h₁ : n < a
-  · left
-    exact h₁
+  · left; exact h₁
   · right
     by_cases h₂ : n ∈ Ico a b
-    · right
-      exact h₂
-    · left
-      simp only [Ico.mem, not_and, not_lt] at *
-      exact h₂ h₁
+    · right; exact h₂
+    · left; simp only [Ico.mem, not_and, not_lt] at *; exact h₂ h₁
 #align list.Ico.trichotomy List.Ico.trichotomy
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
 
 ! This file was ported from Lean 3 source module data.list.intervals
-! leanprover-community/mathlib commit b71077179fac7179e3a342ff319392ad8dcb773c
+! leanprover-community/mathlib commit d64d67d000b974f0d86a2be7918cf800be6271c8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Data.List.Range
 /-!
 # Intervals in ℕ
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines intervals of naturals. `list.Ico m n` is the list of integers greater than `m`
 and strictly less than `n`.
 
Diff
@@ -30,42 +30,53 @@ open Nat
 
 namespace List
 
+#print List.Ico /-
 /-- `Ico n m` is the list of natural numbers `n ≤ x < m`.
 (Ico stands for "interval, closed-open".)
 
 See also `data/set/intervals.lean` for `set.Ico`, modelling intervals in general preorders, and
 `multiset.Ico` and `finset.Ico` for `n ≤ x < m` as a multiset or as a finset.
  -/
-def ico (n m : ℕ) : List ℕ :=
+def Ico (n m : ℕ) : List ℕ :=
   range' n (m - n)
-#align list.Ico List.ico
+#align list.Ico List.Ico
+-/
 
 namespace Ico
 
-theorem zero_bot (n : ℕ) : ico 0 n = range n := by rw [Ico, tsub_zero, range_eq_range']
-#align list.Ico.zero_bot List.ico.zero_bot
+#print List.Ico.zero_bot /-
+theorem zero_bot (n : ℕ) : Ico 0 n = range n := by rw [Ico, tsub_zero, range_eq_range']
+#align list.Ico.zero_bot List.Ico.zero_bot
+-/
 
+#print List.Ico.length /-
 @[simp]
-theorem length (n m : ℕ) : length (ico n m) = m - n :=
+theorem length (n m : ℕ) : length (Ico n m) = m - n :=
   by
   dsimp [Ico]
   simp only [length_range']
-#align list.Ico.length List.ico.length
+#align list.Ico.length List.Ico.length
+-/
 
-theorem pairwise_lt (n m : ℕ) : Pairwise (· < ·) (ico n m) :=
+#print List.Ico.pairwise_lt /-
+theorem pairwise_lt (n m : ℕ) : Pairwise (· < ·) (Ico n m) :=
   by
   dsimp [Ico]
   simp only [pairwise_lt_range']
-#align list.Ico.pairwise_lt List.ico.pairwise_lt
+#align list.Ico.pairwise_lt List.Ico.pairwise_lt
+-/
 
-theorem nodup (n m : ℕ) : Nodup (ico n m) :=
+#print List.Ico.nodup /-
+theorem nodup (n m : ℕ) : Nodup (Ico n m) :=
   by
   dsimp [Ico]
   simp only [nodup_range']
-#align list.Ico.nodup List.ico.nodup
+#align list.Ico.nodup List.Ico.nodup
+-/
 
+#print List.Ico.mem /-
 @[simp]
-theorem mem {n m l : ℕ} : l ∈ ico n m ↔ n ≤ l ∧ l < m :=
+theorem mem {n m l : ℕ} : l ∈ Ico n m ↔ n ≤ l ∧ l < m :=
   by
   suffices n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m by simp [Ico, this]
   cases' le_total n m with hnm hmn
@@ -74,166 +85,264 @@ theorem mem {n m l : ℕ} : l ∈ ico n m ↔ n ≤ l ∧ l < m :=
     exact
       and_congr_right fun hnl =>
         Iff.intro (fun hln => (not_le_of_gt hln hnl).elim) fun hlm => lt_of_lt_of_le hlm hmn
-#align list.Ico.mem List.ico.mem
+#align list.Ico.mem List.Ico.mem
+-/
 
-theorem eq_nil_of_le {n m : ℕ} (h : m ≤ n) : ico n m = [] := by
+#print List.Ico.eq_nil_of_le /-
+theorem eq_nil_of_le {n m : ℕ} (h : m ≤ n) : Ico n m = [] := by
   simp [Ico, tsub_eq_zero_iff_le.mpr h]
-#align list.Ico.eq_nil_of_le List.ico.eq_nil_of_le
+#align list.Ico.eq_nil_of_le List.Ico.eq_nil_of_le
+-/
 
-theorem map_add (n m k : ℕ) : (ico n m).map ((· + ·) k) = ico (n + k) (m + k) := by
+#print List.Ico.map_add /-
+theorem map_add (n m k : ℕ) : (Ico n m).map ((· + ·) k) = Ico (n + k) (m + k) := by
   rw [Ico, Ico, map_add_range', add_tsub_add_eq_tsub_right, add_comm n k]
-#align list.Ico.map_add List.ico.map_add
+#align list.Ico.map_add List.Ico.map_add
+-/
 
-theorem map_sub (n m k : ℕ) (h₁ : k ≤ n) : ((ico n m).map fun x => x - k) = ico (n - k) (m - k) :=
+#print List.Ico.map_sub /-
+theorem map_sub (n m k : ℕ) (h₁ : k ≤ n) : ((Ico n m).map fun x => x - k) = Ico (n - k) (m - k) :=
   by rw [Ico, Ico, tsub_tsub_tsub_cancel_right h₁, map_sub_range' _ _ _ h₁]
-#align list.Ico.map_sub List.ico.map_sub
+#align list.Ico.map_sub List.Ico.map_sub
+-/
 
+#print List.Ico.self_empty /-
 @[simp]
-theorem self_empty {n : ℕ} : ico n n = [] :=
+theorem self_empty {n : ℕ} : Ico n n = [] :=
   eq_nil_of_le (le_refl n)
-#align list.Ico.self_empty List.ico.self_empty
+#align list.Ico.self_empty List.Ico.self_empty
+-/
 
+#print List.Ico.eq_empty_iff /-
 @[simp]
-theorem eq_empty_iff {n m : ℕ} : ico n m = [] ↔ m ≤ n :=
+theorem eq_empty_iff {n m : ℕ} : Ico n m = [] ↔ m ≤ n :=
   Iff.intro (fun h => tsub_eq_zero_iff_le.mp <| by rw [← length, h, List.length]) eq_nil_of_le
-#align list.Ico.eq_empty_iff List.ico.eq_empty_iff
+#align list.Ico.eq_empty_iff List.Ico.eq_empty_iff
+-/
 
-theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) : ico n m ++ ico m l = ico n l :=
+#print List.Ico.append_consecutive /-
+theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) : Ico n m ++ Ico m l = Ico n l :=
   by
   dsimp only [Ico]
   convert range'_append _ _ _
   · exact (add_tsub_cancel_of_le hnm).symm
   · rwa [← add_tsub_assoc_of_le hnm, tsub_add_cancel_of_le]
-#align list.Ico.append_consecutive List.ico.append_consecutive
+#align list.Ico.append_consecutive List.Ico.append_consecutive
+-/
 
+/- warning: list.Ico.inter_consecutive -> List.Ico.inter_consecutive is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (Inter.inter.{0} (List.{0} Nat) (List.hasInter.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b)) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
+but is expected to have type
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (Inter.inter.{0} (List.{0} Nat) (List.instInterList.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
+Case conversion may be inaccurate. Consider using '#align list.Ico.inter_consecutive List.Ico.inter_consecutiveₓ'. -/
 @[simp]
-theorem inter_consecutive (n m l : ℕ) : ico n m ∩ ico m l = [] :=
+theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] :=
   by
   apply eq_nil_iff_forall_not_mem.2
   intro a
-  simp only [and_imp, not_and, not_lt, List.mem_inter, List.ico.mem]
+  simp only [and_imp, not_and, not_lt, List.mem_inter, List.Ico.mem]
   intro h₁ h₂ h₃
   exfalso
   exact not_lt_of_ge h₃ h₂
-#align list.Ico.inter_consecutive List.ico.inter_consecutive
-
+#align list.Ico.inter_consecutive List.Ico.inter_consecutive
+
+/- warning: list.Ico.bag_inter_consecutive -> List.Ico.bagInter_consecutive is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.bagInterₓ.{0} Nat (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
+but is expected to have type
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.bagInter.{0} Nat (instBEq.{0} Nat (fun (a : Nat) (b : Nat) => instDecidableEqNat a b)) (List.Ico n m) (List.Ico m l)) (List.nil.{0} Nat)
+Case conversion may be inaccurate. Consider using '#align list.Ico.bag_inter_consecutive List.Ico.bagInter_consecutiveₓ'. -/
 @[simp]
-theorem bagInter_consecutive (n m l : ℕ) : List.bagInter (ico n m) (ico m l) = [] :=
+theorem bagInter_consecutive (n m l : ℕ) : List.bagInter (Ico n m) (Ico m l) = [] :=
   (bagInter_nil_iff_inter_nil _ _).2 (inter_consecutive n m l)
-#align list.Ico.bag_inter_consecutive List.ico.bagInterₓ_consecutive
+#align list.Ico.bag_inter_consecutive List.Ico.bagInter_consecutive
 
+#print List.Ico.succ_singleton /-
 @[simp]
-theorem succ_singleton {n : ℕ} : ico n (n + 1) = [n] :=
+theorem succ_singleton {n : ℕ} : Ico n (n + 1) = [n] :=
   by
   dsimp [Ico]
   simp [add_tsub_cancel_left]
-#align list.Ico.succ_singleton List.ico.succ_singleton
+#align list.Ico.succ_singleton List.Ico.succ_singleton
+-/
 
-theorem succ_top {n m : ℕ} (h : n ≤ m) : ico n (m + 1) = ico n m ++ [m] :=
+#print List.Ico.succ_top /-
+theorem succ_top {n m : ℕ} (h : n ≤ m) : Ico n (m + 1) = Ico n m ++ [m] :=
   by
   rwa [← succ_singleton, append_consecutive]
   exact Nat.le_succ _
-#align list.Ico.succ_top List.ico.succ_top
+#align list.Ico.succ_top List.Ico.succ_top
+-/
 
-theorem eq_cons {n m : ℕ} (h : n < m) : ico n m = n :: ico (n + 1) m :=
+#print List.Ico.eq_cons /-
+theorem eq_cons {n m : ℕ} (h : n < m) : Ico n m = n :: Ico (n + 1) m :=
   by
   rw [← append_consecutive (Nat.le_succ n) h, succ_singleton]
   rfl
-#align list.Ico.eq_cons List.ico.eq_cons
+#align list.Ico.eq_cons List.Ico.eq_cons
+-/
 
+#print List.Ico.pred_singleton /-
 @[simp]
-theorem pred_singleton {m : ℕ} (h : 0 < m) : ico (m - 1) m = [m - 1] :=
+theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] :=
   by
   dsimp [Ico]
   rw [tsub_tsub_cancel_of_le (succ_le_of_lt h)]
   simp
-#align list.Ico.pred_singleton List.ico.pred_singleton
+#align list.Ico.pred_singleton List.Ico.pred_singleton
+-/
 
-theorem chain'_succ (n m : ℕ) : Chain' (fun a b => b = succ a) (ico n m) :=
+#print List.Ico.chain'_succ /-
+theorem chain'_succ (n m : ℕ) : Chain' (fun a b => b = succ a) (Ico n m) :=
   by
   by_cases n < m
   · rw [eq_cons h]
     exact chain_succ_range' _ _
   · rw [eq_nil_of_le (le_of_not_gt h)]
     trivial
-#align list.Ico.chain'_succ List.ico.chain'_succ
+#align list.Ico.chain'_succ List.Ico.chain'_succ
+-/
 
+#print List.Ico.not_mem_top /-
 @[simp]
-theorem not_mem_top {n m : ℕ} : m ∉ ico n m := by simp
-#align list.Ico.not_mem_top List.ico.not_mem_top
+theorem not_mem_top {n m : ℕ} : m ∉ Ico n m := by simp
+#align list.Ico.not_mem_top List.Ico.not_mem_top
+-/
 
+/- warning: list.Ico.filter_lt_of_top_le -> List.Ico.filter_lt_of_top_le is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe m l) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.Ico n m))
+but is expected to have type
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat m l) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.Ico n m))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_top_le List.Ico.filter_lt_of_top_leₓ'. -/
 theorem filter_lt_of_top_le {n m l : ℕ} (hml : m ≤ l) :
-    ((ico n m).filterₓ fun x => x < l) = ico n m :=
+    ((Ico n m).filterₓ fun x => x < l) = Ico n m :=
   filter_eq_self.2 fun k hk => lt_of_lt_of_le (mem.1 hk).2 hml
-#align list.Ico.filter_lt_of_top_le List.ico.filterₓ_lt_of_top_le
-
-theorem filter_lt_of_le_bot {n m l : ℕ} (hln : l ≤ n) : ((ico n m).filterₓ fun x => x < l) = [] :=
+#align list.Ico.filter_lt_of_top_le List.Ico.filter_lt_of_top_le
+
+/- warning: list.Ico.filter_lt_of_le_bot -> List.Ico.filter_lt_of_le_bot is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe l n) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.nil.{0} Nat))
+but is expected to have type
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat l n) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.nil.{0} Nat))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_le_bot List.Ico.filter_lt_of_le_botₓ'. -/
+theorem filter_lt_of_le_bot {n m l : ℕ} (hln : l ≤ n) : ((Ico n m).filterₓ fun x => x < l) = [] :=
   filter_eq_nil.2 fun k hk => not_lt_of_le <| le_trans hln <| (mem.1 hk).1
-#align list.Ico.filter_lt_of_le_bot List.ico.filterₓ_lt_of_le_bot
-
-theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) : ((ico n m).filterₓ fun x => x < l) = ico n l :=
+#align list.Ico.filter_lt_of_le_bot List.Ico.filter_lt_of_le_bot
+
+/- warning: list.Ico.filter_lt_of_ge -> List.Ico.filter_lt_of_ge is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe l m) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.Ico n l))
+but is expected to have type
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat l m) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.Ico n l))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_ge List.Ico.filter_lt_of_geₓ'. -/
+theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) : ((Ico n m).filterₓ fun x => x < l) = Ico n l :=
   by
   cases' le_total n l with hnl hln
   ·
     rw [← append_consecutive hnl hlm, filter_append, filter_lt_of_top_le (le_refl l),
       filter_lt_of_le_bot (le_refl l), append_nil]
   · rw [eq_nil_of_le hln, filter_lt_of_le_bot hln]
-#align list.Ico.filter_lt_of_ge List.ico.filterₓ_lt_of_ge
-
+#align list.Ico.filter_lt_of_ge List.Ico.filter_lt_of_ge
+
+/- warning: list.Ico.filter_lt -> List.Ico.filter_lt is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x l) (fun (a : Nat) => Nat.decidableLt a l) (List.Ico n m)) (List.Ico n (LinearOrder.min.{0} Nat Nat.linearOrder m l))
+but is expected to have type
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a l) (Nat.decLt a l)) (List.Ico n m)) (List.Ico n (Min.min.{0} Nat instMinNat m l))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt List.Ico.filter_ltₓ'. -/
 @[simp]
-theorem filter_lt (n m l : ℕ) : ((ico n m).filterₓ fun x => x < l) = ico n (min m l) :=
+theorem filter_lt (n m l : ℕ) : ((Ico n m).filterₓ fun x => x < l) = Ico n (min m l) :=
   by
   cases' le_total m l with hml hlm
   · rw [min_eq_left hml, filter_lt_of_top_le hml]
   · rw [min_eq_right hlm, filter_lt_of_ge hlm]
-#align list.Ico.filter_lt List.ico.filterₓ_lt
-
+#align list.Ico.filter_lt List.Ico.filter_lt
+
+/- warning: list.Ico.filter_le_of_le_bot -> List.Ico.filter_le_of_le_bot is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe l n) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.Ico n m))
+but is expected to have type
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat l n) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.Ico n m))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_le_bot List.Ico.filter_le_of_le_botₓ'. -/
 theorem filter_le_of_le_bot {n m l : ℕ} (hln : l ≤ n) :
-    ((ico n m).filterₓ fun x => l ≤ x) = ico n m :=
+    ((Ico n m).filterₓ fun x => l ≤ x) = Ico n m :=
   filter_eq_self.2 fun k hk => le_trans hln (mem.1 hk).1
-#align list.Ico.filter_le_of_le_bot List.ico.filterₓ_le_of_le_bot
-
-theorem filter_le_of_top_le {n m l : ℕ} (hml : m ≤ l) : ((ico n m).filterₓ fun x => l ≤ x) = [] :=
+#align list.Ico.filter_le_of_le_bot List.Ico.filter_le_of_le_bot
+
+/- warning: list.Ico.filter_le_of_top_le -> List.Ico.filter_le_of_top_le is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe m l) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.nil.{0} Nat))
+but is expected to have type
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat m l) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.nil.{0} Nat))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_top_le List.Ico.filter_le_of_top_leₓ'. -/
+theorem filter_le_of_top_le {n m l : ℕ} (hml : m ≤ l) : ((Ico n m).filterₓ fun x => l ≤ x) = [] :=
   filter_eq_nil.2 fun k hk => not_le_of_gt (lt_of_lt_of_le (mem.1 hk).2 hml)
-#align list.Ico.filter_le_of_top_le List.ico.filterₓ_le_of_top_le
-
-theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) : ((ico n m).filterₓ fun x => l ≤ x) = ico l m :=
+#align list.Ico.filter_le_of_top_le List.Ico.filter_le_of_top_le
+
+/- warning: list.Ico.filter_le_of_le -> List.Ico.filter_le_of_le is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat Nat.hasLe n l) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.Ico l m))
+but is expected to have type
+  forall {n : Nat} {m : Nat} {l : Nat}, (LE.le.{0} Nat instLENat n l) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.Ico l m))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_le List.Ico.filter_le_of_leₓ'. -/
+theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico l m :=
   by
   cases' le_total l m with hlm hml
   ·
     rw [← append_consecutive hnl hlm, filter_append, filter_le_of_top_le (le_refl l),
       filter_le_of_le_bot (le_refl l), nil_append]
   · rw [eq_nil_of_le hml, filter_le_of_top_le hml]
-#align list.Ico.filter_le_of_le List.ico.filterₓ_le_of_le
-
+#align list.Ico.filter_le_of_le List.Ico.filter_le_of_le
+
+/- warning: list.Ico.filter_le -> List.Ico.filter_le is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe l x) (fun (a : Nat) => Nat.decidableLe l a) (List.Ico n m)) (List.Ico (LinearOrder.max.{0} Nat Nat.linearOrder n l) m)
+but is expected to have type
+  forall (n : Nat) (m : Nat) (l : Nat), Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat l a) (Nat.decLe l a)) (List.Ico n m)) (List.Ico (Max.max.{0} Nat Nat.instMaxNat n l) m)
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le List.Ico.filter_leₓ'. -/
 @[simp]
-theorem filter_le (n m l : ℕ) : ((ico n m).filterₓ fun x => l ≤ x) = ico (max n l) m :=
+theorem filter_le (n m l : ℕ) : ((Ico n m).filterₓ fun x => l ≤ x) = Ico (max n l) m :=
   by
   cases' le_total n l with hnl hln
   · rw [max_eq_right hnl, filter_le_of_le hnl]
   · rw [max_eq_left hln, filter_le_of_le_bot hln]
-#align list.Ico.filter_le List.ico.filterₓ_le
-
+#align list.Ico.filter_le List.Ico.filter_le
+
+/- warning: list.Ico.filter_lt_of_succ_bot -> List.Ico.filter_lt_of_succ_bot is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat Nat.hasLt n m) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LT.lt.{0} Nat Nat.hasLt x (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (a : Nat) => Nat.decidableLt a (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
+but is expected to have type
+  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat instLTNat n m) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LT.lt.{0} Nat instLTNat a (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Nat.decLt a (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_lt_of_succ_bot List.Ico.filter_lt_of_succ_botₓ'. -/
 theorem filter_lt_of_succ_bot {n m : ℕ} (hnm : n < m) :
-    ((ico n m).filterₓ fun x => x < n + 1) = [n] :=
+    ((Ico n m).filterₓ fun x => x < n + 1) = [n] :=
   by
   have r : min m (n + 1) = n + 1 := (@inf_eq_right _ _ m (n + 1)).mpr hnm
   simp [filter_lt n m (n + 1), r]
-#align list.Ico.filter_lt_of_succ_bot List.ico.filterₓ_lt_of_succ_bot
-
+#align list.Ico.filter_lt_of_succ_bot List.Ico.filter_lt_of_succ_bot
+
+/- warning: list.Ico.filter_le_of_bot -> List.Ico.filter_le_of_bot is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat Nat.hasLt n m) -> (Eq.{1} (List.{0} Nat) (List.filterₓ.{0} Nat (fun (x : Nat) => LE.le.{0} Nat Nat.hasLe x n) (fun (a : Nat) => Nat.decidableLe a n) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
+but is expected to have type
+  forall {n : Nat} {m : Nat}, (LT.lt.{0} Nat instLTNat n m) -> (Eq.{1} (List.{0} Nat) (List.filter.{0} Nat (fun (a : Nat) => Decidable.decide (LE.le.{0} Nat instLENat a n) (Nat.decLe a n)) (List.Ico n m)) (List.cons.{0} Nat n (List.nil.{0} Nat)))
+Case conversion may be inaccurate. Consider using '#align list.Ico.filter_le_of_bot List.Ico.filter_le_of_botₓ'. -/
 @[simp]
-theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((ico n m).filterₓ fun x => x ≤ n) = [n] :=
+theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((Ico n m).filterₓ fun x => x ≤ n) = [n] :=
   by
   rw [← filter_lt_of_succ_bot hnm]
   exact filter_congr' fun _ _ => lt_succ_iff.symm
-#align list.Ico.filter_le_of_bot List.ico.filterₓ_le_of_bot
+#align list.Ico.filter_le_of_bot List.Ico.filter_le_of_bot
 
+#print List.Ico.trichotomy /-
 /-- For any natural numbers n, a, and b, one of the following holds:
 1. n < a
 2. n ≥ b
 3. n ∈ Ico a b
 -/
-theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ ico a b :=
+theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ Ico a b :=
   by
   by_cases h₁ : n < a
   · left
@@ -245,7 +354,8 @@ theorem trichotomy (n a b : ℕ) : n < a ∨ b ≤ n ∨ n ∈ ico a b :=
     · left
       simp only [Ico.mem, not_and, not_lt] at *
       exact h₂ h₁
-#align list.Ico.trichotomy List.ico.trichotomy
+#align list.Ico.trichotomy List.Ico.trichotomy
+-/
 
 end Ico
 

Changes in mathlib4

mathlib3
mathlib4
chore(Algebra/BigOperators/List): Use Std lemmas (#11725)
  • Make Algebra.BigOperators.List.Basic, Data.List.Chain not depend on Data.Nat.Order.Basic by using Nat-specific Std lemmas rather than general mathlib ones. I leave the Data.Nat.Basic import since Algebra.BigOperators.List.Basic is algebra territory.
  • Make Algebra.BigOperators.List.Basic not depend on Algebra.Divisibility.Basic. I'm not too sure about that one since they already are algebra. My motivation is that they involve ring-like objects while big operators are about group-like objects, but this is in some sense a second order refactor.
  • As a consequence, move the divisibility and MonoidWithZero lemmas from Algebra.BigOperators.List.Basic to Algebra.BigOperators.List.Lemmas.
  • Move the content of Algebra.BigOperators.List.Defs to Algebra.BigOperators.List.Basic since no file imported the former without the latter and their imports are becoming very close after this PR.
  • Make Data.List.Count, Data.List.Dedup, Data.List.ProdSigma, Data.List.Zip not depend on Algebra.BigOperators.List.Basic.
  • As a consequence, move the big operators lemmas that were in there to Algebra.BigOperators.List.Basic. For the lemmas that were Nat -specific, keep a version of them stated using Nat.sum.
  • To help with this, add Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum.
Diff
@@ -39,7 +39,7 @@ def Ico (n m : ℕ) : List ℕ :=
 
 namespace Ico
 
-theorem zero_bot (n : ℕ) : Ico 0 n = range n := by rw [Ico, tsub_zero, range_eq_range']
+theorem zero_bot (n : ℕ) : Ico 0 n = range n := by rw [Ico, Nat.sub_zero, range_eq_range']
 #align list.Ico.zero_bot List.Ico.zero_bot
 
 @[simp]
@@ -62,24 +62,24 @@ theorem nodup (n m : ℕ) : Nodup (Ico n m) := by
 theorem mem {n m l : ℕ} : l ∈ Ico n m ↔ n ≤ l ∧ l < m := by
   suffices n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m by simp [Ico, this]
   rcases le_total n m with hnm | hmn
-  · rw [add_tsub_cancel_of_le hnm]
-  · rw [tsub_eq_zero_iff_le.mpr hmn, add_zero]
+  · rw [Nat.add_sub_cancel' hnm]
+  · rw [Nat.sub_eq_zero_iff_le.mpr hmn, Nat.add_zero]
     exact
       and_congr_right fun hnl =>
         Iff.intro (fun hln => (not_le_of_gt hln hnl).elim) fun hlm => lt_of_lt_of_le hlm hmn
 #align list.Ico.mem List.Ico.mem
 
 theorem eq_nil_of_le {n m : ℕ} (h : m ≤ n) : Ico n m = [] := by
-  simp [Ico, tsub_eq_zero_iff_le.mpr h]
+  simp [Ico, Nat.sub_eq_zero_iff_le.mpr h]
 #align list.Ico.eq_nil_of_le List.Ico.eq_nil_of_le
 
 theorem map_add (n m k : ℕ) : (Ico n m).map (k + ·) = Ico (n + k) (m + k) := by
-  rw [Ico, Ico, map_add_range', add_tsub_add_eq_tsub_right m k, add_comm n k]
+  rw [Ico, Ico, map_add_range', Nat.add_sub_add_right m k, Nat.add_comm n k]
 #align list.Ico.map_add List.Ico.map_add
 
 theorem map_sub (n m k : ℕ) (h₁ : k ≤ n) :
     ((Ico n m).map fun x => x - k) = Ico (n - k) (m - k) := by
-  rw [Ico, Ico, tsub_tsub_tsub_cancel_right h₁, map_sub_range' _ _ _ h₁]
+  rw [Ico, Ico, Nat.sub_sub_sub_cancel_right h₁, map_sub_range' _ _ _ h₁]
 #align list.Ico.map_sub List.Ico.map_sub
 
 @[simp]
@@ -89,15 +89,15 @@ theorem self_empty {n : ℕ} : Ico n n = [] :=
 
 @[simp]
 theorem eq_empty_iff {n m : ℕ} : Ico n m = [] ↔ m ≤ n :=
-  Iff.intro (fun h => tsub_eq_zero_iff_le.mp <| by rw [← length, h, List.length]) eq_nil_of_le
+  Iff.intro (fun h => Nat.sub_eq_zero_iff_le.mp <| by rw [← length, h, List.length]) eq_nil_of_le
 #align list.Ico.eq_empty_iff List.Ico.eq_empty_iff
 
 theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) :
     Ico n m ++ Ico m l = Ico n l := by
   dsimp only [Ico]
   convert range'_append n (m-n) (l-m) 1 using 2
-  · rw [one_mul, add_tsub_cancel_of_le hnm]
-  · rw [tsub_add_tsub_cancel hml hnm]
+  · rw [Nat.one_mul, Nat.add_sub_cancel' hnm]
+  · rw [Nat.sub_add_sub_cancel hml hnm]
 #align list.Ico.append_consecutive List.Ico.append_consecutive
 
 @[simp]
@@ -118,7 +118,7 @@ theorem bagInter_consecutive (n m l : Nat) :  @List.bagInter ℕ instBEq (Ico n
 @[simp]
 theorem succ_singleton {n : ℕ} : Ico n (n + 1) = [n] := by
   dsimp [Ico]
-  simp [range', add_tsub_cancel_left]
+  simp [range', Nat.add_sub_cancel_left]
 #align list.Ico.succ_singleton List.Ico.succ_singleton
 
 theorem succ_top {n m : ℕ} (h : n ≤ m) : Ico n (m + 1) = Ico n m ++ [m] := by
@@ -134,7 +134,7 @@ theorem eq_cons {n m : ℕ} (h : n < m) : Ico n m = n :: Ico (n + 1) m := by
 @[simp]
 theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] := by
   dsimp [Ico]
-  rw [tsub_tsub_cancel_of_le (succ_le_of_lt h)]
+  rw [Nat.sub_sub_self (succ_le_of_lt h)]
   simp [← Nat.one_eq_succ_zero]
 
 #align list.Ico.pred_singleton List.Ico.pred_singleton
chore: update Std (#11858)

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

Diff
@@ -112,7 +112,7 @@ theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] := by
 
 @[simp]
 theorem bagInter_consecutive (n m l : Nat) :  @List.bagInter ℕ instBEq (Ico n m) (Ico m l) = [] :=
-  (bagInter_nil_iff_inter_nil _ _).2 (inter_consecutive n m l)
+  (bagInter_nil_iff_inter_nil _ _).2 (by convert inter_consecutive n m l)
 #align list.Ico.bag_inter_consecutive List.Ico.bagInter_consecutive
 
 @[simp]
chore: classify simp can do this porting notes (#10619)

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

Diff
@@ -147,7 +147,7 @@ theorem chain'_succ (n m : ℕ) : Chain' (fun a b => b = succ a) (Ico n m) := by
     trivial
 #align list.Ico.chain'_succ List.Ico.chain'_succ
 
--- Porting Note: simp can prove this
+-- Porting note (#10618): simp can prove this
 -- @[simp]
 theorem not_mem_top {n m : ℕ} : m ∉ Ico n m := by simp
 #align list.Ico.not_mem_top List.Ico.not_mem_top
chore: bump dependencies (#10315)

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

Diff
@@ -220,7 +220,7 @@ theorem filter_le_of_bot {n m : ℕ} (hnm : n < m) : ((Ico n m).filter fun x =>
   rw [← filter_lt_of_succ_bot hnm]
   exact filter_congr' fun _ _ => by
     rw [decide_eq_true_eq, decide_eq_true_eq]
-    exact lt_succ_iff.symm
+    exact Nat.lt_succ_iff.symm
 #align list.Ico.filter_le_of_bot List.Ico.filter_le_of_bot
 
 /-- For any natural numbers n, a, and b, one of the following holds:
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -61,7 +61,7 @@ theorem nodup (n m : ℕ) : Nodup (Ico n m) := by
 @[simp]
 theorem mem {n m l : ℕ} : l ∈ Ico n m ↔ n ≤ l ∧ l < m := by
   suffices n ≤ l ∧ l < n + (m - n) ↔ n ≤ l ∧ l < m by simp [Ico, this]
-  cases' le_total n m with hnm hmn
+  rcases le_total n m with hnm | hmn
   · rw [add_tsub_cancel_of_le hnm]
   · rw [tsub_eq_zero_iff_le.mpr hmn, add_zero]
     exact
@@ -167,7 +167,7 @@ theorem filter_lt_of_le_bot {n m l : ℕ} (hln : l ≤ n) : ((Ico n m).filter fu
 
 theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) :
     ((Ico n m).filter fun x => x < l) = Ico n l := by
-  cases' le_total n l with hnl hln
+  rcases le_total n l with hnl | hln
   · rw [← append_consecutive hnl hlm, filter_append, filter_lt_of_top_le (le_refl l),
       filter_lt_of_le_bot (le_refl l), append_nil]
   · rw [eq_nil_of_le hln, filter_lt_of_le_bot hln]
@@ -176,7 +176,7 @@ theorem filter_lt_of_ge {n m l : ℕ} (hlm : l ≤ m) :
 @[simp]
 theorem filter_lt (n m l : ℕ) :
     ((Ico n m).filter fun x => x < l) = Ico n (min m l) := by
-  cases' le_total m l with hml hlm
+  rcases le_total m l with hml | hlm
   · rw [min_eq_left hml, filter_lt_of_top_le hml]
   · rw [min_eq_right hlm, filter_lt_of_ge hlm]
 #align list.Ico.filter_lt List.Ico.filter_lt
@@ -196,7 +196,7 @@ theorem filter_le_of_top_le {n m l : ℕ} (hml : m ≤ l) : ((Ico n m).filter fu
 
 theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) :
     ((Ico n m).filter fun x => l ≤ x) = Ico l m := by
-  cases' le_total l m with hlm hml
+  rcases le_total l m with hlm | hml
   · rw [← append_consecutive hnl hlm, filter_append, filter_le_of_top_le (le_refl l),
       filter_le_of_le_bot (le_refl l), nil_append]
   · rw [eq_nil_of_le hml, filter_le_of_top_le hml]
@@ -204,7 +204,7 @@ theorem filter_le_of_le {n m l : ℕ} (hnl : n ≤ l) :
 
 @[simp]
 theorem filter_le (n m l : ℕ) : ((Ico n m).filter fun x => l ≤ x) = Ico (max n l) m := by
-  cases' le_total n l with hnl hln
+  rcases le_total n l with hnl | hln
   · rw [max_eq_right hnl, filter_le_of_le hnl]
   · rw [max_eq_left hln, filter_le_of_le_bot hln]
 #align list.Ico.filter_le List.Ico.filter_le
chore: Replace (· op ·) a by (a op ·) (#8843)

I used the regex \(\(· (.) ·\) (.)\), replacing with ($2 $1 ·).

Diff
@@ -73,7 +73,7 @@ theorem eq_nil_of_le {n m : ℕ} (h : m ≤ n) : Ico n m = [] := by
   simp [Ico, tsub_eq_zero_iff_le.mpr h]
 #align list.Ico.eq_nil_of_le List.Ico.eq_nil_of_le
 
-theorem map_add (n m k : ℕ) : (Ico n m).map ((· + ·) k) = Ico (n + k) (m + k) := by
+theorem map_add (n m k : ℕ) : (Ico n m).map (k + ·) = Ico (n + k) (m + k) := by
   rw [Ico, Ico, map_add_range', add_tsub_add_eq_tsub_right m k, add_comm n k]
 #align list.Ico.map_add List.Ico.map_add
 
chore: add missing hypothesis names to by_cases (#8533)

I've also got a change to make this required, but I'd like to land this first.

Diff
@@ -140,7 +140,7 @@ theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] := by
 #align list.Ico.pred_singleton List.Ico.pred_singleton
 
 theorem chain'_succ (n m : ℕ) : Chain' (fun a b => b = succ a) (Ico n m) := by
-  by_cases n < m
+  by_cases h : n < m
   · rw [eq_cons h]
     exact chain_succ_range' _ _ 1
   · rw [eq_nil_of_le (le_of_not_gt h)]
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

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

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

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

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

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

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

leanprover/lean4#2722

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

leanprover/lean4#2783

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

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

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

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

Diff
@@ -45,17 +45,17 @@ theorem zero_bot (n : ℕ) : Ico 0 n = range n := by rw [Ico, tsub_zero, range_e
 @[simp]
 theorem length (n m : ℕ) : length (Ico n m) = m - n := by
   dsimp [Ico]
-  simp only [length_range']
+  simp [length_range', autoParam]
 #align list.Ico.length List.Ico.length
 
 theorem pairwise_lt (n m : ℕ) : Pairwise (· < ·) (Ico n m) := by
   dsimp [Ico]
-  simp only [pairwise_lt_range']
+  simp [pairwise_lt_range', autoParam]
 #align list.Ico.pairwise_lt List.Ico.pairwise_lt
 
 theorem nodup (n m : ℕ) : Nodup (Ico n m) := by
   dsimp [Ico]
-  simp only [nodup_range']
+  simp [nodup_range', autoParam]
 #align list.Ico.nodup List.Ico.nodup
 
 @[simp]
chore: bump Std version (#6435)

Notably there is now a l1 ∪ l2 notation for List.union.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Bulhwi Cha <chabulhwi@semmalgil.com>

Diff
@@ -104,7 +104,7 @@ theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) :
 theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = [] := by
   apply eq_nil_iff_forall_not_mem.2
   intro a
-  simp only [and_imp, not_and, not_lt, List.mem_inter, List.Ico.mem]
+  simp only [and_imp, not_and, not_lt, List.mem_inter_iff, List.Ico.mem]
   intro _ h₂ h₃
   exfalso
   exact not_lt_of_ge h₃ h₂
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2019 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Scott Morrison
-
-! This file was ported from Lean 3 source module data.list.intervals
-! leanprover-community/mathlib commit 7b78d1776212a91ecc94cf601f83bdcc46b04213
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.List.Lattice
 import Mathlib.Data.List.Range
 import Mathlib.Data.Bool.Basic
+
+#align_import data.list.intervals from "leanprover-community/mathlib"@"7b78d1776212a91ecc94cf601f83bdcc46b04213"
 /-!
 # Intervals in ℕ
 
chore: bump to nightly-2023-05-31 (#4530)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Alex J Best <alex.j.best@gmail.com>

Diff
@@ -98,8 +98,8 @@ theorem eq_empty_iff {n m : ℕ} : Ico n m = [] ↔ m ≤ n :=
 theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) :
     Ico n m ++ Ico m l = Ico n l := by
   dsimp only [Ico]
-  convert range'_append n (m-n) (l-m) using 2
-  · rw [add_tsub_cancel_of_le hnm]
+  convert range'_append n (m-n) (l-m) 1 using 2
+  · rw [one_mul, add_tsub_cancel_of_le hnm]
   · rw [tsub_add_tsub_cancel hml hnm]
 #align list.Ico.append_consecutive List.Ico.append_consecutive
 
@@ -121,7 +121,7 @@ theorem bagInter_consecutive (n m l : Nat) :  @List.bagInter ℕ instBEq (Ico n
 @[simp]
 theorem succ_singleton {n : ℕ} : Ico n (n + 1) = [n] := by
   dsimp [Ico]
-  simp [add_tsub_cancel_left]
+  simp [range', add_tsub_cancel_left]
 #align list.Ico.succ_singleton List.Ico.succ_singleton
 
 theorem succ_top {n m : ℕ} (h : n ≤ m) : Ico n (m + 1) = Ico n m ++ [m] := by
@@ -138,13 +138,14 @@ theorem eq_cons {n m : ℕ} (h : n < m) : Ico n m = n :: Ico (n + 1) m := by
 theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1] := by
   dsimp [Ico]
   rw [tsub_tsub_cancel_of_le (succ_le_of_lt h)]
-  simp
+  simp [← Nat.one_eq_succ_zero]
+
 #align list.Ico.pred_singleton List.Ico.pred_singleton
 
 theorem chain'_succ (n m : ℕ) : Chain' (fun a b => b = succ a) (Ico n m) := by
   by_cases n < m
   · rw [eq_cons h]
-    exact chain_succ_range' _ _
+    exact chain_succ_range' _ _ 1
   · rw [eq_nil_of_le (le_of_not_gt h)]
     trivial
 #align list.Ico.chain'_succ List.Ico.chain'_succ
chore: fix upper/lowercase in comments (#4360)
  • Run a non-interactive version of fix-comments.py on all files.
  • Go through the diff and manually add/discard/edit chunks.
Diff
@@ -21,7 +21,7 @@ and strictly less than `n`.
 - Define `Ioo` and `Icc`, state basic lemmas about them.
 - Also do the versions for integers?
 - One could generalise even further, defining 'locally finite partial orders', for which
-  `Set.Ico a b` is `[finite]`, and 'locally finite total orders', for which there is a list model.
+  `Set.Ico a b` is `[Finite]`, and 'locally finite total orders', for which there is a list model.
 - Once the above is done, get rid of `Data.Int.range` (and maybe `List.range'`?).
 -/
 
chore: tidy various files (#3358)
Diff
@@ -14,7 +14,7 @@ import Mathlib.Data.Bool.Basic
 /-!
 # Intervals in ℕ
 
-This file defines intervals of naturals. `list.Ico m n` is the list of integers greater than `m`
+This file defines intervals of naturals. `List.Ico m n` is the list of integers greater than `m`
 and strictly less than `n`.
 
 ## TODO
feat: Port/Data.List.Intervals (#1479)

feat: Port/data.list.intervals

Co-authored-by: z <32079362+xoers@users.noreply.github.com> Co-authored-by: qawbecrdtey <qawbecrdtey@naver.com> Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>

Dependencies 2 + 96

97 files ported (98.0%)
44136 lines ported (99.7%)
Show graph

The unported dependencies are