Built with Alectryon, running Coq+SerAPI v8.16.0+0.16.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
From Tealeaves Require Import
  Functors.Early.Batch
  Classes.Kleisli.TraversableFunctor
  Classes.Coalgebraic.TraversableFunctor.

Import Batch.Notations.
Import Kleisli.TraversableFunctor.Notations.

#[local] Generalizable Variables G T M A B.

#[local] Arguments batch {A} (B)%type_scope _.

(** * Coalgebraic Traversable Functors From Kleisli Traversable Functors *)
(**********************************************************************)

(** ** Derived <<ToBatch>> Operation *)
(**********************************************************************)
Module DerivedOperations.

  #[export] Instance ToBatch_Traverse `{Traverse T}:
  Coalgebraic.TraversableFunctor.ToBatch T :=
  (fun A B => traverse (G := Batch A B) (batch B):
     T A -> Batch A B (T B)).

End DerivedOperations.

Class Compat_ToBatch_Traverse
  (T: Type -> Type)
  `{Traverse_inst: Traverse T}
  `{ToBatch_inst: ToBatch T} :=
  compat_toBatch_traverse:
    ToBatch_inst = DerivedOperations.ToBatch_Traverse.

T: Type -> Type
Traverse_inst: Traverse T
ToBatch_inst: ToBatch T
H: Compat_ToBatch_Traverse T

forall A B : Type, toBatch = traverse (batch B)
T: Type -> Type
Traverse_inst: Traverse T
ToBatch_inst: ToBatch T
H: Compat_ToBatch_Traverse T

forall A B : Type, toBatch = traverse (batch B)
T: Type -> Type
Traverse_inst: Traverse T
ToBatch_inst: ToBatch T
H: Compat_ToBatch_Traverse T
A, B: Type

toBatch = traverse (batch B)
T: Type -> Type
Traverse_inst: Traverse T
ToBatch_inst: ToBatch T
H: Compat_ToBatch_Traverse T
A, B: Type

DerivedOperations.ToBatch_Traverse A B = traverse (batch B)
reflexivity. Qed. #[export] Instance Compat_ToBatch_Traverse_Self `{Traverse T}: Compat_ToBatch_Traverse T (ToBatch_inst := DerivedOperations.ToBatch_Traverse) := ltac:(hnf; reflexivity). (** ** Derived Laws *) (**********************************************************************) Module DerivedInstances. Section instances. Context `{Traverse T} `{ToBatch T} `{! Kleisli.TraversableFunctor.TraversableFunctor T} `{! Compat_ToBatch_Traverse T}. (** *** Coalgebra laws *) (******************************************************************)
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T

forall A : Type, extract_Batch ∘ toBatch = id
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T

forall A : Type, extract_Batch ∘ toBatch = id
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A: Type

extract_Batch ∘ toBatch = id
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A: Type

extract_Batch ∘ traverse (batch A) = id
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A: Type

traverse (extract_Batch ∘ batch A) = id
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A: Type

traverse id = id
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A: Type

id = id
reflexivity. Qed.
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T

forall A B C : Type, cojoin_Batch ∘ toBatch = map toBatch ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T

forall A B C : Type, cojoin_Batch ∘ toBatch = map toBatch ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

cojoin_Batch ∘ toBatch = map toBatch ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

cojoin_Batch ∘ traverse (batch C) = map toBatch ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

traverse (cojoin_Batch ∘ batch C) = map toBatch ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

traverse double_batch = map toBatch ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

traverse double_batch = map (traverse (batch C)) ∘ toBatch
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

traverse double_batch = map (traverse (batch C)) ∘ traverse (batch B)
T: Type -> Type
H: Traverse T
H0: ToBatch T
H1: Kleisli.TraversableFunctor.TraversableFunctor T
Compat_ToBatch_Traverse0: Compat_ToBatch_Traverse T
A, B, C: Type

traverse double_batch = traverse (batch C ⋆2 batch B)
reflexivity. Qed. #[export] Instance Coalgebraic_Traversable_of_Kleisli: Coalgebraic.TraversableFunctor.TraversableFunctor T := {| trf_extract := toBatch_extract_Kleisli; trf_duplicate := toBatch_duplicate_Kleisli; |}. End instances. End DerivedInstances.