1337xyz1337xyz/leandojo-benchmark4-v10 huggingface dataset:
Theorem: DFinsupp.coe_piecewise
File: Mathlib/Data/DFinsupp/Basic.lean

tactic: ext
state_before: ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : (i : ι) → Zero (β i)
inst✝² : (i : ι) → Zero (β₁ i)
inst✝¹ : (i : ι) → Zero (β₂ i)
x y : Π₀ (i : ι), β i
s : Set ι
inst✝ : (i : ι) → Decidable (i ∈ s)
⊢ ⇑(x.piecewise y s) = s.piecewise ⇑x ⇑y
state_after: case h
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : (i : ι) → Zero (β i)
inst✝² : (i : ι) → Zero (β₁ i)
inst✝¹ : (i : ι) → Zero (β₂ i)
x y : Π₀ (i : ι), β i
s : Set ι
inst✝ : (i : ι) → Decidable (i ∈ s)
x✝ : ι
⊢ (x.piecewise y s) x✝ = s.piecewise (⇑x) (⇑y) x✝

tactic: apply piecewise_apply
state_before: case h
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
inst✝³ : (i : ι) → Zero (β i)
inst✝² : (i : ι) → Zero (β₁ i)
inst✝¹ : (i : ι) → Zero (β₂ i)
x y : Π₀ (i : ι), β i
s : Set ι
inst✝ : (i : ι) → Decidable (i ∈ s)
x✝ : ι
⊢ (x.piecewise y s) x✝ = s.piecewise (⇑x) (⇑y) x✝
state_after: no goals
Theorem: UpperHalfPlane.sinh_half_dist
File: Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean

tactic: rw [dist_eq, mul_div_cancel_left₀ (arsinh _) two_ne_zero, sinh_arsinh]
state_before: z✝ w✝ : ℍ
r R : ℝ
z w : ℍ
⊢ sinh (dist z w / 2) = dist ↑z ↑w / (2 * √(z.im * w.im))
state_after: no goals
Theorem: ENorm.map_sub_le
File: Mathlib/Analysis/NormedSpace/ENorm.lean

tactic: rw [sub_eq_add_neg]
state_before: 𝕜 : Type u_1
V : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : AddCommGroup V
inst✝ : Module 𝕜 V
e : ENorm 𝕜 V
x y : V
⊢ ↑e (x - y) = ↑e (x + -y)
state_after: no goals

tactic: rw [e.map_neg]
state_before: 𝕜 : Type u_1
V : Type u_2
inst✝² : NormedField 𝕜
inst✝¹ : AddCommGroup V
inst✝ : Module 𝕜 V
e : ENorm 𝕜 V
x y : V
⊢ ↑e x + ↑e (-y) = ↑e x + ↑e y
state_after: no goals
Theorem: Complex.inv_I
File: Mathlib/Data/Complex/Basic.lean

tactic: rw [inv_eq_one_div, div_I, one_mul]
state_before: ⊢ I⁻¹ = -I
state_after: no goals
Theorem: norm_smul
File: Mathlib/Analysis/Normed/MulAction.lean

tactic: by_cases h : r = 0
state_before: α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
⊢ ‖r • x‖ = ‖r‖ * ‖x‖
state_after: case pos
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : r = 0
⊢ ‖r • x‖ = ‖r‖ * ‖x‖

case neg
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r • x‖ = ‖r‖ * ‖x‖

tactic: simp [h, zero_smul α x]
state_before: case pos
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : r = 0
⊢ ‖r • x‖ = ‖r‖ * ‖x‖
state_after: no goals

tactic: refine le_antisymm (norm_smul_le r x) ?_
state_before: case neg
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r • x‖ = ‖r‖ * ‖x‖
state_after: case neg
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖x‖ ≤ ‖r • x‖

tactic: calc
  ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by rw [inv_smul_smul₀ h]
  _ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) := by gcongr; apply norm_smul_le
  _ = ‖r • x‖ := by rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul]
state_before: case neg
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖x‖ ≤ ‖r • x‖
state_after: no goals

tactic: rw [inv_smul_smul₀ h]
state_before: α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖
state_after: no goals

tactic: gcongr
state_before: α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖r⁻¹ • r • x‖ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖)
state_after: case h
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r⁻¹ • r • x‖ ≤ ‖r⁻¹‖ * ‖r • x‖

tactic: apply norm_smul_le
state_before: case h
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r⁻¹ • r • x‖ ≤ ‖r⁻¹‖ * ‖r • x‖
state_after: no goals

tactic: rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul]
state_before: α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) = ‖r • x‖
state_after: no goals
Theorem: Submodule.mem_sSup
File: Mathlib/LinearAlgebra/Span.lean

tactic: simp_rw [sSup_eq_iSup, Submodule.mem_iSup, iSup_le_iff]
state_before: R : Type u_1
R₂ : Type u_2
K : Type u_3
M : Type u_4
M₂ : Type u_5
V : Type u_6
S : Type u_7
inst✝⁷ : Semiring R
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
x : M
p p' : Submodule R M
inst✝⁴ : Semiring R₂
σ₁₂ : R →+* R₂
inst✝³ : AddCommMonoid M₂
inst✝² : Module R₂ M₂
F : Type u_8
inst✝¹ : FunLike F M M₂
inst✝ : SemilinearMapClass F σ₁₂ M M₂
s✝ t : Set M
s : Set (Submodule R M)
m : M
⊢ m ∈ sSup s ↔ ∀ (N : Submodule R M), (∀ p ∈ s, p ≤ N) → m ∈ N
state_after: no goals
Theorem: minpoly.isRadical
File: Mathlib/FieldTheory/Minpoly/Field.lean

tactic: rw [dvd_iff] at dvd ⊢
state_before: A : Type u_1
B : Type u_2
inst✝³ : Field A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : IsReduced B
n : ℕ
p : A[X]
dvd : minpoly A x ∣ p ^ n
⊢ minpoly A x ∣ p
state_after: A : Type u_1
B : Type u_2
inst✝³ : Field A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : IsReduced B
n : ℕ
p : A[X]
dvd : (Polynomial.aeval x) (p ^ n) = 0
⊢ (Polynomial.aeval x) p = 0

tactic: rw [map_pow] at dvd
state_before: A : Type u_1
B : Type u_2
inst✝³ : Field A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : IsReduced B
n : ℕ
p : A[X]
dvd : (Polynomial.aeval x) (p ^ n) = 0
⊢ (Polynomial.aeval x) p = 0
state_after: A : Type u_1
B : Type u_2
inst✝³ : Field A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : IsReduced B
n : ℕ
p : A[X]
dvd : (Polynomial.aeval x) p ^ n = 0
⊢ (Polynomial.aeval x) p = 0

tactic: exact IsReduced.eq_zero _ ⟨n, dvd⟩
state_before: A : Type u_1
B : Type u_2
inst✝³ : Field A
inst✝² : Ring B
inst✝¹ : Algebra A B
x : B
inst✝ : IsReduced B
n : ℕ
p : A[X]
dvd : (Polynomial.aeval x) p ^ n = 0
⊢ (Polynomial.aeval x) p = 0
state_after: no goals
Theorem: Rat.divInt_neg'
File: .lake/packages/batteries/Batteries/Data/Rat/Lemmas.lean

tactic: rw [← neg_divInt_neg, Int.neg_neg]
state_before: num den : Int
⊢ num /. -den = -num /. den
state_after: no goals
Theorem: ULift.down_inj
File: Mathlib/Logic/Basic.lean

tactic: rw [h]
state_before: α✝ : Sort u_1
α : Type u_2
a b : ULift.{u_3, u_2} α
h : a = b
⊢ a.down = b.down
state_after: no goals
Theorem: Polynomial.lifts_iff_coeff_lifts
File: Mathlib/Algebra/Polynomial/Lifts.lean

tactic: rw [lifts_iff_ringHom_rangeS, mem_map_rangeS f]
state_before: R : Type u
inst✝¹ : Semiring R
S : Type v
inst✝ : Semiring S
f : R →+* S
p : S[X]
⊢ p ∈ lifts f ↔ ∀ (n : ℕ), p.coeff n ∈ Set.range ⇑f
state_after: R : Type u
inst✝¹ : Semiring R
S : Type v
inst✝ : Semiring S
f : R →+* S
p : S[X]
⊢ (∀ (n : ℕ), p.coeff n ∈ f.rangeS) ↔ ∀ (n : ℕ), p.coeff n ∈ Set.range ⇑f

tactic: rfl
state_before: R : Type u
inst✝¹ : Semiring R
S : Type v
inst✝ : Semiring S
f : R →+* S
p : S[X]
⊢ (∀ (n : ℕ), p.coeff n ∈ f.rangeS) ↔ ∀ (n : ℕ), p.coeff n ∈ Set.range ⇑f
state_after: no goals
Theorem: R1Space.t2Space_iff_t0Space
File: Mathlib/Topology/Separation.lean

tactic: constructor <;> intro <;> infer_instance
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : FirstCountableTopology X
inst✝ : R1Space X
⊢ T2Space X ↔ T0Space X
state_after: no goals
Theorem: Cardinal.exists_nat_eq_of_le_nat
File: Mathlib/SetTheory/Cardinal/Basic.lean

tactic: lift c to ℕ using h.trans_lt (nat_lt_aleph0 _)
state_before: α β : Type u
c : Cardinal.{u_1}
n : ℕ
h : c ≤ ↑n
⊢ ∃ m ≤ n, c = ↑m
state_after: case intro
α β : Type u
n c : ℕ
h : ↑c ≤ ↑n
⊢ ∃ m ≤ n, ↑c = ↑m

tactic: exact ⟨c, mod_cast h, rfl⟩
state_before: case intro
α β : Type u
n c : ℕ
h : ↑c ≤ ↑n
⊢ ∃ m ≤ n, ↑c = ↑m
state_after: no goals
Theorem: MeasureTheory.Integrable.integral_norm_condDistrib_map
File: Mathlib/Probability/Kernel/CondDistrib.lean

tactic: rw [condDistrib, ← Measure.fst_map_prod_mk₀ (X := X) hY]
state_before: α : Type u_1
β : Type u_2
Ω : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
inst✝¹ : NormedAddCommGroup F
mα : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
X : α → β
Y : α → Ω
mβ : MeasurableSpace β
s : Set Ω
t : Set β
f : β × Ω → F
hY : AEMeasurable Y μ
hf_int : Integrable f (Measure.map (fun a => (X a, Y a)) μ)
⊢ Integrable (fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂(condDistrib Y X μ) x) (Measure.map X μ)
state_after: α : Type u_1
β : Type u_2
Ω : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
inst✝¹ : NormedAddCommGroup F
mα : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
X : α → β
Y : α → Ω
mβ : MeasurableSpace β
s : Set Ω
t : Set β
f : β × Ω → F
hY : AEMeasurable Y μ
hf_int : Integrable f (Measure.map (fun a => (X a, Y a)) μ)
⊢ Integrable (fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.map (fun a => (X a, Y a)) μ).condKernel x)
    (Measure.map (fun a => (X a, Y a)) μ).fst

tactic: exact hf_int.integral_norm_condKernel
state_before: α : Type u_1
β : Type u_2
Ω : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
inst✝¹ : NormedAddCommGroup F
mα : MeasurableSpace α
μ : Measure α
inst✝ : IsFiniteMeasure μ
X : α → β
Y : α → Ω
mβ : MeasurableSpace β
s : Set Ω
t : Set β
f : β × Ω → F
hY : AEMeasurable Y μ
hf_int : Integrable f (Measure.map (fun a => (X a, Y a)) μ)
⊢ Integrable (fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂(Measure.map (fun a => (X a, Y a)) μ).condKernel x)
    (Measure.map (fun a => (X a, Y a)) μ).fst
state_after: no goals
Theorem: inf_covBy_of_covBy_sup_of_covBy_sup_right
File: Mathlib/Order/ModularLattice.lean

tactic: rw [sup_comm, inf_comm]
state_before: α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakLowerModularLattice α
a b : α
⊢ a ⋖ a ⊔ b → b ⋖ a ⊔ b → a ⊓ b ⋖ b
state_after: α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakLowerModularLattice α
a b : α
⊢ a ⋖ b ⊔ a → b ⋖ b ⊔ a → b ⊓ a ⋖ b

tactic: exact fun ha hb => inf_covBy_of_covBy_sup_of_covBy_sup_left hb ha
state_before: α : Type u_1
inst✝¹ : Lattice α
inst✝ : IsWeakLowerModularLattice α
a b : α
⊢ a ⋖ b ⊔ a → b ⋖ b ⊔ a → b ⊓ a ⋖ b
state_after: no goals
Theorem: Real.Angle.sin_toReal
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean

tactic: conv_rhs => rw [← coe_toReal θ, sin_coe]
state_before: θ : Angle
⊢ Real.sin θ.toReal = θ.sin
state_after: no goals
Theorem: Finset.nonempty_mk
File: Mathlib/Data/Finset/Basic.lean

tactic: induction m using Multiset.induction_on <;> simp
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
s t : Finset α
a b : α
m : Multiset α
hm : m.Nodup
⊢ { val := m, nodup := hm }.Nonempty ↔ m ≠ 0
state_after: no goals
Theorem: BoundedContinuousFunction.dist_zero_of_empty
File: Mathlib/Topology/ContinuousFunction/Bounded.lean

tactic: rw [(ext isEmptyElim : f = g), dist_self]
state_before: F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : PseudoMetricSpace β
inst✝¹ : PseudoMetricSpace γ
f g : α →ᵇ β
x : α
C : ℝ
inst✝ : IsEmpty α
⊢ dist f g = 0
state_after: no goals
Theorem: MeasureTheory.integral_indicatorConstLp
File: Mathlib/MeasureTheory/Integral/SetIntegral.lean

tactic: rw [integral_univ]
state_before: X : Type u_1
Y : Type u_2
E : Type u_3
F : Type u_4
inst✝³ : MeasurableSpace X
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
f g : X → E
s t : Set X
μ ν : Measure X
l l' : Filter X
inst✝ : CompleteSpace E
p : ℝ≥0∞
ht : MeasurableSet t
hμt : μ t ≠ ⊤
e : E
⊢ ∫ (x : X), ↑↑(indicatorConstLp p ht hμt e) x ∂μ = ∫ (x : X) in univ, ↑↑(indicatorConstLp p ht hμt e) x ∂μ
state_after: no goals

tactic: rw [inter_univ]
state_before: X : Type u_1
Y : Type u_2
E : Type u_3
F : Type u_4
inst✝³ : MeasurableSpace X
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
f g : X → E
s t : Set X
μ ν : Measure X
l l' : Filter X
inst✝ : CompleteSpace E
p : ℝ≥0∞
ht : MeasurableSet t
hμt : μ t ≠ ⊤
e : E
⊢ (μ (t ∩ univ)).toReal • e = (μ t).toReal • e
state_after: no goals
Theorem: Orientation.oangle_sub_left
File: Mathlib/Geometry/Euclidean/Angle/Oriented/Basic.lean

tactic: rw [sub_eq_iff_eq_add, o.oangle_add_swap hx hy hz]
state_before: V : Type u_1
V' : Type u_2
inst✝⁵ : NormedAddCommGroup V
inst✝⁴ : NormedAddCommGroup V'
inst✝³ : InnerProductSpace ℝ V
inst✝² : InnerProductSpace ℝ V'
inst✝¹ : Fact (finrank ℝ V = 2)
inst✝ : Fact (finrank ℝ V' = 2)
o : Orientation ℝ V (Fin 2)
x y z : V
hx : x ≠ 0
hy : y ≠ 0
hz : z ≠ 0
⊢ o.oangle x z - o.oangle x y = o.oangle y z
state_after: no goals
Theorem: sameRay_iff_inv_norm_smul_eq
File: Mathlib/Analysis/NormedSpace/Ray.lean

tactic: rcases eq_or_ne x 0 with (rfl | hx)
state_before: E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x y : F
⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y
state_after: case inl
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
y : F
⊢ SameRay ℝ 0 y ↔ 0 = 0 ∨ y = 0 ∨ ‖0‖⁻¹ • 0 = ‖y‖⁻¹ • y

case inr
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x y : F
hx : x ≠ 0
⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y

tactic: rcases eq_or_ne y 0 with (rfl | hy)
state_before: case inr
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x y : F
hx : x ≠ 0
⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y
state_after: case inr.inl
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x : F
hx : x ≠ 0
⊢ SameRay ℝ x 0 ↔ x = 0 ∨ 0 = 0 ∨ ‖x‖⁻¹ • x = ‖0‖⁻¹ • 0

case inr.inr
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x y : F
hx : x ≠ 0
hy : y ≠ 0
⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y

tactic: simp only [sameRay_iff_inv_norm_smul_eq_of_ne hx hy, *, false_or_iff]
state_before: case inr.inr
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x y : F
hx : x ≠ 0
hy : y ≠ 0
⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y
state_after: no goals

tactic: simp [SameRay.zero_left]
state_before: case inl
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
y : F
⊢ SameRay ℝ 0 y ↔ 0 = 0 ∨ y = 0 ∨ ‖0‖⁻¹ • 0 = ‖y‖⁻¹ • y
state_after: no goals

tactic: simp [SameRay.zero_right]
state_before: case inr.inl
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
F : Type u_2
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace ℝ F
x : F
hx : x ≠ 0
⊢ SameRay ℝ x 0 ↔ x = 0 ∨ 0 = 0 ∨ ‖x‖⁻¹ • x = ‖0‖⁻¹ • 0
state_after: no goals
Theorem: gauge_zero
File: Mathlib/Analysis/Convex/Gauge.lean

tactic: rw [gauge_def']
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
⊢ gauge s 0 = 0
state_after: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
⊢ sInf {r | r ∈ Ioi 0 ∧ r⁻¹ • 0 ∈ s} = 0

tactic: by_cases h : (0 : E) ∈ s
state_before: 𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
⊢ sInf {r | r ∈ Ioi 0 ∧ r⁻¹ • 0 ∈ s} = 0
state_after: case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
h : 0 ∈ s
⊢ sInf {r | r ∈ Ioi 0 ∧ r⁻¹ • 0 ∈ s} = 0

case neg
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
h : 0 ∉ s
⊢ sInf {r | r ∈ Ioi 0 ∧ r⁻¹ • 0 ∈ s} = 0

tactic: simp only [smul_zero, sep_true, h, csInf_Ioi]
state_before: case pos
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
h : 0 ∈ s
⊢ sInf {r | r ∈ Ioi 0 ∧ r⁻¹ • 0 ∈ s} = 0
state_after: no goals

tactic: simp only [smul_zero, sep_false, h, Real.sInf_empty]
state_before: case neg
𝕜 : Type u_1
E : Type u_2
F : Type u_3
inst✝¹ : AddCommGroup E
inst✝ : Module ℝ E
s t : Set E
x : E
a : ℝ
h : 0 ∉ s
⊢ sInf {r | r ∈ Ioi 0 ∧ r⁻¹ • 0 ∈ s} = 0
state_after: no goals
Theorem: Function.IsPeriodicPt.iterate_mod_apply
File: Mathlib/Dynamics/PeriodicPts.lean

tactic: conv_rhs => rw [← Nat.mod_add_div m n, iterate_add_apply, (h.mul_const _).eq]
state_before: α : Type u_1
β : Type u_2
f fa : α → α
fb : β → β
x y : α
m✝ n : ℕ
h : IsPeriodicPt f n x
m : ℕ
⊢ f^[m % n] x = f^[m] x
state_after: no goals
Theorem: Equiv.Perm.card_support_swap_mul
File: Mathlib/GroupTheory/Perm/Support.lean

tactic: simp
state_before: α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : Fintype α
f✝ g f : Perm α
x : α
hx : f x ≠ x
h : f.support ⊆ (swap x (f x) * f).support
⊢ ¬(swap x (f x) * f) x ≠ x
state_after: no goals
Theorem: Set.encard_eq_add_one_iff
File: Mathlib/Data/Set/Card.lean

tactic: refine ⟨fun h ↦ ?_, ?_⟩
state_before: α : Type u_1
β : Type u_2
s t : Set α
a b : α
k : ℕ∞
⊢ s.encard = k + 1 ↔ ∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k
state_after: case refine_1
α : Type u_1
β : Type u_2
s t : Set α
a b : α
k : ℕ∞
h : s.encard = k + 1
⊢ ∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k

case refine_2
α : Type u_1
β : Type u_2
s t : Set α
a b : α
k : ℕ∞
⊢ (∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k) → s.encard = k + 1

tactic: rintro ⟨a, t, h, rfl, rfl⟩
state_before: case refine_2
α : Type u_1
β : Type u_2
s t : Set α
a b : α
k : ℕ∞
⊢ (∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k) → s.encard = k + 1
state_after: case refine_2.intro.intro.intro.intro
α : Type u_1
β : Type u_2
t✝ : Set α
a✝ b a : α
t : Set α
h : a ∉ t
⊢ (insert a t).encard = t.encard + 1

tactic: rw [encard_insert_of_not_mem h]
state_before: case refine_2.intro.intro.intro.intro
α : Type u_1
β : Type u_2
t✝ : Set α
a✝ b a : α
t : Set α
h : a ∉ t
⊢ (insert a t).encard = t.encard + 1
state_after: no goals

tactic: obtain ⟨a, ha⟩ := nonempty_of_encard_ne_zero (s := s) (by simp [h])
state_before: case refine_1
α : Type u_1
β : Type u_2
s t : Set α
a b : α
k : ℕ∞
h : s.encard = k + 1
⊢ ∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k
state_after: case refine_1.intro
α : Type u_1
β : Type u_2
s t : Set α
a✝ b : α
k : ℕ∞
h : s.encard = k + 1
a : α
ha : a ∈ s
⊢ ∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k

tactic: refine ⟨a, s \ {a}, fun h ↦ h.2 rfl, by rwa [insert_diff_singleton, insert_eq_of_mem], ?_⟩
state_before: case refine_1.intro
α : Type u_1
β : Type u_2
s t : Set α
a✝ b : α
k : ℕ∞
h : s.encard = k + 1
a : α
ha : a ∈ s
⊢ ∃ a t, a ∉ t ∧ insert a t = s ∧ t.encard = k
state_after: case refine_1.intro
α : Type u_1
β : Type u_2
s t : Set α
a✝ b : α
k : ℕ∞
h : s.encard = k + 1
a : α
ha : a ∈ s
⊢ (s \ {a}).encard = k

tactic: rw [← WithTop.add_right_cancel_iff WithTop.one_ne_top, ← h,
  encard_diff_singleton_add_one ha]
state_before: case refine_1.intro
α : Type u_1
β : Type u_2
s t : Set α
a✝ b : α
k : ℕ∞
h : s.encard = k + 1
a : α
ha : a ∈ s
⊢ (s \ {a}).encard = k
state_after: no goals

tactic: simp [h]
state_before: α : Type u_1
β : Type u_2
s t : Set α
a b : α
k : ℕ∞
h : s.encard = k + 1
⊢ s.encard ≠ 0
state_after: no goals

tactic: rwa [insert_diff_singleton, insert_eq_of_mem]
state_before: α : Type u_1
β : Type u_2
s t : Set α
a✝ b : α
k : ℕ∞
h : s.encard = k + 1
a : α
ha : a ∈ s
⊢ insert a (s \ {a}) = s
state_after: no goals
Theorem: upperSemicontinuous_iff_isClosed_preimage
File: Mathlib/Topology/Semicontinuous.lean

tactic: rw [upperSemicontinuous_iff_isOpen_preimage]
state_before: α : Type u_1
inst✝² : TopologicalSpace α
β : Type u_2
inst✝¹ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_3
inst✝ : LinearOrder γ
f : α → γ
⊢ UpperSemicontinuous f ↔ ∀ (y : γ), IsClosed (f ⁻¹' Ici y)
state_after: α : Type u_1
inst✝² : TopologicalSpace α
β : Type u_2
inst✝¹ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_3
inst✝ : LinearOrder γ
f : α → γ
⊢ (∀ (y : γ), IsOpen (f ⁻¹' Iio y)) ↔ ∀ (y : γ), IsClosed (f ⁻¹' Ici y)

tactic: simp only [← isOpen_compl_iff, ← preimage_compl, compl_Ici]
state_before: α : Type u_1
inst✝² : TopologicalSpace α
β : Type u_2
inst✝¹ : Preorder β
f✝ g : α → β
x : α
s t : Set α
y z : β
γ : Type u_3
inst✝ : LinearOrder γ
f : α → γ
⊢ (∀ (y : γ), IsOpen (f ⁻¹' Iio y)) ↔ ∀ (y : γ), IsClosed (f ⁻¹' Ici y)
state_after: no goals
Theorem: exists_polynomial_near_continuousMap
File: Mathlib/Topology/ContinuousFunction/Weierstrass.lean

tactic: have w := mem_closure_iff_frequently.mp (continuousMap_mem_polynomialFunctions_closure _ _ f)
state_before: a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε
state_after: a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∃ᶠ (x : C(↑(Set.Icc a b), ℝ)) in nhds f, x ∈ ↑(polynomialFunctions (Set.Icc a b))
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε

tactic: rw [Metric.nhds_basis_ball.frequently_iff] at w
state_before: a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∃ᶠ (x : C(↑(Set.Icc a b), ℝ)) in nhds f, x ∈ ↑(polynomialFunctions (Set.Icc a b))
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε
state_after: a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∀ (i : ℝ), 0 < i → ∃ x ∈ Metric.ball f i, x ∈ ↑(polynomialFunctions (Set.Icc a b))
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε

tactic: obtain ⟨-, H, ⟨m, ⟨-, rfl⟩⟩⟩ := w ε pos
state_before: a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∀ (i : ℝ), 0 < i → ∃ x ∈ Metric.ball f i, x ∈ ↑(polynomialFunctions (Set.Icc a b))
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε
state_after: case intro.intro.intro.intro
a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∀ (i : ℝ), 0 < i → ∃ x ∈ Metric.ball f i, x ∈ ↑(polynomialFunctions (Set.Icc a b))
m : ℝ[X]
H : ↑(Polynomial.toContinuousMapOnAlgHom (Set.Icc a b)) m ∈ Metric.ball f ε
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε

tactic: rw [Metric.mem_ball, dist_eq_norm] at H
state_before: case intro.intro.intro.intro
a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∀ (i : ℝ), 0 < i → ∃ x ∈ Metric.ball f i, x ∈ ↑(polynomialFunctions (Set.Icc a b))
m : ℝ[X]
H : ↑(Polynomial.toContinuousMapOnAlgHom (Set.Icc a b)) m ∈ Metric.ball f ε
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε
state_after: case intro.intro.intro.intro
a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∀ (i : ℝ), 0 < i → ∃ x ∈ Metric.ball f i, x ∈ ↑(polynomialFunctions (Set.Icc a b))
m : ℝ[X]
H : ‖↑(Polynomial.toContinuousMapOnAlgHom (Set.Icc a b)) m - f‖ < ε
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε

tactic: exact ⟨m, H⟩
state_before: case intro.intro.intro.intro
a b : ℝ
f : C(↑(Set.Icc a b), ℝ)
ε : ℝ
pos : 0 < ε
w : ∀ (i : ℝ), 0 < i → ∃ x ∈ Metric.ball f i, x ∈ ↑(polynomialFunctions (Set.Icc a b))
m : ℝ[X]
H : ‖↑(Polynomial.toContinuousMapOnAlgHom (Set.Icc a b)) m - f‖ < ε
⊢ ∃ p, ‖p.toContinuousMapOn (Set.Icc a b) - f‖ < ε
state_after: no goals
Theorem: PowerSeries.coeff_C
File: Mathlib/RingTheory/PowerSeries/Basic.lean

tactic: rw [← monomial_zero_eq_C_apply, coeff_monomial]
state_before: R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
⊢ (coeff R n) ((C R) a) = if n = 0 then a else 0
state_after: no goals