data.part
⟷
Mathlib.Data.Part
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)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
@@ -70,6 +70,14 @@ variables {α : Type*} {β : Type*} {γ : Type*}
def to_option (o : part α) [decidable o.dom] : option α :=
if h : dom o then some (o.get h) else none
+@[simp] lemma to_option_is_some (o : part α) [decidable o.dom] :
+ o.to_option.is_some ↔ o.dom :=
+by by_cases o.dom; simp [h, part.to_option]
+
+@[simp] lemma to_option_is_none (o : part α) [decidable o.dom] :
+ o.to_option.is_none ↔ ¬o.dom :=
+by by_cases o.dom; simp [h, part.to_option]
+
/-- `part` extensionality -/
theorem ext' : ∀ {o p : part α}
(H1 : o.dom ↔ p.dom)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -535,7 +535,7 @@ theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy :
rcases Part.eq_none_or_eq_some x with (h | ⟨b, h₀⟩)
· rw [h]; left; apply OrderBot.bot_le _
right; intro b' h₁
- rw [Part.eq_some_iff] at h₀
+ rw [Part.eq_some_iff] at h₀
replace hx := hx _ h₀; replace hy := hy _ h₁
replace hx := Part.mem_unique hx hy; subst hx
exact h₀
@@ -794,10 +794,10 @@ theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
by
constructor <;> intro h
· intro a h' b; replace h := h b
- simp only [and_imp, exists_prop, bind_eq_bind, mem_bind_iff, exists_imp] at h
+ simp only [and_imp, exists_prop, bind_eq_bind, mem_bind_iff, exists_imp] at h
apply h _ h'
· intro b h'
- simp only [exists_prop, bind_eq_bind, mem_bind_iff] at h'
+ simp only [exists_prop, bind_eq_bind, mem_bind_iff] at h'
rcases h' with ⟨a, h₀, h₁⟩; apply h _ h₀ _ h₁
#align part.bind_le Part.bind_le
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -279,7 +279,7 @@ theorem ne_none_iff {o : Part α} : o ≠ none ↔ ∃ x, o = some x :=
#print Part.eq_none_or_eq_some /-
theorem eq_none_or_eq_some (o : Part α) : o = none ∨ ∃ x, o = some x :=
- or_iff_not_imp_left.2 ne_none_iff.1
+ Classical.or_iff_not_imp_left.2 ne_none_iff.1
#align part.eq_none_or_eq_some Part.eq_none_or_eq_some
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
-/
-import Mathbin.Data.Set.Basic
-import Mathbin.Logic.Equiv.Defs
+import Data.Set.Basic
+import Logic.Equiv.Defs
#align_import data.part from "leanprover-community/mathlib"@"80c43012d26f63026d362c3aba28f3c3bafb07e6"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
-
-! This file was ported from Lean 3 source module data.part
-! leanprover-community/mathlib commit 80c43012d26f63026d362c3aba28f3c3bafb07e6
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Set.Basic
import Mathbin.Logic.Equiv.Defs
+#align_import data.part from "leanprover-community/mathlib"@"80c43012d26f63026d362c3aba28f3c3bafb07e6"
+
/-!
# Partial values of a type
mathlib commit https://github.com/leanprover-community/mathlib/commit/8efcf8022aac8e01df8d302dcebdbc25d6a886c8
@@ -744,9 +744,8 @@ instance : Monad Part where
map := @map
bind := @Part.bind
-instance : LawfulMonad Part
- where
- bind_pure_comp_eq_map := @bind_some_eq_map
+instance : LawfulMonad Part where
+ bind_pure_comp := @bind_some_eq_map
id_map β f := by cases f <;> rfl
pure_bind := @bind_some
bind_assoc := @bind_assoc
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -415,6 +415,7 @@ theorem toOption_eq_none_iff {a : Part α} [Decidable a.Dom] : a.toOption = Opti
#align part.to_option_eq_none_iff Part.toOption_eq_none_iff
-/
+#print Part.elim_toOption /-
@[simp]
theorem elim_toOption {α β : Type _} (a : Part α) [Decidable a.Dom] (b : β) (f : α → β) :
a.toOption.elim b f = if h : a.Dom then f (a.get h) else b :=
@@ -425,6 +426,7 @@ theorem elim_toOption {α β : Type _} (a : Part α) [Decidable a.Dom] (b : β)
· rw [Part.toOption_eq_none_iff.2 h]
rfl
#align part.elim_to_option Part.elim_toOption
+-/
#print Part.ofOption /-
/-- Converts an `option α` into a `part α`. -/
@@ -530,6 +532,7 @@ instance : OrderBot (Part α) where
bot := none
bot_le := by introv x; rintro ⟨⟨_⟩, _⟩
+#print Part.le_total_of_le_of_le /-
theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy : y ≤ z) :
x ≤ y ∨ y ≤ x := by
rcases Part.eq_none_or_eq_some x with (h | ⟨b, h₀⟩)
@@ -540,6 +543,7 @@ theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy :
replace hx := Part.mem_unique hx hy; subst hx
exact h₀
#align part.le_total_of_le_of_le Part.le_total_of_le_of_le
+-/
#print Part.assert /-
/-- `assert p f` is a bind-like operation which appends an additional condition
@@ -565,16 +569,20 @@ def map (f : α → β) (o : Part α) : Part β :=
#align part.map Part.map
-/
+#print Part.mem_map /-
theorem mem_map (f : α → β) {o : Part α} : ∀ {a}, a ∈ o → f a ∈ map f o
| _, ⟨h, rfl⟩ => ⟨_, rfl⟩
#align part.mem_map Part.mem_map
+-/
+#print Part.mem_map_iff /-
@[simp]
theorem mem_map_iff (f : α → β) {o : Part α} {b} : b ∈ map f o ↔ ∃ a ∈ o, f a = b :=
⟨match b with
| _, ⟨h, rfl⟩ => ⟨_, ⟨_, rfl⟩, rfl⟩,
fun ⟨a, h₁, h₂⟩ => h₂ ▸ mem_map f h₁⟩
#align part.mem_map_iff Part.mem_map_iff
+-/
#print Part.map_none /-
@[simp]
@@ -628,17 +636,22 @@ theorem assert_neg {p : Prop} {f : p → Part α} (h : ¬p) : assert p f = none
#align part.assert_neg Part.assert_neg
-/
+#print Part.mem_bind /-
theorem mem_bind {f : Part α} {g : α → Part β} : ∀ {a b}, a ∈ f → b ∈ g a → b ∈ f.bind g
| _, _, ⟨h, rfl⟩, ⟨h₂, rfl⟩ => ⟨⟨h, h₂⟩, rfl⟩
#align part.mem_bind Part.mem_bind
+-/
+#print Part.mem_bind_iff /-
@[simp]
theorem mem_bind_iff {f : Part α} {g : α → Part β} {b} : b ∈ f.bind g ↔ ∃ a ∈ f, b ∈ g a :=
⟨match b with
| _, ⟨⟨h₁, h₂⟩, rfl⟩ => ⟨_, ⟨_, rfl⟩, ⟨_, rfl⟩⟩,
fun ⟨a, h₁, h₂⟩ => mem_bind h₁ h₂⟩
#align part.mem_bind_iff Part.mem_bind_iff
+-/
+#print Part.Dom.bind /-
protected theorem Dom.bind {o : Part α} (h : o.Dom) (f : α → Part β) : o.bind f = f (o.get h) :=
by
ext b
@@ -647,6 +660,7 @@ protected theorem Dom.bind {o : Part α} (h : o.Dom) (f : α → Part β) : o.bi
rintro ⟨a, ha, hb⟩
rwa [Part.get_eq_of_mem ha]
#align part.dom.bind Part.Dom.bind
+-/
#print Part.Dom.of_bind /-
theorem Dom.of_bind {f : α → Part β} {a : Part α} (h : (a.bind f).Dom) : a.Dom :=
@@ -668,13 +682,17 @@ theorem bind_some (a : α) (f : α → Part β) : (some a).bind f = f a :=
#align part.bind_some Part.bind_some
-/
+#print Part.bind_of_mem /-
theorem bind_of_mem {o : Part α} {a : α} (h : a ∈ o) (f : α → Part β) : o.bind f = f a := by
rw [eq_some_iff.2 h, bind_some]
#align part.bind_of_mem Part.bind_of_mem
+-/
+#print Part.bind_some_eq_map /-
theorem bind_some_eq_map (f : α → β) (x : Part α) : x.bind (some ∘ f) = map f x :=
ext <| by simp [eq_comm]
#align part.bind_some_eq_map Part.bind_some_eq_map
+-/
#print Part.bind_toOption /-
theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀ a, Decidable (f a).Dom]
@@ -689,6 +707,7 @@ theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀
#align part.bind_to_option Part.bind_toOption
-/
+#print Part.bind_assoc /-
theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ) :
(f.bind g).bind k = f.bind fun x => (g x).bind k :=
ext fun a => by
@@ -697,11 +716,14 @@ theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ)
⟨fun ⟨_, ⟨_, h₁, h₂⟩, h₃⟩ => ⟨_, h₁, _, h₂, h₃⟩, fun ⟨_, h₁, _, h₂, h₃⟩ =>
⟨_, ⟨_, h₁, h₂⟩, h₃⟩⟩
#align part.bind_assoc Part.bind_assoc
+-/
+#print Part.bind_map /-
@[simp]
theorem bind_map {γ} (f : α → β) (x) (g : β → Part γ) :
(map f x).bind g = x.bind fun y => g (f y) := by rw [← bind_some_eq_map, bind_assoc] <;> simp
#align part.bind_map Part.bind_map
+-/
#print Part.map_bind /-
@[simp]
@@ -711,9 +733,11 @@ theorem map_bind {γ} (f : α → Part β) (x : Part α) (g : β → γ) :
#align part.map_bind Part.map_bind
-/
+#print Part.map_map /-
theorem map_map (g : β → γ) (f : α → β) (o : Part α) : map g (map f o) = map (g ∘ f) o := by
rw [← bind_some_eq_map, bind_map, bind_some_eq_map]
#align part.map_map Part.map_map
+-/
instance : Monad Part where
pure := @some
@@ -740,26 +764,35 @@ theorem bind_some_right (x : Part α) : x.bind some = x := by
#align part.bind_some_right Part.bind_some_right
-/
+#print Part.pure_eq_some /-
@[simp]
theorem pure_eq_some (a : α) : pure a = some a :=
rfl
#align part.pure_eq_some Part.pure_eq_some
+-/
+#print Part.ret_eq_some /-
@[simp]
theorem ret_eq_some (a : α) : return a = some a :=
rfl
#align part.ret_eq_some Part.ret_eq_some
+-/
+#print Part.map_eq_map /-
@[simp]
theorem map_eq_map {α β} (f : α → β) (o : Part α) : f <$> o = map f o :=
rfl
#align part.map_eq_map Part.map_eq_map
+-/
+#print Part.bind_eq_bind /-
@[simp]
theorem bind_eq_bind {α β} (f : Part α) (g : α → Part β) : f >>= g = f.bind g :=
rfl
#align part.bind_eq_bind Part.bind_eq_bind
+-/
+#print Part.bind_le /-
theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
x >>= f ≤ y ↔ ∀ a, a ∈ x → f a ≤ y :=
by
@@ -771,6 +804,7 @@ theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
simp only [exists_prop, bind_eq_bind, mem_bind_iff] at h'
rcases h' with ⟨a, h₀, h₁⟩; apply h _ h₀ _ h₁
#align part.bind_le Part.bind_le
+-/
instance : MonadFail Part :=
{ Part.monad with fail := fun _ _ => none }
@@ -807,15 +841,19 @@ theorem assert_defined {p : Prop} {f : p → Part α} : ∀ h : p, (f h).Dom →
#align part.assert_defined Part.assert_defined
-/
+#print Part.bind_defined /-
theorem bind_defined {f : Part α} {g : α → Part β} :
∀ h : f.Dom, (g (f.get h)).Dom → (f.bind g).Dom :=
assert_defined
#align part.bind_defined Part.bind_defined
+-/
+#print Part.bind_dom /-
@[simp]
theorem bind_dom {f : Part α} {g : α → Part β} : (f.bind g).Dom ↔ ∃ h : f.Dom, (g (f.get h)).Dom :=
Iff.rfl
#align part.bind_dom Part.bind_dom
+-/
section Instances
@@ -842,38 +880,50 @@ instance [Union α] : Union (Part α) where union a b := (· ∪ ·) <$> a <*> b
instance [SDiff α] : SDiff (Part α) where sdiff a b := (· \ ·) <$> a <*> b
+#print Part.one_mem_one /-
@[to_additive]
theorem one_mem_one [One α] : (1 : α) ∈ (1 : Part α) :=
⟨trivial, rfl⟩
#align part.one_mem_one Part.one_mem_one
#align part.zero_mem_zero Part.zero_mem_zero
+-/
+#print Part.mul_mem_mul /-
@[to_additive]
theorem mul_mem_mul [Mul α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma * mb ∈ a * b := by tidy
#align part.mul_mem_mul Part.mul_mem_mul
#align part.add_mem_add Part.add_mem_add
+-/
+#print Part.left_dom_of_mul_dom /-
@[to_additive]
theorem left_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : a.Dom := by tidy
#align part.left_dom_of_mul_dom Part.left_dom_of_mul_dom
#align part.left_dom_of_add_dom Part.left_dom_of_add_dom
+-/
+#print Part.right_dom_of_mul_dom /-
@[to_additive]
theorem right_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : b.Dom := by tidy
#align part.right_dom_of_mul_dom Part.right_dom_of_mul_dom
#align part.right_dom_of_add_dom Part.right_dom_of_add_dom
+-/
+#print Part.mul_get_eq /-
@[simp, to_additive]
theorem mul_get_eq [Mul α] (a b : Part α) (hab : Dom (a * b)) :
(a * b).get hab = a.get (left_dom_of_mul_dom hab) * b.get (right_dom_of_mul_dom hab) := by tidy
#align part.mul_get_eq Part.mul_get_eq
#align part.add_get_eq Part.add_get_eq
+-/
+#print Part.some_mul_some /-
@[to_additive]
theorem some_mul_some [Mul α] (a b : α) : some a * some b = some (a * b) := by tidy
#align part.some_mul_some Part.some_mul_some
#align part.some_add_some Part.some_add_some
+-/
#print Part.inv_mem_inv /-
@[to_additive]
@@ -890,126 +940,186 @@ theorem inv_some [Inv α] (a : α) : (some a)⁻¹ = some a⁻¹ :=
#align part.neg_some Part.neg_some
-/
+#print Part.div_mem_div /-
@[to_additive]
theorem div_mem_div [Div α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma / mb ∈ a / b := by tidy
#align part.div_mem_div Part.div_mem_div
#align part.sub_mem_sub Part.sub_mem_sub
+-/
+#print Part.left_dom_of_div_dom /-
@[to_additive]
theorem left_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : a.Dom := by tidy
#align part.left_dom_of_div_dom Part.left_dom_of_div_dom
#align part.left_dom_of_sub_dom Part.left_dom_of_sub_dom
+-/
+#print Part.right_dom_of_div_dom /-
@[to_additive]
theorem right_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : b.Dom := by tidy
#align part.right_dom_of_div_dom Part.right_dom_of_div_dom
#align part.right_dom_of_sub_dom Part.right_dom_of_sub_dom
+-/
+#print Part.div_get_eq /-
@[simp, to_additive]
theorem div_get_eq [Div α] (a b : Part α) (hab : Dom (a / b)) :
(a / b).get hab = a.get (left_dom_of_div_dom hab) / b.get (right_dom_of_div_dom hab) := by tidy
#align part.div_get_eq Part.div_get_eq
#align part.sub_get_eq Part.sub_get_eq
+-/
+#print Part.some_div_some /-
@[to_additive]
theorem some_div_some [Div α] (a b : α) : some a / some b = some (a / b) := by tidy
#align part.some_div_some Part.some_div_some
#align part.some_sub_some Part.some_sub_some
+-/
+#print Part.mod_mem_mod /-
theorem mod_mem_mod [Mod α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma % mb ∈ a % b := by tidy
#align part.mod_mem_mod Part.mod_mem_mod
+-/
+#print Part.left_dom_of_mod_dom /-
theorem left_dom_of_mod_dom [Mod α] {a b : Part α} (hab : Dom (a % b)) : a.Dom := by tidy
#align part.left_dom_of_mod_dom Part.left_dom_of_mod_dom
+-/
+#print Part.right_dom_of_mod_dom /-
theorem right_dom_of_mod_dom [Mod α] {a b : Part α} (hab : Dom (a % b)) : b.Dom := by tidy
#align part.right_dom_of_mod_dom Part.right_dom_of_mod_dom
+-/
+#print Part.mod_get_eq /-
@[simp]
theorem mod_get_eq [Mod α] (a b : Part α) (hab : Dom (a % b)) :
(a % b).get hab = a.get (left_dom_of_mod_dom hab) % b.get (right_dom_of_mod_dom hab) := by tidy
#align part.mod_get_eq Part.mod_get_eq
+-/
+#print Part.some_mod_some /-
theorem some_mod_some [Mod α] (a b : α) : some a % some b = some (a % b) := by tidy
#align part.some_mod_some Part.some_mod_some
+-/
+#print Part.append_mem_append /-
theorem append_mem_append [Append α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma ++ mb ∈ a ++ b := by tidy
#align part.append_mem_append Part.append_mem_append
+-/
+#print Part.left_dom_of_append_dom /-
theorem left_dom_of_append_dom [Append α] {a b : Part α} (hab : Dom (a ++ b)) : a.Dom := by tidy
#align part.left_dom_of_append_dom Part.left_dom_of_append_dom
+-/
+#print Part.right_dom_of_append_dom /-
theorem right_dom_of_append_dom [Append α] {a b : Part α} (hab : Dom (a ++ b)) : b.Dom := by tidy
#align part.right_dom_of_append_dom Part.right_dom_of_append_dom
+-/
+#print Part.append_get_eq /-
@[simp]
theorem append_get_eq [Append α] (a b : Part α) (hab : Dom (a ++ b)) :
(a ++ b).get hab = a.get (left_dom_of_append_dom hab) ++ b.get (right_dom_of_append_dom hab) :=
by tidy
#align part.append_get_eq Part.append_get_eq
+-/
+#print Part.some_append_some /-
theorem some_append_some [Append α] (a b : α) : some a ++ some b = some (a ++ b) := by tidy
#align part.some_append_some Part.some_append_some
+-/
+#print Part.inter_mem_inter /-
theorem inter_mem_inter [Inter α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma ∩ mb ∈ a ∩ b := by tidy
#align part.inter_mem_inter Part.inter_mem_inter
+-/
+#print Part.left_dom_of_inter_dom /-
theorem left_dom_of_inter_dom [Inter α] {a b : Part α} (hab : Dom (a ∩ b)) : a.Dom := by tidy
#align part.left_dom_of_inter_dom Part.left_dom_of_inter_dom
+-/
+#print Part.right_dom_of_inter_dom /-
theorem right_dom_of_inter_dom [Inter α] {a b : Part α} (hab : Dom (a ∩ b)) : b.Dom := by tidy
#align part.right_dom_of_inter_dom Part.right_dom_of_inter_dom
+-/
+#print Part.inter_get_eq /-
@[simp]
theorem inter_get_eq [Inter α] (a b : Part α) (hab : Dom (a ∩ b)) :
(a ∩ b).get hab = a.get (left_dom_of_inter_dom hab) ∩ b.get (right_dom_of_inter_dom hab) := by
tidy
#align part.inter_get_eq Part.inter_get_eq
+-/
+#print Part.some_inter_some /-
theorem some_inter_some [Inter α] (a b : α) : some a ∩ some b = some (a ∩ b) := by tidy
#align part.some_inter_some Part.some_inter_some
+-/
+#print Part.union_mem_union /-
theorem union_mem_union [Union α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma ∪ mb ∈ a ∪ b := by tidy
#align part.union_mem_union Part.union_mem_union
+-/
+#print Part.left_dom_of_union_dom /-
theorem left_dom_of_union_dom [Union α] {a b : Part α} (hab : Dom (a ∪ b)) : a.Dom := by tidy
#align part.left_dom_of_union_dom Part.left_dom_of_union_dom
+-/
+#print Part.right_dom_of_union_dom /-
theorem right_dom_of_union_dom [Union α] {a b : Part α} (hab : Dom (a ∪ b)) : b.Dom := by tidy
#align part.right_dom_of_union_dom Part.right_dom_of_union_dom
+-/
+#print Part.union_get_eq /-
@[simp]
theorem union_get_eq [Union α] (a b : Part α) (hab : Dom (a ∪ b)) :
(a ∪ b).get hab = a.get (left_dom_of_union_dom hab) ∪ b.get (right_dom_of_union_dom hab) := by
tidy
#align part.union_get_eq Part.union_get_eq
+-/
+#print Part.some_union_some /-
theorem some_union_some [Union α] (a b : α) : some a ∪ some b = some (a ∪ b) := by tidy
#align part.some_union_some Part.some_union_some
+-/
+#print Part.sdiff_mem_sdiff /-
theorem sdiff_mem_sdiff [SDiff α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma \ mb ∈ a \ b := by tidy
#align part.sdiff_mem_sdiff Part.sdiff_mem_sdiff
+-/
+#print Part.left_dom_of_sdiff_dom /-
theorem left_dom_of_sdiff_dom [SDiff α] {a b : Part α} (hab : Dom (a \ b)) : a.Dom := by tidy
#align part.left_dom_of_sdiff_dom Part.left_dom_of_sdiff_dom
+-/
+#print Part.right_dom_of_sdiff_dom /-
theorem right_dom_of_sdiff_dom [SDiff α] {a b : Part α} (hab : Dom (a \ b)) : b.Dom := by tidy
#align part.right_dom_of_sdiff_dom Part.right_dom_of_sdiff_dom
+-/
+#print Part.sdiff_get_eq /-
@[simp]
theorem sdiff_get_eq [SDiff α] (a b : Part α) (hab : Dom (a \ b)) :
(a \ b).get hab = a.get (left_dom_of_sdiff_dom hab) \ b.get (right_dom_of_sdiff_dom hab) := by
tidy
#align part.sdiff_get_eq Part.sdiff_get_eq
+-/
+#print Part.some_sdiff_some /-
theorem some_sdiff_some [SDiff α] (a b : α) : some a \ some b = some (a \ b) := by tidy
#align part.some_sdiff_some Part.some_sdiff_some
+-/
end Instances
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -208,7 +208,7 @@ theorem get_eq_of_mem {o : Part α} {a} (h : a ∈ o) (h') : get o h' = a :=
-/
#print Part.subsingleton /-
-protected theorem subsingleton (o : Part α) : Set.Subsingleton { a | a ∈ o } := fun a ha b hb =>
+protected theorem subsingleton (o : Part α) : Set.Subsingleton {a | a ∈ o} := fun a ha b hb =>
mem_unique ha hb
#align part.subsingleton Part.subsingleton
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -314,7 +314,7 @@ theorem get_eq_iff_eq_some {a : Part α} {ha : a.Dom} {b : α} : a.get ha = b
#print Part.get_eq_get_of_eq /-
theorem get_eq_get_of_eq (a : Part α) (ha : a.Dom) {b : Part α} (h : a = b) :
- a.get ha = b.get (h ▸ ha) := by congr ; exact h
+ a.get ha = b.get (h ▸ ha) := by congr; exact h
#align part.get_eq_get_of_eq Part.get_eq_get_of_eq
-/
@@ -452,7 +452,7 @@ theorem ofOption_dom {α} : ∀ o : Option α, (ofOption o).Dom ↔ o.isSome
#print Part.ofOption_eq_get /-
theorem ofOption_eq_get {α} (o : Option α) : ofOption o = ⟨_, @Option.get _ o⟩ :=
- Part.ext' (ofOption_dom o) fun h₁ h₂ => by cases o <;> [cases h₁;rfl]
+ Part.ext' (ofOption_dom o) fun h₁ h₂ => by cases o <;> [cases h₁; rfl]
#align part.of_option_eq_get Part.ofOption_eq_get
-/
@@ -514,7 +514,7 @@ theorem of_toOption (o : Part α) [Decidable o.Dom] : ofOption (toOption o) = o
noncomputable def equivOption : Part α ≃ Option α :=
haveI := Classical.dec
⟨fun o => to_option o, of_option, fun o => of_to_option o, fun o =>
- Eq.trans (by dsimp <;> congr ) (to_of_option o)⟩
+ Eq.trans (by dsimp <;> congr) (to_of_option o)⟩
#align part.equiv_option Part.equivOption
-/
@@ -535,7 +535,7 @@ theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy :
rcases Part.eq_none_or_eq_some x with (h | ⟨b, h₀⟩)
· rw [h]; left; apply OrderBot.bot_le _
right; intro b' h₁
- rw [Part.eq_some_iff] at h₀
+ rw [Part.eq_some_iff] at h₀
replace hx := hx _ h₀; replace hy := hy _ h₁
replace hx := Part.mem_unique hx hy; subst hx
exact h₀
@@ -765,10 +765,10 @@ theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
by
constructor <;> intro h
· intro a h' b; replace h := h b
- simp only [and_imp, exists_prop, bind_eq_bind, mem_bind_iff, exists_imp] at h
+ simp only [and_imp, exists_prop, bind_eq_bind, mem_bind_iff, exists_imp] at h
apply h _ h'
· intro b h'
- simp only [exists_prop, bind_eq_bind, mem_bind_iff] at h'
+ simp only [exists_prop, bind_eq_bind, mem_bind_iff] at h'
rcases h' with ⟨a, h₀, h₁⟩; apply h _ h₀ _ h₁
#align part.bind_le Part.bind_le
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -415,12 +415,6 @@ theorem toOption_eq_none_iff {a : Part α} [Decidable a.Dom] : a.toOption = Opti
#align part.to_option_eq_none_iff Part.toOption_eq_none_iff
-/
-/- warning: part.elim_to_option -> Part.elim_toOption is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (a : Part.{u1} α) [_inst_1 : Decidable (Part.Dom.{u1} α a)] (b : β) (f : α -> β), Eq.{succ u2} β (Option.elim'.{u1, u2} α β b f (Part.toOption.{u1} α a _inst_1)) (dite.{succ u2} β (Part.Dom.{u1} α a) _inst_1 (fun (h : Part.Dom.{u1} α a) => f (Part.get.{u1} α a h)) (fun (h : Not (Part.Dom.{u1} α a)) => b))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (a : Part.{u2} α) [_inst_1 : Decidable (Part.Dom.{u2} α a)] (b : β) (f : α -> β), Eq.{succ u1} β (Option.elim.{u2, succ u1} α β (Part.toOption.{u2} α a _inst_1) b f) (dite.{succ u1} β (Part.Dom.{u2} α a) _inst_1 (fun (h : Part.Dom.{u2} α a) => f (Part.get.{u2} α a h)) (fun (h : Not (Part.Dom.{u2} α a)) => b))
-Case conversion may be inaccurate. Consider using '#align part.elim_to_option Part.elim_toOptionₓ'. -/
@[simp]
theorem elim_toOption {α β : Type _} (a : Part α) [Decidable a.Dom] (b : β) (f : α → β) :
a.toOption.elim b f = if h : a.Dom then f (a.get h) else b :=
@@ -536,12 +530,6 @@ instance : OrderBot (Part α) where
bot := none
bot_le := by introv x; rintro ⟨⟨_⟩, _⟩
-/- warning: part.le_total_of_le_of_le -> Part.le_total_of_le_of_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {x : Part.{u1} α} {y : Part.{u1} α} (z : Part.{u1} α), (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) x z) -> (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) y z) -> (Or (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) x y) (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) y x))
-but is expected to have type
- forall {α : Type.{u1}} {x : Part.{u1} α} {y : Part.{u1} α} (z : Part.{u1} α), (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) x z) -> (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) y z) -> (Or (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) x y) (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) y x))
-Case conversion may be inaccurate. Consider using '#align part.le_total_of_le_of_le Part.le_total_of_le_of_leₓ'. -/
theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy : y ≤ z) :
x ≤ y ∨ y ≤ x := by
rcases Part.eq_none_or_eq_some x with (h | ⟨b, h₀⟩)
@@ -577,22 +565,10 @@ def map (f : α → β) (o : Part α) : Part β :=
#align part.map Part.map
-/
-/- warning: part.mem_map -> Part.mem_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) {o : Part.{u1} α} {a : α}, (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a o) -> (Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) (f a) (Part.map.{u1, u2} α β f o))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) {o : Part.{u2} α} {a : α}, (Membership.mem.{u2, u2} α (Part.{u2} α) (Part.instMembershipPart.{u2} α) a o) -> (Membership.mem.{u1, u1} β (Part.{u1} β) (Part.instMembershipPart.{u1} β) (f a) (Part.map.{u2, u1} α β f o))
-Case conversion may be inaccurate. Consider using '#align part.mem_map Part.mem_mapₓ'. -/
theorem mem_map (f : α → β) {o : Part α} : ∀ {a}, a ∈ o → f a ∈ map f o
| _, ⟨h, rfl⟩ => ⟨_, rfl⟩
#align part.mem_map Part.mem_map
-/- warning: part.mem_map_iff -> Part.mem_map_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) {o : Part.{u1} α} {b : β}, Iff (Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) b (Part.map.{u1, u2} α β f o)) (Exists.{succ u1} α (fun (a : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a o) (fun (H : Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a o) => Eq.{succ u2} β (f a) b)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) {o : Part.{u2} α} {b : β}, Iff (Membership.mem.{u1, u1} β (Part.{u1} β) (Part.instMembershipPart.{u1} β) b (Part.map.{u2, u1} α β f o)) (Exists.{succ u2} α (fun (a : α) => And (Membership.mem.{u2, u2} α (Part.{u2} α) (Part.instMembershipPart.{u2} α) a o) (Eq.{succ u1} β (f a) b)))
-Case conversion may be inaccurate. Consider using '#align part.mem_map_iff Part.mem_map_iffₓ'. -/
@[simp]
theorem mem_map_iff (f : α → β) {o : Part α} {b} : b ∈ map f o ↔ ∃ a ∈ o, f a = b :=
⟨match b with
@@ -652,22 +628,10 @@ theorem assert_neg {p : Prop} {f : p → Part α} (h : ¬p) : assert p f = none
#align part.assert_neg Part.assert_neg
-/
-/- warning: part.mem_bind -> Part.mem_bind is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {f : Part.{u1} α} {g : α -> (Part.{u2} β)} {a : α} {b : β}, (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a f) -> (Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) b (g a)) -> (Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) b (Part.bind.{u1, u2} α β f g))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {f : Part.{u2} α} {g : α -> (Part.{u1} β)} {a : α} {b : β}, (Membership.mem.{u2, u2} α (Part.{u2} α) (Part.instMembershipPart.{u2} α) a f) -> (Membership.mem.{u1, u1} β (Part.{u1} β) (Part.instMembershipPart.{u1} β) b (g a)) -> (Membership.mem.{u1, u1} β (Part.{u1} β) (Part.instMembershipPart.{u1} β) b (Part.bind.{u2, u1} α β f g))
-Case conversion may be inaccurate. Consider using '#align part.mem_bind Part.mem_bindₓ'. -/
theorem mem_bind {f : Part α} {g : α → Part β} : ∀ {a b}, a ∈ f → b ∈ g a → b ∈ f.bind g
| _, _, ⟨h, rfl⟩, ⟨h₂, rfl⟩ => ⟨⟨h, h₂⟩, rfl⟩
#align part.mem_bind Part.mem_bind
-/- warning: part.mem_bind_iff -> Part.mem_bind_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {f : Part.{u1} α} {g : α -> (Part.{u2} β)} {b : β}, Iff (Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) b (Part.bind.{u1, u2} α β f g)) (Exists.{succ u1} α (fun (a : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a f) (fun (H : Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a f) => Membership.Mem.{u2, u2} β (Part.{u2} β) (Part.hasMem.{u2} β) b (g a))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {f : Part.{u2} α} {g : α -> (Part.{u1} β)} {b : β}, Iff (Membership.mem.{u1, u1} β (Part.{u1} β) (Part.instMembershipPart.{u1} β) b (Part.bind.{u2, u1} α β f g)) (Exists.{succ u2} α (fun (a : α) => And (Membership.mem.{u2, u2} α (Part.{u2} α) (Part.instMembershipPart.{u2} α) a f) (Membership.mem.{u1, u1} β (Part.{u1} β) (Part.instMembershipPart.{u1} β) b (g a))))
-Case conversion may be inaccurate. Consider using '#align part.mem_bind_iff Part.mem_bind_iffₓ'. -/
@[simp]
theorem mem_bind_iff {f : Part α} {g : α → Part β} {b} : b ∈ f.bind g ↔ ∃ a ∈ f, b ∈ g a :=
⟨match b with
@@ -675,12 +639,6 @@ theorem mem_bind_iff {f : Part α} {g : α → Part β} {b} : b ∈ f.bind g ↔
fun ⟨a, h₁, h₂⟩ => mem_bind h₁ h₂⟩
#align part.mem_bind_iff Part.mem_bind_iff
-/- warning: part.dom.bind -> Part.Dom.bind is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {o : Part.{u1} α} (h : Part.Dom.{u1} α o) (f : α -> (Part.{u2} β)), Eq.{succ u2} (Part.{u2} β) (Part.bind.{u1, u2} α β o f) (f (Part.get.{u1} α o h))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {o : Part.{u2} α} (h : Part.Dom.{u2} α o) (f : α -> (Part.{u1} β)), Eq.{succ u1} (Part.{u1} β) (Part.bind.{u2, u1} α β o f) (f (Part.get.{u2} α o h))
-Case conversion may be inaccurate. Consider using '#align part.dom.bind Part.Dom.bindₓ'. -/
protected theorem Dom.bind {o : Part α} (h : o.Dom) (f : α → Part β) : o.bind f = f (o.get h) :=
by
ext b
@@ -710,22 +668,10 @@ theorem bind_some (a : α) (f : α → Part β) : (some a).bind f = f a :=
#align part.bind_some Part.bind_some
-/
-/- warning: part.bind_of_mem -> Part.bind_of_mem is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {o : Part.{u1} α} {a : α}, (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a o) -> (forall (f : α -> (Part.{u2} β)), Eq.{succ u2} (Part.{u2} β) (Part.bind.{u1, u2} α β o f) (f a))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {o : Part.{u2} α} {a : α}, (Membership.mem.{u2, u2} α (Part.{u2} α) (Part.instMembershipPart.{u2} α) a o) -> (forall (f : α -> (Part.{u1} β)), Eq.{succ u1} (Part.{u1} β) (Part.bind.{u2, u1} α β o f) (f a))
-Case conversion may be inaccurate. Consider using '#align part.bind_of_mem Part.bind_of_memₓ'. -/
theorem bind_of_mem {o : Part α} {a : α} (h : a ∈ o) (f : α → Part β) : o.bind f = f a := by
rw [eq_some_iff.2 h, bind_some]
#align part.bind_of_mem Part.bind_of_mem
-/- warning: part.bind_some_eq_map -> Part.bind_some_eq_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> β) (x : Part.{u1} α), Eq.{succ u2} (Part.{u2} β) (Part.bind.{u1, u2} α β x (Function.comp.{succ u1, succ u2, succ u2} α β (Part.{u2} β) (Part.some.{u2} β) f)) (Part.map.{u1, u2} α β f x)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> β) (x : Part.{u2} α), Eq.{succ u1} (Part.{u1} β) (Part.bind.{u2, u1} α β x (Function.comp.{succ u2, succ u1, succ u1} α β (Part.{u1} β) (Part.some.{u1} β) f)) (Part.map.{u2, u1} α β f x)
-Case conversion may be inaccurate. Consider using '#align part.bind_some_eq_map Part.bind_some_eq_mapₓ'. -/
theorem bind_some_eq_map (f : α → β) (x : Part α) : x.bind (some ∘ f) = map f x :=
ext <| by simp [eq_comm]
#align part.bind_some_eq_map Part.bind_some_eq_map
@@ -743,12 +689,6 @@ theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀
#align part.bind_to_option Part.bind_toOption
-/
-/- warning: part.bind_assoc -> Part.bind_assoc is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : Part.{u1} α) (g : α -> (Part.{u2} β)) (k : β -> (Part.{u3} γ)), Eq.{succ u3} (Part.{u3} γ) (Part.bind.{u2, u3} β γ (Part.bind.{u1, u2} α β f g) k) (Part.bind.{u1, u3} α γ f (fun (x : α) => Part.bind.{u2, u3} β γ (g x) k))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} (f : Part.{u2} α) (g : α -> (Part.{u1} β)) (k : β -> (Part.{u3} γ)), Eq.{succ u3} (Part.{u3} γ) (Part.bind.{u1, u3} β γ (Part.bind.{u2, u1} α β f g) k) (Part.bind.{u2, u3} α γ f (fun (x : α) => Part.bind.{u1, u3} β γ (g x) k))
-Case conversion may be inaccurate. Consider using '#align part.bind_assoc Part.bind_assocₓ'. -/
theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ) :
(f.bind g).bind k = f.bind fun x => (g x).bind k :=
ext fun a => by
@@ -758,12 +698,6 @@ theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ)
⟨_, ⟨_, h₁, h₂⟩, h₃⟩⟩
#align part.bind_assoc Part.bind_assoc
-/- warning: part.bind_map -> Part.bind_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β) (x : Part.{u1} α) (g : β -> (Part.{u3} γ)), Eq.{succ u3} (Part.{u3} γ) (Part.bind.{u2, u3} β γ (Part.map.{u1, u2} α β f x) g) (Part.bind.{u1, u3} α γ x (fun (y : α) => g (f y)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} (f : α -> β) (x : Part.{u2} α) (g : β -> (Part.{u3} γ)), Eq.{succ u3} (Part.{u3} γ) (Part.bind.{u1, u3} β γ (Part.map.{u2, u1} α β f x) g) (Part.bind.{u2, u3} α γ x (fun (y : α) => g (f y)))
-Case conversion may be inaccurate. Consider using '#align part.bind_map Part.bind_mapₓ'. -/
@[simp]
theorem bind_map {γ} (f : α → β) (x) (g : β → Part γ) :
(map f x).bind g = x.bind fun y => g (f y) := by rw [← bind_some_eq_map, bind_assoc] <;> simp
@@ -777,12 +711,6 @@ theorem map_bind {γ} (f : α → Part β) (x : Part α) (g : β → γ) :
#align part.map_bind Part.map_bind
-/
-/- warning: part.map_map -> Part.map_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (g : β -> γ) (f : α -> β) (o : Part.{u1} α), Eq.{succ u3} (Part.{u3} γ) (Part.map.{u2, u3} β γ g (Part.map.{u1, u2} α β f o)) (Part.map.{u1, u3} α γ (Function.comp.{succ u1, succ u2, succ u3} α β γ g f) o)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (g : β -> γ) (f : α -> β) (o : Part.{u3} α), Eq.{succ u2} (Part.{u2} γ) (Part.map.{u1, u2} β γ g (Part.map.{u3, u1} α β f o)) (Part.map.{u3, u2} α γ (Function.comp.{succ u3, succ u1, succ u2} α β γ g f) o)
-Case conversion may be inaccurate. Consider using '#align part.map_map Part.map_mapₓ'. -/
theorem map_map (g : β → γ) (f : α → β) (o : Part α) : map g (map f o) = map (g ∘ f) o := by
rw [← bind_some_eq_map, bind_map, bind_some_eq_map]
#align part.map_map Part.map_map
@@ -812,56 +740,26 @@ theorem bind_some_right (x : Part α) : x.bind some = x := by
#align part.bind_some_right Part.bind_some_right
-/
-/- warning: part.pure_eq_some -> Part.pure_eq_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (a : α), Eq.{succ u1} (Part.{u1} α) (Pure.pure.{u1, u1} Part.{u1} (Applicative.toHasPure.{u1, u1} Part.{u1} (Monad.toApplicative.{u1, u1} Part.{u1} Part.monad.{u1})) α a) (Part.some.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} (a : α), Eq.{succ u1} (Part.{u1} α) (Pure.pure.{u1, u1} Part.{u1} (Applicative.toPure.{u1, u1} Part.{u1} (Monad.toApplicative.{u1, u1} Part.{u1} Part.instMonadPart.{u1})) α a) (Part.some.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.pure_eq_some Part.pure_eq_someₓ'. -/
@[simp]
theorem pure_eq_some (a : α) : pure a = some a :=
rfl
#align part.pure_eq_some Part.pure_eq_some
-/- warning: part.ret_eq_some -> Part.ret_eq_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (a : α), Eq.{succ u1} (Part.{u1} α) (return.{u1, u1} Part.{u1} Part.monad.{u1} α a) (Part.some.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} (a : α), Eq.{succ u1} (Part.{u1} α) (Pure.pure.{u1, u1} Part.{u1} (Applicative.toPure.{u1, u1} Part.{u1} (Monad.toApplicative.{u1, u1} Part.{u1} Part.instMonadPart.{u1})) α a) (Part.some.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.ret_eq_some Part.ret_eq_someₓ'. -/
@[simp]
theorem ret_eq_some (a : α) : return a = some a :=
rfl
#align part.ret_eq_some Part.ret_eq_some
-/- warning: part.map_eq_map -> Part.map_eq_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (o : Part.{u1} α), Eq.{succ u1} (Part.{u1} β) (Functor.map.{u1, u1} (fun {α : Type.{u1}} => Part.{u1} α) (Applicative.toFunctor.{u1, u1} (fun {α : Type.{u1}} => Part.{u1} α) (Monad.toApplicative.{u1, u1} (fun {α : Type.{u1}} => Part.{u1} α) Part.monad.{u1})) α β f o) (Part.map.{u1, u1} α β f o)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (o : Part.{u1} α), Eq.{succ u1} (Part.{u1} β) (Functor.map.{u1, u1} Part.{u1} (Applicative.toFunctor.{u1, u1} Part.{u1} (Monad.toApplicative.{u1, u1} Part.{u1} Part.instMonadPart.{u1})) α β f o) (Part.map.{u1, u1} α β f o)
-Case conversion may be inaccurate. Consider using '#align part.map_eq_map Part.map_eq_mapₓ'. -/
@[simp]
theorem map_eq_map {α β} (f : α → β) (o : Part α) : f <$> o = map f o :=
rfl
#align part.map_eq_map Part.map_eq_map
-/- warning: part.bind_eq_bind -> Part.bind_eq_bind is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} (f : Part.{u1} α) (g : α -> (Part.{u1} β)), Eq.{succ u1} (Part.{u1} β) (Bind.bind.{u1, u1} Part.{u1} (Monad.toHasBind.{u1, u1} Part.{u1} Part.monad.{u1}) α β f g) (Part.bind.{u1, u1} α β f g)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : Part.{u1} α) (g : α -> (Part.{u1} β)), Eq.{succ u1} (Part.{u1} β) (Bind.bind.{u1, u1} Part.{u1} (Monad.toBind.{u1, u1} Part.{u1} Part.instMonadPart.{u1}) α β f g) (Part.bind.{u1, u1} α β f g)
-Case conversion may be inaccurate. Consider using '#align part.bind_eq_bind Part.bind_eq_bindₓ'. -/
@[simp]
theorem bind_eq_bind {α β} (f : Part α) (g : α → Part β) : f >>= g = f.bind g :=
rfl
#align part.bind_eq_bind Part.bind_eq_bind
-/- warning: part.bind_le -> Part.bind_le is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u1}} (x : Part.{u1} α) (f : α -> (Part.{u1} β)) (y : Part.{u1} β), Iff (LE.le.{u1} (Part.{u1} β) (Preorder.toHasLe.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.partialOrder.{u1} β))) (Bind.bind.{u1, u1} Part.{u1} (Monad.toHasBind.{u1, u1} Part.{u1} Part.monad.{u1}) α β x f) y) (forall (a : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a x) -> (LE.le.{u1} (Part.{u1} β) (Preorder.toHasLe.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.partialOrder.{u1} β))) (f a) y))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u1}} (x : Part.{u1} α) (f : α -> (Part.{u1} β)) (y : Part.{u1} β), Iff (LE.le.{u1} (Part.{u1} β) (Preorder.toLE.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.instPartialOrderPart.{u1} β))) (Bind.bind.{u1, u1} Part.{u1} (Monad.toBind.{u1, u1} Part.{u1} Part.instMonadPart.{u1}) α β x f) y) (forall (a : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) a x) -> (LE.le.{u1} (Part.{u1} β) (Preorder.toLE.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.instPartialOrderPart.{u1} β))) (f a) y))
-Case conversion may be inaccurate. Consider using '#align part.bind_le Part.bind_leₓ'. -/
theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
x >>= f ≤ y ↔ ∀ a, a ∈ x → f a ≤ y :=
by
@@ -909,23 +807,11 @@ theorem assert_defined {p : Prop} {f : p → Part α} : ∀ h : p, (f h).Dom →
#align part.assert_defined Part.assert_defined
-/
-/- warning: part.bind_defined -> Part.bind_defined is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {f : Part.{u1} α} {g : α -> (Part.{u2} β)} (h : Part.Dom.{u1} α f), (Part.Dom.{u2} β (g (Part.get.{u1} α f h))) -> (Part.Dom.{u2} β (Part.bind.{u1, u2} α β f g))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {f : Part.{u2} α} {g : α -> (Part.{u1} β)} (h : Part.Dom.{u2} α f), (Part.Dom.{u1} β (g (Part.get.{u2} α f h))) -> (Part.Dom.{u1} β (Part.bind.{u2, u1} α β f g))
-Case conversion may be inaccurate. Consider using '#align part.bind_defined Part.bind_definedₓ'. -/
theorem bind_defined {f : Part α} {g : α → Part β} :
∀ h : f.Dom, (g (f.get h)).Dom → (f.bind g).Dom :=
assert_defined
#align part.bind_defined Part.bind_defined
-/- warning: part.bind_dom -> Part.bind_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {f : Part.{u1} α} {g : α -> (Part.{u2} β)}, Iff (Part.Dom.{u2} β (Part.bind.{u1, u2} α β f g)) (Exists.{0} (Part.Dom.{u1} α f) (fun (h : Part.Dom.{u1} α f) => Part.Dom.{u2} β (g (Part.get.{u1} α f h))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {f : Part.{u2} α} {g : α -> (Part.{u1} β)}, Iff (Part.Dom.{u1} β (Part.bind.{u2, u1} α β f g)) (Exists.{0} (Part.Dom.{u2} α f) (fun (h : Part.Dom.{u2} α f) => Part.Dom.{u1} β (g (Part.get.{u2} α f h))))
-Case conversion may be inaccurate. Consider using '#align part.bind_dom Part.bind_domₓ'. -/
@[simp]
theorem bind_dom {f : Part α} {g : α → Part β} : (f.bind g).Dom ↔ ∃ h : f.Dom, (g (f.get h)).Dom :=
Iff.rfl
@@ -956,70 +842,34 @@ instance [Union α] : Union (Part α) where union a b := (· ∪ ·) <$> a <*> b
instance [SDiff α] : SDiff (Part α) where sdiff a b := (· \ ·) <$> a <*> b
-/- warning: part.one_mem_one -> Part.one_mem_one is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : One.{u1} α], Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_1))) (OfNat.ofNat.{u1} (Part.{u1} α) 1 (OfNat.mk.{u1} (Part.{u1} α) 1 (One.one.{u1} (Part.{u1} α) (Part.hasOne.{u1} α _inst_1))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : One.{u1} α], Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_1)) (OfNat.ofNat.{u1} (Part.{u1} α) 1 (One.toOfNat1.{u1} (Part.{u1} α) (Part.instOnePart.{u1} α _inst_1)))
-Case conversion may be inaccurate. Consider using '#align part.one_mem_one Part.one_mem_oneₓ'. -/
@[to_additive]
theorem one_mem_one [One α] : (1 : α) ∈ (1 : Part α) :=
⟨trivial, rfl⟩
#align part.one_mem_one Part.one_mem_one
#align part.zero_mem_zero Part.zero_mem_zero
-/- warning: part.mul_mem_mul -> Part.mul_mem_mul is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_1) ma mb) (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.hasMul.{u1} α _inst_1)) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_1) ma mb) (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.instMulPart.{u1} α _inst_1)) a b))
-Case conversion may be inaccurate. Consider using '#align part.mul_mem_mul Part.mul_mem_mulₓ'. -/
@[to_additive]
theorem mul_mem_mul [Mul α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma * mb ∈ a * b := by tidy
#align part.mul_mem_mul Part.mul_mem_mul
#align part.add_mem_add Part.add_mem_add
-/- warning: part.left_dom_of_mul_dom -> Part.left_dom_of_mul_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.hasMul.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.instMulPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_mul_dom Part.left_dom_of_mul_domₓ'. -/
@[to_additive]
theorem left_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : a.Dom := by tidy
#align part.left_dom_of_mul_dom Part.left_dom_of_mul_dom
#align part.left_dom_of_add_dom Part.left_dom_of_add_dom
-/- warning: part.right_dom_of_mul_dom -> Part.right_dom_of_mul_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.hasMul.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.instMulPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_mul_dom Part.right_dom_of_mul_domₓ'. -/
@[to_additive]
theorem right_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : b.Dom := by tidy
#align part.right_dom_of_mul_dom Part.right_dom_of_mul_dom
#align part.right_dom_of_add_dom Part.right_dom_of_add_dom
-/- warning: part.mul_get_eq -> Part.mul_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.hasMul.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.hasMul.{u1} α _inst_1)) a b) hab) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_mul_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_mul_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.instMulPart.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.instMulPart.{u1} α _inst_1)) a b) hab) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_mul_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_mul_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.mul_get_eq Part.mul_get_eqₓ'. -/
@[simp, to_additive]
theorem mul_get_eq [Mul α] (a b : Part α) (hab : Dom (a * b)) :
(a * b).get hab = a.get (left_dom_of_mul_dom hab) * b.get (right_dom_of_mul_dom hab) := by tidy
#align part.mul_get_eq Part.mul_get_eq
#align part.add_get_eq Part.add_get_eq
-/- warning: part.some_mul_some -> Part.some_mul_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.hasMul.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mul.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HMul.hMul.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMul.{u1} (Part.{u1} α) (Part.instMulPart.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.some_mul_some Part.some_mul_someₓ'. -/
@[to_additive]
theorem some_mul_some [Mul α] (a b : α) : some a * some b = some (a * b) := by tidy
#align part.some_mul_some Part.some_mul_some
@@ -1040,304 +890,124 @@ theorem inv_some [Inv α] (a : α) : (some a)⁻¹ = some a⁻¹ :=
#align part.neg_some Part.neg_some
-/
-/- warning: part.div_mem_div -> Part.div_mem_div is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α _inst_1) ma mb) (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.hasDiv.{u1} α _inst_1)) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α _inst_1) ma mb) (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.instDivPart.{u1} α _inst_1)) a b))
-Case conversion may be inaccurate. Consider using '#align part.div_mem_div Part.div_mem_divₓ'. -/
@[to_additive]
theorem div_mem_div [Div α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma / mb ∈ a / b := by tidy
#align part.div_mem_div Part.div_mem_div
#align part.sub_mem_sub Part.sub_mem_sub
-/- warning: part.left_dom_of_div_dom -> Part.left_dom_of_div_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.hasDiv.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.instDivPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_div_dom Part.left_dom_of_div_domₓ'. -/
@[to_additive]
theorem left_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : a.Dom := by tidy
#align part.left_dom_of_div_dom Part.left_dom_of_div_dom
#align part.left_dom_of_sub_dom Part.left_dom_of_sub_dom
-/- warning: part.right_dom_of_div_dom -> Part.right_dom_of_div_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.hasDiv.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.instDivPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_div_dom Part.right_dom_of_div_domₓ'. -/
@[to_additive]
theorem right_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : b.Dom := by tidy
#align part.right_dom_of_div_dom Part.right_dom_of_div_dom
#align part.right_dom_of_sub_dom Part.right_dom_of_sub_dom
-/- warning: part.div_get_eq -> Part.div_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.hasDiv.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.hasDiv.{u1} α _inst_1)) a b) hab) (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_div_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_div_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.instDivPart.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.instDivPart.{u1} α _inst_1)) a b) hab) (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_div_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_div_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.div_get_eq Part.div_get_eqₓ'. -/
@[simp, to_additive]
theorem div_get_eq [Div α] (a b : Part α) (hab : Dom (a / b)) :
(a / b).get hab = a.get (left_dom_of_div_dom hab) / b.get (right_dom_of_div_dom hab) := by tidy
#align part.div_get_eq Part.div_get_eq
#align part.sub_get_eq Part.sub_get_eq
-/- warning: part.some_div_some -> Part.some_div_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.hasDiv.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Div.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HDiv.hDiv.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHDiv.{u1} (Part.{u1} α) (Part.instDivPart.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.some_div_some Part.some_div_someₓ'. -/
@[to_additive]
theorem some_div_some [Div α] (a b : α) : some a / some b = some (a / b) := by tidy
#align part.some_div_some Part.some_div_some
#align part.some_sub_some Part.some_sub_some
-/- warning: part.mod_mem_mod -> Part.mod_mem_mod is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (HMod.hMod.{u1, u1, u1} α α α (instHMod.{u1} α _inst_1) ma mb) (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.hasMod.{u1} α _inst_1)) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (HMod.hMod.{u1, u1, u1} α α α (instHMod.{u1} α _inst_1) ma mb) (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.instModPart.{u1} α _inst_1)) a b))
-Case conversion may be inaccurate. Consider using '#align part.mod_mem_mod Part.mod_mem_modₓ'. -/
theorem mod_mem_mod [Mod α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma % mb ∈ a % b := by tidy
#align part.mod_mem_mod Part.mod_mem_mod
-/- warning: part.left_dom_of_mod_dom -> Part.left_dom_of_mod_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.hasMod.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.instModPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_mod_dom Part.left_dom_of_mod_domₓ'. -/
theorem left_dom_of_mod_dom [Mod α] {a b : Part α} (hab : Dom (a % b)) : a.Dom := by tidy
#align part.left_dom_of_mod_dom Part.left_dom_of_mod_dom
-/- warning: part.right_dom_of_mod_dom -> Part.right_dom_of_mod_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.hasMod.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.instModPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_mod_dom Part.right_dom_of_mod_domₓ'. -/
theorem right_dom_of_mod_dom [Mod α] {a b : Part α} (hab : Dom (a % b)) : b.Dom := by tidy
#align part.right_dom_of_mod_dom Part.right_dom_of_mod_dom
-/- warning: part.mod_get_eq -> Part.mod_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.hasMod.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.hasMod.{u1} α _inst_1)) a b) hab) (HMod.hMod.{u1, u1, u1} α α α (instHMod.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_mod_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_mod_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.instModPart.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.instModPart.{u1} α _inst_1)) a b) hab) (HMod.hMod.{u1, u1, u1} α α α (instHMod.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_mod_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_mod_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.mod_get_eq Part.mod_get_eqₓ'. -/
@[simp]
theorem mod_get_eq [Mod α] (a b : Part α) (hab : Dom (a % b)) :
(a % b).get hab = a.get (left_dom_of_mod_dom hab) % b.get (right_dom_of_mod_dom hab) := by tidy
#align part.mod_get_eq Part.mod_get_eq
-/- warning: part.some_mod_some -> Part.some_mod_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.hasMod.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HMod.hMod.{u1, u1, u1} α α α (instHMod.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Mod.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HMod.hMod.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHMod.{u1} (Part.{u1} α) (Part.instModPart.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HMod.hMod.{u1, u1, u1} α α α (instHMod.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.some_mod_some Part.some_mod_someₓ'. -/
theorem some_mod_some [Mod α] (a b : α) : some a % some b = some (a % b) := by tidy
#align part.some_mod_some Part.some_mod_some
-/- warning: part.append_mem_append -> Part.append_mem_append is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (Append.append.{u1} α _inst_1 ma mb) (Append.append.{u1} (Part.{u1} α) (Part.hasAppend.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (HAppend.hAppend.{u1, u1, u1} α α α (instHAppend.{u1} α _inst_1) ma mb) (HAppend.hAppend.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHAppend.{u1} (Part.{u1} α) (Part.instAppendPart.{u1} α _inst_1)) a b))
-Case conversion may be inaccurate. Consider using '#align part.append_mem_append Part.append_mem_appendₓ'. -/
theorem append_mem_append [Append α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma ++ mb ∈ a ++ b := by tidy
#align part.append_mem_append Part.append_mem_append
-/- warning: part.left_dom_of_append_dom -> Part.left_dom_of_append_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Append.append.{u1} (Part.{u1} α) (Part.hasAppend.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HAppend.hAppend.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHAppend.{u1} (Part.{u1} α) (Part.instAppendPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_append_dom Part.left_dom_of_append_domₓ'. -/
theorem left_dom_of_append_dom [Append α] {a b : Part α} (hab : Dom (a ++ b)) : a.Dom := by tidy
#align part.left_dom_of_append_dom Part.left_dom_of_append_dom
-/- warning: part.right_dom_of_append_dom -> Part.right_dom_of_append_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Append.append.{u1} (Part.{u1} α) (Part.hasAppend.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (HAppend.hAppend.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHAppend.{u1} (Part.{u1} α) (Part.instAppendPart.{u1} α _inst_1)) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_append_dom Part.right_dom_of_append_domₓ'. -/
theorem right_dom_of_append_dom [Append α] {a b : Part α} (hab : Dom (a ++ b)) : b.Dom := by tidy
#align part.right_dom_of_append_dom Part.right_dom_of_append_dom
-/- warning: part.append_get_eq -> Part.append_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (Append.append.{u1} (Part.{u1} α) (Part.hasAppend.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (Append.append.{u1} (Part.{u1} α) (Part.hasAppend.{u1} α _inst_1) a b) hab) (Append.append.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_append_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_append_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (HAppend.hAppend.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHAppend.{u1} (Part.{u1} α) (Part.instAppendPart.{u1} α _inst_1)) a b)), Eq.{succ u1} α (Part.get.{u1} α (HAppend.hAppend.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHAppend.{u1} (Part.{u1} α) (Part.instAppendPart.{u1} α _inst_1)) a b) hab) (HAppend.hAppend.{u1, u1, u1} α α α (instHAppend.{u1} α _inst_1) (Part.get.{u1} α a (Part.left_dom_of_append_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_append_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.append_get_eq Part.append_get_eqₓ'. -/
@[simp]
theorem append_get_eq [Append α] (a b : Part α) (hab : Dom (a ++ b)) :
(a ++ b).get hab = a.get (left_dom_of_append_dom hab) ++ b.get (right_dom_of_append_dom hab) :=
by tidy
#align part.append_get_eq Part.append_get_eq
-/- warning: part.some_append_some -> Part.some_append_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (Append.append.{u1} (Part.{u1} α) (Part.hasAppend.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (Append.append.{u1} α _inst_1 a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Append.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (HAppend.hAppend.{u1, u1, u1} (Part.{u1} α) (Part.{u1} α) (Part.{u1} α) (instHAppend.{u1} (Part.{u1} α) (Part.instAppendPart.{u1} α _inst_1)) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (HAppend.hAppend.{u1, u1, u1} α α α (instHAppend.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.some_append_some Part.some_append_someₓ'. -/
theorem some_append_some [Append α] (a b : α) : some a ++ some b = some (a ++ b) := by tidy
#align part.some_append_some Part.some_append_some
-/- warning: part.inter_mem_inter -> Part.inter_mem_inter is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (Inter.inter.{u1} α _inst_1 ma mb) (Inter.inter.{u1} (Part.{u1} α) (Part.hasInter.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (Inter.inter.{u1} α _inst_1 ma mb) (Inter.inter.{u1} (Part.{u1} α) (Part.instInterPart.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.inter_mem_inter Part.inter_mem_interₓ'. -/
theorem inter_mem_inter [Inter α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma ∩ mb ∈ a ∩ b := by tidy
#align part.inter_mem_inter Part.inter_mem_inter
-/- warning: part.left_dom_of_inter_dom -> Part.left_dom_of_inter_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.hasInter.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.instInterPart.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_inter_dom Part.left_dom_of_inter_domₓ'. -/
theorem left_dom_of_inter_dom [Inter α] {a b : Part α} (hab : Dom (a ∩ b)) : a.Dom := by tidy
#align part.left_dom_of_inter_dom Part.left_dom_of_inter_dom
-/- warning: part.right_dom_of_inter_dom -> Part.right_dom_of_inter_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.hasInter.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.instInterPart.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_inter_dom Part.right_dom_of_inter_domₓ'. -/
theorem right_dom_of_inter_dom [Inter α] {a b : Part α} (hab : Dom (a ∩ b)) : b.Dom := by tidy
#align part.right_dom_of_inter_dom Part.right_dom_of_inter_dom
-/- warning: part.inter_get_eq -> Part.inter_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.hasInter.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.hasInter.{u1} α _inst_1) a b) hab) (Inter.inter.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_inter_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_inter_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.instInterPart.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (Inter.inter.{u1} (Part.{u1} α) (Part.instInterPart.{u1} α _inst_1) a b) hab) (Inter.inter.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_inter_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_inter_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.inter_get_eq Part.inter_get_eqₓ'. -/
@[simp]
theorem inter_get_eq [Inter α] (a b : Part α) (hab : Dom (a ∩ b)) :
(a ∩ b).get hab = a.get (left_dom_of_inter_dom hab) ∩ b.get (right_dom_of_inter_dom hab) := by
tidy
#align part.inter_get_eq Part.inter_get_eq
-/- warning: part.some_inter_some -> Part.some_inter_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (Inter.inter.{u1} (Part.{u1} α) (Part.hasInter.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (Inter.inter.{u1} α _inst_1 a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Inter.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (Inter.inter.{u1} (Part.{u1} α) (Part.instInterPart.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (Inter.inter.{u1} α _inst_1 a b))
-Case conversion may be inaccurate. Consider using '#align part.some_inter_some Part.some_inter_someₓ'. -/
theorem some_inter_some [Inter α] (a b : α) : some a ∩ some b = some (a ∩ b) := by tidy
#align part.some_inter_some Part.some_inter_some
-/- warning: part.union_mem_union -> Part.union_mem_union is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (Union.union.{u1} α _inst_1 ma mb) (Union.union.{u1} (Part.{u1} α) (Part.hasUnion.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (Union.union.{u1} α _inst_1 ma mb) (Union.union.{u1} (Part.{u1} α) (Part.instUnionPart.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.union_mem_union Part.union_mem_unionₓ'. -/
theorem union_mem_union [Union α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma ∪ mb ∈ a ∪ b := by tidy
#align part.union_mem_union Part.union_mem_union
-/- warning: part.left_dom_of_union_dom -> Part.left_dom_of_union_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.hasUnion.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.instUnionPart.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_union_dom Part.left_dom_of_union_domₓ'. -/
theorem left_dom_of_union_dom [Union α] {a b : Part α} (hab : Dom (a ∪ b)) : a.Dom := by tidy
#align part.left_dom_of_union_dom Part.left_dom_of_union_dom
-/- warning: part.right_dom_of_union_dom -> Part.right_dom_of_union_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.hasUnion.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.instUnionPart.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_union_dom Part.right_dom_of_union_domₓ'. -/
theorem right_dom_of_union_dom [Union α] {a b : Part α} (hab : Dom (a ∪ b)) : b.Dom := by tidy
#align part.right_dom_of_union_dom Part.right_dom_of_union_dom
-/- warning: part.union_get_eq -> Part.union_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.hasUnion.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.hasUnion.{u1} α _inst_1) a b) hab) (Union.union.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_union_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_union_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.instUnionPart.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (Union.union.{u1} (Part.{u1} α) (Part.instUnionPart.{u1} α _inst_1) a b) hab) (Union.union.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_union_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_union_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.union_get_eq Part.union_get_eqₓ'. -/
@[simp]
theorem union_get_eq [Union α] (a b : Part α) (hab : Dom (a ∪ b)) :
(a ∪ b).get hab = a.get (left_dom_of_union_dom hab) ∪ b.get (right_dom_of_union_dom hab) := by
tidy
#align part.union_get_eq Part.union_get_eq
-/- warning: part.some_union_some -> Part.some_union_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (Union.union.{u1} (Part.{u1} α) (Part.hasUnion.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (Union.union.{u1} α _inst_1 a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Union.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (Union.union.{u1} (Part.{u1} α) (Part.instUnionPart.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (Union.union.{u1} α _inst_1 a b))
-Case conversion may be inaccurate. Consider using '#align part.some_union_some Part.some_union_someₓ'. -/
theorem some_union_some [Union α] (a b : α) : some a ∪ some b = some (a ∪ b) := by tidy
#align part.some_union_some Part.some_union_some
-/- warning: part.sdiff_mem_sdiff -> Part.sdiff_mem_sdiff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) ma a) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) mb b) -> (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) (SDiff.sdiff.{u1} α _inst_1 ma mb) (SDiff.sdiff.{u1} (Part.{u1} α) (Part.hasSdiff.{u1} α _inst_1) a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (ma : α) (mb : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) ma a) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) mb b) -> (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) (SDiff.sdiff.{u1} α _inst_1 ma mb) (SDiff.sdiff.{u1} (Part.{u1} α) (Part.instSDiffPart.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align part.sdiff_mem_sdiff Part.sdiff_mem_sdiffₓ'. -/
theorem sdiff_mem_sdiff [SDiff α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma \ mb ∈ a \ b := by tidy
#align part.sdiff_mem_sdiff Part.sdiff_mem_sdiff
-/- warning: part.left_dom_of_sdiff_dom -> Part.left_dom_of_sdiff_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.hasSdiff.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.instSDiffPart.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α a)
-Case conversion may be inaccurate. Consider using '#align part.left_dom_of_sdiff_dom Part.left_dom_of_sdiff_domₓ'. -/
theorem left_dom_of_sdiff_dom [SDiff α] {a b : Part α} (hab : Dom (a \ b)) : a.Dom := by tidy
#align part.left_dom_of_sdiff_dom Part.left_dom_of_sdiff_dom
-/- warning: part.right_dom_of_sdiff_dom -> Part.right_dom_of_sdiff_dom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.hasSdiff.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] {a : Part.{u1} α} {b : Part.{u1} α}, (Part.Dom.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.instSDiffPart.{u1} α _inst_1) a b)) -> (Part.Dom.{u1} α b)
-Case conversion may be inaccurate. Consider using '#align part.right_dom_of_sdiff_dom Part.right_dom_of_sdiff_domₓ'. -/
theorem right_dom_of_sdiff_dom [SDiff α] {a b : Part α} (hab : Dom (a \ b)) : b.Dom := by tidy
#align part.right_dom_of_sdiff_dom Part.right_dom_of_sdiff_dom
-/- warning: part.sdiff_get_eq -> Part.sdiff_get_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.hasSdiff.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.hasSdiff.{u1} α _inst_1) a b) hab) (SDiff.sdiff.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_sdiff_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_sdiff_dom.{u1} α _inst_1 a b hab)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] (a : Part.{u1} α) (b : Part.{u1} α) (hab : Part.Dom.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.instSDiffPart.{u1} α _inst_1) a b)), Eq.{succ u1} α (Part.get.{u1} α (SDiff.sdiff.{u1} (Part.{u1} α) (Part.instSDiffPart.{u1} α _inst_1) a b) hab) (SDiff.sdiff.{u1} α _inst_1 (Part.get.{u1} α a (Part.left_dom_of_sdiff_dom.{u1} α _inst_1 a b hab)) (Part.get.{u1} α b (Part.right_dom_of_sdiff_dom.{u1} α _inst_1 a b hab)))
-Case conversion may be inaccurate. Consider using '#align part.sdiff_get_eq Part.sdiff_get_eqₓ'. -/
@[simp]
theorem sdiff_get_eq [SDiff α] (a b : Part α) (hab : Dom (a \ b)) :
(a \ b).get hab = a.get (left_dom_of_sdiff_dom hab) \ b.get (right_dom_of_sdiff_dom hab) := by
tidy
#align part.sdiff_get_eq Part.sdiff_get_eq
-/- warning: part.some_sdiff_some -> Part.some_sdiff_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (SDiff.sdiff.{u1} (Part.{u1} α) (Part.hasSdiff.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (SDiff.sdiff.{u1} α _inst_1 a b))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : SDiff.{u1} α] (a : α) (b : α), Eq.{succ u1} (Part.{u1} α) (SDiff.sdiff.{u1} (Part.{u1} α) (Part.instSDiffPart.{u1} α _inst_1) (Part.some.{u1} α a) (Part.some.{u1} α b)) (Part.some.{u1} α (SDiff.sdiff.{u1} α _inst_1 a b))
-Case conversion may be inaccurate. Consider using '#align part.some_sdiff_some Part.some_sdiff_someₓ'. -/
theorem some_sdiff_some [SDiff α] (a b : α) : some a \ some b = some (a \ b) := by tidy
#align part.some_sdiff_some Part.some_sdiff_some
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -260,12 +260,7 @@ theorem not_none_dom : ¬(none : Part α).Dom :=
#print Part.some_ne_none /-
@[simp]
-theorem some_ne_none (x : α) : some x ≠ none :=
- by
- intro h
- change none.dom
- rw [← h]
- trivial
+theorem some_ne_none (x : α) : some x ≠ none := by intro h; change none.dom; rw [← h]; trivial
#align part.some_ne_none Part.some_ne_none
-/
@@ -280,10 +275,8 @@ theorem none_ne_some (x : α) : none ≠ some x :=
theorem ne_none_iff {o : Part α} : o ≠ none ↔ ∃ x, o = some x :=
by
constructor
- · rw [Ne, eq_none_iff', Classical.not_not]
- exact fun h => ⟨o.get h, eq_some_iff.2 (get_mem h)⟩
- · rintro ⟨x, rfl⟩
- apply some_ne_none
+ · rw [Ne, eq_none_iff', Classical.not_not]; exact fun h => ⟨o.get h, eq_some_iff.2 (get_mem h)⟩
+ · rintro ⟨x, rfl⟩; apply some_ne_none
#align part.ne_none_iff Part.ne_none_iff
-/
@@ -321,9 +314,7 @@ theorem get_eq_iff_eq_some {a : Part α} {ha : a.Dom} {b : α} : a.get ha = b
#print Part.get_eq_get_of_eq /-
theorem get_eq_get_of_eq (a : Part α) (ha : a.Dom) {b : Part α} (h : a = b) :
- a.get ha = b.get (h ▸ ha) := by
- congr
- exact h
+ a.get ha = b.get (h ▸ ha) := by congr ; exact h
#align part.get_eq_get_of_eq Part.get_eq_get_of_eq
-/
@@ -543,9 +534,7 @@ instance : PartialOrder (Part α)
instance : OrderBot (Part α) where
bot := none
- bot_le := by
- introv x
- rintro ⟨⟨_⟩, _⟩
+ bot_le := by introv x; rintro ⟨⟨_⟩, _⟩
/- warning: part.le_total_of_le_of_le -> Part.le_total_of_le_of_le is a dubious translation:
lean 3 declaration is
@@ -556,9 +545,7 @@ Case conversion may be inaccurate. Consider using '#align part.le_total_of_le_of
theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy : y ≤ z) :
x ≤ y ∨ y ≤ x := by
rcases Part.eq_none_or_eq_some x with (h | ⟨b, h₀⟩)
- · rw [h]
- left
- apply OrderBot.bot_le _
+ · rw [h]; left; apply OrderBot.bot_le _
right; intro b' h₁
rw [Part.eq_some_iff] at h₀
replace hx := hx _ h₀; replace hy := hy _ h₁
@@ -879,14 +866,12 @@ theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
x >>= f ≤ y ↔ ∀ a, a ∈ x → f a ≤ y :=
by
constructor <;> intro h
- · intro a h' b
- replace h := h b
+ · intro a h' b; replace h := h b
simp only [and_imp, exists_prop, bind_eq_bind, mem_bind_iff, exists_imp] at h
apply h _ h'
· intro b h'
simp only [exists_prop, bind_eq_bind, mem_bind_iff] at h'
- rcases h' with ⟨a, h₀, h₁⟩
- apply h _ h₀ _ h₁
+ rcases h' with ⟨a, h₀, h₁⟩; apply h _ h₀ _ h₁
#align part.bind_le Part.bind_le
instance : MonadFail Part :=
@@ -906,8 +891,7 @@ theorem mem_restrict (p : Prop) (o : Part α) (h : p → o.Dom) (a : α) :
a ∈ restrict p o h ↔ p ∧ a ∈ o :=
by
dsimp [restrict, mem_eq]; constructor
- · rintro ⟨h₀, h₁⟩
- exact ⟨h₀, ⟨_, h₁⟩⟩
+ · rintro ⟨h₀, h₁⟩; exact ⟨h₀, ⟨_, h₁⟩⟩
rintro ⟨h₀, h₁, h₂⟩; exact ⟨h₀, h₂⟩
#align part.mem_restrict Part.mem_restrict
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/8d33f09cd7089ecf074b4791907588245aec5d1b
@@ -467,7 +467,7 @@ theorem ofOption_dom {α} : ∀ o : Option α, (ofOption o).Dom ↔ o.isSome
#print Part.ofOption_eq_get /-
theorem ofOption_eq_get {α} (o : Option α) : ofOption o = ⟨_, @Option.get _ o⟩ :=
- Part.ext' (ofOption_dom o) fun h₁ h₂ => by cases o <;> [cases h₁, rfl]
+ Part.ext' (ofOption_dom o) fun h₁ h₂ => by cases o <;> [cases h₁;rfl]
#align part.of_option_eq_get Part.ofOption_eq_get
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -549,7 +549,7 @@ instance : OrderBot (Part α) where
/- warning: part.le_total_of_le_of_le -> Part.le_total_of_le_of_le is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {x : Part.{u1} α} {y : Part.{u1} α} (z : Part.{u1} α), (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) x z) -> (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) y z) -> (Or (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) x y) (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) y x))
+ forall {α : Type.{u1}} {x : Part.{u1} α} {y : Part.{u1} α} (z : Part.{u1} α), (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) x z) -> (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) y z) -> (Or (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) x y) (LE.le.{u1} (Part.{u1} α) (Preorder.toHasLe.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.partialOrder.{u1} α))) y x))
but is expected to have type
forall {α : Type.{u1}} {x : Part.{u1} α} {y : Part.{u1} α} (z : Part.{u1} α), (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) x z) -> (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) y z) -> (Or (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) x y) (LE.le.{u1} (Part.{u1} α) (Preorder.toLE.{u1} (Part.{u1} α) (PartialOrder.toPreorder.{u1} (Part.{u1} α) (Part.instPartialOrderPart.{u1} α))) y x))
Case conversion may be inaccurate. Consider using '#align part.le_total_of_le_of_le Part.le_total_of_le_of_leₓ'. -/
@@ -871,7 +871,7 @@ theorem bind_eq_bind {α β} (f : Part α) (g : α → Part β) : f >>= g = f.bi
/- warning: part.bind_le -> Part.bind_le is a dubious translation:
lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u1}} (x : Part.{u1} α) (f : α -> (Part.{u1} β)) (y : Part.{u1} β), Iff (LE.le.{u1} (Part.{u1} β) (Preorder.toLE.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.partialOrder.{u1} β))) (Bind.bind.{u1, u1} Part.{u1} (Monad.toHasBind.{u1, u1} Part.{u1} Part.monad.{u1}) α β x f) y) (forall (a : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a x) -> (LE.le.{u1} (Part.{u1} β) (Preorder.toLE.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.partialOrder.{u1} β))) (f a) y))
+ forall {β : Type.{u1}} {α : Type.{u1}} (x : Part.{u1} α) (f : α -> (Part.{u1} β)) (y : Part.{u1} β), Iff (LE.le.{u1} (Part.{u1} β) (Preorder.toHasLe.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.partialOrder.{u1} β))) (Bind.bind.{u1, u1} Part.{u1} (Monad.toHasBind.{u1, u1} Part.{u1} Part.monad.{u1}) α β x f) y) (forall (a : α), (Membership.Mem.{u1, u1} α (Part.{u1} α) (Part.hasMem.{u1} α) a x) -> (LE.le.{u1} (Part.{u1} β) (Preorder.toHasLe.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.partialOrder.{u1} β))) (f a) y))
but is expected to have type
forall {β : Type.{u1}} {α : Type.{u1}} (x : Part.{u1} α) (f : α -> (Part.{u1} β)) (y : Part.{u1} β), Iff (LE.le.{u1} (Part.{u1} β) (Preorder.toLE.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.instPartialOrderPart.{u1} β))) (Bind.bind.{u1, u1} Part.{u1} (Monad.toBind.{u1, u1} Part.{u1} Part.instMonadPart.{u1}) α β x f) y) (forall (a : α), (Membership.mem.{u1, u1} α (Part.{u1} α) (Part.instMembershipPart.{u1} α) a x) -> (LE.le.{u1} (Part.{u1} β) (Preorder.toLE.{u1} (Part.{u1} β) (PartialOrder.toPreorder.{u1} (Part.{u1} β) (Part.instPartialOrderPart.{u1} β))) (f a) y))
Case conversion may be inaccurate. Consider using '#align part.bind_le Part.bind_leₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/8b8ba04e2f326f3f7cf24ad129beda58531ada61
@@ -355,13 +355,13 @@ theorem some_toOption (a : α) [Decidable (some a).Dom] : (some a).toOption = Op
#print Part.noneDecidable /-
instance noneDecidable : Decidable (@none α).Dom :=
- Decidable.false
+ decidableFalse
#align part.none_decidable Part.noneDecidable
-/
#print Part.someDecidable /-
instance someDecidable (a : α) : Decidable (some a).Dom :=
- Decidable.true
+ decidableTrue
#align part.some_decidable Part.someDecidable
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Subsingleton,Nontrivial
off of Data.Set.Basic
(#11832)
Moves definition of and lemmas related to Set.Subsingleton
and Set.Nontrivial
to a new file, so that Basic
can be shorter.
@@ -3,7 +3,7 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
-/
-import Mathlib.Data.Set.Basic
+import Mathlib.Data.Set.Subsingleton
import Mathlib.Logic.Equiv.Defs
import Mathlib.Algebra.Group.Defs
@@ -294,7 +294,7 @@ theorem mem_toOption {o : Part α} [Decidable o.Dom] {a : α} : a ∈ toOption o
· exact mt Exists.fst h
#align part.mem_to_option Part.mem_toOption
--- Porting note: New theorem, like `mem_toOption` but with LHS in `simp` normal form
+-- Porting note (#10756): new theorem, like `mem_toOption` but with LHS in `simp` normal form
@[simp]
theorem toOption_eq_some_iff {o : Part α} [Decidable o.Dom] {a : α} :
toOption o = Option.some a ↔ a ∈ o :=
@@ -695,7 +695,7 @@ instance [Union α] : Union (Part α) where union a b := (· ∪ ·) <$> a <*> b
instance [SDiff α] : SDiff (Part α) where sdiff a b := (· \ ·) <$> a <*> b
section
--- Porting note: new theorems to unfold definitions
+-- Porting note (#10756): new theorems to unfold definitions
theorem mul_def [Mul α] (a b : Part α) : a * b = bind a fun y ↦ map (y * ·) b := rfl
theorem one_def [One α] : (1 : Part α) = some 1 := rfl
theorem inv_def [Inv α] (a : Part α) : a⁻¹ = Part.map (· ⁻¹) a := rfl
@@ -716,7 +716,7 @@ theorem one_mem_one [One α] : (1 : α) ∈ (1 : Part α) :=
@[to_additive]
theorem mul_mem_mul [Mul α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
- ma * mb ∈ a * b := ⟨⟨ha.1, hb.1⟩, by simp [← ha.2, ← hb.2]; rfl⟩
+ ma * mb ∈ a * b := ⟨⟨ha.1, hb.1⟩, by simp only [← ha.2, ← hb.2]; rfl⟩
#align part.mul_mem_mul Part.mul_mem_mul
#align part.add_mem_add Part.add_mem_add
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -286,7 +286,7 @@ theorem getOrElse_some (a : α) (d : α) [Decidable (some a).Dom] : getOrElse (s
(some a).getOrElse_of_dom (some_dom a) d
#align part.get_or_else_some Part.getOrElse_some
---Porting note: removed `simp`
+-- Porting note: removed `simp`
theorem mem_toOption {o : Part α} [Decidable o.Dom] {a : α} : a ∈ toOption o ↔ a ∈ o := by
unfold toOption
by_cases h : o.Dom <;> simp [h]
@@ -294,7 +294,7 @@ theorem mem_toOption {o : Part α} [Decidable o.Dom] {a : α} : a ∈ toOption o
· exact mt Exists.fst h
#align part.mem_to_option Part.mem_toOption
---Porting note: New theorem, like `mem_toOption` but with LHS in `simp` normal form
+-- Porting note: New theorem, like `mem_toOption` but with LHS in `simp` normal form
@[simp]
theorem toOption_eq_some_iff {o : Part α} [Decidable o.Dom] {a : α} :
toOption o = Option.some a ↔ a ∈ o :=
@@ -626,7 +626,7 @@ theorem bind_le {α} (x : Part α) (f : α → Part β) (y : Part β) :
apply h _ h₀ _ h₁
#align part.bind_le Part.bind_le
---Porting note: No MonadFail in Lean4 yet
+-- Porting note: No MonadFail in Lean4 yet
-- instance : MonadFail Part :=
-- { Part.monad with fail := fun _ _ => none }
In this pull request, I have systematically eliminated the leading whitespace preceding the colon (:
) within all unlabelled or unclassified porting notes. This adjustment facilitates a more efficient review process for the remaining notes by ensuring no entries are overlooked due to formatting inconsistencies.
@@ -294,7 +294,7 @@ theorem mem_toOption {o : Part α} [Decidable o.Dom] {a : α} : a ∈ toOption o
· exact mt Exists.fst h
#align part.mem_to_option Part.mem_toOption
---Porting note : New theorem, like `mem_toOption` but with LHS in `simp` normal form
+--Porting note: New theorem, like `mem_toOption` but with LHS in `simp` normal form
@[simp]
theorem toOption_eq_some_iff {o : Part α} [Decidable o.Dom] {a : α} :
toOption o = Option.some a ↔ a ∈ o :=
@@ -695,7 +695,7 @@ instance [Union α] : Union (Part α) where union a b := (· ∪ ·) <$> a <*> b
instance [SDiff α] : SDiff (Part α) where sdiff a b := (· \ ·) <$> a <*> b
section
--- Porting note : new theorems to unfold definitions
+-- Porting note: new theorems to unfold definitions
theorem mul_def [Mul α] (a b : Part α) : a * b = bind a fun y ↦ map (y * ·) b := rfl
theorem one_def [One α] : (1 : Part α) = some 1 := rfl
theorem inv_def [Inv α] (a : Part α) : a⁻¹ = Part.map (· ⁻¹) a := rfl
Mathlib.Tactic.*
(#9816)
import Mathlib.Tactic.Basic
in Mathlib.Init.Logic
and Mathlib.Logic.Basic
.import
s.@@ -400,9 +400,7 @@ instance : PartialOrder (Part
instance : OrderBot (Part α) where
bot := none
- bot_le := by
- introv x
- rintro ⟨⟨_⟩, _⟩
+ bot_le := by rintro x _ ⟨⟨_⟩, _⟩
theorem le_total_of_le_of_le {x y : Part α} (z : Part α) (hx : x ≤ z) (hy : y ≤ z) :
x ≤ y ∨ y ≤ x := by
@@ -74,7 +74,7 @@ def toOption (o : Part α) [Decidable o.Dom] : Option α :=
#align part.to_option_is_none Part.toOption_isNone
/-- `Part` extensionality -/
-theorem ext' : ∀ {o p : Part α} (_ : o.Dom ↔ p.Dom) (_ : ∀ h₁ h₂, o.get h₁ = p.get h₂), o = p
+theorem ext' : ∀ {o p : Part α}, (o.Dom ↔ p.Dom) → (∀ h₁ h₂, o.get h₁ = p.get h₂) → o = p
| ⟨od, o⟩, ⟨pd, p⟩, H1, H2 => by
have t : od = pd := propext H1
cases t; rw [show o = p from funext fun p => H2 p p]
Removes nonterminal simps on lines looking like simp [...]
@@ -472,7 +472,7 @@ theorem mem_assert_iff {p : Prop} {f : p → Part α} {a} : a ∈ assert p f ↔
theorem assert_pos {p : Prop} {f : p → Part α} (h : p) : assert p f = f h := by
dsimp [assert]
cases h' : f h
- simp [h', mk.injEq, h, exists_prop_of_true, true_and]
+ simp only [h', mk.injEq, h, exists_prop_of_true, true_and]
apply Function.hfunext
· simp only [h, h', exists_prop_of_true]
· aesop
@@ -387,7 +387,7 @@ theorem of_toOption (o : Part α) [Decidable o.Dom] : ofOption (toOption o) = o
noncomputable def equivOption : Part α ≃ Option α :=
haveI := Classical.dec
⟨fun o => toOption o, ofOption, fun o => of_toOption o, fun o =>
- Eq.trans (by dsimp; congr ) (to_ofOption o)⟩
+ Eq.trans (by dsimp; congr) (to_ofOption o)⟩
#align part.equiv_option Part.equivOption
/-- We give `Part α` the order where everything is greater than `none`. -/
@@ -540,7 +540,7 @@ theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀
theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ) :
(f.bind g).bind k = f.bind fun x => (g x).bind k :=
ext fun a => by
- simp
+ simp only [mem_bind_iff]
exact ⟨fun ⟨_, ⟨_, h₁, h₂⟩, h₃⟩ => ⟨_, h₁, _, h₂, h₃⟩,
fun ⟨_, h₁, _, h₂, h₃⟩ => ⟨_, ⟨_, h₁, h₂⟩, h₃⟩⟩
#align part.bind_assoc Part.bind_assoc
@@ -5,6 +5,7 @@ Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
-/
import Mathlib.Data.Set.Basic
import Mathlib.Logic.Equiv.Defs
+import Mathlib.Algebra.Group.Defs
#align_import data.part from "leanprover-community/mathlib"@"80c43012d26f63026d362c3aba28f3c3bafb07e6"
@@ -667,7 +668,12 @@ theorem bind_dom {f : Part α} {g : α → Part β} : (f.bind g).Dom ↔ ∃ h :
section Instances
--- We define several instances for constants and operations on `Part α` inherited from `α`.
+/-!
+We define several instances for constants and operations on `Part α` inherited from `α`.
+
+This section could be moved to a separate file to avoid the import of `Mathlib.Algebra.Group.Defs`.
+-/
+
@[to_additive]
instance [One α] : One (Part α) where one := pure 1
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -57,7 +57,7 @@ structure Part.{u} (α : Type u) : Type u where
namespace Part
-variable {α : Type _} {β : Type _} {γ : Type _}
+variable {α : Type*} {β : Type*} {γ : Type*}
/-- Convert a `Part α` with a decidable domain to an option -/
def toOption (o : Part α) [Decidable o.Dom] : Option α :=
@@ -309,7 +309,7 @@ theorem toOption_eq_none_iff {a : Part α} [Decidable a.Dom] : a.toOption = Opti
/- Porting TODO: Removed `simp`. Maybe add `@[simp]` later if `@[simp]` is taken off definition of
`Option.elim` -/
-theorem elim_toOption {α β : Type _} (a : Part α) [Decidable a.Dom] (b : β) (f : α → β) :
+theorem elim_toOption {α β : Type*} (a : Part α) [Decidable a.Dom] (b : β) (f : α → β) :
a.toOption.elim b f = if h : a.Dom then f (a.get h) else b := by
split_ifs with h
· rw [h.toOption]
@@ -573,16 +573,16 @@ instance : LawfulMonad
map_const := by simp [Functor.mapConst, Functor.map]
--Porting TODO : In Lean3 these were automatic by a tactic
seqLeft_eq x y := ext'
- (by simp [SeqLeft.seqLeft, Part.bind, assert, Seq.seq, const, (. <$> .), and_comm])
+ (by simp [SeqLeft.seqLeft, Part.bind, assert, Seq.seq, const, (· <$> ·), and_comm])
(fun _ _ => rfl)
seqRight_eq x y := ext'
- (by simp [SeqRight.seqRight, Part.bind, assert, Seq.seq, const, (. <$> .), and_comm])
+ (by simp [SeqRight.seqRight, Part.bind, assert, Seq.seq, const, (· <$> ·), and_comm])
(fun _ _ => rfl)
pure_seq x y := ext'
- (by simp [Seq.seq, Part.bind, assert, (. <$> .), pure])
+ (by simp [Seq.seq, Part.bind, assert, (· <$> ·), pure])
(fun _ _ => rfl)
bind_map x y := ext'
- (by simp [(. >>= .), Part.bind, assert, Seq.seq, get, (. <$> .)] )
+ (by simp [(· >>= ·), Part.bind, assert, Seq.seq, get, (· <$> ·)] )
(fun _ _ => rfl)
theorem map_id' {f : α → α} (H : ∀ x : α, f x = x) (o) : map f o = o := by
@@ -692,15 +692,15 @@ instance [SDiff α] : SDiff (Part α) where sdiff a b := (· \ ·) <$> a <*> b
section
-- Porting note : new theorems to unfold definitions
-theorem mul_def [Mul α] (a b : Part α) : a * b = bind a fun y ↦ map (y * .) b := rfl
+theorem mul_def [Mul α] (a b : Part α) : a * b = bind a fun y ↦ map (y * ·) b := rfl
theorem one_def [One α] : (1 : Part α) = some 1 := rfl
-theorem inv_def [Inv α] (a : Part α) : a⁻¹ = Part.map (. ⁻¹) a := rfl
-theorem div_def [Div α] (a b : Part α) : a / b = bind a fun y => map (y / .) b := rfl
-theorem mod_def [Mod α] (a b : Part α) : a % b = bind a fun y => map (y % .) b := rfl
-theorem append_def [Append α] (a b : Part α) : a ++ b = bind a fun y => map (y ++ .) b := rfl
-theorem inter_def [Inter α] (a b : Part α) : a ∩ b = bind a fun y => map (y ∩ .) b := rfl
-theorem union_def [Union α] (a b : Part α) : a ∪ b = bind a fun y => map (y ∪ .) b := rfl
-theorem sdiff_def [SDiff α] (a b : Part α) : a \ b = bind a fun y => map (y \ .) b := rfl
+theorem inv_def [Inv α] (a : Part α) : a⁻¹ = Part.map (· ⁻¹) a := rfl
+theorem div_def [Div α] (a b : Part α) : a / b = bind a fun y => map (y / ·) b := rfl
+theorem mod_def [Mod α] (a b : Part α) : a % b = bind a fun y => map (y % ·) b := rfl
+theorem append_def [Append α] (a b : Part α) : a ++ b = bind a fun y => map (y ++ ·) b := rfl
+theorem inter_def [Inter α] (a b : Part α) : a ∩ b = bind a fun y => map (y ∩ ·) b := rfl
+theorem union_def [Union α] (a b : Part α) : a ∪ b = bind a fun y => map (y ∪ ·) b := rfl
+theorem sdiff_def [SDiff α] (a b : Part α) : a \ b = bind a fun y => map (y \ ·) b := rfl
end
@@ -2,15 +2,12 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
-
-! This file was ported from Lean 3 source module data.part
-! leanprover-community/mathlib commit 80c43012d26f63026d362c3aba28f3c3bafb07e6
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Set.Basic
import Mathlib.Logic.Equiv.Defs
+#align_import data.part from "leanprover-community/mathlib"@"80c43012d26f63026d362c3aba28f3c3bafb07e6"
+
/-!
# Partial values of a type
This file defines `Part α`, the partial values of a type.
Alongside any necessary spacing/flow changes to accommodate their removal.
@@ -542,10 +542,9 @@ theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀
theorem bind_assoc {γ} (f : Part α) (g : α → Part β) (k : β → Part γ) :
(f.bind g).bind k = f.bind fun x => (g x).bind k :=
ext fun a => by
- simp;
- exact
- ⟨fun ⟨_, ⟨_, h₁, h₂⟩, h₃⟩ => ⟨_, h₁, _, h₂, h₃⟩, fun ⟨_, h₁, _, h₂, h₃⟩ =>
- ⟨_, ⟨_, h₁, h₂⟩, h₃⟩⟩
+ simp
+ exact ⟨fun ⟨_, ⟨_, h₁, h₂⟩, h₃⟩ => ⟨_, h₁, _, h₂, h₃⟩,
+ fun ⟨_, h₁, _, h₂, h₃⟩ => ⟨_, ⟨_, h₁, h₂⟩, h₃⟩⟩
#align part.bind_assoc Part.bind_assoc
@[simp]
This PR is the result of running
find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;
which firstly replaces .
focusing dots with ·
and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.
@@ -343,8 +343,8 @@ theorem ofOption_dom {α} : ∀ o : Option α, (ofOption o).Dom ↔ o.isSome
theorem ofOption_eq_get {α} (o : Option α) : ofOption o = ⟨_, @Option.get _ o⟩ :=
Part.ext' (ofOption_dom o) fun h₁ h₂ => by
cases o
- . simp at h₂
- . rfl
+ · simp at h₂
+ · rfl
#align part.of_option_eq_get Part.ofOption_eq_get
instance : Coe (Option α) (Part α) :=
fix-comments.py
on all files.@@ -132,7 +132,7 @@ instance : Inhabited (Part α) :=
theorem not_mem_none (a : α) : a ∉ @none α := fun h => h.fst
#align part.not_mem_none Part.not_mem_none
-/-- The `some a` value in `Part` has a `true` domain and the
+/-- The `some a` value in `Part` has a `True` domain and the
function returns `a`. -/
def some (a : α) : Part α :=
⟨True, fun _ => a⟩
@@ -262,7 +262,7 @@ instance someDecidable (a : α) : Decidable (some a).Dom :=
instDecidableTrue
#align part.some_decidable Part.someDecidable
-/-- Retrieves the value of `a : part α` if it exists, and return the provided default value
+/-- Retrieves the value of `a : Part α` if it exists, and return the provided default value
otherwise. -/
def getOrElse (a : Part α) [Decidable a.Dom] (d : α) :=
if ha : a.Dom then a.get ha else d
@@ -322,6 +322,7 @@ theorem elim_toOption {α β : Type _} (a : Part α) [Decidable a.Dom] (b : β)
#align part.elim_to_option Part.elim_toOption
/-- Converts an `Option α` into a `Part α`. -/
+@[coe]
def ofOption : Option α → Part α
| Option.none => none
| Option.some a => some a
@@ -68,11 +68,11 @@ def toOption (o : Part α) [Decidable o.Dom] : Option α :=
#align part.to_option Part.toOption
@[simp] lemma toOption_isSome (o : Part α) [Decidable o.Dom] : o.toOption.isSome ↔ o.Dom := by
- by_cases o.Dom <;> simp [h, toOption]
+ by_cases h : o.Dom <;> simp [h, toOption]
#align part.to_option_is_some Part.toOption_isSome
@[simp] lemma toOption_isNone (o : Part α) [Decidable o.Dom] : o.toOption.isNone ↔ ¬o.Dom := by
- by_cases o.Dom <;> simp [h, toOption]
+ by_cases h : o.Dom <;> simp [h, toOption]
#align part.to_option_is_none Part.toOption_isNone
/-- `Part` extensionality -/
@@ -531,7 +531,7 @@ theorem bind_some_eq_map (f : α → β) (x : Part α) : x.bind (some ∘ f) = m
theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀ a, Decidable (f a).Dom]
[Decidable (o.bind f).Dom] :
(o.bind f).toOption = o.toOption.elim Option.none fun a => (f a).toOption := by
- by_cases o.Dom
+ by_cases h : o.Dom
· simp_rw [h.toOption, h.bind]
rfl
· rw [Part.toOption_eq_none_iff.2 h]
Also fix some module docstrings.
data.part
@ee0c179cd3c8a45aa5bffbf1b41d8dbede452865
..80c43012d26f63026d362c3aba28f3c3bafb07e6
order.bounds.basic
@aba57d4d3dae35460225919dcd82fe91355162f9
..3310acfa9787aa171db6d4cba3945f6f275fe9f2
data.list.of_fn
@fd838fdf07a83ca89fb66d30bebf6f0e02908c3f
..bf27744463e9620ca4e4ebe951fe83530ae6949b
data.set.finite
@1126441d6bccf98c81214a0780c73d499f6721fe
..1f0096e6caa61e9c849ec2adbd227e960e9dff58
group_theory.group_action.opposite
@fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e
..4330aae21f538b862f8aead371cfb6ee556398f1
data.list.basic
@cf9386b56953fb40904843af98b7a80757bbe7f9
..1447cae870f372074e480de1acbeb51de0077698
data.list.infix
@6d0adfa76594f304b4650d098273d4366edeb61b
..26f081a2fb920140ed5bc5cc5344e84bcc7cb2b2
set_theory.lists
@9003f28797c0664a49e4179487267c494477d853
..497d1e06409995dd8ec95301fa8d8f3480187f4c
data.nat.choose.dvd
@207cfac9fcd06138865b5d04f7091e46d9320432
..966e0cf0685c9cedf8a3283ac69eef4d5f2eaca2
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
! This file was ported from Lean 3 source module data.part
-! leanprover-community/mathlib commit ee0c179cd3c8a45aa5bffbf1b41d8dbede452865
+! leanprover-community/mathlib commit 80c43012d26f63026d362c3aba28f3c3bafb07e6
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,7 +14,7 @@ import Mathlib.Logic.Equiv.Defs
/-!
# Partial values of a type
This file defines `Part α`, the partial values of a type.
-`o : Part α` carries a proposition `o.dom`, its domain, along with a function `get : o.dom → α`, its
+`o : Part α` carries a proposition `o.Dom`, its domain, along with a function `get : o.Dom → α`, its
value. The rule is then that every partial value has a value but, to access it, you need to provide
a proof of the domain.
`Part α` behaves the same as `Option α` except that `o : Option α` is decidably `none` or `some a`
@@ -38,7 +38,7 @@ Monadic structure:
* `Part.map`: Maps the value and keeps the same domain.
Other:
* `Part.restrict`: `Part.restrict p o` replaces the domain of `o : Part α` by `p : Prop` so long as
- `p → o.dom`.
+ `p → o.Dom`.
* `Part.assert`: `assert p f` appends `p` to the domains of the values of a partial function.
* `Part.unwrap`: Gets the value of a partial value regardless of its domain. Unsound.
## Notation
This PR is the result of a slight variant on the following "algorithm"
_
and make all uppercase letters into lowercase_
and make all uppercase letters into lowercase(original_lean3_name, OriginalLean4Name)
#align
statement just before the next empty line#align
statement to have been inserted too early)@@ -435,6 +435,8 @@ protected def bind (f : Part α) (g : α → Part β) : Part β :=
def map (f : α → β) (o : Part α) : Part β :=
⟨o.Dom, f ∘ o.get⟩
#align part.map Part.map
+#align part.map_dom Part.map_Dom
+#align part.map_get Part.map_get
theorem mem_map (f : α → β) {o : Part α} : ∀ {a}, a ∈ o → f a ∈ map f o
| _, ⟨_, rfl⟩ => ⟨_, rfl⟩
@@ -21,7 +21,7 @@ a proof of the domain.
for some `a : α`, while the domain of `o : Part α` doesn't have to be decidable. That means you can
translate back and forth between a partial value with a decidable domain and an option, and
`Option α` and `Part α` are classically equivalent. In general, `Part α` is bigger than `Option α`.
-In current mathlib, `Part ℕ`, aka `part_enat`, is used to move decidability of the order to
+In current mathlib, `Part ℕ`, aka `PartENat`, is used to move decidability of the order to
decidability of `PartENat.find` (which is the smallest natural satisfying a predicate, or `∞` if
there's none).
## Main declarations
Part.toOption_isSome
and Part.toOption_isNone
(#1520)
This is the forward-port of leanprover-community/mathlib#18153
@@ -67,6 +67,14 @@ def toOption (o : Part α) [Decidable o.Dom] : Option α :=
if h : Dom o then some (o.get h) else none
#align part.to_option Part.toOption
+@[simp] lemma toOption_isSome (o : Part α) [Decidable o.Dom] : o.toOption.isSome ↔ o.Dom := by
+ by_cases o.Dom <;> simp [h, toOption]
+#align part.to_option_is_some Part.toOption_isSome
+
+@[simp] lemma toOption_isNone (o : Part α) [Decidable o.Dom] : o.toOption.isNone ↔ ¬o.Dom := by
+ by_cases o.Dom <;> simp [h, toOption]
+#align part.to_option_is_none Part.toOption_isNone
+
/-- `Part` extensionality -/
theorem ext' : ∀ {o p : Part α} (_ : o.Dom ↔ p.Dom) (_ : ∀ h₁ h₂, o.get h₁ = p.get h₂), o = p
| ⟨od, o⟩, ⟨pd, p⟩, H1, H2 => by
@@ -701,61 +701,74 @@ end
theorem one_mem_one [One α] : (1 : α) ∈ (1 : Part α) :=
⟨trivial, rfl⟩
#align part.one_mem_one Part.one_mem_one
+#align part.zero_mem_zero Part.zero_mem_zero
@[to_additive]
theorem mul_mem_mul [Mul α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma * mb ∈ a * b := ⟨⟨ha.1, hb.1⟩, by simp [← ha.2, ← hb.2]; rfl⟩
#align part.mul_mem_mul Part.mul_mem_mul
+#align part.add_mem_add Part.add_mem_add
@[to_additive]
theorem left_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : a.Dom := hab.1
#align part.left_dom_of_mul_dom Part.left_dom_of_mul_dom
+#align part.left_dom_of_add_dom Part.left_dom_of_add_dom
@[to_additive]
theorem right_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : b.Dom := hab.2
#align part.right_dom_of_mul_dom Part.right_dom_of_mul_dom
+#align part.right_dom_of_add_dom Part.right_dom_of_add_dom
@[to_additive (attr := simp)]
theorem mul_get_eq [Mul α] (a b : Part α) (hab : Dom (a * b)) :
(a * b).get hab = a.get (left_dom_of_mul_dom hab) * b.get (right_dom_of_mul_dom hab) := rfl
#align part.mul_get_eq Part.mul_get_eq
+#align part.add_get_eq Part.add_get_eq
@[to_additive]
theorem some_mul_some [Mul α] (a b : α) : some a * some b = some (a * b) := by simp [mul_def]
#align part.some_mul_some Part.some_mul_some
+#align part.some_add_some Part.some_add_some
@[to_additive]
theorem inv_mem_inv [Inv α] (a : Part α) (ma : α) (ha : ma ∈ a) : ma⁻¹ ∈ a⁻¹ :=
by simp [inv_def]; aesop
#align part.inv_mem_inv Part.inv_mem_inv
+#align part.neg_mem_neg Part.neg_mem_neg
@[to_additive]
theorem inv_some [Inv α] (a : α) : (some a)⁻¹ = some a⁻¹ :=
rfl
#align part.inv_some Part.inv_some
+#align part.neg_some Part.neg_some
@[to_additive]
theorem div_mem_div [Div α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma / mb ∈ a / b := by simp [div_def]; aesop
#align part.div_mem_div Part.div_mem_div
+#align part.sub_mem_sub Part.sub_mem_sub
@[to_additive]
theorem left_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : a.Dom := hab.1
#align part.left_dom_of_div_dom Part.left_dom_of_div_dom
+#align part.left_dom_of_sub_dom Part.left_dom_of_sub_dom
@[to_additive]
theorem right_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : b.Dom := hab.2
#align part.right_dom_of_div_dom Part.right_dom_of_div_dom
+#align part.right_dom_of_sub_dom Part.right_dom_of_sub_dom
@[to_additive (attr := simp)]
theorem div_get_eq [Div α] (a b : Part α) (hab : Dom (a / b)) :
(a / b).get hab = a.get (left_dom_of_div_dom hab) / b.get (right_dom_of_div_dom hab) :=
by simp [div_def]; aesop
#align part.div_get_eq Part.div_get_eq
+#align part.sub_get_eq Part.sub_get_eq
@[to_additive]
theorem some_div_some [Div α] (a b : α) : some a / some b = some (a / b) := by simp [div_def]
#align part.some_div_some Part.some_div_some
+#align part.some_sub_some Part.some_sub_some
theorem mod_mem_mod [Mod α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
ma % mb ∈ a % b := by simp [mod_def]; aesop
to_additive
is @[to_additive (attrs := simp, ext, simps)]
simp
and simps
attributes to the to_additive
-dictionary.simp
-attributes). In particular it's possible that norm_cast
might generate some auxiliary declarations.to_additive
and simps
from the Simps
file to the toAdditive
file for uniformity.@[reassoc]
Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -715,7 +715,7 @@ theorem left_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : a.Dom
theorem right_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : b.Dom := hab.2
#align part.right_dom_of_mul_dom Part.right_dom_of_mul_dom
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem mul_get_eq [Mul α] (a b : Part α) (hab : Dom (a * b)) :
(a * b).get hab = a.get (left_dom_of_mul_dom hab) * b.get (right_dom_of_mul_dom hab) := rfl
#align part.mul_get_eq Part.mul_get_eq
@@ -747,7 +747,7 @@ theorem left_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : a.Dom
theorem right_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : b.Dom := hab.2
#align part.right_dom_of_div_dom Part.right_dom_of_div_dom
-@[simp, to_additive]
+@[to_additive (attr := simp)]
theorem div_get_eq [Div α] (a b : Part α) (hab : Dom (a / b)) :
(a / b).get hab = a.get (left_dom_of_div_dom hab) / b.get (right_dom_of_div_dom hab) :=
by simp [div_def]; aesop
@@ -237,14 +237,14 @@ theorem eq_get_iff_mem {o : Part α} {a : α} (h : o.Dom) : a = o.get h ↔ a
#align part.eq_get_iff_mem Part.eq_get_iff_mem
@[simp]
-theorem none_to_option [Decidable (@none α).Dom] : (none : Part α).toOption = Option.none :=
+theorem none_toOption [Decidable (@none α).Dom] : (none : Part α).toOption = Option.none :=
dif_neg id
-#align part.none_to_option Part.none_to_option
+#align part.none_to_option Part.none_toOption
@[simp]
-theorem some_to_option (a : α) [Decidable (some a).Dom] : (some a).toOption = Option.some a :=
+theorem some_toOption (a : α) [Decidable (some a).Dom] : (some a).toOption = Option.some a :=
dif_pos trivial
-#align part.some_to_option Part.some_to_option
+#align part.some_to_option Part.some_toOption
instance noneDecidable : Decidable (@none α).Dom :=
instDecidableFalse
Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2
, add_monoid_hom --> AddMonoidHom
Remove \n
from to_additive
docstrings that were inserted by mathport.
Move files and directories with Gcd
and Smul
to GCD
and SMul
@@ -124,7 +124,7 @@ instance : Inhabited (Part α) :=
theorem not_mem_none (a : α) : a ∉ @none α := fun h => h.fst
#align part.not_mem_none Part.not_mem_none
-/-- The `some a` value in `part` has a `true` domain and the
+/-- The `some a` value in `Part` has a `true` domain and the
function returns `a`. -/
def some (a : α) : Part α :=
⟨True, fun _ => a⟩
@@ -313,7 +313,7 @@ theorem elim_toOption {α β : Type _} (a : Part α) [Decidable a.Dom] (b : β)
rfl
#align part.elim_to_option Part.elim_toOption
-/-- Converts an `option α` into a `part α`. -/
+/-- Converts an `Option α` into a `Part α`. -/
def ofOption : Option α → Part α
| Option.none => none
| Option.some a => some a
@@ -422,7 +422,7 @@ protected def bind (f : Part α) (g : α → Part β) : Part β :=
assert (Dom f) fun b => g (f.get b)
#align part.bind Part.bind
-/-- The map operation for `part` just maps the value and maintains the same domain. -/
+/-- The map operation for `Part` just maps the value and maintains the same domain. -/
@[simps]
def map (f : α → β) (o : Part α) : Part β :=
⟨o.Dom, f ∘ o.get⟩
The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md
@@ -2,6 +2,11 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Jeremy Avigad, Simon Hudon
+
+! This file was ported from Lean 3 source module data.part
+! leanprover-community/mathlib commit ee0c179cd3c8a45aa5bffbf1b41d8dbede452865
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Data.Set.Basic
import Mathlib.Logic.Equiv.Defs
All dependencies are ported!