l3lab/ntp-mathlib huggingface dataset:
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    simp only -- Porting note: added
    rw [decompose_zero]
    rfl
  map_add' _ _ := by
    simp only -- Porting note: added
    rw [decompose_add]
    rfl
  map_mul' := by
    refine' DirectSum.Decomposition.inductionOn 𝒜 (fun x => _) _ _
    · simp only [zero_mul, decompose_zero, zero_apply, ZeroMemClass.coe_zero]
    · rintro i ⟨c, hc⟩
      refine' DirectSum.Decomposition.inductionOn 𝒜 _ _ _
      · simp only [mul_zero, decompose_zero, zero_apply, ZeroMemClass.coe_zero]
      · rintro j ⟨c', hc'⟩
        · simp only [Subtype.coe_mk]
          by_cases h : i + j = 0
          · rw [decompose_of_mem_same 𝒜
                (show c * c' ∈ 𝒜 0 from h ▸ SetLike.GradedMul.mul_mem hc hc'),
              decompose_of_mem_same 𝒜 (show c ∈ 𝒜 0 from (add_eq_zero_iff.mp h).1 ▸ hc),
              decompose_of_mem_same 𝒜 (show c' ∈ 𝒜 0 from (add_eq_zero_iff.mp h).2 ▸ hc')]
          · rw [decompose_of_mem_ne 𝒜 (SetLike.GradedMul.mul_mem hc hc') h]
            cases' show i ≠ 0 ∨ j ≠ 0 by rwa [add_eq_zero_iff, not_and_or] at h with h' h'
            · simp only [decompose_of_mem_ne 𝒜 hc h', zero_mul]
            · simp only [decompose_of_mem_ne 𝒜 hc' h', mul_zero]
      · intro _ _ hd he
        simp only at hd he -- Porting note: added
        simp only [mul_add, decompose_add, add_apply, AddMemClass.coe_add, hd, he]
    · rintro _ _ ha hb _
      simp only at ha hb -- Porting note: added
      

Proof state:
case refine'_3
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
m✝ m'✝ : A
ha : ∀ (y : A), ↑(((decompose 𝒜) (m✝ * y)) 0) = ↑(((decompose 𝒜) m✝) 0) * ↑(((decompose 𝒜) y) 0)
hb : ∀ (y : A), ↑(((decompose 𝒜) (m'✝ * y)) 0) = ↑(((decompose 𝒜) m'✝) 0) * ↑(((decompose 𝒜) y) 0)
y✝ : A
⊢ OneHom.toFun { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) }
      ((m✝ + m'✝) * y✝) =
    OneHom.toFun { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } (m✝ + m'✝) *
      OneHom.toFun { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } y✝

Next tactic:
simp only [add_mul, decompose_add, add_apply, AddMemClass.coe_add, ha, hb]
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) },
          map_mul' :=
            (_ :
              ∀ (m y : A),
                OneHom.toFun { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) }
                    (m * y) =
                  OneHom.toFun
                      { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } m *
                    OneHom.toFun
                      { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } y) })
      0 =
    0

Next tactic:
simp only
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    simp only -- Porting note: added
    

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
⊢ ↑(((decompose 𝒜) 0) 0) = 0

Next tactic:
rw [decompose_zero]
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    simp only -- Porting note: added
    rw [decompose_zero]
    

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
⊢ ↑(0 0) = 0

Next tactic:
rfl
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    simp only -- Porting note: added
    rw [decompose_zero]
    rfl
  map_add' _ _ := by
    

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
x✝¹ x✝ : A
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) },
          map_mul' :=
            (_ :
              ∀ (m y : A),
                OneHom.toFun { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) }
                    (m * y) =
                  OneHom.toFun
                      { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } m *
                    OneHom.toFun
                      { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } y) })
      (x✝¹ + x✝) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) },
            map_mul' :=
              (_ :
                ∀ (m y : A),
                  OneHom.toFun
                      { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) }
                      (m * y) =
                    OneHom.toFun
                        { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } m *
                      OneHom.toFun
                        { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } y) })
        x✝¹ +
      OneHom.toFun
        (↑{ toOneHom := { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) },
            map_mul' :=
              (_ :
                ∀ (m y : A),
                  OneHom.toFun
                      { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) }
                      (m * y) =
                    OneHom.toFun
                        { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } m *
                      OneHom.toFun
                        { toFun := fun a => ↑(((decompose 𝒜) a) 0), map_one' := (_ : ↑(((decompose 𝒜) 1) 0) = 1) } y) })
        x✝

Next tactic:
simp only
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    simp only -- Porting note: added
    rw [decompose_zero]
    rfl
  map_add' _ _ := by
    simp only -- Porting note: added
    

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
x✝¹ x✝ : A
⊢ ↑(((decompose 𝒜) (x✝¹ + x✝)) 0) = ↑(((decompose 𝒜) x✝¹) 0) + ↑(((decompose 𝒜) x✝) 0)

Next tactic:
rw [decompose_add]
/-- If `A` is graded by a canonically ordered add monoid, then the projection map `x ↦ x₀` is a ring
homomorphism.
-/
@[simps]
def GradedRing.projZeroRingHom : A →+* A where
  toFun a := decompose 𝒜 a 0
  map_one' :=
    -- Porting note: qualified `one_mem`
    decompose_of_mem_same 𝒜 SetLike.GradedOne.one_mem
  map_zero' := by
    simp only -- Porting note: added
    rw [decompose_zero]
    rfl
  map_add' _ _ := by
    simp only -- Porting note: added
    rw [decompose_add]
    

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
x✝¹ x✝ : A
⊢ ↑(((decompose 𝒜) x✝¹ + (decompose 𝒜) x✝) 0) = ↑(((decompose 𝒜) x✝¹) 0) + ↑(((decompose 𝒜) x✝) 0)

Next tactic:
rfl
theorem coe_decompose_mul_of_left_mem_of_not_le (a_mem : a ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0 := by
  

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
a b : A
n i : ι
a_mem : a ∈ 𝒜 i
h : ¬i ≤ n
⊢ ↑(((decompose 𝒜) (a * b)) n) = 0

Next tactic:
lift a to 𝒜 i using a_mem
theorem coe_decompose_mul_of_left_mem_of_not_le (a_mem : a ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0 := by
  lift a to 𝒜 i using a_mem
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
b : A
n i : ι
h : ¬i ≤ n
a : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (↑a * b)) n) = 0

Next tactic:
rwa [decompose_mul, decompose_coe, coe_of_mul_apply_of_not_le]
theorem coe_decompose_mul_of_right_mem_of_not_le (b_mem : b ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0 := by
  

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
a b : A
n i : ι
b_mem : b ∈ 𝒜 i
h : ¬i ≤ n
⊢ ↑(((decompose 𝒜) (a * b)) n) = 0

Next tactic:
lift b to 𝒜 i using b_mem
theorem coe_decompose_mul_of_right_mem_of_not_le (b_mem : b ∈ 𝒜 i) (h : ¬i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = 0 := by
  lift b to 𝒜 i using b_mem
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁵ : Semiring A
inst✝⁴ : DecidableEq ι
inst✝³ : CanonicallyOrderedAddCommMonoid ι
inst✝² : SetLike σ A
inst✝¹ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝ : GradedRing 𝒜
a : A
n i : ι
h : ¬i ≤ n
b : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (a * ↑b)) n) = 0

Next tactic:
rwa [decompose_mul, decompose_coe, coe_mul_of_apply_of_not_le]
theorem coe_decompose_mul_of_left_mem_of_le (a_mem : a ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = a * decompose 𝒜 b (n - i) := by
  

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁸ : Semiring A
inst✝⁷ : DecidableEq ι
inst✝⁶ : CanonicallyOrderedAddCommMonoid ι
inst✝⁵ : SetLike σ A
inst✝⁴ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝³ : GradedRing 𝒜
a b : A
n i : ι
inst✝² : Sub ι
inst✝¹ : OrderedSub ι
inst✝ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a_mem : a ∈ 𝒜 i
h : i ≤ n
⊢ ↑(((decompose 𝒜) (a * b)) n) = a * ↑(((decompose 𝒜) b) (n - i))

Next tactic:
lift a to 𝒜 i using a_mem
theorem coe_decompose_mul_of_left_mem_of_le (a_mem : a ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = a * decompose 𝒜 b (n - i) := by
  lift a to 𝒜 i using a_mem
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁸ : Semiring A
inst✝⁷ : DecidableEq ι
inst✝⁶ : CanonicallyOrderedAddCommMonoid ι
inst✝⁵ : SetLike σ A
inst✝⁴ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝³ : GradedRing 𝒜
b : A
n i : ι
inst✝² : Sub ι
inst✝¹ : OrderedSub ι
inst✝ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
h : i ≤ n
a : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (↑a * b)) n) = ↑a * ↑(((decompose 𝒜) b) (n - i))

Next tactic:
rwa [decompose_mul, decompose_coe, coe_of_mul_apply_of_le]
theorem coe_decompose_mul_of_right_mem_of_le (b_mem : b ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = decompose 𝒜 a (n - i) * b := by
  

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁸ : Semiring A
inst✝⁷ : DecidableEq ι
inst✝⁶ : CanonicallyOrderedAddCommMonoid ι
inst✝⁵ : SetLike σ A
inst✝⁴ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝³ : GradedRing 𝒜
a b : A
n i : ι
inst✝² : Sub ι
inst✝¹ : OrderedSub ι
inst✝ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
b_mem : b ∈ 𝒜 i
h : i ≤ n
⊢ ↑(((decompose 𝒜) (a * b)) n) = ↑(((decompose 𝒜) a) (n - i)) * b

Next tactic:
lift b to 𝒜 i using b_mem
theorem coe_decompose_mul_of_right_mem_of_le (b_mem : b ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = decompose 𝒜 a (n - i) * b := by
  lift b to 𝒜 i using b_mem
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁸ : Semiring A
inst✝⁷ : DecidableEq ι
inst✝⁶ : CanonicallyOrderedAddCommMonoid ι
inst✝⁵ : SetLike σ A
inst✝⁴ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝³ : GradedRing 𝒜
a : A
n i : ι
inst✝² : Sub ι
inst✝¹ : OrderedSub ι
inst✝ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
h : i ≤ n
b : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (a * ↑b)) n) = ↑(((decompose 𝒜) a) (n - i)) * ↑b

Next tactic:
rwa [decompose_mul, decompose_coe, coe_mul_of_apply_of_le]
theorem coe_decompose_mul_of_left_mem (n) [Decidable (i ≤ n)] (a_mem : a ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then a * decompose 𝒜 b (n - i) else 0 := by
  

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁹ : Semiring A
inst✝⁸ : DecidableEq ι
inst✝⁷ : CanonicallyOrderedAddCommMonoid ι
inst✝⁶ : SetLike σ A
inst✝⁵ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝⁴ : GradedRing 𝒜
a b : A
n✝ i : ι
inst✝³ : Sub ι
inst✝² : OrderedSub ι
inst✝¹ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
n : ι
inst✝ : Decidable (i ≤ n)
a_mem : a ∈ 𝒜 i
⊢ ↑(((decompose 𝒜) (a * b)) n) = if i ≤ n then a * ↑(((decompose 𝒜) b) (n - i)) else 0

Next tactic:
lift a to 𝒜 i using a_mem
theorem coe_decompose_mul_of_left_mem (n) [Decidable (i ≤ n)] (a_mem : a ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then a * decompose 𝒜 b (n - i) else 0 := by
  lift a to 𝒜 i using a_mem
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁹ : Semiring A
inst✝⁸ : DecidableEq ι
inst✝⁷ : CanonicallyOrderedAddCommMonoid ι
inst✝⁶ : SetLike σ A
inst✝⁵ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝⁴ : GradedRing 𝒜
b : A
n✝ i : ι
inst✝³ : Sub ι
inst✝² : OrderedSub ι
inst✝¹ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
n : ι
inst✝ : Decidable (i ≤ n)
a : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (↑a * b)) n) = if i ≤ n then ↑a * ↑(((decompose 𝒜) b) (n - i)) else 0

Next tactic:
rw [decompose_mul, decompose_coe, coe_of_mul_apply]
theorem coe_decompose_mul_of_right_mem (n) [Decidable (i ≤ n)] (b_mem : b ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then decompose 𝒜 a (n - i) * b else 0 := by
  

Proof state:
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁹ : Semiring A
inst✝⁸ : DecidableEq ι
inst✝⁷ : CanonicallyOrderedAddCommMonoid ι
inst✝⁶ : SetLike σ A
inst✝⁵ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝⁴ : GradedRing 𝒜
a b : A
n✝ i : ι
inst✝³ : Sub ι
inst✝² : OrderedSub ι
inst✝¹ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
n : ι
inst✝ : Decidable (i ≤ n)
b_mem : b ∈ 𝒜 i
⊢ ↑(((decompose 𝒜) (a * b)) n) = if i ≤ n then ↑(((decompose 𝒜) a) (n - i)) * b else 0

Next tactic:
lift b to 𝒜 i using b_mem
theorem coe_decompose_mul_of_right_mem (n) [Decidable (i ≤ n)] (b_mem : b ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then decompose 𝒜 a (n - i) * b else 0 := by
  lift b to 𝒜 i using b_mem
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
A : Type u_3
σ : Type u_4
inst✝⁹ : Semiring A
inst✝⁸ : DecidableEq ι
inst✝⁷ : CanonicallyOrderedAddCommMonoid ι
inst✝⁶ : SetLike σ A
inst✝⁵ : AddSubmonoidClass σ A
𝒜 : ι → σ
inst✝⁴ : GradedRing 𝒜
a : A
n✝ i : ι
inst✝³ : Sub ι
inst✝² : OrderedSub ι
inst✝¹ : ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
n : ι
inst✝ : Decidable (i ≤ n)
b : ↥(𝒜 i)
⊢ ↑(((decompose 𝒜) (a * ↑b)) n) = if i ≤ n then ↑(((decompose 𝒜) a) (n - i)) * ↑b else 0

Next tactic:
rw [decompose_mul, decompose_coe, coe_mul_of_apply]
theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
    (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : f ≤ᵐ[μ.restrict s] g) :
    μ.prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ) := by
  

Proof state:
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
f_int : IntegrableOn f s
g_int : IntegrableOn g s
hs : MeasurableSet s
hfg : f ≤ᶠ[ae (Measure.restrict μ s)] g
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ENNReal.ofReal (∫ (y : α) in s, (g - f) y ∂μ)

Next tactic:
have h : g - f =ᵐ[μ.restrict s] fun x => Real.toNNReal (g x - f x) :=
    hfg.mono fun x hx => (Real.coe_toNNReal _ <| sub_nonneg.2 hx).symm
theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
    (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : f ≤ᵐ[μ.restrict s] g) :
    μ.prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ) := by
  have h : g - f =ᵐ[μ.restrict s] fun x => Real.toNNReal (g x - f x) :=
    hfg.mono fun x hx => (Real.coe_toNNReal _ <| sub_nonneg.2 hx).symm
  

Proof state:
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
f_int : IntegrableOn f s
g_int : IntegrableOn g s
hs : MeasurableSet s
hfg : f ≤ᶠ[ae (Measure.restrict μ s)] g
h : g - f =ᶠ[ae (Measure.restrict μ s)] fun x => ↑(Real.toNNReal (g x - f x))
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ENNReal.ofReal (∫ (y : α) in s, (g - f) y ∂μ)

Next tactic:
rw [volume_regionBetween_eq_lintegral f_int.aemeasurable g_int.aemeasurable hs,
    integral_congr_ae h, lintegral_congr_ae,
    lintegral_coe_eq_integral _ ((integrable_congr h).mp (g_int.sub f_int))]
theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
    (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : f ≤ᵐ[μ.restrict s] g) :
    μ.prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ) := by
  have h : g - f =ᵐ[μ.restrict s] fun x => Real.toNNReal (g x - f x) :=
    hfg.mono fun x hx => (Real.coe_toNNReal _ <| sub_nonneg.2 hx).symm
  rw [volume_regionBetween_eq_lintegral f_int.aemeasurable g_int.aemeasurable hs,
    integral_congr_ae h, lintegral_congr_ae,
    lintegral_coe_eq_integral _ ((integrable_congr h).mp (g_int.sub f_int))]
  

Proof state:
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
f_int : IntegrableOn f s
g_int : IntegrableOn g s
hs : MeasurableSet s
hfg : f ≤ᶠ[ae (Measure.restrict μ s)] g
h : g - f =ᶠ[ae (Measure.restrict μ s)] fun x => ↑(Real.toNNReal (g x - f x))
⊢ (fun y => ENNReal.ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun a => ↑(Real.toNNReal (g a - f a))

Next tactic:
dsimp only
theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
    (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : f ≤ᵐ[μ.restrict s] g) :
    μ.prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ) := by
  have h : g - f =ᵐ[μ.restrict s] fun x => Real.toNNReal (g x - f x) :=
    hfg.mono fun x hx => (Real.coe_toNNReal _ <| sub_nonneg.2 hx).symm
  rw [volume_regionBetween_eq_lintegral f_int.aemeasurable g_int.aemeasurable hs,
    integral_congr_ae h, lintegral_congr_ae,
    lintegral_coe_eq_integral _ ((integrable_congr h).mp (g_int.sub f_int))]
  dsimp only
  

Proof state:
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
f_int : IntegrableOn f s
g_int : IntegrableOn g s
hs : MeasurableSet s
hfg : f ≤ᶠ[ae (Measure.restrict μ s)] g
h : g - f =ᶠ[ae (Measure.restrict μ s)] fun x => ↑(Real.toNNReal (g x - f x))
⊢ (fun y => ENNReal.ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun a => ↑(Real.toNNReal (g a - f a))

Next tactic:
rfl
/-- If the sequence with `n`-th term the the sup norm of `λ x, f (x + n)` on the interval `Icc 0 1`,
for `n ∈ ℤ`, is summable, then `f` is integrable on `ℝ`. -/
theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E] {f : C(ℝ, E)}
    (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
    Integrable f := by
  

Proof state:
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
hf : Summable fun n => ‖ContinuousMap.restrict (Icc 0 1) (comp f (ContinuousMap.addRight ↑n))‖
⊢ Integrable ⇑f

Next tactic:
refine'
    @integrable_of_summable_norm_restrict ℝ ℤ E _ volume _ _ _ _ _ _ _ _
      (.of_nonneg_of_le
        (fun n : ℤ => mul_nonneg (norm_nonneg
            (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
            ENNReal.toReal_nonneg)
        (fun n => _) hf) _
/-- If the sequence with `n`-th term the the sup norm of `λ x, f (x + n)` on the interval `Icc 0 1`,
for `n ∈ ℤ`, is summable, then `f` is integrable on `ℝ`. -/
theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E] {f : C(ℝ, E)}
    (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
    Integrable f := by
  refine'
    @integrable_of_summable_norm_restrict ℝ ℤ E _ volume _ _ _ _ _ _ _ _
      (.of_nonneg_of_le
        (fun n : ℤ => mul_nonneg (norm_nonneg
            (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
            ENNReal.toReal_nonneg)
        (fun n => _) hf) _
  -- porting note: `refine` was able to find that on its own before
  · 

Proof state:
case refine'_1
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
hf : Summable fun n => ‖ContinuousMap.restrict (Icc 0 1) (comp f (ContinuousMap.addRight ↑n))‖
⊢ ℤ → Compacts ℝ

Next tactic:
intro n
/-- If the sequence with `n`-th term the the sup norm of `λ x, f (x + n)` on the interval `Icc 0 1`,
for `n ∈ ℤ`, is summable, then `f` is integrable on `ℝ`. -/
theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E] {f : C(ℝ, E)}
    (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
    Integrable f := by
  refine'
    @integrable_of_summable_norm_restrict ℝ ℤ E _ volume _ _ _ _ _ _ _ _
      (.of_nonneg_of_le
        (fun n : ℤ => mul_nonneg (norm_nonneg
            (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
            ENNReal.toReal_nonneg)
        (fun n => _) hf) _
  -- porting note: `refine` was able to find that on its own before
  · intro n
    

Proof state:
case refine'_1
E : Type u_1
inst✝ : NormedAddCommGroup E
f : C(ℝ, E)
hf : Summable fun n => ‖ContinuousMap.restrict (Icc 0 1) (comp f (ContinuousMap.addRight ↑n))‖
n : ℤ
⊢ Compacts ℝ

Next tactic:
exact ⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩