data.qpf.multivariate.constructions.fixMathlib.Data.QPF.Multivariate.Constructions.Fix

This file has been ported!

Changes since the initial port

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

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Simon Hudon
 -/
-import Data.Pfunctor.Multivariate.W
-import Data.Qpf.Multivariate.Basic
+import Data.PFunctor.Multivariate.W
+import Data.QPF.Multivariate.Basic
 
 #align_import data.qpf.multivariate.constructions.fix from "leanprover-community/mathlib"@"ef7acf407d265ad4081c8998687e994fa80ba70c"
 
Diff
@@ -402,7 +402,7 @@ def Fix.drec {β : Fix F α → Type u}
   let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
   have : x = y.1 := by
     symm; dsimp [y]; apply fix.ind_rec _ id _ x; intro x' ih
-    rw [fix.rec_eq]; dsimp; simp [append_fun_id_id] at ih 
+    rw [fix.rec_eq]; dsimp; simp [append_fun_id_id] at ih
     congr;
     conv =>
       rhs
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2018 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Simon Hudon
 -/
-import Mathbin.Data.Pfunctor.Multivariate.W
-import Mathbin.Data.Qpf.Multivariate.Basic
+import Data.Pfunctor.Multivariate.W
+import Data.Qpf.Multivariate.Basic
 
 #align_import data.qpf.multivariate.constructions.fix from "leanprover-community/mathlib"@"ef7acf407d265ad4081c8998687e994fa80ba70c"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2018 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Simon Hudon
-
-! This file was ported from Lean 3 source module data.qpf.multivariate.constructions.fix
-! leanprover-community/mathlib commit ef7acf407d265ad4081c8998687e994fa80ba70c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Pfunctor.Multivariate.W
 import Mathbin.Data.Qpf.Multivariate.Basic
 
+#align_import data.qpf.multivariate.constructions.fix from "leanprover-community/mathlib"@"ef7acf407d265ad4081c8998687e994fa80ba70c"
+
 /-!
 # The initial algebra of a multivariate qpf is again a qpf.
 
Diff
@@ -69,8 +69,6 @@ open scoped MvFunctor
 
 variable {n : ℕ} {F : TypeVec.{u} (n + 1) → Type u} [MvFunctor F] [q : MvQPF F]
 
-include q
-
 #print MvQPF.recF /-
 /-- `recF` is used as a basis for defining the recursor on `fix F α`. `recF`
 traverses recursively the W-type generated by `q.P` using a function on `F`
Diff
@@ -191,8 +191,8 @@ theorem wEquiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.p.W α) :
   by
   intro h; induction h
   case ind a f' f₀ f₁ h ih => rw [q.P.W_map_W_mk, q.P.W_map_W_mk]; apply Wequiv.ind; apply ih
-  case
-    abs a₀ f'₀ f₀ a₁ f'₁ f₁ h =>
+  case abs a₀ f'₀ f₀ a₁ f'₁ f₁
+    h =>
     rw [q.P.W_map_W_mk, q.P.W_map_W_mk]; apply Wequiv.abs
     show
       abs (q.P.obj_append1 a₀ (g ⊚ f'₀) fun x => q.P.W_map g (f₀ x)) =
@@ -407,8 +407,8 @@ def Fix.drec {β : Fix F α → Type u}
   let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
   have : x = y.1 := by
     symm; dsimp [y]; apply fix.ind_rec _ id _ x; intro x' ih
-    rw [fix.rec_eq]; dsimp; simp [append_fun_id_id] at ih
-    congr ;
+    rw [fix.rec_eq]; dsimp; simp [append_fun_id_id] at ih 
+    congr;
     conv =>
       rhs
       rw [← ih];
Diff
@@ -65,7 +65,7 @@ open TypeVec
 
 open MvFunctor (Liftp Liftr)
 
-open MvFunctor
+open scoped MvFunctor
 
 variable {n : ℕ} {F : TypeVec.{u} (n + 1) → Type u} [MvFunctor F] [q : MvQPF F]
 
Diff
@@ -275,10 +275,7 @@ theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1
     Fix.rec g (Fix.mk x) = g (appendFun id (Fix.rec g) <$$> x) :=
   by
   have : recF g ∘ fixToW = Fix.rec g := by
-    apply funext
-    apply Quotient.ind
-    intro x
-    apply recF_eq_of_Wequiv
+    apply funext; apply Quotient.ind; intro x; apply recF_eq_of_Wequiv
     apply Wrepr_equiv
   conv =>
     lhs
@@ -318,18 +315,13 @@ theorem Fix.ind_rec {β : Type _} (g₁ g₂ : Fix F α → β)
     ∀ x, g₁ x = g₂ x := by
   apply Quot.ind
   intro x
-  apply q.P.W_ind _ x
-  intro a f' f ih
+  apply q.P.W_ind _ x; intro a f' f ih
   show g₁ ⟦q.P.W_mk a f' f⟧ = g₂ ⟦q.P.W_mk a f' f⟧
-  rw [← fix.ind_aux a f' f]
-  apply h
+  rw [← fix.ind_aux a f' f]; apply h
   rw [← abs_map, ← abs_map, MvPFunctor.map_eq, MvPFunctor.map_eq]
   congr 2
   rw [MvPFunctor.appendContents, append_fun, append_fun, ← split_fun_comp, ← split_fun_comp]
-  have : (g₁ ∘ fun x => ⟦f x⟧) = g₂ ∘ fun x => ⟦f x⟧ :=
-    by
-    ext x
-    exact ih x
+  have : (g₁ ∘ fun x => ⟦f x⟧) = g₂ ∘ fun x => ⟦f x⟧ := by ext x; exact ih x
   rw [this]
 #align mvqpf.fix.ind_rec MvQPF.Fix.ind_rec
 -/
@@ -361,15 +353,12 @@ theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x :=
 #print MvQPF.Fix.dest_mk /-
 theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x :=
   by
-  unfold fix.dest
-  rw [fix.rec_eq, ← fix.dest, ← comp_map]
+  unfold fix.dest; rw [fix.rec_eq, ← fix.dest, ← comp_map]
   conv =>
     rhs
     rw [← MvFunctor.id_map x]
   rw [← append_fun_comp, id_comp]
-  have : fix.mk ∘ fix.dest = id := by
-    ext x
-    apply fix.mk_dest
+  have : fix.mk ∘ fix.dest = id := by ext x; apply fix.mk_dest
   rw [this, append_fun_id_id]
 #align mvqpf.fix.dest_mk MvQPF.Fix.dest_mk
 -/
@@ -398,12 +387,7 @@ instance mvqpfFix : MvQPF (Fix F) where
   p := q.p.wp
   abs α := Quot.mk WEquiv
   repr α := fixToW
-  abs_repr := by
-    intro α
-    apply Quot.ind
-    intro a
-    apply Quot.sound
-    apply Wrepr_equiv
+  abs_repr := by intro α; apply Quot.ind; intro a; apply Quot.sound; apply Wrepr_equiv
   abs_map := by
     intro α β g x;
     conv =>
@@ -422,17 +406,12 @@ def Fix.drec {β : Fix F α → Type u}
     (g : ∀ x : F (α ::: Sigma β), β (Fix.mk <| (id ::: Sigma.fst) <$$> x)) (x : Fix F α) : β x :=
   let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
   have : x = y.1 := by
-    symm
-    dsimp [y]
-    apply fix.ind_rec _ id _ x
-    intro x' ih
-    rw [fix.rec_eq]
-    dsimp
-    simp [append_fun_id_id] at ih
-    congr
+    symm; dsimp [y]; apply fix.ind_rec _ id _ x; intro x' ih
+    rw [fix.rec_eq]; dsimp; simp [append_fun_id_id] at ih
+    congr ;
     conv =>
       rhs
-      rw [← ih]
+      rw [← ih];
     rw [MvFunctor.map_map, ← append_fun_comp, id_comp]
   cast (by rw [this]) y.2
 #align mvqpf.fix.drec MvQPF.Fix.drec
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Simon Hudon
 
 ! This file was ported from Lean 3 source module data.qpf.multivariate.constructions.fix
-! leanprover-community/mathlib commit 14b69e9f3c16630440a2cbd46f1ddad0d561dee7
+! leanprover-community/mathlib commit ef7acf407d265ad4081c8998687e994fa80ba70c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Data.Qpf.Multivariate.Basic
 /-!
 # The initial algebra of a multivariate qpf is again a qpf.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 For a `(n+1)`-ary QPF `F (α₀,..,αₙ)`, we take the least fixed point of `F` with
 regards to its last argument `αₙ`. The result is a `n`-ary functor: `fix F (α₀,..,αₙ₋₁)`.
 Making `fix F` into a functor allows us to take the fixed point, compose with other functors
Diff
@@ -68,19 +68,24 @@ variable {n : ℕ} {F : TypeVec.{u} (n + 1) → Type u} [MvFunctor F] [q : MvQPF
 
 include q
 
+#print MvQPF.recF /-
 /-- `recF` is used as a basis for defining the recursor on `fix F α`. `recF`
 traverses recursively the W-type generated by `q.P` using a function on `F`
 as a recursive step -/
 def recF {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) : q.p.W α → β :=
   q.p.wRec fun a f' f rec => g (abs ⟨a, splitFun f' rec⟩)
 #align mvqpf.recF MvQPF.recF
+-/
 
+#print MvQPF.recF_eq /-
 theorem recF_eq {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) (a : q.p.A)
     (f' : q.p.drop.B a ⟹ α) (f : q.p.getLast.B a → q.p.W α) :
     recF g (q.p.wMk a f' f) = g (abs ⟨a, splitFun f' (recF g ∘ f)⟩) := by
   rw [recF, MvPFunctor.wRec_eq] <;> rfl
 #align mvqpf.recF_eq MvQPF.recF_eq
+-/
 
+#print MvQPF.recF_eq' /-
 theorem recF_eq' {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) (x : q.p.W α) :
     recF g x = g (abs (appendFun id (recF g) <$$> q.p.wDest' x)) :=
   by
@@ -88,10 +93,12 @@ theorem recF_eq' {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) (
   intro a f' f
   rw [recF_eq, q.P.W_dest'_W_mk, MvPFunctor.map_eq, append_fun_comp_split_fun, TypeVec.id_comp]
 #align mvqpf.recF_eq' MvQPF.recF_eq'
+-/
 
+#print MvQPF.WEquiv /-
 /-- Equivalence relation on W-types that represent the same `fix F`
 value -/
-inductive Wequiv {α : TypeVec n} : q.p.W α → q.p.W α → Prop
+inductive WEquiv {α : TypeVec n} : q.p.W α → q.p.W α → Prop
   |
   ind (a : q.p.A) (f' : q.p.drop.B a ⟹ α) (f₀ f₁ : q.p.getLast.B a → q.p.W α) :
     (∀ x, Wequiv (f₀ x) (f₁ x)) → Wequiv (q.p.wMk a f' f₀) (q.p.wMk a f' f₁)
@@ -101,10 +108,12 @@ inductive Wequiv {α : TypeVec n} : q.p.W α → q.p.W α → Prop
     abs ⟨a₀, q.p.appendContents f'₀ f₀⟩ = abs ⟨a₁, q.p.appendContents f'₁ f₁⟩ →
       Wequiv (q.p.wMk a₀ f'₀ f₀) (q.p.wMk a₁ f'₁ f₁)
   | trans (u v w : q.p.W α) : Wequiv u v → Wequiv v w → Wequiv u w
-#align mvqpf.Wequiv MvQPF.Wequiv
+#align mvqpf.Wequiv MvQPF.WEquiv
+-/
 
-theorem recF_eq_of_wequiv (α : TypeVec n) {β : Type _} (u : F (α.append1 β) → β) (x y : q.p.W α) :
-    Wequiv x y → recF u x = recF u y :=
+#print MvQPF.recF_eq_of_wEquiv /-
+theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type _} (u : F (α.append1 β) → β) (x y : q.p.W α) :
+    WEquiv x y → recF u x = recF u y :=
   by
   apply q.P.W_cases _ x
   intro a₀ f'₀ f₀
@@ -114,43 +123,55 @@ theorem recF_eq_of_wequiv (α : TypeVec n) {β : Type _} (u : F (α.append1 β)
   case ind a f' f₀ f₁ h ih => simp only [recF_eq, Function.comp, ih]
   case abs a₀ f'₀ f₀ a₁ f'₁ f₁ h => simp only [recF_eq', abs_map, MvPFunctor.wDest'_wMk, h]
   case trans x y z e₁ e₂ ih₁ ih₂ => exact Eq.trans ih₁ ih₂
-#align mvqpf.recF_eq_of_Wequiv MvQPF.recF_eq_of_wequiv
+#align mvqpf.recF_eq_of_Wequiv MvQPF.recF_eq_of_wEquiv
+-/
 
-theorem Wequiv.abs' {α : TypeVec n} (x y : q.p.W α) (h : abs (q.p.wDest' x) = abs (q.p.wDest' y)) :
-    Wequiv x y := by
+#print MvQPF.wEquiv.abs' /-
+theorem wEquiv.abs' {α : TypeVec n} (x y : q.p.W α) (h : abs (q.p.wDest' x) = abs (q.p.wDest' y)) :
+    WEquiv x y := by
   revert h
   apply q.P.W_cases _ x
   intro a₀ f'₀ f₀
   apply q.P.W_cases _ y
   intro a₁ f'₁ f₁
   apply Wequiv.abs
-#align mvqpf.Wequiv.abs' MvQPF.Wequiv.abs'
+#align mvqpf.Wequiv.abs' MvQPF.wEquiv.abs'
+-/
 
-theorem Wequiv.refl {α : TypeVec n} (x : q.p.W α) : Wequiv x x := by
+#print MvQPF.wEquiv.refl /-
+theorem wEquiv.refl {α : TypeVec n} (x : q.p.W α) : WEquiv x x := by
   apply q.P.W_cases _ x <;> intro a f' f <;> exact Wequiv.abs a f' f a f' f rfl
-#align mvqpf.Wequiv.refl MvQPF.Wequiv.refl
+#align mvqpf.Wequiv.refl MvQPF.wEquiv.refl
+-/
 
-theorem Wequiv.symm {α : TypeVec n} (x y : q.p.W α) : Wequiv x y → Wequiv y x :=
+#print MvQPF.wEquiv.symm /-
+theorem wEquiv.symm {α : TypeVec n} (x y : q.p.W α) : WEquiv x y → WEquiv y x :=
   by
   intro h; induction h
   case ind a f' f₀ f₁ h ih => exact Wequiv.ind _ _ _ _ ih
   case abs a₀ f'₀ f₀ a₁ f'₁ f₁ h => exact Wequiv.abs _ _ _ _ _ _ h.symm
-  case trans x y z e₁ e₂ ih₁ ih₂ => exact MvQPF.Wequiv.trans _ _ _ ih₂ ih₁
-#align mvqpf.Wequiv.symm MvQPF.Wequiv.symm
+  case trans x y z e₁ e₂ ih₁ ih₂ => exact MvQPF.WEquiv.trans _ _ _ ih₂ ih₁
+#align mvqpf.Wequiv.symm MvQPF.wEquiv.symm
+-/
 
+#print MvQPF.wrepr /-
 /-- maps every element of the W type to a canonical representative -/
 def wrepr {α : TypeVec n} : q.p.W α → q.p.W α :=
   recF (q.p.wMk' ∘ repr)
 #align mvqpf.Wrepr MvQPF.wrepr
+-/
 
+#print MvQPF.wrepr_wMk /-
 theorem wrepr_wMk {α : TypeVec n} (a : q.p.A) (f' : q.p.drop.B a ⟹ α)
     (f : q.p.getLast.B a → q.p.W α) :
     wrepr (q.p.wMk a f' f) =
       q.p.wMk' (repr (abs (appendFun id wrepr <$$> ⟨a, q.p.appendContents f' f⟩))) :=
   by rw [Wrepr, recF_eq', q.P.W_dest'_W_mk] <;> rfl
 #align mvqpf.Wrepr_W_mk MvQPF.wrepr_wMk
+-/
 
-theorem wrepr_equiv {α : TypeVec n} (x : q.p.W α) : Wequiv (wrepr x) x :=
+#print MvQPF.wrepr_equiv /-
+theorem wrepr_equiv {α : TypeVec n} (x : q.p.W α) : WEquiv (wrepr x) x :=
   by
   apply q.P.W_ind _ x; intro a f' f ih
   apply Wequiv.trans _ (q.P.W_mk' (append_fun id Wrepr <$$> ⟨a, q.P.append_contents f' f⟩))
@@ -159,9 +180,11 @@ theorem wrepr_equiv {α : TypeVec n} (x : q.p.W α) : Wequiv (wrepr x) x :=
   rw [q.P.map_eq, MvPFunctor.wMk', append_fun_comp_split_fun, id_comp]
   apply Wequiv.ind; exact ih
 #align mvqpf.Wrepr_equiv MvQPF.wrepr_equiv
+-/
 
-theorem wequiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.p.W α) :
-    Wequiv x y → Wequiv (g <$$> x) (g <$$> y) :=
+#print MvQPF.wEquiv_map /-
+theorem wEquiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.p.W α) :
+    WEquiv x y → WEquiv (g <$$> x) (g <$$> y) :=
   by
   intro h; induction h
   case ind a f' f₀ f₁ h ih => rw [q.P.W_map_W_mk, q.P.W_map_W_mk]; apply Wequiv.ind; apply ih
@@ -172,17 +195,21 @@ theorem wequiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.p.W α) :
       abs (q.P.obj_append1 a₀ (g ⊚ f'₀) fun x => q.P.W_map g (f₀ x)) =
         abs (q.P.obj_append1 a₁ (g ⊚ f'₁) fun x => q.P.W_map g (f₁ x))
     rw [← q.P.map_obj_append1, ← q.P.map_obj_append1, abs_map, abs_map, h]
-  case trans x y z e₁ e₂ ih₁ ih₂ => apply MvQPF.Wequiv.trans; apply ih₁; apply ih₂
-#align mvqpf.Wequiv_map MvQPF.wequiv_map
+  case trans x y z e₁ e₂ ih₁ ih₂ => apply MvQPF.WEquiv.trans; apply ih₁; apply ih₂
+#align mvqpf.Wequiv_map MvQPF.wEquiv_map
+-/
 
+#print MvQPF.wSetoid /-
 /-- Define the fixed point as the quotient of trees under the equivalence relation.
 -/
 def wSetoid (α : TypeVec n) : Setoid (q.p.W α) :=
-  ⟨Wequiv, @Wequiv.refl _ _ _ _ _, @Wequiv.symm _ _ _ _ _, @Wequiv.trans _ _ _ _ _⟩
+  ⟨WEquiv, @wEquiv.refl _ _ _ _ _, @wEquiv.symm _ _ _ _ _, @WEquiv.trans _ _ _ _ _⟩
 #align mvqpf.W_setoid MvQPF.wSetoid
+-/
 
 attribute [local instance] W_setoid
 
+#print MvQPF.Fix /-
 /-- Least fixed point of functor F. The result is a functor with one fewer parameters
 than the input. For `F a b c` a ternary functor, fix F is a binary functor such that
 
@@ -193,40 +220,54 @@ fix F a b = F a b (fix F a b)
 def Fix {n : ℕ} (F : TypeVec (n + 1) → Type _) [MvFunctor F] [q : MvQPF F] (α : TypeVec n) :=
   Quotient (wSetoid α : Setoid (q.p.W α))
 #align mvqpf.fix MvQPF.Fix
+-/
 
 attribute [nolint has_nonempty_instance] fix
 
+#print MvQPF.Fix.map /-
 /-- `fix F` is a functor -/
 def Fix.map {α β : TypeVec n} (g : α ⟹ β) : Fix F α → Fix F β :=
-  Quotient.lift (fun x : q.p.W α => ⟦q.p.wMap g x⟧) fun a b h => Quot.sound (wequiv_map _ _ _ h)
+  Quotient.lift (fun x : q.p.W α => ⟦q.p.wMap g x⟧) fun a b h => Quot.sound (wEquiv_map _ _ _ h)
 #align mvqpf.fix.map MvQPF.Fix.map
+-/
 
+#print MvQPF.Fix.mvfunctor /-
 instance Fix.mvfunctor : MvFunctor (Fix F) where map := @Fix.map _ _ _ _
 #align mvqpf.fix.mvfunctor MvQPF.Fix.mvfunctor
+-/
 
 variable {α : TypeVec.{u} n}
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print MvQPF.Fix.rec /-
 /-- Recursor for `fix F` -/
 def Fix.rec {β : Type u} (g : F (α ::: β) → β) : Fix F α → β :=
-  Quot.lift (recF g) (recF_eq_of_wequiv α g)
+  Quot.lift (recF g) (recF_eq_of_wEquiv α g)
 #align mvqpf.fix.rec MvQPF.Fix.rec
+-/
 
+#print MvQPF.fixToW /-
 /-- Access W-type underlying `fix F`  -/
 def fixToW : Fix F α → q.p.W α :=
-  Quotient.lift wrepr (recF_eq_of_wequiv α fun x => q.p.wMk' (repr x))
+  Quotient.lift wrepr (recF_eq_of_wEquiv α fun x => q.p.wMk' (repr x))
 #align mvqpf.fix_to_W MvQPF.fixToW
+-/
 
+#print MvQPF.Fix.mk /-
 /-- Constructor for `fix F` -/
 def Fix.mk (x : F (append1 α (Fix F α))) : Fix F α :=
   Quot.mk _ (q.p.wMk' (appendFun id fixToW <$$> repr x))
 #align mvqpf.fix.mk MvQPF.Fix.mk
+-/
 
+#print MvQPF.Fix.dest /-
 /-- Destructor for `fix F` -/
 def Fix.dest : Fix F α → F (append1 α (Fix F α)) :=
   Fix.rec (MvFunctor.map (appendFun id Fix.mk))
 #align mvqpf.fix.dest MvQPF.Fix.dest
+-/
 
+#print MvQPF.Fix.rec_eq /-
 theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1 α (Fix F α))) :
     Fix.rec g (Fix.mk x) = g (appendFun id (Fix.rec g) <$$> x) :=
   by
@@ -244,7 +285,9 @@ theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1
   rw [MvPFunctor.map_eq, recF_eq', ← MvPFunctor.map_eq, MvPFunctor.wDest'_wMk']
   rw [← MvPFunctor.comp_map, abs_map, ← h, abs_repr, ← append_fun_comp, id_comp, this]
 #align mvqpf.fix.rec_eq MvQPF.Fix.rec_eq
+-/
 
+#print MvQPF.Fix.ind_aux /-
 theorem Fix.ind_aux (a : q.p.A) (f' : q.p.drop.B a ⟹ α) (f : q.p.getLast.B a → q.p.W α) :
     Fix.mk (abs ⟨a, q.p.appendContents f' fun x => ⟦f x⟧⟩) = ⟦q.p.wMk a f' f⟧ :=
   by
@@ -262,7 +305,9 @@ theorem Fix.ind_aux (a : q.p.A) (f' : q.p.drop.B a ⟹ α) (f : q.p.getLast.B a
   apply Quot.sound
   apply Wrepr_equiv
 #align mvqpf.fix.ind_aux MvQPF.Fix.ind_aux
+-/
 
+#print MvQPF.Fix.ind_rec /-
 theorem Fix.ind_rec {β : Type _} (g₁ g₂ : Fix F α → β)
     (h :
       ∀ x : F (append1 α (Fix F α)),
@@ -284,7 +329,9 @@ theorem Fix.ind_rec {β : Type _} (g₁ g₂ : Fix F α → β)
     exact ih x
   rw [this]
 #align mvqpf.fix.ind_rec MvQPF.Fix.ind_rec
+-/
 
+#print MvQPF.Fix.rec_unique /-
 theorem Fix.rec_unique {β : Type _} (g : F (append1 α β) → β) (h : Fix F α → β)
     (hyp : ∀ x, h (Fix.mk x) = g (appendFun id h <$$> x)) : Fix.rec g = h :=
   by
@@ -293,7 +340,9 @@ theorem Fix.rec_unique {β : Type _} (g : F (append1 α β) → β) (h : Fix F 
   intro x hyp'
   rw [hyp, ← hyp', fix.rec_eq]
 #align mvqpf.fix.rec_unique MvQPF.Fix.rec_unique
+-/
 
+#print MvQPF.Fix.mk_dest /-
 theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x :=
   by
   change (fix.mk ∘ fix.dest) x = x
@@ -304,7 +353,9 @@ theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x :=
   show fix.mk (append_fun id id <$$> x) = fix.mk x
   rw [append_fun_id_id, MvFunctor.id_map]
 #align mvqpf.fix.mk_dest MvQPF.Fix.mk_dest
+-/
 
+#print MvQPF.Fix.dest_mk /-
 theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x :=
   by
   unfold fix.dest
@@ -318,7 +369,9 @@ theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x :=
     apply fix.mk_dest
   rw [this, append_fun_id_id]
 #align mvqpf.fix.dest_mk MvQPF.Fix.dest_mk
+-/
 
+#print MvQPF.Fix.ind /-
 theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
     (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x :=
   by
@@ -335,10 +388,12 @@ theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
   · apply ih
   · trivial
 #align mvqpf.fix.ind MvQPF.Fix.ind
+-/
 
+#print MvQPF.mvqpfFix /-
 instance mvqpfFix : MvQPF (Fix F) where
   p := q.p.wp
-  abs α := Quot.mk Wequiv
+  abs α := Quot.mk WEquiv
   repr α := fixToW
   abs_repr := by
     intro α
@@ -354,9 +409,11 @@ instance mvqpfFix : MvQPF (Fix F) where
     rw [fix.map]; apply Quot.sound
     apply Wequiv.refl
 #align mvqpf.mvqpf_fix MvQPF.mvqpfFix
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print MvQPF.Fix.drec /-
 /-- Dependent recursor for `fix F` -/
 def Fix.drec {β : Fix F α → Type u}
     (g : ∀ x : F (α ::: Sigma β), β (Fix.mk <| (id ::: Sigma.fst) <$$> x)) (x : Fix F α) : β x :=
@@ -376,6 +433,7 @@ def Fix.drec {β : Fix F α → Type u}
     rw [MvFunctor.map_map, ← append_fun_comp, id_comp]
   cast (by rw [this]) y.2
 #align mvqpf.fix.drec MvQPF.Fix.drec
+-/
 
 end MvQPF
 

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 1 (#12338)

A PR accompanying #12339.

Zulip discussion

Diff
@@ -164,7 +164,10 @@ theorem wEquiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.P.W α) :
       abs (q.P.objAppend1 a₀ (g ⊚ f'₀) fun x => q.P.wMap g (f₀ x)) =
         abs (q.P.objAppend1 a₁ (g ⊚ f'₁) fun x => q.P.wMap g (f₁ x))
     rw [← q.P.map_objAppend1, ← q.P.map_objAppend1, abs_map, abs_map, h]
-  | trans x y z _ _ ih₁ ih₂ => apply MvQPF.WEquiv.trans; apply ih₁; apply ih₂
+  | trans x y z _ _ ih₁ ih₂ =>
+    apply MvQPF.WEquiv.trans
+    · apply ih₁
+    · apply ih₂
 set_option linter.uppercaseLean3 false in
 #align mvqpf.Wequiv_map MvQPF.wEquiv_map
 
chore: classify porting notes referring to missing linters (#12098)

Reference the newly created issues #12094 and #12096, as well as the pre-existing #5171. Change all references to #10927 to #5171. Some of these changes were not labelled as "porting note"; change this for good measure.

Diff
@@ -188,6 +188,7 @@ def Fix {n : ℕ} (F : TypeVec (n + 1) → Type*) [MvFunctor F] [q : MvQPF F] (
   Quotient (wSetoid α : Setoid (q.P.W α))
 #align mvqpf.fix MvQPF.Fix
 
+-- Porting note(#5171): this linter isn't ported yet.
 --attribute [nolint has_nonempty_instance] Fix
 
 /-- `Fix F` is a functor -/
chore: replace λ by fun (#11301)

Per the style guidelines, λ is disallowed in mathlib. This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes

  • In lines I was modifying anyway, I also converted => to .
  • Also contains some mild in-passing indentation fixes in Mathlib/Order/SupClosed.
  • Some doc comments still contained Lean 3 syntax λ x, , which I also replaced.
Diff
@@ -97,7 +97,7 @@ theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type u} (u : F (α.append1 β)
   intro a₁ f'₁ f₁
   intro h
   -- Porting note: induction on h doesn't work.
-  refine' @WEquiv.recOn _ _ _ _ _ (λ a a' _ => recF u a = recF u a') _ _ h _ _ _
+  refine' @WEquiv.recOn _ _ _ _ _ (fun a a' _ ↦ recF u a = recF u a') _ _ h _ _ _
   · intros a f' f₀ f₁ _h ih; simp only [recF_eq, Function.comp]
     congr; funext; congr; funext; apply ih
   · intros a₀ f'₀ f₀ a₁ f'₁ f₁ h; simp only [recF_eq', abs_map, MvPFunctor.wDest'_wMk, h]
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -96,7 +96,7 @@ theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type u} (u : F (α.append1 β)
   apply q.P.w_cases _ y
   intro a₁ f'₁ f₁
   intro h
-  -- porting note: induction on h doesn't work.
+  -- Porting note: induction on h doesn't work.
   refine' @WEquiv.recOn _ _ _ _ _ (λ a a' _ => recF u a = recF u a') _ _ h _ _ _
   · intros a f' f₀ f₁ _h ih; simp only [recF_eq, Function.comp]
     congr; funext; congr; funext; apply ih
chore: prepare Lean version bump with explicit simp (#10999)

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

Diff
@@ -345,7 +345,7 @@ def Fix.drec {β : Fix F α → Type u}
   let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
   have : x = y.1 := by
     symm
-    dsimp
+    dsimp [y]
     apply Fix.ind_rec _ id _ x
     intro x' ih
     rw [Fix.rec_eq]
style: use cases x with | ... instead of cases x; case => ... (#9321)

This converts usages of the pattern

cases h
case inl h' => ...
case inr h' => ...

which derive from mathported code, to the "structured cases" syntax:

cases h with
| inl h' => ...
| inr h' => ...

The case where the subgoals are handled with · instead of case is more contentious (and much more numerous) so I left those alone. This pattern also appears with cases', induction, induction', and rcases. Furthermore, there is a similar transformation for by_cases:

by_cases h : cond
case pos => ...
case neg => ...

is replaced by:

if h : cond then
  ...
else
  ...

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -123,10 +123,10 @@ set_option linter.uppercaseLean3 false in
 #align mvqpf.Wequiv.refl MvQPF.wEquiv.refl
 
 theorem wEquiv.symm {α : TypeVec n} (x y : q.P.W α) : WEquiv x y → WEquiv y x := by
-  intro h; induction h
-  case ind a f' f₀ f₁ _h ih => exact WEquiv.ind _ _ _ _ ih
-  case abs a₀ f'₀ f₀ a₁ f'₁ f₁ h => exact WEquiv.abs _ _ _ _ _ _ h.symm
-  case trans x y z _e₁ _e₂ ih₁ ih₂ => exact MvQPF.WEquiv.trans _ _ _ ih₂ ih₁
+  intro h; induction h with
+  | ind a f' f₀ f₁ _h ih => exact WEquiv.ind _ _ _ _ ih
+  | abs a₀ f'₀ f₀ a₁ f'₁ f₁ h => exact WEquiv.abs _ _ _ _ _ _ h.symm
+  | trans x y z _e₁ _e₂ ih₁ ih₂ => exact MvQPF.WEquiv.trans _ _ _ ih₂ ih₁
 set_option linter.uppercaseLean3 false in
 #align mvqpf.Wequiv.symm MvQPF.wEquiv.symm
 
@@ -156,16 +156,15 @@ set_option linter.uppercaseLean3 false in
 
 theorem wEquiv_map {α β : TypeVec n} (g : α ⟹ β) (x y : q.P.W α) :
     WEquiv x y → WEquiv (g <$$> x) (g <$$> y) := by
-  intro h; induction h
-  case ind a f' f₀ f₁ h ih => rw [q.P.w_map_wMk, q.P.w_map_wMk]; apply WEquiv.ind; exact ih
-  case
-    abs a₀ f'₀ f₀ a₁ f'₁ f₁ h =>
+  intro h; induction h with
+  | ind a f' f₀ f₁ h ih => rw [q.P.w_map_wMk, q.P.w_map_wMk]; apply WEquiv.ind; exact ih
+  | abs a₀ f'₀ f₀ a₁ f'₁ f₁ h =>
     rw [q.P.w_map_wMk, q.P.w_map_wMk]; apply WEquiv.abs
     show
       abs (q.P.objAppend1 a₀ (g ⊚ f'₀) fun x => q.P.wMap g (f₀ x)) =
         abs (q.P.objAppend1 a₁ (g ⊚ f'₁) fun x => q.P.wMap g (f₁ x))
     rw [← q.P.map_objAppend1, ← q.P.map_objAppend1, abs_map, abs_map, h]
-  case trans x y z _ _ ih₁ ih₂ => apply MvQPF.WEquiv.trans; apply ih₁; apply ih₂
+  | trans x y z _ _ ih₁ ih₂ => apply MvQPF.WEquiv.trans; apply ih₁; apply ih₂
 set_option linter.uppercaseLean3 false in
 #align mvqpf.Wequiv_map MvQPF.wEquiv_map
 
chore: Remove nonterminal simp at (#7795)

Removes nonterminal uses of simp at. Replaces most of these with instances of simp? ... says.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -351,7 +351,8 @@ def Fix.drec {β : Fix F α → Type u}
     intro x' ih
     rw [Fix.rec_eq]
     dsimp
-    simp [appendFun_id_id] at ih
+    simp? [appendFun_id_id] at ih says
+      simp only [appendFun_id_id, MvFunctor.id_map] at ih
     congr
     conv =>
       rhs
chore: remove many 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.

Diff
@@ -56,19 +56,19 @@ variable {n : ℕ} {F : TypeVec.{u} (n + 1) → Type u} [MvFunctor F] [q : MvQPF
 /-- `recF` is used as a basis for defining the recursor on `Fix F α`. `recF`
 traverses recursively the W-type generated by `q.P` using a function on `F`
 as a recursive step -/
-def recF {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) : q.P.W α → β :=
+def recF {α : TypeVec n} {β : Type u} (g : F (α.append1 β) → β) : q.P.W α → β :=
   q.P.wRec fun a f' _f rec => g (abs ⟨a, splitFun f' rec⟩)
 set_option linter.uppercaseLean3 false in
 #align mvqpf.recF MvQPF.recF
 
-theorem recF_eq {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) (a : q.P.A)
+theorem recF_eq {α : TypeVec n} {β : Type u} (g : F (α.append1 β) → β) (a : q.P.A)
     (f' : q.P.drop.B a ⟹ α) (f : q.P.last.B a → q.P.W α) :
     recF g (q.P.wMk a f' f) = g (abs ⟨a, splitFun f' (recF g ∘ f)⟩) := by
   rw [recF, MvPFunctor.wRec_eq]; rfl
 set_option linter.uppercaseLean3 false in
 #align mvqpf.recF_eq MvQPF.recF_eq
 
-theorem recF_eq' {α : TypeVec n} {β : Type _} (g : F (α.append1 β) → β) (x : q.P.W α) :
+theorem recF_eq' {α : TypeVec n} {β : Type u} (g : F (α.append1 β) → β) (x : q.P.W α) :
     recF g x = g (abs (appendFun id (recF g) <$$> q.P.wDest' x)) := by
   apply q.P.w_cases _ x
   intro a f' f
@@ -89,7 +89,7 @@ inductive WEquiv {α : TypeVec n} : q.P.W α → q.P.W α → Prop
 set_option linter.uppercaseLean3 false in
 #align mvqpf.Wequiv MvQPF.WEquiv
 
-theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type _} (u : F (α.append1 β) → β) (x y : q.P.W α) :
+theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type u} (u : F (α.append1 β) → β) (x y : q.P.W α) :
     WEquiv x y → recF u x = recF u y := by
   apply q.P.w_cases _ x
   intro a₀ f'₀ f₀
@@ -255,7 +255,7 @@ theorem Fix.ind_aux (a : q.P.A) (f' : q.P.drop.B a ⟹ α) (f : q.P.last.B a →
   apply wrepr_equiv
 #align mvqpf.fix.ind_aux MvQPF.Fix.ind_aux
 
-theorem Fix.ind_rec {β : Type _} (g₁ g₂ : Fix F α → β)
+theorem Fix.ind_rec {β : Type u} (g₁ g₂ : Fix F α → β)
     (h :
       ∀ x : F (append1 α (Fix F α)),
         appendFun id g₁ <$$> x = appendFun id g₂ <$$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
@@ -276,7 +276,7 @@ theorem Fix.ind_rec {β : Type _} (g₁ g₂ : Fix F α → β)
   rw [this]
 #align mvqpf.fix.ind_rec MvQPF.Fix.ind_rec
 
-theorem Fix.rec_unique {β : Type _} (g : F (append1 α β) → β) (h : Fix F α → β)
+theorem Fix.rec_unique {β : Type u} (g : F (append1 α β) → β) (h : Fix F α → β)
     (hyp : ∀ x, h (Fix.mk x) = g (appendFun id h <$$> x)) : Fix.rec g = h := by
   ext x
   apply Fix.ind_rec
chore: cleanup some spaces (#7484)

Purely cosmetic PR.

Diff
@@ -106,7 +106,7 @@ set_option linter.uppercaseLean3 false in
 #align mvqpf.recF_eq_of_Wequiv MvQPF.recF_eq_of_wEquiv
 
 theorem wEquiv.abs' {α : TypeVec n} (x y : q.P.W α)
-    (h : MvQPF.abs (q.P.wDest' x ) = MvQPF.abs (q.P.wDest' y)) :
+    (h : MvQPF.abs (q.P.wDest' x) = MvQPF.abs (q.P.wDest' y)) :
     WEquiv x y := by
   revert h
   apply q.P.w_cases _ x
chore: exactly 4 spaces in theorems (#7328)

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

Diff
@@ -106,7 +106,7 @@ set_option linter.uppercaseLean3 false in
 #align mvqpf.recF_eq_of_Wequiv MvQPF.recF_eq_of_wEquiv
 
 theorem wEquiv.abs' {α : TypeVec n} (x y : q.P.W α)
-                    (h : MvQPF.abs (q.P.wDest' x ) = MvQPF.abs (q.P.wDest' y)) :
+    (h : MvQPF.abs (q.P.wDest' x ) = MvQPF.abs (q.P.wDest' y)) :
     WEquiv x y := by
   revert h
   apply q.P.w_cases _ x
chore: banish Type _ and Sort _ (#6499)

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

This has nice performance benefits.

Diff
@@ -185,7 +185,7 @@ than the input. For `F a b c` a ternary functor, `Fix F` is a binary functor suc
 Fix F a b = F a b (Fix F a b)
 ```
 -/
-def Fix {n : ℕ} (F : TypeVec (n + 1) → Type _) [MvFunctor F] [q : MvQPF F] (α : TypeVec n) :=
+def Fix {n : ℕ} (F : TypeVec (n + 1) → Type*) [MvFunctor F] [q : MvQPF F] (α : TypeVec n) :=
   Quotient (wSetoid α : Setoid (q.P.W α))
 #align mvqpf.fix MvQPF.Fix
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2018 Jeremy Avigad. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Jeremy Avigad, Simon Hudon
-
-! This file was ported from Lean 3 source module data.qpf.multivariate.constructions.fix
-! leanprover-community/mathlib commit 28aa996fc6fb4317f0083c4e6daf79878d81be33
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.PFunctor.Multivariate.W
 import Mathlib.Data.QPF.Multivariate.Basic
 
+#align_import data.qpf.multivariate.constructions.fix from "leanprover-community/mathlib"@"28aa996fc6fb4317f0083c4e6daf79878d81be33"
+
 /-!
 # The initial algebra of a multivariate qpf is again a qpf.
 
chore: fix grammar in docs (#5668)
Diff
@@ -14,8 +14,8 @@ import Mathlib.Data.QPF.Multivariate.Basic
 /-!
 # The initial algebra of a multivariate qpf is again a qpf.
 
-For a `(n+1)`-ary QPF `F (α₀,..,αₙ)`, we take the least fixed point of `F` with
-regards to its last argument `αₙ`. The result is a `n`-ary functor: `Fix F (α₀,..,αₙ₋₁)`.
+For an `(n+1)`-ary QPF `F (α₀,..,αₙ)`, we take the least fixed point of `F` with
+regards to its last argument `αₙ`. The result is an `n`-ary functor: `Fix F (α₀,..,αₙ₋₁)`.
 Making `Fix F` into a functor allows us to take the fixed point, compose with other functors
 and take a fixed point again.
 
chore: remove superfluous parentheses in calls to ext (#5258)

Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -305,7 +305,7 @@ theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x :=
     rw [← MvFunctor.id_map x]
   rw [← appendFun_comp, id_comp]
   have : Fix.mk ∘ Fix.dest = _root_.id := by
-    ext (x: Fix F α)
+    ext (x : Fix F α)
     apply Fix.mk_dest
   rw [this, appendFun_id_id]
 #align mvqpf.fix.dest_mk MvQPF.Fix.dest_mk
chore: bye-bye, solo bys! (#3825)

This PR puts, with one exception, every single remaining by that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh. The exception is when the by begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.

Essentially this is s/\n *by$/ by/g, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated bys".

Diff
@@ -244,8 +244,7 @@ theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1
 
 theorem Fix.ind_aux (a : q.P.A) (f' : q.P.drop.B a ⟹ α) (f : q.P.last.B a → q.P.W α) :
     Fix.mk (abs ⟨a, q.P.appendContents f' fun x => ⟦f x⟧⟩) = ⟦q.P.wMk a f' f⟧ := by
-  have : Fix.mk (abs ⟨a, q.P.appendContents f' fun x => ⟦f x⟧⟩) = ⟦wrepr (q.P.wMk a f' f)⟧ :=
-    by
+  have : Fix.mk (abs ⟨a, q.P.appendContents f' fun x => ⟦f x⟧⟩) = ⟦wrepr (q.P.wMk a f' f)⟧ := by
     apply Quot.sound; apply wEquiv.abs'
     rw [MvPFunctor.wDest'_wMk', abs_map, abs_repr, ← abs_map, MvPFunctor.map_eq]
     conv =>
@@ -274,8 +273,7 @@ theorem Fix.ind_rec {β : Type _} (g₁ g₂ : Fix F α → β)
   rw [← abs_map, ← abs_map, MvPFunctor.map_eq, MvPFunctor.map_eq]
   congr 2
   rw [MvPFunctor.appendContents, appendFun, appendFun, ← splitFun_comp, ← splitFun_comp]
-  have : (g₁ ∘ fun x => ⟦f x⟧) = g₂ ∘ fun x => ⟦f x⟧ :=
-    by
+  have : (g₁ ∘ fun x => ⟦f x⟧) = g₂ ∘ fun x => ⟦f x⟧ := by
     ext x
     exact ih x
   rw [this]
chore: fix #align lines (#3640)

This PR fixes two things:

  • Most 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.
  • All remaining more-than-one-line #align statements. (This was needed for a script I wrote for #3630.)
Diff
@@ -364,7 +364,6 @@ def Fix.drec {β : Fix F α → Type u}
     rw [MvFunctor.map_map, ← appendFun_comp, id_comp]
     simp only [Function.comp]
   cast (by rw [this]) y.2
-
 #align mvqpf.fix.drec MvQPF.Fix.drec
 
 end MvQPF
feat: Port/Data.QPF.Multivariate.Constructions.Fix (#2409)

Co-authored-by: casavaca <96765450+casavaca@users.noreply.github.com> Co-authored-by: Alex Keizer <alex@keizer.dev>

Dependencies 6 + 218

219 files ported (97.3%)
95690 lines ported (97.8%)
Show graph

The unported dependencies are