data.subtypeMathlib.Data.Subtype

This file has been ported!

Changes since the initial port

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

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

refactor(*): move all mk_simp_attribute commands to 1 file (#19223)
Diff
@@ -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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -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"
 
Diff
@@ -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
 
Diff
@@ -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
Diff
@@ -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 α]
 
Diff
@@ -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
Diff
@@ -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
 -/
 

Changes in mathlib4

mathlib3
mathlib4
chore: unify date formatting in lemma deprecations (#12334)
  • consistently use the YYYY-MM-DD format
  • when easily possible, put the date on the same line as the deprecated attribute
  • when easily possible, format the entire declaration on the same line

Why these changes?

  • consistency makes it easier for tools to parse this information
  • compactness: I don't see a good reason for these declarations taking up more space than needed; as I understand it, deprecated lemmas are not supposed to be used in mathlib anyway
  • putting the date on the same line as the attribute makes it easier to discover un-dated deprecations; they also ease writing a tool to replace these by a machine-readable version using leanprover/lean4#3968
Diff
@@ -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.
chore: Delete Init.Data.Subtype.Basic (#11887)

The few useful lemmas can go to Data.Subtype.Basic and the other ones can be deleted.

Diff
@@ -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]
chore: work around simp issues in future nightlies (#11546)
Diff
@@ -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 :=
chore: replace λ 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

  • In lines I was modifying anyway, I also converted => to .
  • Also contains some mild in-passing indentation fixes in Mathlib/Order/SupClosed.
  • Some doc comments still contained Lean 3 syntax λ x, , which I also replaced.
Diff
@@ -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}}
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -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}}
chore: only four spaces for subsequent lines (#7286)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -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) :
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -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 :=
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,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
 
refactor: move all register_simp_attrs 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

Diff
@@ -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.
 -/
chore: fix grammar 2/3 (#5002)

Part 2 of #5001

Diff
@@ -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
chore: fix typos (#4518)

I ran codespell Mathlib and got tired halfway through the suggestions.

Diff
@@ -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' :=
feat: add Mathlib.Tactic.Common, and import (#4056)

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>

Diff
@@ -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
chore: fix some names in comments (#3276)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -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'
chore: add missing #align statements (#1902)

This PR is the result of a slight variant on the following "algorithm"

  • take all mathlib 3 names, remove _ and make all uppercase letters into lowercase
  • take all mathlib 4 names, remove _ and make all uppercase letters into lowercase
  • look for matches, and create pairs (original_lean3_name, OriginalLean4Name)
  • for pairs that do not have an align statement:
    • use Lean 4 to lookup the file + position of the Lean 4 name
    • add an #align statement just before the next empty line
  • manually fix some tiny mistakes (e.g., empty lines in proofs might cause the #align statement to have been inserted too early)
Diff
@@ -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
chore: remove iff_self from simp only after lean4#1933 (#1406)

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

Diff
@@ -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 :=
chore: add source headers to ported theory files (#1094)

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

Diff
@@ -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

Dependencies

1 files ported (100.0%)
207 lines ported (100.0%)

All dependencies are ported!