l3lab/ntp-mathlib huggingface dataset:
/-- 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 (Fin.cons (y.2.1 * y.2.2) finZeroElim) { val := 1, isLt := (_ : (fun a => a < 1 + 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 := 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.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 finZeroElim) { val := 0, isLt := (_ : 0 < 1 + 1) } =
    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)))
      { 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.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 (Fin.cons y.2.1 finZeroElim) { val := 1, isLt := (_ : (fun a => a < 1 + 1) 1) } =
    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)))
      { val := 1, isLt := (_ : (fun a => a < 1 + 1) 1) }

Next tactic:
rfl
theorem dOne_comp_dZero : dOne A ∘ₗ dZero A = 0 := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
⊢ dOne A ∘ₗ dZero A = 0

Next tactic:
ext x g
theorem dOne_comp_dZero : dOne A ∘ₗ dZero A = 0 := by
  ext x g
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : CoeSort.coe A
g : G × G
⊢ (dOne A ∘ₗ dZero A) x g = 0 x g

Next tactic:
simp only [LinearMap.coe_comp, Function.comp_apply, dOne_apply A, dZero_apply A, map_sub,
    map_mul, LinearMap.mul_apply, sub_sub_sub_cancel_left, sub_add_sub_cancel, sub_self]
theorem dOne_comp_dZero : dOne A ∘ₗ dZero A = 0 := by
  ext x g
  simp only [LinearMap.coe_comp, Function.comp_apply, dOne_apply A, dZero_apply A, map_sub,
    map_mul, LinearMap.mul_apply, sub_sub_sub_cancel_left, sub_add_sub_cancel, sub_self]
  

Proof state:
case h.h
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : CoeSort.coe A
g : G × G
⊢ 0 = 0 x g

Next tactic:
rfl
theorem dTwo_comp_dOne : dTwo A ∘ₗ dOne A = 0 := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
⊢ dTwo A ∘ₗ dOne A = 0

Next tactic:
show ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = _
theorem dTwo_comp_dOne : dTwo A ∘ₗ dOne A = 0 := by
  show ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = _
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
⊢ ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = 0

Next tactic:
have h1 : _ ≫ ModuleCat.ofHom (dOne A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dOne_comp_eq A)
theorem dTwo_comp_dOne : dTwo A ∘ₗ dOne A = 0 := by
  show ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = _
  have h1 : _ ≫ ModuleCat.ofHom (dOne A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dOne_comp_eq A)
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
h1 :
  ↑(oneCochainsLequiv A) ≫ ModuleCat.ofHom (dOne A) =
    HomologicalComplex.d (inhomogeneousCochains A) 1 2 ≫ ↑(twoCochainsLequiv A)
⊢ ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = 0

Next tactic:
have h2 : _ ≫ ModuleCat.ofHom (dTwo A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dTwo_comp_eq A)
theorem dTwo_comp_dOne : dTwo A ∘ₗ dOne A = 0 := by
  show ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = _
  have h1 : _ ≫ ModuleCat.ofHom (dOne A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dOne_comp_eq A)
  have h2 : _ ≫ ModuleCat.ofHom (dTwo A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dTwo_comp_eq A)
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
h1 :
  ↑(oneCochainsLequiv A) ≫ ModuleCat.ofHom (dOne A) =
    HomologicalComplex.d (inhomogeneousCochains A) 1 2 ≫ ↑(twoCochainsLequiv A)
h2 :
  ↑(twoCochainsLequiv A) ≫ ModuleCat.ofHom (dTwo A) =
    HomologicalComplex.d (inhomogeneousCochains A) 2 3 ≫ ↑(threeCochainsLequiv A)
⊢ ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = 0

Next tactic:
simp only [← LinearEquiv.toModuleIso_hom] at h1 h2
theorem dTwo_comp_dOne : dTwo A ∘ₗ dOne A = 0 := by
  show ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = _
  have h1 : _ ≫ ModuleCat.ofHom (dOne A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dOne_comp_eq A)
  have h2 : _ ≫ ModuleCat.ofHom (dTwo A) = _ ≫ _ := congr_arg ModuleCat.ofHom (dTwo_comp_eq A)
  simp only [← LinearEquiv.toModuleIso_hom] at h1 h2
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
h1 :
  (LinearEquiv.toModuleIso (oneCochainsLequiv A)).hom ≫ ModuleCat.ofHom (dOne A) =
    HomologicalComplex.d (inhomogeneousCochains A) 1 2 ≫ (LinearEquiv.toModuleIso (twoCochainsLequiv A)).hom
h2 :
  (LinearEquiv.toModuleIso (twoCochainsLequiv A)).hom ≫ ModuleCat.ofHom (dTwo A) =
    HomologicalComplex.d (inhomogeneousCochains A) 2 3 ≫ (LinearEquiv.toModuleIso (threeCochainsLequiv A)).hom
⊢ ModuleCat.ofHom (dOne A) ≫ ModuleCat.ofHom (dTwo A) = 0

Next tactic:
simp only [(Iso.eq_inv_comp _).2 h2, (Iso.eq_inv_comp _).2 h1,
    Category.assoc, Iso.hom_inv_id_assoc, HomologicalComplex.d_comp_d_assoc, zero_comp, comp_zero]
theorem mem_oneCocycles_def (f : G → A) :
    f ∈ oneCocycles A ↔ ∀ g h : G, A.ρ g (f h) - f (g * h) + f g = 0 :=
  LinearMap.mem_ker.trans $ by
    

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G → CoeSort.coe A
⊢ (dOne A) f = 0 ↔ ∀ (g h : G), ((Rep.ρ A) g) (f h) - f (g * h) + f g = 0

Next tactic:
rw [Function.funext_iff]
theorem mem_oneCocycles_def (f : G → A) :
    f ∈ oneCocycles A ↔ ∀ g h : G, A.ρ g (f h) - f (g * h) + f g = 0 :=
  LinearMap.mem_ker.trans $ by
    rw [Function.funext_iff]
    

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G → CoeSort.coe A
⊢ (∀ (a : G × G), (dOne A) f a = OfNat.ofNat 0 a) ↔ ∀ (g h : G), ((Rep.ρ A) g) (f h) - f (g * h) + f g = 0

Next tactic:
simp only [dOne_apply, Pi.zero_apply, Prod.forall]
theorem mem_oneCocycles_iff (f : G → A) :
    f ∈ oneCocycles A ↔ ∀ g h : G, f (g * h) = A.ρ g (f h) + f g := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G → CoeSort.coe A
⊢ f ∈ oneCocycles A ↔ ∀ (g h : G), f (g * h) = ((Rep.ρ A) g) (f h) + f g

Next tactic:
simp_rw [mem_oneCocycles_def, sub_add_eq_add_sub, sub_eq_zero, eq_comm]
@[simp] theorem oneCocycles_map_one (f : oneCocycles A) : f.1 1 = 0 := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(oneCocycles A)
⊢ ↑f 1 = 0

Next tactic:
have := (mem_oneCocycles_def f.1).1 f.2 1 1
@[simp] theorem oneCocycles_map_one (f : oneCocycles A) : f.1 1 = 0 := by
  have := (mem_oneCocycles_def f.1).1 f.2 1 1
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(oneCocycles A)
this : ((Rep.ρ A) 1) (↑f 1) - ↑f (1 * 1) + ↑f 1 = 0
⊢ ↑f 1 = 0

Next tactic:
simpa only [map_one, LinearMap.one_apply, mul_one, sub_self, zero_add] using this
@[simp] theorem oneCocycles_map_inv (f : oneCocycles A) (g : G) :
    A.ρ g (f.1 g⁻¹) = - f.1 g := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(oneCocycles A)
g : G
⊢ ((Rep.ρ A) g) (↑f g⁻¹) = -↑f g

Next tactic:
rw [← add_eq_zero_iff_eq_neg, ← oneCocycles_map_one f, ← mul_inv_self g,
    (mem_oneCocycles_iff f.1).1 f.2 g g⁻¹]
theorem oneCocycles_map_mul_of_isTrivial [A.IsTrivial] (f : oneCocycles A) (g h : G) :
    f.1 (g * h) = f.1 g + f.1 h := by
  

Proof state:
k G : Type u
inst✝² : CommRing k
inst✝¹ : Group G
A : Rep k G
inst✝ : Rep.IsTrivial A
f : ↥(oneCocycles A)
g h : G
⊢ ↑f (g * h) = ↑f g + ↑f h

Next tactic:
rw [(mem_oneCocycles_iff f.1).1 f.2, apply_eq_self A.ρ g (f.1 h), add_comm]
theorem mem_oneCocycles_of_addMonoidHom [A.IsTrivial] (f : Additive G →+ A) :
    f ∘ Additive.ofMul ∈ oneCocycles A :=
  (mem_oneCocycles_iff _).2 fun g h => by
    

Proof state:
k G : Type u
inst✝² : CommRing k
inst✝¹ : Group G
A : Rep k G
inst✝ : Rep.IsTrivial A
f : Additive G →+ CoeSort.coe A
g h : G
⊢ (⇑f ∘ ⇑Additive.ofMul) (g * h) = ((Rep.ρ A) g) ((⇑f ∘ ⇑Additive.ofMul) h) + (⇑f ∘ ⇑Additive.ofMul) g

Next tactic:
simp only [Function.comp_apply, ofMul_mul, map_add,
      oneCocycles_map_mul_of_isTrivial, apply_eq_self A.ρ g (f (Additive.ofMul h)),
      add_comm (f (Additive.ofMul g))]
theorem mem_twoCocycles_def (f : G × G → A) :
    f ∈ twoCocycles A ↔ ∀ g h j : G,
      A.ρ g (f (h, j)) - f (g * h, j) + f (g, h * j) - f (g, h) = 0 :=
  LinearMap.mem_ker.trans $ by
    

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G × G → CoeSort.coe A
⊢ (dTwo A) f = 0 ↔ ∀ (g h j : G), ((Rep.ρ A) g) (f (h, j)) - f (g * h, j) + f (g, h * j) - f (g, h) = 0

Next tactic:
rw [Function.funext_iff]
theorem mem_twoCocycles_def (f : G × G → A) :
    f ∈ twoCocycles A ↔ ∀ g h j : G,
      A.ρ g (f (h, j)) - f (g * h, j) + f (g, h * j) - f (g, h) = 0 :=
  LinearMap.mem_ker.trans $ by
    rw [Function.funext_iff]
    

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G × G → CoeSort.coe A
⊢ (∀ (a : G × G × G), (dTwo A) f a = OfNat.ofNat 0 a) ↔
    ∀ (g h j : G), ((Rep.ρ A) g) (f (h, j)) - f (g * h, j) + f (g, h * j) - f (g, h) = 0

Next tactic:
simp only [dTwo_apply, Prod.mk.eta, Pi.zero_apply, Prod.forall]
theorem mem_twoCocycles_iff (f : G × G → A) :
    f ∈ twoCocycles A ↔ ∀ g h j : G,
      f (g * h, j) + f (g, h) =
        A.ρ g (f (h, j)) + f (g, h * j) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G × G → CoeSort.coe A
⊢ f ∈ twoCocycles A ↔ ∀ (g h j : G), f (g * h, j) + f (g, h) = ((Rep.ρ A) g) (f (h, j)) + f (g, h * j)

Next tactic:
simp_rw [mem_twoCocycles_def, sub_eq_zero, sub_add_eq_add_sub, sub_eq_iff_eq_add, eq_comm,
    add_comm (f (_ * _, _))]
theorem twoCocycles_map_one_fst (f : twoCocycles A) (g : G) :
    f.1 (1, g) = f.1 (1, 1) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
⊢ ↑f (1, g) = ↑f (1, 1)

Next tactic:
have := ((mem_twoCocycles_iff f.1).1 f.2 1 1 g).symm
theorem twoCocycles_map_one_fst (f : twoCocycles A) (g : G) :
    f.1 (1, g) = f.1 (1, 1) := by
  have := ((mem_twoCocycles_iff f.1).1 f.2 1 1 g).symm
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
this : ((Rep.ρ A) 1) (↑f (1, g)) + ↑f (1, 1 * g) = ↑f (1 * 1, g) + ↑f (1, 1)
⊢ ↑f (1, g) = ↑f (1, 1)

Next tactic:
simpa only [map_one, LinearMap.one_apply, one_mul, add_right_inj, this]
theorem twoCocycles_map_one_snd (f : twoCocycles A) (g : G) :
    f.1 (g, 1) = A.ρ g (f.1 (1, 1)) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
⊢ ↑f (g, 1) = ((Rep.ρ A) g) (↑f (1, 1))

Next tactic:
have := (mem_twoCocycles_iff f.1).1 f.2 g 1 1
theorem twoCocycles_map_one_snd (f : twoCocycles A) (g : G) :
    f.1 (g, 1) = A.ρ g (f.1 (1, 1)) := by
  have := (mem_twoCocycles_iff f.1).1 f.2 g 1 1
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
this : ↑f (g * 1, 1) + ↑f (g, 1) = ((Rep.ρ A) g) (↑f (1, 1)) + ↑f (g, 1 * 1)
⊢ ↑f (g, 1) = ((Rep.ρ A) g) (↑f (1, 1))

Next tactic:
simpa only [mul_one, add_left_inj, this]
lemma twoCocycles_ρ_map_inv_sub_map_inv (f : twoCocycles A) (g : G) :
    A.ρ g (f.1 (g⁻¹, g)) - f.1 (g, g⁻¹)
      = f.1 (1, 1) - f.1 (g, 1) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
⊢ ((Rep.ρ A) g) (↑f (g⁻¹, g)) - ↑f (g, g⁻¹) = ↑f (1, 1) - ↑f (g, 1)

Next tactic:
have := (mem_twoCocycles_iff f.1).1 f.2 g g⁻¹ g
lemma twoCocycles_ρ_map_inv_sub_map_inv (f : twoCocycles A) (g : G) :
    A.ρ g (f.1 (g⁻¹, g)) - f.1 (g, g⁻¹)
      = f.1 (1, 1) - f.1 (g, 1) := by
  have := (mem_twoCocycles_iff f.1).1 f.2 g g⁻¹ g
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
this : ↑f (g * g⁻¹, g) + ↑f (g, g⁻¹) = ((Rep.ρ A) g) (↑f (g⁻¹, g)) + ↑f (g, g⁻¹ * g)
⊢ ((Rep.ρ A) g) (↑f (g⁻¹, g)) - ↑f (g, g⁻¹) = ↑f (1, 1) - ↑f (g, 1)

Next tactic:
simp only [mul_right_inv, mul_left_inv, twoCocycles_map_one_fst _ g]
    at this
lemma twoCocycles_ρ_map_inv_sub_map_inv (f : twoCocycles A) (g : G) :
    A.ρ g (f.1 (g⁻¹, g)) - f.1 (g, g⁻¹)
      = f.1 (1, 1) - f.1 (g, 1) := by
  have := (mem_twoCocycles_iff f.1).1 f.2 g g⁻¹ g
  simp only [mul_right_inv, mul_left_inv, twoCocycles_map_one_fst _ g]
    at this
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
g : G
this : ↑f (1, 1) + ↑f (g, g⁻¹) = ((Rep.ρ A) g) (↑f (g⁻¹, g)) + ↑f (g, 1)
⊢ ((Rep.ρ A) g) (↑f (g⁻¹, g)) - ↑f (g, g⁻¹) = ↑f (1, 1) - ↑f (g, 1)

Next tactic:
exact sub_eq_sub_iff_add_eq_add.2 this.symm
theorem mem_oneCoboundaries_of_mem_range (f : G → A) (h : f ∈ LinearMap.range (dZero A)) :
    ⟨f, LinearMap.range_le_ker_iff.2 (dOne_comp_dZero A) h⟩ ∈ oneCoboundaries A := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G → CoeSort.coe A
h : f ∈ LinearMap.range (dZero A)
⊢ { val := f, property := (_ : f ∈ LinearMap.ker (dOne A)) } ∈ oneCoboundaries A

Next tactic:
rcases h with ⟨x, rfl⟩
theorem mem_oneCoboundaries_of_mem_range (f : G → A) (h : f ∈ LinearMap.range (dZero A)) :
    ⟨f, LinearMap.range_le_ker_iff.2 (dOne_comp_dZero A) h⟩ ∈ oneCoboundaries A := by
  rcases h with ⟨x, rfl⟩; 

Proof state:
case intro
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : CoeSort.coe A
⊢ { val := (dZero A) x, property := (_ : (dZero A) x ∈ LinearMap.ker (dOne A)) } ∈ oneCoboundaries A

Next tactic:
exact ⟨x, rfl⟩
theorem mem_range_of_mem_oneCoboundaries (f : oneCocycles A) (h : f ∈ oneCoboundaries A) :
    f.1 ∈ LinearMap.range (dZero A) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(oneCocycles A)
h : f ∈ oneCoboundaries A
⊢ ↑f ∈ LinearMap.range (dZero A)

Next tactic:
rcases h with ⟨x, rfl⟩
theorem mem_range_of_mem_oneCoboundaries (f : oneCocycles A) (h : f ∈ oneCoboundaries A) :
    f.1 ∈ LinearMap.range (dZero A) := by
  rcases h with ⟨x, rfl⟩; 

Proof state:
case intro
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : CoeSort.coe A
⊢ ↑((LinearMap.codRestrict (oneCocycles A) (dZero A) (_ : ∀ (c : CoeSort.coe A), (dOne A ∘ₗ dZero A) c = 0 c)) x) ∈
    LinearMap.range (dZero A)

Next tactic:
exact ⟨x, rfl⟩
theorem oneCoboundaries_eq_bot_of_isTrivial (A : Rep k G) [A.IsTrivial] :
    oneCoboundaries A = ⊥ := by
  

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

Next tactic:
simp_rw [oneCoboundaries, dZero_eq_zero]
theorem oneCoboundaries_eq_bot_of_isTrivial (A : Rep k G) [A.IsTrivial] :
    oneCoboundaries A = ⊥ := by
  simp_rw [oneCoboundaries, dZero_eq_zero]
  

Proof state:
k G : Type u
inst✝² : CommRing k
inst✝¹ : Group G
A✝ A : Rep k G
inst✝ : Rep.IsTrivial A
⊢ LinearMap.range (LinearMap.codRestrict (oneCocycles A) 0 (_ : ∀ (c : CoeSort.coe A), 0 c ∈ oneCocycles A)) = ⊥

Next tactic:
exact LinearMap.range_eq_bot.2 rfl
theorem mem_twoCoboundaries_of_mem_range (f : G × G → A) (h : f ∈ LinearMap.range (dOne A)) :
    ⟨f, LinearMap.range_le_ker_iff.2 (dTwo_comp_dOne A) h⟩ ∈ twoCoboundaries A := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : G × G → CoeSort.coe A
h : f ∈ LinearMap.range (dOne A)
⊢ { val := f, property := (_ : f ∈ LinearMap.ker (dTwo A)) } ∈ twoCoboundaries A

Next tactic:
rcases h with ⟨x, rfl⟩
theorem mem_twoCoboundaries_of_mem_range (f : G × G → A) (h : f ∈ LinearMap.range (dOne A)) :
    ⟨f, LinearMap.range_le_ker_iff.2 (dTwo_comp_dOne A) h⟩ ∈ twoCoboundaries A := by
  rcases h with ⟨x, rfl⟩; 

Proof state:
case intro
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : G → CoeSort.coe A
⊢ { val := (dOne A) x, property := (_ : (dOne A) x ∈ LinearMap.ker (dTwo A)) } ∈ twoCoboundaries A

Next tactic:
exact ⟨x, rfl⟩
theorem mem_range_of_mem_twoCoboundaries (f : twoCocycles A) (h : f ∈ twoCoboundaries A) :
    (twoCocycles A).subtype f ∈ LinearMap.range (dOne A) := by
  

Proof state:
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
f : ↥(twoCocycles A)
h : f ∈ twoCoboundaries A
⊢ (Submodule.subtype (twoCocycles A)) f ∈ LinearMap.range (dOne A)

Next tactic:
rcases h with ⟨x, rfl⟩
theorem mem_range_of_mem_twoCoboundaries (f : twoCocycles A) (h : f ∈ twoCoboundaries A) :
    (twoCocycles A).subtype f ∈ LinearMap.range (dOne A) := by
  rcases h with ⟨x, rfl⟩; 

Proof state:
case intro
k G : Type u
inst✝¹ : CommRing k
inst✝ : Group G
A : Rep k G
x : G → CoeSort.coe A
⊢ (Submodule.subtype (twoCocycles A))
      ((LinearMap.codRestrict (twoCocycles A) (dOne A) (_ : ∀ (c : G → CoeSort.coe A), (dTwo A ∘ₗ dOne A) c = 0 c)) x) ∈
    LinearMap.range (dOne A)

Next tactic:
exact ⟨x, rfl⟩
theorem H1LequivOfIsTrivial_comp_H1_π [A.IsTrivial] :
    (H1LequivOfIsTrivial A).comp (H1_π A) = oneCocyclesLequivOfIsTrivial A := by
  

Proof state:
k G : Type u
inst✝² : CommRing k
inst✝¹ : Group G
A : Rep k G
inst✝ : Rep.IsTrivial A
⊢ ↑(H1LequivOfIsTrivial A) ∘ₗ H1_π A = ↑(oneCocyclesLequivOfIsTrivial A)

Next tactic:
ext
theorem H1LequivOfIsTrivial_comp_H1_π [A.IsTrivial] :
    (H1LequivOfIsTrivial A).comp (H1_π A) = oneCocyclesLequivOfIsTrivial A := 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✝¹ : ↥(oneCocycles A)
x✝ : Additive G
⊢ ((↑(H1LequivOfIsTrivial A) ∘ₗ H1_π A) x✝¹) x✝ = (↑(oneCocyclesLequivOfIsTrivial A) x✝¹) x✝

Next tactic:
rfl
lemma isClosed_sUnion (hS : ∀ s ∈ S, IsClosed s) : IsClosed (⋃₀ S) := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : AlexandrovDiscrete α
S : Set (Set α)
f : ι → Set α
hS : ∀ s ∈ S, IsClosed s
⊢ IsClosed (⋃₀ S)

Next tactic:
simp only [← isOpen_compl_iff, compl_sUnion] at hS ⊢
lemma isClosed_sUnion (hS : ∀ s ∈ S, IsClosed s) : IsClosed (⋃₀ S) := by
  simp only [← isOpen_compl_iff, compl_sUnion] at hS ⊢; 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : AlexandrovDiscrete α
S : Set (Set α)
f : ι → Set α
hS : ∀ s ∈ S, IsOpen sᶜ
⊢ IsOpen (⋂₀ (compl '' S))

Next tactic:
exact isOpen_sInter $ ball_image_iff.2 hS
lemma interior_sInter (S : Set (Set α)) : interior (⋂₀ S) = ⋂ s ∈ S, interior s := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : AlexandrovDiscrete α
S✝ : Set (Set α)
f : ι → Set α
S : Set (Set α)
⊢ interior (⋂₀ S) = ⋂ s ∈ S, interior s

Next tactic:
simp_rw [sInter_eq_biInter, interior_iInter]
lemma closure_iUnion (f : ι → Set α) : closure (⋃ i, f i) = ⋃ i, closure (f i) :=
  compl_injective <| by
    

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : AlexandrovDiscrete α
S : Set (Set α)
f✝ f : ι → Set α
⊢ (closure (⋃ i, f i))ᶜ = (⋃ i, closure (f i))ᶜ

Next tactic:
simpa only [← interior_compl, compl_iUnion] using interior_iInter fun i ↦ (f i)ᶜ
lemma closure_sUnion (S : Set (Set α)) : closure (⋃₀ S) = ⋃ s ∈ S, closure s := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
inst✝ : AlexandrovDiscrete α
S✝ : Set (Set α)
f : ι → Set α
S : Set (Set α)
⊢ closure (⋃₀ S) = ⋃ s ∈ S, closure s

Next tactic:
simp_rw [sUnion_eq_biUnion, closure_iUnion]
lemma exterior_singleton_eq_ker_nhds (a : α) : exterior {a} = (𝓝 a).ker := by 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
s t : Set α
a✝ x y a : α
⊢ exterior {a} = ker (𝓝 a)

Next tactic:
simp [exterior]
lemma mem_exterior : a ∈ exterior s ↔ ∀ U, IsOpen U → s ⊆ U → a ∈ U := by 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
s t : Set α
a x y : α
⊢ a ∈ exterior s ↔ ∀ (U : Set α), IsOpen U → s ⊆ U → a ∈ U

Next tactic:
simp [exterior_def]
lemma subset_exterior_iff : s ⊆ exterior t ↔ ∀ U, IsOpen U → t ⊆ U → s ⊆ U := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
s t : Set α
a x y : α
⊢ s ⊆ exterior t ↔ ∀ (U : Set α), IsOpen U → t ⊆ U → s ⊆ U

Next tactic:
simp [exterior_def]
lemma exterior_minimal (h₁ : s ⊆ t) (h₂ : IsOpen t) : exterior s ⊆ t := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
s t : Set α
a x y : α
h₁ : s ⊆ t
h₂ : IsOpen t
⊢ exterior s ⊆ t

Next tactic:
rw [exterior_def]
lemma exterior_minimal (h₁ : s ⊆ t) (h₂ : IsOpen t) : exterior s ⊆ t := by
  rw [exterior_def]; 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
s t : Set α
a x y : α
h₁ : s ⊆ t
h₂ : IsOpen t
⊢ ⋂₀ {t | IsOpen t ∧ s ⊆ t} ⊆ t

Next tactic:
exact sInter_subset_of_mem ⟨h₂, h₁⟩