l3lab/ntp-mathlib huggingface dataset:
instance : IsIso (pushoutComparison G f g) := by
  rw [← PreservesPushout.iso_hom]
  

Proof state:
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₁, u₂} D
G : C ⥤ D
X Y Z : C
f : X ⟶ Y
g : X ⟶ Z
inst✝² : HasPushout f g
inst✝¹ : HasPushout (G.map f) (G.map g)
inst✝ : PreservesColimit (span f g) G
⊢ IsIso (PreservesPushout.iso G f g).hom

Next tactic:
infer_instance
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  

Proof state:
c : Char
⊢ 0 < utf8Size c

Next tactic:
simp only [utf8Size]
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  

Proof state:
c : Char
⊢ 0 <
    if c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1 then UInt32.ofNatCore 1 utf8Size.proof_2
    else
      if c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3 then UInt32.ofNatCore 2 utf8Size.proof_4
      else
        if c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5 then UInt32.ofNatCore 3 utf8Size.proof_6
        else UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
repeat (split; decide)
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (

Proof state:
c : Char
⊢ 0 <
    if c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1 then UInt32.ofNatCore 1 utf8Size.proof_2
    else
      if c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3 then UInt32.ofNatCore 2 utf8Size.proof_4
      else
        if c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5 then UInt32.ofNatCore 3 utf8Size.proof_6
        else UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
split
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (split; 

Proof state:
case inl
c : Char
h✝ : c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
⊢ 0 < UInt32.ofNatCore 1 utf8Size.proof_2
case inr
c : Char
h✝ : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
⊢ 0 <
    if c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3 then UInt32.ofNatCore 2 utf8Size.proof_4
    else
      if c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5 then UInt32.ofNatCore 3 utf8Size.proof_6
      else UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
decide
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (

Proof state:
case inr
c : Char
h✝ : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
⊢ 0 <
    if c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3 then UInt32.ofNatCore 2 utf8Size.proof_4
    else
      if c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5 then UInt32.ofNatCore 3 utf8Size.proof_6
      else UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
split
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (split; 

Proof state:
case inr.inl
c : Char
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝ : c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
⊢ 0 < UInt32.ofNatCore 2 utf8Size.proof_4
case inr.inr
c : Char
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝ : ¬c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
⊢ 0 <
    if c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5 then UInt32.ofNatCore 3 utf8Size.proof_6
    else UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
decide
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (

Proof state:
case inr.inr
c : Char
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝ : ¬c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
⊢ 0 <
    if c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5 then UInt32.ofNatCore 3 utf8Size.proof_6
    else UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
split
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (split; 

Proof state:
case inr.inr.inl
c : Char
h✝² : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
h✝ : c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5
⊢ 0 < UInt32.ofNatCore 3 utf8Size.proof_6
case inr.inr.inr
c : Char
h✝² : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5
⊢ 0 < UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
decide
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (

Proof state:
case inr.inr.inr
c : Char
h✝² : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5
⊢ 0 < UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
split
theorem Char.utf8Size_pos (c : Char) : 0 < c.utf8Size := by
  simp only [utf8Size]
  repeat (split; decide)
  

Proof state:
case inr.inr.inr
c : Char
h✝² : ¬c.val ≤ UInt32.ofNatCore 127 utf8Size.proof_1
h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 utf8Size.proof_3
h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 utf8Size.proof_5
⊢ 0 < UInt32.ofNatCore 4 utf8Size.proof_7

Next tactic:
decide
theorem Char.ofNat_toNat {c : Char} (h : isValidCharNat c.toNat) : Char.ofNat c.toNat = c := by
  

Proof state:
c : Char
h : isValidCharNat (toNat c)
⊢ ofNat (toNat c) = c

Next tactic:
rw [Char.ofNat, dif_pos h]
theorem Char.ofNat_toNat {c : Char} (h : isValidCharNat c.toNat) : Char.ofNat c.toNat = c := by
  rw [Char.ofNat, dif_pos h]
  

Proof state:
c : Char
h : isValidCharNat (toNat c)
⊢ ofNatAux (toNat c) h = c

Next tactic:
rfl
/-- The constant presheaf functor is left adjoint to evaluation at a terminal object. -/
noncomputable def constantPresheafAdj {T : C} (hT : IsTerminal T) :
    Functor.const Cᵒᵖ ⊣ (evaluation Cᵒᵖ D).obj (op T) :=
  Adjunction.mkOfUnitCounit {
    unit := (Functor.constCompEvaluationObj D (op T)).hom
    counit := {
      app := fun F => {
        app := fun ⟨X⟩ => F.map (IsTerminal.from hT X).op
        naturality := fun _ _ _ => by
          

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.57, u_1} C
J : GrothendieckTopology C
D : Type u_2
inst✝ : Category.{?u.79, u_2} D
T : C
hT : IsTerminal T
F : Cᵒᵖ ⥤ D
x✝² x✝¹ : Cᵒᵖ
x✝ : x✝² ⟶ x✝¹
⊢ (((evaluation Cᵒᵖ D).obj (op T) ⋙ Functor.const Cᵒᵖ).obj F).map x✝ ≫
      (fun x =>
          match x with
          | { unop := X } => F.map (IsTerminal.from hT X).op)
        x✝¹ =
    (fun x =>
          match x with
          | { unop := X } => F.map (IsTerminal.from hT X).op)
        x✝² ≫
      ((𝟭 (Cᵒᵖ ⥤ D)).obj F).map x✝

Next tactic:
simp only [Functor.comp_obj, Functor.const_obj_obj, Functor.id_obj, Functor.const_obj_map,
            Category.id_comp, ← Functor.map_comp]
/-- The constant presheaf functor is left adjoint to evaluation at a terminal object. -/
noncomputable def constantPresheafAdj {T : C} (hT : IsTerminal T) :
    Functor.const Cᵒᵖ ⊣ (evaluation Cᵒᵖ D).obj (op T) :=
  Adjunction.mkOfUnitCounit {
    unit := (Functor.constCompEvaluationObj D (op T)).hom
    counit := {
      app := fun F => {
        app := fun ⟨X⟩ => F.map (IsTerminal.from hT X).op
        naturality := fun _ _ _ => by
          simp only [Functor.comp_obj, Functor.const_obj_obj, Functor.id_obj, Functor.const_obj_map,
            Category.id_comp, ← Functor.map_comp]
          

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.57, u_1} C
J : GrothendieckTopology C
D : Type u_2
inst✝ : Category.{?u.79, u_2} D
T : C
hT : IsTerminal T
F : Cᵒᵖ ⥤ D
x✝² x✝¹ : Cᵒᵖ
x✝ : x✝² ⟶ x✝¹
⊢ F.map (IsTerminal.from hT x✝¹.unop).op = F.map ((IsTerminal.from hT x✝².unop).op ≫ x✝)

Next tactic:
congr
/-- The constant presheaf functor is left adjoint to evaluation at a terminal object. -/
noncomputable def constantPresheafAdj {T : C} (hT : IsTerminal T) :
    Functor.const Cᵒᵖ ⊣ (evaluation Cᵒᵖ D).obj (op T) :=
  Adjunction.mkOfUnitCounit {
    unit := (Functor.constCompEvaluationObj D (op T)).hom
    counit := {
      app := fun F => {
        app := fun ⟨X⟩ => F.map (IsTerminal.from hT X).op
        naturality := fun _ _ _ => by
          simp only [Functor.comp_obj, Functor.const_obj_obj, Functor.id_obj, Functor.const_obj_map,
            Category.id_comp, ← Functor.map_comp]
          congr
          

Proof state:
case e_a.e_f
C : Type u_1
inst✝¹ : Category.{?u.57, u_1} C
J : GrothendieckTopology C
D : Type u_2
inst✝ : Category.{?u.79, u_2} D
T : C
hT : IsTerminal T
F : Cᵒᵖ ⥤ D
x✝² x✝¹ : Cᵒᵖ
x✝ : x✝² ⟶ x✝¹
⊢ IsTerminal.from hT x✝¹.unop = x✝.unop ≫ (IsTerminal.from hT x✝².unop).op.unop

Next tactic:
simp
/-- The constant presheaf functor is left adjoint to evaluation at a terminal object. -/
noncomputable def constantPresheafAdj {T : C} (hT : IsTerminal T) :
    Functor.const Cᵒᵖ ⊣ (evaluation Cᵒᵖ D).obj (op T) :=
  Adjunction.mkOfUnitCounit {
    unit := (Functor.constCompEvaluationObj D (op T)).hom
    counit := {
      app := fun F => {
        app := fun ⟨X⟩ => F.map (IsTerminal.from hT X).op
        naturality := fun _ _ _ => by
          simp only [Functor.comp_obj, Functor.const_obj_obj, Functor.id_obj, Functor.const_obj_map,
            Category.id_comp, ← Functor.map_comp]
          congr
          simp }
      naturality := by 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.57, u_1} C
J : GrothendieckTopology C
D : Type u_2
inst✝ : Category.{?u.79, u_2} D
T : C
hT : IsTerminal T
⊢ ∀ ⦃X Y : Cᵒᵖ ⥤ D⦄ (f : X ⟶ Y),
    ((evaluation Cᵒᵖ D).obj (op T) ⋙ Functor.const Cᵒᵖ).map f ≫
        (fun F =>
            NatTrans.mk fun x =>
              match x with
              | { unop := X } => F.map (IsTerminal.from hT X).op)
          Y =
      (fun F =>
            NatTrans.mk fun x =>
              match x with
              | { unop := X } => F.map (IsTerminal.from hT X).op)
          X ≫
        (𝟭 (Cᵒᵖ ⥤ D)).map f

Next tactic:
intros
/-- The constant presheaf functor is left adjoint to evaluation at a terminal object. -/
noncomputable def constantPresheafAdj {T : C} (hT : IsTerminal T) :
    Functor.const Cᵒᵖ ⊣ (evaluation Cᵒᵖ D).obj (op T) :=
  Adjunction.mkOfUnitCounit {
    unit := (Functor.constCompEvaluationObj D (op T)).hom
    counit := {
      app := fun F => {
        app := fun ⟨X⟩ => F.map (IsTerminal.from hT X).op
        naturality := fun _ _ _ => by
          simp only [Functor.comp_obj, Functor.const_obj_obj, Functor.id_obj, Functor.const_obj_map,
            Category.id_comp, ← Functor.map_comp]
          congr
          simp }
      naturality := by intros; 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.57, u_1} C
J : GrothendieckTopology C
D : Type u_2
inst✝ : Category.{?u.79, u_2} D
T : C
hT : IsTerminal T
X✝ Y✝ : Cᵒᵖ ⥤ D
f✝ : X✝ ⟶ Y✝
⊢ ((evaluation Cᵒᵖ D).obj (op T) ⋙ Functor.const Cᵒᵖ).map f✝ ≫
      (fun F =>
          NatTrans.mk fun x =>
            match x with
            | { unop := X } => F.map (IsTerminal.from hT X).op)
        Y✝ =
    (fun F =>
          NatTrans.mk fun x =>
            match x with
            | { unop := X } => F.map (IsTerminal.from hT X).op)
        X✝ ≫
      (𝟭 (Cᵒᵖ ⥤ D)).map f✝

Next tactic:
ext
/-- The constant presheaf functor is left adjoint to evaluation at a terminal object. -/
noncomputable def constantPresheafAdj {T : C} (hT : IsTerminal T) :
    Functor.const Cᵒᵖ ⊣ (evaluation Cᵒᵖ D).obj (op T) :=
  Adjunction.mkOfUnitCounit {
    unit := (Functor.constCompEvaluationObj D (op T)).hom
    counit := {
      app := fun F => {
        app := fun ⟨X⟩ => F.map (IsTerminal.from hT X).op
        naturality := fun _ _ _ => by
          simp only [Functor.comp_obj, Functor.const_obj_obj, Functor.id_obj, Functor.const_obj_map,
            Category.id_comp, ← Functor.map_comp]
          congr
          simp }
      naturality := by intros; ext; 

Proof state:
case w.h
C : Type u_1
inst✝¹ : Category.{?u.57, u_1} C
J : GrothendieckTopology C
D : Type u_2
inst✝ : Category.{?u.79, u_2} D
T : C
hT : IsTerminal T
X✝ Y✝ : Cᵒᵖ ⥤ D
f✝ : X✝ ⟶ Y✝
x✝ : Cᵒᵖ
⊢ (((evaluation Cᵒᵖ D).obj (op T) ⋙ Functor.const Cᵒᵖ).map f✝ ≫
          (fun F =>
              NatTrans.mk fun x =>
                match x with
                | { unop := X } => F.map (IsTerminal.from hT X).op)
            Y✝).app
      x✝ =
    ((fun F =>
              NatTrans.mk fun x =>
                match x with
                | { unop := X } => F.map (IsTerminal.from hT X).op)
            X✝ ≫
          (𝟭 (Cᵒᵖ ⥤ D)).map f✝).app
      x✝

Next tactic:
simp
theorem hasStrictDerivAt_tan {x : ℝ} (h : cos x ≠ 0) : HasStrictDerivAt tan (1 / cos x ^ 2) x :=
  mod_cast (Complex.hasStrictDerivAt_tan (by 

Proof state:
x : ℝ
h : cos x ≠ 0
⊢ Complex.cos ↑x ≠ 0

Next tactic:
exact mod_cast h
theorem hasDerivAt_tan {x : ℝ} (h : cos x ≠ 0) : HasDerivAt tan (1 / cos x ^ 2) x :=
  mod_cast (Complex.hasDerivAt_tan (by 

Proof state:
x : ℝ
h : cos x ≠ 0
⊢ Complex.cos ↑x ≠ 0

Next tactic:
exact mod_cast h
theorem tendsto_abs_tan_of_cos_eq_zero {x : ℝ} (hx : cos x = 0) :
    Tendsto (fun x => abs (tan x)) (𝓝[≠] x) atTop := by
  

Proof state:
x : ℝ
hx : cos x = 0
⊢ Tendsto (fun x => |tan x|) (𝓝[≠] x) atTop

Next tactic:
have hx : Complex.cos x = 0 := mod_cast hx
theorem tendsto_abs_tan_of_cos_eq_zero {x : ℝ} (hx : cos x = 0) :
    Tendsto (fun x => abs (tan x)) (𝓝[≠] x) atTop := by
  have hx : Complex.cos x = 0 := mod_cast hx
  

Proof state:
x : ℝ
hx✝ : cos x = 0
hx : Complex.cos ↑x = 0
⊢ Tendsto (fun x => |tan x|) (𝓝[≠] x) atTop

Next tactic:
simp only [← Complex.abs_ofReal, Complex.ofReal_tan]
theorem tendsto_abs_tan_of_cos_eq_zero {x : ℝ} (hx : cos x = 0) :
    Tendsto (fun x => abs (tan x)) (𝓝[≠] x) atTop := by
  have hx : Complex.cos x = 0 := mod_cast hx
  simp only [← Complex.abs_ofReal, Complex.ofReal_tan]
  

Proof state:
x : ℝ
hx✝ : cos x = 0
hx : Complex.cos ↑x = 0
⊢ Tendsto (fun x => Complex.abs (Complex.tan ↑x)) (𝓝[≠] x) atTop

Next tactic:
refine' (Complex.tendsto_abs_tan_of_cos_eq_zero hx).comp _
theorem tendsto_abs_tan_of_cos_eq_zero {x : ℝ} (hx : cos x = 0) :
    Tendsto (fun x => abs (tan x)) (𝓝[≠] x) atTop := by
  have hx : Complex.cos x = 0 := mod_cast hx
  simp only [← Complex.abs_ofReal, Complex.ofReal_tan]
  refine' (Complex.tendsto_abs_tan_of_cos_eq_zero hx).comp _
  

Proof state:
x : ℝ
hx✝ : cos x = 0
hx : Complex.cos ↑x = 0
⊢ Tendsto (fun x => ↑x) (𝓝[≠] x) (𝓝[≠] ↑x)

Next tactic:
refine' Tendsto.inf Complex.continuous_ofReal.continuousAt _
theorem tendsto_abs_tan_of_cos_eq_zero {x : ℝ} (hx : cos x = 0) :
    Tendsto (fun x => abs (tan x)) (𝓝[≠] x) atTop := by
  have hx : Complex.cos x = 0 := mod_cast hx
  simp only [← Complex.abs_ofReal, Complex.ofReal_tan]
  refine' (Complex.tendsto_abs_tan_of_cos_eq_zero hx).comp _
  refine' Tendsto.inf Complex.continuous_ofReal.continuousAt _
  

Proof state:
x : ℝ
hx✝ : cos x = 0
hx : Complex.cos ↑x = 0
⊢ Tendsto (fun x => ↑x) (𝓟 {x}ᶜ) (𝓟 {↑x}ᶜ)

Next tactic:
exact tendsto_principal_principal.2 fun y => mt Complex.ofReal_inj.1
theorem continuousAt_tan {x : ℝ} : ContinuousAt tan x ↔ cos x ≠ 0 := by
  

Proof state:
x : ℝ
⊢ ContinuousAt tan x ↔ cos x ≠ 0

Next tactic:
refine' ⟨fun hc h₀ => _, fun h => (hasDerivAt_tan h).continuousAt⟩
theorem continuousAt_tan {x : ℝ} : ContinuousAt tan x ↔ cos x ≠ 0 := by
  refine' ⟨fun hc h₀ => _, fun h => (hasDerivAt_tan h).continuousAt⟩
  

Proof state:
x : ℝ
hc : ContinuousAt tan x
h₀ : cos x = 0
⊢ False

Next tactic:
exact not_tendsto_nhds_of_tendsto_atTop (tendsto_abs_tan_of_cos_eq_zero h₀) _
    (hc.norm.tendsto.mono_left inf_le_left)
@[simp]
theorem deriv_tan (x : ℝ) : deriv tan x = 1 / cos x ^ 2 :=
  if h : cos x = 0 then by
    

Proof state:
x : ℝ
h : cos x = 0
⊢ deriv tan x = 1 / cos x ^ 2

Next tactic:
have : ¬DifferentiableAt ℝ tan x := mt differentiableAt_tan.1 (Classical.not_not.2 h)
@[simp]
theorem deriv_tan (x : ℝ) : deriv tan x = 1 / cos x ^ 2 :=
  if h : cos x = 0 then by
    have : ¬DifferentiableAt ℝ tan x := mt differentiableAt_tan.1 (Classical.not_not.2 h)
    

Proof state:
x : ℝ
h : cos x = 0
this : ¬DifferentiableAt ℝ tan x
⊢ deriv tan x = 1 / cos x ^ 2

Next tactic:
simp [deriv_zero_of_not_differentiableAt this, h, sq]
theorem hasStrictDerivAt_arctan (x : ℝ) : HasStrictDerivAt arctan (1 / (1 + x ^ 2)) x := by
  

Proof state:
x : ℝ
⊢ HasStrictDerivAt arctan (1 / (1 + x ^ 2)) x

Next tactic:
have A : cos (arctan x) ≠ 0 := (cos_arctan_pos x).ne'
theorem hasStrictDerivAt_arctan (x : ℝ) : HasStrictDerivAt arctan (1 / (1 + x ^ 2)) x := by
  have A : cos (arctan x) ≠ 0 := (cos_arctan_pos x).ne'
  

Proof state:
x : ℝ
A : cos (arctan x) ≠ 0
⊢ HasStrictDerivAt arctan (1 / (1 + x ^ 2)) x

Next tactic:
simpa [cos_sq_arctan] using
    tanPartialHomeomorph.hasStrictDerivAt_symm trivial (by simpa) (hasStrictDerivAt_tan A)
theorem hasStrictDerivAt_arctan (x : ℝ) : HasStrictDerivAt arctan (1 / (1 + x ^ 2)) x := by
  have A : cos (arctan x) ≠ 0 := (cos_arctan_pos x).ne'
  simpa [cos_sq_arctan] using
    tanPartialHomeomorph.hasStrictDerivAt_symm trivial (by 

Proof state:
x : ℝ
A : cos (arctan x) ≠ 0
⊢ 1 / cos (↑(PartialHomeomorph.symm tanPartialHomeomorph) x) ^ 2 ≠ 0

Next tactic:
simpa
theorem contDiff_arctan {n : ℕ∞} : ContDiff ℝ n arctan :=
  contDiff_iff_contDiffAt.2 fun x =>
    have : cos (arctan x) ≠ 0 := (cos_arctan_pos x).ne'
    tanPartialHomeomorph.contDiffAt_symm_deriv (by 

Proof state:
n : ℕ∞
x : ℝ
this : cos (arctan x) ≠ 0
⊢ 1 / cos (↑(PartialHomeomorph.symm tanPartialHomeomorph) x) ^ 2 ≠ 0

Next tactic:
simpa
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  

Proof state:
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
⊢ ∑ x : σ → K, (eval x) f = 0

Next tactic:
haveI : DecidableEq K := Classical.decEq K
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  

Proof state:
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
⊢ ∑ x : σ → K, (eval x) f = 0

Next tactic:
calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      simp only [eval_eq']
    _ = ∑ d in f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm
    _ = 0 := sum_eq_zero ?_
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      

Proof state:
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
⊢ ∑ x : σ → K, (eval x) f = ∑ x : σ → K, ∑ d in support f, coeff d f * ∏ i : σ, x i ^ d i

Next tactic:
simp only [eval_eq']
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      simp only [eval_eq']
    _ = ∑ d in f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm
    _ = 0 := sum_eq_zero ?_
  

Proof state:
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
⊢ ∀ x ∈ support f, ∑ x_1 : σ → K, coeff x f * ∏ i : σ, x_1 i ^ x i = 0

Next tactic:
intro d hd
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      simp only [eval_eq']
    _ = ∑ d in f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm
    _ = 0 := sum_eq_zero ?_
  intro d hd
  

Proof state:
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
d : σ →₀ ℕ
hd : d ∈ support f
⊢ ∑ x : σ → K, coeff d f * ∏ i : σ, x i ^ d i = 0

Next tactic:
obtain ⟨i, hi⟩ : ∃ i, d i < q - 1
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      simp only [eval_eq']
    _ = ∑ d in f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm
    _ = 0 := sum_eq_zero ?_
  intro d hd
  obtain ⟨i, hi⟩ : ∃ i, d i < q - 1; 

Proof state:
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
d : σ →₀ ℕ
hd : d ∈ support f
⊢ ∃ i, d i < q - 1
case intro
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
d : σ →₀ ℕ
hd : d ∈ support f
i : σ
hi : d i < q - 1
⊢ ∑ x : σ → K, coeff d f * ∏ i : σ, x i ^ d i = 0

Next tactic:
exact f.exists_degree_lt (q - 1) h hd
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      simp only [eval_eq']
    _ = ∑ d in f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm
    _ = 0 := sum_eq_zero ?_
  intro d hd
  obtain ⟨i, hi⟩ : ∃ i, d i < q - 1; exact f.exists_degree_lt (q - 1) h hd
  

Proof state:
case intro
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
d : σ →₀ ℕ
hd : d ∈ support f
i : σ
hi : d i < q - 1
⊢ ∑ x : σ → K, coeff d f * ∏ i : σ, x i ^ d i = 0

Next tactic:
calc
    (∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i) = f.coeff d * ∑ x : σ → K, ∏ i, x i ^ d i :=
      mul_sum.symm
    _ = 0 := (mul_eq_zero.mpr ∘ Or.inr) ?_
theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by
  haveI : DecidableEq K := Classical.decEq K
  calc
    ∑ x, eval x f = ∑ x : σ → K, ∑ d in f.support, f.coeff d * ∏ i, x i ^ d i := by
      simp only [eval_eq']
    _ = ∑ d in f.support, ∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i := sum_comm
    _ = 0 := sum_eq_zero ?_
  intro d hd
  obtain ⟨i, hi⟩ : ∃ i, d i < q - 1; exact f.exists_degree_lt (q - 1) h hd
  calc
    (∑ x : σ → K, f.coeff d * ∏ i, x i ^ d i) = f.coeff d * ∑ x : σ → K, ∏ i, x i ^ d i :=
      mul_sum.symm
    _ = 0 := (mul_eq_zero.mpr ∘ Or.inr) ?_
  

Proof state:
case intro
K : Type u_1
σ : Type u_2
ι : Type u_3
inst✝³ : Fintype K
inst✝² : Field K
inst✝¹ : Fintype σ
inst✝ : DecidableEq σ
f : MvPolynomial σ K
h : totalDegree f < (q - 1) * Fintype.card σ
this : DecidableEq K
d : σ →₀ ℕ
hd : d ∈ support f
i : σ
hi : d i < q - 1
⊢ ∑ x : σ → K, ∏ i : σ, x i ^ d i = 0

Next tactic:
calc
    (∑ x : σ → K, ∏ i, x i ^ d i) =
        ∑ x₀ : { j // j ≠ i } → K, ∑ x : { x : σ → K // x ∘ (↑) = x₀ }, ∏ j, (x : σ → K) j ^ d j :=
      (Fintype.sum_fiberwise _ _).symm
    _ = 0 := Fintype.sum_eq_zero _ ?_