data.set.list
⟷
Mathlib.Data.Set.List
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -44,14 +44,14 @@ theorem range_list_map_coe (s : Set α) : range (map (coe : s → α)) = {l |
#align set.range_list_map_coe Set.range_list_map_coe
-/
-#print Set.range_list_nthLe /-
+#print Set.range_list_get /-
@[simp]
-theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = {x | x ∈ l} :=
+theorem range_list_get : (range fun k : Fin l.length => l.nthLe k k.2) = {x | x ∈ l} :=
by
ext x
rw [mem_set_of_eq, mem_iff_nth_le]
exact ⟨fun ⟨⟨n, h₁⟩, h₂⟩ => ⟨n, h₁, h₂⟩, fun ⟨n, h₁, h₂⟩ => ⟨⟨n, h₁⟩, h₂⟩⟩
-#align set.range_list_nth_le Set.range_list_nthLe
+#align set.range_list_nth_le Set.range_list_get
-/
#print Set.range_list_get? /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2023 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
-import Mathbin.Data.Set.Image
-import Mathbin.Data.List.Basic
-import Mathbin.Data.Fin.Basic
+import Data.Set.Image
+import Data.List.Basic
+import Data.Fin.Basic
#align_import data.set.list from "leanprover-community/mathlib"@"31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2023 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module data.set.list
-! leanprover-community/mathlib commit 31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Set.Image
import Mathbin.Data.List.Basic
import Mathbin.Data.Fin.Basic
+#align_import data.set.list from "leanprover-community/mathlib"@"31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0"
+
/-!
# Lemmas about `list`s and `set.range`
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -75,7 +75,6 @@ theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d {x | x
simp only [← range_comp, (· ∘ ·), nthd_eq_get_or_else_nth]
_ = insert d {x | x ∈ l} := by
simp only [range_list_nth, image_insert_eq, Option.getD, image_image, image_id']
-
#align set.range_list_nthd Set.range_list_getD
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -29,7 +29,7 @@ variable {α β : Type _} (l : List α)
namespace Set
#print Set.range_list_map /-
-theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } :=
+theorem range_list_map (f : α → β) : range (map f) = {l | ∀ x ∈ l, x ∈ range f} :=
by
refine'
subset.antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
@@ -42,14 +42,14 @@ theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x
-/
#print Set.range_list_map_coe /-
-theorem range_list_map_coe (s : Set α) : range (map (coe : s → α)) = { l | ∀ x ∈ l, x ∈ s } := by
+theorem range_list_map_coe (s : Set α) : range (map (coe : s → α)) = {l | ∀ x ∈ l, x ∈ s} := by
rw [range_list_map, Subtype.range_coe]
#align set.range_list_map_coe Set.range_list_map_coe
-/
#print Set.range_list_nthLe /-
@[simp]
-theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x | x ∈ l } :=
+theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = {x | x ∈ l} :=
by
ext x
rw [mem_set_of_eq, mem_iff_nth_le]
@@ -58,7 +58,7 @@ theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x |
-/
#print Set.range_list_get? /-
-theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) :=
+theorem range_list_get? : range l.get? = insert none (some '' {x | x ∈ l}) :=
by
rw [← range_list_nth_le, ← range_comp]
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset.2 ⟨_, _⟩)
@@ -69,11 +69,11 @@ theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) :
#print Set.range_list_getD /-
@[simp]
-theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x | x ∈ l } :=
+theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d {x | x ∈ l} :=
calc
(range fun n => l.getD n d) = (fun o : Option α => o.getD d) '' range l.get? := by
simp only [← range_comp, (· ∘ ·), nthd_eq_get_or_else_nth]
- _ = insert d { x | x ∈ l } := by
+ _ = insert d {x | x ∈ l} := by
simp only [range_list_nth, image_insert_eq, Option.getD, image_image, image_id']
#align set.range_list_nthd Set.range_list_getD
@@ -81,7 +81,7 @@ theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x |
#print Set.range_list_getI /-
@[simp]
-theorem range_list_getI [Inhabited α] (l : List α) : range l.getI = insert default { x | x ∈ l } :=
+theorem range_list_getI [Inhabited α] (l : List α) : range l.getI = insert default {x | x ∈ l} :=
range_list_getD l default
#align set.range_list_inth Set.range_list_getI
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -62,7 +62,7 @@ theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) :
by
rw [← range_list_nth_le, ← range_comp]
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset.2 ⟨_, _⟩)
- exacts[(le_or_lt l.length n).imp nth_eq_none_iff.2 fun hlt => ⟨⟨_, _⟩, (nth_le_nth hlt).symm⟩,
+ exacts [(le_or_lt l.length n).imp nth_eq_none_iff.2 fun hlt => ⟨⟨_, _⟩, (nth_le_nth hlt).symm⟩,
⟨_, nth_eq_none_iff.2 le_rfl⟩, range_subset_iff.2 fun k => ⟨_, nth_le_nth _⟩]
#align set.range_list_nth Set.range_list_get?
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/3cacc945118c8c637d89950af01da78307f59325
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
! This file was ported from Lean 3 source module data.set.list
-! leanprover-community/mathlib commit 2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4
+! leanprover-community/mathlib commit 31ca6f9cf5f90a6206092cd7f84b359dcb6d52e0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -15,6 +15,9 @@ import Mathbin.Data.Fin.Basic
/-!
# Lemmas about `list`s and `set.range`
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
In this file we prove lemmas about range of some operations on lists.
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a
@@ -25,6 +25,7 @@ variable {α β : Type _} (l : List α)
namespace Set
+#print Set.range_list_map /-
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } :=
by
refine'
@@ -35,11 +36,15 @@ theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x
rcases hl a (mem_cons_self _ _) with ⟨a, rfl⟩
exact ⟨a :: l, map_cons _ _ _⟩
#align set.range_list_map Set.range_list_map
+-/
+#print Set.range_list_map_coe /-
theorem range_list_map_coe (s : Set α) : range (map (coe : s → α)) = { l | ∀ x ∈ l, x ∈ s } := by
rw [range_list_map, Subtype.range_coe]
#align set.range_list_map_coe Set.range_list_map_coe
+-/
+#print Set.range_list_nthLe /-
@[simp]
theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x | x ∈ l } :=
by
@@ -47,7 +52,9 @@ theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x |
rw [mem_set_of_eq, mem_iff_nth_le]
exact ⟨fun ⟨⟨n, h₁⟩, h₂⟩ => ⟨n, h₁, h₂⟩, fun ⟨n, h₁, h₂⟩ => ⟨⟨n, h₁⟩, h₂⟩⟩
#align set.range_list_nth_le Set.range_list_nthLe
+-/
+#print Set.range_list_get? /-
theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) :=
by
rw [← range_list_nth_le, ← range_comp]
@@ -55,7 +62,9 @@ theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) :
exacts[(le_or_lt l.length n).imp nth_eq_none_iff.2 fun hlt => ⟨⟨_, _⟩, (nth_le_nth hlt).symm⟩,
⟨_, nth_eq_none_iff.2 le_rfl⟩, range_subset_iff.2 fun k => ⟨_, nth_le_nth _⟩]
#align set.range_list_nth Set.range_list_get?
+-/
+#print Set.range_list_getD /-
@[simp]
theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x | x ∈ l } :=
calc
@@ -65,11 +74,14 @@ theorem range_list_getD (d : α) : (range fun n => l.getD n d) = insert d { x |
simp only [range_list_nth, image_insert_eq, Option.getD, image_image, image_id']
#align set.range_list_nthd Set.range_list_getD
+-/
+#print Set.range_list_getI /-
@[simp]
theorem range_list_getI [Inhabited α] (l : List α) : range l.getI = insert default { x | x ∈ l } :=
range_list_getD l default
#align set.range_list_inth Set.range_list_getI
+-/
end Set
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a
@@ -22,9 +22,8 @@ variable {α β : Type*} (l : List α)
namespace Set
theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f } := by
- refine'
- antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
- fun l hl => _
+ refine antisymm (range_subset_iff.2 fun l => forall_mem_map_iff.2 fun y _ => mem_range_self _)
+ fun l hl => ?_
induction' l with a l ihl; · exact ⟨[], rfl⟩
rcases ihl fun x hx => hl x <| subset_cons _ _ hx with ⟨l, rfl⟩
rcases hl a (mem_cons_self _ _) with ⟨a, rfl⟩
@@ -36,14 +35,14 @@ theorem range_list_map_coe (s : Set α) : range (map ((↑) : s → α)) = { l |
#align set.range_list_map_coe Set.range_list_map_coe
@[simp]
-theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x | x ∈ l } := by
+theorem range_list_get : range l.get = { x | x ∈ l } := by
ext x
- rw [mem_setOf_eq, mem_iff_get]
- exact ⟨fun ⟨⟨n, h₁⟩, h₂⟩ => ⟨⟨n, h₁⟩, h₂⟩, fun ⟨⟨n, h₁⟩, h₂⟩ => ⟨⟨n, h₁⟩, h₂⟩⟩
-#align set.range_list_nth_le Set.range_list_nthLe
+ rw [mem_setOf_eq, mem_iff_get, mem_range]
+#align set.range_list_nth_le Set.range_list_get
+@[deprecated] alias range_list_nthLe := range_list_get -- 2024-04-22
theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by
- rw [← range_list_nthLe, ← range_comp]
+ rw [← range_list_get, ← range_comp]
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset_iff.2 ⟨_, _⟩)
exacts [(le_or_lt l.length n).imp get?_eq_none.2 (fun hlt => ⟨⟨_, hlt⟩, (get?_eq_get hlt).symm⟩),
⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 fun k => ⟨_, get?_eq_get _⟩]
Splits off some lemmas from the end of this file, reducing the size of what is currently the longest file in mathlib.
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Mathlib.Data.Set.Image
-import Mathlib.Data.List.Basic
+import Mathlib.Data.List.GetD
#align_import data.set.list from "leanprover-community/mathlib"@"2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4"
@@ -5,7 +5,6 @@ Authors: Yury Kudryashov
-/
import Mathlib.Data.Set.Image
import Mathlib.Data.List.Basic
-import Mathlib.Data.Fin.Basic
#align_import data.set.list from "leanprover-community/mathlib"@"2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4"
@@ -47,7 +47,7 @@ theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) :
rw [← range_list_nthLe, ← range_comp]
refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset_iff.2 ⟨_, _⟩)
exacts [(le_or_lt l.length n).imp get?_eq_none.2 (fun hlt => ⟨⟨_, hlt⟩, (get?_eq_get hlt).symm⟩),
- ⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 <| fun k => ⟨_, get?_eq_get _⟩]
+ ⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 fun k => ⟨_, get?_eq_get _⟩]
#align set.range_list_nth Set.range_list_get?
@[simp]
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -18,7 +18,7 @@ In this file we prove lemmas about range of some operations on lists.
open List
-variable {α β : Type _} (l : List α)
+variable {α β : Type*} (l : List α)
namespace Set
@@ -2,16 +2,13 @@
Copyright (c) 2023 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module data.set.list
-! leanprover-community/mathlib commit 2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Set.Image
import Mathlib.Data.List.Basic
import Mathlib.Data.Fin.Basic
+#align_import data.set.list from "leanprover-community/mathlib"@"2ec920d35348cb2d13ac0e1a2ad9df0fdf1a76b4"
+
/-!
# Lemmas about `List`s and `Set.range`
Currently, (for both Set
and Finset
) insert_subset
is an iff
lemma stating that insert a s ⊆ t
if and only if a ∈ t
and s ⊆ t
. For both types, this PR renames this lemma to insert_subset_iff
, and adds an insert_subset
lemma that gives the implication just in the reverse direction : namely theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t
.
This both aligns the naming with union_subset
and union_subset_iff
, and removes the need for the awkward insert_subset.mpr ⟨_,_⟩
idiom. It touches a lot of files (too many to list), but in a trivial way.
@@ -48,7 +48,7 @@ theorem range_list_nthLe : (range fun k : Fin l.length => l.nthLe k k.2) = { x |
theorem range_list_get? : range l.get? = insert none (some '' { x | x ∈ l }) := by
rw [← range_list_nthLe, ← range_comp]
- refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset.2 ⟨_, _⟩)
+ refine' (range_subset_iff.2 fun n => _).antisymm (insert_subset_iff.2 ⟨_, _⟩)
exacts [(le_or_lt l.length n).imp get?_eq_none.2 (fun hlt => ⟨⟨_, hlt⟩, (get?_eq_get hlt).symm⟩),
⟨_, get?_eq_none.2 le_rfl⟩, range_subset_iff.2 <| fun k => ⟨_, get?_eq_get _⟩]
#align set.range_list_nth Set.range_list_get?
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>