l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      

Proof state:
case intro.intro.intro
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
suffices C = 1 by rwa [this, one_smul] at hC
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      suffices C = 1 by 

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝¹ : IsHaarMeasure (map (⇑f) μ)
this✝ : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
this : C = 1
⊢ map (fun g => g ^ n) μ = μ

Next tactic:
rwa [this, one_smul] at hC
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      suffices C = 1 by rwa [this, one_smul] at hC
      

Proof state:
case intro.intro.intro
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
⊢ C = 1

Next tactic:
have h_univ : (μ.map f) univ = μ univ := by
        rw [map_apply_of_aemeasurable hf.measurable.aemeasurable MeasurableSet.univ,
          preimage_univ]
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      suffices C = 1 by rwa [this, one_smul] at hC
      have h_univ : (μ.map f) univ = μ univ := by
        

Proof state:
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
⊢ ↑↑(map (⇑f) μ) univ = ↑↑μ univ

Next tactic:
rw [map_apply_of_aemeasurable hf.measurable.aemeasurable MeasurableSet.univ,
          preimage_univ]
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      suffices C = 1 by rwa [this, one_smul] at hC
      have h_univ : (μ.map f) univ = μ univ := by
        rw [map_apply_of_aemeasurable hf.measurable.aemeasurable MeasurableSet.univ,
          preimage_univ]
      

Proof state:
case intro.intro.intro
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
h_univ : ↑↑(map (⇑f) μ) univ = ↑↑μ univ
⊢ C = 1

Next tactic:
have hμ₀ : μ univ ≠ 0 := IsOpenPosMeasure.open_pos univ isOpen_univ univ_nonempty
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      suffices C = 1 by rwa [this, one_smul] at hC
      have h_univ : (μ.map f) univ = μ univ := by
        rw [map_apply_of_aemeasurable hf.measurable.aemeasurable MeasurableSet.univ,
          preimage_univ]
      have hμ₀ : μ univ ≠ 0 := IsOpenPosMeasure.open_pos univ isOpen_univ univ_nonempty
      

Proof state:
case intro.intro.intro
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
h_univ : ↑↑(map (⇑f) μ) univ = ↑↑μ univ
hμ₀ : ↑↑μ univ ≠ 0
⊢ C = 1

Next tactic:
have hμ₁ : μ univ ≠ ∞ := CompactSpace.isFiniteMeasure.measure_univ_lt_top.ne
@[to_additive]
theorem measurePreserving_zpow [CompactSpace G] [RootableBy G ℤ]
    [InnerRegularCompactLTTop μ] {n : ℤ} (hn : n ≠ 0) :
    MeasurePreserving (fun g : G => g ^ n) μ μ :=
  { measurable := (continuous_zpow n).measurable
    map_eq := by
      let f := @zpowGroupHom G _ n
      have hf : Continuous f := continuous_zpow n
      have : (μ.map f).IsHaarMeasure :=
        isHaarMeasure_map_of_isFiniteMeasure μ f hf (RootableBy.surjective_pow G ℤ hn)
      have : InnerRegular (μ.map f) := InnerRegular.map_of_continuous hf
      obtain ⟨C, -, -, hC⟩ := isHaarMeasure_eq_smul_of_innerRegular (μ.map f) μ
      suffices C = 1 by rwa [this, one_smul] at hC
      have h_univ : (μ.map f) univ = μ univ := by
        rw [map_apply_of_aemeasurable hf.measurable.aemeasurable MeasurableSet.univ,
          preimage_univ]
      have hμ₀ : μ univ ≠ 0 := IsOpenPosMeasure.open_pos univ isOpen_univ univ_nonempty
      have hμ₁ : μ univ ≠ ∞ := CompactSpace.isFiniteMeasure.measure_univ_lt_top.ne
      

Proof state:
case intro.intro.intro
G : Type u_1
inst✝⁸ : CommGroup G
inst✝⁷ : TopologicalSpace G
inst✝⁶ : TopologicalGroup G
inst✝⁵ : MeasurableSpace G
inst✝⁴ : BorelSpace G
μ : Measure G
inst✝³ : IsHaarMeasure μ
inst✝² : CompactSpace G
inst✝¹ : RootableBy G ℤ
inst✝ : InnerRegularCompactLTTop μ
n : ℤ
hn : n ≠ 0
f : G →* G := zpowGroupHom n
hf : Continuous ⇑f
this✝ : IsHaarMeasure (map (⇑f) μ)
this : InnerRegular (map (⇑f) μ)
C : ℝ≥0∞
hC : map (⇑f) μ = C • μ
h_univ : ↑↑(map (⇑f) μ) univ = ↑↑μ univ
hμ₀ : ↑↑μ univ ≠ 0
hμ₁ : ↑↑μ univ ≠ ⊤
⊢ C = 1

Next tactic:
rwa [hC, smul_apply, Algebra.id.smul_eq_mul, mul_comm, ← ENNReal.eq_div_iff hμ₀ hμ₁,
        ENNReal.div_self hμ₀ hμ₁] at h_univ
theorem C_mul_monomial : C a * monomial s a' = monomial s (a * a') := by
  -- porting note: this `show` feels like defeq abuse, but I can't find the appropriate lemmas
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ C a * (monomial s) a' = (monomial s) (a * a')

Next tactic:
show AddMonoidAlgebra.single _ _ * AddMonoidAlgebra.single _ _ = AddMonoidAlgebra.single _ _
theorem C_mul_monomial : C a * monomial s a' = monomial s (a * a') := by
  -- porting note: this `show` feels like defeq abuse, but I can't find the appropriate lemmas
  show AddMonoidAlgebra.single _ _ * AddMonoidAlgebra.single _ _ = AddMonoidAlgebra.single _ _
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ AddMonoidAlgebra.single 0 a * AddMonoidAlgebra.single s a' = AddMonoidAlgebra.single s (a * a')

Next tactic:
simp [C_apply, single_mul_single]
theorem C_surjective {R : Type*} [CommSemiring R] (σ : Type*) [IsEmpty σ] :
    Function.Surjective (C : R → MvPolynomial σ R) := by
  

Proof state:
R✝ : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ✝ : Type u_1
a a' a₁ a₂ : R✝
e : ℕ
n m : σ✝
s : σ✝ →₀ ℕ
inst✝³ : CommSemiring R✝
inst✝² : CommSemiring S₁
p q : MvPolynomial σ✝ R✝
R : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : IsEmpty σ
⊢ Surjective ⇑C

Next tactic:
refine' fun p => ⟨p.toFun 0, Finsupp.ext fun a => _⟩
theorem C_surjective {R : Type*} [CommSemiring R] (σ : Type*) [IsEmpty σ] :
    Function.Surjective (C : R → MvPolynomial σ R) := by
  refine' fun p => ⟨p.toFun 0, Finsupp.ext fun a => _⟩
  

Proof state:
R✝ : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ✝ : Type u_1
a✝ a' a₁ a₂ : R✝
e : ℕ
n m : σ✝
s : σ✝ →₀ ℕ
inst✝³ : CommSemiring R✝
inst✝² : CommSemiring S₁
p✝ q : MvPolynomial σ✝ R✝
R : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : IsEmpty σ
p : MvPolynomial σ R
a : σ →₀ ℕ
⊢ (C (toFun p 0)) a = p a

Next tactic:
simp only [C_apply, ← single_eq_monomial, (Finsupp.ext isEmptyElim (α := σ) : a = 0),
    single_eq_same]
theorem C_surjective {R : Type*} [CommSemiring R] (σ : Type*) [IsEmpty σ] :
    Function.Surjective (C : R → MvPolynomial σ R) := by
  refine' fun p => ⟨p.toFun 0, Finsupp.ext fun a => _⟩
  simp only [C_apply, ← single_eq_monomial, (Finsupp.ext isEmptyElim (α := σ) : a = 0),
    single_eq_same]
  

Proof state:
R✝ : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ✝ : Type u_1
a✝ a' a₁ a₂ : R✝
e : ℕ
n m : σ✝
s : σ✝ →₀ ℕ
inst✝³ : CommSemiring R✝
inst✝² : CommSemiring S₁
p✝ q : MvPolynomial σ✝ R✝
R : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : IsEmpty σ
p : MvPolynomial σ R
a : σ →₀ ℕ
⊢ toFun p 0 = p 0

Next tactic:
rfl
theorem C_eq_coe_nat (n : ℕ) : (C ↑n : MvPolynomial σ R) = n := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n✝ m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
n : ℕ
⊢ C ↑n = ↑n

Next tactic:
induction n
theorem C_eq_coe_nat (n : ℕ) : (C ↑n : MvPolynomial σ R) = n := by
  induction n <;> 

Proof state:
case zero
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ C ↑Nat.zero = ↑Nat.zero

Next tactic:
simp [Nat.succ_eq_add_one, *]
theorem C_eq_coe_nat (n : ℕ) : (C ↑n : MvPolynomial σ R) = n := by
  induction n <;> 

Proof state:
case succ
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
n✝ : ℕ
n_ih✝ : C ↑n✝ = ↑n✝
⊢ C ↑(Nat.succ n✝) = ↑(Nat.succ n✝)

Next tactic:
simp [Nat.succ_eq_add_one, *]
theorem C_eq_smul_one : (C a : MvPolynomial σ R) = a • (1 : MvPolynomial σ R) := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ C a = a • 1

Next tactic:
rw [← C_mul', mul_one]
theorem X_pow_eq_monomial : X n ^ e = monomial (Finsupp.single n e) (1 : R) := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ X n ^ e = (monomial fun₀ | n => e) 1

Next tactic:
simp [X, monomial_pow]
theorem monomial_add_single : monomial (s + Finsupp.single n e) a = monomial s a * X n ^ e := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ (monomial (s + fun₀ | n => e)) a = (monomial s) a * X n ^ e

Next tactic:
rw [X_pow_eq_monomial, monomial_mul, mul_one]
theorem monomial_single_add : monomial (Finsupp.single n e + s) a = X n ^ e * monomial s a := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ (monomial ((fun₀ | n => e) + s)) a = X n ^ e * (monomial s) a

Next tactic:
rw [X_pow_eq_monomial, monomial_mul, one_mul]
theorem C_mul_X_pow_eq_monomial {s : σ} {a : R} {n : ℕ} :
    C a * X s ^ n = monomial (Finsupp.single s n) a := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n✝ m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
s : σ
a : R
n : ℕ
⊢ C a * X s ^ n = (monomial fun₀ | s => n) a

Next tactic:
rw [← zero_add (Finsupp.single s n), monomial_add_single, C_apply]
theorem C_mul_X_eq_monomial {s : σ} {a : R} : C a * X s = monomial (Finsupp.single s 1) a := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
s : σ
a : R
⊢ C a * X s = (monomial fun₀ | s => 1) a

Next tactic:
rw [← C_mul_X_pow_eq_monomial, pow_one]
theorem monomial_sum_index {α : Type*} (s : Finset α) (f : α → σ →₀ ℕ) (a : R) :
    monomial (∑ i in s, f i) a = C a * ∏ i in s, monomial (f i) 1 := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
α : Type u_2
s : Finset α
f : α → σ →₀ ℕ
a : R
⊢ (monomial (∑ i in s, f i)) a = C a * ∏ i in s, (monomial (f i)) 1

Next tactic:
rw [← monomial_sum_one, C_mul', ← (monomial _).map_smul, smul_eq_mul, mul_one]
theorem monomial_eq : monomial s a = C a * (s.prod fun n e => X n ^ e : MvPolynomial σ R) := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
⊢ (monomial s) a = C a * Finsupp.prod s fun n e => X n ^ e

Next tactic:
simp only [X_pow_eq_monomial, ← monomial_finsupp_sum_index, Finsupp.sum_single]
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
⊢ ∀ (s : σ →₀ ℕ) (a : R), M ((monomial s) a)

Next tactic:
intro s a
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
⊢ M ((monomial s) a)

Next tactic:
apply @Finsupp.induction σ ℕ _ _ s
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · 

Proof state:
case h0
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
⊢ M ((monomial 0) a)

Next tactic:
show M (monomial 0 a)
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · show M (monomial 0 a)
    

Proof state:
case h0
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
⊢ M ((monomial 0) a)

Next tactic:
exact h_C a
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · show M (monomial 0 a)
    exact h_C a
  · 

Proof state:
case ha
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e : ℕ
n m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
⊢ ∀ (a_1 : σ) (b : ℕ) (f : σ →₀ ℕ),
    a_1 ∉ f.support → b ≠ 0 → M ((monomial f) a) → M ((monomial ((fun₀ | a_1 => b) + f)) a)

Next tactic:
intro n e p _hpn _he ih
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · show M (monomial 0 a)
    exact h_C a
  · intro n e p _hpn _he ih
    

Proof state:
case ha
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e✝ : ℕ
n✝ m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p✝ q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
n : σ
e : ℕ
p : σ →₀ ℕ
_hpn : n ∉ p.support
_he : e ≠ 0
ih : M ((monomial p) a)
⊢ M ((monomial ((fun₀ | n => e) + p)) a)

Next tactic:
have : ∀ e : ℕ, M (monomial p a * X n ^ e) := by
      intro e
      induction e with
      | zero => simp [ih]
      | succ e e_ih => simp [ih, pow_succ', (mul_assoc _ _ _).symm, h_X, e_ih]
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · show M (monomial 0 a)
    exact h_C a
  · intro n e p _hpn _he ih
    have : ∀ e : ℕ, M (monomial p a * X n ^ e) := by
      

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e✝ : ℕ
n✝ m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p✝ q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
n : σ
e : ℕ
p : σ →₀ ℕ
_hpn : n ∉ p.support
_he : e ≠ 0
ih : M ((monomial p) a)
⊢ ∀ (e : ℕ), M ((monomial p) a * X n ^ e)

Next tactic:
intro e
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · show M (monomial 0 a)
    exact h_C a
  · intro n e p _hpn _he ih
    have : ∀ e : ℕ, M (monomial p a * X n ^ e) := by
      intro e
      

Proof state:
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e✝¹ : ℕ
n✝ m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p✝ q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
n : σ
e✝ : ℕ
p : σ →₀ ℕ
_hpn : n ∉ p.support
_he : e✝ ≠ 0
ih : M ((monomial p) a)
e : ℕ
⊢ M ((monomial p) a * X n ^ e)

Next tactic:
induction e with
      | zero => simp [ih]
      | succ e e_ih => simp [ih, pow_succ', (mul_assoc _ _ _).symm, h_X, e_ih]
theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a) := by
  intro s a
  apply @Finsupp.induction σ ℕ _ _ s
  · show M (monomial 0 a)
    exact h_C a
  · intro n e p _hpn _he ih
    have : ∀ e : ℕ, M (monomial p a * X n ^ e) := by
      intro e
      induction e with
      

Proof state:
case zero
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a✝ a' a₁ a₂ : R
e✝ : ℕ
n✝ m : σ
s✝ : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p✝ q : MvPolynomial σ R
M : MvPolynomial σ R → Prop
h_C : ∀ (a : R), M (C a)
h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * X n)
s : σ →₀ ℕ
a : R
n : σ
e : ℕ
p : σ →₀ ℕ
_hpn : n ∉ p.support
_he : e ≠ 0
ih : M ((monomial p) a)
⊢ M ((monomial p) a * X n ^ Nat.zero)

Next tactic:
| zero => simp [ih]