File: Mathlib/Control/Functor/Multivariate.lean

full_name: MvFunctor
code: /-- Multivariate functors, i.e. functor between the category of type vectors
and the category of Type -/
class MvFunctor {n : ℕ} (F : TypeVec n → Type*) where
  /-- Multivariate map, if `f : α ⟹ β` and `x : F α` then `f <$$> x : F β`. -/
  map : ∀ {α β : TypeVec n}, α ⟹ β → F α → F β
goal: Type (max u_1 (u_2 + 1))

full_name: MvFunctor.map
code: /-- Multivariate functors, i.e. functor between the category of type vectors
and the category of Type -/
class MvFunctor {n : ℕ} (F : TypeVec n → Type*) where
  /-- Multivariate map, if `f : α ⟹ β` and `x : F α` then `f <$$> x : F β`. -/
  map : ∀ {α β : TypeVec n}, α ⟹ β → F α → F β
goal: α ⟹ β → F α → F β

full_name: MvFunctor.«_aux_Mathlib_Control_Functor_Multivariate___macroRules_MvFunctor_term_<$$>__1»
code: /-- Multivariate map, if `f : α ⟹ β` and `x : F α` then `f <$$> x : F β` -/
scoped[MvFunctor] infixr:100 " <$$> " => MvFunctor.map
goal: Lean.Macro

full_name: MvFunctor._aux_Mathlib_Control_Functor_Multivariate___unexpand_MvFunctor_map_1
code: /-- Multivariate map, if `f : α ⟹ β` and `x : F α` then `f <$$> x : F β` -/
scoped[MvFunctor] infixr:100 " <$$> " => MvFunctor.map
goal: Lean.PrettyPrinter.Unexpander

full_name: MvFunctor.LiftP
code: /-- predicate lifting over multivariate functors -/
def LiftP {α : TypeVec n} (P : ∀ i, α i → Prop) (x : F α) : Prop 
goal: Prop

full_name: MvFunctor.LiftR
code: /-- relational lifting over multivariate functors -/
def LiftR {α : TypeVec n} (R : ∀ {i}, α i → α i → Prop) (x y : F α) : Prop 
goal: Prop

full_name: MvFunctor.supp
code: /-- given `x : F α` and a projection `i` of type vector `α`, `supp x i` is the set
of `α.i` contained in `x` -/
def supp {α : TypeVec n} (x : F α) (i : Fin2 n) : Set (α i) 
goal: Set (α i)

full_name: MvFunctor.of_mem_supp
code: theorem of_mem_supp {α : TypeVec n} {x : F α} {P : ∀ ⦃i⦄, α i → Prop} (h : LiftP P x) (i : Fin2 n) :
    ∀ y ∈ supp x i, P y 
goal: y ∈ MvFunctor.supp x i → P y

full_name: LawfulMvFunctor
code: /-- laws for `MvFunctor` -/
class LawfulMvFunctor {n : ℕ} (F : TypeVec n → Type*) [MvFunctor F] : Prop where
  /-- `map` preserved identities, i.e., maps identity on `α` to identity on `F α` -/
  id_map : ∀ {α : TypeVec n} (x : F α), TypeVec.id <$$> x = x
  /-- `map` preserves compositions -/
  comp_map :
    ∀ {α β γ : TypeVec n} (g : α ⟹ β) (h : β ⟹ γ) (x : F α), (h ⊚ g) <$$> x = h <$$> g <$$> x
goal: Prop

full_name: LawfulMvFunctor.id_map
code: /-- laws for `MvFunctor` -/
class LawfulMvFunctor {n : ℕ} (F : TypeVec n → Type*) [MvFunctor F] : Prop where
  /-- `map` preserved identities, i.e., maps identity on `α` to identity on `F α` -/
  id_map : ∀ {α : TypeVec n} (x : F α), TypeVec.id <$$> x = x
  /-- `map` preserves compositions -/
  comp_map :
    ∀ {α β γ : TypeVec n} (g : α ⟹ β) (h : β ⟹ γ) (x : F α), (h ⊚ g) <$$> x = h <$$> g <$$> x
goal: TypeVec.id <$$> x = x

full_name: LawfulMvFunctor.comp_map
code: /-- laws for `MvFunctor` -/
class LawfulMvFunctor {n : ℕ} (F : TypeVec n → Type*) [MvFunctor F] : Prop where
  /-- `map` preserved identities, i.e., maps identity on `α` to identity on `F α` -/
  id_map : ∀ {α : TypeVec n} (x : F α), TypeVec.id <$$> x = x
  /-- `map` preserves compositions -/
  comp_map :
    ∀ {α β γ : TypeVec n} (g : α ⟹ β) (h : β ⟹ γ) (x : F α), (h ⊚ g) <$$> x = h <$$> g <$$> x
goal: (h ⊚ g) <$$> x = h <$$> g <$$> x

full_name: MvFunctor.LiftP'
code: /-- adapt `MvFunctor.LiftP` to accept predicates as arrows -/
def LiftP' : F α → Prop 
goal: F α → Prop

full_name: MvFunctor.LiftR'
code: /-- adapt `MvFunctor.LiftR` to accept relations as arrows -/
def LiftR' : F α → F α → Prop 
goal: F α → F α → Prop

full_name: MvFunctor.id_map
code: @[simp]
theorem id_map (x : F α) : TypeVec.id <$$> x = x 
goal: TypeVec.id <$$> x = x

full_name: MvFunctor.id_map'
code: @[simp]
theorem id_map' (x : F α) : (fun _i a => a) <$$> x = x 
goal: (fun _i a => a) <$$> x = x

full_name: MvFunctor.map_map
code: theorem map_map (g : α ⟹ β) (h : β ⟹ γ) (x : F α) : h <$$> g <$$> x = (h ⊚ g) <$$> x 
goal: h <$$> g <$$> x = (h ⊚ g) <$$> x

full_name: MvFunctor.exists_iff_exists_of_mono
code: theorem exists_iff_exists_of_mono {P : F α → Prop} {q : F β → Prop}
    (f : α ⟹ β) (g : β ⟹ α)
    (h₀ : f ⊚ g = TypeVec.id)
    (h₁ : ∀ u : F α, P u ↔ q (f <$$> u)) :
    (∃ u : F α, P u) ↔ ∃ u : F β, q u 
goal: (∃ u, P u) ↔ ∃ u, q u

full_name: MvFunctor.LiftP_def
code: theorem LiftP_def (x : F α) : LiftP' P x ↔ ∃ u : F (Subtype_ P), subtypeVal P <$$> u = x 
goal: MvFunctor.LiftP' P x ↔ ∃ u, TypeVec.subtypeVal P <$$> u = x

full_name: MvFunctor.LiftR_def
code: theorem LiftR_def (x y : F α) :
    LiftR' R x y ↔
      ∃ u : F (Subtype_ R),
        (TypeVec.prod.fst ⊚ subtypeVal R) <$$> u = x ∧
          (TypeVec.prod.snd ⊚ subtypeVal R) <$$> u = y 
goal: MvFunctor.LiftR' R x y ↔
  ∃ u, (TypeVec.prod.fst ⊚ TypeVec.subtypeVal R) <$$> u = x ∧ (TypeVec.prod.snd ⊚ TypeVec.subtypeVal R) <$$> u = y

full_name: _private.Mathlib.Control.Functor.Multivariate.0.MvFunctor.f
code: private def f :
    ∀ n α,
      (fun i : Fin2 (n + 1) => { p_1 // ofRepeat (PredLast' α pp i p_1) }) ⟹ fun i : Fin2 (n + 1) =>
        { p_1 : (α ::: β) i // PredLast α pp p_1 }
  
goal: (fun i => { p_1 // TypeVec.ofRepeat (α.PredLast' pp i p_1) }) ⟹ fun i => { p_1 // α.PredLast pp p_1 }

full_name: _private.Mathlib.Control.Functor.Multivariate.0.MvFunctor.g
code: private def g :
    ∀ n α,
      (fun i : Fin2 (n + 1) => { p_1 : (α ::: β) i // PredLast α pp p_1 }) ⟹ fun i : Fin2 (n + 1) =>
        { p_1 // ofRepeat (PredLast' α pp i p_1) }
  
goal: (fun i => { p_1 // α.PredLast pp p_1 }) ⟹ fun i => { p_1 // TypeVec.ofRepeat (α.PredLast' pp i p_1) }

full_name: MvFunctor.LiftP_PredLast_iff
code: theorem LiftP_PredLast_iff {β} (P : β → Prop) (x : F (α ::: β)) :
    LiftP' (PredLast' _ P) x ↔ LiftP (PredLast _ P) x 
goal: MvFunctor.LiftP' (α.PredLast' P) x ↔ MvFunctor.LiftP (α.PredLast P) x

full_name: _private.Mathlib.Control.Functor.Multivariate.0.MvFunctor.f'
code: private def f' :
    ∀ n α,
      (fun i : Fin2 (n + 1) =>
          { p_1 : _ × _ // ofRepeat (RelLast' α rr i (TypeVec.prod.mk _ p_1.fst p_1.snd)) }) ⟹
        fun i : Fin2 (n + 1) => { p_1 : (α ::: β) i × _ // RelLast α rr p_1.fst p_1.snd }
  
goal: (fun i => { p_1 // TypeVec.ofRepeat (α.RelLast' rr i (TypeVec.prod.mk i p_1.1 p_1.2)) }) ⟹ fun i =>
  { p_1 // α.RelLast rr p_1.1 p_1.2 }

full_name: _private.Mathlib.Control.Functor.Multivariate.0.MvFunctor.g'
code: private def g' :
    ∀ n α,
      (fun i : Fin2 (n + 1) => { p_1 : (α ::: β) i × _ // RelLast α rr p_1.fst p_1.snd }) ⟹
        fun i : Fin2 (n + 1) =>
        { p_1 : _ × _ // ofRepeat (RelLast' α rr i (TypeVec.prod.mk _ p_1.1 p_1.2)) }
  
goal: (fun i => { p_1 // α.RelLast rr p_1.1 p_1.2 }) ⟹ fun i =>
  { p_1 // TypeVec.ofRepeat (α.RelLast' rr i (TypeVec.prod.mk i p_1.1 p_1.2)) }

full_name: MvFunctor.LiftR_RelLast_iff
code: theorem LiftR_RelLast_iff (x y : F (α ::: β)) :
    LiftR' (RelLast' _ rr) x y ↔ LiftR (RelLast (i := _) _ rr) x y 
goal: MvFunctor.LiftR' (α.RelLast' rr) x y ↔ MvFunctor.LiftR (fun {i} => α.RelLast rr) x y

full_name: MvFunctor.ofEquiv
code: /-- Any type function that is (extensionally) equivalent to a functor, is itself a functor -/
def ofEquiv {F F' : TypeVec.{u} n → Type*} [MvFunctor F'] (eqv : ∀ α, F α ≃ F' α) :
    MvFunctor F 
goal: MvFunctor F