l3lab/ntp-mathlib huggingface dataset:
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
    · 

Proof state:
case h.refine'_2.intro.intro.intro.inl.inl.inl
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
t : Set α
h : t ∈ s
⊢ t ∈ {t | GenerateMeasurable s t}

Next tactic:
exact .basic t h
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
    · exact .basic t h
    · 

Proof state:
case h.refine'_2.intro.intro.intro.inl.inl.inr
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
⊢ ∅ ∈ {t | GenerateMeasurable s t}

Next tactic:
exact .empty
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
    · exact .basic t h
    · exact .empty
    · 

Proof state:
case h.refine'_2.intro.intro.intro.inl.inr.intro.intro.intro.intro.intro.mk
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
u : Set α
k : (Quotient.out (ord (aleph 1))).α
hk : k ∈ Iio j
hu : u ∈ (fun j_1 => generateMeasurableRec s ↑j_1) { val := k, property := hk }
⊢ uᶜ ∈ {t | GenerateMeasurable s t}

Next tactic:
exact .compl u (H k hk u hu)
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
    · exact .basic t h
    · exact .empty
    · exact .compl u (H k hk u hu)
    · 

Proof state:
case h.refine'_2.intro.intro.intro.inr.intro
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
f : ℕ → ↑(⋃ j_1, generateMeasurableRec s ↑j_1)
⊢ (fun f => ⋃ n, ↑(f n)) f ∈ {t | GenerateMeasurable s t}

Next tactic:
refine .iUnion _ @fun n => ?_
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
    · exact .basic t h
    · exact .empty
    · exact .compl u (H k hk u hu)
    · refine .iUnion _ @fun n => ?_
      

Proof state:
case h.refine'_2.intro.intro.intro.inr.intro
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
f : ℕ → ↑(⋃ j_1, generateMeasurableRec s ↑j_1)
n : ℕ
⊢ GenerateMeasurable s ↑(f n)

Next tactic:
obtain ⟨-, ⟨⟨k, hk⟩, rfl⟩, hf⟩ := (f n).prop
/-- `generateMeasurableRec s` generates precisely the smallest sigma-algebra containing `s`. -/
theorem generateMeasurable_eq_rec (s : Set (Set α)) :
    { t | GenerateMeasurable s t } =
        ⋃ (i : (Quotient.out (aleph 1).ord).α), generateMeasurableRec s i := by
  ext t; refine' ⟨fun ht => _, fun ht => _⟩
  · inhabit ω₁
    induction' ht with u hu u _ IH f _ IH
    · exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩
    · exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩
    · rcases mem_iUnion.1 IH with ⟨i, hi⟩
      obtain ⟨j, hj⟩ := exists_gt i
      exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩
    · have : ∀ n, ∃ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n
      choose I hI using this
      have : IsWellOrder (ω₁ : Type u) (· < ·) := isWellOrder_out_lt _
      refine' mem_iUnion.2
        ⟨Ordinal.enum (· < ·) (Ordinal.lsub fun n => Ordinal.typein.{u} (· < ·) (I n)) _,
          iUnion_mem_generateMeasurableRec fun n => ⟨I n, _, hI n⟩⟩
      · rw [Ordinal.type_lt]
        refine' Ordinal.lsub_lt_ord_lift _ fun i => Ordinal.typein_lt_self _
        rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq]
        exact aleph0_lt_aleph_one
      · rw [← Ordinal.typein_lt_typein (· < ·), Ordinal.typein_enum]
        apply Ordinal.lt_lsub fun n : ℕ => _
  · rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩
    revert t
    apply (aleph 1).ord.out.wo.wf.induction i
    intro j H t ht
    unfold generateMeasurableRec at ht
    rcases ht with (((h | (rfl : t = ∅)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩)
    · exact .basic t h
    · exact .empty
    · exact .compl u (H k hk u hu)
    · refine .iUnion _ @fun n => ?_
      obtain ⟨-, ⟨⟨k, hk⟩, rfl⟩, hf⟩ := (f n).prop
      

Proof state:
case h.refine'_2.intro.intro.intro.inr.intro.intro.intro.intro.mk
α : Type u
s : Set (Set α)
i j : (Quotient.out (ord (aleph 1))).α
H :
  ∀ (y : (Quotient.out (ord (aleph 1))).α),
    WellOrder.r (Quotient.out (ord (aleph 1))) y j →
      ∀ t ∈ (fun i => generateMeasurableRec s i) y, t ∈ {t | GenerateMeasurable s t}
f : ℕ → ↑(⋃ j_1, generateMeasurableRec s ↑j_1)
n : ℕ
k : (Quotient.out (ord (aleph 1))).α
hk : k ∈ Iio j
hf : ↑(f n) ∈ (fun j_1 => generateMeasurableRec s ↑j_1) { val := k, property := hk }
⊢ GenerateMeasurable s ↑(f n)

Next tactic:
exact H k hk _ hf
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
  

Proof state:
α : Type u
s : Set (Set α)
⊢ #↑{t | GenerateMeasurable s t} ≤ max (#↑s) 2 ^ ℵ₀

Next tactic:
rw [generateMeasurable_eq_rec]
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
  rw [generateMeasurable_eq_rec]
  

Proof state:
α : Type u
s : Set (Set α)
⊢ #↑(⋃ i, generateMeasurableRec s i) ≤ max (#↑s) 2 ^ ℵ₀

Next tactic:
apply (mk_iUnion_le _).trans
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
  rw [generateMeasurable_eq_rec]
  apply (mk_iUnion_le _).trans
  

Proof state:
α : Type u
s : Set (Set α)
⊢ #(Quotient.out (ord (aleph 1))).α * ⨆ i, #↑(generateMeasurableRec s i) ≤ max (#↑s) 2 ^ ℵ₀

Next tactic:
rw [(aleph 1).mk_ord_out]
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
  rw [generateMeasurable_eq_rec]
  apply (mk_iUnion_le _).trans
  rw [(aleph 1).mk_ord_out]
  

Proof state:
α : Type u
s : Set (Set α)
⊢ aleph 1 * ⨆ i, #↑(generateMeasurableRec s i) ≤ max (#↑s) 2 ^ ℵ₀

Next tactic:
refine le_trans (mul_le_mul' aleph_one_le_continuum
      (ciSup_le' fun i => cardinal_generateMeasurableRec_le s i)) ?_
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
  rw [generateMeasurable_eq_rec]
  apply (mk_iUnion_le _).trans
  rw [(aleph 1).mk_ord_out]
  refine le_trans (mul_le_mul' aleph_one_le_continuum
      (ciSup_le' fun i => cardinal_generateMeasurableRec_le s i)) ?_
  

Proof state:
α : Type u
s : Set (Set α)
⊢ 𝔠 * max (#↑s) 2 ^ ℵ₀ ≤ max (#↑s) 2 ^ ℵ₀

Next tactic:
refine (mul_le_max_of_aleph0_le_left aleph0_le_continuum).trans (max_le ?_ le_rfl)
/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u} := by
  rw [generateMeasurable_eq_rec]
  apply (mk_iUnion_le _).trans
  rw [(aleph 1).mk_ord_out]
  refine le_trans (mul_le_mul' aleph_one_le_continuum
      (ciSup_le' fun i => cardinal_generateMeasurableRec_le s i)) ?_
  refine (mul_le_max_of_aleph0_le_left aleph0_le_continuum).trans (max_le ?_ le_rfl)
  

Proof state:
α : Type u
s : Set (Set α)
⊢ 𝔠 ≤ max (#↑s) 2 ^ ℵ₀

Next tactic:
exact power_le_power_right (le_max_right _ _)
/-- If a sigma-algebra is generated by a set of sets `s` with cardinality at most the continuum,
then the sigma algebra has the same cardinality bound. -/
theorem cardinal_generateMeasurable_le_continuum {s : Set (Set α)} (hs : #s ≤ 𝔠) :
    #{ t | GenerateMeasurable s t } ≤ 𝔠 :=
  (cardinal_generateMeasurable_le s).trans
    (by
      

Proof state:
α : Type u
s : Set (Set α)
hs : #↑s ≤ 𝔠
⊢ max (#↑s) 2 ^ ℵ₀ ≤ 𝔠

Next tactic:
rw [← continuum_power_aleph0]
/-- If a sigma-algebra is generated by a set of sets `s` with cardinality at most the continuum,
then the sigma algebra has the same cardinality bound. -/
theorem cardinal_generateMeasurable_le_continuum {s : Set (Set α)} (hs : #s ≤ 𝔠) :
    #{ t | GenerateMeasurable s t } ≤ 𝔠 :=
  (cardinal_generateMeasurable_le s).trans
    (by
      rw [← continuum_power_aleph0]
      

Proof state:
α : Type u
s : Set (Set α)
hs : #↑s ≤ 𝔠
⊢ max (#↑s) 2 ^ ℵ₀ ≤ 𝔠 ^ ℵ₀

Next tactic:
exact mod_cast power_le_power_right (max_le hs (nat_lt_continuum 2).le)
@[simp]
theorem piQuotientLift_mk [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (x : ∀ i, Ms i) :
    (piQuotientLift p q f hf fun i => Quotient.mk (x i)) = Quotient.mk (lsum _ _ R f x) := by
  

Proof state:
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
x : (i : ι) → Ms i
⊢ ((piQuotientLift p q f hf) fun i => Quotient.mk (x i)) = Quotient.mk (((lsum R (fun i => Ms i) R) f) x)

Next tactic:
rw [piQuotientLift, lsum_apply, sum_apply, ← mkQ_apply, lsum_apply, sum_apply, _root_.map_sum]
@[simp]
theorem piQuotientLift_mk [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (x : ∀ i, Ms i) :
    (piQuotientLift p q f hf fun i => Quotient.mk (x i)) = Quotient.mk (lsum _ _ R f x) := by
  rw [piQuotientLift, lsum_apply, sum_apply, ← mkQ_apply, lsum_apply, sum_apply, _root_.map_sum]
  

Proof state:
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
x : (i : ι) → Ms i
⊢ (Finset.sum Finset.univ fun d =>
      (mapQ (p d) q (f d) (_ : p d ≤ comap (f d) q) ∘ₗ proj d) fun i => Quotient.mk (x i)) =
    Finset.sum Finset.univ fun x_1 => (mkQ q) ((f x_1 ∘ₗ proj x_1) x)

Next tactic:
simp only [coe_proj, mapQ_apply, mkQ_apply, comp_apply]
@[simp]
theorem piQuotientLift_single [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (i)
    (x : Ms i ⧸ p i) : piQuotientLift p q f hf (Pi.single i x) = mapQ _ _ (f i) (hf i) x := by
  

Proof state:
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
i : ι
x : Ms i ⧸ p i
⊢ (piQuotientLift p q f hf) (Pi.single i x) = (mapQ (p i) q (f i) (_ : p i ≤ comap (f i) q)) x

Next tactic:
simp_rw [piQuotientLift, lsum_apply, sum_apply, comp_apply, proj_apply]
@[simp]
theorem piQuotientLift_single [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (i)
    (x : Ms i ⧸ p i) : piQuotientLift p q f hf (Pi.single i x) = mapQ _ _ (f i) (hf i) x := by
  simp_rw [piQuotientLift, lsum_apply, sum_apply, comp_apply, proj_apply]
  

Proof state:
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
i : ι
x : Ms i ⧸ p i
⊢ (Finset.sum Finset.univ fun x_1 => (mapQ (p x_1) q (f x_1) (_ : p x_1 ≤ comap (f x_1) q)) (Pi.single i x x_1)) =
    (mapQ (p i) q (f i) (_ : p i ≤ comap (f i) q)) x

Next tactic:
rw [Finset.sum_eq_single i]
@[simp]
theorem piQuotientLift_single [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (i)
    (x : Ms i ⧸ p i) : piQuotientLift p q f hf (Pi.single i x) = mapQ _ _ (f i) (hf i) x := by
  simp_rw [piQuotientLift, lsum_apply, sum_apply, comp_apply, proj_apply]
  rw [Finset.sum_eq_single i]
  · 

Proof state:
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
i : ι
x : Ms i ⧸ p i
⊢ (mapQ (p i) q (f i) (_ : p i ≤ comap (f i) q)) (Pi.single i x i) = (mapQ (p i) q (f i) (_ : p i ≤ comap (f i) q)) x

Next tactic:
rw [Pi.single_eq_same]
@[simp]
theorem piQuotientLift_single [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (i)
    (x : Ms i ⧸ p i) : piQuotientLift p q f hf (Pi.single i x) = mapQ _ _ (f i) (hf i) x := by
  simp_rw [piQuotientLift, lsum_apply, sum_apply, comp_apply, proj_apply]
  rw [Finset.sum_eq_single i]
  · rw [Pi.single_eq_same]
  · 

Proof state:
case h₀
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
i : ι
x : Ms i ⧸ p i
⊢ ∀ b ∈ Finset.univ, b ≠ i → (mapQ (p b) q (f b) (_ : p b ≤ comap (f b) q)) (Pi.single i x b) = 0

Next tactic:
rintro j - hj
@[simp]
theorem piQuotientLift_single [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (i)
    (x : Ms i ⧸ p i) : piQuotientLift p q f hf (Pi.single i x) = mapQ _ _ (f i) (hf i) x := by
  simp_rw [piQuotientLift, lsum_apply, sum_apply, comp_apply, proj_apply]
  rw [Finset.sum_eq_single i]
  · rw [Pi.single_eq_same]
  · rintro j - hj
    

Proof state:
case h₀
ι : Type u_1
R : Type u_2
inst✝⁸ : CommRing R
Ms : ι → Type u_3
inst✝⁷ : (i : ι) → AddCommGroup (Ms i)
inst✝⁶ : (i : ι) → Module R (Ms i)
N : Type u_4
inst✝⁵ : AddCommGroup N
inst✝⁴ : Module R N
Ns : ι → Type u_5
inst✝³ : (i : ι) → AddCommGroup (Ns i)
inst✝² : (i : ι) → Module R (Ns i)
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
p : (i : ι) → Submodule R (Ms i)
q : Submodule R N
f : (i : ι) → Ms i →ₗ[R] N
hf : ∀ (i : ι), p i ≤ comap (f i) q
i : ι
x : Ms i ⧸ p i
j : ι
hj : j ≠ i
⊢ (mapQ (p j) q (f j) (_ : p j ≤ comap (f j) q)) (Pi.single i x j) = 0

Next tactic:
rw [Pi.single_eq_of_ne hj, _root_.map_zero]