control.traversable.basic
⟷
Mathlib.Control.Traversable.Basic
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-/
-import Mathbin.Control.Functor
-import Mathbin.Tactic.Ext
+import Control.Functor
+import Tactic.Ext
#align_import control.traversable.basic from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-
-! This file was ported from Lean 3 source module control.traversable.basic
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Control.Functor
import Mathbin.Tactic.Ext
+#align_import control.traversable.basic from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
+
/-!
# Traversable type class
mathlib commit https://github.com/leanprover-community/mathlib/commit/5dc6092d09e5e489106865241986f7f2ad28d4c8
@@ -274,14 +274,14 @@ def sequence [Traversable t] : t (f α) → f (t α) :=
end Functions
-#print IsLawfulTraversable /-
+#print LawfulTraversable /-
/-- A traversable functor is lawful if its `traverse` satisfies a
number of additional properties. It must send `id.mk` to `id.mk`,
send the composition of applicative functors to the composition of the
`traverse` of each, send each function `f` to `λ x, f <$> x`, and
satisfy a naturality condition with respect to applicative
transformations. -/
-class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
+class LawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
Type (u + 1) where
id_traverse : ∀ {α} (x : t α), traverse id.mk x = x
comp_traverse :
@@ -293,13 +293,13 @@ class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends Lawful
∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G]
(η : ApplicativeTransformation F G) {α β} (f : α → F β) (x : t α),
η (traverse f x) = traverse (@η _ ∘ f) x
-#align is_lawful_traversable IsLawfulTraversable
+#align is_lawful_traversable LawfulTraversable
-/
instance : Traversable id :=
⟨fun _ _ _ _ => id⟩
-instance : IsLawfulTraversable id := by refine' { .. } <;> intros <;> rfl
+instance : LawfulTraversable id := by refine' { .. } <;> intros <;> rfl
section
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -72,6 +72,7 @@ variable (F : Type u → Type v) [Applicative F] [LawfulApplicative F]
variable (G : Type u → Type w) [Applicative G] [LawfulApplicative G]
+#print ApplicativeTransformation /-
/-- A transformation between applicative functors. It is a natural
transformation such that `app` preserves the `has_pure.pure` and
`functor.map` (`<*>`) operations. See
@@ -81,6 +82,7 @@ structure ApplicativeTransformation : Type max (u + 1) v w where
preserves_pure' : ∀ {α : Type u} (x : α), app _ (pure x) = pure x
preserves_seq' : ∀ {α β : Type u} (x : F (α → β)) (y : F α), app _ (x <*> y) = app _ x <*> app _ y
#align applicative_transformation ApplicativeTransformation
+-/
end ApplicativeTransformation
@@ -95,54 +97,72 @@ instance : CoeFun (ApplicativeTransformation F G) fun _ => ∀ {α}, F α → G
variable {F G}
+#print ApplicativeTransformation.app_eq_coe /-
@[simp]
theorem app_eq_coe (η : ApplicativeTransformation F G) : η.app = η :=
rfl
#align applicative_transformation.app_eq_coe ApplicativeTransformation.app_eq_coe
+-/
+#print ApplicativeTransformation.coe_mk /-
@[simp]
theorem coe_mk (f : ∀ α : Type u, F α → G α) (pp ps) :
⇑(ApplicativeTransformation.mk f pp ps) = f :=
rfl
#align applicative_transformation.coe_mk ApplicativeTransformation.coe_mk
+-/
+#print ApplicativeTransformation.congr_fun /-
protected theorem congr_fun (η η' : ApplicativeTransformation F G) (h : η = η') {α : Type u}
(x : F α) : η x = η' x :=
congr_arg (fun η'' : ApplicativeTransformation F G => η'' x) h
#align applicative_transformation.congr_fun ApplicativeTransformation.congr_fun
+-/
+#print ApplicativeTransformation.congr_arg /-
protected theorem congr_arg (η : ApplicativeTransformation F G) {α : Type u} {x y : F α}
(h : x = y) : η x = η y :=
congr_arg (fun z : F α => η z) h
#align applicative_transformation.congr_arg ApplicativeTransformation.congr_arg
+-/
+#print ApplicativeTransformation.coe_inj /-
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') : η = η' :=
by cases η; cases η'; congr; exact h
#align applicative_transformation.coe_inj ApplicativeTransformation.coe_inj
+-/
+#print ApplicativeTransformation.ext /-
@[ext]
theorem ext ⦃η η' : ApplicativeTransformation F G⦄ (h : ∀ (α : Type u) (x : F α), η x = η' x) :
η = η' := by apply coe_inj; ext1 α; exact funext (h α)
#align applicative_transformation.ext ApplicativeTransformation.ext
+-/
+#print ApplicativeTransformation.ext_iff /-
theorem ext_iff {η η' : ApplicativeTransformation F G} :
η = η' ↔ ∀ (α : Type u) (x : F α), η x = η' x :=
⟨fun h α x => h ▸ rfl, fun h => ext h⟩
#align applicative_transformation.ext_iff ApplicativeTransformation.ext_iff
+-/
section Preserves
variable (η : ApplicativeTransformation F G)
+#print ApplicativeTransformation.preserves_pure /-
@[functor_norm]
theorem preserves_pure {α} : ∀ x : α, η (pure x) = pure x :=
η.preserves_pure'
#align applicative_transformation.preserves_pure ApplicativeTransformation.preserves_pure
+-/
+#print ApplicativeTransformation.preserves_seq /-
@[functor_norm]
theorem preserves_seq {α β : Type u} : ∀ (x : F (α → β)) (y : F α), η (x <*> y) = η x <*> η y :=
η.preserves_seq'
#align applicative_transformation.preserves_seq ApplicativeTransformation.preserves_seq
+-/
#print ApplicativeTransformation.preserves_map /-
@[functor_norm]
@@ -176,6 +196,7 @@ universe s t
variable {H : Type u → Type s} [Applicative H] [LawfulApplicative H]
+#print ApplicativeTransformation.comp /-
/-- The composition of applicative transformations. -/
def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G) :
ApplicativeTransformation F H where
@@ -183,28 +204,37 @@ def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F
preserves_pure' α x := by simp [functor_norm]
preserves_seq' α β x y := by simp [functor_norm]
#align applicative_transformation.comp ApplicativeTransformation.comp
+-/
+#print ApplicativeTransformation.comp_apply /-
@[simp]
theorem comp_apply (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G)
{α : Type u} (x : F α) : η'.comp η x = η' (η x) :=
rfl
#align applicative_transformation.comp_apply ApplicativeTransformation.comp_apply
+-/
+#print ApplicativeTransformation.comp_assoc /-
theorem comp_assoc {I : Type u → Type t} [Applicative I] [LawfulApplicative I]
(η'' : ApplicativeTransformation H I) (η' : ApplicativeTransformation G H)
(η : ApplicativeTransformation F G) : (η''.comp η').comp η = η''.comp (η'.comp η) :=
rfl
#align applicative_transformation.comp_assoc ApplicativeTransformation.comp_assoc
+-/
+#print ApplicativeTransformation.comp_id /-
@[simp]
theorem comp_id (η : ApplicativeTransformation F G) : η.comp idTransformation = η :=
ext fun α x => rfl
#align applicative_transformation.comp_id ApplicativeTransformation.comp_id
+-/
+#print ApplicativeTransformation.id_comp /-
@[simp]
theorem id_comp (η : ApplicativeTransformation F G) : idTransformation.comp η = η :=
ext fun α x => rfl
#align applicative_transformation.id_comp ApplicativeTransformation.id_comp
+-/
end ApplicativeTransformation
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -117,7 +117,7 @@ protected theorem congr_arg (η : ApplicativeTransformation F G) {α : Type u} {
#align applicative_transformation.congr_arg ApplicativeTransformation.congr_arg
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') : η = η' :=
- by cases η; cases η'; congr ; exact h
+ by cases η; cases η'; congr; exact h
#align applicative_transformation.coe_inj ApplicativeTransformation.coe_inj
@[ext]
@@ -252,7 +252,7 @@ send the composition of applicative functors to the composition of the
satisfy a naturality condition with respect to applicative
transformations. -/
class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
- Type (u + 1) where
+ Type (u + 1) where
id_traverse : ∀ {α} (x : t α), traverse id.mk x = x
comp_traverse :
∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G] {α β γ}
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -72,12 +72,6 @@ variable (F : Type u → Type v) [Applicative F] [LawfulApplicative F]
variable (G : Type u → Type w) [Applicative G] [LawfulApplicative G]
-/- warning: applicative_transformation -> ApplicativeTransformation is a dubious translation:
-lean 3 declaration is
- forall (F : Type.{u1} -> Type.{u2}) [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] (G : Type.{u1} -> Type.{u3}) [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3], Type.{max (succ u1) u2 u3}
-but is expected to have type
- forall (F : Type.{u1} -> Type.{u2}) [_inst_1 : Applicative.{u1, u2} F] (_inst_2 : Type.{u1} -> Type.{u3}) [G : Applicative.{u1, u3} _inst_2], Type.{max (succ u1) u2 u3}
-Case conversion may be inaccurate. Consider using '#align applicative_transformation ApplicativeTransformationₓ'. -/
/-- A transformation between applicative functors. It is a natural
transformation such that `app` preserves the `has_pure.pure` and
`functor.map` (`<*>`) operations. See
@@ -101,78 +95,36 @@ instance : CoeFun (ApplicativeTransformation F G) fun _ => ∀ {α}, F α → G
variable {F G}
-/- warning: applicative_transformation.app_eq_coe -> ApplicativeTransformation.app_eq_coe is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4), Eq.{max (succ (succ u1)) (succ u2) (succ u3)} (forall (α : Type.{u1}), (F α) -> (G α)) (ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4 η) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η)
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G), Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (forall (α : Type.{u1}), (F α) -> (_inst_2 α)) (ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3) (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243)
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.app_eq_coe ApplicativeTransformation.app_eq_coeₓ'. -/
@[simp]
theorem app_eq_coe (η : ApplicativeTransformation F G) : η.app = η :=
rfl
#align applicative_transformation.app_eq_coe ApplicativeTransformation.app_eq_coe
-/- warning: applicative_transformation.coe_mk -> ApplicativeTransformation.coe_mk is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (f : forall (α : Type.{u1}), (F α) -> (G α)) (pp : forall {α : Type.{u1}} (x : α), Eq.{succ u3} (G α) (f α (Pure.pure.{u1, u2} (fun (α : Type.{u1}) => F α) (Applicative.toHasPure.{u1, u2} (fun (α : Type.{u1}) => F α) _inst_1) α x)) (Pure.pure.{u1, u3} (fun (α : Type.{u1}) => G α) (Applicative.toHasPure.{u1, u3} (fun (α : Type.{u1}) => G α) _inst_3) α x)) (ps : forall {α : Type.{u1}} {β : Type.{u1}} (x : F (α -> β)) (y : F α), Eq.{succ u3} (G β) (f β (Seq.seq.{u1, u2} (fun (α : Type.{u1}) => F α) (Applicative.toHasSeq.{u1, u2} (fun (α : Type.{u1}) => F α) _inst_1) α β x y)) (Seq.seq.{u1, u3} (fun (α : Type.{u1}) => G α) (Applicative.toHasSeq.{u1, u3} (fun (α : Type.{u1}) => G α) _inst_3) α β (f (α -> β) x) (f α y))), Eq.{max (succ (succ u1)) (succ u2) (succ u3)} (forall {α : Type.{u1}}, (F α) -> (G α)) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} (fun (α : Type.{u1}) => F α) _inst_1 _inst_2 (fun (α : Type.{u1}) => G α) _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} (fun (α : Type.{u1}) => F α) _inst_1 _inst_2 (fun (α : Type.{u1}) => G α) _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} (fun (α : Type.{u1}) => F α) _inst_1 _inst_2 (fun (α : Type.{u1}) => G α) _inst_3 _inst_4) (ApplicativeTransformation.mk.{u1, u2, u3} (fun (α : Type.{u1}) => F α) _inst_1 _inst_2 (fun (α : Type.{u1}) => G α) _inst_3 _inst_4 f pp ps)) f
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : forall (α : Type.{u1}), (F α) -> (_inst_2 α)) (_inst_4 : forall {α : Type.{u1}} (x : α), Eq.{succ u3} (_inst_2 α) (_inst_3 α (Pure.pure.{u1, u2} (fun (α : Type.{u1}) => F α) (Applicative.toPure.{u1, u2} (fun (α : Type.{u1}) => F α) _inst_1) α x)) (Pure.pure.{u1, u3} (fun (α : Type.{u1}) => _inst_2 α) (Applicative.toPure.{u1, u3} (fun (α : Type.{u1}) => _inst_2 α) G) α x)) (f : forall {α : Type.{u1}} {ᾰ : Type.{u1}} (x : F (α -> ᾰ)) (y : F α), Eq.{succ u3} (_inst_2 ᾰ) (_inst_3 ᾰ (Seq.seq.{u1, u2} (fun (α : Type.{u1}) => F α) (Applicative.toSeq.{u1, u2} (fun (α : Type.{u1}) => F α) _inst_1) α ᾰ x (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.113 : Unit) => y))) (Seq.seq.{u1, u3} (fun (α : Type.{u1}) => _inst_2 α) (Applicative.toSeq.{u1, u3} (fun (α : Type.{u1}) => _inst_2 α) G) α ᾰ (_inst_3 (α -> ᾰ) x) (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.125 : Unit) => _inst_3 α y))), Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (forall {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}}, (F α._@.Mathlib.Control.Traversable.Basic._hyg.243) -> (_inst_2 α._@.Mathlib.Control.Traversable.Basic._hyg.243)) (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} (fun (α : Type.{u1}) => F α) _inst_1 (fun (α : Type.{u1}) => _inst_2 α) G (ApplicativeTransformation.mk.{u1, u2, u3} (fun (α : Type.{u1}) => F α) _inst_1 (fun (α : Type.{u1}) => _inst_2 α) G _inst_3 _inst_4 f) α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_3
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.coe_mk ApplicativeTransformation.coe_mkₓ'. -/
@[simp]
theorem coe_mk (f : ∀ α : Type u, F α → G α) (pp ps) :
⇑(ApplicativeTransformation.mk f pp ps) = f :=
rfl
#align applicative_transformation.coe_mk ApplicativeTransformation.coe_mk
-/- warning: applicative_transformation.congr_fun -> ApplicativeTransformation.congr_fun is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (η' : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4), (Eq.{succ (max (succ u1) u2 u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η η') -> (forall {α : Type.{u1}} (x : F α), Eq.{succ u3} (G α) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α x) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η' α x))
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) (_inst_4 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G), (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) _inst_3 _inst_4) -> (forall {η' : Type.{u1}} (h : F η'), Eq.{succ u3} (_inst_2 η') ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) η' h) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_4 α._@.Mathlib.Control.Traversable.Basic._hyg.243) η' h))
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.congr_fun ApplicativeTransformation.congr_funₓ'. -/
protected theorem congr_fun (η η' : ApplicativeTransformation F G) (h : η = η') {α : Type u}
(x : F α) : η x = η' x :=
congr_arg (fun η'' : ApplicativeTransformation F G => η'' x) h
#align applicative_transformation.congr_fun ApplicativeTransformation.congr_fun
-/- warning: applicative_transformation.congr_arg -> ApplicativeTransformation.congr_arg is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) {α : Type.{u1}} {x : F α} {y : F α}, (Eq.{succ u2} (F α) x y) -> (Eq.{succ u3} (G α) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α x) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α y))
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) {_inst_4 : Type.{u1}} {η : F _inst_4} {α : F _inst_4}, (Eq.{succ u2} (F _inst_4) η α) -> (Eq.{succ u3} (_inst_2 _inst_4) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_4 η) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_4 α))
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.congr_arg ApplicativeTransformation.congr_argₓ'. -/
protected theorem congr_arg (η : ApplicativeTransformation F G) {α : Type u} {x y : F α}
(h : x = y) : η x = η y :=
congr_arg (fun z : F α => η z) h
#align applicative_transformation.congr_arg ApplicativeTransformation.congr_arg
-/- warning: applicative_transformation.coe_inj -> ApplicativeTransformation.coe_inj is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] {{η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4}} {{η' : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4}}, (Eq.{max (succ (succ u1)) (succ u2) (succ u3)} ((fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) η) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η')) -> (Eq.{succ (max (succ u1) u2 u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η η')
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {{_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}} {{_inst_4 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}}, (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (forall {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}}, (F α._@.Mathlib.Control.Traversable.Basic._hyg.243) -> (_inst_2 α._@.Mathlib.Control.Traversable.Basic._hyg.243)) (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_4 α._@.Mathlib.Control.Traversable.Basic._hyg.243)) -> (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) _inst_3 _inst_4)
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.coe_inj ApplicativeTransformation.coe_injₓ'. -/
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') : η = η' :=
by cases η; cases η'; congr ; exact h
#align applicative_transformation.coe_inj ApplicativeTransformation.coe_inj
-/- warning: applicative_transformation.ext -> ApplicativeTransformation.ext is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] {{η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4}} {{η' : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4}}, (forall (α : Type.{u1}) (x : F α), Eq.{succ u3} (G α) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α x) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η' α x)) -> (Eq.{succ (max (succ u1) u2 u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η η')
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {{_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}} {{_inst_4 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}}, (forall (α : Type.{u1}) (x : F α), Eq.{succ u3} (_inst_2 α) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) α x) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_4 α._@.Mathlib.Control.Traversable.Basic._hyg.243) α x)) -> (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) _inst_3 _inst_4)
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.ext ApplicativeTransformation.extₓ'. -/
@[ext]
theorem ext ⦃η η' : ApplicativeTransformation F G⦄ (h : ∀ (α : Type u) (x : F α), η x = η' x) :
η = η' := by apply coe_inj; ext1 α; exact funext (h α)
#align applicative_transformation.ext ApplicativeTransformation.ext
-/- warning: applicative_transformation.ext_iff -> ApplicativeTransformation.ext_iff is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] {η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4} {η' : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4}, Iff (Eq.{succ (max (succ u1) u2 u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η η') (forall (α : Type.{u1}) (x : F α), Eq.{succ u3} (G α) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α x) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η' α x))
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G} {_inst_4 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}, Iff (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) _inst_3 _inst_4) (forall (α : Type.{u1}) (x : F α), Eq.{succ u3} (_inst_2 α) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) α x) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_4 α._@.Mathlib.Control.Traversable.Basic._hyg.243) α x))
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.ext_iff ApplicativeTransformation.ext_iffₓ'. -/
theorem ext_iff {η η' : ApplicativeTransformation F G} :
η = η' ↔ ∀ (α : Type u) (x : F α), η x = η' x :=
⟨fun h α x => h ▸ rfl, fun h => ext h⟩
@@ -182,23 +134,11 @@ section Preserves
variable (η : ApplicativeTransformation F G)
-/- warning: applicative_transformation.preserves_pure -> ApplicativeTransformation.preserves_pure is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) {α : Type.{u1}} (x : α), Eq.{succ u3} (G α) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α (Pure.pure.{u1, u2} F (Applicative.toHasPure.{u1, u2} F _inst_1) α x)) (Pure.pure.{u1, u3} G (Applicative.toHasPure.{u1, u3} G _inst_3) α x)
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) {_inst_4 : Type.{u1}} (η : _inst_4), Eq.{succ u3} (_inst_2 _inst_4) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_4 (Pure.pure.{u1, u2} F (Applicative.toPure.{u1, u2} F _inst_1) _inst_4 η)) (Pure.pure.{u1, u3} _inst_2 (Applicative.toPure.{u1, u3} _inst_2 G) _inst_4 η)
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.preserves_pure ApplicativeTransformation.preserves_pureₓ'. -/
@[functor_norm]
theorem preserves_pure {α} : ∀ x : α, η (pure x) = pure x :=
η.preserves_pure'
#align applicative_transformation.preserves_pure ApplicativeTransformation.preserves_pure
-/- warning: applicative_transformation.preserves_seq -> ApplicativeTransformation.preserves_seq is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) {α : Type.{u1}} {β : Type.{u1}} (x : F (α -> β)) (y : F α), Eq.{succ u3} (G β) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η β (Seq.seq.{u1, u2} F (Applicative.toHasSeq.{u1, u2} F _inst_1) α β x y)) (Seq.seq.{u1, u3} G (Applicative.toHasSeq.{u1, u3} G _inst_3) α β (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η (α -> β) x) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α y))
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) {_inst_4 : Type.{u1}} {η : Type.{u1}} (α : F (_inst_4 -> η)) (β : F _inst_4), Eq.{succ u3} (_inst_2 η) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) η (Seq.seq.{u1, u2} F (Applicative.toSeq.{u1, u2} F _inst_1) _inst_4 η α (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.768 : Unit) => β))) (Seq.seq.{u1, u3} _inst_2 (Applicative.toSeq.{u1, u3} _inst_2 G) _inst_4 η ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) (_inst_4 -> η) α) (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.780 : Unit) => (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_4 β))
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.preserves_seq ApplicativeTransformation.preserves_seqₓ'. -/
@[functor_norm]
theorem preserves_seq {α β : Type u} : ∀ (x : F (α → β)) (y : F α), η (x <*> y) = η x <*> η y :=
η.preserves_seq'
@@ -236,12 +176,6 @@ universe s t
variable {H : Type u → Type s} [Applicative H] [LawfulApplicative H]
-/- warning: applicative_transformation.comp -> ApplicativeTransformation.comp is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] {H : Type.{u1} -> Type.{u4}} [_inst_5 : Applicative.{u1, u4} H] [_inst_6 : LawfulApplicative.{u1, u4} H _inst_5], (ApplicativeTransformation.{u1, u3, u4} G _inst_3 _inst_4 H _inst_5 _inst_6) -> (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) -> (ApplicativeTransformation.{u1, u2, u4} F _inst_1 _inst_2 H _inst_5 _inst_6)
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {_inst_3 : Type.{u1} -> Type.{u4}} [_inst_4 : Applicative.{u1, u4} _inst_3], (ApplicativeTransformation.{u1, u3, u4} _inst_2 G _inst_3 _inst_4) -> (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) -> (ApplicativeTransformation.{u1, u2, u4} F _inst_1 _inst_3 _inst_4)
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.comp ApplicativeTransformation.compₓ'. -/
/-- The composition of applicative transformations. -/
def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G) :
ApplicativeTransformation F H where
@@ -250,47 +184,23 @@ def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F
preserves_seq' α β x y := by simp [functor_norm]
#align applicative_transformation.comp ApplicativeTransformation.comp
-/- warning: applicative_transformation.comp_apply -> ApplicativeTransformation.comp_apply is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] {H : Type.{u1} -> Type.{u4}} [_inst_5 : Applicative.{u1, u4} H] [_inst_6 : LawfulApplicative.{u1, u4} H _inst_5] (η' : ApplicativeTransformation.{u1, u3, u4} G _inst_3 _inst_4 H _inst_5 _inst_6) (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) {α : Type.{u1}} (x : F α), Eq.{succ u4} (H α) (coeFn.{succ (max (succ u1) u2 u4), max (succ (succ u1)) (succ u2) (succ u4)} (ApplicativeTransformation.{u1, u2, u4} F _inst_1 _inst_2 H _inst_5 _inst_6) (fun (_x : ApplicativeTransformation.{u1, u2, u4} F _inst_1 _inst_2 H _inst_5 _inst_6) => forall {α : Type.{u1}}, (F α) -> (H α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u4} F _inst_1 _inst_2 H _inst_5 _inst_6) (ApplicativeTransformation.comp.{u1, u2, u3, u4} F _inst_1 _inst_2 G _inst_3 _inst_4 H _inst_5 _inst_6 η' η) α x) (coeFn.{succ (max (succ u1) u3 u4), max (succ (succ u1)) (succ u3) (succ u4)} (ApplicativeTransformation.{u1, u3, u4} G _inst_3 _inst_4 H _inst_5 _inst_6) (fun (_x : ApplicativeTransformation.{u1, u3, u4} G _inst_3 _inst_4 H _inst_5 _inst_6) => forall {α : Type.{u1}}, (G α) -> (H α)) (ApplicativeTransformation.hasCoeToFun.{u1, u3, u4} G _inst_3 _inst_4 H _inst_5 _inst_6) η' α (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α x))
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {_inst_3 : Type.{u1} -> Type.{u4}} [_inst_4 : Applicative.{u1, u4} _inst_3] (H : ApplicativeTransformation.{u1, u3, u4} _inst_2 G _inst_3 _inst_4) (_inst_5 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) {_inst_6 : Type.{u1}} (η' : F _inst_6), Eq.{succ u4} (_inst_3 _inst_6) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u4} F _inst_1 _inst_3 _inst_4 (ApplicativeTransformation.comp.{u1, u2, u3, u4} F _inst_1 _inst_2 G _inst_3 _inst_4 H _inst_5) α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_6 η') ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u3, u4} _inst_2 G _inst_3 _inst_4 H α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_6 ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_5 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_6 η'))
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.comp_apply ApplicativeTransformation.comp_applyₓ'. -/
@[simp]
theorem comp_apply (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G)
{α : Type u} (x : F α) : η'.comp η x = η' (η x) :=
rfl
#align applicative_transformation.comp_apply ApplicativeTransformation.comp_apply
-/- warning: applicative_transformation.comp_assoc -> ApplicativeTransformation.comp_assoc is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] {H : Type.{u1} -> Type.{u4}} [_inst_5 : Applicative.{u1, u4} H] [_inst_6 : LawfulApplicative.{u1, u4} H _inst_5] {I : Type.{u1} -> Type.{u5}} [_inst_7 : Applicative.{u1, u5} I] [_inst_8 : LawfulApplicative.{u1, u5} I _inst_7] (η'' : ApplicativeTransformation.{u1, u4, u5} H _inst_5 _inst_6 I _inst_7 _inst_8) (η' : ApplicativeTransformation.{u1, u3, u4} G _inst_3 _inst_4 H _inst_5 _inst_6) (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4), Eq.{succ (max (succ u1) u2 u5)} (ApplicativeTransformation.{u1, u2, u5} F _inst_1 _inst_2 I _inst_7 _inst_8) (ApplicativeTransformation.comp.{u1, u2, u3, u5} F _inst_1 _inst_2 G _inst_3 _inst_4 I _inst_7 _inst_8 (ApplicativeTransformation.comp.{u1, u3, u4, u5} G _inst_3 _inst_4 H _inst_5 _inst_6 I _inst_7 _inst_8 η'' η') η) (ApplicativeTransformation.comp.{u1, u2, u4, u5} F _inst_1 _inst_2 H _inst_5 _inst_6 I _inst_7 _inst_8 η'' (ApplicativeTransformation.comp.{u1, u2, u3, u4} F _inst_1 _inst_2 G _inst_3 _inst_4 H _inst_5 _inst_6 η' η))
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {_inst_3 : Type.{u1} -> Type.{u4}} [_inst_4 : Applicative.{u1, u4} _inst_3] {H : Type.{u1} -> Type.{u5}} [_inst_5 : Applicative.{u1, u5} H] (_inst_6 : ApplicativeTransformation.{u1, u4, u5} _inst_3 _inst_4 H _inst_5) (I : ApplicativeTransformation.{u1, u3, u4} _inst_2 G _inst_3 _inst_4) (_inst_7 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G), Eq.{max (max (succ u5) (succ (succ u1))) (succ u2)} (ApplicativeTransformation.{u1, u2, u5} F _inst_1 H _inst_5) (ApplicativeTransformation.comp.{u1, u2, u3, u5} F _inst_1 _inst_2 G H _inst_5 (ApplicativeTransformation.comp.{u1, u3, u4, u5} _inst_2 G _inst_3 _inst_4 H _inst_5 _inst_6 I) _inst_7) (ApplicativeTransformation.comp.{u1, u2, u4, u5} F _inst_1 _inst_3 _inst_4 H _inst_5 _inst_6 (ApplicativeTransformation.comp.{u1, u2, u3, u4} F _inst_1 _inst_2 G _inst_3 _inst_4 I _inst_7))
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.comp_assoc ApplicativeTransformation.comp_assocₓ'. -/
theorem comp_assoc {I : Type u → Type t} [Applicative I] [LawfulApplicative I]
(η'' : ApplicativeTransformation H I) (η' : ApplicativeTransformation G H)
(η : ApplicativeTransformation F G) : (η''.comp η').comp η = η''.comp (η'.comp η) :=
rfl
#align applicative_transformation.comp_assoc ApplicativeTransformation.comp_assoc
-/- warning: applicative_transformation.comp_id -> ApplicativeTransformation.comp_id is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4), Eq.{succ (max (succ u1) u2 u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (ApplicativeTransformation.comp.{u1, u2, u2, u3} F _inst_1 _inst_2 F _inst_1 _inst_2 G _inst_3 _inst_4 η (ApplicativeTransformation.idTransformation.{u1, u2} F _inst_1 _inst_2)) η
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G), Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) (ApplicativeTransformation.comp.{u1, u2, u2, u3} F _inst_1 F _inst_1 _inst_2 G _inst_3 (ApplicativeTransformation.idTransformation.{u1, u2} F _inst_1)) _inst_3
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.comp_id ApplicativeTransformation.comp_idₓ'. -/
@[simp]
theorem comp_id (η : ApplicativeTransformation F G) : η.comp idTransformation = η :=
ext fun α x => rfl
#align applicative_transformation.comp_id ApplicativeTransformation.comp_id
-/- warning: applicative_transformation.id_comp -> ApplicativeTransformation.id_comp is a dubious translation:
-lean 3 declaration is
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4), Eq.{succ (max (succ u1) u2 u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (ApplicativeTransformation.comp.{u1, u2, u3, u3} F _inst_1 _inst_2 G _inst_3 _inst_4 G _inst_3 _inst_4 (ApplicativeTransformation.idTransformation.{u1, u3} G _inst_3 _inst_4) η) η
-but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G), Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) (ApplicativeTransformation.comp.{u1, u2, u3, u3} F _inst_1 _inst_2 G _inst_2 G (ApplicativeTransformation.idTransformation.{u1, u3} _inst_2 G) _inst_3) _inst_3
-Case conversion may be inaccurate. Consider using '#align applicative_transformation.id_comp ApplicativeTransformation.id_compₓ'. -/
@[simp]
theorem id_comp (η : ApplicativeTransformation F G) : idTransformation.comp η = η :=
ext fun α x => rfl
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -153,11 +153,7 @@ but is expected to have type
forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] {{_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}} {{_inst_4 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G}}, (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (forall {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}}, (F α._@.Mathlib.Control.Traversable.Basic._hyg.243) -> (_inst_2 α._@.Mathlib.Control.Traversable.Basic._hyg.243)) (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_4 α._@.Mathlib.Control.Traversable.Basic._hyg.243)) -> (Eq.{max (max (succ (succ u1)) (succ u2)) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) _inst_3 _inst_4)
Case conversion may be inaccurate. Consider using '#align applicative_transformation.coe_inj ApplicativeTransformation.coe_injₓ'. -/
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') : η = η' :=
- by
- cases η
- cases η'
- congr
- exact h
+ by cases η; cases η'; congr ; exact h
#align applicative_transformation.coe_inj ApplicativeTransformation.coe_inj
/- warning: applicative_transformation.ext -> ApplicativeTransformation.ext is a dubious translation:
@@ -168,10 +164,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align applicative_transformation.ext ApplicativeTransformation.extₓ'. -/
@[ext]
theorem ext ⦃η η' : ApplicativeTransformation F G⦄ (h : ∀ (α : Type u) (x : F α), η x = η' x) :
- η = η' := by
- apply coe_inj
- ext1 α
- exact funext (h α)
+ η = η' := by apply coe_inj; ext1 α; exact funext (h α)
#align applicative_transformation.ext ApplicativeTransformation.ext
/- warning: applicative_transformation.ext_iff -> ApplicativeTransformation.ext_iff is a dubious translation:
@@ -219,9 +212,7 @@ theorem preserves_map {α β} (x : α → β) (y : F α) : η (x <$> y) = x <$>
-/
#print ApplicativeTransformation.preserves_map' /-
-theorem preserves_map' {α β} (x : α → β) : @η _ ∘ Functor.map x = Functor.map x ∘ @η _ :=
- by
- ext y
+theorem preserves_map' {α β} (x : α → β) : @η _ ∘ Functor.map x = Functor.map x ∘ @η _ := by ext y;
exact preserves_map η x y
#align applicative_transformation.preserves_map' ApplicativeTransformation.preserves_map'
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -204,7 +204,7 @@ theorem preserves_pure {α} : ∀ x : α, η (pure x) = pure x :=
lean 3 declaration is
forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] [_inst_2 : LawfulApplicative.{u1, u2} F _inst_1] {G : Type.{u1} -> Type.{u3}} [_inst_3 : Applicative.{u1, u3} G] [_inst_4 : LawfulApplicative.{u1, u3} G _inst_3] (η : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) {α : Type.{u1}} {β : Type.{u1}} (x : F (α -> β)) (y : F α), Eq.{succ u3} (G β) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η β (Seq.seq.{u1, u2} F (Applicative.toHasSeq.{u1, u2} F _inst_1) α β x y)) (Seq.seq.{u1, u3} G (Applicative.toHasSeq.{u1, u3} G _inst_3) α β (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η (α -> β) x) (coeFn.{succ (max (succ u1) u2 u3), max (succ (succ u1)) (succ u2) (succ u3)} (ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) (fun (_x : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) => forall {α : Type.{u1}}, (F α) -> (G α)) (ApplicativeTransformation.hasCoeToFun.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 _inst_4) η α y))
but is expected to have type
- forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) {_inst_4 : Type.{u1}} {η : Type.{u1}} (α : F (_inst_4 -> η)) (β : F _inst_4), Eq.{succ u3} (_inst_2 η) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) η (Seq.seq.{u1, u2} F (Applicative.toSeq.{u1, u2} F _inst_1) _inst_4 η α (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.752 : Unit) => β))) (Seq.seq.{u1, u3} _inst_2 (Applicative.toSeq.{u1, u3} _inst_2 G) _inst_4 η ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) (_inst_4 -> η) α) (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.763 : Unit) => (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_4 β))
+ forall {F : Type.{u1} -> Type.{u2}} [_inst_1 : Applicative.{u1, u2} F] {_inst_2 : Type.{u1} -> Type.{u3}} [G : Applicative.{u1, u3} _inst_2] (_inst_3 : ApplicativeTransformation.{u1, u2, u3} F _inst_1 _inst_2 G) {_inst_4 : Type.{u1}} {η : Type.{u1}} (α : F (_inst_4 -> η)) (β : F _inst_4), Eq.{succ u3} (_inst_2 η) ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) η (Seq.seq.{u1, u2} F (Applicative.toSeq.{u1, u2} F _inst_1) _inst_4 η α (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.768 : Unit) => β))) (Seq.seq.{u1, u3} _inst_2 (Applicative.toSeq.{u1, u3} _inst_2 G) _inst_4 η ((fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) (_inst_4 -> η) α) (fun (x._@.Mathlib.Control.Traversable.Basic._hyg.780 : Unit) => (fun {α._@.Mathlib.Control.Traversable.Basic._hyg.243 : Type.{u1}} => ApplicativeTransformation.app.{u1, u2, u3} F _inst_1 _inst_2 G _inst_3 α._@.Mathlib.Control.Traversable.Basic._hyg.243) _inst_4 β))
Case conversion may be inaccurate. Consider using '#align applicative_transformation.preserves_seq ApplicativeTransformation.preserves_seqₓ'. -/
@[functor_norm]
theorem preserves_seq {α β : Type u} : ∀ (x : F (α → β)) (y : F α), η (x <*> y) = η x <*> η y :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
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)
@@ -62,7 +62,6 @@ universe u v w
section ApplicativeTransformation
variable (F : Type u → Type v) [Applicative F] [LawfulApplicative F]
-
variable (G : Type u → Type w) [Applicative G] [LawfulApplicative G]
/-- A transformation between applicative functors. It is a natural
@@ -83,7 +82,6 @@ end ApplicativeTransformation
namespace ApplicativeTransformation
variable (F : Type u → Type v) [Applicative F] [LawfulApplicative F]
-
variable (G : Type u → Type w) [Applicative G] [LawfulApplicative G]
instance : CoeFun (ApplicativeTransformation F G) fun _ => ∀ {α}, F α → G α :=
@@ -227,11 +225,8 @@ export Traversable (traverse)
section Functions
variable {t : Type u → Type u}
-
variable {m : Type u → Type v} [Applicative m]
-
variable {α β : Type u}
-
variable {f : Type u → Type u} [Applicative f]
/-- A traversable functor commutes with all applicative functors. -/
@@ -287,9 +282,7 @@ end
namespace Sum
variable {σ : Type u}
-
variable {F : Type u → Type u}
-
variable [Applicative F]
-- Porting note: this was marked as a dubious translation but the only issue seems to be
λ
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.@@ -87,7 +87,7 @@ variable (F : Type u → Type v) [Applicative F] [LawfulApplicative F]
variable (G : Type u → Type w) [Applicative G] [LawfulApplicative G]
instance : CoeFun (ApplicativeTransformation F G) fun _ => ∀ {α}, F α → G α :=
- ⟨λ η => η.app _⟩
+ ⟨fun η ↦ η.app _⟩
variable {F G}
Homogenises porting notes via capitalisation and addition of whitespace.
It makes the following changes:
@@ -188,7 +188,7 @@ theorem comp_apply (η' : ApplicativeTransformation G H) (η : ApplicativeTransf
rfl
#align applicative_transformation.comp_apply ApplicativeTransformation.comp_apply
--- porting note: in mathlib3 we also had the assumption `[LawfulApplicative I]` because
+-- Porting note: in mathlib3 we also had the assumption `[LawfulApplicative I]` because
-- this was assumed
theorem comp_assoc {I : Type u → Type t} [Applicative I]
(η'' : ApplicativeTransformation H I) (η' : ApplicativeTransformation G H)
@@ -292,7 +292,7 @@ variable {F : Type u → Type u}
variable [Applicative F]
--- porting note: this was marked as a dubious translation but the only issue seems to be
+-- Porting note: this was marked as a dubious translation but the only issue seems to be
-- a universe issue; this may be a bug in mathlib3port. I've carefully checked the universes
-- in mathlib3 and mathlib4 and they seem to match up exactly. Discussion here
-- https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/why.20dubious.3F/
@@ -3,8 +3,8 @@ Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-/
-import Mathlib.Data.List.Defs
import Mathlib.Data.Option.Defs
+import Mathlib.Control.Functor
#align_import control.traversable.basic from "leanprover-community/mathlib"@"1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a"
This @[simp] attribute was bad all along, and with a change to the simp algorithm in leanprover/lean4#3124, finally starting breaking things.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -91,7 +91,7 @@ instance : CoeFun (ApplicativeTransformation F G) fun _ => ∀ {α}, F α → G
variable {F G}
-@[simp]
+-- This cannot be a `simp` lemma, as the RHS is a coercion which contains `η.app`.
theorem app_eq_coe (η : ApplicativeTransformation F G) : η.app = η :=
rfl
#align applicative_transformation.app_eq_coe ApplicativeTransformation.app_eq_coe
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -277,10 +277,10 @@ section
variable {F : Type u → Type v} [Applicative F]
instance : Traversable Option :=
- ⟨@Option.traverse⟩
+ ⟨Option.traverse⟩
instance : Traversable List :=
- ⟨@List.traverse⟩
+ ⟨List.traverse⟩
end
@@ -98,7 +98,7 @@ theorem app_eq_coe (η : ApplicativeTransformation F G) : η.app = η :=
@[simp]
theorem coe_mk (f : ∀ α : Type u, F α → G α) (pp ps) :
- (ApplicativeTransformation.mk f @pp @ps) = f :=
+ (ApplicativeTransformation.mk f @pp @ps) = f :=
rfl
#align applicative_transformation.coe_mk ApplicativeTransformation.coe_mk
@@ -248,7 +248,7 @@ send the composition of applicative functors to the composition of the
satisfy a naturality condition with respect to applicative
transformations. -/
class LawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
- Type (u + 1) where
+ Prop where
/-- `traverse` plays well with `pure` of the identity monad-/
id_traverse : ∀ {α} (x : t α), traverse (pure : α → Id α) x = x
/-- `traverse` plays well with composition of applicative functors. -/
@@ -2,15 +2,12 @@
Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
-
-! This file was ported from Lean 3 source module control.traversable.basic
-! leanprover-community/mathlib commit 1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.List.Defs
import Mathlib.Data.Option.Defs
+#align_import control.traversable.basic from "leanprover-community/mathlib"@"1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a"
+
/-!
# Traversable type class
@@ -38,7 +38,7 @@ For more on how to use traversable, consider the Haskell tutorial:
* `Traversable` type class - exposes the `traverse` function
* `sequence` - based on `traverse`,
turns a collection of effects into an effect returning a collection
- * `IsLawfulTraversable` - laws for a traversable functor
+ * `LawfulTraversable` - laws for a traversable functor
* `ApplicativeTransformation` - the notion of a natural transformation for applicative functors
## Tags
@@ -250,7 +250,7 @@ send the composition of applicative functors to the composition of the
`traverse` of each, send each function `f` to `fun x ↦ f <$> x`, and
satisfy a naturality condition with respect to applicative
transformations. -/
-class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
+class LawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
Type (u + 1) where
/-- `traverse` plays well with `pure` of the identity monad-/
id_traverse : ∀ {α} (x : t α), traverse (pure : α → Id α) x = x
@@ -268,12 +268,12 @@ class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends Lawful
∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G]
(η : ApplicativeTransformation F G) {α β} (f : α → F β) (x : t α),
η (traverse f x) = traverse (@η _ ∘ f) x
-#align is_lawful_traversable IsLawfulTraversable
+#align is_lawful_traversable LawfulTraversable
instance : Traversable Id :=
⟨id⟩
-instance : IsLawfulTraversable Id := by refine' { .. } <;> intros <;> rfl
+instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> rfl
section
@@ -247,7 +247,7 @@ end Functions
/-- A traversable functor is lawful if its `traverse` satisfies a
number of additional properties. It must send `pure : α → Id α` to `pure`,
send the composition of applicative functors to the composition of the
-`traverse` of each, send each function `f` to `λ x, f <$> x`, and
+`traverse` of each, send each function `f` to `fun x ↦ f <$> x`, and
satisfy a naturality condition with respect to applicative
transformations. -/
class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends LawfulFunctor t :
@@ -271,7 +271,7 @@ class IsLawfulTraversable (t : Type u → Type u) [Traversable t] extends Lawful
#align is_lawful_traversable IsLawfulTraversable
instance : Traversable Id :=
-⟨id⟩
+ ⟨id⟩
instance : IsLawfulTraversable Id := by refine' { .. } <;> intros <;> rfl
fix-comments.py
on all files.@@ -312,7 +312,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align sum.traverse Sum.traverseₓ'. -/
/-- Defines a `traverse` function on the second component of a sum type.
-This is used to give a `traversable` instance for the functor `σ ⊕ -`. -/
+This is used to give a `Traversable` instance for the functor `σ ⊕ -`. -/
protected def traverse {α β} (f : α → F β) : Sum σ α → F (Sum σ β)
| Sum.inl x => pure (Sum.inl x)
| Sum.inr x => Sum.inr <$> f x
This PR fixes two things:
align
statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align
). This is often seen in the mathport output after ending calc
blocks.#align
statements. (This was needed for a script I wrote for #3630.)@@ -152,7 +152,6 @@ theorem preserves_seq {α β : Type u} : ∀ (x : F (α → β)) (y : F α), η
@[functor_norm]
theorem preserves_map {α β} (x : α → β) (y : F α) : η (x <$> y) = x <$> η y := by
rw [← pure_seq, η.preserves_seq, preserves_pure, pure_seq]
-
#align applicative_transformation.preserves_map ApplicativeTransformation.preserves_map
theorem preserves_map' {α β} (x : α → β) : @η _ ∘ Functor.map x = Functor.map x ∘ @η _ := by
@@ -151,7 +151,8 @@ theorem preserves_seq {α β : Type u} : ∀ (x : F (α → β)) (y : F α), η
@[functor_norm]
theorem preserves_map {α β} (x : α → β) (y : F α) : η (x <$> y) = x <$> η y := by
- rw [← pure_seq, η.preserves_seq] ; simp [functor_norm]
+ rw [← pure_seq, η.preserves_seq, preserves_pure, pure_seq]
+
#align applicative_transformation.preserves_map ApplicativeTransformation.preserves_map
theorem preserves_map' {α β} (x : α → β) : @η _ ∘ Functor.map x = Functor.map x ∘ @η _ := by
@@ -179,8 +180,10 @@ variable {H : Type u → Type s} [Applicative H] [LawfulApplicative H]
def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G) :
ApplicativeTransformation F H where
app α x := η' (η x)
- preserves_pure' x := by simp [functor_norm]
- preserves_seq' x y := by simp [functor_norm]
+ -- Porting note: something has gone wrong with `simp [functor_norm]`,
+ -- which should suffice for the next two.
+ preserves_pure' x := by simp only [preserves_pure]
+ preserves_seq' x y := by simp only [preserves_seq]
#align applicative_transformation.comp ApplicativeTransformation.comp
@[simp]
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
@@ -69,8 +69,8 @@ variable (F : Type u → Type v) [Applicative F] [LawfulApplicative F]
variable (G : Type u → Type w) [Applicative G] [LawfulApplicative G]
/-- A transformation between applicative functors. It is a natural
-transformation such that `app` preserves the `has_pure.pure` and
-`functor.map` (`<*>`) operations. See
+transformation such that `app` preserves the `Pure.pure` and
+`Functor.map` (`<*>`) operations. See
`ApplicativeTransformation.preserves_map` for naturality. -/
structure ApplicativeTransformation : Type max (u + 1) v w where
/-- The function on objects defined by an `ApplicativeTransformation`. -/
Fixes some problems surrounding Data.List.Defs
that were affecting the ongoing port of Data.List.Basic
.
takeI
as a faithful port of take'
and fixes the align
take'
was previously erroneously aligned with takeD
. takeD
uses an explicitly-provided argument as a default whereas takeI
usesInhabited
's default
.Data.List.Chain
→ Data.List.Defs
to Data.List.Defs
→ Data.List.Chain
Data.List.Basic
when it attempted to import Data.List.Defs
.chain_cons
from Data.List.Chain
into Data.List.Defs
.Control.Traversable.Basic
's imports, since it was previously relying on Data.Option.Defs
via Data.List.Defs
← Data.List.Chain
← ...See this Zulip conversation for more context.
@@ -9,6 +9,7 @@ Authors: Simon Hudon
! if you have ported upstream changes.
-/
import Mathlib.Data.List.Defs
+import Mathlib.Data.Option.Defs
/-!
# Traversable type class
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) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon
+
+! This file was ported from Lean 3 source module control.traversable.basic
+! leanprover-community/mathlib commit 1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Data.List.Defs
All dependencies are ported!