data.quot
⟷
Mathlib.Data.Quot
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)
(last sync)
trunc
a quotient
(#18320)
This allows us to use quotient
lemmas for trunc
.
mathlib4 PR: https://github.com/leanprover-community/mathlib4/pull/1924
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -365,15 +365,21 @@ lemma nonempty_quotient_iff (s : setoid α) : nonempty (quotient s) ↔ nonempty
/-! ### Truncation -/
+theorem true_equivalence : @equivalence α (λ _ _, true) :=
+⟨λ _, trivial, λ _ _ _, trivial, λ _ _ _ _ _, trivial⟩
+
+/-- Always-true relation as a `setoid`.
+
+Note that in later files the preferred spelling is `⊤ : setoid α`. -/
+def true_setoid : setoid α :=
+⟨_, true_equivalence⟩
+
/-- `trunc α` is the quotient of `α` by the always-true relation. This
is related to the propositional truncation in HoTT, and is similar
in effect to `nonempty α`, but unlike `nonempty α`, `trunc α` is data,
so the VM representation is the same as `α`, and so this can be used to
maintain computability. -/
-def {u} trunc (α : Sort u) : Sort u := @quot α (λ _ _, true)
-
-theorem true_equivalence : @equivalence α (λ _ _, true) :=
-⟨λ _, trivial, λ _ _ _, trivial, λ _ _ _ _ _, trivial⟩
+def {u} trunc (α : Sort u) : Sort u := @quotient α true_setoid
namespace trunc
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ 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.Relator
+import Logic.Relator
#align_import data.quot from "leanprover-community/mathlib"@"6ed6abbde29b8f630001a1b481603f657a3384f1"
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -327,11 +327,11 @@ theorem Quotient.eq' [r : Setoid α] {x y : α} : ⟦x⟧ = ⟦y⟧ ↔ x ≈ y
#align quotient.eq Quotient.eq'
-/
-#print forall_quotient_iff /-
-theorem forall_quotient_iff {α : Type _} [r : Setoid α] {p : Quotient r → Prop} :
+#print Quotient.forall /-
+theorem Quotient.forall {α : Type _} [r : Setoid α] {p : Quotient r → Prop} :
(∀ a : Quotient r, p a) ↔ ∀ a : α, p ⟦a⟧ :=
⟨fun h x => h _, fun h a => a.inductionOn h⟩
-#align forall_quotient_iff forall_quotient_iff
+#align forall_quotient_iff Quotient.forall
-/
#print Quotient.lift_mk /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/001ffdc42920050657fd45bd2b8bfbec8eaaeb29
@@ -384,12 +384,12 @@ theorem surjective_quot_mk (r : α → α → Prop) : Surjective (Quot.mk r) :=
#align surjective_quot_mk surjective_quot_mk
-/
-#print surjective_quotient_mk /-
+#print surjective_quotient_mk' /-
/-- `quotient.mk` is a surjective function. -/
-theorem surjective_quotient_mk (α : Sort _) [s : Setoid α] :
+theorem surjective_quotient_mk' (α : Sort _) [s : Setoid α] :
Surjective (Quotient.mk' : α → Quotient s) :=
Quot.exists_rep
-#align surjective_quotient_mk surjective_quotient_mk
+#align surjective_quotient_mk surjective_quotient_mk'
-/
#print Quot.out /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -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.quot
-! leanprover-community/mathlib commit 6ed6abbde29b8f630001a1b481603f657a3384f1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Logic.Relator
+#align_import data.quot from "leanprover-community/mathlib"@"6ed6abbde29b8f630001a1b481603f657a3384f1"
+
/-!
# Quotient types
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -46,7 +46,6 @@ namespace Quot
variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Quot rb → Sort _}
--- mathport name: mk
local notation:arg "⟦" a "⟧" => Quot.mk _ a
instance (r : α → α → Prop) [Inhabited α] : Inhabited (Quot r) :=
@@ -139,12 +138,14 @@ protected def lift₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂
#align quot.lift₂ Quot.lift₂
-/
+#print Quot.lift₂_mk /-
@[simp]
theorem lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (a : α) (b : β) :
Quot.lift₂ f hr hs (Quot.mk r a) (Quot.mk s b) = f a b :=
rfl
#align quot.lift₂_mk Quot.lift₂_mk
+-/
#print Quot.liftOn₂ /-
/-- Descends a function `f : α → β → γ` to quotients of `α` and `β` and applies it. -/
@@ -155,12 +156,14 @@ protected def liftOn₂ (p : Quot r) (q : Quot s) (f : α → β → γ)
#align quot.lift_on₂ Quot.liftOn₂
-/
+#print Quot.liftOn₂_mk /-
@[simp]
theorem liftOn₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) :
Quot.liftOn₂ (Quot.mk r a) (Quot.mk s b) f hr hs = f a b :=
rfl
#align quot.lift_on₂_mk Quot.liftOn₂_mk
+-/
variable {t : γ → γ → Prop}
@@ -174,12 +177,14 @@ protected def map₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂
#align quot.map₂ Quot.map₂
-/
+#print Quot.map₂_mk /-
@[simp]
theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂))
(hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (a : α) (b : β) :
Quot.map₂ f hr hs (Quot.mk r a) (Quot.mk s b) = Quot.mk t (f a b) :=
rfl
#align quot.map₂_mk Quot.map₂_mk
+-/
#print Quot.recOnSubsingleton₂ /-
/-- A binary version of `quot.rec_on_subsingleton`. -/
@@ -192,17 +197,21 @@ protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort _}
#align quot.rec_on_subsingleton₂ Quot.recOnSubsingleton₂
-/
+#print Quot.induction_on₂ /-
@[elab_as_elim]
protected theorem induction_on₂ {δ : Quot r → Quot s → Prop} (q₁ : Quot r) (q₂ : Quot s)
(h : ∀ a b, δ (Quot.mk r a) (Quot.mk s b)) : δ q₁ q₂ :=
Quot.ind (fun a₁ => Quot.ind (fun a₂ => h a₁ a₂) q₂) q₁
#align quot.induction_on₂ Quot.induction_on₂
+-/
+#print Quot.induction_on₃ /-
@[elab_as_elim]
protected theorem induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (q₁ : Quot r) (q₂ : Quot s)
(q₃ : Quot t) (h : ∀ a b c, δ (Quot.mk r a) (Quot.mk s b) (Quot.mk t c)) : δ q₁ q₂ q₃ :=
Quot.ind (fun a₁ => Quot.ind (fun a₂ => Quot.ind (fun a₃ => h a₁ a₂ a₃) q₃) q₂) q₁
#align quot.induction_on₃ Quot.induction_on₃
+-/
instance (r : α → α → Prop) (f : α → Prop) (h : ∀ a b, r a b → f a = f b) [hf : DecidablePred f] :
DecidablePred (Quot.lift f h) := fun q => Quot.recOnSubsingleton' q hf
@@ -259,11 +268,13 @@ protected def map (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) : Quot
#align quotient.map Quotient.map
-/
+#print Quotient.map_mk /-
@[simp]
theorem map_mk (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) :
Quotient.map f h (⟦x⟧ : Quotient sa) = (⟦f x⟧ : Quotient sb) :=
rfl
#align quotient.map_mk Quotient.map_mk
+-/
variable {γ : Sort _} [sc : Setoid γ]
@@ -277,27 +288,23 @@ protected def map₂ (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·)
#align quotient.map₂ Quotient.map₂
-/
+#print Quotient.map₂_mk /-
@[simp]
theorem map₂_mk (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) (y : β) :
Quotient.map₂ f h (⟦x⟧ : Quotient sa) (⟦y⟧ : Quotient sb) = (⟦f x y⟧ : Quotient sc) :=
rfl
#align quotient.map₂_mk Quotient.map₂_mk
-
-include sa
+-/
instance (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f b) [DecidablePred f] :
DecidablePred (Quotient.lift f h) :=
Quot.lift.decidablePred _ _ _
-include sb
-
/-- Note that this provides `decidable_rel (quotient.lift₂ f h)` when `α = β`. -/
instance (f : α → β → Prop) (h : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂)
[hf : ∀ a, DecidablePred (f a)] (q₁ : Quotient sa) : DecidablePred (Quotient.lift₂ f h q₁) :=
fun q₂ => Quotient.recOnSubsingleton₂ q₁ q₂ hf
-omit sb
-
instance (q : Quotient sa) (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f b) [DecidablePred f] :
Decidable (Quotient.liftOn q f h) :=
Quotient.lift.decidablePred _ _ _
@@ -330,18 +337,23 @@ theorem forall_quotient_iff {α : Type _} [r : Setoid α] {p : Quotient r → Pr
#align forall_quotient_iff forall_quotient_iff
-/
+#print Quotient.lift_mk /-
@[simp]
theorem Quotient.lift_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.lift f h (Quotient.mk' x) = f x :=
rfl
#align quotient.lift_mk Quotient.lift_mk
+-/
+#print Quotient.lift_comp_mk /-
@[simp]
theorem Quotient.lift_comp_mk [Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) :
Quotient.lift f h ∘ Quotient.mk' = f :=
rfl
#align quotient.lift_comp_mk Quotient.lift_comp_mk
+-/
+#print Quotient.lift₂_mk /-
@[simp]
theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α] [Setoid β]
(f : α → β → γ)
@@ -349,19 +361,24 @@ theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α
(b : β) : Quotient.lift₂ f h (Quotient.mk' a) (Quotient.mk' b) = f a b :=
rfl
#align quotient.lift₂_mk Quotient.lift₂_mk
+-/
+#print Quotient.liftOn_mk /-
@[simp]
theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.liftOn (Quotient.mk' x) f h = f x :=
rfl
#align quotient.lift_on_mk Quotient.liftOn_mk
+-/
+#print Quotient.liftOn₂_mk /-
@[simp]
theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α → α → β)
(h : ∀ a₁ a₂ b₁ b₂ : α, a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (x y : α) :
Quotient.liftOn₂ (Quotient.mk' x) (Quotient.mk' y) f h = f x y :=
rfl
#align quotient.lift_on₂_mk Quotient.liftOn₂_mk
+-/
#print surjective_quot_mk /-
/-- `quot.mk r` is a surjective function. -/
@@ -479,12 +496,15 @@ noncomputable def Quotient.choice {ι : Type _} {α : ι → Type _} [S : ∀ i,
#align quotient.choice Quotient.choice
-/
+#print Quotient.choice_eq /-
@[simp]
theorem Quotient.choice_eq {ι : Type _} {α : ι → Type _} [∀ i, Setoid (α i)] (f : ∀ i, α i) :
(Quotient.choice fun i => ⟦f i⟧) = ⟦f⟧ :=
Quotient.sound fun i => Quotient.mk_out _
#align quotient.choice_eq Quotient.choice_eq
+-/
+#print Quotient.induction_on_pi /-
@[elab_as_elim]
theorem Quotient.induction_on_pi {ι : Type _} {α : ι → Sort _} [s : ∀ i, Setoid (α i)]
{p : (∀ i, Quotient (s i)) → Prop} (f : ∀ i, Quotient (s i))
@@ -493,6 +513,7 @@ theorem Quotient.induction_on_pi {ι : Type _} {α : ι → Sort _} [s : ∀ i,
rw [← (funext fun i => Quotient.out_eq (f i) : (fun i => ⟦(f i).out⟧) = f)]
apply h
#align quotient.induction_on_pi Quotient.induction_on_pi
+-/
end Pi
@@ -583,11 +604,13 @@ theorem exists_rep (q : Trunc α) : ∃ a : α, mk a = q :=
#align trunc.exists_rep Trunc.exists_rep
-/
+#print Trunc.induction_on₂ /-
@[elab_as_elim]
protected theorem induction_on₂ {C : Trunc α → Trunc β → Prop} (q₁ : Trunc α) (q₂ : Trunc β)
(h : ∀ a b, C (mk a) (mk b)) : C q₁ q₂ :=
Trunc.induction_on q₁ fun a₁ => Trunc.induction_on q₂ (h a₁)
#align trunc.induction_on₂ Trunc.induction_on₂
+-/
#print Trunc.eq /-
protected theorem eq (a b : Trunc α) : a = b :=
@@ -710,17 +733,21 @@ protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.
#align quotient.lift_on' Quotient.liftOn'
-/
+#print Quotient.liftOn'_mk'' /-
@[simp]
protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
Quotient.liftOn' (@Quotient.mk'' _ s₁ x) f h = f x :=
rfl
#align quotient.lift_on'_mk' Quotient.liftOn'_mk''
+-/
+#print Quotient.surjective_liftOn' /-
@[simp]
theorem surjective_liftOn' {f : α → φ} (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) :
(Surjective fun x => Quotient.liftOn' x f h) ↔ Surjective f :=
Quot.surjective_lift _
#align quotient.surjective_lift_on' Quotient.surjective_liftOn'
+-/
#print Quotient.liftOn₂' /-
/-- A version of `quotient.lift_on₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit arguments
@@ -732,11 +759,13 @@ protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α
#align quotient.lift_on₂' Quotient.liftOn₂'
-/
+#print Quotient.liftOn₂'_mk'' /-
@[simp]
protected theorem liftOn₂'_mk'' (f : α → β → γ) (h) (a : α) (b : β) :
Quotient.liftOn₂' (@Quotient.mk'' _ s₁ a) (@Quotient.mk'' _ s₂ b) f h = f a b :=
rfl
#align quotient.lift_on₂'_mk' Quotient.liftOn₂'_mk''
+-/
#print Quotient.ind' /-
/-- A version of `quotient.ind` taking `{s : setoid α}` as an implicit argument instead of an
@@ -748,6 +777,7 @@ protected theorem ind' {p : Quotient s₁ → Prop} (h : ∀ a, p (Quotient.mk''
#align quotient.ind' Quotient.ind'
-/
+#print Quotient.ind₂' /-
/-- A version of `quotient.ind₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit arguments
instead of instance arguments. -/
@[elab_as_elim]
@@ -756,6 +786,7 @@ protected theorem ind₂' {p : Quotient s₁ → Quotient s₂ → Prop}
p q₁ q₂ :=
Quotient.ind₂ h q₁ q₂
#align quotient.ind₂' Quotient.ind₂'
+-/
#print Quotient.inductionOn' /-
/-- A version of `quotient.induction_on` taking `{s : setoid α}` as an implicit argument instead
@@ -767,6 +798,7 @@ protected theorem inductionOn' {p : Quotient s₁ → Prop} (q : Quotient s₁)
#align quotient.induction_on' Quotient.inductionOn'
-/
+#print Quotient.inductionOn₂' /-
/-- A version of `quotient.induction_on₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit
arguments instead of instance arguments. -/
@[elab_as_elim]
@@ -774,7 +806,9 @@ protected theorem inductionOn₂' {p : Quotient s₁ → Quotient s₂ → Prop}
(q₂ : Quotient s₂) (h : ∀ a₁ a₂, p (Quotient.mk'' a₁) (Quotient.mk'' a₂)) : p q₁ q₂ :=
Quotient.induction_on₂ q₁ q₂ h
#align quotient.induction_on₂' Quotient.inductionOn₂'
+-/
+#print Quotient.inductionOn₃' /-
/-- A version of `quotient.induction_on₃` taking `{s₁ : setoid α} {s₂ : setoid β} {s₃ : setoid γ}`
as implicit arguments instead of instance arguments. -/
@[elab_as_elim]
@@ -783,6 +817,7 @@ protected theorem inductionOn₃' {p : Quotient s₁ → Quotient s₂ → Quoti
(h : ∀ a₁ a₂ a₃, p (Quotient.mk'' a₁) (Quotient.mk'' a₂) (Quotient.mk'' a₃)) : p q₁ q₂ q₃ :=
Quotient.induction_on₃ q₁ q₂ q₃ h
#align quotient.induction_on₃' Quotient.inductionOn₃'
+-/
#print Quotient.recOnSubsingleton' /-
/-- A version of `quotient.rec_on_subsingleton` taking `{s₁ : setoid α}` as an implicit argument
@@ -813,11 +848,13 @@ protected def hrecOn' {φ : Quotient s₁ → Sort _} (qa : Quotient s₁) (f :
#align quotient.hrec_on' Quotient.hrecOn'
-/
+#print Quotient.hrecOn'_mk'' /-
@[simp]
theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk'' a))
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂)) (x : α) : (Quotient.mk'' x).hrecOn' f c = f x :=
rfl
#align quotient.hrec_on'_mk' Quotient.hrecOn'_mk''
+-/
#print Quotient.hrecOn₂' /-
/-- Recursion on two `quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
@@ -828,6 +865,7 @@ protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa :
#align quotient.hrec_on₂' Quotient.hrecOn₂'
-/
+#print Quotient.hrecOn₂'_mk'' /-
@[simp]
theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
(f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b))
@@ -835,6 +873,7 @@ theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
(Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) fun b₁ b₂ => c _ _ _ _ (Setoid.refl _) :=
rfl
#align quotient.hrec_on₂'_mk' Quotient.hrecOn₂'_mk''
+-/
#print Quotient.map' /-
/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements
@@ -844,11 +883,13 @@ protected def map' (f : α → β) (h : (s₁.R ⇒ s₂.R) f f) : Quotient s₁
#align quotient.map' Quotient.map'
-/
+#print Quotient.map'_mk'' /-
@[simp]
theorem map'_mk'' (f : α → β) (h) (x : α) :
(Quotient.mk'' x : Quotient s₁).map' f h = (Quotient.mk'' (f x) : Quotient s₂) :=
rfl
#align quotient.map'_mk' Quotient.map'_mk''
+-/
#print Quotient.map₂' /-
/-- A version of `quotient.map₂` using curly braces and unification. -/
@@ -858,12 +899,14 @@ protected def map₂' (f : α → β → γ) (h : (s₁.R ⇒ s₂.R ⇒ s₃.R)
#align quotient.map₂' Quotient.map₂'
-/
+#print Quotient.map₂'_mk'' /-
@[simp]
theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) :
(Quotient.mk'' x : Quotient s₁).map₂' f h =
(Quotient.map' (f x) (h (Setoid.refl x)) : Quotient s₂ → Quotient s₃) :=
rfl
#align quotient.map₂'_mk' Quotient.map₂'_mk''
+-/
#print Quotient.exact' /-
theorem exact' {a b : α} : (Quotient.mk'' a : Quotient s₁) = Quotient.mk'' b → @Setoid.r _ s₁ a b :=
@@ -913,16 +956,20 @@ protected theorem mk''_eq_mk' (x : α) : Quotient.mk'' x = ⟦x⟧ :=
rfl
#align quotient.mk'_eq_mk Quotient.mk''_eq_mk'
+#print Quotient.liftOn'_mk /-
@[simp]
protected theorem liftOn'_mk (x : α) (f : α → β) (h) : ⟦x⟧.liftOn' f h = f x :=
rfl
#align quotient.lift_on'_mk Quotient.liftOn'_mk
+-/
+#print Quotient.liftOn₂'_mk /-
@[simp]
protected theorem liftOn₂'_mk [Setoid β] (f : α → β → γ) (h) (a : α) (b : β) :
Quotient.liftOn₂' ⟦a⟧ ⟦b⟧ f h = f a b :=
Quotient.liftOn₂'_mk'' _ _ _ _
#align quotient.lift_on₂'_mk Quotient.liftOn₂'_mk
+-/
#print Quotient.map'_mk /-
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -66,7 +66,6 @@ protected def hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧
HEq (@Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₁) (@cb _)) (f a₁ b) := by simp [hEq_self_iff_true]
HEq _ (f a₂ b) := (ca pa)
HEq _ (@Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₂) (@cb _)) := by simp [hEq_self_iff_true]
-
#align quot.hrec_on₂ Quot.hrecOn₂
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -140,12 +140,6 @@ protected def lift₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂
#align quot.lift₂ Quot.lift₂
-/
-/- warning: quot.lift₂_mk -> Quot.lift₂_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β -> γ) (hr : forall (a : α) (b₁ : β) (b₂ : β), (s b₁ b₂) -> (Eq.{u3} γ (f a b₁) (f a b₂))) (hs : forall (a₁ : α) (a₂ : α) (b : β), (r a₁ a₂) -> (Eq.{u3} γ (f a₁ b) (f a₂ b))) (a : α) (b : β), Eq.{u3} γ (Quot.lift₂.{u1, u2, u3} α β γ (fun (a₁ : α) (a₂ : α) => r a₁ a₂) (fun (b₁ : β) (b₂ : β) => s b₁ b₂) f hr hs (Quot.mk.{u1} α r a) (Quot.mk.{u2} β s b)) (f a b)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} (f : α -> β -> γ) (hr : forall (a : α) (b₁ : β) (b₂ : β), (s b₁ b₂) -> (Eq.{u3} γ (f a b₁) (f a b₂))) (hs : forall (a₁ : α) (a₂ : α) (b : β), (r a₁ a₂) -> (Eq.{u3} γ (f a₁ b) (f a₂ b))) (a : α) (b : β), Eq.{u3} γ (Quot.lift₂.{u2, u1, u3} α β γ (fun (a₁ : α) (a₂ : α) => r a₁ a₂) (fun (b₁ : β) (b₂ : β) => s b₁ b₂) f hr hs (Quot.mk.{u2} α r a) (Quot.mk.{u1} β s b)) (f a b)
-Case conversion may be inaccurate. Consider using '#align quot.lift₂_mk Quot.lift₂_mkₓ'. -/
@[simp]
theorem lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (a : α) (b : β) :
@@ -162,12 +156,6 @@ protected def liftOn₂ (p : Quot r) (q : Quot s) (f : α → β → γ)
#align quot.lift_on₂ Quot.liftOn₂
-/
-/- warning: quot.lift_on₂_mk -> Quot.liftOn₂_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} (a : α) (b : β) (f : α -> β -> γ) (hr : forall (a : α) (b₁ : β) (b₂ : β), (s b₁ b₂) -> (Eq.{u3} γ (f a b₁) (f a b₂))) (hs : forall (a₁ : α) (a₂ : α) (b : β), (r a₁ a₂) -> (Eq.{u3} γ (f a₁ b) (f a₂ b))), Eq.{u3} γ (Quot.liftOn₂.{u1, u2, u3} α β γ r s (Quot.mk.{u1} α r a) (Quot.mk.{u2} β s b) f hr hs) (f a b)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} (a : α) (b : β) (f : α -> β -> γ) (hr : forall (a : α) (b₁ : β) (b₂ : β), (s b₁ b₂) -> (Eq.{u3} γ (f a b₁) (f a b₂))) (hs : forall (a₁ : α) (a₂ : α) (b : β), (r a₁ a₂) -> (Eq.{u3} γ (f a₁ b) (f a₂ b))), Eq.{u3} γ (Quot.liftOn₂.{u2, u1, u3} α β γ r s (Quot.mk.{u2} α r a) (Quot.mk.{u1} β s b) f hr hs) (f a b)
-Case conversion may be inaccurate. Consider using '#align quot.lift_on₂_mk Quot.liftOn₂_mkₓ'. -/
@[simp]
theorem liftOn₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) :
@@ -187,12 +175,6 @@ protected def map₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂
#align quot.map₂ Quot.map₂
-/
-/- warning: quot.map₂_mk -> Quot.map₂_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : α -> β -> γ) (hr : forall (a : α) (b₁ : β) (b₂ : β), (s b₁ b₂) -> (t (f a b₁) (f a b₂))) (hs : forall (a₁ : α) (a₂ : α) (b : β), (r a₁ a₂) -> (t (f a₁ b) (f a₂ b))) (a : α) (b : β), Eq.{u3} (Quot.{u3} γ t) (Quot.map₂.{u1, u2, u3} α β γ (fun (a₁ : α) (a₂ : α) => r a₁ a₂) (fun (b₁ : β) (b₂ : β) => s b₁ b₂) t f hr hs (Quot.mk.{u1} α r a) (Quot.mk.{u2} β s b)) (Quot.mk.{u3} γ t (f a b))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} (f : α -> β -> γ) (hr : forall (a : α) (b₁ : β) (b₂ : β), (s b₁ b₂) -> (t (f a b₁) (f a b₂))) (hs : forall (a₁ : α) (a₂ : α) (b : β), (r a₁ a₂) -> (t (f a₁ b) (f a₂ b))) (a : α) (b : β), Eq.{u3} (Quot.{u3} γ t) (Quot.map₂.{u2, u1, u3} α β γ (fun (a₁ : α) (a₂ : α) => r a₁ a₂) (fun (b₁ : β) (b₂ : β) => s b₁ b₂) t f hr hs (Quot.mk.{u2} α r a) (Quot.mk.{u1} β s b)) (Quot.mk.{u3} γ t (f a b))
-Case conversion may be inaccurate. Consider using '#align quot.map₂_mk Quot.map₂_mkₓ'. -/
@[simp]
theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂))
(hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (a : α) (b : β) :
@@ -211,24 +193,12 @@ protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort _}
#align quot.rec_on_subsingleton₂ Quot.recOnSubsingleton₂
-/
-/- warning: quot.induction_on₂ -> Quot.induction_on₂ is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {r : α -> α -> Prop} {s : β -> β -> Prop} {δ : (Quot.{u1} α r) -> (Quot.{u2} β s) -> Prop} (q₁ : Quot.{u1} α r) (q₂ : Quot.{u2} β s), (forall (a : α) (b : β), δ (Quot.mk.{u1} α r a) (Quot.mk.{u2} β s b)) -> (δ q₁ q₂)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {δ : (Quot.{u2} α r) -> (Quot.{u1} β s) -> Prop} (q₁ : Quot.{u2} α r) (q₂ : Quot.{u1} β s), (forall (a : α) (b : β), δ (Quot.mk.{u2} α r a) (Quot.mk.{u1} β s b)) -> (δ q₁ q₂)
-Case conversion may be inaccurate. Consider using '#align quot.induction_on₂ Quot.induction_on₂ₓ'. -/
@[elab_as_elim]
protected theorem induction_on₂ {δ : Quot r → Quot s → Prop} (q₁ : Quot r) (q₂ : Quot s)
(h : ∀ a b, δ (Quot.mk r a) (Quot.mk s b)) : δ q₁ q₂ :=
Quot.ind (fun a₁ => Quot.ind (fun a₂ => h a₁ a₂) q₂) q₁
#align quot.induction_on₂ Quot.induction_on₂
-/- warning: quot.induction_on₃ -> Quot.induction_on₃ is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} {δ : (Quot.{u1} α r) -> (Quot.{u2} β s) -> (Quot.{u3} γ t) -> Prop} (q₁ : Quot.{u1} α r) (q₂ : Quot.{u2} β s) (q₃ : Quot.{u3} γ t), (forall (a : α) (b : β) (c : γ), δ (Quot.mk.{u1} α r a) (Quot.mk.{u2} β s b) (Quot.mk.{u3} γ t c)) -> (δ q₁ q₂ q₃)
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {r : α -> α -> Prop} {s : β -> β -> Prop} {t : γ -> γ -> Prop} {δ : (Quot.{u3} α r) -> (Quot.{u2} β s) -> (Quot.{u1} γ t) -> Prop} (q₁ : Quot.{u3} α r) (q₂ : Quot.{u2} β s) (q₃ : Quot.{u1} γ t), (forall (a : α) (b : β) (c : γ), δ (Quot.mk.{u3} α r a) (Quot.mk.{u2} β s b) (Quot.mk.{u1} γ t c)) -> (δ q₁ q₂ q₃)
-Case conversion may be inaccurate. Consider using '#align quot.induction_on₃ Quot.induction_on₃ₓ'. -/
@[elab_as_elim]
protected theorem induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (q₁ : Quot r) (q₂ : Quot s)
(q₃ : Quot t) (h : ∀ a b c, δ (Quot.mk r a) (Quot.mk s b) (Quot.mk t c)) : δ q₁ q₂ q₃ :=
@@ -290,12 +260,6 @@ protected def map (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) : Quot
#align quotient.map Quotient.map
-/
-/- warning: quotient.map_mk -> Quotient.map_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [sa : Setoid.{u1} α] [sb : Setoid.{u2} β] (f : α -> β) (h : Relator.LiftFun.{u1, u1, u2, u2} α α β β (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α sa)) (HasEquivₓ.Equiv.{u2} β (setoidHasEquiv.{u2} β sb)) f f) (x : α), Eq.{u2} (Quotient.{u2} β sb) (Quotient.map.{u1, u2} α β sa sb f h (Quotient.mk'.{u1} α sa x)) (Quotient.mk'.{u2} β sb (f x))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} [sa : Setoid.{u2} α] [sb : Setoid.{u1} β] (f : α -> β) (h : Relator.LiftFun.{u2, u2, u1, u1} α α β β (fun (x._@.Mathlib.Data.Quot._hyg.4515 : α) (x._@.Mathlib.Data.Quot._hyg.4517 : α) => HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α sa) x._@.Mathlib.Data.Quot._hyg.4515 x._@.Mathlib.Data.Quot._hyg.4517) (fun (x._@.Mathlib.Data.Quot._hyg.4530 : β) (x._@.Mathlib.Data.Quot._hyg.4532 : β) => HasEquiv.Equiv.{u1, 0} β (instHasEquiv.{u1} β sb) x._@.Mathlib.Data.Quot._hyg.4530 x._@.Mathlib.Data.Quot._hyg.4532) f f) (x : α), Eq.{u1} (Quotient.{u1} β sb) (Quotient.map.{u2, u1} α β sa sb f h (Quotient.mk.{u2} α sa x)) (Quotient.mk.{u1} β sb (f x))
-Case conversion may be inaccurate. Consider using '#align quotient.map_mk Quotient.map_mkₓ'. -/
@[simp]
theorem map_mk (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) :
Quotient.map f h (⟦x⟧ : Quotient sa) = (⟦f x⟧ : Quotient sb) :=
@@ -314,12 +278,6 @@ protected def map₂ (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·)
#align quotient.map₂ Quotient.map₂
-/
-/- warning: quotient.map₂_mk -> Quotient.map₂_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [sa : Setoid.{u1} α] [sb : Setoid.{u2} β] {γ : Sort.{u3}} [sc : Setoid.{u3} γ] (f : α -> β -> γ) (h : Relator.LiftFun.{u1, u1, imax u2 u3, imax u2 u3} α α (β -> γ) (β -> γ) (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α sa)) (Relator.LiftFun.{u2, u2, u3, u3} β β γ γ (HasEquivₓ.Equiv.{u2} β (setoidHasEquiv.{u2} β sb)) (HasEquivₓ.Equiv.{u3} γ (setoidHasEquiv.{u3} γ sc))) f f) (x : α) (y : β), Eq.{u3} (Quotient.{u3} γ sc) (Quotient.map₂.{u1, u2, u3} α β sa sb γ sc f h (Quotient.mk'.{u1} α sa x) (Quotient.mk'.{u2} β sb y)) (Quotient.mk'.{u3} γ sc (f x y))
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} [sa : Setoid.{u3} α] [sb : Setoid.{u2} β] {γ : Sort.{u1}} [sc : Setoid.{u1} γ] (f : α -> β -> γ) (h : Relator.LiftFun.{u3, u3, imax u2 u1, imax u2 u1} α α (β -> γ) (β -> γ) (fun (x._@.Mathlib.Data.Quot._hyg.4742 : α) (x._@.Mathlib.Data.Quot._hyg.4744 : α) => HasEquiv.Equiv.{u3, 0} α (instHasEquiv.{u3} α sa) x._@.Mathlib.Data.Quot._hyg.4742 x._@.Mathlib.Data.Quot._hyg.4744) (Relator.LiftFun.{u2, u2, u1, u1} β β γ γ (fun (x._@.Mathlib.Data.Quot._hyg.4760 : β) (x._@.Mathlib.Data.Quot._hyg.4762 : β) => HasEquiv.Equiv.{u2, 0} β (instHasEquiv.{u2} β sb) x._@.Mathlib.Data.Quot._hyg.4760 x._@.Mathlib.Data.Quot._hyg.4762) (fun (x._@.Mathlib.Data.Quot._hyg.4775 : γ) (x._@.Mathlib.Data.Quot._hyg.4777 : γ) => HasEquiv.Equiv.{u1, 0} γ (instHasEquiv.{u1} γ sc) x._@.Mathlib.Data.Quot._hyg.4775 x._@.Mathlib.Data.Quot._hyg.4777)) f f) (x : α) (y : β), Eq.{u1} (Quotient.{u1} γ sc) (Quotient.map₂.{u3, u2, u1} α β sa sb γ sc f h (Quotient.mk.{u3} α sa x) (Quotient.mk.{u2} β sb y)) (Quotient.mk.{u1} γ sc (f x y))
-Case conversion may be inaccurate. Consider using '#align quotient.map₂_mk Quotient.map₂_mkₓ'. -/
@[simp]
theorem map₂_mk (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) (y : β) :
Quotient.map₂ f h (⟦x⟧ : Quotient sa) (⟦y⟧ : Quotient sb) = (⟦f x y⟧ : Quotient sc) :=
@@ -373,36 +331,18 @@ theorem forall_quotient_iff {α : Type _} [r : Setoid α] {p : Quotient r → Pr
#align forall_quotient_iff forall_quotient_iff
-/
-/- warning: quotient.lift_mk -> Quotient.lift_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [s : Setoid.{u1} α] (f : α -> β) (h : forall (a : α) (b : α), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α s) a b) -> (Eq.{u2} β (f a) (f b))) (x : α), Eq.{u2} β (Quotient.lift.{u1, u2} α β s f h (Quotient.mk'.{u1} α s x)) (f x)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} [s : Setoid.{u2} α] (f : α -> β) (h : forall (a : α) (b : α), (HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α s) a b) -> (Eq.{u1} β (f a) (f b))) (x : α), Eq.{u1} β (Quotient.lift.{u2, u1} α β s f h (Quotient.mk.{u2} α s x)) (f x)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_mk Quotient.lift_mkₓ'. -/
@[simp]
theorem Quotient.lift_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.lift f h (Quotient.mk' x) = f x :=
rfl
#align quotient.lift_mk Quotient.lift_mk
-/- warning: quotient.lift_comp_mk -> Quotient.lift_comp_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Setoid.{u1} α] (f : α -> β) (h : forall (a : α) (b : α), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α _inst_1) a b) -> (Eq.{u2} β (f a) (f b))), Eq.{imax u1 u2} (α -> β) (Function.comp.{u1, u1, u2} α (Quotient.{u1} α _inst_1) β (Quotient.lift.{u1, u2} α β _inst_1 f h) (Quotient.mk'.{u1} α _inst_1)) f
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Setoid.{u2} α] (f : α -> β) (h : forall (a : α) (b : α), (HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α _inst_1) a b) -> (Eq.{u1} β (f a) (f b))), Eq.{imax u2 u1} (α -> β) (Function.comp.{u2, u2, u1} α (Quotient.{u2} α _inst_1) β (Quotient.lift.{u2, u1} α β _inst_1 f h) (Quotient.mk.{u2} α _inst_1)) f
-Case conversion may be inaccurate. Consider using '#align quotient.lift_comp_mk Quotient.lift_comp_mkₓ'. -/
@[simp]
theorem Quotient.lift_comp_mk [Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) :
Quotient.lift f h ∘ Quotient.mk' = f :=
rfl
#align quotient.lift_comp_mk Quotient.lift_comp_mk
-/- warning: quotient.lift₂_mk -> Quotient.lift₂_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} [_inst_1 : Setoid.{u1} α] [_inst_2 : Setoid.{u2} β] (f : α -> β -> γ) (h : forall (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α _inst_1) a₁ b₁) -> (HasEquivₓ.Equiv.{u2} β (setoidHasEquiv.{u2} β _inst_2) a₂ b₂) -> (Eq.{u3} γ (f a₁ a₂) (f b₁ b₂))) (a : α) (b : β), Eq.{u3} γ (Quotient.lift₂.{u1, u2, u3} α β γ _inst_1 _inst_2 f h (Quotient.mk'.{u1} α _inst_1 a) (Quotient.mk'.{u2} β _inst_2 b)) (f a b)
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} [_inst_1 : Setoid.{u3} α] [_inst_2 : Setoid.{u2} β] (f : α -> β -> γ) (h : forall (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), (HasEquiv.Equiv.{u3, 0} α (instHasEquiv.{u3} α _inst_1) a₁ b₁) -> (HasEquiv.Equiv.{u2, 0} β (instHasEquiv.{u2} β _inst_2) a₂ b₂) -> (Eq.{u1} γ (f a₁ a₂) (f b₁ b₂))) (a : α) (b : β), Eq.{u1} γ (Quotient.lift₂.{u3, u2, u1} α β γ _inst_1 _inst_2 f h (Quotient.mk.{u3} α _inst_1 a) (Quotient.mk.{u2} β _inst_2 b)) (f a b)
-Case conversion may be inaccurate. Consider using '#align quotient.lift₂_mk Quotient.lift₂_mkₓ'. -/
@[simp]
theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α] [Setoid β]
(f : α → β → γ)
@@ -411,24 +351,12 @@ theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α
rfl
#align quotient.lift₂_mk Quotient.lift₂_mk
-/- warning: quotient.lift_on_mk -> Quotient.liftOn_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [s : Setoid.{u1} α] (f : α -> β) (h : forall (a : α) (b : α), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α s) a b) -> (Eq.{u2} β (f a) (f b))) (x : α), Eq.{u2} β (Quotient.liftOn.{u1, u2} α β s (Quotient.mk'.{u1} α s x) f h) (f x)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} [s : Setoid.{u2} α] (f : α -> β) (h : forall (a : α) (b : α), (HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α s) a b) -> (Eq.{u1} β (f a) (f b))) (x : α), Eq.{u1} β (Quotient.liftOn.{u2, u1} α β s (Quotient.mk.{u2} α s x) f h) (f x)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_on_mk Quotient.liftOn_mkₓ'. -/
@[simp]
theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.liftOn (Quotient.mk' x) f h = f x :=
rfl
#align quotient.lift_on_mk Quotient.liftOn_mk
-/- warning: quotient.lift_on₂_mk -> Quotient.liftOn₂_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Setoid.{u1} α] (f : α -> α -> β) (h : forall (a₁ : α) (a₂ : α) (b₁ : α) (b₂ : α), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α _inst_1) a₁ b₁) -> (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α _inst_1) a₂ b₂) -> (Eq.{u2} β (f a₁ a₂) (f b₁ b₂))) (x : α) (y : α), Eq.{u2} β (Quotient.liftOn₂.{u1, u1, u2} α α β _inst_1 _inst_1 (Quotient.mk'.{u1} α _inst_1 x) (Quotient.mk'.{u1} α _inst_1 y) f h) (f x y)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Setoid.{u2} α] (f : α -> α -> β) (h : forall (a₁ : α) (a₂ : α) (b₁ : α) (b₂ : α), (HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α _inst_1) a₁ b₁) -> (HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α _inst_1) a₂ b₂) -> (Eq.{u1} β (f a₁ a₂) (f b₁ b₂))) (x : α) (y : α), Eq.{u1} β (Quotient.liftOn₂.{u2, u2, u1} α α β _inst_1 _inst_1 (Quotient.mk.{u2} α _inst_1 x) (Quotient.mk.{u2} α _inst_1 y) f h) (f x y)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_on₂_mk Quotient.liftOn₂_mkₓ'. -/
@[simp]
theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α → α → β)
(h : ∀ a₁ a₂ b₁ b₂ : α, a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (x y : α) :
@@ -552,24 +480,12 @@ noncomputable def Quotient.choice {ι : Type _} {α : ι → Type _} [S : ∀ i,
#align quotient.choice Quotient.choice
-/
-/- warning: quotient.choice_eq -> Quotient.choice_eq is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u1}} {α : ι -> Type.{u2}} [_inst_1 : forall (i : ι), Setoid.{succ u2} (α i)] (f : forall (i : ι), α i), Eq.{max (succ u1) (succ u2)} (Quotient.{max (succ u1) (succ u2)} (forall (i : ι), α i) (piSetoid.{succ u1, succ u2} ι (fun (i : ι) => α i) (fun (i : ι) => _inst_1 i))) (Quotient.choice.{u1, u2} ι (fun (i : ι) => α i) (fun (i : ι) => _inst_1 i) (fun (i : ι) => Quotient.mk'.{succ u2} (α i) (_inst_1 i) (f i))) (Quotient.mk'.{max (succ u1) (succ u2)} (forall (i : ι), α i) (piSetoid.{succ u1, succ u2} ι (fun (i : ι) => α i) (fun (i : ι) => _inst_1 i)) f)
-but is expected to have type
- forall {ι : Type.{u2}} {α : ι -> Type.{u1}} [_inst_1 : forall (i : ι), Setoid.{succ u1} (α i)] (f : forall (i : ι), α i), Eq.{max (succ u2) (succ u1)} (Quotient.{max (succ u2) (succ u1)} (forall (i : ι), α i) (inferInstance.{max (succ u2) (succ u1)} (Setoid.{max (succ u2) (succ u1)} (forall (i : ι), α i)) (piSetoid.{succ u2, succ u1} ι (fun (i : ι) => α i) (fun (i : ι) => _inst_1 i)))) (Quotient.choice.{u2, u1} ι (fun (i : ι) => α i) (fun (i : ι) => _inst_1 i) (fun (i : ι) => Quotient.mk.{succ u1} (α i) (_inst_1 i) (f i))) (Quotient.mk.{max (succ u2) (succ u1)} (forall (i : ι), α i) (inferInstance.{max (succ u2) (succ u1)} (Setoid.{max (succ u2) (succ u1)} (forall (i : ι), α i)) (piSetoid.{succ u2, succ u1} ι (fun (i : ι) => α i) (fun (i : ι) => _inst_1 i))) f)
-Case conversion may be inaccurate. Consider using '#align quotient.choice_eq Quotient.choice_eqₓ'. -/
@[simp]
theorem Quotient.choice_eq {ι : Type _} {α : ι → Type _} [∀ i, Setoid (α i)] (f : ∀ i, α i) :
(Quotient.choice fun i => ⟦f i⟧) = ⟦f⟧ :=
Quotient.sound fun i => Quotient.mk_out _
#align quotient.choice_eq Quotient.choice_eq
-/- warning: quotient.induction_on_pi -> Quotient.induction_on_pi is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u1}} {α : ι -> Sort.{u2}} [s : forall (i : ι), Setoid.{u2} (α i)] {p : (forall (i : ι), Quotient.{u2} (α i) (s i)) -> Prop} (f : forall (i : ι), Quotient.{u2} (α i) (s i)), (forall (a : forall (i : ι), α i), p (fun (i : ι) => Quotient.mk'.{u2} (α i) (s i) (a i))) -> (p f)
-but is expected to have type
- forall {ι : Type.{u2}} {α : ι -> Sort.{u1}} [s : forall (i : ι), Setoid.{u1} (α i)] {p : (forall (i : ι), Quotient.{u1} (α i) (s i)) -> Prop} (f : forall (i : ι), Quotient.{u1} (α i) (s i)), (forall (a : forall (i : ι), α i), p (fun (i : ι) => Quotient.mk.{u1} (α i) (s i) (a i))) -> (p f)
-Case conversion may be inaccurate. Consider using '#align quotient.induction_on_pi Quotient.induction_on_piₓ'. -/
@[elab_as_elim]
theorem Quotient.induction_on_pi {ι : Type _} {α : ι → Sort _} [s : ∀ i, Setoid (α i)]
{p : (∀ i, Quotient (s i)) → Prop} (f : ∀ i, Quotient (s i))
@@ -668,12 +584,6 @@ theorem exists_rep (q : Trunc α) : ∃ a : α, mk a = q :=
#align trunc.exists_rep Trunc.exists_rep
-/
-/- warning: trunc.induction_on₂ -> Trunc.induction_on₂ is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {C : (Trunc.{u1} α) -> (Trunc.{u2} β) -> Prop} (q₁ : Trunc.{u1} α) (q₂ : Trunc.{u2} β), (forall (a : α) (b : β), C (Trunc.mk.{u1} α a) (Trunc.mk.{u2} β b)) -> (C q₁ q₂)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {C : (Trunc.{u2} α) -> (Trunc.{u1} β) -> Prop} (q₁ : Trunc.{u2} α) (q₂ : Trunc.{u1} β), (forall (a : α) (b : β), C (Trunc.mk.{u2} α a) (Trunc.mk.{u1} β b)) -> (C q₁ q₂)
-Case conversion may be inaccurate. Consider using '#align trunc.induction_on₂ Trunc.induction_on₂ₓ'. -/
@[elab_as_elim]
protected theorem induction_on₂ {C : Trunc α → Trunc β → Prop} (q₁ : Trunc α) (q₂ : Trunc β)
(h : ∀ a b, C (mk a) (mk b)) : C q₁ q₂ :=
@@ -801,24 +711,12 @@ protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.
#align quotient.lift_on' Quotient.liftOn'
-/
-/- warning: quotient.lift_on'_mk' -> Quotient.liftOn'_mk'' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {φ : Sort.{u2}} {s₁ : Setoid.{u1} α} (f : α -> φ) (h : forall (a : α) (b : α), (Setoid.r.{u1} α s₁ a b) -> (Eq.{u2} φ (f a) (f b))) (x : α), Eq.{u2} φ (Quotient.liftOn'.{u1, u2} α φ s₁ (Quotient.mk''.{u1} α s₁ x) f h) (f x)
-but is expected to have type
- forall {α : Sort.{u2}} {φ : Sort.{u1}} {s₁ : Setoid.{u2} α} (f : α -> φ) (h : forall (a : α) (b : α), (Setoid.r.{u2} α s₁ a b) -> (Eq.{u1} φ (f a) (f b))) (x : α), Eq.{u1} φ (Quotient.liftOn'.{u2, u1} α φ s₁ (Quotient.mk''.{u2} α s₁ x) f h) (f x)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_on'_mk' Quotient.liftOn'_mk''ₓ'. -/
@[simp]
protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
Quotient.liftOn' (@Quotient.mk'' _ s₁ x) f h = f x :=
rfl
#align quotient.lift_on'_mk' Quotient.liftOn'_mk''
-/- warning: quotient.surjective_lift_on' -> Quotient.surjective_liftOn' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {φ : Sort.{u2}} {s₁ : Setoid.{u1} α} {f : α -> φ} (h : forall (a : α) (b : α), (Setoid.r.{u1} α s₁ a b) -> (Eq.{u2} φ (f a) (f b))), Iff (Function.Surjective.{u1, u2} (Quotient.{u1} α s₁) φ (fun (x : Quotient.{u1} α s₁) => Quotient.liftOn'.{u1, u2} α φ s₁ x f h)) (Function.Surjective.{u1, u2} α φ f)
-but is expected to have type
- forall {α : Sort.{u2}} {φ : Sort.{u1}} {s₁ : Setoid.{u2} α} {f : α -> φ} (h : forall (a : α) (b : α), (Setoid.r.{u2} α s₁ a b) -> (Eq.{u1} φ (f a) (f b))), Iff (Function.Surjective.{u2, u1} (Quotient.{u2} α s₁) φ (fun (x : Quotient.{u2} α s₁) => Quotient.liftOn'.{u2, u1} α φ s₁ x f h)) (Function.Surjective.{u2, u1} α φ f)
-Case conversion may be inaccurate. Consider using '#align quotient.surjective_lift_on' Quotient.surjective_liftOn'ₓ'. -/
@[simp]
theorem surjective_liftOn' {f : α → φ} (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) :
(Surjective fun x => Quotient.liftOn' x f h) ↔ Surjective f :=
@@ -835,12 +733,6 @@ protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α
#align quotient.lift_on₂' Quotient.liftOn₂'
-/
-/- warning: quotient.lift_on₂'_mk' -> Quotient.liftOn₂'_mk'' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} (f : α -> β -> γ) (h : forall (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), (Setoid.r.{u1} α s₁ a₁ b₁) -> (Setoid.r.{u2} β s₂ a₂ b₂) -> (Eq.{u3} γ (f a₁ a₂) (f b₁ b₂))) (a : α) (b : β), Eq.{u3} γ (Quotient.liftOn₂'.{u1, u2, u3} α β γ s₁ s₂ (Quotient.mk''.{u1} α s₁ a) (Quotient.mk''.{u2} β s₂ b) f h) (f a b)
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {s₁ : Setoid.{u3} α} {s₂ : Setoid.{u2} β} (f : α -> β -> γ) (h : forall (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), (Setoid.r.{u3} α s₁ a₁ b₁) -> (Setoid.r.{u2} β s₂ a₂ b₂) -> (Eq.{u1} γ (f a₁ a₂) (f b₁ b₂))) (a : α) (b : β), Eq.{u1} γ (Quotient.liftOn₂'.{u3, u2, u1} α β γ s₁ s₂ (Quotient.mk''.{u3} α s₁ a) (Quotient.mk''.{u2} β s₂ b) f h) (f a b)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_on₂'_mk' Quotient.liftOn₂'_mk''ₓ'. -/
@[simp]
protected theorem liftOn₂'_mk'' (f : α → β → γ) (h) (a : α) (b : β) :
Quotient.liftOn₂' (@Quotient.mk'' _ s₁ a) (@Quotient.mk'' _ s₂ b) f h = f a b :=
@@ -857,12 +749,6 @@ protected theorem ind' {p : Quotient s₁ → Prop} (h : ∀ a, p (Quotient.mk''
#align quotient.ind' Quotient.ind'
-/
-/- warning: quotient.ind₂' -> Quotient.ind₂' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} {p : (Quotient.{u1} α s₁) -> (Quotient.{u2} β s₂) -> Prop}, (forall (a₁ : α) (a₂ : β), p (Quotient.mk''.{u1} α s₁ a₁) (Quotient.mk''.{u2} β s₂ a₂)) -> (forall (q₁ : Quotient.{u1} α s₁) (q₂ : Quotient.{u2} β s₂), p q₁ q₂)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {s₁ : Setoid.{u2} α} {s₂ : Setoid.{u1} β} {p : (Quotient.{u2} α s₁) -> (Quotient.{u1} β s₂) -> Prop}, (forall (a₁ : α) (a₂ : β), p (Quotient.mk''.{u2} α s₁ a₁) (Quotient.mk''.{u1} β s₂ a₂)) -> (forall (q₁ : Quotient.{u2} α s₁) (q₂ : Quotient.{u1} β s₂), p q₁ q₂)
-Case conversion may be inaccurate. Consider using '#align quotient.ind₂' Quotient.ind₂'ₓ'. -/
/-- A version of `quotient.ind₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit arguments
instead of instance arguments. -/
@[elab_as_elim]
@@ -882,12 +768,6 @@ protected theorem inductionOn' {p : Quotient s₁ → Prop} (q : Quotient s₁)
#align quotient.induction_on' Quotient.inductionOn'
-/
-/- warning: quotient.induction_on₂' -> Quotient.inductionOn₂' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} {p : (Quotient.{u1} α s₁) -> (Quotient.{u2} β s₂) -> Prop} (q₁ : Quotient.{u1} α s₁) (q₂ : Quotient.{u2} β s₂), (forall (a₁ : α) (a₂ : β), p (Quotient.mk''.{u1} α s₁ a₁) (Quotient.mk''.{u2} β s₂ a₂)) -> (p q₁ q₂)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {s₁ : Setoid.{u2} α} {s₂ : Setoid.{u1} β} {p : (Quotient.{u2} α s₁) -> (Quotient.{u1} β s₂) -> Prop} (q₁ : Quotient.{u2} α s₁) (q₂ : Quotient.{u1} β s₂), (forall (a₁ : α) (a₂ : β), p (Quotient.mk''.{u2} α s₁ a₁) (Quotient.mk''.{u1} β s₂ a₂)) -> (p q₁ q₂)
-Case conversion may be inaccurate. Consider using '#align quotient.induction_on₂' Quotient.inductionOn₂'ₓ'. -/
/-- A version of `quotient.induction_on₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit
arguments instead of instance arguments. -/
@[elab_as_elim]
@@ -896,12 +776,6 @@ protected theorem inductionOn₂' {p : Quotient s₁ → Quotient s₂ → Prop}
Quotient.induction_on₂ q₁ q₂ h
#align quotient.induction_on₂' Quotient.inductionOn₂'
-/- warning: quotient.induction_on₃' -> Quotient.inductionOn₃' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} {s₃ : Setoid.{u3} γ} {p : (Quotient.{u1} α s₁) -> (Quotient.{u2} β s₂) -> (Quotient.{u3} γ s₃) -> Prop} (q₁ : Quotient.{u1} α s₁) (q₂ : Quotient.{u2} β s₂) (q₃ : Quotient.{u3} γ s₃), (forall (a₁ : α) (a₂ : β) (a₃ : γ), p (Quotient.mk''.{u1} α s₁ a₁) (Quotient.mk''.{u2} β s₂ a₂) (Quotient.mk''.{u3} γ s₃ a₃)) -> (p q₁ q₂ q₃)
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {s₁ : Setoid.{u3} α} {s₂ : Setoid.{u2} β} {s₃ : Setoid.{u1} γ} {p : (Quotient.{u3} α s₁) -> (Quotient.{u2} β s₂) -> (Quotient.{u1} γ s₃) -> Prop} (q₁ : Quotient.{u3} α s₁) (q₂ : Quotient.{u2} β s₂) (q₃ : Quotient.{u1} γ s₃), (forall (a₁ : α) (a₂ : β) (a₃ : γ), p (Quotient.mk''.{u3} α s₁ a₁) (Quotient.mk''.{u2} β s₂ a₂) (Quotient.mk''.{u1} γ s₃ a₃)) -> (p q₁ q₂ q₃)
-Case conversion may be inaccurate. Consider using '#align quotient.induction_on₃' Quotient.inductionOn₃'ₓ'. -/
/-- A version of `quotient.induction_on₃` taking `{s₁ : setoid α} {s₂ : setoid β} {s₃ : setoid γ}`
as implicit arguments instead of instance arguments. -/
@[elab_as_elim]
@@ -940,12 +814,6 @@ protected def hrecOn' {φ : Quotient s₁ → Sort _} (qa : Quotient s₁) (f :
#align quotient.hrec_on' Quotient.hrecOn'
-/
-/- warning: quotient.hrec_on'_mk' -> Quotient.hrecOn'_mk'' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {s₁ : Setoid.{u1} α} {φ : (Quotient.{u1} α s₁) -> Sort.{u2}} (f : forall (a : α), φ (Quotient.mk''.{u1} α s₁ a)) (c : forall (a₁ : α) (a₂ : α), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α s₁) a₁ a₂) -> (HEq.{u2} (φ (Quotient.mk''.{u1} α s₁ a₁)) (f a₁) (φ (Quotient.mk''.{u1} α s₁ a₂)) (f a₂))) (x : α), Eq.{u2} (φ (Quotient.mk''.{u1} α s₁ x)) (Quotient.hrecOn'.{u1, u2} α s₁ φ (Quotient.mk''.{u1} α s₁ x) f c) (f x)
-but is expected to have type
- forall {α : Sort.{u2}} {s₁ : Setoid.{u2} α} {φ : (Quotient.{u2} α s₁) -> Sort.{u1}} (f : forall (a : α), φ (Quotient.mk''.{u2} α s₁ a)) (c : forall (a₁ : α) (a₂ : α), (HasEquiv.Equiv.{u2, 0} α (instHasEquiv.{u2} α s₁) a₁ a₂) -> (HEq.{u1} (φ (Quotient.mk''.{u2} α s₁ a₁)) (f a₁) (φ (Quotient.mk''.{u2} α s₁ a₂)) (f a₂))) (x : α), Eq.{u1} (φ (Quotient.mk''.{u2} α s₁ x)) (Quotient.hrecOn'.{u2, u1} α s₁ φ (Quotient.mk''.{u2} α s₁ x) f c) (f x)
-Case conversion may be inaccurate. Consider using '#align quotient.hrec_on'_mk' Quotient.hrecOn'_mk''ₓ'. -/
@[simp]
theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk'' a))
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂)) (x : α) : (Quotient.mk'' x).hrecOn' f c = f x :=
@@ -961,12 +829,6 @@ protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa :
#align quotient.hrec_on₂' Quotient.hrecOn₂'
-/
-/- warning: quotient.hrec_on₂'_mk' -> Quotient.hrecOn₂'_mk'' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} {φ : (Quotient.{u1} α s₁) -> (Quotient.{u2} β s₂) -> Sort.{u3}} (f : forall (a : α) (b : β), φ (Quotient.mk''.{u1} α s₁ a) (Quotient.mk''.{u2} β s₂ b)) (c : forall (a₁ : α) (b₁ : β) (a₂ : α) (b₂ : β), (HasEquivₓ.Equiv.{u1} α (setoidHasEquiv.{u1} α s₁) a₁ a₂) -> (HasEquivₓ.Equiv.{u2} β (setoidHasEquiv.{u2} β s₂) b₁ b₂) -> (HEq.{u3} (φ (Quotient.mk''.{u1} α s₁ a₁) (Quotient.mk''.{u2} β s₂ b₁)) (f a₁ b₁) (φ (Quotient.mk''.{u1} α s₁ a₂) (Quotient.mk''.{u2} β s₂ b₂)) (f a₂ b₂))) (x : α) (qb : Quotient.{u2} β s₂), Eq.{u3} (φ (Quotient.mk''.{u1} α s₁ x) qb) (Quotient.hrecOn₂'.{u1, u2, u3} α β s₁ s₂ φ (Quotient.mk''.{u1} α s₁ x) qb f c) (Quotient.hrecOn'.{u2, u3} β s₂ (fun (qb : Quotient.{u2} β s₂) => φ (Quotient.mk''.{u1} α s₁ x) qb) qb (f x) (fun (b₁ : β) (b₂ : β) => c x b₁ x b₂ (Setoid.refl.{u1} α s₁ x)))
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} {s₁ : Setoid.{u3} α} {s₂ : Setoid.{u2} β} {φ : (Quotient.{u3} α s₁) -> (Quotient.{u2} β s₂) -> Sort.{u1}} (f : forall (a : α) (b : β), φ (Quotient.mk''.{u3} α s₁ a) (Quotient.mk''.{u2} β s₂ b)) (c : forall (a₁ : α) (b₁ : β) (a₂ : α) (b₂ : β), (HasEquiv.Equiv.{u3, 0} α (instHasEquiv.{u3} α s₁) a₁ a₂) -> (HasEquiv.Equiv.{u2, 0} β (instHasEquiv.{u2} β s₂) b₁ b₂) -> (HEq.{u1} (φ (Quotient.mk''.{u3} α s₁ a₁) (Quotient.mk''.{u2} β s₂ b₁)) (f a₁ b₁) (φ (Quotient.mk''.{u3} α s₁ a₂) (Quotient.mk''.{u2} β s₂ b₂)) (f a₂ b₂))) (x : α) (qb : Quotient.{u2} β s₂), Eq.{u1} (φ (Quotient.mk''.{u3} α s₁ x) qb) (Quotient.hrecOn₂'.{u3, u2, u1} α β s₁ s₂ φ (Quotient.mk''.{u3} α s₁ x) qb f c) (Quotient.hrecOn'.{u2, u1} β s₂ (φ (Quotient.mk''.{u3} α s₁ x)) qb (f x) (fun (b₁ : β) (b₂ : β) => c x b₁ x b₂ (Setoid.refl.{u3} α s₁ x)))
-Case conversion may be inaccurate. Consider using '#align quotient.hrec_on₂'_mk' Quotient.hrecOn₂'_mk''ₓ'. -/
@[simp]
theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
(f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b))
@@ -983,12 +845,6 @@ protected def map' (f : α → β) (h : (s₁.R ⇒ s₂.R) f f) : Quotient s₁
#align quotient.map' Quotient.map'
-/
-/- warning: quotient.map'_mk' -> Quotient.map'_mk'' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} (f : α -> β) (h : Relator.LiftFun.{u1, u1, u2, u2} α α β β (Setoid.r.{u1} α s₁) (Setoid.r.{u2} β s₂) f f) (x : α), Eq.{u2} (Quotient.{u2} β s₂) (Quotient.map'.{u1, u2} α β s₁ s₂ f h (Quotient.mk''.{u1} α s₁ x)) (Quotient.mk''.{u2} β s₂ (f x))
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} {s₁ : Setoid.{u2} α} {s₂ : Setoid.{u1} β} (f : α -> β) (h : Relator.LiftFun.{u2, u2, u1, u1} α α β β (Setoid.r.{u2} α s₁) (Setoid.r.{u1} β s₂) f f) (x : α), Eq.{u1} (Quotient.{u1} β s₂) (Quotient.map'.{u2, u1} α β s₁ s₂ f h (Quotient.mk''.{u2} α s₁ x)) (Quotient.mk''.{u1} β s₂ (f x))
-Case conversion may be inaccurate. Consider using '#align quotient.map'_mk' Quotient.map'_mk''ₓ'. -/
@[simp]
theorem map'_mk'' (f : α → β) (h) (x : α) :
(Quotient.mk'' x : Quotient s₁).map' f h = (Quotient.mk'' (f x) : Quotient s₂) :=
@@ -1003,12 +859,6 @@ protected def map₂' (f : α → β → γ) (h : (s₁.R ⇒ s₂.R ⇒ s₃.R)
#align quotient.map₂' Quotient.map₂'
-/
-/- warning: quotient.map₂'_mk' -> Quotient.map₂'_mk'' is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {s₁ : Setoid.{u1} α} {s₂ : Setoid.{u2} β} {s₃ : Setoid.{u3} γ} (f : α -> β -> γ) (h : Relator.LiftFun.{u1, u1, imax u2 u3, imax u2 u3} α α (β -> γ) (β -> γ) (Setoid.r.{u1} α s₁) (Relator.LiftFun.{u2, u2, u3, u3} β β γ γ (Setoid.r.{u2} β s₂) (Setoid.r.{u3} γ s₃)) f f) (x : α), Eq.{imax u2 u3} ((Quotient.{u2} β s₂) -> (Quotient.{u3} γ s₃)) (Quotient.map₂'.{u1, u2, u3} α β γ s₁ s₂ s₃ f h (Quotient.mk''.{u1} α s₁ x)) (Quotient.map'.{u2, u3} β γ s₂ s₃ (f x) (h x x (Setoid.refl.{u1} α s₁ x)))
-but is expected to have type
- forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {s₁ : Setoid.{u3} α} {s₂ : Setoid.{u2} β} {s₃ : Setoid.{u1} γ} (f : α -> β -> γ) (h : Relator.LiftFun.{u3, u3, imax u2 u1, imax u2 u1} α α (β -> γ) (β -> γ) (Setoid.r.{u3} α s₁) (Relator.LiftFun.{u2, u2, u1, u1} β β γ γ (Setoid.r.{u2} β s₂) (Setoid.r.{u1} γ s₃)) f f) (x : α), Eq.{imax u2 u1} ((Quotient.{u2} β s₂) -> (Quotient.{u1} γ s₃)) (Quotient.map₂'.{u3, u2, u1} α β γ s₁ s₂ s₃ f h (Quotient.mk''.{u3} α s₁ x)) (Quotient.map'.{u2, u1} β γ s₂ s₃ (f x) (h x x (Setoid.refl.{u3} α s₁ x)))
-Case conversion may be inaccurate. Consider using '#align quotient.map₂'_mk' Quotient.map₂'_mk''ₓ'. -/
@[simp]
theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) :
(Quotient.mk'' x : Quotient s₁).map₂' f h =
@@ -1064,23 +914,11 @@ protected theorem mk''_eq_mk' (x : α) : Quotient.mk'' x = ⟦x⟧ :=
rfl
#align quotient.mk'_eq_mk Quotient.mk''_eq_mk'
-/- warning: quotient.lift_on'_mk -> Quotient.liftOn'_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Setoid.{u1} α] (x : α) (f : α -> β) (h : forall (a : α) (b : α), (Setoid.r.{u1} α _inst_1 a b) -> (Eq.{u2} β (f a) (f b))), Eq.{u2} β (Quotient.liftOn'.{u1, u2} α β _inst_1 (Quotient.mk'.{u1} α _inst_1 x) f h) (f x)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Setoid.{u2} α] (x : α) (f : α -> β) (h : forall (a : α) (b : α), (Setoid.r.{u2} α _inst_1 a b) -> (Eq.{u1} β (f a) (f b))), Eq.{u1} β (Quotient.liftOn'.{u2, u1} α β _inst_1 (Quotient.mk.{u2} α _inst_1 x) f h) (f x)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_on'_mk Quotient.liftOn'_mkₓ'. -/
@[simp]
protected theorem liftOn'_mk (x : α) (f : α → β) (h) : ⟦x⟧.liftOn' f h = f x :=
rfl
#align quotient.lift_on'_mk Quotient.liftOn'_mk
-/- warning: quotient.lift_on₂'_mk -> Quotient.liftOn₂'_mk is a dubious translation:
-lean 3 declaration is
- forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} [_inst_1 : Setoid.{u1} α] [_inst_2 : Setoid.{u2} β] (f : α -> β -> γ) (h : forall (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), (Setoid.r.{u1} α _inst_1 a₁ b₁) -> (Setoid.r.{u2} β _inst_2 a₂ b₂) -> (Eq.{u3} γ (f a₁ a₂) (f b₁ b₂))) (a : α) (b : β), Eq.{u3} γ (Quotient.liftOn₂'.{u1, u2, u3} α β γ _inst_1 _inst_2 (Quotient.mk'.{u1} α _inst_1 a) (Quotient.mk'.{u2} β _inst_2 b) f h) (f a b)
-but is expected to have type
- forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : Sort.{u1}} [_inst_1 : Setoid.{u2} α] [_inst_2 : Setoid.{u3} β] (f : α -> β -> γ) (h : forall (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), (Setoid.r.{u2} α _inst_1 a₁ b₁) -> (Setoid.r.{u3} β _inst_2 a₂ b₂) -> (Eq.{u1} γ (f a₁ a₂) (f b₁ b₂))) (a : α) (b : β), Eq.{u1} γ (Quotient.liftOn₂'.{u2, u3, u1} α β γ _inst_1 _inst_2 (Quotient.mk.{u2} α _inst_1 a) (Quotient.mk.{u3} β _inst_2 b) f h) (f a b)
-Case conversion may be inaccurate. Consider using '#align quotient.lift_on₂'_mk Quotient.liftOn₂'_mkₓ'. -/
@[simp]
protected theorem liftOn₂'_mk [Setoid β] (f : α → β → γ) (h) (a : α) (b : β) :
Quotient.liftOn₂' ⟦a⟧ ⟦b⟧ f h = f a b :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -64,7 +64,7 @@ protected def hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧
Quot.inductionOn qb fun b =>
calc
HEq (@Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₁) (@cb _)) (f a₁ b) := by simp [hEq_self_iff_true]
- HEq _ (f a₂ b) := ca pa
+ HEq _ (f a₂ b) := (ca pa)
HEq _ (@Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₂) (@cb _)) := by simp [hEq_self_iff_true]
#align quot.hrec_on₂ Quot.hrecOn₂
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -17,9 +17,6 @@ This module extends the core library's treatment of quotient types (`Init.Core`)
quotient
-/
-set_option autoImplicit true
-
-
variable {α : Sort*} {β : Sort*}
namespace Setoid
@@ -44,7 +41,7 @@ variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Q
local notation3:arg "⟦" a "⟧" => Quot.mk _ a
@[elab_as_elim]
-protected theorem induction_on {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop} (q : Quot r)
+protected theorem induction_on {α : Sort*} {r : α → α → Prop} {β : Quot r → Prop} (q : Quot r)
(h : ∀ a, β (Quot.mk r a)) : β q :=
ind h q
@@ -40,7 +40,6 @@ namespace Quot
variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Quot rb → Sort*}
--- mathport name: mk
@[inherit_doc Quot.mk]
local notation3:arg "⟦" a "⟧" => Quot.mk _ a
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -216,7 +216,6 @@ end Quot
namespace Quotient
variable [sa : Setoid α] [sb : Setoid β]
-
variable {φ : Quotient sa → Quotient sb → Sort*}
-- Porting note: in mathlib3 this notation took the Setoid as an instance-implicit argument,
λ
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.@@ -170,28 +170,28 @@ protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort*}
[h : ∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)] (q₁ : Quot r)
(q₂ : Quot s) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) : φ q₁ q₂ :=
@Quot.recOnSubsingleton _ r (fun q ↦ φ q q₂)
- (fun a ↦ Quot.ind (β := λ b => Subsingleton (φ (mk r a) b)) (h a) q₂) q₁
+ (fun a ↦ Quot.ind (β := fun b ↦ Subsingleton (φ (mk r a) b)) (h a) q₂) q₁
fun a ↦ Quot.recOnSubsingleton q₂ fun b ↦ f a b
#align quot.rec_on_subsingleton₂ Quot.recOnSubsingleton₂
@[elab_as_elim]
protected theorem induction_on₂ {δ : Quot r → Quot s → Prop} (q₁ : Quot r) (q₂ : Quot s)
(h : ∀ a b, δ (Quot.mk r a) (Quot.mk s b)) : δ q₁ q₂ :=
- Quot.ind (β := λ a => δ a q₂) (fun a₁ ↦ Quot.ind (fun a₂ ↦ h a₁ a₂) q₂) q₁
+ Quot.ind (β := fun a ↦ δ a q₂) (fun a₁ ↦ Quot.ind (fun a₂ ↦ h a₁ a₂) q₂) q₁
#align quot.induction_on₂ Quot.induction_on₂
@[elab_as_elim]
protected theorem induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (q₁ : Quot r)
(q₂ : Quot s) (q₃ : Quot t) (h : ∀ a b c, δ (Quot.mk r a) (Quot.mk s b) (Quot.mk t c)) :
δ q₁ q₂ q₃ :=
- Quot.ind (β := λ a => δ a q₂ q₃) (fun a₁ ↦ Quot.ind (β := λ b => δ _ b q₃)
+ Quot.ind (β := fun a ↦ δ a q₂ q₃) (fun a₁ ↦ Quot.ind (β := fun b ↦ δ _ b q₃)
(fun a₂ ↦ Quot.ind (fun a₃ ↦ h a₁ a₂ a₃) q₃) q₂) q₁
#align quot.induction_on₃ Quot.induction_on₃
instance lift.decidablePred (r : α → α → Prop) (f : α → Prop) (h : ∀ a b, r a b → f a = f b)
[hf : DecidablePred f] :
DecidablePred (Quot.lift f h) :=
- fun q ↦ Quot.recOnSubsingleton (motive := λ _ => Decidable _) q hf
+ fun q ↦ Quot.recOnSubsingleton (motive := fun _ ↦ Decidable _) q hf
/-- Note that this provides `DecidableRel (Quot.Lift₂ f ha hb)` when `α = β`. -/
instance lift₂.decidablePred (r : α → α → Prop) (s : β → β → Prop) (f : α → β → Prop)
@@ -636,7 +636,7 @@ protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
rfl
@[simp] lemma surjective_liftOn' {f : α → φ} (h) :
- Function.Surjective (λ x : Quotient s₁ => x.liftOn' f h) ↔ Function.Surjective f :=
+ Function.Surjective (fun x : Quotient s₁ ↦ x.liftOn' f h) ↔ Function.Surjective f :=
Quot.surjective_lift _
#align quotient.surjective_lift_on' Quotient.surjective_liftOn'
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -116,7 +116,7 @@ theorem liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f
#align quot.surjective_lift Quot.surjective_lift
/-- Descends a function `f : α → β → γ` to quotients of `α` and `β`. -/
--- porting note: removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
+-- Porting note: removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def lift₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (q₁ : Quot r) (q₂ : Quot s) : γ :=
@@ -498,7 +498,7 @@ protected theorem lift_mk (f : α → β) (c) (a : α) : lift f c (mk a) = f a :
#align trunc.lift_mk Trunc.lift_mk
/-- Lift a constant function on `q : Trunc α`. -/
--- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
+-- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn (q : Trunc α) (f : α → β) (c : ∀ a b : α, f a = f b) : β :=
lift f c q
@@ -544,7 +544,7 @@ instance : LawfulMonad Trunc where
id_map _ := Trunc.eq _ _
pure_bind _ _ := rfl
bind_assoc _ _ _ := Trunc.eq _ _
- -- porting note: the fields below are new in Lean 4
+ -- Porting note: the fields below are new in Lean 4
map_const := rfl
seqLeft_eq _ _ := Trunc.eq _ _
seqRight_eq _ _ := Trunc.eq _ _
@@ -608,7 +608,7 @@ several different quotient relations on a type, for example quotient groups, rin
-- TODO: this whole section can probably be replaced `Quotient.mk`, with explicit parameter
--- porting note: Quotient.mk' is the equivalent of Lean 3's `Quotient.mk`
+-- Porting note: Quotient.mk' is the equivalent of Lean 3's `Quotient.mk`
/-- A version of `Quotient.mk` taking `{s : Setoid α}` as an implicit argument instead of an
instance argument. -/
protected def mk'' (a : α) : Quotient s₁ :=
@@ -623,7 +623,7 @@ theorem surjective_Quotient_mk'' : Function.Surjective (Quotient.mk'' : α → Q
/-- A version of `Quotient.liftOn` taking `{s : Setoid α}` as an implicit argument instead of an
instance argument. -/
--- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
+-- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) :
φ :=
@@ -642,7 +642,7 @@ protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
/-- A version of `Quotient.liftOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments
instead of instance arguments. -/
--- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
+-- Porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → γ)
(h : ∀ a₁ a₂ b₁ b₂, @Setoid.r α s₁ a₁ b₁ → @Setoid.r β s₂ a₂ b₂ → f a₁ a₂ = f b₁ b₂) : γ :=
slow / slower
porting notes (#11084)
Classifies by adding issue number #11083 to porting notes claiming anything semantically equivalent to:
attribute
because it caused extremely slow tactic
"@@ -117,7 +117,7 @@ theorem liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f
/-- Descends a function `f : α → β → γ` to quotients of `α` and `β`. -/
-- porting note: removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def lift₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (q₁ : Quot r) (q₂ : Quot s) : γ :=
Quot.lift (fun a ↦ Quot.lift (f a) (hr a))
@@ -132,8 +132,8 @@ theorem lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ →
#align quot.lift₂_mk Quot.lift₂_mk
/-- Descends a function `f : α → β → γ` to quotients of `α` and `β` and applies it. -/
--- porting note: removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn₂ (p : Quot r) (q : Quot s) (f : α → β → γ)
(hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) : γ :=
Quot.lift₂ f hr hs p q
@@ -164,7 +164,7 @@ theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ →
#align quot.map₂_mk Quot.map₂_mk
/-- A binary version of `Quot.recOnSubsingleton`. -/
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort*}
[h : ∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)] (q₁ : Quot r)
@@ -499,7 +499,7 @@ protected theorem lift_mk (f : α → β) (c) (a : α) : lift f c (mk a) = f a :
/-- Lift a constant function on `q : Trunc α`. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn (q : Trunc α) (f : α → β) (c : ∀ a b : α, f a = f b) : β :=
lift f c q
#align trunc.lift_on Trunc.liftOn
@@ -555,7 +555,7 @@ instance : LawfulMonad Trunc where
variable {C : Trunc α → Sort*}
/-- Recursion/induction principle for `Trunc`. -/
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def rec (f : ∀ a, C (mk a))
(h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b)
@@ -564,7 +564,7 @@ protected def rec (f : ∀ a, C (mk a))
#align trunc.rec Trunc.rec
/-- A version of `Trunc.rec` taking `q : Trunc α` as the first argument. -/
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOn (q : Trunc α) (f : ∀ a, C (mk a))
(h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b) : C q :=
@@ -572,7 +572,7 @@ protected def recOn (q : Trunc α) (f : ∀ a, C (mk a))
#align trunc.rec_on Trunc.recOn
/-- A version of `Trunc.recOn` assuming the codomain is a `Subsingleton`. -/
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083)s: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOnSubsingleton [∀ a, Subsingleton (C (mk a))] (q : Trunc α) (f : ∀ a, C (mk a)) :
C q :=
@@ -624,7 +624,7 @@ theorem surjective_Quotient_mk'' : Function.Surjective (Quotient.mk'' : α → Q
/-- A version of `Quotient.liftOn` taking `{s : Setoid α}` as an implicit argument instead of an
instance argument. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) :
φ :=
Quotient.liftOn q f h
@@ -643,7 +643,7 @@ protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
/-- A version of `Quotient.liftOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments
instead of instance arguments. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → γ)
(h : ∀ a₁ a₂ b₁ b₂, @Setoid.r α s₁ a₁ b₁ → @Setoid.r β s₂ a₂ b₂ → f a₁ a₂ = f b₁ b₂) : γ :=
Quotient.liftOn₂ q₁ q₂ f h
@@ -709,7 +709,7 @@ protected def recOnSubsingleton' {φ : Quotient s₁ → Sort*} [∀ a, Subsingl
/-- A version of `Quotient.recOnSubsingleton₂` taking `{s₁ : Setoid α} {s₂ : Setoid α}`
as implicit arguments instead of instance arguments. -/
--- porting note: removed `@[reducible]` because it caused extremely slow `simp`
+-- porting note (#11083): removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOnSubsingleton₂' {φ : Quotient s₁ → Quotient s₂ → Sort*}
[∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)]
@@ -367,7 +367,7 @@ noncomputable def Quot.out {r : α → α → Prop} (q : Quot r) : α :=
/-- Unwrap the VM representation of a quotient to obtain an element of the equivalence class.
Computable but unsound. -/
unsafe def Quot.unquot {r : α → α → Prop} : Quot r → α :=
- cast lcProof -- porting notes: was `unchecked_cast` before, which unfolds to `cast undefined`
+ cast lcProof -- Porting note: was `unchecked_cast` before, which unfolds to `cast undefined`
@[simp]
theorem Quot.out_eq {r : α → α → Prop} (q : Quot r) : Quot.mk r q.out = q :=
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl
-/
import Mathlib.Init.Data.Quot
import Mathlib.Logic.Relator
+import Mathlib.Logic.Unique
import Mathlib.Mathport.Notation
#align_import data.quot from "leanprover-community/mathlib"@"6ed6abbde29b8f630001a1b481603f657a3384f1"
@@ -55,6 +56,8 @@ protected instance Subsingleton [Subsingleton α] : Subsingleton (Quot ra) :=
⟨fun x ↦ Quot.induction_on x fun _ ↦ Quot.ind fun _ ↦ congr_arg _ (Subsingleton.elim _ _)⟩
#align quot.subsingleton Quot.Subsingleton
+instance [Unique α] : Unique (Quot ra) := Unique.mk' _
+
/-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
protected def hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧)
(ca : ∀ {b a₁ a₂}, ra a₁ a₂ → HEq (f a₁ b) (f a₂ b))
@@ -230,6 +233,8 @@ instance instInhabitedQuotient (s : Setoid α) [Inhabited α] : Inhabited (Quoti
instance instSubsingletonQuotient (s : Setoid α) [Subsingleton α] : Subsingleton (Quotient s) :=
Quot.Subsingleton
+instance instUniqueQuotient (s : Setoid α) [Unique α] : Unique (Quotient s) := Unique.mk' _
+
instance {α : Type*} [Setoid α] : IsEquiv α (· ≈ ·) where
refl := Setoid.refl
symm _ _ := Setoid.symm
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -804,7 +804,7 @@ section
variable [s : Setoid α]
-protected theorem mk''_eq_mk (x : α) : Quotient.mk'' x = Quotient.mk s x :=
+protected theorem mk''_eq_mk : Quotient.mk'' = Quotient.mk s :=
rfl
@[simp]
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl
-/
import Mathlib.Init.Data.Quot
import Mathlib.Logic.Relator
+import Mathlib.Mathport.Notation
#align_import data.quot from "leanprover-community/mathlib"@"6ed6abbde29b8f630001a1b481603f657a3384f1"
@@ -39,8 +40,8 @@ namespace Quot
variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Quot rb → Sort*}
-- mathport name: mk
-@[inherit_doc]
-local notation:arg "⟦" a "⟧" => Quot.mk _ a
+@[inherit_doc Quot.mk]
+local notation3:arg "⟦" a "⟧" => Quot.mk _ a
@[elab_as_elim]
protected theorem induction_on {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop} (q : Quot r)
@@ -220,8 +221,8 @@ variable {φ : Quotient sa → Quotient sb → Sort*}
-- We have not yet decided which one works best, since the setoid instance can't always be
-- reliably found but it can't always be inferred from the expected type either.
-- See also: https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/confusion.20between.20equivalence.20and.20instance.20setoid/near/360822354
-@[inherit_doc]
-notation:arg "⟦" a "⟧" => Quotient.mk _ a
+@[inherit_doc Quotient.mk]
+notation3:arg "⟦" a "⟧" => Quotient.mk _ a
instance instInhabitedQuotient (s : Setoid α) [Inhabited α] : Inhabited (Quotient s) :=
⟨⟦default⟧⟩
Type _
before the colon (#7718)
We have turned to Type*
instead of Type _
, but many of them remained in mathlib because the straight replacement did not work. In general, having Type _
before the colon is a code smell, though, as it hides which types should be in the same universe and which shouldn't, and is not very robust.
This PR replaces most of the remaining Type _
before the colon (except those in category theory) by Type*
or Type u
. This has uncovered a few bugs (where declarations were not as polymorphic as they should be).
I had to increase heartbeats at two places when replacing Type _
by Type*
, but I think it's worth it as it's really more robust.
@@ -839,7 +839,7 @@ instance (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → Prop)
end Quotient
@[simp]
-lemma Equivalence.quot_mk_eq_iff {α : Type _} {r : α → α → Prop} (h : Equivalence r) (x y : α) :
+lemma Equivalence.quot_mk_eq_iff {α : Type*} {r : α → α → Prop} (h : Equivalence r) (x y : α) :
Quot.mk r x = Quot.mk r y ↔ r x y := by
constructor
· rw [Quot.eq]
@@ -102,7 +102,7 @@ theorem lift_mk (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a
#align quot.lift_mk Quot.lift_mk
theorem liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) :
- Quot.liftOn (Quot.mk r a) f h = f a :=
+ Quot.liftOn (Quot.mk r a) f h = f a :=
rfl
#align quot.lift_on_mk Quot.liftOn_mk
Quotient.exists
(#7220)
Also forall_quotient_iff {α : Type*} [r : Setoid α] ...
-> Quotient.forall {α : Sort*} {s : Setoid α} ...
@@ -299,15 +299,19 @@ theorem Quot.eq {α : Type*} {r : α → α → Prop} {x y : α} :
theorem Quotient.eq [r : Setoid α] {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x ≈ y :=
⟨Quotient.exact, Quotient.sound⟩
-theorem forall_quotient_iff {α : Type*} [r : Setoid α] {p : Quotient r → Prop} :
- (∀ a : Quotient r, p a) ↔ ∀ a : α, p ⟦a⟧ :=
- ⟨fun h _ ↦ h _, fun h a ↦ a.induction_on h⟩
-#align forall_quotient_iff forall_quotient_iff
+theorem Quotient.forall {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} :
+ (∀ a, p a) ↔ ∀ a : α, p ⟦a⟧ :=
+ ⟨fun h _ ↦ h _, fun h a ↦ a.ind h⟩
+#align forall_quotient_iff Quotient.forall
+
+theorem Quotient.exists {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} :
+ (∃ a, p a) ↔ ∃ a : α, p ⟦a⟧ :=
+ ⟨fun ⟨q, hq⟩ ↦ q.ind (motive := (p · → _)) .intro hq, fun ⟨a, ha⟩ ↦ ⟨⟦a⟧, ha⟩⟩
@[simp]
theorem Quotient.lift_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.lift f h (Quotient.mk s x) = f x :=
-rfl
+ rfl
#align quotient.lift_mk Quotient.lift_mk
@[simp]
It is shown in this PR that when an equivalence relation on morphisms in a preadditive category is compatible with the addition, then the quotient category is preadditive.
@@ -833,3 +833,16 @@ instance (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → Prop)
Quotient.lift₂.decidablePred _ h _ _
end Quotient
+
+@[simp]
+lemma Equivalence.quot_mk_eq_iff {α : Type _} {r : α → α → Prop} (h : Equivalence r) (x y : α) :
+ Quot.mk r x = Quot.mk r y ↔ r x y := by
+ constructor
+ · rw [Quot.eq]
+ intro hxy
+ induction hxy with
+ | rel _ _ H => exact H
+ | refl _ => exact h.refl _
+ | symm _ _ _ H => exact h.symm H
+ | trans _ _ _ _ _ h₁₂ h₂₃ => exact h.trans h₁₂ h₂₃
+ · exact Quot.sound
The mathlib3 lemma is about quotient.mk, which takes an instance argument and is translated into mathlib4 as Quotient.mk'.
@@ -342,11 +342,11 @@ theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.
Quot.exists_rep
#align surjective_quot_mk surjective_quot_mk
-/-- `Quotient.mk` is a surjective function. -/
-theorem surjective_quotient_mk (α : Sort*) [s : Setoid α] :
- Function.Surjective (Quotient.mk _ : α → Quotient s) :=
+/-- `Quotient.mk'` is a surjective function. -/
+theorem surjective_quotient_mk' (α : Sort*) [s : Setoid α] :
+ Function.Surjective (Quotient.mk' : α → Quotient s) :=
Quot.exists_rep
-#align surjective_quotient_mk surjective_quotient_mk
+#align surjective_quotient_mk surjective_quotient_mk'
/-- Choose an element of the equivalence class using the axiom of choice.
Sound but noncomputable. -/
Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.
The intent of this PR is to make autoImplicit
opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true
in the few files that rely on it.
That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.
I claim that many of the uses of autoImplicit
in these files are accidental; situations such as:
variables
are in scope, but pasting the lemma in the wrong sectionHaving set_option autoImplicit false
as the default prevents these types of mistake being made in the 90% of files where autoImplicit
s are not used at all, and causes them to be caught by CI during review.
I think there were various points during the port where we encouraged porters to delete the universes u v
lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.
A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18
as the no:dontcare:yes
vote ratio.
While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true
has been placed locally within a section, rather than at the top of the file.
@@ -15,6 +15,8 @@ This module extends the core library's treatment of quotient types (`Init.Core`)
quotient
-/
+set_option autoImplicit true
+
variable {α : Sort*} {β : Sort*}
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -16,13 +16,13 @@ quotient
-/
-variable {α : Sort _} {β : Sort _}
+variable {α : Sort*} {β : Sort*}
namespace Setoid
#align setoid.r Setoid.r
-theorem ext {α : Sort _} : ∀ {s t : Setoid α},
+theorem ext {α : Sort*} : ∀ {s t : Setoid α},
(∀ a b, @Setoid.r α s a b ↔ @Setoid.r α t a b) → s = t
| ⟨r, _⟩, ⟨p, _⟩, Eq =>
by have : r = p := funext fun a ↦ funext fun b ↦ propext <| Eq a b
@@ -34,7 +34,7 @@ end Setoid
namespace Quot
-variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Quot rb → Sort _}
+variable {ra : α → α → Prop} {rb : β → β → Prop} {φ : Quot ra → Quot rb → Sort*}
-- mathport name: mk
@[inherit_doc]
@@ -81,16 +81,16 @@ protected def mapRight {ra' : α → α → Prop} (h : ∀ a₁ a₂, ra a₁ a
#align quot.map_right Quot.mapRight
/-- Weaken the relation of a quotient. This is the same as `Quot.map id`. -/
-def factor {α : Type _} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) : Quot r → Quot s :=
+def factor {α : Type*} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) : Quot r → Quot s :=
Quot.lift (Quot.mk s) fun x y rxy ↦ Quot.sound (h x y rxy)
#align quot.factor Quot.factor
-theorem factor_mk_eq {α : Type _} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) :
+theorem factor_mk_eq {α : Type*} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) :
factor r s h ∘ Quot.mk _ = Quot.mk _ :=
rfl
#align quot.factor_mk_eq Quot.factor_mk_eq
-variable {γ : Sort _} {r : α → α → Prop} {s : β → β → Prop}
+variable {γ : Sort*} {r : α → α → Prop} {s : β → β → Prop}
-- Porting note: used to be an Alias of `quot.lift_beta`.
theorem lift_mk (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) (a : α) :
@@ -160,7 +160,7 @@ theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ →
/-- A binary version of `Quot.recOnSubsingleton`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
-protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort _}
+protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort*}
[h : ∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)] (q₁ : Quot r)
(q₂ : Quot s) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧) : φ q₁ q₂ :=
@Quot.recOnSubsingleton _ r (fun q ↦ φ q q₂)
@@ -211,7 +211,7 @@ namespace Quotient
variable [sa : Setoid α] [sb : Setoid β]
-variable {φ : Quotient sa → Quotient sb → Sort _}
+variable {φ : Quotient sa → Quotient sb → Sort*}
-- Porting note: in mathlib3 this notation took the Setoid as an instance-implicit argument,
-- now it's explicit but left as a metavariable.
@@ -227,7 +227,7 @@ instance instInhabitedQuotient (s : Setoid α) [Inhabited α] : Inhabited (Quoti
instance instSubsingletonQuotient (s : Setoid α) [Subsingleton α] : Subsingleton (Quotient s) :=
Quot.Subsingleton
-instance {α : Type _} [Setoid α] : IsEquiv α (· ≈ ·) where
+instance {α : Type*} [Setoid α] : IsEquiv α (· ≈ ·) where
refl := Setoid.refl
symm _ _ := Setoid.symm
trans _ _ _ := Setoid.trans
@@ -250,7 +250,7 @@ theorem map_mk (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α)
rfl
#align quotient.map_mk Quotient.map_mk
-variable {γ : Sort _} [sc : Setoid γ]
+variable {γ : Sort*} [sc : Setoid γ]
/-- Map a function `f : α → β → γ` that sends equivalent elements to equivalent elements
to a function `f : Quotient sa → Quotient sb → Quotient sc`.
@@ -288,7 +288,7 @@ instance (q₁ : Quotient sa) (q₂ : Quotient sb) (f : α → β → Prop)
end Quotient
-theorem Quot.eq {α : Type _} {r : α → α → Prop} {x y : α} :
+theorem Quot.eq {α : Type*} {r : α → α → Prop} {x y : α} :
Quot.mk r x = Quot.mk r y ↔ EqvGen r x y :=
⟨Quot.exact r, Quot.EqvGen_sound⟩
#align quot.eq Quot.eq
@@ -297,7 +297,7 @@ theorem Quot.eq {α : Type _} {r : α → α → Prop} {x y : α} :
theorem Quotient.eq [r : Setoid α] {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x ≈ y :=
⟨Quotient.exact, Quotient.sound⟩
-theorem forall_quotient_iff {α : Type _} [r : Setoid α] {p : Quotient r → Prop} :
+theorem forall_quotient_iff {α : Type*} [r : Setoid α] {p : Quotient r → Prop} :
(∀ a : Quotient r, p a) ↔ ∀ a : α, p ⟦a⟧ :=
⟨fun h _ ↦ h _, fun h a ↦ a.induction_on h⟩
#align forall_quotient_iff forall_quotient_iff
@@ -315,7 +315,7 @@ theorem Quotient.lift_comp_mk [Setoid α] (f : α → β) (h : ∀ a b : α, a
#align quotient.lift_comp_mk Quotient.lift_comp_mk
@[simp]
-theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α] [Setoid β]
+theorem Quotient.lift₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} [Setoid α] [Setoid β]
(f : α → β → γ)
(h : ∀ (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂)
(a : α) (b : β) :
@@ -329,7 +329,7 @@ theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a
#align quotient.lift_on_mk Quotient.liftOn_mk
@[simp]
-theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α → α → β)
+theorem Quotient.liftOn₂_mk {α : Sort*} {β : Sort*} [Setoid α] (f : α → α → β)
(h : ∀ a₁ a₂ b₁ b₂ : α, a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (x y : α) :
Quotient.liftOn₂ (Quotient.mk _ x) (Quotient.mk _ y) f h = f x y :=
rfl
@@ -341,7 +341,7 @@ theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.
#align surjective_quot_mk surjective_quot_mk
/-- `Quotient.mk` is a surjective function. -/
-theorem surjective_quotient_mk (α : Sort _) [s : Setoid α] :
+theorem surjective_quotient_mk (α : Sort*) [s : Setoid α] :
Function.Surjective (Quotient.mk _ : α → Quotient s) :=
Quot.exists_rep
#align surjective_quotient_mk surjective_quotient_mk
@@ -405,7 +405,7 @@ theorem Quotient.out_inj {s : Setoid α} {x y : Quotient s} : x.out = y.out ↔
section Pi
-instance piSetoid {ι : Sort _} {α : ι → Sort _} [∀ i, Setoid (α i)] : Setoid (∀ i, α i) where
+instance piSetoid {ι : Sort*} {α : ι → Sort*} [∀ i, Setoid (α i)] : Setoid (∀ i, α i) where
r a b := ∀ i, a i ≈ b i
iseqv := ⟨fun _ _ ↦ Setoid.refl _,
fun h _ ↦ Setoid.symm (h _),
@@ -413,20 +413,20 @@ instance piSetoid {ι : Sort _} {α : ι → Sort _} [∀ i, Setoid (α i)] : Se
/-- Given a function `f : Π i, Quotient (S i)`, returns the class of functions `Π i, α i` sending
each `i` to an element of the class `f i`. -/
-noncomputable def Quotient.choice {ι : Type _} {α : ι → Type _} [S : ∀ i, Setoid (α i)]
+noncomputable def Quotient.choice {ι : Type*} {α : ι → Type*} [S : ∀ i, Setoid (α i)]
(f : ∀ i, Quotient (S i)) :
@Quotient (∀ i, α i) (by infer_instance) :=
⟦fun i ↦ (f i).out⟧
#align quotient.choice Quotient.choice
@[simp]
-theorem Quotient.choice_eq {ι : Type _} {α : ι → Type _} [∀ i, Setoid (α i)] (f : ∀ i, α i) :
+theorem Quotient.choice_eq {ι : Type*} {α : ι → Type*} [∀ i, Setoid (α i)] (f : ∀ i, α i) :
(Quotient.choice fun i ↦ ⟦f i⟧) = ⟦f⟧ :=
Quotient.sound fun _ ↦ Quotient.mk_out _
#align quotient.choice_eq Quotient.choice_eq
@[elab_as_elim]
-theorem Quotient.induction_on_pi {ι : Type _} {α : ι → Sort _} [s : ∀ i, Setoid (α i)]
+theorem Quotient.induction_on_pi {ι : Type*} {α : ι → Sort*} [s : ∀ i, Setoid (α i)]
{p : (∀ i, Quotient (s i)) → Prop} (f : ∀ i, Quotient (s i))
(h : ∀ a : ∀ i, α i, p fun i ↦ ⟦a i⟧) : p f := by
rw [← (funext fun i ↦ Quotient.out_eq (f i) : (fun i ↦ ⟦(f i).out⟧) = f)]
@@ -540,7 +540,7 @@ instance : LawfulMonad Trunc where
bind_pure_comp _ _ := rfl
bind_map _ _ := rfl
-variable {C : Trunc α → Sort _}
+variable {C : Trunc α → Sort*}
/-- Recursion/induction principle for `Trunc`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@@ -588,7 +588,7 @@ end Trunc
namespace Quotient
-variable {γ : Sort _} {φ : Sort _} {s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}
+variable {γ : Sort*} {φ : Sort*} {s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}
/-! Versions of quotient definitions and lemmas ending in `'` use unification instead
of typeclass inference for inferring the `Setoid` argument. This is useful when there are
@@ -689,7 +689,7 @@ protected theorem inductionOn₃' {p : Quotient s₁ → Quotient s₂ → Quoti
/-- A version of `Quotient.recOnSubsingleton` taking `{s₁ : Setoid α}` as an implicit argument
instead of an instance argument. -/
@[elab_as_elim]
-protected def recOnSubsingleton' {φ : Quotient s₁ → Sort _} [∀ a, Subsingleton (φ ⟦a⟧)]
+protected def recOnSubsingleton' {φ : Quotient s₁ → Sort*} [∀ a, Subsingleton (φ ⟦a⟧)]
(q : Quotient s₁)
(f : ∀ a, φ (Quotient.mk'' a)) : φ q :=
Quotient.recOnSubsingleton q f
@@ -699,7 +699,7 @@ protected def recOnSubsingleton' {φ : Quotient s₁ → Sort _} [∀ a, Subsing
as implicit arguments instead of instance arguments. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
-protected def recOnSubsingleton₂' {φ : Quotient s₁ → Quotient s₂ → Sort _}
+protected def recOnSubsingleton₂' {φ : Quotient s₁ → Quotient s₂ → Sort*}
[∀ a b, Subsingleton (φ ⟦a⟧ ⟦b⟧)]
(q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : ∀ a₁ a₂, φ (Quotient.mk'' a₁) (Quotient.mk'' a₂)) :
φ q₁ q₂ :=
@@ -707,20 +707,20 @@ protected def recOnSubsingleton₂' {φ : Quotient s₁ → Quotient s₂ → So
#align quotient.rec_on_subsingleton₂' Quotient.recOnSubsingleton₂'
/-- Recursion on a `Quotient` argument `a`, result type depends on `⟦a⟧`. -/
-protected def hrecOn' {φ : Quotient s₁ → Sort _} (qa : Quotient s₁) (f : ∀ a, φ (Quotient.mk'' a))
+protected def hrecOn' {φ : Quotient s₁ → Sort*} (qa : Quotient s₁) (f : ∀ a, φ (Quotient.mk'' a))
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂)) : φ qa :=
Quot.hrecOn qa f c
#align quotient.hrec_on' Quotient.hrecOn'
@[simp]
-theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk'' a))
+theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort*} (f : ∀ a, φ (Quotient.mk'' a))
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂))
(x : α) : (Quotient.mk'' x).hrecOn' f c = f x :=
rfl
#align quotient.hrec_on'_mk' Quotient.hrecOn'_mk''
/-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
-protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa : Quotient s₁)
+protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort*} (qa : Quotient s₁)
(qb : Quotient s₂) (f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b))
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) :
φ qa qb :=
@@ -728,7 +728,7 @@ protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa :
#align quotient.hrec_on₂' Quotient.hrecOn₂'
@[simp]
-theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
+theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort*}
(f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b))
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) (x : α) (qb : Quotient s₂) :
(Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) fun _ _ ↦ c _ _ _ _ (Setoid.refl _) :=
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>
@@ -221,10 +221,10 @@ variable {φ : Quotient sa → Quotient sb → Sort _}
@[inherit_doc]
notation:arg "⟦" a "⟧" => Quotient.mk _ a
-instance (s : Setoid α) [Inhabited α] : Inhabited (Quotient s) :=
+instance instInhabitedQuotient (s : Setoid α) [Inhabited α] : Inhabited (Quotient s) :=
⟨⟦default⟧⟩
-instance (s : Setoid α) [Subsingleton α] : Subsingleton (Quotient s) :=
+instance instSubsingletonQuotient (s : Setoid α) [Subsingleton α] : Subsingleton (Quotient s) :=
Quot.Subsingleton
instance {α : Type _} [Setoid α] : IsEquiv α (· ≈ ·) where
@@ -511,7 +511,7 @@ protected theorem eq (a b : Trunc α) : a = b :=
Trunc.induction_on₂ a b fun _ _ ↦ Quot.sound trivial
#align trunc.eq Trunc.eq
-instance : Subsingleton (Trunc α) :=
+instance instSubsingletonTrunc : Subsingleton (Trunc α) :=
⟨Trunc.eq⟩
/-- The `bind` operator for the `Trunc` monad. -/
@@ -2,15 +2,12 @@
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.quot
-! leanprover-community/mathlib commit 6ed6abbde29b8f630001a1b481603f657a3384f1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Init.Data.Quot
import Mathlib.Logic.Relator
+#align_import data.quot from "leanprover-community/mathlib"@"6ed6abbde29b8f630001a1b481603f657a3384f1"
+
/-!
# Quotient types
This module extends the core library's treatment of quotient types (`Init.Core`).
I ran codespell Mathlib
and got tired halfway through the suggestions.
@@ -145,7 +145,7 @@ theorem liftOn₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b
variable {t : γ → γ → Prop}
-/-- Descends a function `f : α → β → γ` to quotients of `α` and `β` wih values in a quotient of
+/-- Descends a function `f : α → β → γ` to quotients of `α` and `β` with values in a quotient of
`γ`. -/
protected def map₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂))
(hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (q₁ : Quot r) (q₂ : Quot s) : Quot t :=
⟦a⟧
notation (#4306)
The details of this notation changed between mathlib 3 and 4, so we should leave a porting note about this change and give a bit motivation (the motivation is actually not totally clear anymore).
@@ -216,6 +216,11 @@ variable [sa : Setoid α] [sb : Setoid β]
variable {φ : Quotient sa → Quotient sb → Sort _}
+-- Porting note: in mathlib3 this notation took the Setoid as an instance-implicit argument,
+-- now it's explicit but left as a metavariable.
+-- We have not yet decided which one works best, since the setoid instance can't always be
+-- reliably found but it can't always be inferred from the expected type either.
+-- See also: https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/confusion.20between.20equivalence.20and.20instance.20setoid/near/360822354
@[inherit_doc]
notation:arg "⟦" a "⟧" => Quotient.mk _ a
Now that leanprover/lean4#2210 has been merged, this PR:
set_option synthInstance.etaExperiment true
commands (and some etaExperiment%
term elaborators)set_option maxHeartbeats
commandsCo-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>
@@ -826,6 +826,6 @@ instance (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → Prop)
(h : ∀ a₁ b₁ a₂ b₂, @Setoid.r α s₁ a₁ a₂ → @Setoid.r β s₂ b₁ b₂ → f a₁ b₁ = f a₂ b₂)
[∀ a, DecidablePred (f a)] :
Decidable (Quotient.liftOn₂' q₁ q₂ f h) :=
- Quotient.lift₂.decidablePred _ _ _ _
+ Quotient.lift₂.decidablePred _ h _ _
end Quotient
leanprover-community/mathlib#18320 was already forward-ported in #1924.
@@ -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.quot
-! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! leanprover-community/mathlib commit 6ed6abbde29b8f630001a1b481603f657a3384f1
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
This forward-ports the last commits in https://github.com/leanprover-community/mathlib/pull/18320, which was prematurely forward-ported as https://github.com/leanprover-community/mathlib4/pull/1924 before it was merged in mathlib3.
@@ -444,7 +444,9 @@ theorem true_equivalence : @Equivalence α fun _ _ ↦ True :=
⟨fun _ ↦ trivial, fun _ ↦ trivial, fun _ _ ↦ trivial⟩
#align true_equivalence true_equivalence
-/-- Always-true relation as a `Setoid`. -/
+/-- Always-true relation as a `Setoid`.
+
+Note that in later files the preferred spelling is `⊤ : Setoid α`. -/
def trueSetoid : Setoid α :=
⟨_, true_equivalence⟩
#align true_setoid trueSetoid
Trunc
a Quotient
(#1924)
mathlib3 PR: https://github.com/leanprover-community/mathlib/pull/18320
@@ -440,19 +440,24 @@ theorem nonempty_quotient_iff (s : Setoid α) : Nonempty (Quotient s) ↔ Nonemp
/-! ### Truncation -/
+theorem true_equivalence : @Equivalence α fun _ _ ↦ True :=
+ ⟨fun _ ↦ trivial, fun _ ↦ trivial, fun _ _ ↦ trivial⟩
+#align true_equivalence true_equivalence
+
+/-- Always-true relation as a `Setoid`. -/
+def trueSetoid : Setoid α :=
+ ⟨_, true_equivalence⟩
+#align true_setoid trueSetoid
+
/-- `Trunc α` is the quotient of `α` by the always-true relation. This
is related to the propositional truncation in HoTT, and is similar
in effect to `Nonempty α`, but unlike `Nonempty α`, `Trunc α` is data,
so the VM representation is the same as `α`, and so this can be used to
maintain computability. -/
def Trunc.{u} (α : Sort u) : Sort u :=
- @Quot α fun _ _ ↦ True
+ @Quotient α trueSetoid
#align trunc Trunc
-theorem true_equivalence : @Equivalence α fun _ _ ↦ True :=
- ⟨fun _ ↦ trivial, fun _ ↦ trivial, fun _ _ ↦ trivial⟩
-#align true_equivalence true_equivalence
-
namespace Trunc
/-- Constructor for `Trunc α` -/
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)@@ -31,6 +31,7 @@ theorem ext {α : Sort _} : ∀ {s t : Setoid α},
by have : r = p := funext fun a ↦ funext fun b ↦ propext <| Eq a b
subst this
rfl
+#align setoid.ext Setoid.ext
end Setoid
@@ -68,24 +69,29 @@ protected def hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧
have h₂ : HEq (f a₂ b) (@Quot.hrecOn _ _ (φ _) ⟦b⟧ (f a₂) (@cb _)) :=
by simp [heq_self_iff_true]
(h₁.trans (ca pa)).trans h₂
+#align quot.hrec_on₂ Quot.hrecOn₂
/-- Map a function `f : α → β` such that `ra x y` implies `rb (f x) (f y)`
to a map `Quot ra → Quot rb`. -/
protected def map (f : α → β) (h : (ra ⇒ rb) f f) : Quot ra → Quot rb :=
(Quot.lift fun x ↦ ⟦f x⟧) fun x y (h₁ : ra x y) ↦ Quot.sound <| h h₁
+#align quot.map Quot.map
/-- If `ra` is a subrelation of `ra'`, then we have a natural map `Quot ra → Quot ra'`. -/
protected def mapRight {ra' : α → α → Prop} (h : ∀ a₁ a₂, ra a₁ a₂ → ra' a₁ a₂) :
Quot ra → Quot ra' :=
Quot.map id h
+#align quot.map_right Quot.mapRight
/-- Weaken the relation of a quotient. This is the same as `Quot.map id`. -/
def factor {α : Type _} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) : Quot r → Quot s :=
Quot.lift (Quot.mk s) fun x y rxy ↦ Quot.sound (h x y rxy)
+#align quot.factor Quot.factor
theorem factor_mk_eq {α : Type _} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) :
factor r s h ∘ Quot.mk _ = Quot.mk _ :=
rfl
+#align quot.factor_mk_eq Quot.factor_mk_eq
variable {γ : Sort _} {r : α → α → Prop} {s : β → β → Prop}
@@ -94,6 +100,7 @@ theorem lift_mk (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a
Quot.lift f h (Quot.mk r a) = f a :=
rfl
#align quot.lift_beta Quot.lift_mk
+#align quot.lift_mk Quot.lift_mk
theorem liftOn_mk (a : α) (f : α → γ) (h : ∀ a₁ a₂, r a₁ a₂ → f a₁ = f a₂) :
Quot.liftOn (Quot.mk r a) f h = f a :=
@@ -112,12 +119,14 @@ protected def lift₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) (q₁ : Quot r) (q₂ : Quot s) : γ :=
Quot.lift (fun a ↦ Quot.lift (f a) (hr a))
(fun a₁ a₂ ha ↦ funext fun q ↦ Quot.induction_on q fun b ↦ hs a₁ a₂ b ha) q₁ q₂
+#align quot.lift₂ Quot.lift₂
@[simp]
theorem lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
(hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b)
(a : α) (b : β) : Quot.lift₂ f hr hs (Quot.mk r a) (Quot.mk s b) = f a b :=
rfl
+#align quot.lift₂_mk Quot.lift₂_mk
/-- Descends a function `f : α → β → γ` to quotients of `α` and `β` and applies it. -/
-- porting note: removed `@[elab_as_elim]`, gave "unexpected resulting type γ"
@@ -125,6 +134,7 @@ theorem lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ →
protected def liftOn₂ (p : Quot r) (q : Quot s) (f : α → β → γ)
(hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b) : γ :=
Quot.lift₂ f hr hs p q
+#align quot.lift_on₂ Quot.liftOn₂
@[simp]
theorem liftOn₂_mk (a : α) (b : β) (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
@@ -141,12 +151,14 @@ protected def map₂ (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂
(hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (q₁ : Quot r) (q₂ : Quot s) : Quot t :=
Quot.lift₂ (fun a b ↦ Quot.mk t <| f a b) (fun a b₁ b₂ hb ↦ Quot.sound (hr a b₁ b₂ hb))
(fun a₁ a₂ b ha ↦ Quot.sound (hs a₁ a₂ b ha)) q₁ q₂
+#align quot.map₂ Quot.map₂
@[simp]
theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂))
(hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (a : α) (b : β) :
Quot.map₂ f hr hs (Quot.mk r a) (Quot.mk s b) = Quot.mk t (f a b) :=
rfl
+#align quot.map₂_mk Quot.map₂_mk
/-- A binary version of `Quot.recOnSubsingleton`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@@ -157,11 +169,13 @@ protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort _}
@Quot.recOnSubsingleton _ r (fun q ↦ φ q q₂)
(fun a ↦ Quot.ind (β := λ b => Subsingleton (φ (mk r a) b)) (h a) q₂) q₁
fun a ↦ Quot.recOnSubsingleton q₂ fun b ↦ f a b
+#align quot.rec_on_subsingleton₂ Quot.recOnSubsingleton₂
@[elab_as_elim]
protected theorem induction_on₂ {δ : Quot r → Quot s → Prop} (q₁ : Quot r) (q₂ : Quot s)
(h : ∀ a b, δ (Quot.mk r a) (Quot.mk s b)) : δ q₁ q₂ :=
Quot.ind (β := λ a => δ a q₂) (fun a₁ ↦ Quot.ind (fun a₂ ↦ h a₁ a₂) q₂) q₁
+#align quot.induction_on₂ Quot.induction_on₂
@[elab_as_elim]
protected theorem induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (q₁ : Quot r)
@@ -169,6 +183,7 @@ protected theorem induction_on₃ {δ : Quot r → Quot s → Quot t → Prop} (
δ q₁ q₂ q₃ :=
Quot.ind (β := λ a => δ a q₂ q₃) (fun a₁ ↦ Quot.ind (β := λ b => δ _ b q₃)
(fun a₂ ↦ Quot.ind (fun a₃ ↦ h a₁ a₂ a₃) q₃) q₂) q₁
+#align quot.induction_on₃ Quot.induction_on₃
instance lift.decidablePred (r : α → α → Prop) (f : α → Prop) (h : ∀ a b, r a b → f a = f b)
[hf : DecidablePred f] :
@@ -219,16 +234,19 @@ instance {α : Type _} [Setoid α] : IsEquiv α (· ≈ ·) where
protected def hrecOn₂ (qa : Quotient sa) (qb : Quotient sb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧)
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) : φ qa qb :=
Quot.hrecOn₂ qa qb f (fun p ↦ c _ _ _ _ p (Setoid.refl _)) fun p ↦ c _ _ _ _ (Setoid.refl _) p
+#align quotient.hrec_on₂ Quotient.hrecOn₂
/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements
to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/
protected def map (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) : Quotient sa → Quotient sb :=
Quot.map f h
+#align quotient.map Quotient.map
@[simp]
theorem map_mk (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) :
Quotient.map f h (⟦x⟧ : Quotient sa) = (⟦f x⟧ : Quotient sb) :=
rfl
+#align quotient.map_mk Quotient.map_mk
variable {γ : Sort _} [sc : Setoid γ]
@@ -238,11 +256,13 @@ Useful to define binary operations on quotients. -/
protected def map₂ (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) :
Quotient sa → Quotient sb → Quotient sc :=
Quotient.lift₂ (fun x y ↦ ⟦f x y⟧) fun _ _ _ _ h₁ h₂ ↦ Quot.sound <| h h₁ h₂
+#align quotient.map₂ Quotient.map₂
@[simp]
theorem map₂_mk (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α) (y : β) :
Quotient.map₂ f h (⟦x⟧ : Quotient sa) (⟦y⟧ : Quotient sb) = (⟦f x y⟧ : Quotient sc) :=
rfl
+#align quotient.map₂_mk Quotient.map₂_mk
instance lift.decidablePred (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f b) [DecidablePred f] :
DecidablePred (Quotient.lift f h) :=
@@ -269,6 +289,7 @@ end Quotient
theorem Quot.eq {α : Type _} {r : α → α → Prop} {x y : α} :
Quot.mk r x = Quot.mk r y ↔ EqvGen r x y :=
⟨Quot.exact r, Quot.EqvGen_sound⟩
+#align quot.eq Quot.eq
@[simp]
theorem Quotient.eq [r : Setoid α] {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x ≈ y :=
@@ -277,16 +298,19 @@ theorem Quotient.eq [r : Setoid α] {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x
theorem forall_quotient_iff {α : Type _} [r : Setoid α] {p : Quotient r → Prop} :
(∀ a : Quotient r, p a) ↔ ∀ a : α, p ⟦a⟧ :=
⟨fun h _ ↦ h _, fun h a ↦ a.induction_on h⟩
+#align forall_quotient_iff forall_quotient_iff
@[simp]
theorem Quotient.lift_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.lift f h (Quotient.mk s x) = f x :=
rfl
+#align quotient.lift_mk Quotient.lift_mk
@[simp]
theorem Quotient.lift_comp_mk [Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) :
Quotient.lift f h ∘ Quotient.mk _ = f :=
rfl
+#align quotient.lift_comp_mk Quotient.lift_comp_mk
@[simp]
theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α] [Setoid β]
@@ -295,6 +319,7 @@ theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α
(a : α) (b : β) :
Quotient.lift₂ f h (Quotient.mk _ a) (Quotient.mk _ b) = f a b :=
rfl
+#align quotient.lift₂_mk Quotient.lift₂_mk
theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.liftOn (Quotient.mk s x) f h = f x :=
@@ -311,16 +336,19 @@ theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α
/-- `Quot.mk r` is a surjective function. -/
theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r) :=
Quot.exists_rep
+#align surjective_quot_mk surjective_quot_mk
/-- `Quotient.mk` is a surjective function. -/
theorem surjective_quotient_mk (α : Sort _) [s : Setoid α] :
Function.Surjective (Quotient.mk _ : α → Quotient s) :=
Quot.exists_rep
+#align surjective_quotient_mk surjective_quotient_mk
/-- Choose an element of the equivalence class using the axiom of choice.
Sound but noncomputable. -/
noncomputable def Quot.out {r : α → α → Prop} (q : Quot r) : α :=
Classical.choose (Quot.exists_rep q)
+#align quot.out Quot.out
/-- Unwrap the VM representation of a quotient to obtain an element of the equivalence class.
Computable but unsound. -/
@@ -330,39 +358,48 @@ unsafe def Quot.unquot {r : α → α → Prop} : Quot r → α :=
@[simp]
theorem Quot.out_eq {r : α → α → Prop} (q : Quot r) : Quot.mk r q.out = q :=
Classical.choose_spec (Quot.exists_rep q)
+#align quot.out_eq Quot.out_eq
/-- Choose an element of the equivalence class using the axiom of choice.
Sound but noncomputable. -/
noncomputable def Quotient.out [s : Setoid α] : Quotient s → α :=
Quot.out
+#align quotient.out Quotient.out
@[simp]
theorem Quotient.out_eq [s : Setoid α] (q : Quotient s) : ⟦q.out⟧ = q :=
Quot.out_eq q
+#align quotient.out_eq Quotient.out_eq
theorem Quotient.mk_out [Setoid α] (a : α) : ⟦a⟧.out ≈ a :=
Quotient.exact (Quotient.out_eq _)
+#align quotient.mk_out Quotient.mk_out
theorem Quotient.mk_eq_iff_out [s : Setoid α] {x : α} {y : Quotient s} :
⟦x⟧ = y ↔ x ≈ Quotient.out y := by
refine' Iff.trans _ Quotient.eq
rw [Quotient.out_eq y]
+#align quotient.mk_eq_iff_out Quotient.mk_eq_iff_out
theorem Quotient.eq_mk_iff_out [s : Setoid α] {x : Quotient s} {y : α} :
x = ⟦y⟧ ↔ Quotient.out x ≈ y := by
refine' Iff.trans _ Quotient.eq
rw [Quotient.out_eq x]
+#align quotient.eq_mk_iff_out Quotient.eq_mk_iff_out
@[simp]
theorem Quotient.out_equiv_out {s : Setoid α} {x y : Quotient s} : x.out ≈ y.out ↔ x = y := by
rw [← Quotient.eq_mk_iff_out, Quotient.out_eq]
+#align quotient.out_equiv_out Quotient.out_equiv_out
theorem Quotient.out_injective {s : Setoid α} : Function.Injective (@Quotient.out α s) :=
fun _ _ h ↦ Quotient.out_equiv_out.1 <| h ▸ Setoid.refl _
+#align quotient.out_injective Quotient.out_injective
@[simp]
theorem Quotient.out_inj {s : Setoid α} {x y : Quotient s} : x.out = y.out ↔ x = y :=
⟨fun h ↦ Quotient.out_injective h, fun h ↦ h ▸ rfl⟩
+#align quotient.out_inj Quotient.out_inj
section Pi
@@ -378,11 +415,13 @@ noncomputable def Quotient.choice {ι : Type _} {α : ι → Type _} [S : ∀ i,
(f : ∀ i, Quotient (S i)) :
@Quotient (∀ i, α i) (by infer_instance) :=
⟦fun i ↦ (f i).out⟧
+#align quotient.choice Quotient.choice
@[simp]
theorem Quotient.choice_eq {ι : Type _} {α : ι → Type _} [∀ i, Setoid (α i)] (f : ∀ i, α i) :
(Quotient.choice fun i ↦ ⟦f i⟧) = ⟦f⟧ :=
Quotient.sound fun _ ↦ Quotient.mk_out _
+#align quotient.choice_eq Quotient.choice_eq
@[elab_as_elim]
theorem Quotient.induction_on_pi {ι : Type _} {α : ι → Sort _} [s : ∀ i, Setoid (α i)]
@@ -390,11 +429,13 @@ theorem Quotient.induction_on_pi {ι : Type _} {α : ι → Sort _} [s : ∀ i,
(h : ∀ a : ∀ i, α i, p fun i ↦ ⟦a i⟧) : p f := by
rw [← (funext fun i ↦ Quotient.out_eq (f i) : (fun i ↦ ⟦(f i).out⟧) = f)]
apply h
+#align quotient.induction_on_pi Quotient.induction_on_pi
end Pi
theorem nonempty_quotient_iff (s : Setoid α) : Nonempty (Quotient s) ↔ Nonempty α :=
⟨fun ⟨a⟩ ↦ Quotient.inductionOn a Nonempty.intro, fun ⟨a⟩ ↦ ⟨⟦a⟧⟩⟩
+#align nonempty_quotient_iff nonempty_quotient_iff
/-! ### Truncation -/
@@ -406,15 +447,18 @@ theorem nonempty_quotient_iff (s : Setoid α) : Nonempty (Quotient s) ↔ Nonemp
maintain computability. -/
def Trunc.{u} (α : Sort u) : Sort u :=
@Quot α fun _ _ ↦ True
+#align trunc Trunc
theorem true_equivalence : @Equivalence α fun _ _ ↦ True :=
⟨fun _ ↦ trivial, fun _ ↦ trivial, fun _ _ ↦ trivial⟩
+#align true_equivalence true_equivalence
namespace Trunc
/-- Constructor for `Trunc α` -/
def mk (a : α) : Trunc α :=
Quot.mk _ a
+#align trunc.mk Trunc.mk
instance [Inhabited α] : Inhabited (Trunc α) :=
⟨mk default⟩
@@ -422,33 +466,41 @@ instance [Inhabited α] : Inhabited (Trunc α) :=
/-- Any constant function lifts to a function out of the truncation -/
def lift (f : α → β) (c : ∀ a b : α, f a = f b) : Trunc α → β :=
Quot.lift f fun a b _ ↦ c a b
+#align trunc.lift Trunc.lift
theorem ind {β : Trunc α → Prop} : (∀ a : α, β (mk a)) → ∀ q : Trunc α, β q :=
Quot.ind
+#align trunc.ind Trunc.ind
protected theorem lift_mk (f : α → β) (c) (a : α) : lift f c (mk a) = f a :=
rfl
+#align trunc.lift_mk Trunc.lift_mk
/-- Lift a constant function on `q : Trunc α`. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn (q : Trunc α) (f : α → β) (c : ∀ a b : α, f a = f b) : β :=
lift f c q
+#align trunc.lift_on Trunc.liftOn
@[elab_as_elim]
protected theorem induction_on {β : Trunc α → Prop} (q : Trunc α) (h : ∀ a, β (mk a)) : β q :=
ind h q
+#align trunc.induction_on Trunc.induction_on
theorem exists_rep (q : Trunc α) : ∃ a : α, mk a = q :=
Quot.exists_rep q
+#align trunc.exists_rep Trunc.exists_rep
@[elab_as_elim]
protected theorem induction_on₂ {C : Trunc α → Trunc β → Prop} (q₁ : Trunc α) (q₂ : Trunc β)
(h : ∀ a b, C (mk a) (mk b)) : C q₁ q₂ :=
Trunc.induction_on q₁ fun a₁ ↦ Trunc.induction_on q₂ (h a₁)
+#align trunc.induction_on₂ Trunc.induction_on₂
protected theorem eq (a b : Trunc α) : a = b :=
Trunc.induction_on₂ a b fun _ _ ↦ Quot.sound trivial
+#align trunc.eq Trunc.eq
instance : Subsingleton (Trunc α) :=
⟨Trunc.eq⟩
@@ -456,10 +508,12 @@ instance : Subsingleton (Trunc α) :=
/-- The `bind` operator for the `Trunc` monad. -/
def bind (q : Trunc α) (f : α → Trunc β) : Trunc β :=
Trunc.liftOn q f fun _ _ ↦ Trunc.eq _ _
+#align trunc.bind Trunc.bind
/-- A function `f : α → β` defines a function `map f : Trunc α → Trunc β`. -/
def map (f : α → β) (q : Trunc α) : Trunc β :=
bind q (Trunc.mk ∘ f)
+#align trunc.map Trunc.map
instance : Monad Trunc where
pure := @Trunc.mk
@@ -486,6 +540,7 @@ protected def rec (f : ∀ a, C (mk a))
(h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b)
(q : Trunc α) : C q :=
Quot.rec f (fun a b _ ↦ h a b) q
+#align trunc.rec Trunc.rec
/-- A version of `Trunc.rec` taking `q : Trunc α` as the first argument. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@@ -493,6 +548,7 @@ protected def rec (f : ∀ a, C (mk a))
protected def recOn (q : Trunc α) (f : ∀ a, C (mk a))
(h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b) : C q :=
Trunc.rec f h q
+#align trunc.rec_on Trunc.recOn
/-- A version of `Trunc.recOn` assuming the codomain is a `Subsingleton`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@@ -500,17 +556,21 @@ protected def recOn (q : Trunc α) (f : ∀ a, C (mk a))
protected def recOnSubsingleton [∀ a, Subsingleton (C (mk a))] (q : Trunc α) (f : ∀ a, C (mk a)) :
C q :=
Trunc.rec f (fun _ b ↦ Subsingleton.elim _ (f b)) q
+#align trunc.rec_on_subsingleton Trunc.recOnSubsingleton
/-- Noncomputably extract a representative of `Trunc α` (using the axiom of choice). -/
noncomputable def out : Trunc α → α :=
Quot.out
+#align trunc.out Trunc.out
@[simp]
theorem out_eq (q : Trunc α) : mk q.out = q :=
Trunc.eq _ _
+#align trunc.out_eq Trunc.out_eq
protected theorem nonempty (q : Trunc α) : Nonempty α :=
nonempty_of_exists q.exists_rep
+#align trunc.nonempty Trunc.nonempty
end Trunc
@@ -547,6 +607,7 @@ instance argument. -/
protected def liftOn' (q : Quotient s₁) (f : α → φ) (h : ∀ a b, @Setoid.r α s₁ a b → f a = f b) :
φ :=
Quotient.liftOn q f h
+#align quotient.lift_on' Quotient.liftOn'
@[simp]
protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
@@ -565,6 +626,7 @@ instead of instance arguments. -/
protected def liftOn₂' (q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : α → β → γ)
(h : ∀ a₁ a₂ b₁ b₂, @Setoid.r α s₁ a₁ b₁ → @Setoid.r β s₂ a₂ b₂ → f a₁ a₂ = f b₁ b₂) : γ :=
Quotient.liftOn₂ q₁ q₂ f h
+#align quotient.lift_on₂' Quotient.liftOn₂'
@[simp]
protected theorem liftOn₂'_mk'' (f : α → β → γ) (h) (a : α) (b : β) :
@@ -577,6 +639,7 @@ instance argument. -/
protected theorem ind' {p : Quotient s₁ → Prop} (h : ∀ a, p (Quotient.mk'' a)) (q : Quotient s₁) :
p q :=
Quotient.ind h q
+#align quotient.ind' Quotient.ind'
/-- A version of `Quotient.ind₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments
instead of instance arguments. -/
@@ -585,6 +648,7 @@ protected theorem ind₂' {p : Quotient s₁ → Quotient s₂ → Prop}
(h : ∀ a₁ a₂, p (Quotient.mk'' a₁) (Quotient.mk'' a₂))
(q₁ : Quotient s₁) (q₂ : Quotient s₂) : p q₁ q₂ :=
Quotient.ind₂ h q₁ q₂
+#align quotient.ind₂' Quotient.ind₂'
/-- A version of `Quotient.inductionOn` taking `{s : Setoid α}` as an implicit argument instead
of an instance argument. -/
@@ -620,6 +684,7 @@ protected def recOnSubsingleton' {φ : Quotient s₁ → Sort _} [∀ a, Subsing
(q : Quotient s₁)
(f : ∀ a, φ (Quotient.mk'' a)) : φ q :=
Quotient.recOnSubsingleton q f
+#align quotient.rec_on_subsingleton' Quotient.recOnSubsingleton'
/-- A version of `Quotient.recOnSubsingleton₂` taking `{s₁ : Setoid α} {s₂ : Setoid α}`
as implicit arguments instead of instance arguments. -/
@@ -630,11 +695,13 @@ protected def recOnSubsingleton₂' {φ : Quotient s₁ → Quotient s₂ → So
(q₁ : Quotient s₁) (q₂ : Quotient s₂) (f : ∀ a₁ a₂, φ (Quotient.mk'' a₁) (Quotient.mk'' a₂)) :
φ q₁ q₂ :=
Quotient.recOnSubsingleton₂ q₁ q₂ f
+#align quotient.rec_on_subsingleton₂' Quotient.recOnSubsingleton₂'
/-- Recursion on a `Quotient` argument `a`, result type depends on `⟦a⟧`. -/
protected def hrecOn' {φ : Quotient s₁ → Sort _} (qa : Quotient s₁) (f : ∀ a, φ (Quotient.mk'' a))
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂)) : φ qa :=
Quot.hrecOn qa f c
+#align quotient.hrec_on' Quotient.hrecOn'
@[simp]
theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk'' a))
@@ -649,6 +716,7 @@ protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa :
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) :
φ qa qb :=
Quotient.hrecOn₂ qa qb f c
+#align quotient.hrec_on₂' Quotient.hrecOn₂'
@[simp]
theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
@@ -662,6 +730,7 @@ theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/
protected def map' (f : α → β) (h : (s₁.r ⇒ s₂.r) f f) : Quotient s₁ → Quotient s₂ :=
Quot.map f h
+#align quotient.map' Quotient.map'
@[simp]
theorem map'_mk'' (f : α → β) (h) (x : α) :
@@ -672,6 +741,7 @@ theorem map'_mk'' (f : α → β) (h) (x : α) :
protected def map₂' (f : α → β → γ) (h : (s₁.r ⇒ s₂.r ⇒ s₃.r) f f) :
Quotient s₁ → Quotient s₂ → Quotient s₃ :=
Quotient.map₂ f h
+#align quotient.map₂' Quotient.map₂'
@[simp]
theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) :
@@ -682,9 +752,11 @@ theorem map₂'_mk'' (f : α → β → γ) (h) (x : α) :
theorem exact' {a b : α} :
(Quotient.mk'' a : Quotient s₁) = Quotient.mk'' b → @Setoid.r _ s₁ a b :=
Quotient.exact
+#align quotient.exact' Quotient.exact'
theorem sound' {a b : α} : @Setoid.r _ s₁ a b → @Quotient.mk'' α s₁ a = Quotient.mk'' b :=
Quotient.sound
+#align quotient.sound' Quotient.sound'
@[simp]
protected theorem eq' [s₁ : Setoid α] {a b : α} :
@@ -701,13 +773,16 @@ protected theorem eq'' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b
instance argument. -/
noncomputable def out' (a : Quotient s₁) : α :=
Quotient.out a
+#align quotient.out' Quotient.out'
@[simp]
theorem out_eq' (q : Quotient s₁) : Quotient.mk'' q.out' = q :=
q.out_eq
+#align quotient.out_eq' Quotient.out_eq'
theorem mk_out' (a : α) : @Setoid.r α s₁ (Quotient.mk'' a : Quotient s₁).out' a :=
Quotient.exact (Quotient.out_eq _)
+#align quotient.mk_out' Quotient.mk_out'
section
@@ -731,6 +806,7 @@ protected theorem liftOn₂'_mk [t : Setoid β] (f : α → β → γ) (h) (a :
theorem map'_mk [t : Setoid β] (f : α → β) (h) (x : α) :
(Quotient.mk s x).map' f h = (Quotient.mk t (f x)) :=
rfl
+#align quotient.map'_mk Quotient.map'_mk
end
@@ -532,7 +532,8 @@ several different quotient relations on a type, for example quotient groups, rin
instance argument. -/
protected def mk'' (a : α) : Quotient s₁ :=
Quot.mk s₁.1 a
-#align quotient.mk Quotient.mk''
+#align quotient.mk Quotient.mk'
+#align quotient.mk' Quotient.mk''
/-- `Quotient.mk''` is a surjective function. -/
theorem surjective_Quotient_mk'' : Function.Surjective (Quotient.mk'' : α → Quotient s₁) :=
@@ -686,8 +687,15 @@ theorem sound' {a b : α} : @Setoid.r _ s₁ a b → @Quotient.mk'' α s₁ a =
Quotient.sound
@[simp]
-protected theorem eq' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ @Setoid.r _ s₁ a b :=
+protected theorem eq' [s₁ : Setoid α] {a b : α} :
+ @Quotient.mk' α s₁ a = @Quotient.mk' α s₁ b ↔ @Setoid.r _ s₁ a b :=
Quotient.eq
+#align quotient.eq Quotient.eq'
+
+@[simp]
+protected theorem eq'' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ @Setoid.r _ s₁ a b :=
+ Quotient.eq
+#align quotient.eq' Quotient.eq''
/-- A version of `Quotient.out` taking `{s₁ : Setoid α}` as an implicit argument instead of an
instance argument. -/
@@ -299,14 +299,14 @@ theorem Quotient.lift₂_mk {α : Sort _} {β : Sort _} {γ : Sort _} [Setoid α
theorem Quotient.liftOn_mk [s : Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) (x : α) :
Quotient.liftOn (Quotient.mk s x) f h = f x :=
rfl
-#align Quotient.lift_on_mk Quotient.liftOn_mk
+#align quotient.lift_on_mk Quotient.liftOn_mk
@[simp]
theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α → α → β)
(h : ∀ a₁ a₂ b₁ b₂ : α, a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂) (x y : α) :
Quotient.liftOn₂ (Quotient.mk _ x) (Quotient.mk _ y) f h = f x y :=
rfl
-#align Quotient.lift_on₂_mk Quotient.liftOn₂_mk
+#align quotient.lift_on₂_mk Quotient.liftOn₂_mk
/-- `Quot.mk r` is a surjective function. -/
theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r) :=
@@ -640,7 +640,7 @@ theorem hrecOn'_mk'' {φ : Quotient s₁ → Sort _} (f : ∀ a, φ (Quotient.mk
(c : ∀ a₁ a₂, a₁ ≈ a₂ → HEq (f a₁) (f a₂))
(x : α) : (Quotient.mk'' x).hrecOn' f c = f x :=
rfl
-#align quotient.hrec_on'_mk'' Quotient.hrecOn'_mk''
+#align quotient.hrec_on'_mk' Quotient.hrecOn'_mk''
/-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
protected def hrecOn₂' {φ : Quotient s₁ → Quotient s₂ → Sort _} (qa : Quotient s₁)
@@ -655,7 +655,7 @@ theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) (x : α) (qb : Quotient s₂) :
(Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) fun _ _ ↦ c _ _ _ _ (Setoid.refl _) :=
rfl
-#align quotient.hrec_on₂'_mk'' Quotient.hrecOn₂'_mk''
+#align quotient.hrec_on₂'_mk' Quotient.hrecOn₂'_mk''
/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements
to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/
Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2
, add_monoid_hom --> AddMonoidHom
Remove \n
from to_additive
docstrings that were inserted by mathport.
Move files and directories with Gcd
and Smul
to GCD
and SMul
@@ -13,7 +13,7 @@ import Mathlib.Logic.Relator
/-!
# Quotient types
-This module extends the core library's treatment of quotient types (`init.data.quot`).
+This module extends the core library's treatment of quotient types (`Init.Core`).
## Tags
quotient
-/
@@ -54,7 +54,7 @@ protected instance Subsingleton [Subsingleton α] : Subsingleton (Quot ra) :=
⟨fun x ↦ Quot.induction_on x fun _ ↦ Quot.ind fun _ ↦ congr_arg _ (Subsingleton.elim _ _)⟩
#align quot.subsingleton Quot.Subsingleton
-/-- Recursion on two `quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
+/-- Recursion on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
protected def hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧)
(ca : ∀ {b a₁ a₂}, ra a₁ a₂ → HEq (f a₁ b) (f a₂ b))
(cb : ∀ {a b₁ b₂}, rb b₁ b₂ → HEq (f a b₁) (f a b₂)) :
@@ -70,16 +70,16 @@ protected def hrecOn₂ (qa : Quot ra) (qb : Quot rb) (f : ∀ a b, φ ⟦a⟧
(h₁.trans (ca pa)).trans h₂
/-- Map a function `f : α → β` such that `ra x y` implies `rb (f x) (f y)`
-to a map `quot ra → quot rb`. -/
+to a map `Quot ra → Quot rb`. -/
protected def map (f : α → β) (h : (ra ⇒ rb) f f) : Quot ra → Quot rb :=
(Quot.lift fun x ↦ ⟦f x⟧) fun x y (h₁ : ra x y) ↦ Quot.sound <| h h₁
-/-- If `ra` is a subrelation of `ra'`, then we have a natural map `quot ra → quot ra'`. -/
+/-- If `ra` is a subrelation of `ra'`, then we have a natural map `Quot ra → Quot ra'`. -/
protected def mapRight {ra' : α → α → Prop} (h : ∀ a₁ a₂, ra a₁ a₂ → ra' a₁ a₂) :
Quot ra → Quot ra' :=
Quot.map id h
-/-- Weaken the relation of a quotient. This is the same as `quot.map id`. -/
+/-- Weaken the relation of a quotient. This is the same as `Quot.map id`. -/
def factor {α : Type _} (r s : α → α → Prop) (h : ∀ x y, r x y → s x y) : Quot r → Quot s :=
Quot.lift (Quot.mk s) fun x y rxy ↦ Quot.sound (h x y rxy)
@@ -148,7 +148,7 @@ theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ →
Quot.map₂ f hr hs (Quot.mk r a) (Quot.mk s b) = Quot.mk t (f a b) :=
rfl
-/-- A binary version of `quot.rec_on_subsingleton`. -/
+/-- A binary version of `Quot.recOnSubsingleton`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOnSubsingleton₂ {φ : Quot r → Quot s → Sort _}
@@ -175,7 +175,7 @@ instance lift.decidablePred (r : α → α → Prop) (f : α → Prop) (h : ∀
DecidablePred (Quot.lift f h) :=
fun q ↦ Quot.recOnSubsingleton (motive := λ _ => Decidable _) q hf
-/-- Note that this provides `decidable_rel (quot.lift₂ f ha hb)` when `α = β`. -/
+/-- Note that this provides `DecidableRel (Quot.Lift₂ f ha hb)` when `α = β`. -/
instance lift₂.decidablePred (r : α → α → Prop) (s : β → β → Prop) (f : α → β → Prop)
(ha : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂) (hb : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b)
[hf : ∀ a, DecidablePred (f a)] (q₁ : Quot r) :
@@ -215,13 +215,13 @@ instance {α : Type _} [Setoid α] : IsEquiv α (· ≈ ·) where
symm _ _ := Setoid.symm
trans _ _ _ := Setoid.trans
-/-- Induction on two `quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
+/-- Induction on two `Quotient` arguments `a` and `b`, result type depends on `⟦a⟧` and `⟦b⟧`. -/
protected def hrecOn₂ (qa : Quotient sa) (qb : Quotient sb) (f : ∀ a b, φ ⟦a⟧ ⟦b⟧)
(c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) : φ qa qb :=
Quot.hrecOn₂ qa qb f (fun p ↦ c _ _ _ _ p (Setoid.refl _)) fun p ↦ c _ _ _ _ (Setoid.refl _) p
/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements
-to a function `quotient sa → quotient sb`. Useful to define unary operations on quotients. -/
+to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/
protected def map (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) : Quotient sa → Quotient sb :=
Quot.map f h
@@ -233,7 +233,7 @@ theorem map_mk (f : α → β) (h : ((· ≈ ·) ⇒ (· ≈ ·)) f f) (x : α)
variable {γ : Sort _} [sc : Setoid γ]
/-- Map a function `f : α → β → γ` that sends equivalent elements to equivalent elements
-to a function `f : quotient sa → quotient sb → quotient sc`.
+to a function `f : Quotient sa → Quotient sb → Quotient sc`.
Useful to define binary operations on quotients. -/
protected def map₂ (f : α → β → γ) (h : ((· ≈ ·) ⇒ (· ≈ ·) ⇒ (· ≈ ·)) f f) :
Quotient sa → Quotient sb → Quotient sc :=
@@ -248,7 +248,7 @@ instance lift.decidablePred (f : α → Prop) (h : ∀ a b, a ≈ b → f a = f
DecidablePred (Quotient.lift f h) :=
Quot.lift.decidablePred _ _ _
-/-- Note that this provides `decidable_rel (quotient.lift₂ f h)` when `α = β`. -/
+/-- Note that this provides `DecidableRel (Quotient.lift₂ f h)` when `α = β`. -/
instance lift₂.decidablePred (f : α → β → Prop)
(h : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → f a₁ b₁ = f a₂ b₂)
[hf : ∀ a, DecidablePred (f a)]
@@ -308,11 +308,11 @@ theorem Quotient.liftOn₂_mk {α : Sort _} {β : Sort _} [Setoid α] (f : α
rfl
#align Quotient.lift_on₂_mk Quotient.liftOn₂_mk
-/-- `quot.mk r` is a surjective function. -/
+/-- `Quot.mk r` is a surjective function. -/
theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r) :=
Quot.exists_rep
-/-- `quotient.mk` is a surjective function. -/
+/-- `Quotient.mk` is a surjective function. -/
theorem surjective_quotient_mk (α : Sort _) [s : Setoid α] :
Function.Surjective (Quotient.mk _ : α → Quotient s) :=
Quot.exists_rep
@@ -324,7 +324,7 @@ noncomputable def Quot.out {r : α → α → Prop} (q : Quot r) : α :=
/-- Unwrap the VM representation of a quotient to obtain an element of the equivalence class.
Computable but unsound. -/
-unsafe def quot.unquot {r : α → α → Prop} : Quot r → α :=
+unsafe def Quot.unquot {r : α → α → Prop} : Quot r → α :=
cast lcProof -- porting notes: was `unchecked_cast` before, which unfolds to `cast undefined`
@[simp]
@@ -372,7 +372,7 @@ instance piSetoid {ι : Sort _} {α : ι → Sort _} [∀ i, Setoid (α i)] : Se
fun h _ ↦ Setoid.symm (h _),
fun h₁ h₂ _ ↦ Setoid.trans (h₁ _) (h₂ _)⟩
-/-- Given a function `f : Π i, quotient (S i)`, returns the class of functions `Π i, α i` sending
+/-- Given a function `f : Π i, Quotient (S i)`, returns the class of functions `Π i, α i` sending
each `i` to an element of the class `f i`. -/
noncomputable def Quotient.choice {ι : Type _} {α : ι → Type _} [S : ∀ i, Setoid (α i)]
(f : ∀ i, Quotient (S i)) :
@@ -399,9 +399,9 @@ theorem nonempty_quotient_iff (s : Setoid α) : Nonempty (Quotient s) ↔ Nonemp
/-! ### Truncation -/
-/-- `trunc α` is the quotient of `α` by the always-true relation. This
+/-- `Trunc α` is the quotient of `α` by the always-true relation. This
is related to the propositional truncation in HoTT, and is similar
- in effect to `nonempty α`, but unlike `nonempty α`, `trunc α` is data,
+ in effect to `Nonempty α`, but unlike `Nonempty α`, `Trunc α` is data,
so the VM representation is the same as `α`, and so this can be used to
maintain computability. -/
def Trunc.{u} (α : Sort u) : Sort u :=
@@ -412,7 +412,7 @@ theorem true_equivalence : @Equivalence α fun _ _ ↦ True :=
namespace Trunc
-/-- Constructor for `trunc α` -/
+/-- Constructor for `Trunc α` -/
def mk (a : α) : Trunc α :=
Quot.mk _ a
@@ -429,7 +429,7 @@ theorem ind {β : Trunc α → Prop} : (∀ a : α, β (mk a)) → ∀ q : Trunc
protected theorem lift_mk (f : α → β) (c) (a : α) : lift f c (mk a) = f a :=
rfl
-/-- Lift a constant function on `q : trunc α`. -/
+/-- Lift a constant function on `q : Trunc α`. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
protected def liftOn (q : Trunc α) (f : α → β) (c : ∀ a b : α, f a = f b) : β :=
@@ -453,11 +453,11 @@ protected theorem eq (a b : Trunc α) : a = b :=
instance : Subsingleton (Trunc α) :=
⟨Trunc.eq⟩
-/-- The `bind` operator for the `trunc` monad. -/
+/-- The `bind` operator for the `Trunc` monad. -/
def bind (q : Trunc α) (f : α → Trunc β) : Trunc β :=
Trunc.liftOn q f fun _ _ ↦ Trunc.eq _ _
-/-- A function `f : α → β` defines a function `map f : trunc α → trunc β`. -/
+/-- A function `f : α → β` defines a function `map f : Trunc α → Trunc β`. -/
def map (f : α → β) (q : Trunc α) : Trunc β :=
bind q (Trunc.mk ∘ f)
@@ -479,7 +479,7 @@ instance : LawfulMonad Trunc where
variable {C : Trunc α → Sort _}
-/-- Recursion/induction principle for `trunc`. -/
+/-- Recursion/induction principle for `Trunc`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def rec (f : ∀ a, C (mk a))
@@ -487,21 +487,21 @@ protected def rec (f : ∀ a, C (mk a))
(q : Trunc α) : C q :=
Quot.rec f (fun a b _ ↦ h a b) q
-/-- A version of `trunc.rec` taking `q : trunc α` as the first argument. -/
+/-- A version of `Trunc.rec` taking `q : Trunc α` as the first argument. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOn (q : Trunc α) (f : ∀ a, C (mk a))
(h : ∀ a b : α, (Eq.ndrec (f a) (Trunc.eq (mk a) (mk b)) : C (mk b)) = f b) : C q :=
Trunc.rec f h q
-/-- A version of `trunc.rec_on` assuming the codomain is a `subsingleton`. -/
+/-- A version of `Trunc.recOn` assuming the codomain is a `Subsingleton`. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
protected def recOnSubsingleton [∀ a, Subsingleton (C (mk a))] (q : Trunc α) (f : ∀ a, C (mk a)) :
C q :=
Trunc.rec f (fun _ b ↦ Subsingleton.elim _ (f b)) q
-/-- Noncomputably extract a representative of `trunc α` (using the axiom of choice). -/
+/-- Noncomputably extract a representative of `Trunc α` (using the axiom of choice). -/
noncomputable def out : Trunc α → α :=
Quot.out
@@ -514,7 +514,7 @@ protected theorem nonempty (q : Trunc α) : Nonempty α :=
end Trunc
-/-! ### `quotient` with implicit `setoid` -/
+/-! ### `Quotient` with implicit `Setoid` -/
namespace Quotient
@@ -522,13 +522,13 @@ namespace Quotient
variable {γ : Sort _} {φ : Sort _} {s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}
/-! Versions of quotient definitions and lemmas ending in `'` use unification instead
-of typeclass inference for inferring the `setoid` argument. This is useful when there are
+of typeclass inference for inferring the `Setoid` argument. This is useful when there are
several different quotient relations on a type, for example quotient groups, rings and modules. -/
-- TODO: this whole section can probably be replaced `Quotient.mk`, with explicit parameter
--- porting note: Quotient.mk' is the equivalent of Lean 3's `quotient.mk`
-/-- A version of `quotient.mk` taking `{s : setoid α}` as an implicit argument instead of an
+-- porting note: Quotient.mk' is the equivalent of Lean 3's `Quotient.mk`
+/-- A version of `Quotient.mk` taking `{s : Setoid α}` as an implicit argument instead of an
instance argument. -/
protected def mk'' (a : α) : Quotient s₁ :=
Quot.mk s₁.1 a
@@ -539,7 +539,7 @@ theorem surjective_Quotient_mk'' : Function.Surjective (Quotient.mk'' : α → Q
Quot.exists_rep
#align quotient.surjective_quotient_mk' Quotient.surjective_Quotient_mk''
-/-- A version of `Quotient.liftOn` taking `{s : setoid α}` as an implicit argument instead of an
+/-- A version of `Quotient.liftOn` taking `{s : Setoid α}` as an implicit argument instead of an
instance argument. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@@ -557,7 +557,7 @@ protected theorem liftOn'_mk'' (f : α → φ) (h) (x : α) :
Quot.surjective_lift _
#align quotient.surjective_lift_on' Quotient.surjective_liftOn'
-/-- A version of `quotient.liftOn₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit arguments
+/-- A version of `Quotient.liftOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments
instead of instance arguments. -/
-- porting note: removed `@[elab_as_elim]` because it gave "unexpected eliminator resulting type"
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@@ -570,14 +570,14 @@ protected theorem liftOn₂'_mk'' (f : α → β → γ) (h) (a : α) (b : β) :
Quotient.liftOn₂' (@Quotient.mk'' _ s₁ a) (@Quotient.mk'' _ s₂ b) f h = f a b :=
rfl
-/-- A version of `Quotient.ind` taking `{s : setoid α}` as an implicit argument instead of an
+/-- A version of `Quotient.ind` taking `{s : Setoid α}` as an implicit argument instead of an
instance argument. -/
@[elab_as_elim]
protected theorem ind' {p : Quotient s₁ → Prop} (h : ∀ a, p (Quotient.mk'' a)) (q : Quotient s₁) :
p q :=
Quotient.ind h q
-/-- A version of `Quotient.ind₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit arguments
+/-- A version of `Quotient.ind₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments
instead of instance arguments. -/
@[elab_as_elim]
protected theorem ind₂' {p : Quotient s₁ → Quotient s₂ → Prop}
@@ -585,7 +585,7 @@ protected theorem ind₂' {p : Quotient s₁ → Quotient s₂ → Prop}
(q₁ : Quotient s₁) (q₂ : Quotient s₂) : p q₁ q₂ :=
Quotient.ind₂ h q₁ q₂
-/-- A version of `Quotient.inductionOn` taking `{s : setoid α}` as an implicit argument instead
+/-- A version of `Quotient.inductionOn` taking `{s : Setoid α}` as an implicit argument instead
of an instance argument. -/
@[elab_as_elim]
protected theorem inductionOn' {p : Quotient s₁ → Prop} (q : Quotient s₁)
@@ -593,7 +593,7 @@ protected theorem inductionOn' {p : Quotient s₁ → Prop} (q : Quotient s₁)
Quotient.inductionOn q h
#align quotient.induction_on' Quotient.inductionOn'
-/-- A version of `Quotient.inductionOn₂` taking `{s₁ : setoid α} {s₂ : setoid β}` as implicit
+/-- A version of `Quotient.inductionOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit
arguments instead of instance arguments. -/
@[elab_as_elim]
protected theorem inductionOn₂' {p : Quotient s₁ → Quotient s₂ → Prop} (q₁ : Quotient s₁)
@@ -602,7 +602,7 @@ protected theorem inductionOn₂' {p : Quotient s₁ → Quotient s₂ → Prop}
Quotient.inductionOn₂ q₁ q₂ h
#align quotient.induction_on₂' Quotient.inductionOn₂'
-/-- A version of `Quotient.inductionOn₃` taking `{s₁ : setoid α} {s₂ : setoid β} {s₃ : setoid γ}`
+/-- A version of `Quotient.inductionOn₃` taking `{s₁ : Setoid α} {s₂ : Setoid β} {s₃ : Setoid γ}`
as implicit arguments instead of instance arguments. -/
@[elab_as_elim]
protected theorem inductionOn₃' {p : Quotient s₁ → Quotient s₂ → Quotient s₃ → Prop}
@@ -612,7 +612,7 @@ protected theorem inductionOn₃' {p : Quotient s₁ → Quotient s₂ → Quoti
Quotient.inductionOn₃ q₁ q₂ q₃ h
#align quotient.induction_on₃' Quotient.inductionOn₃'
-/-- A version of `Quotient.recOnSubsingleton` taking `{s₁ : setoid α}` as an implicit argument
+/-- A version of `Quotient.recOnSubsingleton` taking `{s₁ : Setoid α}` as an implicit argument
instead of an instance argument. -/
@[elab_as_elim]
protected def recOnSubsingleton' {φ : Quotient s₁ → Sort _} [∀ a, Subsingleton (φ ⟦a⟧)]
@@ -620,7 +620,7 @@ protected def recOnSubsingleton' {φ : Quotient s₁ → Sort _} [∀ a, Subsing
(f : ∀ a, φ (Quotient.mk'' a)) : φ q :=
Quotient.recOnSubsingleton q f
-/-- A version of `Quotient.recOnSubsingleton₂` taking `{s₁ : setoid α} {s₂ : setoid α}`
+/-- A version of `Quotient.recOnSubsingleton₂` taking `{s₁ : Setoid α} {s₂ : Setoid α}`
as implicit arguments instead of instance arguments. -/
-- porting note: removed `@[reducible]` because it caused extremely slow `simp`
@[elab_as_elim]
@@ -658,7 +658,7 @@ theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort _}
#align quotient.hrec_on₂'_mk'' Quotient.hrecOn₂'_mk''
/-- Map a function `f : α → β` that sends equivalent elements to equivalent elements
-to a function `quotient sa → quotient sb`. Useful to define unary operations on quotients. -/
+to a function `Quotient sa → Quotient sb`. Useful to define unary operations on quotients. -/
protected def map' (f : α → β) (h : (s₁.r ⇒ s₂.r) f f) : Quotient s₁ → Quotient s₂ :=
Quot.map f h
@@ -689,7 +689,7 @@ theorem sound' {a b : α} : @Setoid.r _ s₁ a b → @Quotient.mk'' α s₁ a =
protected theorem eq' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ @Setoid.r _ s₁ a b :=
Quotient.eq
-/-- A version of `quotient.out` taking `{s₁ : setoid α}` as an implicit argument instead of an
+/-- A version of `Quotient.out` taking `{s₁ : Setoid α}` as an implicit argument instead of an
instance argument. -/
noncomputable def out' (a : Quotient s₁) : α :=
Quotient.out a
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.quot
+! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Init.Data.Quot
import Mathlib.Logic.Relator
All dependencies are ported!