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 Export
Classes.Categorical.Applicative.From Tealeaves Require Import
Classes.Comonoid.Import Applicative.Notations.Import Product.Notations.#[local] Generalizable Variablesϕ F G A B C.(** * Commutative and Idempotent Elements and Functors *)(**********************************************************************)(** ** The Center of an Applicative Functor *)(**********************************************************************)ClassCenter (G: Type -> Type)
`{mapG: Map G} `{pureG: Pure G} `{multG: Mult G}
(A: Type) (a: G A): Prop :=
{ appcenter_left: forall (B: Type) (x: G B),
x ⊗ a = map (fun '(x, y) => (y, x)) (a ⊗ x);
appcenter_right: forall (B: Type) (x: G B),
a ⊗ x = map (fun '(x, y) => (y, x)) (x ⊗ a);
}.(** ** The Idempotent and Central Elements of an Applicative Functor *)(**********************************************************************)ClassIdempotent (G: Type -> Type)
`{mapG: Map G} `{pureG: Pure G} `{multG: Mult G}
(A: Type) (a: G A): Prop :=
{ appidem: a ⊗ a = map (funa => (a, a)) a;
}.ClassIdempotentCenter (G: Type -> Type)
`{mapG: Map G} `{pureG: Pure G} `{multG: Mult G}
(A: Type) (a: G A): Prop :=
{ appic_idem :> Idempotent G A a;
appic_center :> Center G A a;
}.#[global] Arguments appcenter_left {G}%function_scope {mapG pureG multG}
{A}%type_scope (a) {Center} {B}%type_scope x.#[global] Arguments appcenter_right {G}%function_scope {mapG pureG multG}
{A}%type_scope (a) {Center} {B}%type_scope x.#[global] Arguments appidem {G}%function_scope {mapG pureG multG}
{A}%type_scope (a) {Idempotent}.(** ** <<pure>> is always CI *)(**********************************************************************)Sectionpurity.Context `{Applicative G}.
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G
forall (A : Type) (a : A), Idempotent G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G
forall (A : Type) (a : A), Idempotent G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A
Idempotent G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A
pure a ⊗ pure a = map (funa : A => (a, a)) (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A
pure (a, a) = map (funa : A => (a, a)) (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A
pure (a, a) = pure (a, a)
reflexivity.Qed.
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G
forall (A : Type) (a : A), Center G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G
forall (A : Type) (a : A), Center G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A
Center G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
x ⊗ pure a = map (fun '(x, y) => (y, x)) (pure a ⊗ x)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
pure a ⊗ x = map (fun '(x, y) => (y, x)) (x ⊗ pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
x ⊗ pure a = map (fun '(x, y) => (y, x)) (pure a ⊗ x)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
x ⊗ pure a =
map (fun '(x, y) => (y, x)) (strength (a, x))
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (funb : B => (b, a)) x =
map (fun '(x, y) => (y, x)) (strength (a, x))
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (funb : B => (b, a)) x =
map (fun '(x, y) => (y, x)) (map (pair a) x)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (funb : B => (b, a)) x =
(map (fun '(x, y) => (y, x)) ∘ map (pair a)) x
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (funb : B => (b, a)) x =
map ((fun '(x, y) => (y, x)) ∘ pair a) x
reflexivity.
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
pure a ⊗ x = map (fun '(x, y) => (y, x)) (x ⊗ pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
strength (a, x) =
map (fun '(x, y) => (y, x)) (x ⊗ pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (pair a) x =
map (fun '(x, y) => (y, x))
(map (funb : B => (b, a)) x)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (pair a) x =
(map (fun '(x, y) => (y, x))
∘ map (funb : B => (b, a))) x
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G A: Type a: A B: Type x: G B
map (pair a) x =
map ((fun '(x, y) => (y, x)) ∘ (funb : B => (b, a)))
x
reflexivity.Qed.
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G
forall (A : Type) (a : A),
IdempotentCenter G A (pure a)
G: Type -> Type Map_G: Map G Pure_G: Pure G Mult_G: Mult G H: Applicative G
forall (A : Type) (a : A),
IdempotentCenter G A (pure a)
constructor;
typeclasses eauto.Qed.Endpurity.(** ** Everything is always CI for <<(fun A => A)>> *)(**********************************************************************)Sectionpurity.
forall (A : Type) (a : A),
Idempotent (funA0 : Type => A0) A (pure a)
forall (A : Type) (a : A),
Idempotent (funA0 : Type => A0) A (pure a)
A: Type a: A
Idempotent (funA : Type => A) A (pure a)
A: Type a: A
pure a ⊗ pure a = map (funa : A => (a, a)) (pure a)
reflexivity.Qed.
forall (A : Type) (a : A),
Center (funA0 : Type => A0) A (pure a)
forall (A : Type) (a : A),
Center (funA0 : Type => A0) A (pure a)
A: Type a: A
Center (funA : Type => A) A (pure a)
A: Type a: A
forall (B : Type) (x : B),
x ⊗ pure a =
map (fun '(x0, y) => (y, x0)) (pure a ⊗ x)
A: Type a: A
forall (B : Type) (x : B),
pure a ⊗ x =
map (fun '(x0, y) => (y, x0)) (x ⊗ pure a)
A: Type a: A
forall (B : Type) (x : B),
pure a ⊗ x =
map (fun '(x0, y) => (y, x0)) (x ⊗ pure a)
reflexivity.Qed.
forall (A : Type) (a : A),
IdempotentCenter (funA0 : Type => A0) A (pure a)
forall (A : Type) (a : A),
IdempotentCenter (funA0 : Type => A0) A (pure a)
constructor;
typeclasses eauto.Qed.Endpurity.(** ** Rewriting Laws for C-I Elements *)(**********************************************************************)Sectionrewriting_commutative_idempotent_element.Context
{G: Type -> Type}
`{mapG: Map G} `{pureG: Pure G} `{multG: Mult G}
`{appG: ! Applicative G}.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
f <⋆> a = map evalAt a <⋆> f
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
f <⋆> a = map evalAt a <⋆> f
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
map (fun '(f, a) => f a) (f ⊗ a) =
map (fun '(f, a) => f a) (map evalAt a ⊗ f)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
map (fun '(f, a) => f a)
(map (fun '(x, y) => (y, x)) (a ⊗ f)) =
map (fun '(f, a) => f a) (map evalAt a ⊗ f)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
(map (fun '(f, a) => f a)
∘ map (fun '(x, y) => (y, x))) (a ⊗ f) =
map (fun '(f, a) => f a) (map evalAt a ⊗ f)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
map ((fun '(f, a) => f a) ∘ (fun '(x, y) => (y, x)))
(a ⊗ f) =
map (fun '(f, a) => f a) (map evalAt a ⊗ f)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
map ((fun '(f, a) => f a) ∘ (fun '(x, y) => (y, x)))
(a ⊗ f) =
map (fun '(f, a) => f a)
(map (map_fst evalAt) (a ⊗ f))
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
map ((fun '(f, a) => f a) ∘ (fun '(x, y) => (y, x)))
(a ⊗ f) =
(map (fun '(f, a) => f a) ∘ map (map_fst evalAt))
(a ⊗ f)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
map ((fun '(f, a) => f a) ∘ (fun '(x, y) => (y, x)))
(a ⊗ f) =
map ((fun '(f, a) => f a) ∘ map_fst evalAt) (a ⊗ f)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a
(fun '(f, a) => f a) ∘ (fun '(x, y) => (y, x)) =
(fun '(f, a) => f a) ∘ map_fst evalAt
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a x: A y: A -> B
((fun '(f, a) => f a) ∘ (fun '(x, y) => (y, x)))
(x, y) =
((fun '(f, a) => f a) ∘ map_fst evalAt) (x, y)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> B) a: G A center_a: Center G A a x: A y: A -> B
y x = evalAt x (id y)
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
f <⋆> lhs <⋆> rhs = map flip f <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
f <⋆> lhs <⋆> rhs = map flip f <⋆> rhs <⋆> lhs
(* LHS *)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure evalAt <⋆> rhs <⋆> (f <⋆> lhs) =
map flip f <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure compose <⋆> (pure evalAt <⋆> rhs) <⋆> f <⋆> lhs =
map flip f <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure compose <⋆> pure compose <⋆> pure evalAt <⋆> rhs <⋆>
f <⋆> lhs = map flip f <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose compose) <⋆> pure evalAt <⋆> rhs <⋆> f <⋆>
lhs = map flip f <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
map flip f <⋆> rhs <⋆> lhs
(* RHS *)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
map evalAt rhs <⋆> map flip f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure evalAt <⋆> rhs <⋆> map flip f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure evalAt <⋆> rhs <⋆> (pure flip <⋆> f) <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure compose <⋆> (pure evalAt <⋆> rhs) <⋆> pure flip <⋆>
f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure compose <⋆> pure compose <⋆> pure evalAt <⋆> rhs <⋆>
pure flip <⋆> f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure (compose compose) <⋆> pure evalAt <⋆> rhs <⋆>
pure flip <⋆> f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure (compose ∘ evalAt) <⋆> rhs <⋆> pure flip <⋆> f <⋆>
lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure (evalAt flip) <⋆>
(pure (compose ∘ evalAt) <⋆> rhs) <⋆> f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure compose <⋆> pure (evalAt flip) <⋆>
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure (compose (evalAt flip)) <⋆>
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_rhs: Center G B rhs
pure (compose ∘ evalAt) <⋆> rhs <⋆> f <⋆> lhs =
pure (evalAt flip ∘ (compose ∘ evalAt)) <⋆> rhs <⋆> f <⋆>
lhs
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
f <⋆> lhs <⋆> rhs = map flip f <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
f <⋆> lhs <⋆> rhs = map flip f <⋆> rhs <⋆> lhs
(* LHS *)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
f <⋆> lhs <⋆> rhs =
(map flip ∘ map flip) f <⋆> lhs <⋆> rhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
f <⋆> lhs <⋆> rhs =
map (flip ∘ flip) f <⋆> lhs <⋆> rhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
f <⋆> lhs <⋆> rhs = map id f <⋆> lhs <⋆> rhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> C) lhs: G A rhs: G B center_lhs: Center G A lhs
f <⋆> lhs <⋆> rhs = id f <⋆> lhs <⋆> rhs
reflexivity.Qed.(* compose flip = (fun f a c b => f a b c) *)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> D) a: G A lhs: G B rhs: G C center_rhs: Center G C rhs
f <⋆> a <⋆> lhs <⋆> rhs =
map (compose flip) f <⋆> a <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> D) a: G A lhs: G B rhs: G C center_rhs: Center G C rhs
f <⋆> a <⋆> lhs <⋆> rhs =
map (compose flip) f <⋆> a <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> D) a: G A lhs: G B rhs: G C center_rhs: Center G C rhs
map flip (f <⋆> a) <⋆> rhs <⋆> lhs =
map (compose flip) f <⋆> a <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> D) a: G A lhs: G B rhs: G C center_rhs: Center G C rhs
map (compose flip) f <⋆> a <⋆> rhs <⋆> lhs =
map (compose flip) f <⋆> a <⋆> rhs <⋆> lhs
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> E) a: G A b: G B lhs: G C rhs: G D center_rhs: Center G D rhs
f <⋆> a <⋆> b <⋆> lhs <⋆> rhs =
map (compose (compose flip)) f <⋆> a <⋆> b <⋆> rhs <⋆>
lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> E) a: G A b: G B lhs: G C rhs: G D center_rhs: Center G D rhs
f <⋆> a <⋆> b <⋆> lhs <⋆> rhs =
map (compose (compose flip)) f <⋆> a <⋆> b <⋆> rhs <⋆>
lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> E) a: G A b: G B lhs: G C rhs: G D center_rhs: Center G D rhs
map flip (f <⋆> a <⋆> b) <⋆> rhs <⋆> lhs =
map (compose (compose flip)) f <⋆> a <⋆> b <⋆> rhs <⋆>
lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> E) a: G A b: G B lhs: G C rhs: G D center_rhs: Center G D rhs
map (compose flip) (f <⋆> a) <⋆> b <⋆> rhs <⋆> lhs =
map (compose (compose flip)) f <⋆> a <⋆> b <⋆> rhs <⋆>
lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> E) a: G A b: G B lhs: G C rhs: G D center_rhs: Center G D rhs
map (compose (compose flip)) f <⋆> a <⋆> b <⋆> rhs <⋆>
lhs =
map (compose (compose flip)) f <⋆> a <⋆> b <⋆> rhs <⋆>
lhs
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> F) a: G A b: G B c: G C lhs: G D rhs: G E center_rhs: Center G E rhs
f <⋆> a <⋆> b <⋆> c <⋆> lhs <⋆> rhs =
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> F) a: G A b: G B c: G C lhs: G D rhs: G E center_rhs: Center G E rhs
f <⋆> a <⋆> b <⋆> c <⋆> lhs <⋆> rhs =
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> F) a: G A b: G B c: G C lhs: G D rhs: G E center_rhs: Center G E rhs
map flip (f <⋆> a <⋆> b <⋆> c) <⋆> rhs <⋆> lhs =
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> F) a: G A b: G B c: G C lhs: G D rhs: G E center_rhs: Center G E rhs
map (compose flip) (f <⋆> a <⋆> b) <⋆> c <⋆> rhs <⋆>
lhs =
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> F) a: G A b: G B c: G C lhs: G D rhs: G E center_rhs: Center G E rhs
map (compose (compose flip)) (f <⋆> a) <⋆> b <⋆> c <⋆>
rhs <⋆> lhs =
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> F) a: G A b: G B c: G C lhs: G D rhs: G E center_rhs: Center G E rhs
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs =
map (compose (compose (compose flip))) f <⋆> a <⋆> b <⋆>
c <⋆> rhs <⋆> lhs
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> lhs <⋆> rhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> lhs <⋆> rhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
map flip (f <⋆> a <⋆> b <⋆> c <⋆> d) <⋆> rhs <⋆> lhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
map (compose flip) (f <⋆> a <⋆> b <⋆> c) <⋆> d <⋆> rhs <⋆>
lhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
map (compose (compose flip)) (f <⋆> a <⋆> b) <⋆> c <⋆>
d <⋆> rhs <⋆> lhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
map (compose (compose (compose flip))) (f <⋆> a) <⋆> b <⋆>
c <⋆> d <⋆> rhs <⋆> lhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> J) a: G A b: G B c: G C d: G D lhs: G E rhs: G F center_rhs: Center G F rhs
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs =
map (compose (compose (compose (compose flip)))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> rhs <⋆> lhs
reflexivity.Qed.Definitiondouble_input {AB: Type} (f: A -> A -> B): A -> B :=
uncurry f ∘ dup.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
f <⋆> contract <⋆> contract =
map double_input f <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
f <⋆> contract <⋆> contract =
map double_input f <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map (fun '(f, a) => f a)
(map (fun '(f, a) => f a) (f ⊗ contract) ⊗ contract) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map (fun '(f, a) => f a)
(map (fun '(f, a) => f a) (f ⊗ contract) ⊗ contract) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map (fun '(f, a) => f a)
(map (map_fst (fun '(f, a) => f a))
(f ⊗ contract ⊗ contract)) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
(map (fun '(f, a) => f a)
∘ map (map_fst (fun '(f, a) => f a)))
(f ⊗ contract ⊗ contract) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a))
(f ⊗ contract ⊗ contract) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a))
(map α^-1 (f ⊗ (contract ⊗ contract))) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a))
(map α^-1 (f ⊗ map (funa : A => (a, a)) contract)) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a))
(map α^-1
(map (map_snd (funa : A => (a, a)))
(f ⊗ contract))) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a))
((map α^-1 ∘ map (map_snd (funa : A => (a, a))))
(f ⊗ contract)) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a))
(map (α^-1 ∘ map_snd (funa : A => (a, a)))
(f ⊗ contract)) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
(map
((fun '(f, a) => f a)
∘ map_fst (fun '(f, a) => f a))
∘ map (α^-1 ∘ map_snd (funa : A => (a, a))))
(f ⊗ contract) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a)
∘ (α^-1 ∘ map_snd (funa : A => (a, a))))
(f ⊗ contract) =
map (fun '(f, a) => f a)
(map double_input f ⊗ contract)
(* rhs *)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
map
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a)
∘ (α^-1 ∘ map_snd (funa : A => (a, a))))
(f ⊗ contract) =
map (fun '(f, a) => f a)
(map (map_fst double_input) (f ⊗ contract))
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
(eq
∘ map
((fun '(f, a) => f a)
∘ map_fst (fun '(f, a) => f a)
∘ (α^-1 ∘ map_snd (funa : A => (a, a)))))
(f ⊗ contract)
((map (fun '(f, a) => f a)
∘ map (map_fst double_input)) (f ⊗ contract))
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
(eq
∘ map
((fun '(f, a) => f a)
∘ map_fst (fun '(f, a) => f a)
∘ (α^-1 ∘ map_snd (funa : A => (a, a)))))
(f ⊗ contract)
(map ((fun '(f, a) => f a) ∘ map_fst double_input)
(f ⊗ contract))
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract
(fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a)
∘ (α^-1 ∘ map_snd (funa : A => (a, a))) =
(fun '(f, a) => f a) ∘ map_fst double_input
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract x: A -> A -> B y: A
((fun '(f, a) => f a) ∘ map_fst (fun '(f, a) => f a)
∘ (α^-1 ∘ map_snd (funa : A => (a, a)))) (x, y) =
((fun '(f, a) => f a) ∘ map_fst double_input) (x, y)
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B: Type f: G (A -> A -> B) contract: G A idem_contract: Idempotent G A contract x: A -> A -> B y: A
id x y (id y) = x (id y) (id y)
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> B -> C) a: G A contract: G B idem_contract: Idempotent G B contract
f <⋆> a <⋆> contract <⋆> contract =
map (compose double_input) f <⋆> a <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> B -> C) a: G A contract: G B idem_contract: Idempotent G B contract
f <⋆> a <⋆> contract <⋆> contract =
map (compose double_input) f <⋆> a <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> B -> C) a: G A contract: G B idem_contract: Idempotent G B contract
map double_input (f <⋆> a) <⋆> contract =
map (compose double_input) f <⋆> a <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C: Type f: G (A -> B -> B -> C) a: G A contract: G B idem_contract: Idempotent G B contract
map (compose double_input) f <⋆> a <⋆> contract =
map (compose double_input) f <⋆> a <⋆> contract
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> C -> D) a: G A b: G B contract: G C idem_contract: Idempotent G C contract
f <⋆> a <⋆> b <⋆> contract <⋆> contract =
map (compose (compose double_input)) f <⋆> a <⋆> b <⋆>
contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> C -> D) a: G A b: G B contract: G C idem_contract: Idempotent G C contract
f <⋆> a <⋆> b <⋆> contract <⋆> contract =
map (compose (compose double_input)) f <⋆> a <⋆> b <⋆>
contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> C -> D) a: G A b: G B contract: G C idem_contract: Idempotent G C contract
map double_input (f <⋆> a <⋆> b) <⋆> contract =
map (compose (compose double_input)) f <⋆> a <⋆> b <⋆>
contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> C -> D) a: G A b: G B contract: G C idem_contract: Idempotent G C contract
map (compose double_input) (f <⋆> a) <⋆> b <⋆>
contract =
map (compose (compose double_input)) f <⋆> a <⋆> b <⋆>
contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D: Type f: G (A -> B -> C -> C -> D) a: G A b: G B contract: G C idem_contract: Idempotent G C contract
map (compose (compose double_input)) f <⋆> a <⋆> b <⋆>
contract =
map (compose (compose double_input)) f <⋆> a <⋆> b <⋆>
contract
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> D -> E) a: G A b: G B c: G C contract: G D idem_contract: Idempotent G D contract
f <⋆> a <⋆> b <⋆> c <⋆> contract <⋆> contract =
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> D -> E) a: G A b: G B c: G C contract: G D idem_contract: Idempotent G D contract
f <⋆> a <⋆> b <⋆> c <⋆> contract <⋆> contract =
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> D -> E) a: G A b: G B c: G C contract: G D idem_contract: Idempotent G D contract
map double_input (f <⋆> a <⋆> b <⋆> c) <⋆> contract =
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> D -> E) a: G A b: G B c: G C contract: G D idem_contract: Idempotent G D contract
map (compose double_input) (f <⋆> a <⋆> b) <⋆> c <⋆>
contract =
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> D -> E) a: G A b: G B c: G C contract: G D idem_contract: Idempotent G D contract
map (compose (compose double_input)) (f <⋆> a) <⋆> b <⋆>
c <⋆> contract =
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E: Type f: G (A -> B -> C -> D -> D -> E) a: G A b: G B c: G C contract: G D idem_contract: Idempotent G D contract
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract =
map (compose (compose (compose double_input))) f <⋆> a <⋆>
b <⋆> c <⋆> contract
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract <⋆> contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract <⋆> contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
map double_input (f <⋆> a <⋆> b <⋆> c <⋆> d) <⋆>
contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
map (compose double_input) (f <⋆> a <⋆> b <⋆> c) <⋆> d <⋆>
contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
map (compose (compose double_input)) (f <⋆> a <⋆> b) <⋆>
c <⋆> d <⋆> contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
map (compose (compose (compose double_input)))
(f <⋆> a) <⋆> b <⋆> c <⋆> d <⋆> contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F: Type f: G (A -> B -> C -> D -> E -> E -> F) a: G A b: G B c: G C d: G D contract: G E idem_contract: Idempotent G E contract
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract =
map
(compose (compose (compose (compose double_input))))
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> contract
reflexivity.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract <⋆>
contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract <⋆>
contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
map double_input (f <⋆> a <⋆> b <⋆> c <⋆> d <⋆> e) <⋆>
contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
map (compose double_input) (f <⋆> a <⋆> b <⋆> c <⋆> d) <⋆>
e <⋆> contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
map (compose (compose double_input))
(f <⋆> a <⋆> b <⋆> c) <⋆> d <⋆> e <⋆> contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
map (compose (compose (compose double_input)))
(f <⋆> a <⋆> b) <⋆> c <⋆> d <⋆> e <⋆> contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
map
(compose (compose (compose (compose double_input))))
(f <⋆> a) <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G appG: Applicative G A, B, C, D, E, F, J: Type f: G (A -> B -> C -> D -> E -> F -> F -> J) a: G A b: G B c: G C d: G D e: G E contract: G F idem_contract: Idempotent G F contract
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract =
map
(compose
(compose
(compose (compose (compose double_input))))) f <⋆>
a <⋆> b <⋆> c <⋆> d <⋆> e <⋆> contract
reflexivity.Qed.Endrewriting_commutative_idempotent_element.(** ** Commutative Idempotent Applicative Functors *)(**********************************************************************)ClassApplicativeCommutativeIdempotent (G: Type -> Type)
`{mapG: Map G} `{pureG: Pure G} `{multG: Mult G} :=
{ appci_applicative :> Applicative G;
appci_appic :> forall (A: Type) (a: G A),
IdempotentCenter G A a;
}.ClassApplicativeCommutative (G: Type -> Type)
`{mapG: Map G} `{pureG: Pure G} `{multG: Mult G} :=
{ appc_applicative :> Applicative G;
appc_appc :> forall (A: Type) (a: G A),
Center G A a;
}.(** ** Rewriting Laws for C-I Applicative Funtors *)(**********************************************************************)Sectionrewrite_commutative_idempotent_functor.Context
`{ApplicativeCommutativeIdempotent G}.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G A, B: Type f: G (A -> B) a: G A
f <⋆> a = map evalAt a <⋆> f
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G A, B: Type f: G (A -> B) a: G A
f <⋆> a = map evalAt a <⋆> f
nowrewrite ap_swap.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G
forall (ABC : Type) (f : G (A -> B -> C)) (a : G A)
(b : G B), f <⋆> a <⋆> b = map flip f <⋆> b <⋆> a
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G
forall (ABC : Type) (f : G (A -> B -> C)) (a : G A)
(b : G B), f <⋆> a <⋆> b = map flip f <⋆> b <⋆> a
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G A, B, C: Type f: G (A -> B -> C) a: G A b: G B
f <⋆> a <⋆> b = map flip f <⋆> b <⋆> a
nowrewrite ap_flip1.Qed.
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G
forall (AB : Type) (f : G (A -> A -> B)) (a : G A),
f <⋆> a <⋆> a = map double_input f <⋆> a
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G
forall (AB : Type) (f : G (A -> A -> B)) (a : G A),
f <⋆> a <⋆> a = map double_input f <⋆> a
G: Type -> Type mapG: Map G pureG: Pure G multG: Mult G H: ApplicativeCommutativeIdempotent G A, B: Type f: G (A -> A -> B) a: G A