data.subtype
⟷
Mathlib.Data.Subtype
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)
@@ -84,7 +84,7 @@ ext_iff
@[simp] theorem coe_eta (a : {a // p a}) (h : p a) : mk ↑a h = a := subtype.ext rfl
-@[simp] theorem coe_mk (a h) : (@mk α p a h : α) = a := rfl
+@[simp, mfld_simps] theorem coe_mk (a h) : (@mk α p a h : α) = a := rfl
@[simp, nolint simp_nf] -- built-in reduction doesn't always work
theorem mk_eq_mk {a h a' h'} : @mk α p a h = @mk α p a' h' ↔ a = a' :=
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(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/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-import Mathbin.Logic.Function.Basic
-import Mathbin.Tactic.Ext
-import Mathbin.Tactic.Simps
+import Logic.Function.Basic
+import Tactic.Ext
+import Tactic.Simps
#align_import data.subtype from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module data.subtype
-! leanprover-community/mathlib commit 48fb5b5280e7c81672afc9524185ae994553ebf4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Logic.Function.Basic
import Mathbin.Tactic.Ext
import Mathbin.Tactic.Simps
+#align_import data.subtype from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
+
/-!
# Subtypes
mathlib commit https://github.com/leanprover-community/mathlib/commit/728ef9dbb281241906f25cbeb30f90d83e0bb451
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module data.subtype
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
+! leanprover-community/mathlib commit 48fb5b5280e7c81672afc9524185ae994553ebf4
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -134,7 +134,7 @@ theorem coe_eta (a : { a // p a }) (h : p a) : mk (↑a) h = a :=
-/
#print Subtype.coe_mk /-
-@[simp]
+@[simp, mfld_simps]
theorem coe_mk (a h) : (@mk α p a h : α) = a :=
rfl
#align subtype.coe_mk Subtype.coe_mk
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -206,18 +206,25 @@ def restrict {α} {β : α → Type _} (p : α → Prop) (f : ∀ x, β x) (x :
#align subtype.restrict Subtype.restrict
-/
+#print Subtype.restrict_apply /-
theorem restrict_apply {α} {β : α → Type _} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
restrict p f x = f x.1 := by rfl
#align subtype.restrict_apply Subtype.restrict_apply
+-/
+#print Subtype.restrict_def /-
theorem restrict_def {α β} (f : α → β) (p : α → Prop) : restrict p f = f ∘ coe := by rfl
#align subtype.restrict_def Subtype.restrict_def
+-/
+#print Subtype.restrict_injective /-
theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Injective f) :
Injective (restrict p f) :=
h.comp coe_injective
#align subtype.restrict_injective Subtype.restrict_injective
+-/
+#print Subtype.surjective_restrict /-
theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
Surjective fun f : ∀ x, β x => restrict p f :=
by
@@ -226,6 +233,7 @@ theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β
rintro ⟨x, hx⟩
exact dif_pos hx
#align subtype.surjective_restrict Subtype.surjective_restrict
+-/
#print Subtype.coind /-
/-- Defining a map into a subtype, this can be seen as an "coinduction principle" of `subtype`-/
@@ -234,20 +242,26 @@ def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α
#align subtype.coind Subtype.coind
-/
+#print Subtype.coind_injective /-
theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Injective f) :
Injective (coind f h) := fun x y hxy => hf <| by apply congr_arg Subtype.val hxy
#align subtype.coind_injective Subtype.coind_injective
+-/
+#print Subtype.coind_surjective /-
theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Surjective f) :
Surjective (coind f h) := fun x =>
let ⟨a, ha⟩ := hf x
⟨a, coe_injective ha⟩
#align subtype.coind_surjective Subtype.coind_surjective
+-/
+#print Subtype.coind_bijective /-
theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Bijective f) :
Bijective (coind f h) :=
⟨coind_injective h hf.1, coind_surjective h hf.2⟩
#align subtype.coind_bijective Subtype.coind_bijective
+-/
#print Subtype.map /-
/-- Restriction of a function to a function on subtypes. -/
@@ -257,11 +271,13 @@ def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a →
#align subtype.map Subtype.map
-/
+#print Subtype.map_comp /-
theorem map_comp {p : α → Prop} {q : β → Prop} {r : γ → Prop} {x : Subtype p} (f : α → β)
(h : ∀ a, p a → q (f a)) (g : β → γ) (l : ∀ a, q a → r (g a)) :
map g l (map f h x) = map (g ∘ f) (fun a ha => l (f a) <| h a ha) x :=
rfl
#align subtype.map_comp Subtype.map_comp
+-/
#print Subtype.map_id /-
theorem map_id {p : α → Prop} {h : ∀ a, p a → p (id a)} : map (@id α) h = id :=
@@ -269,10 +285,12 @@ theorem map_id {p : α → Prop} {h : ∀ a, p a → p (id a)} : map (@id α) h
#align subtype.map_id Subtype.map_id
-/
+#print Subtype.map_injective /-
theorem map_injective {p : α → Prop} {q : β → Prop} {f : α → β} (h : ∀ a, p a → q (f a))
(hf : Injective f) : Injective (map f h) :=
coind_injective _ <| hf.comp coe_injective
#align subtype.map_injective Subtype.map_injective
+-/
#print Subtype.map_involutive /-
theorem map_involutive {p : α → Prop} {f : α → α} (h : ∀ a, p a → p (f a)) (hf : Involutive f) :
@@ -283,9 +301,11 @@ theorem map_involutive {p : α → Prop} {f : α → α} (h : ∀ a, p a → p (
instance [HasEquiv α] (p : α → Prop) : HasEquiv (Subtype p) :=
⟨fun s t => (s : α) ≈ (t : α)⟩
+#print Subtype.equiv_iff /-
theorem equiv_iff [HasEquiv α] {p : α → Prop} {s t : Subtype p} : s ≈ t ↔ (s : α) ≈ (t : α) :=
Iff.rfl
#align subtype.equiv_iff Subtype.equiv_iff
+-/
variable [Setoid α]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -206,42 +206,18 @@ def restrict {α} {β : α → Type _} (p : α → Prop) (f : ∀ x, β x) (x :
#align subtype.restrict Subtype.restrict
-/
-/- warning: subtype.restrict_apply -> Subtype.restrict_apply is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Type.{u2}} (f : forall (x : α), β x) (p : α -> Prop) (x : Subtype.{u1} α p), Eq.{succ u2} (β (Subtype.val.{u1} α p x)) (Subtype.restrict.{u1, u2} α (fun (x : α) => β x) p f x) (f (Subtype.val.{u1} α p x))
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Type.{u1}} (f : forall (x : α), β x) (p : α -> Prop) (x : Subtype.{u2} α p), Eq.{succ u1} (β (Subtype.val.{u2} α p x)) (Subtype.restrict.{u2, u1} α (fun (x : α) => β x) p f x) (f (Subtype.val.{u2} α p x))
-Case conversion may be inaccurate. Consider using '#align subtype.restrict_apply Subtype.restrict_applyₓ'. -/
theorem restrict_apply {α} {β : α → Type _} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
restrict p f x = f x.1 := by rfl
#align subtype.restrict_apply Subtype.restrict_apply
-/- warning: subtype.restrict_def -> Subtype.restrict_def is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Type.{u2}} (f : α -> β) (p : α -> Prop), Eq.{max (max 1 u1) (succ u2)} ((Subtype.{u1} α p) -> β) (Subtype.restrict.{u1, u2} α (fun (ᾰ : α) => β) p f) (Function.comp.{max 1 u1, u1, succ u2} (Subtype.{u1} α p) α β f ((fun (a : Sort.{max 1 u1}) (b : Sort.{u1}) [self : HasLiftT.{max 1 u1, u1} a b] => self.0) (Subtype.{u1} α p) α (HasLiftT.mk.{max 1 u1, u1} (Subtype.{u1} α p) α (CoeTCₓ.coe.{max 1 u1, u1} (Subtype.{u1} α p) α (coeBase.{max 1 u1, u1} (Subtype.{u1} α p) α (coeSubtype.{u1} α (fun (x : α) => p x)))))))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Type.{u1}} (f : α -> β) (p : α -> Prop), Eq.{max u2 (succ u1)} ((Subtype.{u2} α p) -> β) (Subtype.restrict.{u2, u1} α (fun (ᾰ : α) => β) p f) (Function.comp.{max 1 u2, u2, succ u1} (Subtype.{u2} α p) α β f (fun (a : Subtype.{u2} α p) => Subtype.val.{u2} α p a))
-Case conversion may be inaccurate. Consider using '#align subtype.restrict_def Subtype.restrict_defₓ'. -/
theorem restrict_def {α β} (f : α → β) (p : α → Prop) : restrict p f = f ∘ coe := by rfl
#align subtype.restrict_def Subtype.restrict_def
-/- warning: subtype.restrict_injective -> Subtype.restrict_injective is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Type.{u2}} {f : α -> β} (p : α -> Prop), (Function.Injective.{u1, succ u2} α β f) -> (Function.Injective.{max 1 u1, succ u2} (Subtype.{u1} α p) β (Subtype.restrict.{u1, u2} α (fun (ᾰ : α) => β) p f))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Type.{u1}} {f : α -> β} (p : α -> Prop), (Function.Injective.{u2, succ u1} α β f) -> (Function.Injective.{max 1 u2, succ u1} (Subtype.{u2} α p) β (Subtype.restrict.{u2, u1} α (fun (ᾰ : α) => β) p f))
-Case conversion may be inaccurate. Consider using '#align subtype.restrict_injective Subtype.restrict_injectiveₓ'. -/
theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Injective f) :
Injective (restrict p f) :=
h.comp coe_injective
#align subtype.restrict_injective Subtype.restrict_injective
-/- warning: subtype.surjective_restrict -> Subtype.surjective_restrict is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Type.{u2}} [ne : forall (a : α), Nonempty.{succ u2} (β a)] (p : α -> Prop), Function.Surjective.{max u1 (succ u2), max (max 1 u1) (succ u2)} (forall (x : α), β x) (forall (x : Subtype.{u1} α p), β (Subtype.val.{u1} α p x)) (fun (f : forall (x : α), β x) => Subtype.restrict.{u1, u2} α (fun (x : α) => β x) p f)
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Type.{u1}} [ne : forall (a : α), Nonempty.{succ u1} (β a)] (p : α -> Prop), Function.Surjective.{max u2 (succ u1), max u2 (succ u1)} (forall (x : α), β x) (forall (x : Subtype.{u2} α p), β (Subtype.val.{u2} α p x)) (fun (f : forall (x : α), β x) => Subtype.restrict.{u2, u1} α (fun (x : α) => β x) p f)
-Case conversion may be inaccurate. Consider using '#align subtype.surjective_restrict Subtype.surjective_restrictₓ'. -/
theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
Surjective fun f : ∀ x, β x => restrict p f :=
by
@@ -258,34 +234,16 @@ def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α
#align subtype.coind Subtype.coind
-/
-/- warning: subtype.coind_injective -> Subtype.coind_injective is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β} {p : β -> Prop} (h : forall (a : α), p (f a)), (Function.Injective.{u1, u2} α β f) -> (Function.Injective.{u1, max 1 u2} α (Subtype.{u2} β p) (Subtype.coind.{u1, u2} α β f p h))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β} {p : β -> Prop} (h : forall (a : α), p (f a)), (Function.Injective.{u2, u1} α β f) -> (Function.Injective.{u2, max 1 u1} α (Subtype.{u1} β p) (Subtype.coind.{u2, u1} α β f p h))
-Case conversion may be inaccurate. Consider using '#align subtype.coind_injective Subtype.coind_injectiveₓ'. -/
theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Injective f) :
Injective (coind f h) := fun x y hxy => hf <| by apply congr_arg Subtype.val hxy
#align subtype.coind_injective Subtype.coind_injective
-/- warning: subtype.coind_surjective -> Subtype.coind_surjective is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β} {p : β -> Prop} (h : forall (a : α), p (f a)), (Function.Surjective.{u1, u2} α β f) -> (Function.Surjective.{u1, max 1 u2} α (Subtype.{u2} β p) (Subtype.coind.{u1, u2} α β f p h))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β} {p : β -> Prop} (h : forall (a : α), p (f a)), (Function.Surjective.{u2, u1} α β f) -> (Function.Surjective.{u2, max 1 u1} α (Subtype.{u1} β p) (Subtype.coind.{u2, u1} α β f p h))
-Case conversion may be inaccurate. Consider using '#align subtype.coind_surjective Subtype.coind_surjectiveₓ'. -/
theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Surjective f) :
Surjective (coind f h) := fun x =>
let ⟨a, ha⟩ := hf x
⟨a, coe_injective ha⟩
#align subtype.coind_surjective Subtype.coind_surjective
-/- warning: subtype.coind_bijective -> Subtype.coind_bijective is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β} {p : β -> Prop} (h : forall (a : α), p (f a)), (Function.Bijective.{u1, u2} α β f) -> (Function.Bijective.{u1, max 1 u2} α (Subtype.{u2} β p) (Subtype.coind.{u1, u2} α β f p h))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β} {p : β -> Prop} (h : forall (a : α), p (f a)), (Function.Bijective.{u2, u1} α β f) -> (Function.Bijective.{u2, max 1 u1} α (Subtype.{u1} β p) (Subtype.coind.{u2, u1} α β f p h))
-Case conversion may be inaccurate. Consider using '#align subtype.coind_bijective Subtype.coind_bijectiveₓ'. -/
theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Bijective f) :
Bijective (coind f h) :=
⟨coind_injective h hf.1, coind_surjective h hf.2⟩
@@ -299,12 +257,6 @@ def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a →
#align subtype.map Subtype.map
-/
-/- warning: subtype.map_comp -> Subtype.map_comp is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {p : α -> Prop} {q : β -> Prop} {r : γ -> Prop} {x : Subtype.{u1} α p} (f : α -> β) (h : forall (a : α), (p a) -> (q (f a))) (g : β -> γ) (l : forall (a : β), (q a) -> (r (g a))), Eq.{max 1 u3} (Subtype.{u3} γ r) (Subtype.map.{u2, u3} β γ (fun (a : β) => q a) r g l (Subtype.map.{u1, u2} α β (fun (a : α) => p a) (fun (a : β) => q a) f h x)) (Subtype.map.{u1, u3} α γ (fun (a : α) => p a) r (Function.comp.{u1, u2, u3} α β γ g f) (fun (a : α) (ha : p a) => l (f a) (h a ha)) x)
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u1}} {γ : Sort.{u2}} {p : α -> Prop} {q : β -> Prop} {r : γ -> Prop} {x : Subtype.{u3} α p} (f : α -> β) (h : forall (a : α), (p a) -> (q (f a))) (g : β -> γ) (l : forall (a : β), (q a) -> (r (g a))), Eq.{max 1 u2} (Subtype.{u2} γ r) (Subtype.map.{u1, u2} β γ (fun (a : β) => q a) r g l (Subtype.map.{u3, u1} α β (fun (a : α) => p a) (fun (a : β) => q a) f h x)) (Subtype.map.{u3, u2} α γ (fun (a : α) => p a) r (Function.comp.{u3, u1, u2} α β γ g f) (fun (a : α) (ha : p a) => l (f a) (h a ha)) x)
-Case conversion may be inaccurate. Consider using '#align subtype.map_comp Subtype.map_compₓ'. -/
theorem map_comp {p : α → Prop} {q : β → Prop} {r : γ → Prop} {x : Subtype p} (f : α → β)
(h : ∀ a, p a → q (f a)) (g : β → γ) (l : ∀ a, q a → r (g a)) :
map g l (map f h x) = map (g ∘ f) (fun a ha => l (f a) <| h a ha) x :=
@@ -317,12 +269,6 @@ theorem map_id {p : α → Prop} {h : ∀ a, p a → p (id a)} : map (@id α) h
#align subtype.map_id Subtype.map_id
-/
-/- warning: subtype.map_injective -> Subtype.map_injective is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {p : α -> Prop} {q : β -> Prop} {f : α -> β} (h : forall (a : α), (p a) -> (q (f a))), (Function.Injective.{u1, u2} α β f) -> (Function.Injective.{max 1 u1, max 1 u2} (Subtype.{u1} α (fun (a : α) => p a)) (Subtype.{u2} β q) (Subtype.map.{u1, u2} α β (fun (a : α) => p a) q f h))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {p : α -> Prop} {q : β -> Prop} {f : α -> β} (h : forall (a : α), (p a) -> (q (f a))), (Function.Injective.{u2, u1} α β f) -> (Function.Injective.{max 1 u2, max 1 u1} (Subtype.{u2} α (fun (a : α) => p a)) (Subtype.{u1} β q) (Subtype.map.{u2, u1} α β (fun (a : α) => p a) q f h))
-Case conversion may be inaccurate. Consider using '#align subtype.map_injective Subtype.map_injectiveₓ'. -/
theorem map_injective {p : α → Prop} {q : β → Prop} {f : α → β} (h : ∀ a, p a → q (f a))
(hf : Injective f) : Injective (map f h) :=
coind_injective _ <| hf.comp coe_injective
@@ -337,12 +283,6 @@ theorem map_involutive {p : α → Prop} {f : α → α} (h : ∀ a, p a → p (
instance [HasEquiv α] (p : α → Prop) : HasEquiv (Subtype p) :=
⟨fun s t => (s : α) ≈ (t : α)⟩
-/- warning: subtype.equiv_iff -> Subtype.equiv_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} [_inst_1 : HasEquivₓ.{u1} α] {p : α -> Prop} {s : Subtype.{u1} α p} {t : Subtype.{u1} α p}, Iff (HasEquivₓ.Equiv.{max 1 u1} (Subtype.{u1} α p) (Subtype.hasEquiv.{u1} α _inst_1 p) s t) (HasEquivₓ.Equiv.{u1} α _inst_1 ((fun (a : Sort.{max 1 u1}) (b : Sort.{u1}) [self : HasLiftT.{max 1 u1, u1} a b] => self.0) (Subtype.{u1} α p) α (HasLiftT.mk.{max 1 u1, u1} (Subtype.{u1} α p) α (CoeTCₓ.coe.{max 1 u1, u1} (Subtype.{u1} α p) α (coeBase.{max 1 u1, u1} (Subtype.{u1} α p) α (coeSubtype.{u1} α (fun (x : α) => p x))))) s) ((fun (a : Sort.{max 1 u1}) (b : Sort.{u1}) [self : HasLiftT.{max 1 u1, u1} a b] => self.0) (Subtype.{u1} α p) α (HasLiftT.mk.{max 1 u1, u1} (Subtype.{u1} α p) α (CoeTCₓ.coe.{max 1 u1, u1} (Subtype.{u1} α p) α (coeBase.{max 1 u1, u1} (Subtype.{u1} α p) α (coeSubtype.{u1} α (fun (x : α) => p x))))) t))
-but is expected to have type
- forall {α : Sort.{u1}} [_inst_1 : HasEquiv.{u1, 0} α] {p : α -> Prop} {s : Subtype.{u1} α p} {t : Subtype.{u1} α p}, Iff (HasEquiv.Equiv.{max 1 u1, 0} (Subtype.{u1} α p) (Subtype.instHasEquivSubtype.{u1, 0} α _inst_1 p) s t) (HasEquiv.Equiv.{u1, 0} α _inst_1 (Subtype.val.{u1} α p s) (Subtype.val.{u1} α p t))
-Case conversion may be inaccurate. Consider using '#align subtype.equiv_iff Subtype.equiv_iffₓ'. -/
theorem equiv_iff [HasEquiv α] {p : α → Prop} {s t : Subtype p} : s ≈ t ↔ (s : α) ≈ (t : α) :=
Iff.rfl
#align subtype.equiv_iff Subtype.equiv_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -109,11 +109,8 @@ theorem heq_iff_coe_eq (h : ∀ x, p x ↔ q x) {a1 : { x // p x }} {a2 : { x //
#print Subtype.heq_iff_coe_heq /-
theorem heq_iff_coe_heq {α β : Sort _} {p : α → Prop} {q : β → Prop} {a : { x // p x }}
- {b : { y // q y }} (h : α = β) (h' : HEq p q) : HEq a b ↔ HEq (a : α) (b : β) :=
- by
- subst h
- subst h'
- rw [heq_iff_eq, heq_iff_eq, ext_iff]
+ {b : { y // q y }} (h : α = β) (h' : HEq p q) : HEq a b ↔ HEq (a : α) (b : β) := by subst h;
+ subst h'; rw [heq_iff_eq, heq_iff_eq, ext_iff]
#align subtype.heq_iff_coe_heq Subtype.heq_iff_coe_heq
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
deprecated
attributeWhy these changes?
@@ -141,8 +141,7 @@ theorem val_inj {a b : Subtype p} : a.val = b.val ↔ a = b :=
lemma coe_ne_coe {a b : Subtype p} : (a : α) ≠ b ↔ a ≠ b := coe_injective.ne_iff
--- 2024-04-04
-@[deprecated] alias ⟨ne_of_val_ne, _⟩ := coe_ne_coe
+@[deprecated] alias ⟨ne_of_val_ne, _⟩ := coe_ne_coe -- 2024-04-04
#align subtype.ne_of_val_ne Subtype.ne_of_val_ne
-- Porting note: it is unclear why the linter doesn't like this.
Init.Data.Subtype.Basic
(#11887)
The few useful lemmas can go to Data.Subtype.Basic
and the other ones can be deleted.
@@ -6,6 +6,7 @@ Authors: Johannes Hölzl
import Mathlib.Logic.Function.Basic
#align_import data.subtype from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
+#align_import init.data.subtype.basic from "leanprover-community/lean"@"855e5b74e3a52a40552e8f067169d747d48743fd"
/-!
# Subtypes
@@ -29,6 +30,13 @@ namespace Subtype
variable {α β γ : Sort*} {p q : α → Prop}
+#align subtype.eq Subtype.eq
+#align subtype.eta Subtype.eta
+
+#noalign subtype.tag_irrelevant
+#noalign subtype.exists_of_subtype
+#align subtype.inhabited Subtype.instInhabitedSubtype
+
attribute [coe] Subtype.val
initialize_simps_projections Subtype (val → coe)
@@ -131,6 +139,12 @@ theorem val_inj {a b : Subtype p} : a.val = b.val ↔ a = b :=
coe_inj
#align subtype.val_inj Subtype.val_inj
+lemma coe_ne_coe {a b : Subtype p} : (a : α) ≠ b ↔ a ≠ b := coe_injective.ne_iff
+
+-- 2024-04-04
+@[deprecated] alias ⟨ne_of_val_ne, _⟩ := coe_ne_coe
+#align subtype.ne_of_val_ne Subtype.ne_of_val_ne
+
-- Porting note: it is unclear why the linter doesn't like this.
-- If you understand why, please replace this comment with an explanation, or resolve.
@[simp, nolint simpNF]
@@ -203,6 +203,11 @@ def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a →
#align subtype.map Subtype.map
#align subtype.map_coe Subtype.map_coe
+-- Adaptation note: nightly-2024-03-16: added to replace simp [Subtype.map]
+theorem map_def {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :
+ map f h = fun x ↦ ⟨f x, h x x.prop⟩ :=
+ rfl
+
theorem map_comp {p : α → Prop} {q : β → Prop} {r : γ → Prop} {x : Subtype p}
(f : α → β) (h : ∀ a, p a → q (f a)) (g : β → γ) (l : ∀ a, q a → r (g a)) :
map g l (map f h x) = map (g ∘ f) (fun a ha ↦ l (f a) <| h a ha) x :=
λ
by fun
(#11301)
Per the style guidelines, λ
is disallowed in mathlib.
This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.
Notes
=>
to ↦
.Mathlib/Order/SupClosed
.λ x,
, which I also replaced.@@ -72,8 +72,8 @@ theorem ext_iff {a1 a2 : { x // p x }} : a1 = a2 ↔ (a1 : α) = (a2 : α) :=
theorem heq_iff_coe_eq (h : ∀ x, p x ↔ q x) {a1 : { x // p x }} {a2 : { x // q x }} :
HEq a1 a2 ↔ (a1 : α) = (a2 : α) :=
- Eq.rec (motive := λ (pp: (α → Prop)) _ => ∀ a2' : {x // pp x}, HEq a1 a2' ↔ (a1 : α) = (a2' : α))
- (λ _ => heq_iff_eq.trans ext_iff) (funext <| λ x => propext (h x)) a2
+ Eq.rec (motive := fun (pp: (α → Prop)) _ ↦ ∀ a2' : {x // pp x}, HEq a1 a2' ↔ (a1 : α) = (a2' : α))
+ (fun _ ↦ heq_iff_eq.trans ext_iff) (funext <| fun x ↦ propext (h x)) a2
#align subtype.heq_iff_coe_eq Subtype.heq_iff_coe_eq
lemma heq_iff_coe_heq {α β : Sort _} {p : α → Prop} {q : β → Prop} {a : {x // p x}}
$
with <|
(#9319)
See Zulip thread for the discussion.
@@ -73,7 +73,7 @@ theorem ext_iff {a1 a2 : { x // p x }} : a1 = a2 ↔ (a1 : α) = (a2 : α) :=
theorem heq_iff_coe_eq (h : ∀ x, p x ↔ q x) {a1 : { x // p x }} {a2 : { x // q x }} :
HEq a1 a2 ↔ (a1 : α) = (a2 : α) :=
Eq.rec (motive := λ (pp: (α → Prop)) _ => ∀ a2' : {x // pp x}, HEq a1 a2' ↔ (a1 : α) = (a2' : α))
- (λ _ => heq_iff_eq.trans ext_iff) (funext $ λ x => propext (h x)) a2
+ (λ _ => heq_iff_eq.trans ext_iff) (funext <| λ x => propext (h x)) a2
#align subtype.heq_iff_coe_eq Subtype.heq_iff_coe_eq
lemma heq_iff_coe_heq {α β : Sort _} {p : α → Prop} {q : β → Prop} {a : {x // p x}}
@@ -158,7 +158,7 @@ theorem restrict_apply {α} {β : α → Type*} (f : ∀ x, β x) (p : α → Pr
#align subtype.restrict_apply Subtype.restrict_apply
theorem restrict_def {α β} (f : α → β) (p : α → Prop) :
- restrict p f = f ∘ (fun (a : Subtype p) ↦ a) := rfl
+ restrict p f = f ∘ (fun (a : Subtype p) ↦ a) := rfl
#align subtype.restrict_def Subtype.restrict_def
theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Injective f) :
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -27,7 +27,7 @@ open Function
namespace Subtype
-variable {α β γ : Sort _} {p q : α → Prop}
+variable {α β γ : Sort*} {p q : α → Prop}
attribute [coe] Subtype.val
@@ -148,11 +148,11 @@ theorem _root_.exists_subtype_mk_eq_iff {a : Subtype p} {b : α} :
#align exists_subtype_mk_eq_iff exists_subtype_mk_eq_iff
/-- Restrict a (dependent) function to a subtype -/
-def restrict {α} {β : α → Type _} (p : α → Prop) (f : ∀ x, β x) (x : Subtype p) : β x.1 :=
+def restrict {α} {β : α → Type*} (p : α → Prop) (f : ∀ x, β x) (x : Subtype p) : β x.1 :=
f x
#align subtype.restrict Subtype.restrict
-theorem restrict_apply {α} {β : α → Type _} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
+theorem restrict_apply {α} {β : α → Type*} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
restrict p f x = f x.1 := by
rfl
#align subtype.restrict_apply Subtype.restrict_apply
@@ -166,7 +166,7 @@ theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Inject
h.comp coe_injective
#align subtype.restrict_injective Subtype.restrict_injective
-theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
+theorem surjective_restrict {α} {β : α → Type*} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
Surjective fun f : ∀ x, β x ↦ restrict p f := by
letI := Classical.decPred p
refine' fun f ↦ ⟨fun x ↦ if h : p x then f ⟨x, h⟩ else Nonempty.some (ne x), funext <| _⟩
@@ -256,7 +256,7 @@ end Subtype
namespace Subtype
/-! Some facts about sets, which require that `α` is a type. -/
-variable {α β γ : Type _} {p : α → Prop}
+variable {α β γ : Type*} {p : α → Prop}
@[simp]
theorem coe_prop {S : Set α} (a : { a // a ∈ S }) : ↑a ∈ S :=
@@ -2,14 +2,11 @@
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module data.subtype
-! leanprover-community/mathlib commit 48fb5b5280e7c81672afc9524185ae994553ebf4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Logic.Function.Basic
+#align_import data.subtype from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4"
+
/-!
# Subtypes
register_simp_attr
s to 1 file (#5681)
There are slight differences between mathlib3
and mathlib4
(different set of attributes, different lemmas are in core/std), so I redid the same refactor instead of forward-porting changes.
mathlib3 PR: leanprover-community/mathlib#19223
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module data.subtype
-! leanprover-community/mathlib commit c4658a649d216f57e99621708b09dcb3dcccbd23
+! leanprover-community/mathlib commit 48fb5b5280e7c81672afc9524185ae994553ebf4
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -177,7 +177,7 @@ theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β
exact dif_pos hx
#align subtype.surjective_restrict Subtype.surjective_restrict
-/-- Defining a map into a subtype, this can be seen as an "coinduction principle" of `Subtype`-/
+/-- Defining a map into a subtype, this can be seen as a "coinduction principle" of `Subtype`-/
@[simps]
def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α → Subtype p := fun a ↦ ⟨f a, h a⟩
#align subtype.coind Subtype.coind
I ran codespell Mathlib
and got tired halfway through the suggestions.
@@ -104,7 +104,7 @@ theorem coe_mk (a h) : (@mk α p a h : α) = a :=
#align subtype.coe_mk Subtype.coe_mk
-- Porting note: comment out `@[simp, nolint simp_nf]`
--- Porting note: not clear if "build-in reduction doesn't always work" is still relevant
+-- Porting note: not clear if "built-in reduction doesn't always work" is still relevant
-- built-in reduction doesn't always work
-- @[simp, nolint simp_nf]
theorem mk_eq_mk {a h a' h'} : @mk α p a h = @mk α p a' h' ↔ a = a' :=
This makes a mathlib4 version of mathlib3's tactic.basic
, now called Mathlib.Tactic.Common
, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.
This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -9,7 +9,6 @@ Authors: Johannes Hölzl
! if you have ported upstream changes.
-/
import Mathlib.Logic.Function.Basic
-import Mathlib.Tactic.Simps.Basic
/-!
# Subtypes
@@ -59,8 +59,8 @@ protected theorem «exists» {q : { a // p a } → Prop} : (∃ x, q x) ↔ ∃
⟨fun ⟨⟨a, b⟩, h⟩ ↦ ⟨a, b, h⟩, fun ⟨a, b, h⟩ ↦ ⟨⟨a, b⟩, h⟩⟩
#align subtype.exists Subtype.exists
-/-- An alternative version of `subtype.exists`. This one is useful if Lean cannot figure out `q`
- when using `subtype.exists` from right to left. -/
+/-- An alternative version of `Subtype.exists`. This one is useful if Lean cannot figure out `q`
+ when using `Subtype.exists` from right to left. -/
protected theorem exists' {q : ∀ x, p x → Prop} : (∃ x h, q x h) ↔ ∃ x : { a // p a }, q x x.2 :=
(@Subtype.exists _ _ fun x ↦ q x.1 x.2).symm
#align subtype.exists' Subtype.exists'
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)@@ -41,55 +41,68 @@ initialize_simps_projections Subtype (val → coe)
instead of `x.1`. A similar result is `Subtype.mem` in `Data.Set.Basic`. -/
theorem prop (x : Subtype p) : p x :=
x.2
+#align subtype.prop Subtype.prop
@[simp]
protected theorem «forall» {q : { a // p a } → Prop} : (∀ x, q x) ↔ ∀ a b, q ⟨a, b⟩ :=
⟨fun h a b ↦ h ⟨a, b⟩, fun h ⟨a, b⟩ ↦ h a b⟩
+#align subtype.forall Subtype.forall
/-- An alternative version of `Subtype.forall`. This one is useful if Lean cannot figure out `q`
when using `Subtype.forall` from right to left. -/
protected theorem forall' {q : ∀ x, p x → Prop} : (∀ x h, q x h) ↔ ∀ x : { a // p a }, q x x.2 :=
(@Subtype.forall _ _ fun x ↦ q x.1 x.2).symm
+#align subtype.forall' Subtype.forall'
@[simp]
protected theorem «exists» {q : { a // p a } → Prop} : (∃ x, q x) ↔ ∃ a b, q ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ ↦ ⟨a, b, h⟩, fun ⟨a, b, h⟩ ↦ ⟨⟨a, b⟩, h⟩⟩
+#align subtype.exists Subtype.exists
/-- An alternative version of `subtype.exists`. This one is useful if Lean cannot figure out `q`
when using `subtype.exists` from right to left. -/
protected theorem exists' {q : ∀ x, p x → Prop} : (∃ x h, q x h) ↔ ∃ x : { a // p a }, q x x.2 :=
(@Subtype.exists _ _ fun x ↦ q x.1 x.2).symm
+#align subtype.exists' Subtype.exists'
@[ext]
protected theorem ext : ∀ {a1 a2 : { x // p x }}, (a1 : α) = (a2 : α) → a1 = a2
| ⟨_, _⟩, ⟨_, _⟩, rfl => rfl
+#align subtype.ext Subtype.ext
theorem ext_iff {a1 a2 : { x // p x }} : a1 = a2 ↔ (a1 : α) = (a2 : α) :=
⟨congr_arg _, Subtype.ext⟩
+#align subtype.ext_iff Subtype.ext_iff
theorem heq_iff_coe_eq (h : ∀ x, p x ↔ q x) {a1 : { x // p x }} {a2 : { x // q x }} :
HEq a1 a2 ↔ (a1 : α) = (a2 : α) :=
Eq.rec (motive := λ (pp: (α → Prop)) _ => ∀ a2' : {x // pp x}, HEq a1 a2' ↔ (a1 : α) = (a2' : α))
(λ _ => heq_iff_eq.trans ext_iff) (funext $ λ x => propext (h x)) a2
+#align subtype.heq_iff_coe_eq Subtype.heq_iff_coe_eq
lemma heq_iff_coe_heq {α β : Sort _} {p : α → Prop} {q : β → Prop} {a : {x // p x}}
{b : {y // q y}} (h : α = β) (h' : HEq p q) : HEq a b ↔ HEq (a : α) (b : β) := by
subst h
subst h'
rw [heq_iff_eq, heq_iff_eq, ext_iff]
+#align subtype.heq_iff_coe_heq Subtype.heq_iff_coe_heq
theorem ext_val {a1 a2 : { x // p x }} : a1.1 = a2.1 → a1 = a2 :=
Subtype.ext
+#align subtype.ext_val Subtype.ext_val
theorem ext_iff_val {a1 a2 : { x // p x }} : a1 = a2 ↔ a1.1 = a2.1 :=
ext_iff
+#align subtype.ext_iff_val Subtype.ext_iff_val
@[simp]
theorem coe_eta (a : { a // p a }) (h : p a) : mk (↑a) h = a :=
Subtype.ext rfl
+#align subtype.coe_eta Subtype.coe_eta
theorem coe_mk (a h) : (@mk α p a h : α) = a :=
rfl
+#align subtype.coe_mk Subtype.coe_mk
-- Porting note: comment out `@[simp, nolint simp_nf]`
-- Porting note: not clear if "build-in reduction doesn't always work" is still relevant
@@ -97,23 +110,30 @@ theorem coe_mk (a h) : (@mk α p a h : α) = a :=
-- @[simp, nolint simp_nf]
theorem mk_eq_mk {a h a' h'} : @mk α p a h = @mk α p a' h' ↔ a = a' :=
ext_iff
+#align subtype.mk_eq_mk Subtype.mk_eq_mk
theorem coe_eq_of_eq_mk {a : { a // p a }} {b : α} (h : ↑a = b) : a = ⟨b, h ▸ a.2⟩ :=
Subtype.ext h
+#align subtype.coe_eq_of_eq_mk Subtype.coe_eq_of_eq_mk
theorem coe_eq_iff {a : { a // p a }} {b : α} : ↑a = b ↔ ∃ h, a = ⟨b, h⟩ :=
⟨fun h ↦ h ▸ ⟨a.2, (coe_eta _ _).symm⟩, fun ⟨_, ha⟩ ↦ ha.symm ▸ rfl⟩
+#align subtype.coe_eq_iff Subtype.coe_eq_iff
theorem coe_injective : Injective (fun (a : Subtype p) ↦ (a : α)) := fun _ _ ↦ Subtype.ext
+#align subtype.coe_injective Subtype.coe_injective
theorem val_injective : Injective (@val _ p) :=
coe_injective
+#align subtype.val_injective Subtype.val_injective
theorem coe_inj {a b : Subtype p} : (a : α) = b ↔ a = b :=
coe_injective.eq_iff
+#align subtype.coe_inj Subtype.coe_inj
theorem val_inj {a b : Subtype p} : a.val = b.val ↔ a = b :=
coe_inj
+#align subtype.val_inj Subtype.val_inj
-- Porting note: it is unclear why the linter doesn't like this.
-- If you understand why, please replace this comment with an explanation, or resolve.
@@ -121,6 +141,7 @@ theorem val_inj {a b : Subtype p} : a.val = b.val ↔ a = b :=
theorem _root_.exists_eq_subtype_mk_iff {a : Subtype p} {b : α} :
(∃ h : p b, a = Subtype.mk b h) ↔ ↑a = b :=
coe_eq_iff.symm
+#align exists_eq_subtype_mk_iff exists_eq_subtype_mk_iff
-- Porting note: it is unclear why the linter doesn't like this.
-- If you understand why, please replace this comment with an explanation, or resolve.
@@ -128,21 +149,26 @@ theorem _root_.exists_eq_subtype_mk_iff {a : Subtype p} {b : α} :
theorem _root_.exists_subtype_mk_eq_iff {a : Subtype p} {b : α} :
(∃ h : p b, Subtype.mk b h = a) ↔ b = a := by
simp only [@eq_comm _ b, exists_eq_subtype_mk_iff, @eq_comm _ _ a]
+#align exists_subtype_mk_eq_iff exists_subtype_mk_eq_iff
/-- Restrict a (dependent) function to a subtype -/
def restrict {α} {β : α → Type _} (p : α → Prop) (f : ∀ x, β x) (x : Subtype p) : β x.1 :=
f x
+#align subtype.restrict Subtype.restrict
theorem restrict_apply {α} {β : α → Type _} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
restrict p f x = f x.1 := by
rfl
+#align subtype.restrict_apply Subtype.restrict_apply
theorem restrict_def {α β} (f : α → β) (p : α → Prop) :
restrict p f = f ∘ (fun (a : Subtype p) ↦ a) := rfl
+#align subtype.restrict_def Subtype.restrict_def
theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Injective f) :
Injective (restrict p f) :=
h.comp coe_injective
+#align subtype.restrict_injective Subtype.restrict_injective
theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β a)] (p : α → Prop) :
Surjective fun f : ∀ x, β x ↦ restrict p f := by
@@ -150,64 +176,81 @@ theorem surjective_restrict {α} {β : α → Type _} [ne : ∀ a, Nonempty (β
refine' fun f ↦ ⟨fun x ↦ if h : p x then f ⟨x, h⟩ else Nonempty.some (ne x), funext <| _⟩
rintro ⟨x, hx⟩
exact dif_pos hx
+#align subtype.surjective_restrict Subtype.surjective_restrict
/-- Defining a map into a subtype, this can be seen as an "coinduction principle" of `Subtype`-/
@[simps]
def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α → Subtype p := fun a ↦ ⟨f a, h a⟩
+#align subtype.coind Subtype.coind
+#align subtype.coind_coe Subtype.coind_coe
theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Injective f) :
Injective (coind f h) := fun x y hxy ↦ hf <| by apply congr_arg Subtype.val hxy
+#align subtype.coind_injective Subtype.coind_injective
theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Surjective f) :
Surjective (coind f h) := fun x ↦
let ⟨a, ha⟩ := hf x
⟨a, coe_injective ha⟩
+#align subtype.coind_surjective Subtype.coind_surjective
theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Bijective f) :
Bijective (coind f h) :=
⟨coind_injective h hf.1, coind_surjective h hf.2⟩
+#align subtype.coind_bijective Subtype.coind_bijective
/-- Restriction of a function to a function on subtypes. -/
@[simps]
def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :
Subtype p → Subtype q :=
fun x ↦ ⟨f x, h x x.prop⟩
+#align subtype.map Subtype.map
+#align subtype.map_coe Subtype.map_coe
theorem map_comp {p : α → Prop} {q : β → Prop} {r : γ → Prop} {x : Subtype p}
(f : α → β) (h : ∀ a, p a → q (f a)) (g : β → γ) (l : ∀ a, q a → r (g a)) :
map g l (map f h x) = map (g ∘ f) (fun a ha ↦ l (f a) <| h a ha) x :=
rfl
+#align subtype.map_comp Subtype.map_comp
theorem map_id {p : α → Prop} {h : ∀ a, p a → p (id a)} : map (@id α) h = id :=
funext fun _ ↦ rfl
+#align subtype.map_id Subtype.map_id
theorem map_injective {p : α → Prop} {q : β → Prop} {f : α → β} (h : ∀ a, p a → q (f a))
(hf : Injective f) : Injective (map f h) :=
coind_injective _ <| hf.comp coe_injective
+#align subtype.map_injective Subtype.map_injective
theorem map_involutive {p : α → Prop} {f : α → α} (h : ∀ a, p a → p (f a))
(hf : Involutive f) : Involutive (map f h) :=
fun x ↦ Subtype.ext (hf x)
+#align subtype.map_involutive Subtype.map_involutive
instance [HasEquiv α] (p : α → Prop) : HasEquiv (Subtype p) :=
⟨fun s t ↦ (s : α) ≈ (t : α)⟩
theorem equiv_iff [HasEquiv α] {p : α → Prop} {s t : Subtype p} : s ≈ t ↔ (s : α) ≈ (t : α) :=
Iff.rfl
+#align subtype.equiv_iff Subtype.equiv_iff
variable [Setoid α]
protected theorem refl (s : Subtype p) : s ≈ s :=
Setoid.refl _
+#align subtype.refl Subtype.refl
protected theorem symm {s t : Subtype p} (h : s ≈ t) : t ≈ s :=
Setoid.symm h
+#align subtype.symm Subtype.symm
protected theorem trans {s t u : Subtype p} (h₁ : s ≈ t) (h₂ : t ≈ u) : s ≈ u :=
Setoid.trans h₁ h₂
+#align subtype.trans Subtype.trans
theorem equivalence (p : α → Prop) : Equivalence (@HasEquiv.Equiv (Subtype p) _) :=
.mk (Subtype.refl) (@Subtype.symm _ p _) (@Subtype.trans _ p _)
+#align subtype.equivalence Subtype.equivalence
instance (p : α → Prop) : Setoid (Subtype p) :=
Setoid.mk (· ≈ ·) (equivalence p)
@@ -222,8 +265,10 @@ variable {α β γ : Type _} {p : α → Prop}
@[simp]
theorem coe_prop {S : Set α} (a : { a // a ∈ S }) : ↑a ∈ S :=
a.prop
+#align subtype.coe_prop Subtype.coe_prop
theorem val_prop {S : Set α} (a : { a // a ∈ S }) : a.val ∈ S :=
a.property
+#align subtype.val_prop Subtype.val_prop
end Subtype
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -127,7 +127,7 @@ theorem _root_.exists_eq_subtype_mk_iff {a : Subtype p} {b : α} :
@[simp, nolint simpNF]
theorem _root_.exists_subtype_mk_eq_iff {a : Subtype p} {b : α} :
(∃ h : p b, Subtype.mk b h = a) ↔ b = a := by
- simp only [@eq_comm _ b, exists_eq_subtype_mk_iff, @eq_comm _ _ a, iff_self]
+ simp only [@eq_comm _ b, exists_eq_subtype_mk_iff, @eq_comm _ _ a]
/-- Restrict a (dependent) function to a subtype -/
def restrict {α} {β : α → Type _} (p : α → Prop) (f : ∀ x, β x) (x : Subtype p) : β x.1 :=
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 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
+
+! This file was ported from Lean 3 source module data.subtype
+! leanprover-community/mathlib commit c4658a649d216f57e99621708b09dcb3dcccbd23
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Logic.Function.Basic
import Mathlib.Tactic.Simps.Basic
All dependencies are ported!