tasksource/leandojo huggingface dataset:
Theorem: Std.RBNode.toList_node
File: Std/Data/RBMap/Lemmas.lean

tactic: rw [toList, foldr, foldr_cons]
state_before: α : Type u_1
c : RBColor
a : RBNode α
x : α
b : RBNode α
⊢ toList (node c a x b) = toList a ++ x :: toList b

tactic: rfl
state_before: α : Type u_1
c : RBColor
a : RBNode α
x : α
b : RBNode α
⊢ toList a ++ x :: foldr (fun x x_1 => x :: x_1) b [] = toList a ++ x :: toList b
Theorem: List.map_pmap
File: Mathlib/Data/List/Basic.lean

tactic: induction l <;> [rfl; simp only [*, pmap, map]]
state_before: ι : Type ?u.326579
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p : α → Prop
g : β → γ
f : (a : α) → p a → β
l : List α
H : ∀ (a : α), a ∈ l → p a
⊢ map g (pmap f l H) = pmap (fun a h => g (f a h)) l H
Theorem: Function.update_apply
File: Mathlib/Logic/Function/Basic.lean

tactic: have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b :=
  by intro h
     rw [eq_rec_constant]
state_before: α : Sort u
β✝ : α → Sort v
α' : Sort w
inst✝¹ : DecidableEq α
inst✝ : DecidableEq α'
f✝ g : (a : α) → β✝ a
a✝ : α
b✝ : β✝ a✝
β : Sort u_1
f : α → β
a' : α
b : β
a : α
⊢ update f a' b a = if a = a' then b else f a

tactic: have h3 : (λ h : a = a' => Eq.rec (motive := λ _ _ => β) b h.symm) =
          (λ _ : a = a' =>  b) := funext h2
state_before: α : Sort u
β✝ : α → Sort v
α' : Sort w
inst✝¹ : DecidableEq α
inst✝ : DecidableEq α'
f✝ g : (a : α) → β✝ a
a✝ : α
b✝ : β✝ a✝
β : Sort u_1
f : α → β
a' : α
b : β
a : α
h2 : ∀ (h : a = a'), (_ : a' = a) ▸ b = b
⊢ update f a' b a = if a = a' then b else f a

tactic: let f := λ x => dite (a = a') x (λ (_: ¬ a = a') => (f a))
state_before: α : Sort u
β✝ : α → Sort v
α' : Sort w
inst✝¹ : DecidableEq α
inst✝ : DecidableEq α'
f✝ g : (a : α) → β✝ a
a✝ : α
b✝ : β✝ a✝
β : Sort u_1
f : α → β
a' : α
b : β
a : α
h2 : ∀ (h : a = a'), (_ : a' = a) ▸ b = b
h3 : (fun h => (_ : a' = a) ▸ b) = fun x => b
⊢ update f a' b a = if a = a' then b else f a

tactic: exact congrArg f h3
state_before: α : Sort u
β✝ : α → Sort v
α' : Sort w
inst✝¹ : DecidableEq α
inst✝ : DecidableEq α'
f✝¹ g : (a : α) → β✝ a
a✝ : α
b✝ : β✝ a✝
β : Sort u_1
f✝ : α → β
a' : α
b : β
a : α
h2 : ∀ (h : a = a'), (_ : a' = a) ▸ b = b
h3 : (fun h => (_ : a' = a) ▸ b) = fun x => b
f : (a = a' → β) → β := fun x => dite (a = a') x fun x => f✝ a
⊢ update f✝ a' b a = if a = a' then b else f✝ a

tactic: intro h
state_before: α : Sort u
β✝ : α → Sort v
α' : Sort w
inst✝¹ : DecidableEq α
inst✝ : DecidableEq α'
f✝ g : (a : α) → β✝ a
a✝ : α
b✝ : β✝ a✝
β : Sort u_1
f : α → β
a' : α
b : β
a : α
⊢ ∀ (h : a = a'), (_ : a' = a) ▸ b = b

tactic: rw [eq_rec_constant]
state_before: α : Sort u
β✝ : α → Sort v
α' : Sort w
inst✝¹ : DecidableEq α
inst✝ : DecidableEq α'
f✝ g : (a : α) → β✝ a
a✝ : α
b✝ : β✝ a✝
β : Sort u_1
f : α → β
a' : α
b : β
a : α
h : a = a'
⊢ (_ : a' = a) ▸ b = b
Theorem: StarSubalgebra.comap_comap
File: Mathlib/Algebra/Star/Subalgebra.lean

tactic: exact Set.preimage_preimage
state_before: F : Type ?u.338269
R : Type u_1
A : Type u_4
B : Type u_3
C : Type u_2
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : Semiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Algebra R A
inst✝⁸ : StarModule R A
inst✝⁷ : Semiring B
inst✝⁶ : StarRing B
inst✝⁵ : Algebra R B
inst✝⁴ : StarModule R B
inst✝³ : Semiring C
inst✝² : StarRing C
inst✝¹ : Algebra R C
inst✝ : StarModule R C
S✝ : StarSubalgebra R A
S : StarSubalgebra R C
g : B →⋆ₐ[R] C
f : A →⋆ₐ[R] B
⊢ ↑(comap f (comap g S)) = ↑(comap (StarAlgHom.comp g f) S)
Theorem: InnerProductGeometry.angle_add_angle_eq_pi_of_angle_eq_pi
File: Mathlib/Geometry/Euclidean/Angle/Unoriented/Basic.lean

tactic: rcases angle_eq_pi_iff.1 h with ⟨_, ⟨r, ⟨hr, rfl⟩⟩⟩
state_before: V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x✝ y✝ x y z : V
h : angle x y = π
⊢ angle x z + angle y z = π

tactic: rw [angle_smul_left_of_neg x z hr, angle_neg_left, add_sub_cancel'_right]
state_before: case intro.intro.intro
V : Type u_1
inst✝¹ : NormedAddCommGroup V
inst✝ : InnerProductSpace ℝ V
x✝ y x z : V
left✝ : x ≠ 0
r : ℝ
hr : r < 0
h : angle x (r • x) = π
⊢ angle x z + angle (r • x) z = π
Theorem: MvPolynomial.pderiv_mul
File: Mathlib/Data/MvPolynomial/PDeriv.lean

tactic: simp only [(pderiv i).leibniz f g, smul_eq_mul, mul_comm, add_comm]
state_before: R : Type u
σ : Type v
a a' a₁ a₂ : R
s : σ →₀ ℕ
inst✝ : CommSemiring R
i : σ
f g : MvPolynomial σ R
⊢ ↑(pderiv i) (f * g) = ↑(pderiv i) f * g + f * ↑(pderiv i) g
Theorem: Pi.basisFun_repr
File: Mathlib/LinearAlgebra/StdBasis.lean

tactic: simp [basisFun]
state_before: R : Type u_1
η : Type u_2
ιs : η → Type ?u.157855
Ms : η → Type ?u.157860
inst✝³ : Semiring R
inst✝² : (i : η) → AddCommMonoid (Ms i)
inst✝¹ : (i : η) → Module R (Ms i)
inst✝ : Fintype η
x : η → R
i : η
⊢ ↑(↑(basisFun R η).repr x) i = x i
Theorem: HasCompactMulSupport.is_one_at_infty
File: Mathlib/Topology/UniformSpace/Compact.lean

tactic: intro N hN
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
⊢ Tendsto f (cocompact α) (𝓝 1)

tactic: rw [mem_map, mem_cocompact']
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
N : Set γ
hN : N ∈ 𝓝 1
⊢ N ∈ map f (cocompact α)

tactic: refine' ⟨mulTSupport f, h.isCompact, _⟩
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
N : Set γ
hN : N ∈ 𝓝 1
⊢ ∃ t, IsCompact t ∧ (f ⁻¹' N)ᶜ ⊆ t

tactic: rw [compl_subset_comm]
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
N : Set γ
hN : N ∈ 𝓝 1
⊢ (f ⁻¹' N)ᶜ ⊆ mulTSupport f

tactic: intro v hv
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
N : Set γ
hN : N ∈ 𝓝 1
⊢ mulTSupport fᶜ ⊆ f ⁻¹' N

tactic: rw [mem_preimage, image_eq_one_of_nmem_mulTSupport hv]
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
N : Set γ
hN : N ∈ 𝓝 1
v : α
hv : v ∈ mulTSupport fᶜ
⊢ v ∈ f ⁻¹' N

tactic: exact mem_of_mem_nhds hN
state_before: α : Type u_2
β : Type ?u.45460
γ : Type u_1
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
f : α → γ
inst✝¹ : TopologicalSpace γ
inst✝ : One γ
h : HasCompactMulSupport f
N : Set γ
hN : N ∈ 𝓝 1
v : α
hv : v ∈ mulTSupport fᶜ
⊢ 1 ∈ N
Theorem: StrictConvex.smul
File: Mathlib/Analysis/Convex/Strict.lean

tactic: obtain rfl | hc := eq_or_ne c 0
state_before: 𝕜 : Type u_1
𝕝 : Type u_3
E : Type u_2
F : Type ?u.99037
β : Type ?u.99040
inst✝¹⁰ : OrderedSemiring 𝕜
inst✝⁹ : TopologicalSpace E
inst✝⁸ : TopologicalSpace F
inst✝⁷ : AddCommGroup E
inst✝⁶ : AddCommGroup F
inst✝⁵ : Module 𝕜 E
inst✝⁴ : Module 𝕜 F
inst✝³ : LinearOrderedField 𝕝
inst✝² : Module 𝕝 E
inst✝¹ : ContinuousConstSMul 𝕝 E
inst✝ : LinearMap.CompatibleSMul E E 𝕜 𝕝
s : Set E
x : E
hs : StrictConvex 𝕜 s
c : 𝕝
⊢ StrictConvex 𝕜 (c • s)

tactic: exact (subsingleton_zero_smul_set _).strictConvex
state_before: case inl
𝕜 : Type u_1
𝕝 : Type u_3
E : Type u_2
F : Type ?u.99037
β : Type ?u.99040
inst✝¹⁰ : OrderedSemiring 𝕜
inst✝⁹ : TopologicalSpace E
inst✝⁸ : TopologicalSpace F
inst✝⁷ : AddCommGroup E
inst✝⁶ : AddCommGroup F
inst✝⁵ : Module 𝕜 E
inst✝⁴ : Module 𝕜 F
inst✝³ : LinearOrderedField 𝕝
inst✝² : Module 𝕝 E
inst✝¹ : ContinuousConstSMul 𝕝 E
inst✝ : LinearMap.CompatibleSMul E E 𝕜 𝕝
s : Set E
x : E
hs : StrictConvex 𝕜 s
⊢ StrictConvex 𝕜 (0 • s)

tactic: exact hs.linear_image (LinearMap.lsmul _ _ c) (isOpenMap_smul₀ hc)
state_before: case inr
𝕜 : Type u_1
𝕝 : Type u_3
E : Type u_2
F : Type ?u.99037
β : Type ?u.99040
inst✝¹⁰ : OrderedSemiring 𝕜
inst✝⁹ : TopologicalSpace E
inst✝⁸ : TopologicalSpace F
inst✝⁷ : AddCommGroup E
inst✝⁶ : AddCommGroup F
inst✝⁵ : Module 𝕜 E
inst✝⁴ : Module 𝕜 F
inst✝³ : LinearOrderedField 𝕝
inst✝² : Module 𝕝 E
inst✝¹ : ContinuousConstSMul 𝕝 E
inst✝ : LinearMap.CompatibleSMul E E 𝕜 𝕝
s : Set E
x : E
hs : StrictConvex 𝕜 s
c : 𝕝
hc : c ≠ 0
⊢ StrictConvex 𝕜 (c • s)
Theorem: SameRay.nonneg_smul_right
File: Mathlib/LinearAlgebra/Ray.lean

tactic: rw [hy, smul_zero]
state_before: R : Type u_1
inst✝⁵ : StrictOrderedCommSemiring R
M : Type u_2
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
N : Type ?u.26709
inst✝² : AddCommMonoid N
inst✝¹ : Module R N
ι : Type ?u.26791
inst✝ : DecidableEq ι
x y z : M
r : R
h : SameRay R x y
hr : 0 ≤ r
hy : y = 0
⊢ r • y = 0
Theorem: iteratedFDeriv_const_smul_apply
File: Mathlib/Analysis/Calculus/ContDiff.lean

tactic: simp_rw [← contDiffOn_univ, ← iteratedFDerivWithin_univ] at *
state_before: 𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹³ : NormedAddCommGroup D
inst✝¹² : NormedSpace 𝕜 D
E : Type uE
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
F : Type uF
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
G : Type uG
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
X : Type ?u.2147408
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x✝ x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
R : Type u_2
inst✝³ : Semiring R
inst✝² : Module R F
inst✝¹ : SMulCommClass 𝕜 R F
inst✝ : ContinuousConstSMul R F
i : ℕ
a : R
x : E
hf : ContDiff 𝕜 (↑i) f
⊢ iteratedFDeriv 𝕜 i (a • f) x = a • iteratedFDeriv 𝕜 i f x

tactic: refine' iteratedFDerivWithin_const_smul_apply hf uniqueDiffOn_univ (Set.mem_univ _)
state_before: 𝕜 : Type u_1
inst✝¹⁴ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹³ : NormedAddCommGroup D
inst✝¹² : NormedSpace 𝕜 D
E : Type uE
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
F : Type uF
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
G : Type uG
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
X : Type ?u.2147408
inst✝⁵ : NormedAddCommGroup X
inst✝⁴ : NormedSpace 𝕜 X
s s₁ t u : Set E
f f₁ : E → F
g : F → G
x✝ x₀ : E
c : F
b : E × F → G
m n : ℕ∞
p : E → FormalMultilinearSeries 𝕜 E F
R : Type u_2
inst✝³ : Semiring R
inst✝² : Module R F
inst✝¹ : SMulCommClass 𝕜 R F
inst✝ : ContinuousConstSMul R F
i : ℕ
a : R
x : E
hf : ContDiffOn 𝕜 (↑i) f univ
⊢ iteratedFDerivWithin 𝕜 i (a • f) univ x = a • iteratedFDerivWithin 𝕜 i f univ x
Theorem: IsUnifLocDoublingMeasure.ae_tendsto_average
File: Mathlib/MeasureTheory/Covering/DensityTheorem.lean

tactic: filter_upwards [(vitaliFamily μ K).ae_tendsto_average hf] with x hx ι l w δ δlim xmem using
  hx.comp (tendsto_closedBall_filterAt μ _ _ δlim xmem)
state_before: α : Type u_2
inst✝⁸ : MetricSpace α
inst✝⁷ : MeasurableSpace α
μ : MeasureTheory.Measure α
inst✝⁶ : IsUnifLocDoublingMeasure μ
inst✝⁵ : SecondCountableTopology α
inst✝⁴ : BorelSpace α
inst✝³ : IsLocallyFiniteMeasure μ
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : α → E
hf : Integrable f
K : ℝ
⊢ ∀ᵐ (x : α) ∂μ,
    ∀ {ι : Type u_3} {l : Filter ι} (w : ι → α) (δ : ι → ℝ),
      Tendsto δ l (𝓝[Ioi 0] 0) →
        (∀ᶠ (j : ι) in l, x ∈ closedBall (w j) (K * δ j)) →
          Tendsto (fun j => ⨍ (y : α) in closedBall (w j) (δ j), f y ∂μ) l (𝓝 (f x))
Theorem: Polynomial.comp_one
File: Mathlib/Data/Polynomial/Eval.lean

tactic: rw [← C_1, comp_C]
state_before: R : Type u
S : Type v
T : Type w
ι : Type y
a b : R
m n : ℕ
inst✝ : Semiring R
p q r : R[X]
⊢ comp p 1 = ↑C (eval 1 p)
Theorem: CategoryTheory.Splitting.iso_comp_eq_snd
File: Mathlib/Algebra/Homology/ShortExact/Preadditive.lean

tactic: rw [Iso.inv_comp_eq, h.iso_comp_snd_eq]
state_before: 𝒜 : Type u_2
inst✝² : Category 𝒜
A B C A' B' C' : 𝒜
f : A ⟶ B
g : B ⟶ C
f' : A' ⟶ B'
g' : B' ⟶ C'
inst✝¹ : HasZeroMorphisms 𝒜
inst✝ : HasBinaryBiproducts 𝒜
h : Splitting f g
⊢ h.iso.inv ≫ g = biprod.snd
Theorem: CategoryTheory.Bicategory.whiskerLeft_rightUnitor_inv
File: Mathlib/CategoryTheory/Bicategory/Basic.lean

tactic: simp
state_before: B : Type u
inst✝ : Bicategory B
a b c d e : B
f : a ⟶ b
g : b ⟶ c
⊢ inv (f ◁ (ρ_ g).inv) = inv ((ρ_ (f ≫ g)).inv ≫ (α_ f g (𝟙 c)).hom)
Theorem: Polynomial.reverse_neg
File: Mathlib/Data/Polynomial/Reverse.lean

tactic: rw [reverse, reverse, reflect_neg, natDegree_neg]
state_before: R : Type u_1
inst✝ : Ring R
f : R[X]
⊢ reverse (-f) = -reverse f
Theorem: MeasureTheory.MeasurePreserving.integrable_comp
File: Mathlib/MeasureTheory/Function/L1Space.lean

tactic: rw [← hf.map_eq] at hg ⊢
state_before: α : Type u_2
β : Type u_3
γ : Type ?u.935096
δ : Type u_1
m : MeasurableSpace α
μ ν✝ : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
ν : Measure δ
g : δ → β
f : α → δ
hf : MeasurePreserving f
hg : AEStronglyMeasurable g ν
⊢ Integrable (g ∘ f) ↔ Integrable g

tactic: exact (integrable_map_measure hg hf.measurable.aemeasurable).symm
state_before: α : Type u_2
β : Type u_3
γ : Type ?u.935096
δ : Type u_1
m : MeasurableSpace α
μ ν✝ : Measure α
inst✝² : MeasurableSpace δ
inst✝¹ : NormedAddCommGroup β
inst✝ : NormedAddCommGroup γ
ν : Measure δ
g : δ → β
f : α → δ
hf : MeasurePreserving f
hg : AEStronglyMeasurable g (Measure.map f μ)
⊢ Integrable (g ∘ f) ↔ Integrable g
Theorem: Decidable.not_iff
File: Std/Logic.lean

tactic: by_cases h : b <;> simp [h, iff_true, iff_false]
state_before: b a : Prop
inst✝ : Decidable b
⊢ ¬(a ↔ b) ↔ (¬a ↔ b)
Theorem: CategoryTheory.Projective.projective_iff_preservesEpimorphisms_preadditiveCoyoneda_obj'
File: Mathlib/CategoryTheory/Preadditive/Yoneda/Projective.lean

tactic: rw [projective_iff_preservesEpimorphisms_coyoneda_obj]
state_before: C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
P : C
⊢ Projective P ↔ Functor.PreservesEpimorphisms (preadditiveCoyoneda.obj P.op)

tactic: refine' ⟨fun h : (preadditiveCoyoneda.obj (op P) ⋙
    forget AddCommGroupCat).PreservesEpimorphisms => _, _⟩
state_before: C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
P : C
⊢ Functor.PreservesEpimorphisms (coyoneda.obj P.op) ↔ Functor.PreservesEpimorphisms (preadditiveCoyoneda.obj P.op)

tactic: exact Functor.preservesEpimorphisms_of_preserves_of_reflects (preadditiveCoyoneda.obj (op P))
    (forget _)
state_before: case refine'_1
C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
P : C
h : Functor.PreservesEpimorphisms (preadditiveCoyoneda.obj P.op ⋙ forget AddCommGroupCat)
⊢ Functor.PreservesEpimorphisms (preadditiveCoyoneda.obj P.op)

tactic: intro
state_before: case refine'_2
C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
P : C
⊢ Functor.PreservesEpimorphisms (preadditiveCoyoneda.obj P.op) → Functor.PreservesEpimorphisms (coyoneda.obj P.op)

tactic: exact (inferInstance : (preadditiveCoyoneda.obj (op P) ⋙ forget _).PreservesEpimorphisms)
state_before: case refine'_2
C : Type u
inst✝¹ : Category C
inst✝ : Preadditive C
P : C
a✝ : Functor.PreservesEpimorphisms (preadditiveCoyoneda.obj P.op)
⊢ Functor.PreservesEpimorphisms (coyoneda.obj P.op)
Theorem: EMetric.edist_le_infEdist_add_ediam
File: Mathlib/Topology/MetricSpace/HausdorffDistance.lean

tactic: simp_rw [infEdist, ENNReal.iInf_add]
state_before: ι : Sort ?u.8332
α : Type u
β : Type v
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : α
s t : Set α
Φ : α → β
hy : y ∈ s
⊢ edist x y ≤ infEdist x s + diam s

tactic: refine le_iInf₂ fun i hi => ?_
state_before: ι : Sort ?u.8332
α : Type u
β : Type v
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : α
s t : Set α
Φ : α → β
hy : y ∈ s
⊢ edist x y ≤ ⨅ (i : α) (_ : i ∈ s), edist x i + diam s

tactic: calc
  edist x y ≤ edist x i + edist i y := edist_triangle _ _ _
  _ ≤ edist x i + diam s := add_le_add le_rfl (edist_le_diam_of_mem hi hy)
state_before: ι : Sort ?u.8332
α : Type u
β : Type v
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
x y : α
s t : Set α
Φ : α → β
hy : y ∈ s
i : α
hi : i ∈ s
⊢ edist x y ≤ edist x i + diam s
Theorem: Set.Icc_diff_Ioo_same
File: Mathlib/Data/Set/Intervals/Basic.lean

tactic: rw [← Icc_diff_both, diff_diff_cancel_left]
state_before: α : Type u_1
β : Type ?u.44269
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ Icc a b \ Ioo a b = {a, b}

tactic: simp [insert_subset, h]
state_before: α : Type u_1
β : Type ?u.44269
inst✝ : PartialOrder α
a b c : α
h : a ≤ b
⊢ {a, b} ⊆ Icc a b
Theorem: Seminorm.Seminorm.isLUB_sSup
File: Mathlib/Analysis/Seminorm.lean

tactic: refine' ⟨fun p hp x => _, fun p hp x => _⟩ <;> haveI : Nonempty ↑s := hs₂.coe_sort <;>
  dsimp <;> rw [Seminorm.coe_sSup_eq hs₁, iSup_apply]
state_before: R : Type ?u.778047
R' : Type ?u.778050
𝕜 : Type u_2
𝕜₂ : Type ?u.778056
𝕜₃ : Type ?u.778059
𝕝 : Type ?u.778062
E : Type u_1
E₂ : Type ?u.778068
E₃ : Type ?u.778071
F : Type ?u.778074
G : Type ?u.778077
ι : Type ?u.778080
inst✝² : NormedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
p q : Seminorm 𝕜 E
x : E
s : Set (Seminorm 𝕜 E)
hs₁ : BddAbove s
hs₂ : Set.Nonempty s
⊢ IsLUB s (sSup s)

tactic: rcases hs₁ with ⟨q, hq⟩
state_before: case refine'_1
R : Type ?u.778047
R' : Type ?u.778050
𝕜 : Type u_2
𝕜₂ : Type ?u.778056
𝕜₃ : Type ?u.778059
𝕝 : Type ?u.778062
E : Type u_1
E₂ : Type ?u.778068
E₃ : Type ?u.778071
F : Type ?u.778074
G : Type ?u.778077
ι : Type ?u.778080
inst✝² : NormedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
p✝ q : Seminorm 𝕜 E
x✝ : E
s : Set (Seminorm 𝕜 E)
hs₁ : BddAbove s
hs₂ : Set.Nonempty s
p : Seminorm 𝕜 E
hp : p ∈ s
x : E
this : Nonempty ↑s
⊢ ↑p x ≤ ⨆ (i : ↑s), ↑↑i x

tactic: exact le_ciSup ⟨q x, forall_range_iff.mpr fun i : s => hq i.2 x⟩ ⟨p, hp⟩
state_before: case refine'_1.intro
R : Type ?u.778047
R' : Type ?u.778050
𝕜 : Type u_2
𝕜₂ : Type ?u.778056
𝕜₃ : Type ?u.778059
𝕝 : Type ?u.778062
E : Type u_1
E₂ : Type ?u.778068
E₃ : Type ?u.778071
F : Type ?u.778074
G : Type ?u.778077
ι : Type ?u.778080
inst✝² : NormedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
p✝ q✝ : Seminorm 𝕜 E
x✝ : E
s : Set (Seminorm 𝕜 E)
hs₂ : Set.Nonempty s
p : Seminorm 𝕜 E
hp : p ∈ s
x : E
this : Nonempty ↑s
q : Seminorm 𝕜 E
hq : q ∈ upperBounds s
⊢ ↑p x ≤ ⨆ (i : ↑s), ↑↑i x

tactic: exact ciSup_le fun q => hp q.2 x
state_before: case refine'_2
R : Type ?u.778047
R' : Type ?u.778050
𝕜 : Type u_2
𝕜₂ : Type ?u.778056
𝕜₃ : Type ?u.778059
𝕝 : Type ?u.778062
E : Type u_1
E₂ : Type ?u.778068
E₃ : Type ?u.778071
F : Type ?u.778074
G : Type ?u.778077
ι : Type ?u.778080
inst✝² : NormedField 𝕜
inst✝¹ : AddCommGroup E
inst✝ : Module 𝕜 E
p✝ q : Seminorm 𝕜 E
x✝ : E
s : Set (Seminorm 𝕜 E)
hs₁ : BddAbove s
hs₂ : Set.Nonempty s
p : Seminorm 𝕜 E
hp : p ∈ upperBounds s
x : E
this : Nonempty ↑s
⊢ (⨆ (i : ↑s), ↑↑i x) ≤ ↑p x
Theorem: EuclideanGeometry.angle_eq_angle_of_angle_eq_pi
File: Mathlib/Geometry/Euclidean/Angle/Unoriented/Affine.lean

tactic: unfold angle at *
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p1 p2 p3 p4 : P
h : ∠ p2 p3 p4 = π
⊢ ∠ p1 p2 p3 = ∠ p1 p2 p4

tactic: rcases angle_eq_pi_iff.1 h with ⟨_, ⟨r, ⟨hr, hpr⟩⟩⟩
state_before: V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p1 p2 p3 p4 : P
h : InnerProductGeometry.angle (p2 -ᵥ p3) (p4 -ᵥ p3) = π
⊢ InnerProductGeometry.angle (p1 -ᵥ p2) (p3 -ᵥ p2) = InnerProductGeometry.angle (p1 -ᵥ p2) (p4 -ᵥ p2)

tactic: rw [eq_comm]
state_before: case intro.intro.intro
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p1 p2 p3 p4 : P
h : InnerProductGeometry.angle (p2 -ᵥ p3) (p4 -ᵥ p3) = π
left✝ : p2 -ᵥ p3 ≠ 0
r : ℝ
hr : r < 0
hpr : p4 -ᵥ p3 = r • (p2 -ᵥ p3)
⊢ InnerProductGeometry.angle (p1 -ᵥ p2) (p3 -ᵥ p2) = InnerProductGeometry.angle (p1 -ᵥ p2) (p4 -ᵥ p2)

tactic: convert angle_smul_right_of_pos (p1 -ᵥ p2) (p3 -ᵥ p2) (add_pos (neg_pos_of_neg hr) zero_lt_one)
state_before: case intro.intro.intro
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p1 p2 p3 p4 : P
h : InnerProductGeometry.angle (p2 -ᵥ p3) (p4 -ᵥ p3) = π
left✝ : p2 -ᵥ p3 ≠ 0
r : ℝ
hr : r < 0
hpr : p4 -ᵥ p3 = r • (p2 -ᵥ p3)
⊢ InnerProductGeometry.angle (p1 -ᵥ p2) (p4 -ᵥ p2) = InnerProductGeometry.angle (p1 -ᵥ p2) (p3 -ᵥ p2)

tactic: rw [add_smul, ← neg_vsub_eq_vsub_rev p2 p3, smul_neg, neg_smul, ← hpr]
state_before: case h.e'_2.h.e'_5
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p1 p2 p3 p4 : P
h : InnerProductGeometry.angle (p2 -ᵥ p3) (p4 -ᵥ p3) = π
left✝ : p2 -ᵥ p3 ≠ 0
r : ℝ
hr : r < 0
hpr : p4 -ᵥ p3 = r • (p2 -ᵥ p3)
⊢ p4 -ᵥ p2 = (-r + 1) • (p3 -ᵥ p2)

tactic: simp
state_before: case h.e'_2.h.e'_5
V : Type u_1
P : Type u_2
inst✝³ : NormedAddCommGroup V
inst✝² : InnerProductSpace ℝ V
inst✝¹ : MetricSpace P
inst✝ : NormedAddTorsor V P
p1 p2 p3 p4 : P
h : InnerProductGeometry.angle (p2 -ᵥ p3) (p4 -ᵥ p3) = π
left✝ : p2 -ᵥ p3 ≠ 0
r : ℝ
hr : r < 0
hpr : p4 -ᵥ p3 = r • (p2 -ᵥ p3)
⊢ p4 -ᵥ p2 = - -(p4 -ᵥ p3) + 1 • -(p2 -ᵥ p3)
Theorem: Polynomial.natTrailingDegree_mul'
File: Mathlib/Data/Polynomial/Degree/TrailingDegree.lean

tactic: have hp : p ≠ 0 := fun hp => h (by rw [hp, trailingCoeff_zero, zero_mul])
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
⊢ natTrailingDegree (p * q) = natTrailingDegree p + natTrailingDegree q

tactic: have hq : q ≠ 0 := fun hq => h (by rw [hq, trailingCoeff_zero, mul_zero])
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p ≠ 0
⊢ natTrailingDegree (p * q) = natTrailingDegree p + natTrailingDegree q

tactic: have aux1 : ∀ n, Nat.cast n = WithTop.some (n) := fun n ↦ rfl
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p ≠ 0
hq : q ≠ 0
⊢ natTrailingDegree (p * q) = natTrailingDegree p + natTrailingDegree q

tactic: have aux2 : ∀ (p : R[X]), WithTop.some (natTrailingDegree p) = Nat.cast (natTrailingDegree p) :=
  fun p ↦ rfl
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p ≠ 0
hq : q ≠ 0
aux1 : ∀ (n : ℕ), ↑n = ↑n
⊢ natTrailingDegree (p * q) = natTrailingDegree p + natTrailingDegree q

tactic: apply natTrailingDegree_eq_of_trailingDegree_eq_some
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p ≠ 0
hq : q ≠ 0
aux1 : ∀ (n : ℕ), ↑n = ↑n
aux2 : ∀ (p : R[X]), ↑(natTrailingDegree p) = ↑(natTrailingDegree p)
⊢ natTrailingDegree (p * q) = natTrailingDegree p + natTrailingDegree q

tactic: rw [trailingDegree_mul' h, aux1 (natTrailingDegree p + natTrailingDegree q),
  WithTop.coe_add, aux2 p, aux2 q, ← trailingDegree_eq_natTrailingDegree hp, ←
  trailingDegree_eq_natTrailingDegree hq]
state_before: case h
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p ≠ 0
hq : q ≠ 0
aux1 : ∀ (n : ℕ), ↑n = ↑n
aux2 : ∀ (p : R[X]), ↑(natTrailingDegree p) = ↑(natTrailingDegree p)
⊢ trailingDegree (p * q) = ↑(natTrailingDegree p + natTrailingDegree q)

tactic: rw [hp, trailingCoeff_zero, zero_mul]
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p = 0
⊢ trailingCoeff p * trailingCoeff q = 0

tactic: rw [hq, trailingCoeff_zero, mul_zero]
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r : R[X]
h : trailingCoeff p * trailingCoeff q ≠ 0
hp : p ≠ 0
hq : q = 0
⊢ trailingCoeff p * trailingCoeff q = 0