l3lab/ntp-mathlib huggingface dataset:
/-- In a locally compact space, for every containment `K ⊆ U` of a compact set `K` in an open
  set `U`, there is a compact neighborhood `L` such that `K ⊆ L ⊆ U`: equivalently, there is a
  compact `L` such that `K ⊆ interior L` and `L ⊆ U`.
  See also `exists_compact_closed_between`, in which one guarantees additionally that `L` is closed
  if the space is regular. -/
theorem exists_compact_between [hX : LocallyCompactSpace X] {K U : Set X} (hK : IsCompact K)
    (hU : IsOpen U) (h_KU : K ⊆ U) : ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U := by
  choose V hVc hxV hKV using fun x : K => exists_compact_subset hU (h_KU x.2)
  have : K ⊆ ⋃ x, interior (V x) := fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxV _⟩
  

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
s t : Set X
hX : LocallyCompactSpace X
K U : Set X
hK : IsCompact K
hU : IsOpen U
h_KU : K ⊆ U
V : ↑K → Set X
hVc : ∀ (x : ↑K), IsCompact (V x)
hxV : ∀ (x : ↑K), ↑x ∈ interior (V x)
hKV : ∀ (x : ↑K), V x ⊆ U
this : K ⊆ ⋃ x, interior (V x)
⊢ ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U

Next tactic:
rcases hK.elim_finite_subcover _ (fun x => @isOpen_interior X _ (V x)) this with ⟨t, ht⟩
/-- In a locally compact space, for every containment `K ⊆ U` of a compact set `K` in an open
  set `U`, there is a compact neighborhood `L` such that `K ⊆ L ⊆ U`: equivalently, there is a
  compact `L` such that `K ⊆ interior L` and `L ⊆ U`.
  See also `exists_compact_closed_between`, in which one guarantees additionally that `L` is closed
  if the space is regular. -/
theorem exists_compact_between [hX : LocallyCompactSpace X] {K U : Set X} (hK : IsCompact K)
    (hU : IsOpen U) (h_KU : K ⊆ U) : ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U := by
  choose V hVc hxV hKV using fun x : K => exists_compact_subset hU (h_KU x.2)
  have : K ⊆ ⋃ x, interior (V x) := fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxV _⟩
  rcases hK.elim_finite_subcover _ (fun x => @isOpen_interior X _ (V x)) this with ⟨t, ht⟩
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
s t✝ : Set X
hX : LocallyCompactSpace X
K U : Set X
hK : IsCompact K
hU : IsOpen U
h_KU : K ⊆ U
V : ↑K → Set X
hVc : ∀ (x : ↑K), IsCompact (V x)
hxV : ∀ (x : ↑K), ↑x ∈ interior (V x)
hKV : ∀ (x : ↑K), V x ⊆ U
this : K ⊆ ⋃ x, interior (V x)
t : Finset ↑K
ht : K ⊆ ⋃ i ∈ t, interior (V i)
⊢ ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U

Next tactic:
refine'
    ⟨_, t.isCompact_biUnion fun x _ => hVc x, fun x hx => _, Set.iUnion₂_subset fun i _ => hKV i⟩
/-- In a locally compact space, for every containment `K ⊆ U` of a compact set `K` in an open
  set `U`, there is a compact neighborhood `L` such that `K ⊆ L ⊆ U`: equivalently, there is a
  compact `L` such that `K ⊆ interior L` and `L ⊆ U`.
  See also `exists_compact_closed_between`, in which one guarantees additionally that `L` is closed
  if the space is regular. -/
theorem exists_compact_between [hX : LocallyCompactSpace X] {K U : Set X} (hK : IsCompact K)
    (hU : IsOpen U) (h_KU : K ⊆ U) : ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U := by
  choose V hVc hxV hKV using fun x : K => exists_compact_subset hU (h_KU x.2)
  have : K ⊆ ⋃ x, interior (V x) := fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxV _⟩
  rcases hK.elim_finite_subcover _ (fun x => @isOpen_interior X _ (V x)) this with ⟨t, ht⟩
  refine'
    ⟨_, t.isCompact_biUnion fun x _ => hVc x, fun x hx => _, Set.iUnion₂_subset fun i _ => hKV i⟩
  

Proof state:
case intro
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
s t✝ : Set X
hX : LocallyCompactSpace X
K U : Set X
hK : IsCompact K
hU : IsOpen U
h_KU : K ⊆ U
V : ↑K → Set X
hVc : ∀ (x : ↑K), IsCompact (V x)
hxV : ∀ (x : ↑K), ↑x ∈ interior (V x)
hKV : ∀ (x : ↑K), V x ⊆ U
this : K ⊆ ⋃ x, interior (V x)
t : Finset ↑K
ht : K ⊆ ⋃ i ∈ t, interior (V i)
x : X
hx : x ∈ K
⊢ x ∈ interior (⋃ i ∈ t, V i)

Next tactic:
rcases mem_iUnion₂.1 (ht hx) with ⟨y, hyt, hy⟩
/-- In a locally compact space, for every containment `K ⊆ U` of a compact set `K` in an open
  set `U`, there is a compact neighborhood `L` such that `K ⊆ L ⊆ U`: equivalently, there is a
  compact `L` such that `K ⊆ interior L` and `L ⊆ U`.
  See also `exists_compact_closed_between`, in which one guarantees additionally that `L` is closed
  if the space is regular. -/
theorem exists_compact_between [hX : LocallyCompactSpace X] {K U : Set X} (hK : IsCompact K)
    (hU : IsOpen U) (h_KU : K ⊆ U) : ∃ L, IsCompact L ∧ K ⊆ interior L ∧ L ⊆ U := by
  choose V hVc hxV hKV using fun x : K => exists_compact_subset hU (h_KU x.2)
  have : K ⊆ ⋃ x, interior (V x) := fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxV _⟩
  rcases hK.elim_finite_subcover _ (fun x => @isOpen_interior X _ (V x)) this with ⟨t, ht⟩
  refine'
    ⟨_, t.isCompact_biUnion fun x _ => hVc x, fun x hx => _, Set.iUnion₂_subset fun i _ => hKV i⟩
  rcases mem_iUnion₂.1 (ht hx) with ⟨y, hyt, hy⟩
  

Proof state:
case intro.intro.intro
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
s t✝ : Set X
hX : LocallyCompactSpace X
K U : Set X
hK : IsCompact K
hU : IsOpen U
h_KU : K ⊆ U
V : ↑K → Set X
hVc : ∀ (x : ↑K), IsCompact (V x)
hxV : ∀ (x : ↑K), ↑x ∈ interior (V x)
hKV : ∀ (x : ↑K), V x ⊆ U
this : K ⊆ ⋃ x, interior (V x)
t : Finset ↑K
ht : K ⊆ ⋃ i ∈ t, interior (V i)
x : X
hx : x ∈ K
y : ↑K
hyt : y ∈ t
hy : x ∈ interior (V y)
⊢ x ∈ interior (⋃ i ∈ t, V i)

Next tactic:
exact interior_mono (subset_iUnion₂ y hyt) hy
protected theorem ClosedEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : ClosedEmbedding f) : LocallyCompactSpace X :=
  haveI : ∀ x : X, (𝓝 x).HasBasis (fun s => s ∈ 𝓝 (f x) ∧ IsCompact s) fun s => f ⁻¹' s := by
    

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : ClosedEmbedding f
⊢ ∀ (x : X), HasBasis (𝓝 x) (fun s => s ∈ 𝓝 (f x) ∧ IsCompact s) fun s => f ⁻¹' s

Next tactic:
intro x
protected theorem ClosedEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : ClosedEmbedding f) : LocallyCompactSpace X :=
  haveI : ∀ x : X, (𝓝 x).HasBasis (fun s => s ∈ 𝓝 (f x) ∧ IsCompact s) fun s => f ⁻¹' s := by
    intro x
    

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : ClosedEmbedding f
x : X
⊢ HasBasis (𝓝 x) (fun s => s ∈ 𝓝 (f x) ∧ IsCompact s) fun s => f ⁻¹' s

Next tactic:
rw [hf.toInducing.nhds_eq_comap]
protected theorem ClosedEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : ClosedEmbedding f) : LocallyCompactSpace X :=
  haveI : ∀ x : X, (𝓝 x).HasBasis (fun s => s ∈ 𝓝 (f x) ∧ IsCompact s) fun s => f ⁻¹' s := by
    intro x
    rw [hf.toInducing.nhds_eq_comap]
    

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : ClosedEmbedding f
x : X
⊢ HasBasis (comap f (𝓝 (f x))) (fun s => s ∈ 𝓝 (f x) ∧ IsCompact s) fun s => f ⁻¹' s

Next tactic:
exact (compact_basis_nhds _).comap _
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
⊢ LocallyCompactSpace X

Next tactic:
have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    intro x
    rw [hf.toInducing.nhds_eq_comap]
    exact
      ((compact_basis_nhds _).restrict_subset <| hf.open_range.mem_nhds <| mem_range_self _).comap _
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
⊢ ∀ (x : X), HasBasis (𝓝 x) (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s

Next tactic:
intro x
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    intro x
    

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
x : X
⊢ HasBasis (𝓝 x) (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s

Next tactic:
rw [hf.toInducing.nhds_eq_comap]
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    intro x
    rw [hf.toInducing.nhds_eq_comap]
    

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
x : X
⊢ HasBasis (comap f (𝓝 (f x))) (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s

Next tactic:
exact
      ((compact_basis_nhds _).restrict_subset <| hf.open_range.mem_nhds <| mem_range_self _).comap _
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    intro x
    rw [hf.toInducing.nhds_eq_comap]
    exact
      ((compact_basis_nhds _).restrict_subset <| hf.open_range.mem_nhds <| mem_range_self _).comap _
  

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
this : ∀ (x : X), HasBasis (𝓝 x) (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s
⊢ LocallyCompactSpace X

Next tactic:
refine' locallyCompactSpace_of_hasBasis this fun x s hs => _
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    intro x
    rw [hf.toInducing.nhds_eq_comap]
    exact
      ((compact_basis_nhds _).restrict_subset <| hf.open_range.mem_nhds <| mem_range_self _).comap _
  refine' locallyCompactSpace_of_hasBasis this fun x s hs => _
  

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s✝ t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
this : ∀ (x : X), HasBasis (𝓝 x) (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s
x : X
s : Set Y
hs : (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f
⊢ IsCompact (f ⁻¹' s)

Next tactic:
rw [hf.toInducing.isCompact_iff, image_preimage_eq_of_subset hs.2]
protected theorem OpenEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : OpenEmbedding f) : LocallyCompactSpace X := by
  have : ∀ x : X, (𝓝 x).HasBasis
      (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s := by
    intro x
    rw [hf.toInducing.nhds_eq_comap]
    exact
      ((compact_basis_nhds _).restrict_subset <| hf.open_range.mem_nhds <| mem_range_self _).comap _
  refine' locallyCompactSpace_of_hasBasis this fun x s hs => _
  rw [hf.toInducing.isCompact_iff, image_preimage_eq_of_subset hs.2]
  

Proof state:
X : Type u_1
Y : Type u_2
ι : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
s✝ t : Set X
inst✝ : LocallyCompactSpace Y
f : X → Y
hf : OpenEmbedding f
this : ∀ (x : X), HasBasis (𝓝 x) (fun s => (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f) fun s => f ⁻¹' s
x : X
s : Set Y
hs : (s ∈ 𝓝 (f x) ∧ IsCompact s) ∧ s ⊆ range f
⊢ IsCompact s

Next tactic:
exact hs.1.2
@[simp]
theorem opRingEquiv_op_monomial (n : ℕ) (r : R) :
    opRingEquiv R (op (monomial n r : R[X])) = monomial n (op r) := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
n : ℕ
r : R
⊢ (opRingEquiv R) (op ((monomial n) r)) = (monomial n) (op r)

Next tactic:
simp only [opRingEquiv, RingEquiv.coe_trans, Function.comp_apply,
    AddMonoidAlgebra.opRingEquiv_apply, RingEquiv.op_apply_apply, toFinsuppIso_apply, unop_op,
    toFinsupp_monomial, Finsupp.mapRange_single, toFinsuppIso_symm_apply, ofFinsupp_single]
theorem opRingEquiv_op_C_mul_X_pow (r : R) (n : ℕ) :
    opRingEquiv R (op (C r * X ^ n : R[X])) = C (op r) * X ^ n := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
r : R
n : ℕ
⊢ (opRingEquiv R) (op (C r * X ^ n)) = C (op r) * X ^ n

Next tactic:
simp only [X_pow_mul, op_mul, op_pow, map_mul, map_pow, opRingEquiv_op_X, opRingEquiv_op_C]
@[simp]
theorem opRingEquiv_symm_monomial (n : ℕ) (r : Rᵐᵒᵖ) :
    (opRingEquiv R).symm (monomial n r) = op (monomial n (unop r)) :=
  (opRingEquiv R).injective (by 

Proof state:
R : Type u_1
inst✝ : Semiring R
n : ℕ
r : Rᵐᵒᵖ
⊢ (opRingEquiv R) ((RingEquiv.symm (opRingEquiv R)) ((monomial n) r)) = (opRingEquiv R) (op ((monomial n) (unop r)))

Next tactic:
simp
theorem opRingEquiv_symm_C_mul_X_pow (r : Rᵐᵒᵖ) (n : ℕ) :
    (opRingEquiv R).symm (C r * X ^ n : Rᵐᵒᵖ[X]) = op (C (unop r) * X ^ n) := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
r : Rᵐᵒᵖ
n : ℕ
⊢ (RingEquiv.symm (opRingEquiv R)) (C r * X ^ n) = op (C (unop r) * X ^ n)

Next tactic:
rw [C_mul_X_pow_eq_monomial, opRingEquiv_symm_monomial, C_mul_X_pow_eq_monomial]
@[simp]
theorem coeff_opRingEquiv (p : R[X]ᵐᵒᵖ) (n : ℕ) :
    (opRingEquiv R p).coeff n = op ((unop p).coeff n) := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
p : R[X]ᵐᵒᵖ
n : ℕ
⊢ coeff ((opRingEquiv R) p) n = op (coeff (unop p) n)

Next tactic:
induction' p using MulOpposite.rec' with p
@[simp]
theorem coeff_opRingEquiv (p : R[X]ᵐᵒᵖ) (n : ℕ) :
    (opRingEquiv R p).coeff n = op ((unop p).coeff n) := by
  induction' p using MulOpposite.rec' with p
  

Proof state:
case h
R : Type u_1
inst✝ : Semiring R
n : ℕ
p : R[X]
⊢ coeff ((opRingEquiv R) (op p)) n = op (coeff (unop (op p)) n)

Next tactic:
cases p
@[simp]
theorem coeff_opRingEquiv (p : R[X]ᵐᵒᵖ) (n : ℕ) :
    (opRingEquiv R p).coeff n = op ((unop p).coeff n) := by
  induction' p using MulOpposite.rec' with p
  cases p
  

Proof state:
case h.ofFinsupp
R : Type u_1
inst✝ : Semiring R
n : ℕ
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ coeff ((opRingEquiv R) (op { toFinsupp := toFinsupp✝ })) n = op (coeff (unop (op { toFinsupp := toFinsupp✝ })) n)

Next tactic:
rfl
@[simp]
theorem support_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).support = (unop p).support := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
p : R[X]ᵐᵒᵖ
⊢ support ((opRingEquiv R) p) = support (unop p)

Next tactic:
induction' p using MulOpposite.rec' with p
@[simp]
theorem support_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).support = (unop p).support := by
  induction' p using MulOpposite.rec' with p
  

Proof state:
case h
R : Type u_1
inst✝ : Semiring R
p : R[X]
⊢ support ((opRingEquiv R) (op p)) = support (unop (op p))

Next tactic:
cases p
@[simp]
theorem support_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).support = (unop p).support := by
  induction' p using MulOpposite.rec' with p
  cases p
  

Proof state:
case h.ofFinsupp
R : Type u_1
inst✝ : Semiring R
toFinsupp✝ : AddMonoidAlgebra R ℕ
⊢ support ((opRingEquiv R) (op { toFinsupp := toFinsupp✝ })) = support (unop (op { toFinsupp := toFinsupp✝ }))

Next tactic:
exact Finsupp.support_mapRange_of_injective (map_zero _) _ op_injective
@[simp]
theorem natDegree_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).natDegree = (unop p).natDegree := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
p : R[X]ᵐᵒᵖ
⊢ natDegree ((opRingEquiv R) p) = natDegree (unop p)

Next tactic:
by_cases p0 : p = 0
@[simp]
theorem natDegree_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).natDegree = (unop p).natDegree := by
  by_cases p0 : p = 0
  · 

Proof state:
case pos
R : Type u_1
inst✝ : Semiring R
p : R[X]ᵐᵒᵖ
p0 : p = 0
⊢ natDegree ((opRingEquiv R) p) = natDegree (unop p)

Next tactic:
simp only [p0, _root_.map_zero, natDegree_zero, unop_zero]
@[simp]
theorem natDegree_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).natDegree = (unop p).natDegree := by
  by_cases p0 : p = 0
  · simp only [p0, _root_.map_zero, natDegree_zero, unop_zero]
  · 

Proof state:
case neg
R : Type u_1
inst✝ : Semiring R
p : R[X]ᵐᵒᵖ
p0 : ¬p = 0
⊢ natDegree ((opRingEquiv R) p) = natDegree (unop p)

Next tactic:
simp only [p0, natDegree_eq_support_max', Ne.def, AddEquivClass.map_eq_zero_iff, not_false_iff,
      support_opRingEquiv, unop_eq_zero_iff]
@[simp]
theorem leadingCoeff_opRingEquiv (p : R[X]ᵐᵒᵖ) :
    (opRingEquiv R p).leadingCoeff = op (unop p).leadingCoeff := by
  

Proof state:
R : Type u_1
inst✝ : Semiring R
p : R[X]ᵐᵒᵖ
⊢ leadingCoeff ((opRingEquiv R) p) = op (leadingCoeff (unop p))

Next tactic:
rw [leadingCoeff, coeff_opRingEquiv, natDegree_opRingEquiv, leadingCoeff]
theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0 := by
  

Proof state:
α : Type u_1
b : ℂ
hb : b ≠ 0
⊢ (fun x => 0 ^ x) =ᶠ[𝓝 b] 0

Next tactic:
suffices : ∀ᶠ x : ℂ in 𝓝 b, x ≠ 0
theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0 := by
  suffices : ∀ᶠ x : ℂ in 𝓝 b, x ≠ 0
  

Proof state:
α : Type u_1
b : ℂ
hb : b ≠ 0
this : ∀ᶠ (x : ℂ) in 𝓝 b, x ≠ 0
⊢ (fun x => 0 ^ x) =ᶠ[𝓝 b] 0
case this α : Type u_1 b : ℂ hb : b ≠ 0 ⊢ ∀ᶠ (x : ℂ) in 𝓝 b, x ≠ 0

Next tactic:
exact
    this.mono fun x hx => by
      dsimp only
      rw [zero_cpow hx, Pi.zero_apply]
theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0 := by
  suffices : ∀ᶠ x : ℂ in 𝓝 b, x ≠ 0
  exact
    this.mono fun x hx => by
      

Proof state:
α : Type u_1
b : ℂ
hb : b ≠ 0
this : ∀ᶠ (x : ℂ) in 𝓝 b, x ≠ 0
x : ℂ
hx : x ≠ 0
⊢ (fun x => 0 ^ x) x = OfNat.ofNat 0 x

Next tactic:
dsimp only
theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0 := by
  suffices : ∀ᶠ x : ℂ in 𝓝 b, x ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      

Proof state:
α : Type u_1
b : ℂ
hb : b ≠ 0
this : ∀ᶠ (x : ℂ) in 𝓝 b, x ≠ 0
x : ℂ
hx : x ≠ 0
⊢ 0 ^ x = OfNat.ofNat 0 x

Next tactic:
rw [zero_cpow hx, Pi.zero_apply]
theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0 := by
  suffices : ∀ᶠ x : ℂ in 𝓝 b, x ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      rw [zero_cpow hx, Pi.zero_apply]
  

Proof state:
case this
α : Type u_1
b : ℂ
hb : b ≠ 0
⊢ ∀ᶠ (x : ℂ) in 𝓝 b, x ≠ 0

Next tactic:
exact IsOpen.eventually_mem isOpen_ne hb
theorem cpow_eq_nhds {a b : ℂ} (ha : a ≠ 0) :
    (fun x => x ^ b) =ᶠ[𝓝 a] fun x => exp (log x * b) := by
  

Proof state:
α : Type u_1
a b : ℂ
ha : a ≠ 0
⊢ (fun x => x ^ b) =ᶠ[𝓝 a] fun x => cexp (Complex.log x * b)

Next tactic:
suffices : ∀ᶠ x : ℂ in 𝓝 a, x ≠ 0
theorem cpow_eq_nhds {a b : ℂ} (ha : a ≠ 0) :
    (fun x => x ^ b) =ᶠ[𝓝 a] fun x => exp (log x * b) := by
  suffices : ∀ᶠ x : ℂ in 𝓝 a, x ≠ 0
  

Proof state:
α : Type u_1
a b : ℂ
ha : a ≠ 0
this : ∀ᶠ (x : ℂ) in 𝓝 a, x ≠ 0
⊢ (fun x => x ^ b) =ᶠ[𝓝 a] fun x => cexp (Complex.log x * b)
case this α : Type u_1 a b : ℂ ha : a ≠ 0 ⊢ ∀ᶠ (x : ℂ) in 𝓝 a, x ≠ 0

Next tactic:
exact
    this.mono fun x hx => by
      dsimp only
      rw [cpow_def_of_ne_zero hx]
theorem cpow_eq_nhds {a b : ℂ} (ha : a ≠ 0) :
    (fun x => x ^ b) =ᶠ[𝓝 a] fun x => exp (log x * b) := by
  suffices : ∀ᶠ x : ℂ in 𝓝 a, x ≠ 0
  exact
    this.mono fun x hx => by
      

Proof state:
α : Type u_1
a b : ℂ
ha : a ≠ 0
this : ∀ᶠ (x : ℂ) in 𝓝 a, x ≠ 0
x : ℂ
hx : x ≠ 0
⊢ (fun x => x ^ b) x = (fun x => cexp (Complex.log x * b)) x

Next tactic:
dsimp only
theorem cpow_eq_nhds {a b : ℂ} (ha : a ≠ 0) :
    (fun x => x ^ b) =ᶠ[𝓝 a] fun x => exp (log x * b) := by
  suffices : ∀ᶠ x : ℂ in 𝓝 a, x ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      

Proof state:
α : Type u_1
a b : ℂ
ha : a ≠ 0
this : ∀ᶠ (x : ℂ) in 𝓝 a, x ≠ 0
x : ℂ
hx : x ≠ 0
⊢ x ^ b = cexp (Complex.log x * b)

Next tactic:
rw [cpow_def_of_ne_zero hx]
theorem cpow_eq_nhds {a b : ℂ} (ha : a ≠ 0) :
    (fun x => x ^ b) =ᶠ[𝓝 a] fun x => exp (log x * b) := by
  suffices : ∀ᶠ x : ℂ in 𝓝 a, x ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      rw [cpow_def_of_ne_zero hx]
  

Proof state:
case this
α : Type u_1
a b : ℂ
ha : a ≠ 0
⊢ ∀ᶠ (x : ℂ) in 𝓝 a, x ≠ 0

Next tactic:
exact IsOpen.eventually_mem isOpen_ne ha
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  

Proof state:
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
⊢ (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => cexp (Complex.log x.1 * x.2)

Next tactic:
suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
  

Proof state:
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
this : ∀ᶠ (x : ℂ × ℂ) in 𝓝 p, x.1 ≠ 0
⊢ (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => cexp (Complex.log x.1 * x.2)
case this α : Type u_1 p : ℂ × ℂ hp_fst : p.1 ≠ 0 ⊢ ∀ᶠ (x : ℂ × ℂ) in 𝓝 p, x.1 ≠ 0

Next tactic:
exact
    this.mono fun x hx => by
      dsimp only
      rw [cpow_def_of_ne_zero hx]
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
  exact
    this.mono fun x hx => by
      

Proof state:
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
this : ∀ᶠ (x : ℂ × ℂ) in 𝓝 p, x.1 ≠ 0
x : ℂ × ℂ
hx : x.1 ≠ 0
⊢ (fun x => x.1 ^ x.2) x = (fun x => cexp (Complex.log x.1 * x.2)) x

Next tactic:
dsimp only
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      

Proof state:
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
this : ∀ᶠ (x : ℂ × ℂ) in 𝓝 p, x.1 ≠ 0
x : ℂ × ℂ
hx : x.1 ≠ 0
⊢ x.1 ^ x.2 = cexp (Complex.log x.1 * x.2)

Next tactic:
rw [cpow_def_of_ne_zero hx]
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      rw [cpow_def_of_ne_zero hx]
  

Proof state:
case this
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
⊢ ∀ᶠ (x : ℂ × ℂ) in 𝓝 p, x.1 ≠ 0

Next tactic:
refine' IsOpen.eventually_mem _ hp_fst
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      rw [cpow_def_of_ne_zero hx]
  refine' IsOpen.eventually_mem _ hp_fst
  

Proof state:
case this
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
⊢ IsOpen fun x => x.1 = 0 → False

Next tactic:
change IsOpen { x : ℂ × ℂ | x.1 = 0 }ᶜ
theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) := by
  suffices : ∀ᶠ x : ℂ × ℂ in 𝓝 p, x.1 ≠ 0
  exact
    this.mono fun x hx => by
      dsimp only
      rw [cpow_def_of_ne_zero hx]
  refine' IsOpen.eventually_mem _ hp_fst
  change IsOpen { x : ℂ × ℂ | x.1 = 0 }ᶜ
  

Proof state:
case this
α : Type u_1
p : ℂ × ℂ
hp_fst : p.1 ≠ 0
⊢ IsOpen {x | x.1 = 0}ᶜ

Next tactic:
rw [isOpen_compl_iff]