l3lab/ntp-mathlib huggingface dataset:
/-- 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.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) 1)
y : G × G
i : Fin 1
⊢ (Equiv.funUnique (Fin 1) G).symm (y.1 * y.2) i =
    Fin.contractNth 0 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y) i

Next tactic:
rw [Subsingleton.elim i 0]
/-- 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.e_a.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.1 i =
    Fin.contractNth 1 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y) i

Next tactic:
rw [Subsingleton.elim i 0]
/-- 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 <;> rw [Subsingleton.elim i 0] <;> 

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 0 = (piFinTwoEquiv fun x => G).symm y (Fin.succ 0)

Next tactic:
rfl
/-- 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 <;> rw [Subsingleton.elim i 0] <;> 

Proof state:
case h.h.e_a.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) 1)
y : G × G
i : Fin 1
⊢ (Equiv.funUnique (Fin 1) G).symm (y.1 * y.2) 0 =
    Fin.contractNth 0 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y) 0

Next tactic:
rfl
/-- 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 <;> rw [Subsingleton.elim i 0] <;> 

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) 1)
y : G × G
i : Fin 1
⊢ (Equiv.funUnique (Fin 1) G).symm y.1 0 =
    Fin.contractNth 1 (fun x x_1 => x * x_1) ((piFinTwoEquiv fun x => G).symm y) 0

Next tactic:
rfl
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dTwo` gives a simpler expression for the 2nd differential: that is, the following
square commutes:
```
      C²(G, A) -------d²-----> C³(G, A)
        |                         |
        |                         |
        |                         |
        v                         v
  Fun(G × G, A) --dTwo--> Fun(G × G × G, A)
```
where the vertical arrows are `twoCochainsLequiv` and `threeCochainsLequiv` respectively.
-/
theorem dTwo_comp_eq :
    dTwo A ∘ₗ twoCochainsLequiv A = threeCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 2 3 := by
  

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

Next tactic:
ext x y
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dTwo` gives a simpler expression for the 2nd differential: that is, the following
square commutes:
```
      C²(G, A) -------d²-----> C³(G, A)
        |                         |
        |                         |
        |                         |
        v                         v
  Fun(G × G, A) --dTwo--> Fun(G × G × G, A)
```
where the vertical arrows are `twoCochainsLequiv` and `threeCochainsLequiv` respectively.
-/
theorem dTwo_comp_eq :
    dTwo A ∘ₗ twoCochainsLequiv A = threeCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 2 3 := 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) 2)
y : G × G × G
⊢ (dTwo A ∘ₗ ↑(twoCochainsLequiv A)) x y =
    (↑(threeCochainsLequiv A) ∘ₗ HomologicalComplex.d (inhomogeneousCochains A) 2 3) x y

Next tactic:
show A.ρ y.1 (x _) - x _ + x _ - x _ = _ + _
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dTwo` gives a simpler expression for the 2nd differential: that is, the following
square commutes:
```
      C²(G, A) -------d²-----> C³(G, A)
        |                         |
        |                         |
        |                         |
        v                         v
  Fun(G × G, A) --dTwo--> Fun(G × G × G, A)
```
where the vertical arrows are `twoCochainsLequiv` and `threeCochainsLequiv` respectively.
-/
theorem dTwo_comp_eq :
    dTwo A ∘ₗ twoCochainsLequiv A = threeCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 2 3 := by
  ext x y
  show A.ρ y.1 (x _) - 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) 2)
y : G × G × G
⊢ ((Rep.ρ A) y.1) (x ((piFinTwoEquiv fun x => G).symm (y.2.1, y.2.2))) -
          x ((piFinTwoEquiv fun x => G).symm (y.1 * y.2.1, y.2.2)) +
        x ((piFinTwoEquiv fun x => G).symm (y.1, y.2.1 * y.2.2)) -
      x ((piFinTwoEquiv fun x => G).symm (y.1, y.2.1)) =
    ((Rep.ρ A) (((Equiv.piFinSucc 2 G).trans (Equiv.prodCongr (Equiv.refl G) (piFinTwoEquiv fun x => G))).symm y 0))
        (x fun i =>
          ((Equiv.piFinSucc 2 G).trans (Equiv.prodCongr (Equiv.refl G) (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)
              (((Equiv.piFinSucc 2 G).trans (Equiv.prodCongr (Equiv.refl G) (piFinTwoEquiv fun x => G))).symm y))

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

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

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

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

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

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

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

Proof state:
case h.h.e_a.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) 2)
y : G × G × G
i : Fin (1 + 1)
⊢ Fin.cons (y.1 * y.2.1) (Fin.cons y.2.2 finZeroElim) i =
    Fin.contractNth 0 (fun x x_1 => x * x_1)
      ((Equiv.piFinSucc 2 G).symm (y.1, Fin.cons y.2.1 (Fin.cons y.2.2 finZeroElim))) i

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

Proof state:
case h.h.e_a.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) 2)
y : G × G × G
i : Fin (1 + 1)
⊢ Fin.cons y.1 (Fin.cons (y.2.1 * y.2.2) finZeroElim) i =
    Fin.contractNth 1 (fun x x_1 => x * x_1)
      ((Equiv.piFinSucc 2 G).symm (y.1, Fin.cons y.2.1 (Fin.cons y.2.2 finZeroElim))) i

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

Proof state:
case h.h.e_a.e_a.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) 2)
y : G × G × G
i : Fin (1 + 1)
⊢ Fin.cons y.1 (Fin.cons y.2.1 finZeroElim) i =
    Fin.contractNth 2 (fun x x_1 => x * x_1)
      ((Equiv.piFinSucc 2 G).symm (y.1, Fin.cons y.2.1 (Fin.cons y.2.2 finZeroElim))) i

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

Proof state:
case h.h.e_a.e_a.e_a.e_a.h.head
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 2)
y : G × G × G
⊢ Fin.cons (y.1 * y.2.1) (Fin.cons y.2.2 finZeroElim) { val := 0, isLt := (_ : 0 < 1 + 1) } =
    Fin.contractNth 0 (fun x x_1 => x * x_1)
      ((Equiv.piFinSucc 2 G).symm (y.1, Fin.cons y.2.1 (Fin.cons y.2.2 finZeroElim)))
      { val := 0, isLt := (_ : 0 < 1 + 1) }

Next tactic:
rfl
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dTwo` gives a simpler expression for the 2nd differential: that is, the following
square commutes:
```
      C²(G, A) -------d²-----> C³(G, A)
        |                         |
        |                         |
        |                         |
        v                         v
  Fun(G × G, A) --dTwo--> Fun(G × G × G, A)
```
where the vertical arrows are `twoCochainsLequiv` and `threeCochainsLequiv` respectively.
-/
theorem dTwo_comp_eq :
    dTwo A ∘ₗ twoCochainsLequiv A = threeCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 2 3 := by
  ext x y
  show A.ρ y.1 (x _) - x _ + x _ - x _ = _ + _
  dsimp
  rw [Fin.sum_univ_three]
  simp only [sub_eq_add_neg, add_assoc, Fin.val_zero, zero_add, pow_one, neg_smul,
    one_smul, Fin.val_one, Fin.val_two, pow_succ (-1 : k) 2, neg_sq, Nat.one_add, one_pow, mul_one]
  rcongr i <;> fin_cases i <;> 

Proof state:
case h.h.e_a.e_a.e_a.e_a.h.tail.head
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 2)
y : G × G × G
⊢ Fin.cons (y.1 * y.2.1) (Fin.cons y.2.2 finZeroElim) { val := 1, isLt := (_ : (fun a => a < 1 + 1) 1) } =
    Fin.contractNth 0 (fun x x_1 => x * x_1)
      ((Equiv.piFinSucc 2 G).symm (y.1, Fin.cons y.2.1 (Fin.cons y.2.2 finZeroElim)))
      { val := 1, isLt := (_ : (fun a => a < 1 + 1) 1) }

Next tactic:
rfl
/-- Let `C(G, A)` denote the complex of inhomogeneous cochains of `A : Rep k G`. This lemma
says `dTwo` gives a simpler expression for the 2nd differential: that is, the following
square commutes:
```
      C²(G, A) -------d²-----> C³(G, A)
        |                         |
        |                         |
        |                         |
        v                         v
  Fun(G × G, A) --dTwo--> Fun(G × G × G, A)
```
where the vertical arrows are `twoCochainsLequiv` and `threeCochainsLequiv` respectively.
-/
theorem dTwo_comp_eq :
    dTwo A ∘ₗ twoCochainsLequiv A = threeCochainsLequiv A ∘ₗ (inhomogeneousCochains A).d 2 3 := by
  ext x y
  show A.ρ y.1 (x _) - x _ + x _ - x _ = _ + _
  dsimp
  rw [Fin.sum_univ_three]
  simp only [sub_eq_add_neg, add_assoc, Fin.val_zero, zero_add, pow_one, neg_smul,
    one_smul, Fin.val_one, Fin.val_two, pow_succ (-1 : k) 2, neg_sq, Nat.one_add, one_pow, mul_one]
  rcongr i <;> fin_cases i <;> 

Proof state:
case h.h.e_a.e_a.e_a.e_a.h.head
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : ↑(HomologicalComplex.X (inhomogeneousCochains A) 2)
y : G × G × G
⊢ Fin.cons y.1 (Fin.cons (y.2.1 * y.2.2) finZeroElim) { val := 0, isLt := (_ : 0 < 1 + 1) } =
    Fin.contractNth 1 (fun x x_1 => x * x_1)
      ((Equiv.piFinSucc 2 G).symm (y.1, Fin.cons y.2.1 (Fin.cons y.2.2 finZeroElim)))
      { val := 0, isLt := (_ : 0 < 1 + 1) }

Next tactic:
rfl