tasksource/leandojo huggingface dataset:
Theorem: Set.compl_compl_image
File: Mathlib/Data/Set/Image.lean

tactic: rw [← image_comp, compl_comp_compl, image_id]
state_before: α : Type u_1
β : Type ?u.39948
γ : Type ?u.39951
ι : Sort ?u.39954
ι' : Sort ?u.39957
f : α → β
s t : Set α
inst✝ : BooleanAlgebra α
S : Set α
⊢ compl '' (compl '' S) = S
Theorem: List.lt_length_left_of_zipWith
File: Mathlib/Data/List/Zip.lean

tactic: rw [length_zipWith, lt_min_iff] at h
state_before: α : Type u
β : Type u_1
γ : Type u_2
δ : Type ?u.19754
ε : Type ?u.19757
f : α → β → γ
i : ℕ
l : List α
l' : List β
h : i < length (zipWith f l l')
⊢ i < length l

tactic: exact h.left
state_before: α : Type u
β : Type u_1
γ : Type u_2
δ : Type ?u.19754
ε : Type ?u.19757
f : α → β → γ
i : ℕ
l : List α
l' : List β
h : i < length l ∧ i < length l'
⊢ i < length l
Theorem: Nat.bit0_val
File: Mathlib/Init/Data/Nat/Bitwise.lean

tactic: rw [Nat.zero_add]
state_before: n : ℕ
⊢ n + n = 0 + n + n
Theorem: mul_mul_div_cancel
File: Mathlib/Algebra/Group/Basic.lean

tactic: rw [mul_assoc, mul_div_cancel'_right]
state_before: α : Type ?u.72863
β : Type ?u.72866
G : Type u_1
inst✝ : CommGroup G
a✝ b✝ c✝ d a b c : G
⊢ a * c * (b / c) = a * b
Theorem: one_nsmul
File: Mathlib/Algebra/GroupPower/Basic.lean

tactic: rw [succ_nsmul, zero_nsmul, add_zero]
state_before: α : Type ?u.9049
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
inst✝¹ : Monoid M
inst✝ : AddMonoid A
a : A
⊢ 1 • a = a
Theorem: MeasureTheory.integrable_comp_mul_right_iff
File: Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean

tactic: simpa only [mul_comm] using integrable_comp_mul_left_iff g hR
state_before: F : Type u_1
inst✝ : NormedAddCommGroup F
g : ℝ → F
R : ℝ
hR : R ≠ 0
⊢ (Integrable fun x => g (x * R)) ↔ Integrable g
Theorem: rank_real_of_complex
File: Mathlib/Data/Complex/Module.lean

tactic: rw [← lift_rank_mul_lift_rank ℝ ℂ E, Complex.rank_real_complex']
state_before: E : Type u_1
inst✝¹ : AddCommGroup E
inst✝ : Module ℂ E
⊢ Cardinal.lift (Module.rank ℝ E) = Cardinal.lift (2 * Module.rank ℂ E)

tactic: simp only [Cardinal.lift_id']
state_before: E : Type u_1
inst✝¹ : AddCommGroup E
inst✝ : Module ℂ E
⊢ 2 * Cardinal.lift (Module.rank ℂ E) = Cardinal.lift (2 * Module.rank ℂ E)
Theorem: SimpleGraph.dart_fst_fiber_card_eq_degree
File: Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean

tactic: simpa only [dart_fst_fiber, Finset.card_univ, card_neighborSet_eq_degree] using
  card_image_of_injective univ (G.dartOfNeighborSet_injective v)
state_before: V : Type u
G : SimpleGraph V
inst✝³ : Fintype V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype (Sym2 V)
inst✝ : DecidableEq V
v : V
⊢ card (filter (fun d => d.fst = v) univ) = degree G v
Theorem: LinearMap.trace_comp_comm'
File: Mathlib/LinearAlgebra/Trace.lean

tactic: have h := ext_iff.1 (ext_iff.1 (trace_comp_comm R M N) g) f
state_before: R : Type u_1
inst✝⁹ : CommRing R
M : Type u_2
inst✝⁸ : AddCommGroup M
inst✝⁷ : Module R M
N : Type u_3
inst✝⁶ : AddCommGroup N
inst✝⁵ : Module R N
ι : Type ?u.726554
inst✝⁴ : Module.Free R M
inst✝³ : Module.Finite R M
inst✝² : Module.Free R N
inst✝¹ : Module.Finite R N
inst✝ : Nontrivial R
f : M →ₗ[R] N
g : N →ₗ[R] M
⊢ ↑(trace R M) (comp g f) = ↑(trace R N) (comp f g)

tactic: simp only [llcomp_apply', compr₂_apply, flip_apply] at h
state_before: R : Type u_1
inst✝⁹ : CommRing R
M : Type u_2
inst✝⁸ : AddCommGroup M
inst✝⁷ : Module R M
N : Type u_3
inst✝⁶ : AddCommGroup N
inst✝⁵ : Module R N
ι : Type ?u.726554
inst✝⁴ : Module.Free R M
inst✝³ : Module.Finite R M
inst✝² : Module.Free R N
inst✝¹ : Module.Finite R N
inst✝ : Nontrivial R
f : M →ₗ[R] N
g : N →ₗ[R] M
h : ↑(↑(compr₂ (llcomp R M N M) (trace R M)) g) f = ↑(↑(compr₂ (flip (llcomp R N M N)) (trace R N)) g) f
⊢ ↑(trace R M) (comp g f) = ↑(trace R N) (comp f g)

tactic: exact h
state_before: R : Type u_1
inst✝⁹ : CommRing R
M : Type u_2
inst✝⁸ : AddCommGroup M
inst✝⁷ : Module R M
N : Type u_3
inst✝⁶ : AddCommGroup N
inst✝⁵ : Module R N
ι : Type ?u.726554
inst✝⁴ : Module.Free R M
inst✝³ : Module.Finite R M
inst✝² : Module.Free R N
inst✝¹ : Module.Finite R N
inst✝ : Nontrivial R
f : M →ₗ[R] N
g : N →ₗ[R] M
h : ↑(trace R M) (comp g f) = ↑(trace R N) (comp f g)
⊢ ↑(trace R M) (comp g f) = ↑(trace R N) (comp f g)
Theorem: Set.card_fintypeInsertOfNotMem
File: Mathlib/Data/Set/Finite.lean

tactic: rw [fintypeInsertOfNotMem, Fintype.card_ofFinset]
state_before: α : Type u
β : Type v
ι : Sort w
γ : Type x
a : α
s : Set α
inst✝ : Fintype ↑s
h : ¬a ∈ s
⊢ Fintype.card ↑(insert a s) = Fintype.card ↑s + 1

tactic: simp only [Finset.card, toFinset, Finset.map_val, Embedding.coe_subtype,
           Multiset.card_cons, Multiset.card_map, add_left_inj]
state_before: α : Type u
β : Type v
ι : Sort w
γ : Type x
a : α
s : Set α
inst✝ : Fintype ↑s
h : ¬a ∈ s
⊢ Finset.card { val := a ::ₘ (toFinset s).val, nodup := (_ : Multiset.Nodup (a ::ₘ (toFinset s).val)) } =
    Fintype.card ↑s + 1

tactic: rfl
state_before: α : Type u
β : Type v
ι : Sort w
γ : Type x
a : α
s : Set α
inst✝ : Fintype ↑s
h : ¬a ∈ s
⊢ ↑Multiset.card Finset.univ.val = Fintype.card ↑s
Theorem: sInfHom.cancel_left
File: Mathlib/Order/Hom/CompleteLattice.lean

tactic: rw [← comp_apply, h, comp_apply]
state_before: F : Type ?u.47608
α : Type u_3
β : Type u_1
γ : Type u_2
δ : Type ?u.47620
ι : Sort ?u.47623
κ : ι → Sort ?u.47628
inst✝³ : InfSet α
inst✝² : InfSet β
inst✝¹ : InfSet γ
inst✝ : InfSet δ
g : sInfHom β γ
f₁ f₂ : sInfHom α β
hg : Injective ↑g
h : comp g f₁ = comp g f₂
a : α
⊢ ↑g (↑f₁ a) = ↑g (↑f₂ a)
Theorem: Rat.mkRat_eq_div
File: Mathlib/Data/Rat/Defs.lean

tactic: simp [mkRat]
state_before: a b c : ℚ
n : ℤ
d : ℕ
⊢ mkRat n d = ↑n / ↑d

tactic: by_cases d = 0
state_before: a b c : ℚ
n : ℤ
d : ℕ
⊢ (if h : d = 0 then 0 else normalize n d) = ↑n / ↑d

tactic: simp [h]
state_before: case pos
a b c : ℚ
n : ℤ
d : ℕ
h : d = 0
⊢ (if h : d = 0 then 0 else normalize n d) = ↑n / ↑d

tactic: simp [h, HDiv.hDiv, Rat.div, Div.div]
state_before: case neg
a b c : ℚ
n : ℤ
d : ℕ
h : ¬d = 0
⊢ (if h : d = 0 then 0 else normalize n d) = ↑n / ↑d

tactic: unfold Rat.inv
state_before: case neg
a b c : ℚ
n : ℤ
d : ℕ
h : ¬d = 0
⊢ normalize n d = ↑n * Rat.inv ↑d

tactic: have h₁ : 0 < d := Nat.pos_iff_ne_zero.2 h
state_before: case neg
a b c : ℚ
n : ℤ
d : ℕ
h : ¬d = 0
⊢ normalize n d =
    ↑n *
      if h : (↑d).num < 0 then mk' (-↑(↑d).den) (Int.natAbs (↑d).num)
      else if h : (↑d).num > 0 then mk' (↑(↑d).den) (Int.natAbs (↑d).num) else ↑d

tactic: have h₂ : ¬ (d : ℤ) < 0 := by simp
state_before: case neg
a b c : ℚ
n : ℤ
d : ℕ
h : ¬d = 0
h₁ : 0 < d
⊢ normalize n d =
    ↑n *
      if h : (↑d).num < 0 then mk' (-↑(↑d).den) (Int.natAbs (↑d).num)
      else if h : (↑d).num > 0 then mk' (↑(↑d).den) (Int.natAbs (↑d).num) else ↑d

tactic: simp [h, h₁, h₂, ←Rat.normalize_eq_mk', Rat.normalize_eq_mkRat, ← mkRat_one,
  Rat.mkRat_mul_mkRat]
state_before: case neg
a b c : ℚ
n : ℤ
d : ℕ
h : ¬d = 0
h₁ : 0 < d
h₂ : ¬↑d < 0
⊢ normalize n d =
    ↑n *
      if h : (↑d).num < 0 then mk' (-↑(↑d).den) (Int.natAbs (↑d).num)
      else if h : (↑d).num > 0 then mk' (↑(↑d).den) (Int.natAbs (↑d).num) else ↑d

tactic: simp
state_before: a b c : ℚ
n : ℤ
d : ℕ
h : ¬d = 0
h₁ : 0 < d
⊢ ¬↑d < 0
Theorem: Nat.xgcd_aux_rec
File: Mathlib/Data/Int/GCD.lean

tactic: obtain ⟨r, rfl⟩ := Nat.exists_eq_succ_of_ne_zero h.ne'
state_before: r : ℕ
s t : ℤ
r' : ℕ
s' t' : ℤ
h : 0 < r
⊢ xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - ↑r' / ↑r * s) (t' - ↑r' / ↑r * t) r s t

tactic: rfl
state_before: case intro
s t : ℤ
r' : ℕ
s' t' : ℤ
r : ℕ
h : 0 < succ r
⊢ xgcdAux (succ r) s t r' s' t' =
    xgcdAux (r' % succ r) (s' - ↑r' / ↑(succ r) * s) (t' - ↑r' / ↑(succ r) * t) (succ r) s t
Theorem: IsSubfield.pow_mem
File: Mathlib/Deprecated/Subfield.lean

tactic: cases' n with n n
state_before: F : Type u_1
inst✝ : Field F
S : Set F
a : F
n : ℤ
s : Set F
hs : IsSubfield s
h : a ∈ s
⊢ a ^ n ∈ s

tactic: suffices a ^ (n : ℤ) ∈ s by exact this
state_before: case ofNat
F : Type u_1
inst✝ : Field F
S : Set F
a : F
s : Set F
hs : IsSubfield s
h : a ∈ s
n : ℕ
⊢ a ^ Int.ofNat n ∈ s

tactic: rw [zpow_ofNat]
state_before: case ofNat
F : Type u_1
inst✝ : Field F
S : Set F
a : F
s : Set F
hs : IsSubfield s
h : a ∈ s
n : ℕ
⊢ a ^ ↑n ∈ s

tactic: exact hs.toIsSubring.toIsSubmonoid.pow_mem h
state_before: case ofNat
F : Type u_1
inst✝ : Field F
S : Set F
a : F
s : Set F
hs : IsSubfield s
h : a ∈ s
n : ℕ
⊢ a ^ n ∈ s

tactic: exact this
state_before: F : Type u_1
inst✝ : Field F
S : Set F
a : F
s : Set F
hs : IsSubfield s
h : a ∈ s
n : ℕ
this : a ^ ↑n ∈ s
⊢ a ^ Int.ofNat n ∈ s

tactic: rw [zpow_negSucc]
state_before: case negSucc
F : Type u_1
inst✝ : Field F
S : Set F
a : F
s : Set F
hs : IsSubfield s
h : a ∈ s
n : ℕ
⊢ a ^ Int.negSucc n ∈ s

tactic: exact hs.inv_mem (hs.toIsSubring.toIsSubmonoid.pow_mem h)
state_before: case negSucc
F : Type u_1
inst✝ : Field F
S : Set F
a : F
s : Set F
hs : IsSubfield s
h : a ∈ s
n : ℕ
⊢ (a ^ (n + 1))⁻¹ ∈ s
Theorem: Real.sign_of_neg
File: Mathlib/Data/Real/Sign.lean

tactic: rw [sign, if_pos hr]
state_before: r : ℝ
hr : r < 0
⊢ sign r = -1
Theorem: SimpleGraph.dart_edge_eq_mk'_iff
File: Mathlib/Combinatorics/SimpleGraph/Basic.lean

tactic: rintro ⟨p, h⟩
state_before: ι : Sort ?u.98474
𝕜 : Type ?u.98477
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
⊢ ∀ {d : Dart G} {p : V × V}, Dart.edge d = Quotient.mk (Sym2.Rel.setoid V) p ↔ d.toProd = p ∨ d.toProd = Prod.swap p

tactic: apply Sym2.mk''_eq_mk''_iff
state_before: case mk
ι : Sort ?u.98474
𝕜 : Type ?u.98477
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
p : V × V
h : Adj G p.fst p.snd
⊢ ∀ {p_1 : V × V},
    Dart.edge { toProd := p, is_adj := h } = Quotient.mk (Sym2.Rel.setoid V) p_1 ↔
      { toProd := p, is_adj := h }.toProd = p_1 ∨ { toProd := p, is_adj := h }.toProd = Prod.swap p_1
Theorem: Polynomial.map_injective
File: Mathlib/Data/Polynomial/Eval.lean

tactic: rw [← coeff_map f, ← coeff_map f, h]
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]
inst✝ : Semiring S
f : R →+* S
hf : Function.Injective ↑f
p q : R[X]
h : map f p = map f q
m : ℕ
⊢ ↑f (coeff p m) = ↑f (coeff q m)
Theorem: IntervalIntegrable.iff_comp_neg
File: Mathlib/MeasureTheory/Integral/IntervalIntegral.lean

tactic: rw [← comp_mul_left_iff (neg_ne_zero.2 one_ne_zero)]
state_before: ι : Type ?u.7675134
𝕜 : Type ?u.7675137
E : Type u_1
F : Type ?u.7675143
A : Type ?u.7675146
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedRing A
f g : ℝ → E
a b : ℝ
μ : MeasureTheory.Measure ℝ
⊢ IntervalIntegrable f volume a b ↔ IntervalIntegrable (fun x => f (-x)) volume (-a) (-b)

tactic: simp [div_neg]
state_before: ι : Type ?u.7675134
𝕜 : Type ?u.7675137
E : Type u_1
F : Type ?u.7675143
A : Type ?u.7675146
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedRing A
f g : ℝ → E
a b : ℝ
μ : MeasureTheory.Measure ℝ
⊢ IntervalIntegrable (fun x => f (-1 * x)) volume (a / -1) (b / -1) ↔
    IntervalIntegrable (fun x => f (-x)) volume (-a) (-b)
Theorem: Rel.swap_mem_interedges_iff
File: Mathlib/Combinatorics/SimpleGraph/Density.lean

tactic: rw [mem_interedges_iff, mem_interedges_iff, hr.iff]
state_before: 𝕜 : Type ?u.102463
ι : Type ?u.102466
κ : Type ?u.102469
α : Type u_1
β : Type ?u.102475
r : α → α → Prop
inst✝ : DecidableRel r
s s₁ s₂ t t₁ t₂ : Finset α
a b : α
hr : Symmetric r
x : α × α
⊢ Prod.swap x ∈ interedges r s t ↔ x ∈ interedges r t s

tactic: exact and_left_comm
state_before: 𝕜 : Type ?u.102463
ι : Type ?u.102466
κ : Type ?u.102469
α : Type u_1
β : Type ?u.102475
r : α → α → Prop
inst✝ : DecidableRel r
s s₁ s₂ t t₁ t₂ : Finset α
a b : α
hr : Symmetric r
x : α × α
⊢ (Prod.swap x).fst ∈ s ∧ (Prod.swap x).snd ∈ t ∧ r (Prod.swap x).snd (Prod.swap x).fst ↔
    x.fst ∈ t ∧ x.snd ∈ s ∧ r x.fst x.snd
Theorem: OrthogonalFamily.linearIsometry_apply_dfinsupp_sum_single
File: Mathlib/Analysis/InnerProductSpace/l2Space.lean

tactic: have :
  hV.linearIsometry (∑ i in W₀.support, lp.single 2 i (W₀ i)) =
    ∑ i in W₀.support, hV.linearIsometry (lp.single 2 i (W₀ i)) :=
  hV.linearIsometry.toLinearMap.map_sum
state_before: ι : Type u_1
𝕜 : Type u_4
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_2
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
V : (i : ι) → G i →ₗᵢ[𝕜] E
hV : OrthogonalFamily 𝕜 G V
W₀ : Π₀ (i : ι), G i
⊢ ↑(OrthogonalFamily.linearIsometry hV) (Dfinsupp.sum W₀ (lp.single 2)) = Dfinsupp.sum W₀ fun i => ↑(V i)

tactic: simp (config := { contextual := true }) [Dfinsupp.sum, this]
state_before: ι : Type u_1
𝕜 : Type u_4
inst✝⁴ : IsROrC 𝕜
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace 𝕜 E
cplt : CompleteSpace E
G : ι → Type u_2
inst✝¹ : (i : ι) → NormedAddCommGroup (G i)
inst✝ : (i : ι) → InnerProductSpace 𝕜 (G i)
V : (i : ι) → G i →ₗᵢ[𝕜] E
hV : OrthogonalFamily 𝕜 G V
W₀ : Π₀ (i : ι), G i
this :
  ↑(OrthogonalFamily.linearIsometry hV) (∑ i in Dfinsupp.support W₀, lp.single 2 i (↑W₀ i)) =
    ∑ i in Dfinsupp.support W₀, ↑(OrthogonalFamily.linearIsometry hV) (lp.single 2 i (↑W₀ i))
⊢ ↑(OrthogonalFamily.linearIsometry hV) (Dfinsupp.sum W₀ (lp.single 2)) = Dfinsupp.sum W₀ fun i => ↑(V i)
Theorem: LinearMap.lTensor_comp_rTensor
File: Mathlib/LinearAlgebra/TensorProduct.lean

tactic: simp only [lTensor, rTensor, ← map_comp, id_comp, comp_id]
state_before: R : Type u_1
inst✝¹⁴ : CommSemiring R
R' : Type ?u.1273862
inst✝¹³ : Monoid R'
R'' : Type ?u.1273868
inst✝¹² : Semiring R''
M : Type u_2
N : Type u_4
P : Type u_3
Q : Type u_5
S : Type ?u.1273886
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : AddCommMonoid N
inst✝⁹ : AddCommMonoid P
inst✝⁸ : AddCommMonoid Q
inst✝⁷ : AddCommMonoid S
inst✝⁶ : Module R M
inst✝⁵ : Module R N
inst✝⁴ : Module R P
inst✝³ : Module R Q
inst✝² : Module R S
inst✝¹ : DistribMulAction R' M
inst✝ : Module R'' M
g✝ : P →ₗ[R] Q
f✝ : N →ₗ[R] P
f : M →ₗ[R] P
g : N →ₗ[R] Q
⊢ comp (lTensor P g) (rTensor N f) = map f g
Theorem: fderiv_sub_const
File: Mathlib/Analysis/Calculus/FDeriv/Add.lean

tactic: simp only [sub_eq_add_neg, fderiv_add_const]
state_before: 𝕜 : Type u_3
inst✝⁸ : NontriviallyNormedField 𝕜
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type u_2
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type ?u.523964
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
G' : Type ?u.524059
inst✝¹ : NormedAddCommGroup G'
inst✝ : NormedSpace 𝕜 G'
f f₀ f₁ g : E → F
f' f₀' f₁' g' e : E →L[𝕜] F
x : E
s t : Set E
L L₁ L₂ : Filter E
c : F
⊢ fderiv 𝕜 (fun y => f y - c) x = fderiv 𝕜 f x
Theorem: Mathlib.Meta.NormNum.MinFacHelper.one_lt
File: Mathlib/Tactic/NormNum/Prime.lean

tactic: have : 2 < minFac n := h.1.trans_le h.2.2
state_before: n k : ℕ
h : MinFacHelper n k
⊢ 1 < n

tactic: rcases eq_zero_or_pos n with rfl|h
state_before: n k : ℕ
h : MinFacHelper n k
this : 2 < minFac n
⊢ 1 < n

tactic: rcases (succ_le_of_lt h).eq_or_lt with rfl|h
state_before: case inr
n k : ℕ
h✝ : MinFacHelper n k
this : 2 < minFac n
h : n > 0
⊢ 1 < n

tactic: exact h
state_before: case inr.inr
n k : ℕ
h✝¹ : MinFacHelper n k
this : 2 < minFac n
h✝ : n > 0
h : succ 0 < n
⊢ 1 < n

tactic: contradiction
state_before: case inl
k : ℕ
h : MinFacHelper 0 k
this : 2 < minFac 0
⊢ 1 < 0

tactic: contradiction
state_before: case inr.inl
k : ℕ
h✝ : MinFacHelper (succ 0) k
this : 2 < minFac (succ 0)
h : succ 0 > 0
⊢ 1 < succ 0
Theorem: Combinatorics.Line.apply_none
File: Mathlib/Combinatorics/HalesJewett.lean

tactic: simp only [Option.getD_none, h, l.apply]
state_before: α : Type u_1
ι : Type u_2
l : Line α ι
x : α
i : ι
h : idxFun l i = none
⊢ (fun x i => Option.getD (idxFun l i) x) x i = x
Theorem: geom_sum_eq
File: Mathlib/Algebra/GeomSum.lean

tactic: have : x - 1 ≠ 0 := by simp_all [sub_eq_iff_eq_add]
state_before: α : Type u
inst✝ : DivisionRing α
x : α
h : x ≠ 1
n : ℕ
⊢ ∑ i in range n, x ^ i = (x ^ n - 1) / (x - 1)

tactic: rw [← geom_sum_mul, mul_div_cancel _ this]
state_before: α : Type u
inst✝ : DivisionRing α
x : α
h : x ≠ 1
n : ℕ
this : x - 1 ≠ 0
⊢ ∑ i in range n, x ^ i = (x ^ n - 1) / (x - 1)

tactic: simp_all [sub_eq_iff_eq_add]
state_before: α : Type u
inst✝ : DivisionRing α
x : α
h : x ≠ 1
n : ℕ
⊢ x - 1 ≠ 0
Theorem: ContinuousMap.inf_mem_subalgebra_closure
File: Mathlib/Topology/ContinuousFunction/StoneWeierstrass.lean

tactic: rw [inf_eq]
state_before: X : Type u_1
inst✝¹ : TopologicalSpace X
inst✝ : CompactSpace X
A : Subalgebra ℝ C(X, ℝ)
f g : { x // x ∈ A }
⊢ ↑f ⊓ ↑g ∈ Subalgebra.topologicalClosure A

tactic: refine'
  A.topologicalClosure.smul_mem
    (A.topologicalClosure.sub_mem
      (A.topologicalClosure.add_mem (A.le_topologicalClosure f.property)
        (A.le_topologicalClosure g.property))
      _)
    _
state_before: X : Type u_1
inst✝¹ : TopologicalSpace X
inst✝ : CompactSpace X
A : Subalgebra ℝ C(X, ℝ)
f g : { x // x ∈ A }
⊢ 2⁻¹ • (↑f + ↑g - Abs.abs (↑f - ↑g)) ∈ Subalgebra.topologicalClosure A

tactic: exact_mod_cast abs_mem_subalgebra_closure A _
state_before: X : Type u_1
inst✝¹ : TopologicalSpace X
inst✝ : CompactSpace X
A : Subalgebra ℝ C(X, ℝ)
f g : { x // x ∈ A }
⊢ Abs.abs (↑f - ↑g) ∈ Subalgebra.topologicalClosure A
Theorem: fderiv_add_const
File: Mathlib/Analysis/Calculus/FDeriv/Add.lean

tactic: simp only [← fderivWithin_univ, fderivWithin_add_const uniqueDiffWithinAt_univ]
state_before: 𝕜 : Type u_3
inst✝⁸ : NontriviallyNormedField 𝕜
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type u_2
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type ?u.231390
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
G' : Type ?u.231485
inst✝¹ : NormedAddCommGroup G'
inst✝ : NormedSpace 𝕜 G'
f f₀ f₁ g : E → F
f' f₀' f₁' g' e : E →L[𝕜] F
x : E
s t : Set E
L L₁ L₂ : Filter E
c : F
⊢ fderiv 𝕜 (fun y => f y + c) x = fderiv 𝕜 f x
Theorem: SymplecticGroup.transpose_mem_iff
File: Mathlib/LinearAlgebra/SymplecticGroup.lean

tactic: simpa using transpose_mem hA
state_before: l : Type u_1
R : Type u_2
inst✝² : DecidableEq l
inst✝¹ : Fintype l
inst✝ : CommRing R
A : Matrix (l ⊕ l) (l ⊕ l) R
hA : Aᵀ ∈ symplecticGroup l R
⊢ A ∈ symplecticGroup l R
Theorem: Semiquot.mem_bind
File: Mathlib/Data/Semiquot.lean

tactic: simp_rw [← exists_prop]
state_before: α : Type u_1
β : Type u_2
q : Semiquot α
f : α → Semiquot β
b : β
⊢ b ∈ bind q f ↔ ∃ a, a ∈ q ∧ b ∈ f a

tactic: exact Set.mem_iUnion₂
state_before: α : Type u_1
β : Type u_2
q : Semiquot α
f : α → Semiquot β
b : β
⊢ b ∈ bind q f ↔ ∃ a _h, b ∈ f a
Theorem: orthogonalProjection_unit_singleton
File: Mathlib/Analysis/InnerProductSpace/Projection.lean

tactic: rw [← smul_orthogonalProjection_singleton 𝕜 w]
state_before: 𝕜 : Type u_2
E : Type u_1
F : Type ?u.635187
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 E
inst✝¹ : InnerProductSpace ℝ F
K : Submodule 𝕜 E
inst✝ : CompleteSpace { x // x ∈ K }
v : E
hv : ‖v‖ = 1
w : E
⊢ ↑(↑(orthogonalProjection (Submodule.span 𝕜 {v})) w) = inner v w • v

tactic: simp [hv]
state_before: 𝕜 : Type u_2
E : Type u_1
F : Type ?u.635187
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedAddCommGroup F
inst✝² : InnerProductSpace 𝕜 E
inst✝¹ : InnerProductSpace ℝ F
K : Submodule 𝕜 E
inst✝ : CompleteSpace { x // x ∈ K }
v : E
hv : ‖v‖ = 1
w : E
⊢ ↑(↑(orthogonalProjection (Submodule.span 𝕜 {v})) w) = ↑(‖v‖ ^ 2) • ↑(↑(orthogonalProjection (Submodule.span 𝕜 {v})) w)
Theorem: List.scanl_eq_scanlTR
File: Std/Data/List/Basic.lean

tactic: funext α f n l
state_before: ⊢ @scanl = @scanlTR

tactic: simp [scanlTR, scanlTR_go_eq]
state_before: case h.h.h.h
α : Type u_2
f : Type u_1
n : α → f → α
l : α
⊢ scanl n l = scanlTR n l
Theorem: List.get_of_append_proof
File: Std/Data/List/Lemmas.lean

tactic: simp_arith
state_before: α : Type u_1
l₁ : List α
a : α
l₂ : List α
n : Nat
l : List α
eq : l = l₁ ++ a :: l₂
h : length l₁ = n
⊢ length l₁ < length (l₁ ++ a :: l₂)
Theorem: Finset.range_add
File: Mathlib/Data/Finset/Image.lean

tactic: rw [← val_inj, union_val]
state_before: α : Type ?u.108255
β : Type ?u.108258
γ : Type ?u.108261
inst✝ : DecidableEq β
f g : α → β
s : Finset α
t : Finset β
a✝ : α
b✝ c : β
a b : ℕ
⊢ range (a + b) = range a ∪ map (addLeftEmbedding a) (range b)

tactic: exact Multiset.range_add_eq_union a b
state_before: α : Type ?u.108255
β : Type ?u.108258
γ : Type ?u.108261
inst✝ : DecidableEq β
f g : α → β
s : Finset α
t : Finset β
a✝ : α
b✝ c : β
a b : ℕ
⊢ (range (a + b)).val = (range a).val ∪ (map (addLeftEmbedding a) (range b)).val
Theorem: ENNReal.toReal_eq_toReal_iff'
File: Mathlib/Data/Real/ENNReal.lean

tactic: simp only [ENNReal.toReal, NNReal.coe_eq, toNNReal_eq_toNNReal_iff' hx hy]
state_before: α : Type ?u.33209
β : Type ?u.33212
a b c d : ℝ≥0∞
r p q : ℝ≥0
x y : ℝ≥0∞
hx : x ≠ ⊤
hy : y ≠ ⊤
⊢ ENNReal.toReal x = ENNReal.toReal y ↔ x = y
Theorem: ModuleCat.MonoidalCategory.hexagon_forward
File: Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean

tactic: apply TensorProduct.ext_threefold
state_before: R : Type u
inst✝ : CommRing R
X Y Z : ModuleCat R
⊢ (α_ X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom =
    ((braiding X Y).hom ⊗ 𝟙 Z) ≫ (α_ Y X Z).hom ≫ (𝟙 Y ⊗ (braiding X Z).hom)

tactic: intro x y z
state_before: case H
R : Type u
inst✝ : CommRing R
X Y Z : ModuleCat R
⊢ ∀ (x : ↑X) (y : ↑Y) (z : ↑Z),
    ↑((α_ X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom) ((x ⊗ₜ[R] y) ⊗ₜ[R] z) =
      ↑(((braiding X Y).hom ⊗ 𝟙 Z) ≫ (α_ Y X Z).hom ≫ (𝟙 Y ⊗ (braiding X Z).hom)) ((x ⊗ₜ[R] y) ⊗ₜ[R] z)

tactic: rfl
state_before: case H
R : Type u
inst✝ : CommRing R
X Y Z : ModuleCat R
x : ↑X
y : ↑Y
z : ↑Z
⊢ ↑((α_ X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom) ((x ⊗ₜ[R] y) ⊗ₜ[R] z) =
    ↑(((braiding X Y).hom ⊗ 𝟙 Z) ≫ (α_ Y X Z).hom ≫ (𝟙 Y ⊗ (braiding X Z).hom)) ((x ⊗ₜ[R] y) ⊗ₜ[R] z)
Theorem: abs_sub_round_eq_min
File: Mathlib/Algebra/Order/Floor.lean

tactic: simp_rw [round, min_def_lt, two_mul, ← lt_tsub_iff_left]
state_before: F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
⊢ abs (x - ↑(round x)) = min (fract x) (1 - fract x)

tactic: cases' lt_or_ge (fract x) (1 - fract x) with hx hx
state_before: F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
⊢ abs (x - ↑(if fract x < 1 - fract x then ⌊x⌋ else ⌈x⌉)) = if fract x < 1 - fract x then fract x else 1 - fract x

tactic: rw [if_pos hx, if_pos hx, self_sub_floor, abs_fract]
state_before: case inl
F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
hx : fract x < 1 - fract x
⊢ abs (x - ↑(if fract x < 1 - fract x then ⌊x⌋ else ⌈x⌉)) = if fract x < 1 - fract x then fract x else 1 - fract x

tactic: have : 0 < fract x := by
  replace hx : 0 < fract x + fract x := lt_of_lt_of_le zero_lt_one (tsub_le_iff_left.mp hx)
  simpa only [← two_mul, zero_lt_mul_left, zero_lt_two] using hx
state_before: case inr
F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
hx : fract x ≥ 1 - fract x
⊢ abs (x - ↑(if fract x < 1 - fract x then ⌊x⌋ else ⌈x⌉)) = if fract x < 1 - fract x then fract x else 1 - fract x

tactic: rw [if_neg (not_lt.mpr hx), if_neg (not_lt.mpr hx), abs_sub_comm, ceil_sub_self_eq this.ne.symm,
  abs_one_sub_fract]
state_before: case inr
F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
hx : fract x ≥ 1 - fract x
this : 0 < fract x
⊢ abs (x - ↑(if fract x < 1 - fract x then ⌊x⌋ else ⌈x⌉)) = if fract x < 1 - fract x then fract x else 1 - fract x

tactic: replace hx : 0 < fract x + fract x := lt_of_lt_of_le zero_lt_one (tsub_le_iff_left.mp hx)
state_before: F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
hx : fract x ≥ 1 - fract x
⊢ 0 < fract x

tactic: simpa only [← two_mul, zero_lt_mul_left, zero_lt_two] using hx
state_before: F : Type ?u.259084
α : Type u_1
β : Type ?u.259090
inst✝¹ : LinearOrderedRing α
inst✝ : FloorRing α
x : α
hx : 0 < fract x + fract x
⊢ 0 < fract x