l3lab/ntp-mathlib huggingface dataset:
theorem comp_P_eq_self_iff {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} :
    φ ≫ (P q).f (n + 1) = φ ↔ HigherFacesVanish q φ := by
  constructor
  · intro hφ
    rw [← hφ]
    apply HigherFacesVanish.of_comp
    

Proof state:
case mp.v
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
n q : ℕ
φ : Y ⟶ X.obj (op [n + 1])
hφ : φ ≫ HomologicalComplex.Hom.f (P q) (n + 1) = φ
⊢ HigherFacesVanish q (HomologicalComplex.Hom.f (P q) (n + 1))

Next tactic:
apply HigherFacesVanish.of_P
theorem comp_P_eq_self_iff {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} :
    φ ≫ (P q).f (n + 1) = φ ↔ HigherFacesVanish q φ := by
  constructor
  · intro hφ
    rw [← hφ]
    apply HigherFacesVanish.of_comp
    apply HigherFacesVanish.of_P
  · 

Proof state:
case mpr
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
Y : C
n q : ℕ
φ : Y ⟶ X.obj (op [n + 1])
⊢ HigherFacesVanish q φ → φ ≫ HomologicalComplex.Hom.f (P q) (n + 1) = φ

Next tactic:
exact HigherFacesVanish.comp_P_eq_self
@[reassoc (attr := simp)]
theorem P_f_idem (q n : ℕ) : ((P q).f n : X _[n] ⟶ _) ≫ (P q).f n = (P q).f n := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q n : ℕ
⊢ HomologicalComplex.Hom.f (P q) n ≫ HomologicalComplex.Hom.f (P q) n = HomologicalComplex.Hom.f (P q) n

Next tactic:
rcases n with (_|n)
@[reassoc (attr := simp)]
theorem P_f_idem (q n : ℕ) : ((P q).f n : X _[n] ⟶ _) ≫ (P q).f n = (P q).f n := by
  rcases n with (_|n)
  · 

Proof state:
case zero
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
⊢ HomologicalComplex.Hom.f (P q) Nat.zero ≫ HomologicalComplex.Hom.f (P q) Nat.zero =
    HomologicalComplex.Hom.f (P q) Nat.zero

Next tactic:
rw [P_f_0_eq q, comp_id]
@[reassoc (attr := simp)]
theorem P_f_idem (q n : ℕ) : ((P q).f n : X _[n] ⟶ _) ≫ (P q).f n = (P q).f n := by
  rcases n with (_|n)
  · rw [P_f_0_eq q, comp_id]
  · 

Proof state:
case succ
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q n : ℕ
⊢ HomologicalComplex.Hom.f (P q) (Nat.succ n) ≫ HomologicalComplex.Hom.f (P q) (Nat.succ n) =
    HomologicalComplex.Hom.f (P q) (Nat.succ n)

Next tactic:
exact (HigherFacesVanish.of_P q n).comp_P_eq_self
@[reassoc (attr := simp)]
theorem P_idem (q : ℕ) : (P q : K[X] ⟶ K[X]) ≫ P q = P q := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
⊢ P q ≫ P q = P q

Next tactic:
ext n
@[reassoc (attr := simp)]
theorem P_idem (q : ℕ) : (P q : K[X] ⟶ K[X]) ≫ P q = P q := by
  ext n
  

Proof state:
case h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q n : ℕ
⊢ HomologicalComplex.Hom.f (P q ≫ P q) n = HomologicalComplex.Hom.f (P q) n

Next tactic:
exact P_f_idem q n
@[reassoc (attr := simp)]
theorem Q_idem (q : ℕ) : (Q q : K[X] ⟶ K[X]) ≫ Q q = Q q := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
⊢ Q q ≫ Q q = Q q

Next tactic:
ext n
@[reassoc (attr := simp)]
theorem Q_idem (q : ℕ) : (Q q : K[X] ⟶ K[X]) ≫ Q q = Q q := by
  ext n
  

Proof state:
case h
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q n : ℕ
⊢ HomologicalComplex.Hom.f (Q q ≫ Q q) n = HomologicalComplex.Hom.f (Q q) n

Next tactic:
exact Q_f_idem q n
/-- For each `q`, `P q` is a natural transformation. -/
@[simps]
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
  app X := P q
  naturality _ _ f := by
    

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.248155, u_1} C
inst✝ : Preadditive C
X : SimplicialObject C
q : ℕ
x✝¹ x✝ : SimplicialObject C
f : x✝¹ ⟶ x✝
⊢ (alternatingFaceMapComplex C).map f ≫ (fun X => P q) x✝ = (fun X => P q) x✝¹ ≫ (alternatingFaceMapComplex C).map f

Next tactic:
induction' q with q hq
/-- For each `q`, `P q` is a natural transformation. -/
@[simps]
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
  app X := P q
  naturality _ _ f := by
    induction' q with q hq
    · 

Proof state:
case zero
C : Type u_1
inst✝¹ : Category.{?u.248155, u_1} C
inst✝ : Preadditive C
X x✝¹ x✝ : SimplicialObject C
f : x✝¹ ⟶ x✝
⊢ (alternatingFaceMapComplex C).map f ≫ (fun X => P Nat.zero) x✝ =
    (fun X => P Nat.zero) x✝¹ ≫ (alternatingFaceMapComplex C).map f

Next tactic:
dsimp [alternatingFaceMapComplex]
/-- For each `q`, `P q` is a natural transformation. -/
@[simps]
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
  app X := P q
  naturality _ _ f := by
    induction' q with q hq
    · dsimp [alternatingFaceMapComplex]
      

Proof state:
case zero
C : Type u_1
inst✝¹ : Category.{?u.248155, u_1} C
inst✝ : Preadditive C
X x✝¹ x✝ : SimplicialObject C
f : x✝¹ ⟶ x✝
⊢ AlternatingFaceMapComplex.map f ≫ P 0 = P 0 ≫ AlternatingFaceMapComplex.map f

Next tactic:
simp only [P_zero, id_comp, comp_id]
/-- For each `q`, `P q` is a natural transformation. -/
@[simps]
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
  app X := P q
  naturality _ _ f := by
    induction' q with q hq
    · dsimp [alternatingFaceMapComplex]
      simp only [P_zero, id_comp, comp_id]
    · 

Proof state:
case succ
C : Type u_1
inst✝¹ : Category.{?u.248155, u_1} C
inst✝ : Preadditive C
X x✝¹ x✝ : SimplicialObject C
f : x✝¹ ⟶ x✝
q : ℕ
hq : (alternatingFaceMapComplex C).map f ≫ (fun X => P q) x✝ = (fun X => P q) x✝¹ ≫ (alternatingFaceMapComplex C).map f
⊢ (alternatingFaceMapComplex C).map f ≫ (fun X => P (Nat.succ q)) x✝ =
    (fun X => P (Nat.succ q)) x✝¹ ≫ (alternatingFaceMapComplex C).map f

Next tactic:
simp only [P_succ, add_comp, comp_add, assoc, comp_id, hq, reassoc_of% hq]
/-- For each `q`, `P q` is a natural transformation. -/
@[simps]
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
  app X := P q
  naturality _ _ f := by
    induction' q with q hq
    · dsimp [alternatingFaceMapComplex]
      simp only [P_zero, id_comp, comp_id]
    · simp only [P_succ, add_comp, comp_add, assoc, comp_id, hq, reassoc_of% hq]
      

Proof state:
case succ
C : Type u_1
inst✝¹ : Category.{?u.248155, u_1} C
inst✝ : Preadditive C
X x✝¹ x✝ : SimplicialObject C
f : x✝¹ ⟶ x✝
q : ℕ
hq : (alternatingFaceMapComplex C).map f ≫ (fun X => P q) x✝ = (fun X => P q) x✝¹ ≫ (alternatingFaceMapComplex C).map f
⊢ P q ≫ (alternatingFaceMapComplex C).map f + P q ≫ (alternatingFaceMapComplex C).map f ≫ Hσ q =
    P q ≫ (alternatingFaceMapComplex C).map f + P q ≫ Hσ q ≫ (alternatingFaceMapComplex C).map f

Next tactic:
erw [(natTransHσ q).naturality f]
/-- For each `q`, `P q` is a natural transformation. -/
@[simps]
def natTransP (q : ℕ) : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C where
  app X := P q
  naturality _ _ f := by
    induction' q with q hq
    · dsimp [alternatingFaceMapComplex]
      simp only [P_zero, id_comp, comp_id]
    · simp only [P_succ, add_comp, comp_add, assoc, comp_id, hq, reassoc_of% hq]
      erw [(natTransHσ q).naturality f]
      

Proof state:
case succ
C : Type u_1
inst✝¹ : Category.{?u.248155, u_1} C
inst✝ : Preadditive C
X x✝¹ x✝ : SimplicialObject C
f : x✝¹ ⟶ x✝
q : ℕ
hq : (alternatingFaceMapComplex C).map f ≫ (fun X => P q) x✝ = (fun X => P q) x✝¹ ≫ (alternatingFaceMapComplex C).map f
⊢ P q ≫ (alternatingFaceMapComplex C).map f + P q ≫ (natTransHσ q).app x✝¹ ≫ (alternatingFaceMapComplex C).map f =
    P q ≫ (alternatingFaceMapComplex C).map f + P q ≫ Hσ q ≫ (alternatingFaceMapComplex C).map f

Next tactic:
rfl
@[reassoc (attr := simp)]
theorem Q_f_naturality (q n : ℕ) {X Y : SimplicialObject C} (f : X ⟶ Y) :
    f.app (op [n]) ≫ (Q q).f n = (Q q).f n ≫ f.app (op [n]) := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X✝ : SimplicialObject C
q n : ℕ
X Y : SimplicialObject C
f : X ⟶ Y
⊢ f.app (op [n]) ≫ HomologicalComplex.Hom.f (Q q) n = HomologicalComplex.Hom.f (Q q) n ≫ f.app (op [n])

Next tactic:
simp only [Q, HomologicalComplex.sub_f_apply, HomologicalComplex.id_f, comp_sub, P_f_naturality,
    sub_comp, sub_left_inj]
@[reassoc (attr := simp)]
theorem Q_f_naturality (q n : ℕ) {X Y : SimplicialObject C} (f : X ⟶ Y) :
    f.app (op [n]) ≫ (Q q).f n = (Q q).f n ≫ f.app (op [n]) := by
  simp only [Q, HomologicalComplex.sub_f_apply, HomologicalComplex.id_f, comp_sub, P_f_naturality,
    sub_comp, sub_left_inj]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X✝ : SimplicialObject C
q n : ℕ
X Y : SimplicialObject C
f : X ⟶ Y
⊢ f.app (op [n]) ≫ 𝟙 (HomologicalComplex.X K[Y] n) = 𝟙 (HomologicalComplex.X K[X] n) ≫ f.app (op [n])

Next tactic:
dsimp
@[reassoc (attr := simp)]
theorem Q_f_naturality (q n : ℕ) {X Y : SimplicialObject C} (f : X ⟶ Y) :
    f.app (op [n]) ≫ (Q q).f n = (Q q).f n ≫ f.app (op [n]) := by
  simp only [Q, HomologicalComplex.sub_f_apply, HomologicalComplex.id_f, comp_sub, P_f_naturality,
    sub_comp, sub_left_inj]
  dsimp
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : Preadditive C
X✝ : SimplicialObject C
q n : ℕ
X Y : SimplicialObject C
f : X ⟶ Y
⊢ f.app (op [n]) ≫ 𝟙 (Y.obj (op [n])) = 𝟙 (X.obj (op [n])) ≫ f.app (op [n])

Next tactic:
simp only [comp_id, id_comp]
theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
  

Proof state:
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
X✝ : SimplicialObject C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : Functor.Additive G
X : SimplicialObject C
q n : ℕ
⊢ G.map (HomologicalComplex.Hom.f (P q) n) = HomologicalComplex.Hom.f (P q) n

Next tactic:
induction' q with q hq
theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
  induction' q with q hq
  · 

Proof state:
case zero
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
X✝ : SimplicialObject C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : Functor.Additive G
X : SimplicialObject C
n : ℕ
⊢ G.map (HomologicalComplex.Hom.f (P Nat.zero) n) = HomologicalComplex.Hom.f (P Nat.zero) n

Next tactic:
simp only [P_zero]
theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
  induction' q with q hq
  · simp only [P_zero]
    

Proof state:
case zero
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
X✝ : SimplicialObject C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : Functor.Additive G
X : SimplicialObject C
n : ℕ
⊢ G.map (HomologicalComplex.Hom.f (𝟙 K[X]) n) = HomologicalComplex.Hom.f (𝟙 K[((whiskering C D).obj G).obj X]) n

Next tactic:
apply G.map_id
theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
  induction' q with q hq
  · simp only [P_zero]
    apply G.map_id
  · 

Proof state:
case succ
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
X✝ : SimplicialObject C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : Functor.Additive G
X : SimplicialObject C
n q : ℕ
hq : G.map (HomologicalComplex.Hom.f (P q) n) = HomologicalComplex.Hom.f (P q) n
⊢ G.map (HomologicalComplex.Hom.f (P (Nat.succ q)) n) = HomologicalComplex.Hom.f (P (Nat.succ q)) n

Next tactic:
simp only [P_succ, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply,
      comp_id, Functor.map_add, Functor.map_comp, hq, map_Hσ]
theorem map_Q {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((Q q : K[X] ⟶ _).f n) = (Q q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
  

Proof state:
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
X✝ : SimplicialObject C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : Functor.Additive G
X : SimplicialObject C
q n : ℕ
⊢ G.map (HomologicalComplex.Hom.f (Q q) n) = HomologicalComplex.Hom.f (Q q) n

Next tactic:
rw [← add_right_inj (G.map ((P q : K[X] ⟶ _).f n)), ← G.map_add, map_P G X q n, P_add_Q_f,
    P_add_Q_f]
theorem map_Q {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((Q q : K[X] ⟶ _).f n) = (Q q : K[((whiskering C D).obj G).obj X] ⟶ _).f n := by
  rw [← add_right_inj (G.map ((P q : K[X] ⟶ _).f n)), ← G.map_add, map_P G X q n, P_add_Q_f,
    P_add_Q_f]
  

Proof state:
C : Type u_1
inst✝⁴ : Category.{u_4, u_1} C
inst✝³ : Preadditive C
X✝ : SimplicialObject C
D : Type u_2
inst✝² : Category.{u_3, u_2} D
inst✝¹ : Preadditive D
G : C ⥤ D
inst✝ : Functor.Additive G
X : SimplicialObject C
q n : ℕ
⊢ G.map (𝟙 (X.obj (op [n]))) = 𝟙 ((((whiskering C D).obj G).obj X).obj (op [n]))

Next tactic:
apply G.map_id
/-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i :=
  { DFinsupp.equivFunOnFintype with
    toFun := (↑)
    map_add' := fun f g ↦ by
      

Proof state:
R : Type u
inst✝⁵ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁴ : (i : ι) → AddCommMonoid (M i)
inst✝³ : (i : ι) → Module R (M i)
N : Type u₁
inst✝² : AddCommMonoid N
inst✝¹ : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝ : Fintype ι
src✝ : (Π₀ (i : ι), M i) ≃ ((i : ι) → M i) := DFinsupp.equivFunOnFintype
f g : ⨁ (i : ι), M i
⊢ ⇑(f + g) = ⇑f + ⇑g

Next tactic:
ext
/-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i :=
  { DFinsupp.equivFunOnFintype with
    toFun := (↑)
    map_add' := fun f g ↦ by
      ext
      

Proof state:
case h
R : Type u
inst✝⁵ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁴ : (i : ι) → AddCommMonoid (M i)
inst✝³ : (i : ι) → Module R (M i)
N : Type u₁
inst✝² : AddCommMonoid N
inst✝¹ : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝ : Fintype ι
src✝ : (Π₀ (i : ι), M i) ≃ ((i : ι) → M i) := DFinsupp.equivFunOnFintype
f g : ⨁ (i : ι), M i
x✝ : ι
⊢ (f + g) x✝ = (⇑f + ⇑g) x✝

Next tactic:
rw [add_apply, Pi.add_apply]
/-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i :=
  { DFinsupp.equivFunOnFintype with
    toFun := (↑)
    map_add' := fun f g ↦ by
      ext
      rw [add_apply, Pi.add_apply]
    map_smul' := fun c f ↦ by
      

Proof state:
R : Type u
inst✝⁵ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁴ : (i : ι) → AddCommMonoid (M i)
inst✝³ : (i : ι) → Module R (M i)
N : Type u₁
inst✝² : AddCommMonoid N
inst✝¹ : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝ : Fintype ι
src✝ : (Π₀ (i : ι), M i) ≃ ((i : ι) → M i) := DFinsupp.equivFunOnFintype
c : R
f : ⨁ (i : ι), M i
⊢ AddHom.toFun { toFun := FunLike.coe, map_add' := (_ : ∀ (f g : ⨁ (i : ι), M i), ⇑(f + g) = ⇑f + ⇑g) } (c • f) =
    (RingHom.id R) c •
      AddHom.toFun { toFun := FunLike.coe, map_add' := (_ : ∀ (f g : ⨁ (i : ι), M i), ⇑(f + g) = ⇑f + ⇑g) } f

Next tactic:
simp_rw [RingHom.id_apply]
/-- Given `Fintype α`, `linearEquivFunOnFintype R` is the natural `R`-linear equivalence
between `⨁ i, M i` and `∀ i, M i`. -/
@[simps apply]
def linearEquivFunOnFintype [Fintype ι] : (⨁ i, M i) ≃ₗ[R] ∀ i, M i :=
  { DFinsupp.equivFunOnFintype with
    toFun := (↑)
    map_add' := fun f g ↦ by
      ext
      rw [add_apply, Pi.add_apply]
    map_smul' := fun c f ↦ by
      simp_rw [RingHom.id_apply]
      

Proof state:
R : Type u
inst✝⁵ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁴ : (i : ι) → AddCommMonoid (M i)
inst✝³ : (i : ι) → Module R (M i)
N : Type u₁
inst✝² : AddCommMonoid N
inst✝¹ : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝ : Fintype ι
src✝ : (Π₀ (i : ι), M i) ≃ ((i : ι) → M i) := DFinsupp.equivFunOnFintype
c : R
f : ⨁ (i : ι), M i
⊢ ⇑(c • f) = c • ⇑f

Next tactic:
rw [DFinsupp.coe_smul]
@[simp]
theorem linearEquivFunOnFintype_lof [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M) (lof R ι M i m) = Pi.single i m := by
  

Proof state:
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
i : ι
m : M i
⊢ (linearEquivFunOnFintype R ι M) ((lof R ι M i) m) = Pi.single i m

Next tactic:
ext a
@[simp]
theorem linearEquivFunOnFintype_lof [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M) (lof R ι M i m) = Pi.single i m := by
  ext a
  

Proof state:
case h
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
i : ι
m : M i
a : ι
⊢ (linearEquivFunOnFintype R ι M) ((lof R ι M i) m) a = Pi.single i m a

Next tactic:
change (DFinsupp.equivFunOnFintype (lof R ι M i m)) a = _
@[simp]
theorem linearEquivFunOnFintype_lof [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M) (lof R ι M i m) = Pi.single i m := by
  ext a
  change (DFinsupp.equivFunOnFintype (lof R ι M i m)) a = _
  

Proof state:
case h
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
i : ι
m : M i
a : ι
⊢ DFinsupp.equivFunOnFintype ((lof R ι M i) m) a = Pi.single i m a

Next tactic:
convert _root_.congr_fun (DFinsupp.equivFunOnFintype_single i m) a
@[simp]
theorem linearEquivFunOnFintype_symm_single [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M).symm (Pi.single i m) = lof R ι M i m := by
  

Proof state:
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
i : ι
m : M i
⊢ (LinearEquiv.symm (linearEquivFunOnFintype R ι M)) (Pi.single i m) = (lof R ι M i) m

Next tactic:
change (DFinsupp.equivFunOnFintype.symm (Pi.single i m)) = _
@[simp]
theorem linearEquivFunOnFintype_symm_single [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M).symm (Pi.single i m) = lof R ι M i m := by
  change (DFinsupp.equivFunOnFintype.symm (Pi.single i m)) = _
  

Proof state:
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
i : ι
m : M i
⊢ DFinsupp.equivFunOnFintype.symm (Pi.single i m) = (lof R ι M i) m

Next tactic:
rw [DFinsupp.equivFunOnFintype_symm_single i m]
@[simp]
theorem linearEquivFunOnFintype_symm_single [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M).symm (Pi.single i m) = lof R ι M i m := by
  change (DFinsupp.equivFunOnFintype.symm (Pi.single i m)) = _
  rw [DFinsupp.equivFunOnFintype_symm_single i m]
  

Proof state:
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
i : ι
m : M i
⊢ DFinsupp.single i m = (lof R ι M i) m

Next tactic:
rfl
@[simp]
theorem linearEquivFunOnFintype_symm_coe [Fintype ι] (f : ⨁ i, M i) :
    (linearEquivFunOnFintype R ι M).symm f = f := by
  

Proof state:
R : Type u
inst✝⁵ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁴ : (i : ι) → AddCommMonoid (M i)
inst✝³ : (i : ι) → Module R (M i)
N : Type u₁
inst✝² : AddCommMonoid N
inst✝¹ : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
inst✝ : Fintype ι
f : ⨁ (i : ι), M i
⊢ (LinearEquiv.symm (linearEquivFunOnFintype R ι M)) ⇑f = f

Next tactic:
simp [linearEquivFunOnFintype]
theorem ext_iff {f g : ⨁ i, M i} : f = g ↔ ∀ i, component R ι M i f = component R ι M i g :=
  ⟨fun h _ ↦ by 

Proof state:
R : Type u
inst✝⁴ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝³ : (i : ι) → AddCommMonoid (M i)
inst✝² : (i : ι) → Module R (M i)
N : Type u₁
inst✝¹ : AddCommMonoid N
inst✝ : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
f g : ⨁ (i : ι), M i
h : f = g
x✝ : ι
⊢ (component R ι M x✝) f = (component R ι M x✝) g

Next tactic:
rw [h]
/-- `curry` as a linear map. -/
def sigmaLcurry : (⨁ i : Σi, _, δ i.1 i.2) →ₗ[R] ⨁ (i) (j), δ i j :=
  { sigmaCurry with map_smul' := fun r ↦ by 

Proof state:
R : Type u
inst✝⁶ : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : ι → Type w
inst✝⁵ : (i : ι) → AddCommMonoid (M i)
inst✝⁴ : (i : ι) → Module R (M i)
N : Type u₁
inst✝³ : AddCommMonoid N
inst✝² : Module R N
φ : (i : ι) → M i →ₗ[R] N
ψ ψ' : (⨁ (i : ι), M i) →ₗ[R] N
α : ι → Type u_1
δ : (i : ι) → α i → Type w
inst✝¹ : (i : ι) → (j : α i) → AddCommMonoid (δ i j)
inst✝ : (i : ι) → (j : α i) → Module R (δ i j)
src✝ : (⨁ (i : (_i : ι) × α _i), δ i.fst i.snd) →+ ⨁ (i : ι) (j : α i), δ i j := sigmaCurry
r : R
⊢ ∀ (x : ⨁ (i : (i : ι) × α i), δ i.fst i.snd),
    AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ :
              ∀ (x y : ⨁ (i : (_i : ι) × α _i), δ i.fst i.snd),
                ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        (r • x) =
      (RingHom.id R) r •
        AddHom.toFun
          { toFun := src✝.toFun,
            map_add' :=
              (_ :
                ∀ (x y : ⨁ (i : (_i : ι) × α _i), δ i.fst i.snd),
                  ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
          x

Next tactic:
convert DFinsupp.sigmaCurry_smul (δ := δ) r
@[simp]
theorem IsInternal.ofBijective_coeLinearMap_same (h : IsInternal A)
    {i : ι} (x : A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x i = x := by
  

Proof state:
R : Type u
inst✝² : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : Type u_1
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
A : ι → Submodule R M
h : IsInternal A
i : ι
x : ↥(A i)
⊢ ((LinearEquiv.symm (LinearEquiv.ofBijective (coeLinearMap A) h)) ↑x) i = x

Next tactic:
rw [← coeLinearMap_of, LinearEquiv.ofBijective_symm_apply_apply, of_eq_same]
@[simp]
theorem IsInternal.ofBijective_coeLinearMap_of_ne (h : IsInternal A)
    {i j : ι} (hij : i ≠ j) (x : A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x j = 0 := by
  

Proof state:
R : Type u
inst✝² : Semiring R
ι : Type v
dec_ι : DecidableEq ι
M : Type u_1
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
A : ι → Submodule R M
h : IsInternal A
i j : ι
hij : i ≠ j
x : ↥(A i)
⊢ ((LinearEquiv.symm (LinearEquiv.ofBijective (coeLinearMap A) h)) ↑x) j = 0

Next tactic:
rw [← coeLinearMap_of, LinearEquiv.ofBijective_symm_apply_apply, of_eq_of_ne _ i j _ hij]