data.finset.pimage
⟷
Mathlib.Data.Finset.PImage
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)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(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
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
import Data.Finset.Option
-import Data.Pfun
+import Data.PFun
#align_import data.finset.pimage from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yury Kudryashov
-/
-import Mathbin.Data.Finset.Option
-import Mathbin.Data.Pfun
+import Data.Finset.Option
+import Data.Pfun
#align_import data.finset.pimage from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2021 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.finset.pimage
-! leanprover-community/mathlib commit 0a0ec35061ed9960bf0e7ffb0335f44447b58977
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Finset.Option
import Mathbin.Data.Pfun
+#align_import data.finset.pimage from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
+
/-!
# Image of a `finset α` under a partially defined function
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -79,9 +79,11 @@ def pimage (f : α →. β) [∀ x, Decidable (f x).Dom] (s : Finset α) : Finse
#align finset.pimage Finset.pimage
-/
+#print Finset.mem_pimage /-
@[simp]
theorem mem_pimage : b ∈ s.pimage f ↔ ∃ a ∈ s, b ∈ f a := by simp [pimage]
#align finset.mem_pimage Finset.mem_pimage
+-/
#print Finset.coe_pimage /-
@[simp, norm_cast]
@@ -90,14 +92,18 @@ theorem coe_pimage : (s.pimage f : Set β) = f.image s :=
#align finset.coe_pimage Finset.coe_pimage
-/
+#print Finset.pimage_some /-
@[simp]
theorem pimage_some (s : Finset α) (f : α → β) [∀ x, Decidable (Part.some <| f x).Dom] :
(s.pimage fun x => Part.some (f x)) = s.image f := by ext; simp [eq_comm]
#align finset.pimage_some Finset.pimage_some
+-/
+#print Finset.pimage_congr /-
theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f = t.pimage g := by subst s;
ext y; simp (config := { contextual := true }) [h₂]
#align finset.pimage_congr Finset.pimage_congr
+-/
#print Finset.pimage_eq_image_filter /-
/-- Rewrite `s.pimage f` in terms of `finset.filter`, `finset.attach`, and `finset.image`. -/
@@ -108,9 +114,11 @@ theorem pimage_eq_image_filter :
#align finset.pimage_eq_image_filter Finset.pimage_eq_image_filter
-/
+#print Finset.pimage_union /-
theorem pimage_union [DecidableEq α] : (s ∪ t).pimage f = s.pimage f ∪ t.pimage f :=
coe_inj.1 <| by simp only [coe_pimage, PFun.image_union, coe_union]
#align finset.pimage_union Finset.pimage_union
+-/
#print Finset.pimage_empty /-
@[simp]
@@ -124,14 +132,18 @@ theorem pimage_subset {t : Finset β} : s.pimage f ⊆ t ↔ ∀ x ∈ s, ∀ y
#align finset.pimage_subset Finset.pimage_subset
-/
+#print Finset.pimage_mono /-
@[mono]
theorem pimage_mono (h : s ⊆ t) : s.pimage f ⊆ t.pimage f :=
pimage_subset.2 fun x hx y hy => mem_pimage.2 ⟨x, h hx, hy⟩
#align finset.pimage_mono Finset.pimage_mono
+-/
+#print Finset.pimage_inter /-
theorem pimage_inter [DecidableEq α] : (s ∩ t).pimage f ⊆ s.pimage f ∩ t.pimage f := by
simp only [← coe_subset, coe_pimage, coe_inter, PFun.image_inter]
#align finset.pimage_inter Finset.pimage_inter
+-/
end Finset
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -60,7 +60,7 @@ theorem toFinset_some {a : α} [Decidable (some a).Dom] : (some a).toFinset = {a
#print Part.coe_toFinset /-
@[simp]
-theorem coe_toFinset (o : Part α) [Decidable o.Dom] : (o.toFinset : Set α) = { x | x ∈ o } :=
+theorem coe_toFinset (o : Part α) [Decidable o.Dom] : (o.toFinset : Set α) = {x | x ∈ o} :=
Set.ext fun x => mem_toFinset
#align part.coe_to_finset Part.coe_toFinset
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -79,12 +79,6 @@ def pimage (f : α →. β) [∀ x, Decidable (f x).Dom] (s : Finset α) : Finse
#align finset.pimage Finset.pimage
-/
-/- warning: finset.mem_pimage -> Finset.mem_pimage is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] {f : PFun.{u1, u2} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u2} β (f x))] {s : Finset.{u1} α} {b : β}, Iff (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s)) (Exists.{succ u1} α (fun (a : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) (fun (H : Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) => Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) b (f a))))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] {f : PFun.{u1, u2} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u2} β (f x))] {s : Finset.{u1} α} {b : β}, Iff (Membership.mem.{u2, u2} β (Finset.{u2} β) (Finset.instMembershipFinset.{u2} β) b (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s)) (Exists.{succ u1} α (fun (a : α) => And (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s) (Membership.mem.{u2, u2} β (Part.{u2} β) (Part.instMembershipPart.{u2} β) b (f a))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_pimage Finset.mem_pimageₓ'. -/
@[simp]
theorem mem_pimage : b ∈ s.pimage f ↔ ∃ a ∈ s, b ∈ f a := by simp [pimage]
#align finset.mem_pimage Finset.mem_pimage
@@ -96,23 +90,11 @@ theorem coe_pimage : (s.pimage f : Set β) = f.image s :=
#align finset.coe_pimage Finset.coe_pimage
-/
-/- warning: finset.pimage_some -> Finset.pimage_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] (s : Finset.{u1} α) (f : α -> β) [_inst_4 : forall (x : α), Decidable (Part.Dom.{u2} β (Part.some.{u2} β (f x)))], Eq.{succ u2} (Finset.{u2} β) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) (fun (x : α) => Part.some.{u2} β (f x)) (fun (x : α) => _inst_4 x) s) (Finset.image.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f s)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} β] (s : Finset.{u2} α) (f : α -> β) [_inst_4 : forall (x : α), Decidable (Part.Dom.{u1} β (Part.some.{u1} β (f x)))], Eq.{succ u1} (Finset.{u1} β) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) (fun (x : α) => Part.some.{u1} β (f x)) (fun (x : α) => _inst_4 x) s) (Finset.image.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f s)
-Case conversion may be inaccurate. Consider using '#align finset.pimage_some Finset.pimage_someₓ'. -/
@[simp]
theorem pimage_some (s : Finset α) (f : α → β) [∀ x, Decidable (Part.some <| f x).Dom] :
(s.pimage fun x => Part.some (f x)) = s.image f := by ext; simp [eq_comm]
#align finset.pimage_some Finset.pimage_some
-/- warning: finset.pimage_congr -> Finset.pimage_congr is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] {f : PFun.{u1, u2} α β} {g : PFun.{u1, u2} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u2} β (f x))] [_inst_3 : forall (x : α), Decidable (Part.Dom.{u2} β (g x))] {s : Finset.{u1} α} {t : Finset.{u1} α}, (Eq.{succ u1} (Finset.{u1} α) s t) -> (forall (x : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) x t) -> (Eq.{succ u2} (Part.{u2} β) (f x) (g x))) -> (Eq.{succ u2} (Finset.{u2} β) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) g (fun (x : α) => _inst_3 x) t))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} β] {f : PFun.{u2, u1} α β} {g : PFun.{u2, u1} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u1} β (f x))] [_inst_3 : forall (x : α), Decidable (Part.Dom.{u1} β (g x))] {s : Finset.{u2} α} {t : Finset.{u2} α}, (Eq.{succ u2} (Finset.{u2} α) s t) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x t) -> (Eq.{succ u1} (Part.{u1} β) (f x) (g x))) -> (Eq.{succ u1} (Finset.{u1} β) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) g (fun (x : α) => _inst_3 x) t))
-Case conversion may be inaccurate. Consider using '#align finset.pimage_congr Finset.pimage_congrₓ'. -/
theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f = t.pimage g := by subst s;
ext y; simp (config := { contextual := true }) [h₂]
#align finset.pimage_congr Finset.pimage_congr
@@ -126,12 +108,6 @@ theorem pimage_eq_image_filter :
#align finset.pimage_eq_image_filter Finset.pimage_eq_image_filter
-/
-/- warning: finset.pimage_union -> Finset.pimage_union is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] {f : PFun.{u1, u2} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u2} β (f x))] {s : Finset.{u1} α} {t : Finset.{u1} α} [_inst_4 : DecidableEq.{succ u1} α], Eq.{succ u2} (Finset.{u2} β) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_4 a b)) s t)) (Union.union.{u2} (Finset.{u2} β) (Finset.hasUnion.{u2} β (fun (a : β) (b : β) => _inst_1 a b)) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) t))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} β] {f : PFun.{u2, u1} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u1} β (f x))] {s : Finset.{u2} α} {t : Finset.{u2} α} [_inst_4 : DecidableEq.{succ u2} α], Eq.{succ u1} (Finset.{u1} β) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_4 a b)) s t)) (Union.union.{u1} (Finset.{u1} β) (Finset.instUnionFinset.{u1} β (fun (a : β) (b : β) => _inst_1 a b)) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) t))
-Case conversion may be inaccurate. Consider using '#align finset.pimage_union Finset.pimage_unionₓ'. -/
theorem pimage_union [DecidableEq α] : (s ∪ t).pimage f = s.pimage f ∪ t.pimage f :=
coe_inj.1 <| by simp only [coe_pimage, PFun.image_union, coe_union]
#align finset.pimage_union Finset.pimage_union
@@ -148,23 +124,11 @@ theorem pimage_subset {t : Finset β} : s.pimage f ⊆ t ↔ ∀ x ∈ s, ∀ y
#align finset.pimage_subset Finset.pimage_subset
-/
-/- warning: finset.pimage_mono -> Finset.pimage_mono is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] {f : PFun.{u1, u2} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u2} β (f x))] {s : Finset.{u1} α} {t : Finset.{u1} α}, (HasSubset.Subset.{u1} (Finset.{u1} α) (Finset.hasSubset.{u1} α) s t) -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) t))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} β] {f : PFun.{u2, u1} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u1} β (f x))] {s : Finset.{u2} α} {t : Finset.{u2} α}, (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.instHasSubsetFinset.{u2} α) s t) -> (HasSubset.Subset.{u1} (Finset.{u1} β) (Finset.instHasSubsetFinset.{u1} β) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) t))
-Case conversion may be inaccurate. Consider using '#align finset.pimage_mono Finset.pimage_monoₓ'. -/
@[mono]
theorem pimage_mono (h : s ⊆ t) : s.pimage f ⊆ t.pimage f :=
pimage_subset.2 fun x hx y hy => mem_pimage.2 ⟨x, h hx, hy⟩
#align finset.pimage_mono Finset.pimage_mono
-/- warning: finset.pimage_inter -> Finset.pimage_inter is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} β] {f : PFun.{u1, u2} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u2} β (f x))] {s : Finset.{u1} α} {t : Finset.{u1} α} [_inst_4 : DecidableEq.{succ u1} α], HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_4 a b)) s t)) (Inter.inter.{u2} (Finset.{u2} β) (Finset.hasInter.{u2} β (fun (a : β) (b : β) => _inst_1 a b)) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u1, u2} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) t))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} β] {f : PFun.{u2, u1} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u1} β (f x))] {s : Finset.{u2} α} {t : Finset.{u2} α} [_inst_4 : DecidableEq.{succ u2} α], HasSubset.Subset.{u1} (Finset.{u1} β) (Finset.instHasSubsetFinset.{u1} β) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_4 a b)) s t)) (Inter.inter.{u1} (Finset.{u1} β) (Finset.instInterFinset.{u1} β (fun (a : β) (b : β) => _inst_1 a b)) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) t))
-Case conversion may be inaccurate. Consider using '#align finset.pimage_inter Finset.pimage_interₓ'. -/
theorem pimage_inter [DecidableEq α] : (s ∩ t).pimage f ⊆ s.pimage f ∩ t.pimage f := by
simp only [← coe_subset, coe_pimage, coe_inter, PFun.image_inter]
#align finset.pimage_inter Finset.pimage_inter
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -104,10 +104,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.pimage_some Finset.pimage_someₓ'. -/
@[simp]
theorem pimage_some (s : Finset α) (f : α → β) [∀ x, Decidable (Part.some <| f x).Dom] :
- (s.pimage fun x => Part.some (f x)) = s.image f :=
- by
- ext
- simp [eq_comm]
+ (s.pimage fun x => Part.some (f x)) = s.image f := by ext; simp [eq_comm]
#align finset.pimage_some Finset.pimage_some
/- warning: finset.pimage_congr -> Finset.pimage_congr is a dubious translation:
@@ -116,11 +113,8 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} β] {f : PFun.{u2, u1} α β} {g : PFun.{u2, u1} α β} [_inst_2 : forall (x : α), Decidable (Part.Dom.{u1} β (f x))] [_inst_3 : forall (x : α), Decidable (Part.Dom.{u1} β (g x))] {s : Finset.{u2} α} {t : Finset.{u2} α}, (Eq.{succ u2} (Finset.{u2} α) s t) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x t) -> (Eq.{succ u1} (Part.{u1} β) (f x) (g x))) -> (Eq.{succ u1} (Finset.{u1} β) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) f (fun (x : α) => _inst_2 x) s) (Finset.pimage.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) g (fun (x : α) => _inst_3 x) t))
Case conversion may be inaccurate. Consider using '#align finset.pimage_congr Finset.pimage_congrₓ'. -/
-theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f = t.pimage g :=
- by
- subst s
- ext y
- simp (config := { contextual := true }) [h₂]
+theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f = t.pimage g := by subst s;
+ ext y; simp (config := { contextual := true }) [h₂]
#align finset.pimage_congr Finset.pimage_congr
#print Finset.pimage_eq_image_filter /-
@@ -128,9 +122,7 @@ theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f
theorem pimage_eq_image_filter :
s.pimage f =
(filter (fun x => (f x).Dom) s).attach.image fun x => (f x).get (mem_filter.1 x.coe_prop).2 :=
- by
- ext x
- simp [Part.mem_eq, And.exists, -exists_prop]
+ by ext x; simp [Part.mem_eq, And.exists, -exists_prop]
#align finset.pimage_eq_image_filter Finset.pimage_eq_image_filter
-/
@@ -146,9 +138,7 @@ theorem pimage_union [DecidableEq α] : (s ∪ t).pimage f = s.pimage f ∪ t.pi
#print Finset.pimage_empty /-
@[simp]
-theorem pimage_empty : pimage f ∅ = ∅ := by
- ext
- simp
+theorem pimage_empty : pimage f ∅ = ∅ := by ext; simp
#align finset.pimage_empty Finset.pimage_empty
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/e3fb84046afd187b710170887195d50bada934ee
@@ -75,7 +75,7 @@ variable [DecidableEq β] {f g : α →. β} [∀ x, Decidable (f x).Dom] [∀ x
#print Finset.pimage /-
/-- Image of `s : finset α` under a partially defined function `f : α →. β`. -/
def pimage (f : α →. β) [∀ x, Decidable (f x).Dom] (s : Finset α) : Finset β :=
- s.bunionᵢ fun x => (f x).toFinset
+ s.biUnion fun x => (f x).toFinset
#align finset.pimage Finset.pimage
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -82,8 +82,8 @@ theorem pimage_some (s : Finset α) (f : α → β) [∀ x, Decidable (Part.some
theorem pimage_congr (h₁ : s = t) (h₂ : ∀ x ∈ t, f x = g x) : s.pimage f = t.pimage g := by
subst s
ext y
- -- Porting note: `←exists_prop` required because `∃ x ∈ s, p x` is defined differently
- simp (config := { contextual := true }) only [mem_pimage, ←exists_prop, h₂]
+ -- Porting note: `← exists_prop` required because `∃ x ∈ s, p x` is defined differently
+ simp (config := { contextual := true }) only [mem_pimage, ← exists_prop, h₂]
#align finset.pimage_congr Finset.pimage_congr
/-- Rewrite `s.pimage f` in terms of `Finset.filter`, `Finset.attach`, and `Finset.image`. -/
@@ -93,8 +93,8 @@ theorem pimage_eq_image_filter : s.pimage f =
(f x).get (mem_filter.mp x.coe_prop).2 := by
ext x
simp [Part.mem_eq, And.exists]
- -- Porting note: `←exists_prop` required because `∃ x ∈ s, p x` is defined differently
- simp only [←exists_prop]
+ -- Porting note: `← exists_prop` required because `∃ x ∈ s, p x` is defined differently
+ simp only [← exists_prop]
#align finset.pimage_eq_image_filter Finset.pimage_eq_image_filter
theorem pimage_union [DecidableEq α] : (s ∪ t).pimage f = s.pimage f ∪ t.pimage f :=
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -21,7 +21,7 @@ finite set, image, partial function
-/
-variable {α β : Type _}
+variable {α β : Type*}
namespace Part
@@ -2,16 +2,13 @@
Copyright (c) 2021 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.finset.pimage
-! leanprover-community/mathlib commit f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Finset.Option
import Mathlib.Data.PFun
import Mathlib.Data.Part
+#align_import data.finset.pimage from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c"
+
/-!
# Image of a `Finset α` under a partially defined function
@@ -28,7 +28,7 @@ variable {α β : Type _}
namespace Part
-/-- Convert a `o : Part α` with decidable `Part.Dom o` to `Finset α`. -/
+/-- Convert an `o : Part α` with decidable `Part.Dom o` to `Finset α`. -/
def toFinset (o : Part α) [Decidable o.Dom] : Finset α :=
o.toOption.toFinset
#align part.to_finset Part.toFinset
sSup
/iSup
(#3938)
As discussed on Zulip
supₛ
→ sSup
infₛ
→ sInf
supᵢ
→ iSup
infᵢ
→ iInf
bsupₛ
→ bsSup
binfₛ
→ bsInf
bsupᵢ
→ biSup
binfᵢ
→ biInf
csupₛ
→ csSup
cinfₛ
→ csInf
csupᵢ
→ ciSup
cinfᵢ
→ ciInf
unionₛ
→ sUnion
interₛ
→ sInter
unionᵢ
→ iUnion
interᵢ
→ iInter
bunionₛ
→ bsUnion
binterₛ
→ bsInter
bunionᵢ
→ biUnion
binterᵢ
→ biInter
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@@ -62,7 +62,7 @@ variable [DecidableEq β] {f g : α →. β} [∀ x, Decidable (f x).Dom] [∀ x
/-- Image of `s : Finset α` under a partially defined function `f : α →. β`. -/
def pimage (f : α →. β) [∀ x, Decidable (f x).Dom] (s : Finset α) : Finset β :=
- s.bunionᵢ fun x => (f x).toFinset
+ s.biUnion fun x => (f x).toFinset
#align finset.pimage Finset.pimage
@[simp]
Acc.rec
and many related defs computable (#3535)
Lean 4 code generator has had no native supports for Acc.rec
.
This PR makes Acc.rec
computable.
This change makes many defs computable. Especially, computable PFun.fix
and Part.hasFix
enables us to reason about partial
functions.
This PR also renames some instances and gives PFun.lift
@[coe]
attr.
@@ -61,7 +61,7 @@ variable [DecidableEq β] {f g : α →. β} [∀ x, Decidable (f x).Dom] [∀ x
{s t : Finset α} {b : β}
/-- Image of `s : Finset α` under a partially defined function `f : α →. β`. -/
-noncomputable def pimage (f : α →. β) [∀ x, Decidable (f x).Dom] (s : Finset α) : Finset β :=
+def pimage (f : α →. β) [∀ x, Decidable (f x).Dom] (s : Finset α) : Finset β :=
s.bunionᵢ fun x => (f x).toFinset
#align finset.pimage Finset.pimage
@@ -115,7 +115,7 @@ theorem pimage_subset {t : Finset β} : s.pimage f ⊆ t ↔ ∀ x ∈ s, ∀ y
simp [subset_iff, @forall_swap _ β]
#align finset.pimage_subset Finset.pimage_subset
--- @[mono] Porting note: mono not implemented yet
+@[mono]
theorem pimage_mono (h : s ⊆ t) : s.pimage f ⊆ t.pimage f :=
pimage_subset.2 fun x hx _ hy => mem_pimage.2 ⟨x, h hx, hy⟩
#align finset.pimage_mono Finset.pimage_mono
The unported dependencies are