data.sigma.basic
⟷
Mathlib.Data.Sigma.Basic
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ 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.Meta.Univs
+import Meta.Univs
import Mathbin.Tactic.Lint.Default
-import Mathbin.Tactic.Ext
-import Mathbin.Logic.Function.Basic
+import Tactic.Ext
+import Logic.Function.Basic
#align_import data.sigma.basic from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
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.sigma.basic
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Meta.Univs
import Mathbin.Tactic.Lint.Default
import Mathbin.Tactic.Ext
import Mathbin.Logic.Function.Basic
+#align_import data.sigma.basic from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
+
/-!
# Sigma types
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -59,25 +59,33 @@ instance [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq (β a)] : DecidableE
| b₁, b₂, is_false n => isFalse fun h => Sigma.noConfusion h fun e₁ e₂ => n <| eq_of_hEq e₂
| a₁, _, a₂, _, is_false n => isFalse fun h => Sigma.noConfusion h fun e₁ e₂ => n e₁
+#print Sigma.mk.inj_iff /-
-- sometimes the built-in injectivity support does not work
@[simp, nolint simp_nf]
theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
Sigma.mk a₁ b₁ = ⟨a₂, b₂⟩ ↔ a₁ = a₂ ∧ HEq b₁ b₂ := by simp
#align sigma.mk.inj_iff Sigma.mk.inj_iff
+-/
+#print Sigma.eta /-
@[simp]
theorem eta : ∀ x : Σ a, β a, Sigma.mk x.1 x.2 = x
| ⟨i, x⟩ => rfl
#align sigma.eta Sigma.eta
+-/
+#print Sigma.ext /-
@[ext]
theorem ext {x₀ x₁ : Sigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by cases x₀;
cases x₁; cases h₀; cases h₁; rfl
#align sigma.ext Sigma.ext
+-/
+#print Sigma.ext_iff /-
theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by cases x₀; cases x₁;
exact Sigma.mk.inj_iff
#align sigma.ext_iff Sigma.ext_iff
+-/
#print Sigma.subtype_ext /-
/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@@ -95,15 +103,19 @@ theorem subtype_ext_iff {β : Type _} {p : α → β → Prop} {x₀ x₁ : Σ a
#align sigma.subtype_ext_iff Sigma.subtype_ext_iff
-/
+#print Sigma.forall /-
@[simp]
theorem forall {p : (Σ a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b => h ⟨a, b⟩, fun h ⟨a, b⟩ => h a b⟩
#align sigma.forall Sigma.forall
+-/
+#print Sigma.exists /-
@[simp]
theorem exists {p : (Σ a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ => ⟨a, b, h⟩, fun ⟨a, b, h⟩ => ⟨⟨a, b⟩, h⟩⟩
#align sigma.exists Sigma.exists
+-/
#print Sigma.map /-
/-- Map the left and right components of a sigma -/
@@ -120,6 +132,7 @@ theorem sigma_mk_injective {i : α} : Function.Injective (@Sigma.mk α β i)
#align sigma_mk_injective sigma_mk_injective
-/
+#print Function.Injective.sigma_map /-
theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Injective f₁) (h₂ : ∀ a, Function.Injective (f₂ a)) :
Function.Injective (Sigma.map f₁ f₂)
@@ -128,18 +141,24 @@ theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
obtain rfl : x = y; exact h₂ i (sigma_mk_injective h)
rfl
#align function.injective.sigma_map Function.Injective.sigma_map
+-/
+#print Function.Injective.of_sigma_map /-
theorem Function.Injective.of_sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h : Function.Injective (Sigma.map f₁ f₂)) (a : α₁) : Function.Injective (f₂ a) :=
fun x y hxy => sigma_mk_injective <| @h ⟨a, x⟩ ⟨a, y⟩ (Sigma.ext rfl (heq_iff_eq.2 hxy))
#align function.injective.of_sigma_map Function.Injective.of_sigma_map
+-/
+#print Function.Injective.sigma_map_iff /-
theorem Function.Injective.sigma_map_iff {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Injective f₁) :
Function.Injective (Sigma.map f₁ f₂) ↔ ∀ a, Function.Injective (f₂ a) :=
⟨fun h => h.of_sigma_map, h₁.sigma_map⟩
#align function.injective.sigma_map_iff Function.Injective.sigma_map_iff
+-/
+#print Function.Surjective.sigma_map /-
theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Surjective f₁) (h₂ : ∀ a, Function.Surjective (f₂ a)) :
Function.Surjective (Sigma.map f₁ f₂) :=
@@ -147,6 +166,7 @@ theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
simp only [Function.Surjective, Sigma.forall, h₁.forall]
exact fun i => (h₂ _).forall.2 fun x => ⟨⟨i, x⟩, rfl⟩
#align function.surjective.sigma_map Function.Surjective.sigma_map
+-/
#print Sigma.curry /-
/-- Interpret a function on `Σ x : α, β x` as a dependent function with two arguments.
@@ -166,17 +186,21 @@ def Sigma.uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y)
#align sigma.uncurry Sigma.uncurry
-/
+#print Sigma.uncurry_curry /-
@[simp]
theorem Sigma.uncurry_curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) :
Sigma.uncurry (Sigma.curry f) = f :=
funext fun ⟨i, j⟩ => rfl
#align sigma.uncurry_curry Sigma.uncurry_curry
+-/
+#print Sigma.curry_uncurry /-
@[simp]
theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) :
Sigma.curry (Sigma.uncurry f) = f :=
rfl
#align sigma.curry_uncurry Sigma.curry_uncurry
+-/
#print Prod.toSigma /-
/-- Convert a product type to a Σ-type. -/
@@ -185,25 +209,33 @@ def Prod.toSigma {α β} (p : α × β) : Σ _ : α, β :=
#align prod.to_sigma Prod.toSigma
-/
+#print Prod.fst_comp_toSigma /-
@[simp]
theorem Prod.fst_comp_toSigma {α β} : Sigma.fst ∘ @Prod.toSigma α β = Prod.fst :=
rfl
#align prod.fst_comp_to_sigma Prod.fst_comp_toSigma
+-/
+#print Prod.fst_toSigma /-
@[simp]
theorem Prod.fst_toSigma {α β} (x : α × β) : (Prod.toSigma x).fst = x.fst :=
rfl
#align prod.fst_to_sigma Prod.fst_toSigma
+-/
+#print Prod.snd_toSigma /-
@[simp]
theorem Prod.snd_toSigma {α β} (x : α × β) : (Prod.toSigma x).snd = x.snd :=
rfl
#align prod.snd_to_sigma Prod.snd_toSigma
+-/
+#print Prod.toSigma_mk /-
@[simp]
theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩ :=
rfl
#align prod.to_sigma_mk Prod.toSigma_mk
+-/
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
-- we generate this manually as `@[derive has_reflect]` fails
@@ -233,10 +265,12 @@ def elim {γ} (f : ∀ a, β a → γ) (a : PSigma β) : γ :=
#align psigma.elim PSigma.elim
-/
+#print PSigma.elim_val /-
@[simp]
theorem elim_val {γ} (f : ∀ a, β a → γ) (a b) : PSigma.elim f ⟨a, b⟩ = f a b :=
rfl
#align psigma.elim_val PSigma.elim_val
+-/
instance [Inhabited α] [Inhabited (β default)] : Inhabited (PSigma β) :=
⟨⟨default, default⟩⟩
@@ -250,31 +284,41 @@ instance [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq (β a)] : DecidableE
| b₁, b₂, is_false n => isFalse fun h => PSigma.noConfusion h fun e₁ e₂ => n <| eq_of_hEq e₂
| a₁, _, a₂, _, is_false n => isFalse fun h => PSigma.noConfusion h fun e₁ e₂ => n e₁
+#print PSigma.mk.inj_iff /-
theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
@PSigma.mk α β a₁ b₁ = @PSigma.mk α β a₂ b₂ ↔ a₁ = a₂ ∧ HEq b₁ b₂ :=
Iff.intro PSigma.mk.inj fun ⟨h₁, h₂⟩ =>
match a₁, a₂, b₁, b₂, h₁, h₂ with
| _, _, _, _, Eq.refl a, HEq.refl b => rfl
#align psigma.mk.inj_iff PSigma.mk.inj_iff
+-/
+#print PSigma.ext /-
@[ext]
theorem ext {x₀ x₁ : PSigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by cases x₀;
cases x₁; cases h₀; cases h₁; rfl
#align psigma.ext PSigma.ext
+-/
+#print PSigma.ext_iff /-
theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by cases x₀; cases x₁;
exact PSigma.mk.inj_iff
#align psigma.ext_iff PSigma.ext_iff
+-/
+#print PSigma.forall /-
@[simp]
theorem forall {p : (Σ' a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b => h ⟨a, b⟩, fun h ⟨a, b⟩ => h a b⟩
#align psigma.forall PSigma.forall
+-/
+#print PSigma.exists /-
@[simp]
theorem exists {p : (Σ' a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ => ⟨a, b, h⟩, fun ⟨a, b, h⟩ => ⟨⟨a, b⟩, h⟩⟩
#align psigma.exists PSigma.exists
+-/
#print PSigma.subtype_ext /-
/-- A specialized ext lemma for equality of psigma types over an indexed subtype. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -66,7 +66,7 @@ theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
#align sigma.mk.inj_iff Sigma.mk.inj_iff
@[simp]
-theorem eta : ∀ x : Σa, β a, Sigma.mk x.1 x.2 = x
+theorem eta : ∀ x : Σ a, β a, Sigma.mk x.1 x.2 = x
| ⟨i, x⟩ => rfl
#align sigma.eta Sigma.eta
@@ -83,25 +83,25 @@ theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq
/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Type _} {p : α → β → Prop} :
- ∀ {x₀ x₁ : Σa, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
+ ∀ {x₀ x₁ : Σ a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
| ⟨a₀, b₀, hb₀⟩, ⟨a₁, b₁, hb₁⟩, rfl, rfl => rfl
#align sigma.subtype_ext Sigma.subtype_ext
-/
#print Sigma.subtype_ext_iff /-
-theorem subtype_ext_iff {β : Type _} {p : α → β → Prop} {x₀ x₁ : Σa, Subtype (p a)} :
+theorem subtype_ext_iff {β : Type _} {p : α → β → Prop} {x₀ x₁ : Σ a, Subtype (p a)} :
x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd :=
⟨fun h => h ▸ ⟨rfl, rfl⟩, fun ⟨h₁, h₂⟩ => subtype_ext h₁ h₂⟩
#align sigma.subtype_ext_iff Sigma.subtype_ext_iff
-/
@[simp]
-theorem forall {p : (Σa, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
+theorem forall {p : (Σ a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b => h ⟨a, b⟩, fun h ⟨a, b⟩ => h a b⟩
#align sigma.forall Sigma.forall
@[simp]
-theorem exists {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
+theorem exists {p : (Σ a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ => ⟨a, b, h⟩, fun ⟨a, b, h⟩ => ⟨⟨a, b⟩, h⟩⟩
#align sigma.exists Sigma.exists
@@ -180,7 +180,7 @@ theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x
#print Prod.toSigma /-
/-- Convert a product type to a Σ-type. -/
-def Prod.toSigma {α β} (p : α × β) : Σ_ : α, β :=
+def Prod.toSigma {α β} (p : α × β) : Σ _ : α, β :=
⟨p.1, p.2⟩
#align prod.to_sigma Prod.toSigma
-/
@@ -210,7 +210,7 @@ theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩
@[instance]
protected unsafe def sigma.reflect.{u, v} [Lean.ToLevel.{u}] [Lean.ToLevel.{v}] {α : Type u}
(β : α → Type v) [reflected _ α] [reflected _ β] [hα : has_reflect α]
- [hβ : ∀ i, has_reflect (β i)] : has_reflect (Σa, β a) := fun ⟨a, b⟩ =>
+ [hβ : ∀ i, has_reflect (β i)] : has_reflect (Σ a, β a) := fun ⟨a, b⟩ =>
(by
trace
"./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
@@ -267,12 +267,12 @@ theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HE
#align psigma.ext_iff PSigma.ext_iff
@[simp]
-theorem forall {p : (Σ'a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
+theorem forall {p : (Σ' a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b => h ⟨a, b⟩, fun h ⟨a, b⟩ => h a b⟩
#align psigma.forall PSigma.forall
@[simp]
-theorem exists {p : (Σ'a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
+theorem exists {p : (Σ' a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ => ⟨a, b, h⟩, fun ⟨a, b, h⟩ => ⟨⟨a, b⟩, h⟩⟩
#align psigma.exists PSigma.exists
@@ -280,13 +280,13 @@ theorem exists {p : (Σ'a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b
/-- A specialized ext lemma for equality of psigma types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Sort _} {p : α → β → Prop} :
- ∀ {x₀ x₁ : Σ'a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
+ ∀ {x₀ x₁ : Σ' a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
| ⟨a₀, b₀, hb₀⟩, ⟨a₁, b₁, hb₁⟩, rfl, rfl => rfl
#align psigma.subtype_ext PSigma.subtype_ext
-/
#print PSigma.subtype_ext_iff /-
-theorem subtype_ext_iff {β : Sort _} {p : α → β → Prop} {x₀ x₁ : Σ'a, Subtype (p a)} :
+theorem subtype_ext_iff {β : Sort _} {p : α → β → Prop} {x₀ x₁ : Σ' a, Subtype (p a)} :
x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd :=
⟨fun h => h ▸ ⟨rfl, rfl⟩, fun ⟨h₁, h₂⟩ => subtype_ext h₁ h₂⟩
#align psigma.subtype_ext_iff PSigma.subtype_ext_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -59,46 +59,22 @@ instance [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq (β a)] : DecidableE
| b₁, b₂, is_false n => isFalse fun h => Sigma.noConfusion h fun e₁ e₂ => n <| eq_of_hEq e₂
| a₁, _, a₂, _, is_false n => isFalse fun h => Sigma.noConfusion h fun e₁ e₂ => n e₁
-/- warning: sigma.mk.inj_iff -> Sigma.mk.inj_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {a₁ : α} {a₂ : α} {b₁ : β a₁} {b₂ : β a₂}, Iff (Eq.{max (succ u1) (succ u2)} (Sigma.{u1, u2} α (fun {a₁ : α} => β a₁)) (Sigma.mk.{u1, u2} α (fun {a₁ : α} => β a₁) a₁ b₁) (Sigma.mk.{u1, u2} α (fun {a₁ : α} => β a₁) a₂ b₂)) (And (Eq.{succ u1} α a₁ a₂) (HEq.{succ u2} (β a₁) b₁ (β a₂) b₂))
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {a₁ : α} {a₂ : α} {b₁ : β a₁} {b₂ : β a₂}, Iff (Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α β) (Sigma.mk.{u2, u1} α β a₁ b₁) (Sigma.mk.{u2, u1} α β a₂ b₂)) (And (Eq.{succ u2} α a₁ a₂) (HEq.{succ u1} (β a₁) b₁ (β a₂) b₂))
-Case conversion may be inaccurate. Consider using '#align sigma.mk.inj_iff Sigma.mk.inj_iffₓ'. -/
-- sometimes the built-in injectivity support does not work
@[simp, nolint simp_nf]
theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
Sigma.mk a₁ b₁ = ⟨a₂, b₂⟩ ↔ a₁ = a₂ ∧ HEq b₁ b₂ := by simp
#align sigma.mk.inj_iff Sigma.mk.inj_iff
-/- warning: sigma.eta -> Sigma.eta is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} (x : Sigma.{u1, u2} α (fun (a : α) => β a)), Eq.{max (succ u1) (succ u2)} (Sigma.{u1, u2} α β) (Sigma.mk.{u1, u2} α β (Sigma.fst.{u1, u2} α (fun (a : α) => β a) x) (Sigma.snd.{u1, u2} α (fun (a : α) => β a) x)) x
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} (x : Sigma.{u2, u1} α (fun (a : α) => β a)), Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α β) (Sigma.mk.{u2, u1} α β (Sigma.fst.{u2, u1} α (fun (a : α) => β a) x) (Sigma.snd.{u2, u1} α (fun (a : α) => β a) x)) x
-Case conversion may be inaccurate. Consider using '#align sigma.eta Sigma.etaₓ'. -/
@[simp]
theorem eta : ∀ x : Σa, β a, Sigma.mk x.1 x.2 = x
| ⟨i, x⟩ => rfl
#align sigma.eta Sigma.eta
-/- warning: sigma.ext -> Sigma.ext is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {x₀ : Sigma.{u1, u2} α β} {x₁ : Sigma.{u1, u2} α β}, (Eq.{succ u1} α (Sigma.fst.{u1, u2} α β x₀) (Sigma.fst.{u1, u2} α β x₁)) -> (HEq.{succ u2} (β (Sigma.fst.{u1, u2} α β x₀)) (Sigma.snd.{u1, u2} α β x₀) (β (Sigma.fst.{u1, u2} α β x₁)) (Sigma.snd.{u1, u2} α β x₁)) -> (Eq.{max (succ u1) (succ u2)} (Sigma.{u1, u2} α β) x₀ x₁)
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {x₀ : Sigma.{u2, u1} α β} {x₁ : Sigma.{u2, u1} α β}, (Eq.{succ u2} α (Sigma.fst.{u2, u1} α β x₀) (Sigma.fst.{u2, u1} α β x₁)) -> (HEq.{succ u1} (β (Sigma.fst.{u2, u1} α β x₀)) (Sigma.snd.{u2, u1} α β x₀) (β (Sigma.fst.{u2, u1} α β x₁)) (Sigma.snd.{u2, u1} α β x₁)) -> (Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α β) x₀ x₁)
-Case conversion may be inaccurate. Consider using '#align sigma.ext Sigma.extₓ'. -/
@[ext]
theorem ext {x₀ x₁ : Sigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by cases x₀;
cases x₁; cases h₀; cases h₁; rfl
#align sigma.ext Sigma.ext
-/- warning: sigma.ext_iff -> Sigma.ext_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {x₀ : Sigma.{u1, u2} α β} {x₁ : Sigma.{u1, u2} α β}, Iff (Eq.{max (succ u1) (succ u2)} (Sigma.{u1, u2} α β) x₀ x₁) (And (Eq.{succ u1} α (Sigma.fst.{u1, u2} α β x₀) (Sigma.fst.{u1, u2} α β x₁)) (HEq.{succ u2} (β (Sigma.fst.{u1, u2} α β x₀)) (Sigma.snd.{u1, u2} α β x₀) (β (Sigma.fst.{u1, u2} α β x₁)) (Sigma.snd.{u1, u2} α β x₁)))
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {x₀ : Sigma.{u2, u1} α β} {x₁ : Sigma.{u2, u1} α β}, Iff (Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α β) x₀ x₁) (And (Eq.{succ u2} α (Sigma.fst.{u2, u1} α β x₀) (Sigma.fst.{u2, u1} α β x₁)) (HEq.{succ u1} (β (Sigma.fst.{u2, u1} α β x₀)) (Sigma.snd.{u2, u1} α β x₀) (β (Sigma.fst.{u2, u1} α β x₁)) (Sigma.snd.{u2, u1} α β x₁)))
-Case conversion may be inaccurate. Consider using '#align sigma.ext_iff Sigma.ext_iffₓ'. -/
theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by cases x₀; cases x₁;
exact Sigma.mk.inj_iff
#align sigma.ext_iff Sigma.ext_iff
@@ -119,23 +95,11 @@ theorem subtype_ext_iff {β : Type _} {p : α → β → Prop} {x₀ x₁ : Σa,
#align sigma.subtype_ext_iff Sigma.subtype_ext_iff
-/
-/- warning: sigma.forall -> Sigma.forall is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {p : (Sigma.{u1, u2} α (fun (a : α) => β a)) -> Prop}, Iff (forall (x : Sigma.{u1, u2} α (fun (a : α) => β a)), p x) (forall (a : α) (b : β a), p (Sigma.mk.{u1, u2} α (fun (a : α) => β a) a b))
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {p : (Sigma.{u2, u1} α (fun (a : α) => β a)) -> Prop}, Iff (forall (x : Sigma.{u2, u1} α (fun (a : α) => β a)), p x) (forall (a : α) (b : β a), p (Sigma.mk.{u2, u1} α (fun (a : α) => β a) a b))
-Case conversion may be inaccurate. Consider using '#align sigma.forall Sigma.forallₓ'. -/
@[simp]
theorem forall {p : (Σa, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b => h ⟨a, b⟩, fun h ⟨a, b⟩ => h a b⟩
#align sigma.forall Sigma.forall
-/- warning: sigma.exists -> Sigma.exists is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {p : (Sigma.{u1, u2} α (fun (a : α) => β a)) -> Prop}, Iff (Exists.{max (succ u1) (succ u2)} (Sigma.{u1, u2} α (fun (a : α) => β a)) (fun (x : Sigma.{u1, u2} α (fun (a : α) => β a)) => p x)) (Exists.{succ u1} α (fun (a : α) => Exists.{succ u2} (β a) (fun (b : β a) => p (Sigma.mk.{u1, u2} α (fun (a : α) => β a) a b))))
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {p : (Sigma.{u2, u1} α (fun (a : α) => β a)) -> Prop}, Iff (Exists.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α (fun (a : α) => β a)) (fun (x : Sigma.{u2, u1} α (fun (a : α) => β a)) => p x)) (Exists.{succ u2} α (fun (a : α) => Exists.{succ u1} (β a) (fun (b : β a) => p (Sigma.mk.{u2, u1} α (fun (a : α) => β a) a b))))
-Case conversion may be inaccurate. Consider using '#align sigma.exists Sigma.existsₓ'. -/
@[simp]
theorem exists {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ => ⟨a, b, h⟩, fun ⟨a, b, h⟩ => ⟨⟨a, b⟩, h⟩⟩
@@ -156,12 +120,6 @@ theorem sigma_mk_injective {i : α} : Function.Injective (@Sigma.mk α β i)
#align sigma_mk_injective sigma_mk_injective
-/
-/- warning: function.injective.sigma_map -> Function.Injective.sigma_map is a dubious translation:
-lean 3 declaration is
- forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : α₁ -> Type.{u3}} {β₂ : α₂ -> Type.{u4}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Injective.{succ u1, succ u2} α₁ α₂ f₁) -> (forall (a : α₁), Function.Injective.{succ u3, succ u4} (β₁ a) (β₂ (f₁ a)) (f₂ a)) -> (Function.Injective.{max (succ u1) (succ u3), max (succ u2) (succ u4)} (Sigma.{u1, u3} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u2, u4} α₂ β₂) (Sigma.map.{u1, u2, u3, u4} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂))
-but is expected to have type
- forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : α₁ -> Type.{u2}} {β₂ : α₂ -> Type.{u1}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Injective.{succ u4, succ u3} α₁ α₂ f₁) -> (forall (a : α₁), Function.Injective.{succ u2, succ u1} (β₁ a) (β₂ (f₁ a)) (f₂ a)) -> (Function.Injective.{max (succ u2) (succ u4), max (succ u1) (succ u3)} (Sigma.{u4, u2} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u3, u1} α₂ β₂) (Sigma.map.{u4, u3, u2, u1} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂))
-Case conversion may be inaccurate. Consider using '#align function.injective.sigma_map Function.Injective.sigma_mapₓ'. -/
theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Injective f₁) (h₂ : ∀ a, Function.Injective (f₂ a)) :
Function.Injective (Sigma.map f₁ f₂)
@@ -171,35 +129,17 @@ theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
rfl
#align function.injective.sigma_map Function.Injective.sigma_map
-/- warning: function.injective.of_sigma_map -> Function.Injective.of_sigma_map is a dubious translation:
-lean 3 declaration is
- forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : α₁ -> Type.{u3}} {β₂ : α₂ -> Type.{u4}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Injective.{max (succ u1) (succ u3), max (succ u2) (succ u4)} (Sigma.{u1, u3} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u2, u4} α₂ β₂) (Sigma.map.{u1, u2, u3, u4} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂)) -> (forall (a : α₁), Function.Injective.{succ u3, succ u4} (β₁ a) (β₂ (f₁ a)) (f₂ a))
-but is expected to have type
- forall {α₁ : Type.{u3}} {α₂ : Type.{u1}} {β₁ : α₁ -> Type.{u4}} {β₂ : α₂ -> Type.{u2}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Injective.{max (succ u4) (succ u3), max (succ u2) (succ u1)} (Sigma.{u3, u4} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u1, u2} α₂ β₂) (Sigma.map.{u3, u1, u4, u2} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂)) -> (forall (a : α₁), Function.Injective.{succ u4, succ u2} (β₁ a) (β₂ (f₁ a)) (f₂ a))
-Case conversion may be inaccurate. Consider using '#align function.injective.of_sigma_map Function.Injective.of_sigma_mapₓ'. -/
theorem Function.Injective.of_sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h : Function.Injective (Sigma.map f₁ f₂)) (a : α₁) : Function.Injective (f₂ a) :=
fun x y hxy => sigma_mk_injective <| @h ⟨a, x⟩ ⟨a, y⟩ (Sigma.ext rfl (heq_iff_eq.2 hxy))
#align function.injective.of_sigma_map Function.Injective.of_sigma_map
-/- warning: function.injective.sigma_map_iff -> Function.Injective.sigma_map_iff is a dubious translation:
-lean 3 declaration is
- forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : α₁ -> Type.{u3}} {β₂ : α₂ -> Type.{u4}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Injective.{succ u1, succ u2} α₁ α₂ f₁) -> (Iff (Function.Injective.{max (succ u1) (succ u3), max (succ u2) (succ u4)} (Sigma.{u1, u3} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u2, u4} α₂ β₂) (Sigma.map.{u1, u2, u3, u4} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂)) (forall (a : α₁), Function.Injective.{succ u3, succ u4} (β₁ a) (β₂ (f₁ a)) (f₂ a)))
-but is expected to have type
- forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : α₁ -> Type.{u2}} {β₂ : α₂ -> Type.{u1}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Injective.{succ u4, succ u3} α₁ α₂ f₁) -> (Iff (Function.Injective.{max (succ u2) (succ u4), max (succ u1) (succ u3)} (Sigma.{u4, u2} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u3, u1} α₂ β₂) (Sigma.map.{u4, u3, u2, u1} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂)) (forall (a : α₁), Function.Injective.{succ u2, succ u1} (β₁ a) (β₂ (f₁ a)) (f₂ a)))
-Case conversion may be inaccurate. Consider using '#align function.injective.sigma_map_iff Function.Injective.sigma_map_iffₓ'. -/
theorem Function.Injective.sigma_map_iff {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Injective f₁) :
Function.Injective (Sigma.map f₁ f₂) ↔ ∀ a, Function.Injective (f₂ a) :=
⟨fun h => h.of_sigma_map, h₁.sigma_map⟩
#align function.injective.sigma_map_iff Function.Injective.sigma_map_iff
-/- warning: function.surjective.sigma_map -> Function.Surjective.sigma_map is a dubious translation:
-lean 3 declaration is
- forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : α₁ -> Type.{u3}} {β₂ : α₂ -> Type.{u4}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Surjective.{succ u1, succ u2} α₁ α₂ f₁) -> (forall (a : α₁), Function.Surjective.{succ u3, succ u4} (β₁ a) (β₂ (f₁ a)) (f₂ a)) -> (Function.Surjective.{max (succ u1) (succ u3), max (succ u2) (succ u4)} (Sigma.{u1, u3} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u2, u4} α₂ β₂) (Sigma.map.{u1, u2, u3, u4} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂))
-but is expected to have type
- forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : α₁ -> Type.{u2}} {β₂ : α₂ -> Type.{u1}} {f₁ : α₁ -> α₂} {f₂ : forall (a : α₁), (β₁ a) -> (β₂ (f₁ a))}, (Function.Surjective.{succ u4, succ u3} α₁ α₂ f₁) -> (forall (a : α₁), Function.Surjective.{succ u2, succ u1} (β₁ a) (β₂ (f₁ a)) (f₂ a)) -> (Function.Surjective.{max (succ u2) (succ u4), max (succ u1) (succ u3)} (Sigma.{u4, u2} α₁ (fun (a : α₁) => β₁ a)) (Sigma.{u3, u1} α₂ β₂) (Sigma.map.{u4, u3, u2, u1} α₁ α₂ (fun (a : α₁) => β₁ a) β₂ f₁ f₂))
-Case conversion may be inaccurate. Consider using '#align function.surjective.sigma_map Function.Surjective.sigma_mapₓ'. -/
theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Surjective f₁) (h₂ : ∀ a, Function.Surjective (f₂ a)) :
Function.Surjective (Sigma.map f₁ f₂) :=
@@ -226,24 +166,12 @@ def Sigma.uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y)
#align sigma.uncurry Sigma.uncurry
-/
-/- warning: sigma.uncurry_curry -> Sigma.uncurry_curry is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {γ : forall (a : α), (β a) -> Type.{u3}} (f : forall (x : Sigma.{u1, u2} α β), γ (Sigma.fst.{u1, u2} α β x) (Sigma.snd.{u1, u2} α β x)), Eq.{max (max (succ u1) (succ u2)) (succ u3)} (forall (x : Sigma.{u1, u2} α (fun (x : α) => β x)), γ (Sigma.fst.{u1, u2} α (fun (x : α) => β x) x) (Sigma.snd.{u1, u2} α (fun (x : α) => β x) x)) (Sigma.uncurry.{u1, u2, u3} α (fun (x : α) => β x) (fun (x : α) (y : β x) => γ x y) (Sigma.curry.{u1, u2, u3} α β γ f)) f
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {γ : forall (a : α), (β a) -> Type.{u3}} (f : forall (x : Sigma.{u2, u1} α β), γ (Sigma.fst.{u2, u1} α β x) (Sigma.snd.{u2, u1} α β x)), Eq.{max (max (succ u2) (succ u1)) (succ u3)} (forall (x : Sigma.{u2, u1} α (fun (x : α) => β x)), γ (Sigma.fst.{u2, u1} α (fun (x : α) => β x) x) (Sigma.snd.{u2, u1} α (fun (x : α) => β x) x)) (Sigma.uncurry.{u2, u1, u3} α (fun (x : α) => β x) (fun (x : α) (y : β x) => γ x y) (Sigma.curry.{u2, u1, u3} α β γ f)) f
-Case conversion may be inaccurate. Consider using '#align sigma.uncurry_curry Sigma.uncurry_curryₓ'. -/
@[simp]
theorem Sigma.uncurry_curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) :
Sigma.uncurry (Sigma.curry f) = f :=
funext fun ⟨i, j⟩ => rfl
#align sigma.uncurry_curry Sigma.uncurry_curry
-/- warning: sigma.curry_uncurry -> Sigma.curry_uncurry is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} {γ : forall (a : α), (β a) -> Type.{u3}} (f : forall (x : α) (y : β x), γ x y), Eq.{max (succ u1) (succ u2) (succ u3)} (forall (x : α) (y : β x), γ x y) (Sigma.curry.{u1, u2, u3} α (fun (x : α) => β x) (fun (x : α) (y : β x) => γ x y) (Sigma.uncurry.{u1, u2, u3} α (fun (x : α) => β x) (fun (x : α) (y : β x) => γ x y) f)) f
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} {γ : forall (a : α), (β a) -> Type.{u3}} (f : forall (x : α) (y : β x), γ x y), Eq.{max (max (succ u2) (succ u1)) (succ u3)} (forall (x : α) (y : β x), γ x y) (Sigma.curry.{u2, u1, u3} α (fun (x : α) => β x) (fun (x : α) (y : β x) => γ x y) (Sigma.uncurry.{u2, u1, u3} α (fun (x : α) => β x) (fun (x : α) (y : β x) => γ x y) f)) f
-Case conversion may be inaccurate. Consider using '#align sigma.curry_uncurry Sigma.curry_uncurryₓ'. -/
@[simp]
theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) :
Sigma.curry (Sigma.uncurry f) = f :=
@@ -257,45 +185,21 @@ def Prod.toSigma {α β} (p : α × β) : Σ_ : α, β :=
#align prod.to_sigma Prod.toSigma
-/
-/- warning: prod.fst_comp_to_sigma -> Prod.fst_comp_toSigma is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}}, Eq.{max (succ u1) (succ u2)} ((Prod.{u1, u2} α β) -> α) (Function.comp.{max (succ u1) (succ u2), max (succ u1) (succ u2), succ u1} (Prod.{u1, u2} α β) (Sigma.{u1, u2} α (fun (_x : α) => β)) α (Sigma.fst.{u1, u2} α (fun (_x : α) => β)) (Prod.toSigma.{u1, u2} α β)) (Prod.fst.{u1, u2} α β)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}}, Eq.{max (succ u1) (succ u2)} ((Prod.{u2, u1} α β) -> α) (Function.comp.{max (succ u1) (succ u2), max (succ u1) (succ u2), succ u2} (Prod.{u2, u1} α β) (Sigma.{u2, u1} α (fun (_x : α) => β)) α (Sigma.fst.{u2, u1} α (fun (_x : α) => β)) (Prod.toSigma.{u2, u1} α β)) (Prod.fst.{u2, u1} α β)
-Case conversion may be inaccurate. Consider using '#align prod.fst_comp_to_sigma Prod.fst_comp_toSigmaₓ'. -/
@[simp]
theorem Prod.fst_comp_toSigma {α β} : Sigma.fst ∘ @Prod.toSigma α β = Prod.fst :=
rfl
#align prod.fst_comp_to_sigma Prod.fst_comp_toSigma
-/- warning: prod.fst_to_sigma -> Prod.fst_toSigma is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (x : Prod.{u1, u2} α β), Eq.{succ u1} α (Sigma.fst.{u1, u2} α (fun (_x : α) => β) (Prod.toSigma.{u1, u2} α β x)) (Prod.fst.{u1, u2} α β x)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (x : Prod.{u2, u1} α β), Eq.{succ u2} α (Sigma.fst.{u2, u1} α (fun (_x : α) => β) (Prod.toSigma.{u2, u1} α β x)) (Prod.fst.{u2, u1} α β x)
-Case conversion may be inaccurate. Consider using '#align prod.fst_to_sigma Prod.fst_toSigmaₓ'. -/
@[simp]
theorem Prod.fst_toSigma {α β} (x : α × β) : (Prod.toSigma x).fst = x.fst :=
rfl
#align prod.fst_to_sigma Prod.fst_toSigma
-/- warning: prod.snd_to_sigma -> Prod.snd_toSigma is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (x : Prod.{u1, u2} α β), Eq.{succ u2} β (Sigma.snd.{u1, u2} α (fun (_x : α) => β) (Prod.toSigma.{u1, u2} α β x)) (Prod.snd.{u1, u2} α β x)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (x : Prod.{u2, u1} α β), Eq.{succ u1} β (Sigma.snd.{u2, u1} α (fun (_x : α) => β) (Prod.toSigma.{u2, u1} α β x)) (Prod.snd.{u2, u1} α β x)
-Case conversion may be inaccurate. Consider using '#align prod.snd_to_sigma Prod.snd_toSigmaₓ'. -/
@[simp]
theorem Prod.snd_toSigma {α β} (x : α × β) : (Prod.toSigma x).snd = x.snd :=
rfl
#align prod.snd_to_sigma Prod.snd_toSigma
-/- warning: prod.to_sigma_mk -> Prod.toSigma_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (x : α) (y : β), Eq.{max (succ u1) (succ u2)} (Sigma.{u1, u2} α (fun (_x : α) => β)) (Prod.toSigma.{u1, u2} α β (Prod.mk.{u1, u2} α β x y)) (Sigma.mk.{u1, u2} α (fun (_x : α) => β) x y)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (x : α) (y : β), Eq.{max (succ u1) (succ u2)} (Sigma.{u2, u1} α (fun (_x : α) => β)) (Prod.toSigma.{u2, u1} α β (Prod.mk.{u2, u1} α β x y)) (Sigma.mk.{u2, u1} α (fun (_x : α) => β) x y)
-Case conversion may be inaccurate. Consider using '#align prod.to_sigma_mk Prod.toSigma_mkₓ'. -/
@[simp]
theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩ :=
rfl
@@ -329,12 +233,6 @@ def elim {γ} (f : ∀ a, β a → γ) (a : PSigma β) : γ :=
#align psigma.elim PSigma.elim
-/
-/- warning: psigma.elim_val -> PSigma.elim_val is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Sort.{u2}} {γ : Sort.{u3}} (f : forall (a : α), (β a) -> γ) (a : α) (b : β a), Eq.{u3} γ (PSigma.elim.{u1, u2, u3} α (fun (a : α) => β a) γ f (PSigma.mk.{u1, u2} α (fun (a : α) => β a) a b)) (f a b)
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {γ : Sort.{u3}} (f : forall (a : α), (β a) -> γ) (a : α) (b : β a), Eq.{u3} γ (PSigma.elim.{u2, u1, u3} α (fun (a : α) => β a) γ f (PSigma.mk.{u2, u1} α (fun (a : α) => β a) a b)) (f a b)
-Case conversion may be inaccurate. Consider using '#align psigma.elim_val PSigma.elim_valₓ'. -/
@[simp]
theorem elim_val {γ} (f : ∀ a, β a → γ) (a b) : PSigma.elim f ⟨a, b⟩ = f a b :=
rfl
@@ -352,12 +250,6 @@ instance [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq (β a)] : DecidableE
| b₁, b₂, is_false n => isFalse fun h => PSigma.noConfusion h fun e₁ e₂ => n <| eq_of_hEq e₂
| a₁, _, a₂, _, is_false n => isFalse fun h => PSigma.noConfusion h fun e₁ e₂ => n e₁
-/- warning: psigma.mk.inj_iff -> PSigma.mk.inj_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Sort.{u2}} {a₁ : α} {a₂ : α} {b₁ : β a₁} {b₂ : β a₂}, Iff (Eq.{max 1 u1 u2} (PSigma.{u1, u2} α β) (PSigma.mk.{u1, u2} α β a₁ b₁) (PSigma.mk.{u1, u2} α β a₂ b₂)) (And (Eq.{u1} α a₁ a₂) (HEq.{u2} (β a₁) b₁ (β a₂) b₂))
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {a₁ : α} {a₂ : α} {b₁ : β a₁} {b₂ : β a₂}, Iff (Eq.{max (max 1 u2) u1} (PSigma.{u2, u1} α β) (PSigma.mk.{u2, u1} α β a₁ b₁) (PSigma.mk.{u2, u1} α β a₂ b₂)) (And (Eq.{u2} α a₁ a₂) (HEq.{u1} (β a₁) b₁ (β a₂) b₂))
-Case conversion may be inaccurate. Consider using '#align psigma.mk.inj_iff PSigma.mk.inj_iffₓ'. -/
theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
@PSigma.mk α β a₁ b₁ = @PSigma.mk α β a₂ b₂ ↔ a₁ = a₂ ∧ HEq b₁ b₂ :=
Iff.intro PSigma.mk.inj fun ⟨h₁, h₂⟩ =>
@@ -365,44 +257,20 @@ theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
| _, _, _, _, Eq.refl a, HEq.refl b => rfl
#align psigma.mk.inj_iff PSigma.mk.inj_iff
-/- warning: psigma.ext -> PSigma.ext is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Sort.{u2}} {x₀ : PSigma.{u1, u2} α β} {x₁ : PSigma.{u1, u2} α β}, (Eq.{u1} α (PSigma.fst.{u1, u2} α β x₀) (PSigma.fst.{u1, u2} α β x₁)) -> (HEq.{u2} (β (PSigma.fst.{u1, u2} α β x₀)) (PSigma.snd.{u1, u2} α β x₀) (β (PSigma.fst.{u1, u2} α β x₁)) (PSigma.snd.{u1, u2} α β x₁)) -> (Eq.{max 1 u1 u2} (PSigma.{u1, u2} α β) x₀ x₁)
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {x₀ : PSigma.{u2, u1} α β} {x₁ : PSigma.{u2, u1} α β}, (Eq.{u2} α (PSigma.fst.{u2, u1} α β x₀) (PSigma.fst.{u2, u1} α β x₁)) -> (HEq.{u1} (β (PSigma.fst.{u2, u1} α β x₀)) (PSigma.snd.{u2, u1} α β x₀) (β (PSigma.fst.{u2, u1} α β x₁)) (PSigma.snd.{u2, u1} α β x₁)) -> (Eq.{max (max 1 u2) u1} (PSigma.{u2, u1} α β) x₀ x₁)
-Case conversion may be inaccurate. Consider using '#align psigma.ext PSigma.extₓ'. -/
@[ext]
theorem ext {x₀ x₁ : PSigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by cases x₀;
cases x₁; cases h₀; cases h₁; rfl
#align psigma.ext PSigma.ext
-/- warning: psigma.ext_iff -> PSigma.ext_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Sort.{u2}} {x₀ : PSigma.{u1, u2} α β} {x₁ : PSigma.{u1, u2} α β}, Iff (Eq.{max 1 u1 u2} (PSigma.{u1, u2} α β) x₀ x₁) (And (Eq.{u1} α (PSigma.fst.{u1, u2} α β x₀) (PSigma.fst.{u1, u2} α β x₁)) (HEq.{u2} (β (PSigma.fst.{u1, u2} α β x₀)) (PSigma.snd.{u1, u2} α β x₀) (β (PSigma.fst.{u1, u2} α β x₁)) (PSigma.snd.{u1, u2} α β x₁)))
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {x₀ : PSigma.{u2, u1} α β} {x₁ : PSigma.{u2, u1} α β}, Iff (Eq.{max (max 1 u2) u1} (PSigma.{u2, u1} α β) x₀ x₁) (And (Eq.{u2} α (PSigma.fst.{u2, u1} α β x₀) (PSigma.fst.{u2, u1} α β x₁)) (HEq.{u1} (β (PSigma.fst.{u2, u1} α β x₀)) (PSigma.snd.{u2, u1} α β x₀) (β (PSigma.fst.{u2, u1} α β x₁)) (PSigma.snd.{u2, u1} α β x₁)))
-Case conversion may be inaccurate. Consider using '#align psigma.ext_iff PSigma.ext_iffₓ'. -/
theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by cases x₀; cases x₁;
exact PSigma.mk.inj_iff
#align psigma.ext_iff PSigma.ext_iff
-/- warning: psigma.forall -> PSigma.forall is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Sort.{u2}} {p : (PSigma.{u1, u2} α (fun (a : α) => β a)) -> Prop}, Iff (forall (x : PSigma.{u1, u2} α (fun (a : α) => β a)), p x) (forall (a : α) (b : β a), p (PSigma.mk.{u1, u2} α (fun (a : α) => β a) a b))
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {p : (PSigma.{u2, u1} α (fun (a : α) => β a)) -> Prop}, Iff (forall (x : PSigma.{u2, u1} α (fun (a : α) => β a)), p x) (forall (a : α) (b : β a), p (PSigma.mk.{u2, u1} α (fun (a : α) => β a) a b))
-Case conversion may be inaccurate. Consider using '#align psigma.forall PSigma.forallₓ'. -/
@[simp]
theorem forall {p : (Σ'a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b => h ⟨a, b⟩, fun h ⟨a, b⟩ => h a b⟩
#align psigma.forall PSigma.forall
-/- warning: psigma.exists -> PSigma.exists is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : α -> Sort.{u2}} {p : (PSigma.{u1, u2} α (fun (a : α) => β a)) -> Prop}, Iff (Exists.{max 1 u1 u2} (PSigma.{u1, u2} α (fun (a : α) => β a)) (fun (x : PSigma.{u1, u2} α (fun (a : α) => β a)) => p x)) (Exists.{u1} α (fun (a : α) => Exists.{u2} (β a) (fun (b : β a) => p (PSigma.mk.{u1, u2} α (fun (a : α) => β a) a b))))
-but is expected to have type
- forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {p : (PSigma.{u2, u1} α (fun (a : α) => β a)) -> Prop}, Iff (Exists.{max (max 1 u2) u1} (PSigma.{u2, u1} α (fun (a : α) => β a)) (fun (x : PSigma.{u2, u1} α (fun (a : α) => β a)) => p x)) (Exists.{u2} α (fun (a : α) => Exists.{u1} (β a) (fun (b : β a) => p (PSigma.mk.{u2, u1} α (fun (a : α) => β a) a b))))
-Case conversion may be inaccurate. Consider using '#align psigma.exists PSigma.existsₓ'. -/
@[simp]
theorem exists {p : (Σ'a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ => ⟨a, b, h⟩, fun ⟨a, b, h⟩ => ⟨⟨a, b⟩, h⟩⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -89,13 +89,8 @@ but is expected to have type
forall {α : Type.{u2}} {β : α -> Type.{u1}} {x₀ : Sigma.{u2, u1} α β} {x₁ : Sigma.{u2, u1} α β}, (Eq.{succ u2} α (Sigma.fst.{u2, u1} α β x₀) (Sigma.fst.{u2, u1} α β x₁)) -> (HEq.{succ u1} (β (Sigma.fst.{u2, u1} α β x₀)) (Sigma.snd.{u2, u1} α β x₀) (β (Sigma.fst.{u2, u1} α β x₁)) (Sigma.snd.{u2, u1} α β x₁)) -> (Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α β) x₀ x₁)
Case conversion may be inaccurate. Consider using '#align sigma.ext Sigma.extₓ'. -/
@[ext]
-theorem ext {x₀ x₁ : Sigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ :=
- by
- cases x₀
- cases x₁
- cases h₀
- cases h₁
- rfl
+theorem ext {x₀ x₁ : Sigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by cases x₀;
+ cases x₁; cases h₀; cases h₁; rfl
#align sigma.ext Sigma.ext
/- warning: sigma.ext_iff -> Sigma.ext_iff is a dubious translation:
@@ -104,10 +99,7 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u2}} {β : α -> Type.{u1}} {x₀ : Sigma.{u2, u1} α β} {x₁ : Sigma.{u2, u1} α β}, Iff (Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α β) x₀ x₁) (And (Eq.{succ u2} α (Sigma.fst.{u2, u1} α β x₀) (Sigma.fst.{u2, u1} α β x₁)) (HEq.{succ u1} (β (Sigma.fst.{u2, u1} α β x₀)) (Sigma.snd.{u2, u1} α β x₀) (β (Sigma.fst.{u2, u1} α β x₁)) (Sigma.snd.{u2, u1} α β x₁)))
Case conversion may be inaccurate. Consider using '#align sigma.ext_iff Sigma.ext_iffₓ'. -/
-theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 :=
- by
- cases x₀
- cases x₁
+theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by cases x₀; cases x₁;
exact Sigma.mk.inj_iff
#align sigma.ext_iff Sigma.ext_iff
@@ -380,13 +372,8 @@ but is expected to have type
forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {x₀ : PSigma.{u2, u1} α β} {x₁ : PSigma.{u2, u1} α β}, (Eq.{u2} α (PSigma.fst.{u2, u1} α β x₀) (PSigma.fst.{u2, u1} α β x₁)) -> (HEq.{u1} (β (PSigma.fst.{u2, u1} α β x₀)) (PSigma.snd.{u2, u1} α β x₀) (β (PSigma.fst.{u2, u1} α β x₁)) (PSigma.snd.{u2, u1} α β x₁)) -> (Eq.{max (max 1 u2) u1} (PSigma.{u2, u1} α β) x₀ x₁)
Case conversion may be inaccurate. Consider using '#align psigma.ext PSigma.extₓ'. -/
@[ext]
-theorem ext {x₀ x₁ : PSigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ :=
- by
- cases x₀
- cases x₁
- cases h₀
- cases h₁
- rfl
+theorem ext {x₀ x₁ : PSigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by cases x₀;
+ cases x₁; cases h₀; cases h₁; rfl
#align psigma.ext PSigma.ext
/- warning: psigma.ext_iff -> PSigma.ext_iff is a dubious translation:
@@ -395,10 +382,7 @@ lean 3 declaration is
but is expected to have type
forall {α : Sort.{u2}} {β : α -> Sort.{u1}} {x₀ : PSigma.{u2, u1} α β} {x₁ : PSigma.{u2, u1} α β}, Iff (Eq.{max (max 1 u2) u1} (PSigma.{u2, u1} α β) x₀ x₁) (And (Eq.{u2} α (PSigma.fst.{u2, u1} α β x₀) (PSigma.fst.{u2, u1} α β x₁)) (HEq.{u1} (β (PSigma.fst.{u2, u1} α β x₀)) (PSigma.snd.{u2, u1} α β x₀) (β (PSigma.fst.{u2, u1} α β x₁)) (PSigma.snd.{u2, u1} α β x₁)))
Case conversion may be inaccurate. Consider using '#align psigma.ext_iff PSigma.ext_iffₓ'. -/
-theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 :=
- by
- cases x₀
- cases x₁
+theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by cases x₀; cases x₁;
exact PSigma.mk.inj_iff
#align psigma.ext_iff PSigma.ext_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/347636a7a80595d55bedf6e6fbd996a3c39da69a
@@ -312,7 +312,7 @@ theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
-- we generate this manually as `@[derive has_reflect]` fails
@[instance]
-protected unsafe def sigma.reflect.{u, v} [reflected_univ.{u}] [reflected_univ.{v}] {α : Type u}
+protected unsafe def sigma.reflect.{u, v} [Lean.ToLevel.{u}] [Lean.ToLevel.{v}] {α : Type u}
(β : α → Type v) [reflected _ α] [reflected _ β] [hα : has_reflect α]
[hβ : ∀ i, has_reflect (β i)] : has_reflect (Σa, β a) := fun ⟨a, b⟩ =>
(by
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -309,7 +309,7 @@ theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩
rfl
#align prod.to_sigma_mk Prod.toSigma_mk
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
-- we generate this manually as `@[derive has_reflect]` fails
@[instance]
protected unsafe def sigma.reflect.{u, v} [reflected_univ.{u}] [reflected_univ.{v}] {α : Type u}
@@ -317,7 +317,7 @@ protected unsafe def sigma.reflect.{u, v} [reflected_univ.{u}] [reflected_univ.{
[hβ : ∀ i, has_reflect (β i)] : has_reflect (Σa, β a) := fun ⟨a, b⟩ =>
(by
trace
- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[]" :
+ "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @Sigma.mk.{u, v}).subst₄
q(α) q(β) q(a) q(b)
#align sigma.reflect sigma.reflect
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
could not infer motive
(#11302)
These are not all; most of these porting notes are still real.
@@ -56,7 +56,7 @@ instance instDecidableEqSigma [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq
@[simp] -- @[nolint simpNF]
theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
Sigma.mk a₁ b₁ = ⟨a₂, b₂⟩ ↔ a₁ = a₂ ∧ HEq b₁ b₂ :=
- ⟨fun h ↦ by cases h; exact ⟨rfl, heq_of_eq rfl⟩, -- in Lean 3 `simp` solved this
+ ⟨fun h ↦ by cases h; simp,
fun ⟨h₁, h₂⟩ ↦ by subst h₁; rw [eq_of_heq h₂]⟩
#align sigma.mk.inj_iff Sigma.mk.inj_iff
λ
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.@@ -56,8 +56,8 @@ instance instDecidableEqSigma [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq
@[simp] -- @[nolint simpNF]
theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
Sigma.mk a₁ b₁ = ⟨a₂, b₂⟩ ↔ a₁ = a₂ ∧ HEq b₁ b₂ :=
- ⟨λ h => by cases h; exact ⟨rfl, heq_of_eq rfl⟩, -- in Lean 3 `simp` solved this
- λ ⟨h₁, h₂⟩ => by subst h₁; rw [eq_of_heq h₂]⟩
+ ⟨fun h ↦ by cases h; exact ⟨rfl, heq_of_eq rfl⟩, -- in Lean 3 `simp` solved this
+ fun ⟨h₁, h₂⟩ ↦ by subst h₁; rw [eq_of_heq h₂]⟩
#align sigma.mk.inj_iff Sigma.mk.inj_iff
@[simp]
@@ -102,10 +102,10 @@ theorem «exists» {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a
#align sigma.exists Sigma.exists
lemma exists' {p : ∀ a, β a → Prop} : (∃ a b, p a b) ↔ ∃ x : Σ a, β a, p x.1 x.2 :=
- (Sigma.exists (p := λ x ↦ p x.1 x.2)).symm
+ (Sigma.exists (p := fun x ↦ p x.1 x.2)).symm
lemma forall' {p : ∀ a, β a → Prop} : (∀ a b, p a b) ↔ ∀ x : Σ a, β a, p x.1 x.2 :=
- (Sigma.forall (p := λ x ↦ p x.1 x.2)).symm
+ (Sigma.forall (p := fun x ↦ p x.1 x.2)).symm
theorem _root_.sigma_mk_injective {i : α} : Injective (@Sigma.mk α β i)
| _, _, rfl => rfl
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Init.Function
-import Std.Tactic.Ext
import Mathlib.Logic.Function.Basic
#align_import data.sigma.basic from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64"
Sigma.fst_surjective
etc (#9914)
Sigma.fst_surjective
, Sigma.fst_surjective_iff
,
Sigma.fst_injective
, and Sigma.fst_injective_iff
.sigma_mk_injective
up.Function
namespace, drop Function.
.@@ -32,6 +32,8 @@ types. To that effect, we have `PSigma`, which takes value in `Sort*` and carrie
complicated universe signature as a consequence.
-/
+open Function
+
section Sigma
variable {α α₁ α₂ : Type*} {β : α → Type*} {β₁ : α₁ → Type*} {β₂ : α₂ → Type*}
@@ -76,7 +78,7 @@ theorem _root_.Function.eq_of_sigmaMk_comp {γ : Type*} [Nonempty γ]
a = b ∧ HEq f g := by
rcases ‹Nonempty γ› with ⟨i⟩
obtain rfl : a = b := congr_arg Sigma.fst (congr_fun h i)
- simpa [Function.funext_iff] using h
+ simpa [funext_iff] using h
/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@[ext]
@@ -101,10 +103,27 @@ theorem «exists» {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a
#align sigma.exists Sigma.exists
lemma exists' {p : ∀ a, β a → Prop} : (∃ a b, p a b) ↔ ∃ x : Σ a, β a, p x.1 x.2 :=
-(Sigma.exists (p := λ x ↦ p x.1 x.2)).symm
+ (Sigma.exists (p := λ x ↦ p x.1 x.2)).symm
lemma forall' {p : ∀ a, β a → Prop} : (∀ a b, p a b) ↔ ∀ x : Σ a, β a, p x.1 x.2 :=
-(Sigma.forall (p := λ x ↦ p x.1 x.2)).symm
+ (Sigma.forall (p := λ x ↦ p x.1 x.2)).symm
+
+theorem _root_.sigma_mk_injective {i : α} : Injective (@Sigma.mk α β i)
+ | _, _, rfl => rfl
+#align sigma_mk_injective sigma_mk_injective
+
+theorem fst_surjective [h : ∀ a, Nonempty (β a)] : Surjective (fst : (Σ a, β a) → α) := fun a ↦
+ let ⟨b⟩ := h a; ⟨⟨a, b⟩, rfl⟩
+
+theorem fst_surjective_iff : Surjective (fst : (Σ a, β a) → α) ↔ ∀ a, Nonempty (β a) :=
+ ⟨fun h a ↦ let ⟨x, hx⟩ := h a; hx ▸ ⟨x.2⟩, @fst_surjective _ _⟩
+
+theorem fst_injective [h : ∀ a, Subsingleton (β a)] : Injective (fst : (Σ a, β a) → α) := by
+ rintro ⟨a₁, b₁⟩ ⟨a₂, b₂⟩ (rfl : a₁ = a₂)
+ exact congr_arg (mk a₁) <| Subsingleton.elim _ _
+
+theorem fst_injective_iff : Injective (fst : (Σ a, β a) → α) ↔ ∀ a, Subsingleton (β a) :=
+ ⟨fun h _ ↦ ⟨fun _ _ ↦ sigma_mk_injective <| h rfl⟩, @fst_injective _ _⟩
/-- Map the left and right components of a sigma -/
def map (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) (x : Sigma β₁) : Sigma β₂ :=
@@ -115,13 +134,8 @@ lemma map_mk (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a))
map f₁ f₂ ⟨x, y⟩ = ⟨f₁ x, f₂ x y⟩ := rfl
end Sigma
-theorem sigma_mk_injective {i : α} : Function.Injective (@Sigma.mk α β i)
- | _, _, rfl => rfl
-#align sigma_mk_injective sigma_mk_injective
-
theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h₁ : Function.Injective f₁) (h₂ : ∀ a, Function.Injective (f₂ a)) :
- Function.Injective (Sigma.map f₁ f₂)
+ (h₁ : Injective f₁) (h₂ : ∀ a, Injective (f₂ a)) : Injective (Sigma.map f₁ f₂)
| ⟨i, x⟩, ⟨j, y⟩, h => by
obtain rfl : i = j := h₁ (Sigma.mk.inj_iff.mp h).1
obtain rfl : x = y := h₂ i (sigma_mk_injective h)
@@ -129,21 +143,18 @@ theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
#align function.injective.sigma_map Function.Injective.sigma_map
theorem Function.Injective.of_sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h : Function.Injective (Sigma.map f₁ f₂)) (a : α₁) : Function.Injective (f₂ a) :=
- fun x y hxy ↦
+ (h : Injective (Sigma.map f₁ f₂)) (a : α₁) : Injective (f₂ a) := fun x y hxy ↦
sigma_mk_injective <| @h ⟨a, x⟩ ⟨a, y⟩ (Sigma.ext rfl (heq_of_eq hxy))
#align function.injective.of_sigma_map Function.Injective.of_sigma_map
theorem Function.Injective.sigma_map_iff {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h₁ : Function.Injective f₁) :
- Function.Injective (Sigma.map f₁ f₂) ↔ ∀ a, Function.Injective (f₂ a) :=
+ (h₁ : Injective f₁) : Injective (Sigma.map f₁ f₂) ↔ ∀ a, Injective (f₂ a) :=
⟨fun h ↦ h.of_sigma_map, h₁.sigma_map⟩
#align function.injective.sigma_map_iff Function.Injective.sigma_map_iff
theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h₁ : Function.Surjective f₁) (h₂ : ∀ a, Function.Surjective (f₂ a)) :
- Function.Surjective (Sigma.map f₁ f₂) := by
- simp only [Function.Surjective, Sigma.forall, h₁.forall]
+ (h₁ : Surjective f₁) (h₂ : ∀ a, Surjective (f₂ a)) : Surjective (Sigma.map f₁ f₂) := by
+ simp only [Surjective, Sigma.forall, h₁.forall]
exact fun i ↦ (h₂ _).forall.2 fun x ↦ ⟨⟨i, x⟩, rfl⟩
#align function.surjective.sigma_map Function.Surjective.sigma_map
@@ -64,9 +64,6 @@ theorem eta : ∀ x : Σa, β a, Sigma.mk x.1 x.2 = x
| ⟨_, _⟩ => rfl
#align sigma.eta Sigma.eta
-@[ext]
-theorem ext {x₀ x₁ : Sigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by
- cases x₀; cases x₁; cases h₀; cases h₁; rfl
#align sigma.ext Sigma.ext
theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by
@@ -243,9 +240,6 @@ theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
| _, _, _, _, Eq.refl _, HEq.refl _ => rfl
#align psigma.mk.inj_iff PSigma.mk.inj_iff
-@[ext]
-theorem ext {x₀ x₁ : PSigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by
- cases x₀; cases x₁; cases h₀; cases h₁; rfl
#align psigma.ext PSigma.ext
theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by
@@ -123,7 +123,7 @@ theorem sigma_mk_injective {i : α} : Function.Injective (@Sigma.mk α β i)
#align sigma_mk_injective sigma_mk_injective
theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h₁ : Function.Injective f₁) (h₂ : ∀ a, Function.Injective (f₂ a)) :
+ (h₁ : Function.Injective f₁) (h₂ : ∀ a, Function.Injective (f₂ a)) :
Function.Injective (Sigma.map f₁ f₂)
| ⟨i, x⟩, ⟨j, y⟩, h => by
obtain rfl : i = j := h₁ (Sigma.mk.inj_iff.mp h).1
@@ -138,13 +138,13 @@ theorem Function.Injective.of_sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a,
#align function.injective.of_sigma_map Function.Injective.of_sigma_map
theorem Function.Injective.sigma_map_iff {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h₁ : Function.Injective f₁) :
+ (h₁ : Function.Injective f₁) :
Function.Injective (Sigma.map f₁ f₂) ↔ ∀ a, Function.Injective (f₂ a) :=
⟨fun h ↦ h.of_sigma_map, h₁.sigma_map⟩
#align function.injective.sigma_map_iff Function.Injective.sigma_map_iff
theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
- (h₁ : Function.Surjective f₁) (h₂ : ∀ a, Function.Surjective (f₂ a)) :
+ (h₁ : Function.Surjective f₁) (h₂ : ∀ a, Function.Surjective (f₂ a)) :
Function.Surjective (Sigma.map f₁ f₂) := by
simp only [Function.Surjective, Sigma.forall, h₁.forall]
exact fun i ↦ (h₂ _).forall.2 fun x ↦ ⟨⟨i, x⟩, rfl⟩
WithTop
lemmas (#6947)
and corresponding lemmas for ℕ∞
.
Also fix implicitness of iff
lemmas.
@@ -103,6 +103,12 @@ theorem «exists» {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a
⟨fun ⟨⟨a, b⟩, h⟩ ↦ ⟨a, b, h⟩, fun ⟨a, b, h⟩ ↦ ⟨⟨a, b⟩, h⟩⟩
#align sigma.exists Sigma.exists
+lemma exists' {p : ∀ a, β a → Prop} : (∃ a b, p a b) ↔ ∃ x : Σ a, β a, p x.1 x.2 :=
+(Sigma.exists (p := λ x ↦ p x.1 x.2)).symm
+
+lemma forall' {p : ∀ a, β a → Prop} : (∀ a b, p a b) ↔ ∀ x : Σ a, β a, p x.1 x.2 :=
+(Sigma.forall (p := λ x ↦ p x.1 x.2)).symm
+
/-- Map the left and right components of a sigma -/
def map (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) (x : Sigma β₁) : Sigma β₂ :=
⟨f₁ x.1, f₂ x.1 x.2⟩
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -15,26 +15,26 @@ import Mathlib.Logic.Function.Basic
This file proves basic results about sigma types.
A sigma type is a dependent pair type. Like `α × β` but where the type of the second component
-depends on the first component. More precisely, given `β : ι → Type _`, `Sigma β` is made of stuff
+depends on the first component. More precisely, given `β : ι → Type*`, `Sigma β` is made of stuff
which is of type `β i` for some `i : ι`, so the sigma type is a disjoint union of types.
For example, the sum type `X ⊕ Y` can be emulated using a sigma type, by taking `ι` with
exactly two elements (see `Equiv.sumEquivSigmaBool`).
`Σ x, A x` is notation for `Sigma A` (note that this is `\Sigma`, not the sum operator `∑`).
`Σ x y z ..., A x y z ...` is notation for `Σ x, Σ y, Σ z, ..., A x y z ...`. Here we have
-`α : Type _`, `β : α → Type _`, `γ : Π a : α, β a → Type _`, ...,
-`A : Π (a : α) (b : β a) (c : γ a b) ..., Type _` with `x : α` `y : β x`, `z : γ x y`, ...
+`α : Type*`, `β : α → Type*`, `γ : Π a : α, β a → Type*`, ...,
+`A : Π (a : α) (b : β a) (c : γ a b) ..., Type*` with `x : α` `y : β x`, `z : γ x y`, ...
## Notes
-The definition of `Sigma` takes values in `Type _`. This effectively forbids `Prop`- valued sigma
-types. To that effect, we have `PSigma`, which takes value in `Sort _` and carries a more
+The definition of `Sigma` takes values in `Type*`. This effectively forbids `Prop`- valued sigma
+types. To that effect, we have `PSigma`, which takes value in `Sort*` and carries a more
complicated universe signature as a consequence.
-/
section Sigma
-variable {α α₁ α₂ : Type _} {β : α → Type _} {β₁ : α₁ → Type _} {β₂ : α₂ → Type _}
+variable {α α₁ α₂ : Type*} {β : α → Type*} {β₁ : α₁ → Type*} {β₂ : α₂ → Type*}
namespace Sigma
@@ -74,7 +74,7 @@ theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq
#align sigma.ext_iff Sigma.ext_iff
/-- A version of `Iff.mp Sigma.ext_iff` for functions from a nonempty type to a sigma type. -/
-theorem _root_.Function.eq_of_sigmaMk_comp {γ : Type _} [Nonempty γ]
+theorem _root_.Function.eq_of_sigmaMk_comp {γ : Type*} [Nonempty γ]
{a b : α} {f : γ → β a} {g : γ → β b} (h : Sigma.mk a ∘ f = Sigma.mk b ∘ g) :
a = b ∧ HEq f g := by
rcases ‹Nonempty γ› with ⟨i⟩
@@ -83,12 +83,12 @@ theorem _root_.Function.eq_of_sigmaMk_comp {γ : Type _} [Nonempty γ]
/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@[ext]
-theorem subtype_ext {β : Type _} {p : α → β → Prop} :
+theorem subtype_ext {β : Type*} {p : α → β → Prop} :
∀ {x₀ x₁ : Σa, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
| ⟨_, _, _⟩, ⟨_, _, _⟩, rfl, rfl => rfl
#align sigma.subtype_ext Sigma.subtype_ext
-theorem subtype_ext_iff {β : Type _} {p : α → β → Prop} {x₀ x₁ : Σa, Subtype (p a)} :
+theorem subtype_ext_iff {β : Type*} {p : α → β → Prop} {x₀ x₁ : Σa, Subtype (p a)} :
x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd :=
⟨fun h ↦ h ▸ ⟨rfl, rfl⟩, fun ⟨h₁, h₂⟩ ↦ subtype_ext h₁ h₂⟩
#align sigma.subtype_ext_iff Sigma.subtype_ext_iff
@@ -147,25 +147,25 @@ theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
/-- Interpret a function on `Σ x : α, β x` as a dependent function with two arguments.
This also exists as an `Equiv` as `Equiv.piCurry γ`. -/
-def Sigma.curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) (x : α) (y : β x) : γ x y :=
+def Sigma.curry {γ : ∀ a, β a → Type*} (f : ∀ x : Sigma β, γ x.1 x.2) (x : α) (y : β x) : γ x y :=
f ⟨x, y⟩
#align sigma.curry Sigma.curry
/-- Interpret a dependent function with two arguments as a function on `Σ x : α, β x`.
This also exists as an `Equiv` as `(Equiv.piCurry γ).symm`. -/
-def Sigma.uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) (x : Sigma β) : γ x.1 x.2 :=
+def Sigma.uncurry {γ : ∀ a, β a → Type*} (f : ∀ (x) (y : β x), γ x y) (x : Sigma β) : γ x.1 x.2 :=
f x.1 x.2
#align sigma.uncurry Sigma.uncurry
@[simp]
-theorem Sigma.uncurry_curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) :
+theorem Sigma.uncurry_curry {γ : ∀ a, β a → Type*} (f : ∀ x : Sigma β, γ x.1 x.2) :
Sigma.uncurry (Sigma.curry f) = f :=
funext fun ⟨_, _⟩ ↦ rfl
#align sigma.uncurry_curry Sigma.uncurry_curry
@[simp]
-theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) :
+theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type*} (f : ∀ (x) (y : β x), γ x y) :
Sigma.curry (Sigma.uncurry f) = f :=
rfl
#align sigma.curry_uncurry Sigma.curry_uncurry
@@ -201,7 +201,7 @@ end Sigma
namespace PSigma
-variable {α : Sort _} {β : α → Sort _}
+variable {α : Sort*} {β : α → Sort*}
/-- Nondependent eliminator for `PSigma`. -/
def elim {γ} (f : ∀ a, β a → γ) (a : PSigma β) : γ :=
@@ -258,17 +258,17 @@ theorem «exists» {p : (Σ'a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨
/-- A specialized ext lemma for equality of `PSigma` types over an indexed subtype. -/
@[ext]
-theorem subtype_ext {β : Sort _} {p : α → β → Prop} :
+theorem subtype_ext {β : Sort*} {p : α → β → Prop} :
∀ {x₀ x₁ : Σ'a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
| ⟨_, _, _⟩, ⟨_, _, _⟩, rfl, rfl => rfl
#align psigma.subtype_ext PSigma.subtype_ext
-theorem subtype_ext_iff {β : Sort _} {p : α → β → Prop} {x₀ x₁ : Σ'a, Subtype (p a)} :
+theorem subtype_ext_iff {β : Sort*} {p : α → β → Prop} {x₀ x₁ : Σ'a, Subtype (p a)} :
x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd :=
⟨fun h ↦ h ▸ ⟨rfl, rfl⟩, fun ⟨h₁, h₂⟩ ↦ subtype_ext h₁ h₂⟩
#align psigma.subtype_ext_iff PSigma.subtype_ext_iff
-variable {α₁ : Sort _} {α₂ : Sort _} {β₁ : α₁ → Sort _} {β₂ : α₂ → Sort _}
+variable {α₁ : Sort*} {α₂ : Sort*} {β₁ : α₁ → Sort*} {β₂ : α₂ → Sort*}
/-- Map the left and right components of a sigma -/
def map (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) : PSigma β₁ → PSigma β₂
Per https://github.com/leanprover/lean4/issues/2343, we are going to need to change the automatic generation of instance names, as they become too long.
This PR ensures that everywhere in Mathlib that refers to an instance by name, that name is given explicitly, rather than being automatically generated.
There are four exceptions, which are now commented, with links to https://github.com/leanprover/lean4/issues/2343.
This was implemented by running Mathlib against a modified Lean that appended _ᾰ
to all automatically generated names, and fixing everything.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -38,10 +38,11 @@ variable {α α₁ α₂ : Type _} {β : α → Type _} {β₁ : α₁ → Type
namespace Sigma
-instance [Inhabited α] [Inhabited (β default)] : Inhabited (Sigma β) :=
+instance instInhabitedSigma [Inhabited α] [Inhabited (β default)] : Inhabited (Sigma β) :=
⟨⟨default, default⟩⟩
-instance [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq (β a)] : DecidableEq (Sigma β)
+instance instDecidableEqSigma [h₁ : DecidableEq α] [h₂ : ∀ a, DecidableEq (β a)] :
+ DecidableEq (Sigma β)
| ⟨a₁, b₁⟩, ⟨a₂, b₂⟩ =>
match a₁, b₁, a₂, b₂, h₁ a₁ a₂ with
| _, b₁, _, b₂, isTrue (Eq.refl _) =>
@@ -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.sigma.basic
-! leanprover-community/mathlib commit a148d797a1094ab554ad4183a4ad6f130358ef64
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Init.Function
import Std.Tactic.Ext
import Mathlib.Logic.Function.Basic
+#align_import data.sigma.basic from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64"
+
/-!
# Sigma types
@@ -26,7 +26,7 @@ exactly two elements (see `Equiv.sumEquivSigmaBool`).
`Σ x, A x` is notation for `Sigma A` (note that this is `\Sigma`, not the sum operator `∑`).
`Σ x y z ..., A x y z ...` is notation for `Σ x, Σ y, Σ z, ..., A x y z ...`. Here we have
`α : Type _`, `β : α → Type _`, `γ : Π a : α, β a → Type _`, ...,
-`A : Π (a : α) (b : β a) (c : γ a b) ..., Type _` with `x : α` `y : β x`, `z : γ x y`, ...
+`A : Π (a : α) (b : β a) (c : γ a b) ..., Type _` with `x : α` `y : β x`, `z : γ x y`, ...
## Notes
Motivated by a theorem in the Brouwer Fixed Point project
@@ -75,6 +75,14 @@ theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq
cases x₀; cases x₁; exact Sigma.mk.inj_iff
#align sigma.ext_iff Sigma.ext_iff
+/-- A version of `Iff.mp Sigma.ext_iff` for functions from a nonempty type to a sigma type. -/
+theorem _root_.Function.eq_of_sigmaMk_comp {γ : Type _} [Nonempty γ]
+ {a b : α} {f : γ → β a} {g : γ → β b} (h : Sigma.mk a ∘ f = Sigma.mk b ∘ g) :
+ a = b ∧ HEq f g := by
+ rcases ‹Nonempty γ› with ⟨i⟩
+ obtain rfl : a = b := congr_arg Sigma.fst (congr_fun h i)
+ simpa [Function.funext_iff] using h
+
/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Type _} {p : α → β → Prop} :
Sigma.map_mk
(#1905)
simp [Sigma.map_mk]
has the same effect in Lean 4 as simp [sigma.map]
has in Lean 3. OTOH, simp [Sigma.map]
unfolds non-applied Sigma.map
s too.
@@ -102,6 +102,8 @@ def map (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) (x :
⟨f₁ x.1, f₂ x.1 x.2⟩
#align sigma.map Sigma.map
+lemma map_mk (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) (x : α₁) (y : β₁ x) :
+ map f₁ f₂ ⟨x, y⟩ = ⟨f₁ x, f₂ x y⟩ := rfl
end Sigma
theorem sigma_mk_injective {i : α} : Function.Injective (@Sigma.mk α β i)
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)@@ -59,44 +59,54 @@ theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
Sigma.mk a₁ b₁ = ⟨a₂, b₂⟩ ↔ a₁ = a₂ ∧ HEq b₁ b₂ :=
⟨λ h => by cases h; exact ⟨rfl, heq_of_eq rfl⟩, -- in Lean 3 `simp` solved this
λ ⟨h₁, h₂⟩ => by subst h₁; rw [eq_of_heq h₂]⟩
+#align sigma.mk.inj_iff Sigma.mk.inj_iff
@[simp]
theorem eta : ∀ x : Σa, β a, Sigma.mk x.1 x.2 = x
| ⟨_, _⟩ => rfl
+#align sigma.eta Sigma.eta
@[ext]
theorem ext {x₀ x₁ : Sigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by
cases x₀; cases x₁; cases h₀; cases h₁; rfl
+#align sigma.ext Sigma.ext
theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by
cases x₀; cases x₁; exact Sigma.mk.inj_iff
+#align sigma.ext_iff Sigma.ext_iff
/-- A specialized ext lemma for equality of sigma types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Type _} {p : α → β → Prop} :
∀ {x₀ x₁ : Σa, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
| ⟨_, _, _⟩, ⟨_, _, _⟩, rfl, rfl => rfl
+#align sigma.subtype_ext Sigma.subtype_ext
theorem subtype_ext_iff {β : Type _} {p : α → β → Prop} {x₀ x₁ : Σa, Subtype (p a)} :
x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd :=
⟨fun h ↦ h ▸ ⟨rfl, rfl⟩, fun ⟨h₁, h₂⟩ ↦ subtype_ext h₁ h₂⟩
+#align sigma.subtype_ext_iff Sigma.subtype_ext_iff
@[simp]
theorem «forall» {p : (Σa, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b ↦ h ⟨a, b⟩, fun h ⟨a, b⟩ ↦ h a b⟩
+#align sigma.forall Sigma.forall
@[simp]
theorem «exists» {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ ↦ ⟨a, b, h⟩, fun ⟨a, b, h⟩ ↦ ⟨⟨a, b⟩, h⟩⟩
+#align sigma.exists Sigma.exists
/-- Map the left and right components of a sigma -/
def map (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) (x : Sigma β₁) : Sigma β₂ :=
⟨f₁ x.1, f₂ x.1 x.2⟩
+#align sigma.map Sigma.map
end Sigma
theorem sigma_mk_injective {i : α} : Function.Injective (@Sigma.mk α β i)
| _, _, rfl => rfl
+#align sigma_mk_injective sigma_mk_injective
theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Injective f₁) (h₂ : ∀ a, Function.Injective (f₂ a)) :
@@ -105,48 +115,57 @@ theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
obtain rfl : i = j := h₁ (Sigma.mk.inj_iff.mp h).1
obtain rfl : x = y := h₂ i (sigma_mk_injective h)
rfl
+#align function.injective.sigma_map Function.Injective.sigma_map
theorem Function.Injective.of_sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h : Function.Injective (Sigma.map f₁ f₂)) (a : α₁) : Function.Injective (f₂ a) :=
fun x y hxy ↦
sigma_mk_injective <| @h ⟨a, x⟩ ⟨a, y⟩ (Sigma.ext rfl (heq_of_eq hxy))
+#align function.injective.of_sigma_map Function.Injective.of_sigma_map
theorem Function.Injective.sigma_map_iff {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Injective f₁) :
Function.Injective (Sigma.map f₁ f₂) ↔ ∀ a, Function.Injective (f₂ a) :=
⟨fun h ↦ h.of_sigma_map, h₁.sigma_map⟩
+#align function.injective.sigma_map_iff Function.Injective.sigma_map_iff
theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
(h₁ : Function.Surjective f₁) (h₂ : ∀ a, Function.Surjective (f₂ a)) :
Function.Surjective (Sigma.map f₁ f₂) := by
simp only [Function.Surjective, Sigma.forall, h₁.forall]
exact fun i ↦ (h₂ _).forall.2 fun x ↦ ⟨⟨i, x⟩, rfl⟩
+#align function.surjective.sigma_map Function.Surjective.sigma_map
/-- Interpret a function on `Σ x : α, β x` as a dependent function with two arguments.
This also exists as an `Equiv` as `Equiv.piCurry γ`. -/
def Sigma.curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) (x : α) (y : β x) : γ x y :=
f ⟨x, y⟩
+#align sigma.curry Sigma.curry
/-- Interpret a dependent function with two arguments as a function on `Σ x : α, β x`.
This also exists as an `Equiv` as `(Equiv.piCurry γ).symm`. -/
def Sigma.uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) (x : Sigma β) : γ x.1 x.2 :=
f x.1 x.2
+#align sigma.uncurry Sigma.uncurry
@[simp]
theorem Sigma.uncurry_curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) :
Sigma.uncurry (Sigma.curry f) = f :=
funext fun ⟨_, _⟩ ↦ rfl
+#align sigma.uncurry_curry Sigma.uncurry_curry
@[simp]
theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) :
Sigma.curry (Sigma.uncurry f) = f :=
rfl
+#align sigma.curry_uncurry Sigma.curry_uncurry
/-- Convert a product type to a Σ-type. -/
def Prod.toSigma {α β} (p : α × β) : Σ_ : α, β :=
⟨p.1, p.2⟩
+#align prod.to_sigma Prod.toSigma
@[simp]
theorem Prod.fst_comp_toSigma {α β} : Sigma.fst ∘ @Prod.toSigma α β = Prod.fst :=
@@ -179,10 +198,12 @@ variable {α : Sort _} {β : α → Sort _}
/-- Nondependent eliminator for `PSigma`. -/
def elim {γ} (f : ∀ a, β a → γ) (a : PSigma β) : γ :=
PSigma.casesOn a f
+#align psigma.elim PSigma.elim
@[simp]
theorem elim_val {γ} (f : ∀ a, β a → γ) (a b) : PSigma.elim f ⟨a, b⟩ = f a b :=
rfl
+#align psigma.elim_val PSigma.elim_val
instance [Inhabited α] [Inhabited (β default)] : Inhabited (PSigma β) :=
⟨⟨default, default⟩⟩
@@ -206,36 +227,44 @@ theorem mk.inj_iff {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂} :
(Iff.intro PSigma.mk.inj) fun ⟨h₁, h₂⟩ ↦
match a₁, a₂, b₁, b₂, h₁, h₂ with
| _, _, _, _, Eq.refl _, HEq.refl _ => rfl
+#align psigma.mk.inj_iff PSigma.mk.inj_iff
@[ext]
theorem ext {x₀ x₁ : PSigma β} (h₀ : x₀.1 = x₁.1) (h₁ : HEq x₀.2 x₁.2) : x₀ = x₁ := by
cases x₀; cases x₁; cases h₀; cases h₁; rfl
+#align psigma.ext PSigma.ext
theorem ext_iff {x₀ x₁ : PSigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2 := by
cases x₀; cases x₁; exact PSigma.mk.inj_iff
+#align psigma.ext_iff PSigma.ext_iff
@[simp]
theorem «forall» {p : (Σ'a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨a, b⟩ :=
⟨fun h a b ↦ h ⟨a, b⟩, fun h ⟨a, b⟩ ↦ h a b⟩
+#align psigma.forall PSigma.forall
@[simp]
theorem «exists» {p : (Σ'a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ ↦ ⟨a, b, h⟩, fun ⟨a, b, h⟩ ↦ ⟨⟨a, b⟩, h⟩⟩
+#align psigma.exists PSigma.exists
/-- A specialized ext lemma for equality of `PSigma` types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Sort _} {p : α → β → Prop} :
∀ {x₀ x₁ : Σ'a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
| ⟨_, _, _⟩, ⟨_, _, _⟩, rfl, rfl => rfl
+#align psigma.subtype_ext PSigma.subtype_ext
theorem subtype_ext_iff {β : Sort _} {p : α → β → Prop} {x₀ x₁ : Σ'a, Subtype (p a)} :
x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd :=
⟨fun h ↦ h ▸ ⟨rfl, rfl⟩, fun ⟨h₁, h₂⟩ ↦ subtype_ext h₁ h₂⟩
+#align psigma.subtype_ext_iff PSigma.subtype_ext_iff
variable {α₁ : Sort _} {α₂ : Sort _} {β₁ : α₁ → Sort _} {β₂ : α₂ → Sort _}
/-- Map the left and right components of a sigma -/
def map (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) : PSigma β₁ → PSigma β₂
| ⟨a, b⟩ => ⟨f₁ a, f₂ a b⟩
+#align psigma.map PSigma.map
end PSigma
Type*
to Type _
(#1866)
A bunch of docstrings were still mentioning Type*
. This changes them to Type _
.
@@ -18,7 +18,7 @@ import Mathlib.Logic.Function.Basic
This file proves basic results about sigma types.
A sigma type is a dependent pair type. Like `α × β` but where the type of the second component
-depends on the first component. More precisely, given `β : ι → Type*`, `Sigma β` is made of stuff
+depends on the first component. More precisely, given `β : ι → Type _`, `Sigma β` is made of stuff
which is of type `β i` for some `i : ι`, so the sigma type is a disjoint union of types.
For example, the sum type `X ⊕ Y` can be emulated using a sigma type, by taking `ι` with
exactly two elements (see `Equiv.sumEquivSigmaBool`).
@@ -124,13 +124,13 @@ theorem Function.Surjective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β
/-- Interpret a function on `Σ x : α, β x` as a dependent function with two arguments.
-This also exists as an `equiv` as `equiv.Pi_curry γ`. -/
+This also exists as an `Equiv` as `Equiv.piCurry γ`. -/
def Sigma.curry {γ : ∀ a, β a → Type _} (f : ∀ x : Sigma β, γ x.1 x.2) (x : α) (y : β x) : γ x y :=
f ⟨x, y⟩
/-- Interpret a dependent function with two arguments as a function on `Σ x : α, β x`.
-This also exists as an `equiv` as `(equiv.Pi_curry γ).symm`. -/
+This also exists as an `Equiv` as `(Equiv.piCurry γ).symm`. -/
def Sigma.uncurry {γ : ∀ a, β a → Type _} (f : ∀ (x) (y : β x), γ x y) (x : Sigma β) : γ x.1 x.2 :=
f x.1 x.2
@@ -176,7 +176,7 @@ namespace PSigma
variable {α : Sort _} {β : α → Sort _}
-/-- Nondependent eliminator for `psigma`. -/
+/-- Nondependent eliminator for `PSigma`. -/
def elim {γ} (f : ∀ a, β a → γ) (a : PSigma β) : γ :=
PSigma.casesOn a f
@@ -222,7 +222,7 @@ theorem «forall» {p : (Σ'a, β a) → Prop} : (∀ x, p x) ↔ ∀ a b, p ⟨
theorem «exists» {p : (Σ'a, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩ :=
⟨fun ⟨⟨a, b⟩, h⟩ ↦ ⟨a, b, h⟩, fun ⟨a, b, h⟩ ↦ ⟨⟨a, b⟩, h⟩⟩
-/-- A specialized ext lemma for equality of psigma types over an indexed subtype. -/
+/-- A specialized ext lemma for equality of `PSigma` types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Sort _} {p : α → β → Prop} :
∀ {x₀ x₁ : Σ'a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁
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.sigma.basic
+! leanprover-community/mathlib commit a148d797a1094ab554ad4183a4ad6f130358ef64
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Init.Function
import Std.Tactic.Ext
All dependencies are ported!