l3lab/ntp-mathlib huggingface dataset:
theorem dZero_ker_eq_invariants : LinearMap.ker (dZero A) = invariants A.ρ := by
  ext x
  simp only [LinearMap.mem_ker, mem_invariants, ← @sub_eq_zero _ _ _ x, Function.funext_iff]
  

Proof state:
case h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : CoeSort.coe A
⊢ (∀ (a : G), (dZero A) x a = OfNat.ofNat 0 a) ↔ ∀ (g : G), ((Rep.ρ A) g) x - x = 0

Next tactic:
rfl
@[simp] theorem dZero_eq_zero [A.IsTrivial] : dZero A = 0 := by
  

Proof state:
k G : Type u
inst✝² : CommRing k
inst✝¹ : Group G
A : Rep k G
inst✝ : Rep.IsTrivial A
⊢ dZero A = 0

Next tactic:
ext
@[simp] theorem dZero_eq_zero [A.IsTrivial] : dZero A = 0 := by
  ext
  

Proof state:
case h.h
k G : Type u
inst✝² : CommRing k
inst✝¹ : Group G
A : Rep k G
inst✝ : Rep.IsTrivial A
x✝¹ : CoeSort.coe A
x✝ : G
⊢ (dZero A) x✝¹ x✝ = 0 x✝¹ x✝

Next tactic:
simp only [dZero_apply, apply_eq_self, sub_self, LinearMap.zero_apply, Pi.zero_apply]
/-- The 1st differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G, A) → Fun(G × G, A)`. It sends
`(f, (g₁, g₂)) ↦ ρ_A(g₁)(f(g₂)) - f(g₁g₂) + f(g₁).` -/
@[simps]
def dOne : (G → A) →ₗ[k] G × G → A where
  toFun f g := A.ρ g.1 (f g.2) - f (g.1 * g.2) + f g.1
  map_add' x y := funext fun g => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x y : G → CoeSort.coe A
g : G × G
⊢ (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) (x + y) g =
    ((fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) x +
        (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) y)
      g

Next tactic:
dsimp
/-- The 1st differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G, A) → Fun(G × G, A)`. It sends
`(f, (g₁, g₂)) ↦ ρ_A(g₁)(f(g₂)) - f(g₁g₂) + f(g₁).` -/
@[simps]
def dOne : (G → A) →ₗ[k] G × G → A where
  toFun f g := A.ρ g.1 (f g.2) - f (g.1 * g.2) + f g.1
  map_add' x y := funext fun g => by dsimp; 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x y : G → CoeSort.coe A
g : G × G
⊢ ((Rep.ρ A) g.1) (x g.2 + y g.2) - (x (g.1 * g.2) + y (g.1 * g.2)) + (x g.1 + y g.1) =
    ((Rep.ρ A) g.1) (x g.2) - x (g.1 * g.2) + x g.1 + (((Rep.ρ A) g.1) (y g.2) - y (g.1 * g.2) + y g.1)

Next tactic:
rw [map_add, add_add_add_comm, add_sub_add_comm]
/-- The 1st differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G, A) → Fun(G × G, A)`. It sends
`(f, (g₁, g₂)) ↦ ρ_A(g₁)(f(g₂)) - f(g₁g₂) + f(g₁).` -/
@[simps]
def dOne : (G → A) →ₗ[k] G × G → A where
  toFun f g := A.ρ g.1 (f g.2) - f (g.1 * g.2) + f g.1
  map_add' x y := funext fun g => by dsimp; rw [map_add, add_add_add_comm, add_sub_add_comm]
  map_smul' r x := funext fun g => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
r : k
x : G → CoeSort.coe A
g : G × G
⊢ AddHom.toFun
      { toFun := fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1,
        map_add' :=
          (_ :
            ∀ (x y : G → CoeSort.coe A),
              (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) (x + y) =
                (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) x +
                  (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) y) }
      (r • x) g =
    ((RingHom.id k) r •
        AddHom.toFun
          { toFun := fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1,
            map_add' :=
              (_ :
                ∀ (x y : G → CoeSort.coe A),
                  (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) (x + y) =
                    (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) x +
                      (fun f g => ((Rep.ρ A) g.1) (f g.2) - f (g.1 * g.2) + f g.1) y) }
          x)
      g

Next tactic:
dsimp
/-- The 1st differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G, A) → Fun(G × G, A)`. It sends
`(f, (g₁, g₂)) ↦ ρ_A(g₁)(f(g₂)) - f(g₁g₂) + f(g₁).` -/
@[simps]
def dOne : (G → A) →ₗ[k] G × G → A where
  toFun f g := A.ρ g.1 (f g.2) - f (g.1 * g.2) + f g.1
  map_add' x y := funext fun g => by dsimp; rw [map_add, add_add_add_comm, add_sub_add_comm]
  map_smul' r x := funext fun g => by dsimp; 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
r : k
x : G → CoeSort.coe A
g : G × G
⊢ ((Rep.ρ A) g.1) (r • x g.2) - r • x (g.1 * g.2) + r • x g.1 = r • (((Rep.ρ A) g.1) (x g.2) - x (g.1 * g.2) + x g.1)

Next tactic:
rw [map_smul, smul_add, smul_sub]
/-- The 2nd differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G × G, A) → Fun(G × G × G, A)`. It sends
`(f, (g₁, g₂, g₃)) ↦ ρ_A(g₁)(f(g₂, g₃)) - f(g₁g₂, g₃) + f(g₁, g₂g₃) - f(g₁, g₂).` -/
@[simps]
def dTwo : (G × G → A) →ₗ[k] G × G × G → A where
  toFun f g :=
    A.ρ g.1 (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1)
  map_add' x y :=
    funext fun g => by
      

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x y : G × G → CoeSort.coe A
g : G × G × G
⊢ (fun f g => ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1))
      (x + y) g =
    ((fun f g => ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1))
          x +
        (fun f g =>
            ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1))
          y)
      g

Next tactic:
dsimp
/-- The 2nd differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G × G, A) → Fun(G × G × G, A)`. It sends
`(f, (g₁, g₂, g₃)) ↦ ρ_A(g₁)(f(g₂, g₃)) - f(g₁g₂, g₃) + f(g₁, g₂g₃) - f(g₁, g₂).` -/
@[simps]
def dTwo : (G × G → A) →ₗ[k] G × G × G → A where
  toFun f g :=
    A.ρ g.1 (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1)
  map_add' x y :=
    funext fun g => by
      dsimp
      

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x y : G × G → CoeSort.coe A
g : G × G × G
⊢ ((Rep.ρ A) g.1) (x (g.2.1, g.2.2) + y (g.2.1, g.2.2)) - (x (g.1 * g.2.1, g.2.2) + y (g.1 * g.2.1, g.2.2)) +
        (x (g.1, g.2.1 * g.2.2) + y (g.1, g.2.1 * g.2.2)) -
      (x (g.1, g.2.1) + y (g.1, g.2.1)) =
    ((Rep.ρ A) g.1) (x (g.2.1, g.2.2)) - x (g.1 * g.2.1, g.2.2) + x (g.1, g.2.1 * g.2.2) - x (g.1, g.2.1) +
      (((Rep.ρ A) g.1) (y (g.2.1, g.2.2)) - y (g.1 * g.2.1, g.2.2) + y (g.1, g.2.1 * g.2.2) - y (g.1, g.2.1))

Next tactic:
rw [map_add, add_sub_add_comm (A.ρ _ _), add_sub_assoc, add_sub_add_comm, add_add_add_comm,
        add_sub_assoc, add_sub_assoc]
/-- The 2nd differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G × G, A) → Fun(G × G × G, A)`. It sends
`(f, (g₁, g₂, g₃)) ↦ ρ_A(g₁)(f(g₂, g₃)) - f(g₁g₂, g₃) + f(g₁, g₂g₃) - f(g₁, g₂).` -/
@[simps]
def dTwo : (G × G → A) →ₗ[k] G × G × G → A where
  toFun f g :=
    A.ρ g.1 (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1)
  map_add' x y :=
    funext fun g => by
      dsimp
      rw [map_add, add_sub_add_comm (A.ρ _ _), add_sub_assoc, add_sub_add_comm, add_add_add_comm,
        add_sub_assoc, add_sub_assoc]
  map_smul' r x := funext fun g => by 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
r : k
x : G × G → CoeSort.coe A
g : G × G × G
⊢ AddHom.toFun
      {
        toFun := fun f g =>
          ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1),
        map_add' :=
          (_ :
            ∀ (x y : G × G → CoeSort.coe A),
              (fun f g =>
                    ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) -
                      f (g.1, g.2.1))
                  (x + y) =
                (fun f g =>
                      ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) -
                        f (g.1, g.2.1))
                    x +
                  (fun f g =>
                      ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) -
                        f (g.1, g.2.1))
                    y) }
      (r • x) g =
    ((RingHom.id k) r •
        AddHom.toFun
          {
            toFun := fun f g =>
              ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1),
            map_add' :=
              (_ :
                ∀ (x y : G × G → CoeSort.coe A),
                  (fun f g =>
                        ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) -
                          f (g.1, g.2.1))
                      (x + y) =
                    (fun f g =>
                          ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) -
                            f (g.1, g.2.1))
                        x +
                      (fun f g =>
                          ((Rep.ρ A) g.1) (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) -
                            f (g.1, g.2.1))
                        y) }
          x)
      g

Next tactic:
dsimp
/-- The 2nd differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G × G, A) → Fun(G × G × G, A)`. It sends
`(f, (g₁, g₂, g₃)) ↦ ρ_A(g₁)(f(g₂, g₃)) - f(g₁g₂, g₃) + f(g₁, g₂g₃) - f(g₁, g₂).` -/
@[simps]
def dTwo : (G × G → A) →ₗ[k] G × G × G → A where
  toFun f g :=
    A.ρ g.1 (f (g.2.1, g.2.2)) - f (g.1 * g.2.1, g.2.2) + f (g.1, g.2.1 * g.2.2) - f (g.1, g.2.1)
  map_add' x y :=
    funext fun g => by
      dsimp
      rw [map_add, add_sub_add_comm (A.ρ _ _), add_sub_assoc, add_sub_add_comm, add_add_add_comm,
        add_sub_assoc, add_sub_assoc]
  map_smul' r x := funext fun g => by dsimp; 

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
r : k
x : G × G → CoeSort.coe A
g : G × G × G
⊢ ((Rep.ρ A) g.1) (r • x (g.2.1, g.2.2)) - r • x (g.1 * g.2.1, g.2.2) + r • x (g.1, g.2.1 * g.2.2) -
      r • x (g.1, g.2.1) =
    r • (((Rep.ρ A) g.1) (x (g.2.1, g.2.2)) - x (g.1 * g.2.1, g.2.2) + x (g.1, g.2.1 * g.2.2) - x (g.1, g.2.1))

Next tactic:
simp only [map_smul, smul_add, smul_sub]
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dZero` gives a simpler expression for the 0th differential: that is, the following
square commutes:
```
  C⁰(G, A) ---d⁰---> C¹(G, A)
  |                    |
  |                    |
  |                    |
  v                    v
  A ---- dZero ---> Fun(G, A)
```
where the vertical arrows are `zeroCochainsLequiv` and `oneCochainsLequiv` respectively.
-/
theorem dZero_comp_eq : dZero A ∘ₗ (zeroCochainsLequiv A) =
    oneCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 0 1 := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
⊢ dZero A ∘ₗ ↑(zeroCochainsLequiv A) = ↑(oneCochainsLequiv A) ∘ₗ HomologicalComplex.d (inhomogeneousCochains A) 0 1

Next tactic:
ext x y
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dZero` gives a simpler expression for the 0th differential: that is, the following
square commutes:
```
  C⁰(G, A) ---d⁰---> C¹(G, A)
  |                    |
  |                    |
  |                    |
  v                    v
  A ---- dZero ---> Fun(G, A)
```
where the vertical arrows are `zeroCochainsLequiv` and `oneCochainsLequiv` respectively.
-/
theorem dZero_comp_eq : dZero A ∘ₗ (zeroCochainsLequiv A) =
    oneCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 0 1 := by
  ext x y
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 0)
y : G
⊢ (dZero A ∘ₗ ↑(zeroCochainsLequiv A)) x y =
    (↑(oneCochainsLequiv A) ∘ₗ HomologicalComplex.d (inhomogeneousCochains A) 0 1) x y

Next tactic:
show A.ρ y (x default) - x default = _ + ({0} : Finset _).sum _
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dZero` gives a simpler expression for the 0th differential: that is, the following
square commutes:
```
  C⁰(G, A) ---d⁰---> C¹(G, A)
  |                    |
  |                    |
  |                    |
  v                    v
  A ---- dZero ---> Fun(G, A)
```
where the vertical arrows are `zeroCochainsLequiv` and `oneCochainsLequiv` respectively.
-/
theorem dZero_comp_eq : dZero A ∘ₗ (zeroCochainsLequiv A) =
    oneCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 0 1 := by
  ext x y
  show A.ρ y (x default) - x default = _ + ({0} : Finset _).sum _
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 0)
y : G
⊢ ((Rep.ρ A) y) (x default) - x default =
    ((Rep.ρ A) ((Equiv.funUnique (Fin 1) G).symm y 0)) (x fun i => (Equiv.funUnique (Fin 1) G).symm y (Fin.succ i)) +
      Finset.sum {0} fun j =>
        (-1) ^ (↑j + 1) • x (Fin.contractNth j (fun x x_1 => x * x_1) ((Equiv.funUnique (Fin 1) G).symm y))

Next tactic:
simp_rw [Fin.coe_fin_one, zero_add, pow_one, neg_smul, one_smul,
    Finset.sum_singleton, sub_eq_add_neg]
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dZero` gives a simpler expression for the 0th differential: that is, the following
square commutes:
```
  C⁰(G, A) ---d⁰---> C¹(G, A)
  |                    |
  |                    |
  |                    |
  v                    v
  A ---- dZero ---> Fun(G, A)
```
where the vertical arrows are `zeroCochainsLequiv` and `oneCochainsLequiv` respectively.
-/
theorem dZero_comp_eq : dZero A ∘ₗ (zeroCochainsLequiv A) =
    oneCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 0 1 := by
  ext x y
  show A.ρ y (x default) - x default = _ + ({0} : Finset _).sum _
  simp_rw [Fin.coe_fin_one, zero_add, pow_one, neg_smul, one_smul,
    Finset.sum_singleton, sub_eq_add_neg]
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 0)
y : G
⊢ ((Rep.ρ A) y) (x default) + -x default =
    ((Rep.ρ A) ((Equiv.funUnique (Fin 1) G).symm y 0)) (x fun i => (Equiv.funUnique (Fin 1) G).symm y (Fin.succ i)) +
      -x (Fin.contractNth 0 (fun x x_1 => x * x_1) ((Equiv.funUnique (Fin 1) G).symm y))

Next tactic:
rcongr i
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dZero` gives a simpler expression for the 0th differential: that is, the following
square commutes:
```
  C⁰(G, A) ---d⁰---> C¹(G, A)
  |                    |
  |                    |
  |                    |
  v                    v
  A ---- dZero ---> Fun(G, A)
```
where the vertical arrows are `zeroCochainsLequiv` and `oneCochainsLequiv` respectively.
-/
theorem dZero_comp_eq : dZero A ∘ₗ (zeroCochainsLequiv A) =
    oneCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 0 1 := by
  ext x y
  show A.ρ y (x default) - x default = _ + ({0} : Finset _).sum _
  simp_rw [Fin.coe_fin_one, zero_add, pow_one, neg_smul, one_smul,
    Finset.sum_singleton, sub_eq_add_neg]
  rcongr i <;> 

Proof state:
case h.h.e_a.h.e_6.h.e_a.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 0)
y : G
i : Fin 0
⊢ default i = (Equiv.funUnique (Fin 1) G).symm y (Fin.succ i)

Next tactic:
exact Fin.elim0 i
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dZero` gives a simpler expression for the 0th differential: that is, the following
square commutes:
```
  C⁰(G, A) ---d⁰---> C¹(G, A)
  |                    |
  |                    |
  |                    |
  v                    v
  A ---- dZero ---> Fun(G, A)
```
where the vertical arrows are `zeroCochainsLequiv` and `oneCochainsLequiv` respectively.
-/
theorem dZero_comp_eq : dZero A ∘ₗ (zeroCochainsLequiv A) =
    oneCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 0 1 := by
  ext x y
  show A.ρ y (x default) - x default = _ + ({0} : Finset _).sum _
  simp_rw [Fin.coe_fin_one, zero_add, pow_one, neg_smul, one_smul,
    Finset.sum_singleton, sub_eq_add_neg]
  rcongr i <;> 

Proof state:
case h.h.e_a.e_a.e_a.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 0)
y : G
i : Fin 0
⊢ default i = Fin.contractNth 0 (fun x x_1 => x * x_1) ((Equiv.funUnique (Fin 1) G).symm y) i

Next tactic:
exact Fin.elim0 i
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2 := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
⊢ dOne A ∘ₗ ↑(oneCochainsLequiv A) = ↑(twoCochainsLequiv A) ∘ₗ HomologicalComplex.d (inhomogeneousCochains A) 1 2

Next tactic:
ext x y
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2 := by
  ext x y
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 1)
y : G × G
⊢ (dOne A ∘ₗ ↑(oneCochainsLequiv A)) x y =
    (↑(twoCochainsLequiv A) ∘ₗ HomologicalComplex.d (inhomogeneousCochains A) 1 2) x y

Next tactic:
show A.ρ y.1 (x _) - x _ + x _ =  _ + _
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2 := by
  ext x y
  show A.ρ y.1 (x _) - x _ + x _ =  _ + _
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 1)
y : G × G
⊢ ((Rep.ρ A) y.1) (x ((Equiv.funUnique (Fin 1) G).symm y.2)) - x ((Equiv.funUnique (Fin 1) G).symm (y.1 * y.2)) +
      x ((Equiv.funUnique (Fin 1) G).symm y.1) =
    ((Rep.ρ A) ((piFinTwoEquiv fun x => G).symm y 0)) (x fun i => (piFinTwoEquiv fun x => G).symm y (Fin.succ i)) +
      Finset.sum Finset.univ fun j =>
        (-1) ^ (↑j + 1) • x (Fin.contractNth j (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y))

Next tactic:
rw [Fin.sum_univ_two]
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2 := by
  ext x y
  show A.ρ y.1 (x _) - x _ + x _ =  _ + _
  rw [Fin.sum_univ_two]
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 1)
y : G × G
⊢ ((Rep.ρ A) y.1) (x ((Equiv.funUnique (Fin 1) G).symm y.2)) - x ((Equiv.funUnique (Fin 1) G).symm (y.1 * y.2)) +
      x ((Equiv.funUnique (Fin 1) G).symm y.1) =
    ((Rep.ρ A) ((piFinTwoEquiv fun x => G).symm y 0)) (x fun i => (piFinTwoEquiv fun x => G).symm y (Fin.succ i)) +
      ((-1) ^ (↑0 + 1) • x (Fin.contractNth 0 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y)) +
        (-1) ^ (↑1 + 1) • x (Fin.contractNth 1 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y)))

Next tactic:
simp only [Fin.val_zero, zero_add, pow_one, neg_smul, one_smul, Fin.val_one,
    Nat.one_add, neg_one_sq, sub_eq_add_neg, add_assoc]
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2 := by
  ext x y
  show A.ρ y.1 (x _) - x _ + x _ =  _ + _
  rw [Fin.sum_univ_two]
  simp only [Fin.val_zero, zero_add, pow_one, neg_smul, one_smul, Fin.val_one,
    Nat.one_add, neg_one_sq, sub_eq_add_neg, add_assoc]
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 1)
y : G × G
⊢ ((Rep.ρ A) y.1) (x ((Equiv.funUnique (Fin 1) G).symm y.2)) +
      (-x ((Equiv.funUnique (Fin 1) G).symm (y.1 * y.2)) + x ((Equiv.funUnique (Fin 1) G).symm y.1)) =
    ((Rep.ρ A) ((piFinTwoEquiv fun x => G).symm y 0)) (x fun i => (piFinTwoEquiv fun x => G).symm y (Fin.succ i)) +
      (-x (Fin.contractNth 0 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y)) +
        x (Fin.contractNth 1 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y)))

Next tactic:
rcongr i
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dOne` gives a simpler expression for the 1st differential: that is, the following
square commutes:
```
  C¹(G, A) ---d¹-----> C²(G, A)
    |                      |
    |                      |
    |                      |
    v                      v
  Fun(G, A) -dOne-> Fun(G × G, A)
```
where the vertical arrows are `oneCochainsLequiv` and `twoCochainsLequiv` respectively.
-/
theorem dOne_comp_eq : dOne A ∘ₗ oneCochainsLequiv A =
    twoCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 1 2 := by
  ext x y
  show A.ρ y.1 (x _) - x _ + x _ =  _ + _
  rw [Fin.sum_univ_two]
  simp only [Fin.val_zero, zero_add, pow_one, neg_smul, one_smul, Fin.val_one,
    Nat.one_add, neg_one_sq, sub_eq_add_neg, add_assoc]
  rcongr i <;> 

Proof state:
case h.h.e_a.h.e_6.h.e_a.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 1)
y : G × G
i : Fin 1
⊢ (Equiv.funUnique (Fin 1) G).symm y.2 i = (piFinTwoEquiv fun x => G).symm y (Fin.succ i)

Next tactic:
rw [Subsingleton.elim i 0]