File: Mathlib/RingTheory/Coalgebra/Basic.lean

full_name: CoalgebraStruct.comul
code: /-- Data fields for `Coalgebra`, to allow API to be constructed before proving `Coalgebra.coassoc`.

See `Coalgebra` for documentation. -/
class CoalgebraStruct (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] where
  /-- The comultiplication of the coalgebra -/
  comul : A →ₗ[R] A ⊗[R] A
  /-- The counit of the coalgebra -/
  counit : A →ₗ[R] R
goal: A →ₗ[R] A ⊗[R] A

full_name: CoalgebraStruct.counit
code: /-- Data fields for `Coalgebra`, to allow API to be constructed before proving `Coalgebra.coassoc`.

See `Coalgebra` for documentation. -/
class CoalgebraStruct (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] where
  /-- The comultiplication of the coalgebra -/
  comul : A →ₗ[R] A ⊗[R] A
  /-- The counit of the coalgebra -/
  counit : A →ₗ[R] R
goal: A →ₗ[R] R

full_name: CoalgebraStruct
code: /-- Data fields for `Coalgebra`, to allow API to be constructed before proving `Coalgebra.coassoc`.

See `Coalgebra` for documentation. -/
class CoalgebraStruct (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] where
  /-- The comultiplication of the coalgebra -/
  comul : A →ₗ[R] A ⊗[R] A
  /-- The counit of the coalgebra -/
  counit : A →ₗ[R] R
goal: Type (max u v)

full_name: Coalgebra
code: /-- A coalgebra over a commutative (semi)ring `R` is an `R`-module equipped with a coassociative
comultiplication `Δ` and a counit `ε` obeying the left and right counitality laws. -/
class Coalgebra (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] extends CoalgebraStruct R A where
  /-- The comultiplication is coassociative -/
  coassoc : TensorProduct.assoc R A A A ∘ₗ comul.rTensor A ∘ₗ comul = comul.lTensor A ∘ₗ comul
  /-- The counit satisfies the left counitality law -/
  rTensor_counit_comp_comul : counit.rTensor A ∘ₗ comul = TensorProduct.mk R _ _ 1
  /-- The counit satisfies the right counitality law -/
  lTensor_counit_comp_comul : counit.lTensor A ∘ₗ comul = (TensorProduct.mk R _ _).flip 1
goal: Type (max u v)

full_name: Coalgebra.lTensor_counit_comp_comul
code: /-- A coalgebra over a commutative (semi)ring `R` is an `R`-module equipped with a coassociative
comultiplication `Δ` and a counit `ε` obeying the left and right counitality laws. -/
class Coalgebra (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] extends CoalgebraStruct R A where
  /-- The comultiplication is coassociative -/
  coassoc : TensorProduct.assoc R A A A ∘ₗ comul.rTensor A ∘ₗ comul = comul.lTensor A ∘ₗ comul
  /-- The counit satisfies the left counitality law -/
  rTensor_counit_comp_comul : counit.rTensor A ∘ₗ comul = TensorProduct.mk R _ _ 1
  /-- The counit satisfies the right counitality law -/
  lTensor_counit_comp_comul : counit.lTensor A ∘ₗ comul = (TensorProduct.mk R _ _).flip 1
goal: LinearMap.lTensor A Coalgebra.counit ∘ₗ Coalgebra.comul = (TensorProduct.mk R A R).flip 1

full_name: Coalgebra.rTensor_counit_comp_comul
code: /-- A coalgebra over a commutative (semi)ring `R` is an `R`-module equipped with a coassociative
comultiplication `Δ` and a counit `ε` obeying the left and right counitality laws. -/
class Coalgebra (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] extends CoalgebraStruct R A where
  /-- The comultiplication is coassociative -/
  coassoc : TensorProduct.assoc R A A A ∘ₗ comul.rTensor A ∘ₗ comul = comul.lTensor A ∘ₗ comul
  /-- The counit satisfies the left counitality law -/
  rTensor_counit_comp_comul : counit.rTensor A ∘ₗ comul = TensorProduct.mk R _ _ 1
  /-- The counit satisfies the right counitality law -/
  lTensor_counit_comp_comul : counit.lTensor A ∘ₗ comul = (TensorProduct.mk R _ _).flip 1
goal: LinearMap.rTensor A Coalgebra.counit ∘ₗ Coalgebra.comul = (TensorProduct.mk R R A) 1

full_name: Coalgebra.coassoc
code: /-- A coalgebra over a commutative (semi)ring `R` is an `R`-module equipped with a coassociative
comultiplication `Δ` and a counit `ε` obeying the left and right counitality laws. -/
class Coalgebra (R : Type u) (A : Type v)
    [CommSemiring R] [AddCommMonoid A] [Module R A] extends CoalgebraStruct R A where
  /-- The comultiplication is coassociative -/
  coassoc : TensorProduct.assoc R A A A ∘ₗ comul.rTensor A ∘ₗ comul = comul.lTensor A ∘ₗ comul
  /-- The counit satisfies the left counitality law -/
  rTensor_counit_comp_comul : counit.rTensor A ∘ₗ comul = TensorProduct.mk R _ _ 1
  /-- The counit satisfies the right counitality law -/
  lTensor_counit_comp_comul : counit.lTensor A ∘ₗ comul = (TensorProduct.mk R _ _).flip 1
goal: ↑(TensorProduct.assoc R A A A) ∘ₗ LinearMap.rTensor A Coalgebra.comul ∘ₗ Coalgebra.comul =
  LinearMap.lTensor A Coalgebra.comul ∘ₗ Coalgebra.comul

full_name: Coalgebra.coassoc_apply
code: @[simp]
theorem coassoc_apply (a : A) :
    TensorProduct.assoc R A A A (comul.rTensor A (comul a)) = comul.lTensor A (comul a) 
goal: (TensorProduct.assoc R A A A) ((LinearMap.rTensor A Coalgebra.comul) (Coalgebra.comul a)) =
  (LinearMap.lTensor A Coalgebra.comul) (Coalgebra.comul a)

full_name: Coalgebra.coassoc_symm_apply
code: @[simp]
theorem coassoc_symm_apply (a : A) :
    (TensorProduct.assoc R A A A).symm (comul.lTensor A (comul a)) = comul.rTensor A (comul a) 
goal: (TensorProduct.assoc R A A A).symm ((LinearMap.lTensor A Coalgebra.comul) (Coalgebra.comul a)) =
  (LinearMap.rTensor A Coalgebra.comul) (Coalgebra.comul a)

full_name: Coalgebra.coassoc_symm
code: @[simp]
theorem coassoc_symm :
    (TensorProduct.assoc R A A A).symm ∘ₗ comul.lTensor A ∘ₗ comul =
    comul.rTensor A ∘ₗ (comul (R := R)) 
goal: ↑(TensorProduct.assoc R A A A).symm ∘ₗ LinearMap.lTensor A Coalgebra.comul ∘ₗ Coalgebra.comul =
  LinearMap.rTensor A Coalgebra.comul ∘ₗ Coalgebra.comul

full_name: Coalgebra.rTensor_counit_comul
code: @[simp]
theorem rTensor_counit_comul (a : A) : counit.rTensor A (comul a) = 1 ⊗ₜ[R] a 
goal: (LinearMap.rTensor A Coalgebra.counit) (Coalgebra.comul a) = 1 ⊗ₜ[R] a

full_name: Coalgebra.lTensor_counit_comul
code: @[simp]
theorem lTensor_counit_comul (a : A) : counit.lTensor A (comul a) = a ⊗ₜ[R] 1 
goal: (LinearMap.lTensor A Coalgebra.counit) (Coalgebra.comul a) = a ⊗ₜ[R] 1

full_name: CommSemiring.toCoalgebra
code: /-- Every commutative (semi)ring is a coalgebra over itself, with `Δ r = 1 ⊗ₜ r`. -/
instance toCoalgebra : Coalgebra R R 
goal: Coalgebra R R

full_name: CommSemiring.comul_apply
code: @[simp]
theorem comul_apply (r : R) : comul r = 1 ⊗ₜ[R] r 
goal: Coalgebra.comul r = 1 ⊗ₜ[R] r

full_name: CommSemiring.counit_apply
code: @[simp]
theorem counit_apply (r : R) : counit r = r 
goal: Coalgebra.counit r = r

full_name: Prod.instCoalgebraStruct
code: instance instCoalgebraStruct : CoalgebraStruct R (A × B) 
goal: CoalgebraStruct R (A × B)

full_name: Prod.comul_apply
code: @[simp]
theorem comul_apply (r : A × B) :
    comul r =
      TensorProduct.map (.inl R A B) (.inl R A B) (comul r.1) +
      TensorProduct.map (.inr R A B) (.inr R A B) (comul r.2) 
goal: Coalgebra.comul r =
  (TensorProduct.map (LinearMap.inl R A B) (LinearMap.inl R A B)) (Coalgebra.comul r.1) +
    (TensorProduct.map (LinearMap.inr R A B) (LinearMap.inr R A B)) (Coalgebra.comul r.2)

full_name: Prod.counit_apply
code: @[simp]
theorem counit_apply (r : A × B) : (counit r : R) = counit r.1 + counit r.2 
goal: Coalgebra.counit r = Coalgebra.counit r.1 + Coalgebra.counit r.2

full_name: Prod.comul_comp_inl
code: theorem comul_comp_inl :
    comul ∘ₗ inl R A B = TensorProduct.map (.inl R A B) (.inl R A B) ∘ₗ comul 
goal: Coalgebra.comul ∘ₗ LinearMap.inl R A B =
  TensorProduct.map (LinearMap.inl R A B) (LinearMap.inl R A B) ∘ₗ Coalgebra.comul

full_name: Prod.comul_comp_inr
code: theorem comul_comp_inr :
    comul ∘ₗ inr R A B = TensorProduct.map (.inr R A B) (.inr R A B) ∘ₗ comul 
goal: Coalgebra.comul ∘ₗ LinearMap.inr R A B =
  TensorProduct.map (LinearMap.inr R A B) (LinearMap.inr R A B) ∘ₗ Coalgebra.comul

full_name: Prod.comul_comp_fst
code: theorem comul_comp_fst :
    comul ∘ₗ .fst R A B = TensorProduct.map (.fst R A B) (.fst R A B) ∘ₗ comul 
goal: Coalgebra.comul ∘ₗ LinearMap.fst R A B =
  TensorProduct.map (LinearMap.fst R A B) (LinearMap.fst R A B) ∘ₗ Coalgebra.comul

full_name: Prod.comul_comp_snd
code: theorem comul_comp_snd :
    comul ∘ₗ .snd R A B = TensorProduct.map (.snd R A B) (.snd R A B) ∘ₗ comul 
goal: Coalgebra.comul ∘ₗ LinearMap.snd R A B =
  TensorProduct.map (LinearMap.snd R A B) (LinearMap.snd R A B) ∘ₗ Coalgebra.comul

full_name: Prod.counit_comp_inr
code: @[simp] theorem counit_comp_inr : counit ∘ₗ inr R A B = counit 
goal: Coalgebra.counit ∘ₗ LinearMap.inr R A B = Coalgebra.counit

full_name: Prod.counit_comp_inl
code: @[simp] theorem counit_comp_inl : counit ∘ₗ inl R A B = counit 
goal: Coalgebra.counit ∘ₗ LinearMap.inl R A B = Coalgebra.counit

full_name: Prod.instCoalgebra
code: instance instCoalgebra : Coalgebra R (A × B) 
goal: Coalgebra R (A × B)

full_name: Finsupp.instCoalgebraStruct
code: instance instCoalgebraStruct : CoalgebraStruct R (ι →₀ A) 
goal: CoalgebraStruct R (ι →₀ A)

full_name: Finsupp.comul_single
code: @[simp]
theorem comul_single (i : ι) (a : A) :
    comul (R := R) (Finsupp.single i a) =
      (TensorProduct.map (Finsupp.lsingle i) (Finsupp.lsingle i) : _ →ₗ[R] _) (comul a) 
goal: Coalgebra.comul (Finsupp.single i a) = (TensorProduct.map (Finsupp.lsingle i) (Finsupp.lsingle i)) (Coalgebra.comul a)

full_name: Finsupp.counit_single
code: @[simp]
theorem counit_single (i : ι) (a : A) : counit (Finsupp.single i a) = counit (R := R) a 
goal: Coalgebra.counit (Finsupp.single i a) = Coalgebra.counit a

full_name: Finsupp.comul_comp_lsingle
code: theorem comul_comp_lsingle (i : ι) :
    comul ∘ₗ (lsingle i : A →ₗ[R] _) = TensorProduct.map (lsingle i) (lsingle i) ∘ₗ comul 
goal: Coalgebra.comul ∘ₗ Finsupp.lsingle i = TensorProduct.map (Finsupp.lsingle i) (Finsupp.lsingle i) ∘ₗ Coalgebra.comul

full_name: Finsupp.comul_comp_lapply
code: theorem comul_comp_lapply (i : ι) :
    comul ∘ₗ (lapply i : _ →ₗ[R] A) = TensorProduct.map (lapply i) (lapply i) ∘ₗ comul 
goal: Coalgebra.comul ∘ₗ Finsupp.lapply i = TensorProduct.map (Finsupp.lapply i) (Finsupp.lapply i) ∘ₗ Coalgebra.comul

full_name: Finsupp.counit_comp_lsingle
code: @[simp] theorem counit_comp_lsingle (i : ι) : counit ∘ₗ (lsingle i : A →ₗ[R] _) = counit 
goal: Coalgebra.counit ∘ₗ Finsupp.lsingle i = Coalgebra.counit

full_name: Finsupp.instCoalgebra
code: /-- The `R`-module whose elements are functions `ι → A` which are zero on all but finitely many
elements of `ι` has a coalgebra structure. The coproduct `Δ` is given by `Δ(fᵢ a) = fᵢ a₁ ⊗ fᵢ a₂`
where `Δ(a) = a₁ ⊗ a₂` and the counit `ε` by `ε(fᵢ a) = ε(a)`, where `fᵢ a` is the function sending
`i` to `a` and all other elements of `ι` to zero. -/
instance instCoalgebra : Coalgebra R (ι →₀ A) 
goal: Coalgebra R (ι →₀ A)

full_name: TensorProduct.instCoalgebraStruct_comul
code: /-- The coalgebra instance will be defined in #11975, in
`Mathlib.RingTheory.Coalgebra.TensorProduct`. -/
@[simps] instance instCoalgebraStruct :
    CoalgebraStruct R (A ⊗[R] B) 
goal: Coalgebra.comul = ↑(TensorProduct.tensorTensorTensorComm R A A B B) ∘ₗ TensorProduct.map Coalgebra.comul Coalgebra.comul

full_name: TensorProduct.instCoalgebraStruct_counit
code: /-- The coalgebra instance will be defined in #11975, in
`Mathlib.RingTheory.Coalgebra.TensorProduct`. -/
@[simps] instance instCoalgebraStruct :
    CoalgebraStruct R (A ⊗[R] B) 
goal: Coalgebra.counit = LinearMap.mul' R R ∘ₗ TensorProduct.map Coalgebra.counit Coalgebra.counit

full_name: TensorProduct.instCoalgebraStruct
code: /-- The coalgebra instance will be defined in #11975, in
`Mathlib.RingTheory.Coalgebra.TensorProduct`. -/
@[simps] instance instCoalgebraStruct :
    CoalgebraStruct R (A ⊗[R] B) 
goal: CoalgebraStruct R (A ⊗[R] B)