1337xyz1337xyz/leandojo-benchmark4-v10 huggingface dataset:
Theorem: Rat.add_num_den
File: Mathlib/Data/Rat/Lemmas.lean

tactic: have hqd : (q.den : ℤ) ≠ 0 := Int.natCast_ne_zero_iff_pos.2 q.den_pos
state_before: q r : ℚ
⊢ q + r = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)
state_after: q r : ℚ
hqd : ↑q.den ≠ 0
⊢ q + r = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)

tactic: have hrd : (r.den : ℤ) ≠ 0 := Int.natCast_ne_zero_iff_pos.2 r.den_pos
state_before: q r : ℚ
hqd : ↑q.den ≠ 0
⊢ q + r = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)
state_after: q r : ℚ
hqd : ↑q.den ≠ 0
hrd : ↑r.den ≠ 0
⊢ q + r = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)

tactic: conv_lhs => rw [← num_divInt_den q, ← num_divInt_den r, divInt_add_divInt _ _ hqd hrd]
state_before: q r : ℚ
hqd : ↑q.den ≠ 0
hrd : ↑r.den ≠ 0
⊢ q + r = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)
state_after: q r : ℚ
hqd : ↑q.den ≠ 0
hrd : ↑r.den ≠ 0
⊢ (q.num * ↑r.den + r.num * ↑q.den) /. (↑q.den * ↑r.den) = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)

tactic: rw [mul_comm r.num q.den]
state_before: q r : ℚ
hqd : ↑q.den ≠ 0
hrd : ↑r.den ≠ 0
⊢ (q.num * ↑r.den + r.num * ↑q.den) /. (↑q.den * ↑r.den) = (q.num * ↑r.den + ↑q.den * r.num) /. (↑q.den * ↑r.den)
state_after: no goals
Theorem: Set.mulIndicator_mul_compl_eq_piecewise
File: Mathlib/Algebra/Group/Indicator.lean

tactic: ext x
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
⊢ s.mulIndicator f * sᶜ.mulIndicator g = s.piecewise f g
state_after: case h
α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
x : α
⊢ (s.mulIndicator f * sᶜ.mulIndicator g) x = s.piecewise f g x

tactic: by_cases h : x ∈ s
state_before: case h
α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
x : α
⊢ (s.mulIndicator f * sᶜ.mulIndicator g) x = s.piecewise f g x
state_after: case pos
α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
x : α
h : x ∈ s
⊢ (s.mulIndicator f * sᶜ.mulIndicator g) x = s.piecewise f g x

case neg
α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
x : α
h : x ∉ s
⊢ (s.mulIndicator f * sᶜ.mulIndicator g) x = s.piecewise f g x

tactic: rw [piecewise_eq_of_mem _ _ _ h, Pi.mul_apply, Set.mulIndicator_of_mem h,
  Set.mulIndicator_of_not_mem (Set.not_mem_compl_iff.2 h), mul_one]
state_before: case pos
α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
x : α
h : x ∈ s
⊢ (s.mulIndicator f * sᶜ.mulIndicator g) x = s.piecewise f g x
state_after: no goals

tactic: rw [piecewise_eq_of_not_mem _ _ _ h, Pi.mul_apply, Set.mulIndicator_of_not_mem h,
  Set.mulIndicator_of_mem (Set.mem_compl h), one_mul]
state_before: case neg
α : Type u_1
β : Type u_2
ι : Type u_3
M : Type u_4
N : Type u_5
inst✝¹ : MulOneClass M
s t : Set α
f✝ g✝ : α → M
a : α
inst✝ : DecidablePred fun x => x ∈ s
f g : α → M
x : α
h : x ∉ s
⊢ (s.mulIndicator f * sᶜ.mulIndicator g) x = s.piecewise f g x
state_after: no goals
Theorem: PowerSeries.coeff_X_pow_self
File: Mathlib/RingTheory/PowerSeries/Basic.lean

tactic: rw [coeff_X_pow, if_pos rfl]
state_before: R : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ (coeff R n) (X ^ n) = 1
state_after: no goals
Theorem: ProbabilityTheory.IndepFun.cgf_add
File: Mathlib/Probability/Moments.lean

tactic: by_cases hμ : μ = 0
state_before: Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t
state_after: case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
hμ : μ = 0
⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t

case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
hμ : ¬μ = 0
⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t

tactic: simp only [cgf, h_indep.mgf_add h_int_X.aestronglyMeasurable h_int_Y.aestronglyMeasurable]
state_before: case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
hμ : ¬μ = 0
⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t
state_after: case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
hμ : ¬μ = 0
⊢ log (mgf X μ t * mgf Y μ t) = log (mgf X μ t) + log (mgf Y μ t)

tactic: exact log_mul (mgf_pos' hμ h_int_X).ne' (mgf_pos' hμ h_int_Y).ne'
state_before: case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
hμ : ¬μ = 0
⊢ log (mgf X μ t * mgf Y μ t) = log (mgf X μ t) + log (mgf Y μ t)
state_after: no goals

tactic: simp [hμ]
state_before: case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X✝ : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
X Y : Ω → ℝ
h_indep : IndepFun X Y μ
h_int_X : Integrable (fun ω => rexp (t * X ω)) μ
h_int_Y : Integrable (fun ω => rexp (t * Y ω)) μ
hμ : μ = 0
⊢ cgf (X + Y) μ t = cgf X μ t + cgf Y μ t
state_after: no goals
Theorem: Finset.subset_map_iff
File: Mathlib/Data/Finset/Preimage.lean

tactic: classical
simp_rw [← coe_subset, coe_map, subset_image_iff, map_eq_image, eq_comm]
state_before: α : Type u
β : Type v
ι : Sort w
γ : Type x
f : α ↪ β
s : Finset β
t : Finset α
⊢ s ⊆ map f t ↔ ∃ u ⊆ t, s = map f u
state_after: no goals

tactic: simp_rw [← coe_subset, coe_map, subset_image_iff, map_eq_image, eq_comm]
state_before: α : Type u
β : Type v
ι : Sort w
γ : Type x
f : α ↪ β
s : Finset β
t : Finset α
⊢ s ⊆ map f t ↔ ∃ u ⊆ t, s = map f u
state_after: no goals
Theorem: mul_le_of_one_le_left
File: Mathlib/Algebra/Order/Ring/Defs.lean

tactic: simpa only [one_mul] using mul_le_mul_of_nonpos_right h hb
state_before: α : Type u
β : Type u_1
inst✝² : OrderedSemiring α
a b c d : α
inst✝¹ : ExistsAddOfLE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
hb : b ≤ 0
h : 1 ≤ a
⊢ a * b ≤ b
state_after: no goals
Theorem: OrderedCommGroup.to_contravariantClass_left_le
File: Mathlib/Algebra/Order/Group/Defs.lean

tactic: simpa using mul_le_mul_left' bc a⁻¹
state_before: α✝ α : Type u
inst✝ : OrderedCommGroup α
a b c : α
bc : a * b ≤ a * c
⊢ b ≤ c
state_after: no goals
Theorem: Batteries.UnionFind.equiv_find
File: .lake/packages/batteries/Batteries/Data/UnionFind/Lemmas.lean

tactic: simp [Equiv, find_root_1]
state_before: a b : Nat
self : UnionFind
x : Fin self.size
⊢ (self.find x).fst.Equiv a b ↔ self.Equiv a b
state_after: no goals
Theorem: Filter.cardinal_bInter_mem
File: Mathlib/Order/Filter/CardinalInter.lean

tactic: rw [biInter_eq_iInter]
state_before: ι α β : Type u
c : Cardinal.{u}
l : Filter α
inst✝ : CardinalInterFilter l c
S : Set ι
hS : #↑S < c
s : (i : ι) → i ∈ S → Set α
⊢ ⋂ i, ⋂ (hi : i ∈ S), s i hi ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l
state_after: ι α β : Type u
c : Cardinal.{u}
l : Filter α
inst✝ : CardinalInterFilter l c
S : Set ι
hS : #↑S < c
s : (i : ι) → i ∈ S → Set α
⊢ ⋂ x, s ↑x ⋯ ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l

tactic: exact (cardinal_iInter_mem hS).trans Subtype.forall
state_before: ι α β : Type u
c : Cardinal.{u}
l : Filter α
inst✝ : CardinalInterFilter l c
S : Set ι
hS : #↑S < c
s : (i : ι) → i ∈ S → Set α
⊢ ⋂ x, s ↑x ⋯ ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l
state_after: no goals
Theorem: DvdNotUnit.ne
File: Mathlib/Algebra/Associated.lean

tactic: by_contra hcontra
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
h : DvdNotUnit p q
⊢ p ≠ q
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
h : DvdNotUnit p q
hcontra : p = q
⊢ False

tactic: obtain ⟨hp, x, hx', hx''⟩ := h
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
h : DvdNotUnit p q
hcontra : p = q
⊢ False
state_after: case intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
hcontra : p = q
hp : p ≠ 0
x : α
hx' : ¬IsUnit x
hx'' : q = p * x
⊢ False

tactic: conv_lhs at hx'' => rw [← hcontra, ← mul_one p]
state_before: case intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
hcontra : p = q
hp : p ≠ 0
x : α
hx' : ¬IsUnit x
hx'' : q = p * x
⊢ False
state_after: case intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
hcontra : p = q
hp : p ≠ 0
x : α
hx' : ¬IsUnit x
hx'' : p * 1 = p * x
⊢ False

tactic: rw [(mul_left_cancel₀ hp hx'').symm] at hx'
state_before: case intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
hcontra : p = q
hp : p ≠ 0
x : α
hx' : ¬IsUnit x
hx'' : p * 1 = p * x
⊢ False
state_after: case intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
hcontra : p = q
hp : p ≠ 0
x : α
hx' : ¬IsUnit 1
hx'' : p * 1 = p * x
⊢ False

tactic: exact hx' isUnit_one
state_before: case intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CancelCommMonoidWithZero α
p q : α
hcontra : p = q
hp : p ≠ 0
x : α
hx' : ¬IsUnit 1
hx'' : p * 1 = p * x
⊢ False
state_after: no goals
Theorem: Ordinal.dvd_of_mod_eq_zero
File: Mathlib/SetTheory/Ordinal/Arithmetic.lean

tactic: simpa [H] using (div_add_mod a b).symm
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
H : a % b = 0
⊢ a = b * (a / b)
state_after: no goals
Theorem: IsPrimitiveRoot.norm_toInteger_sub_one_of_prime_ne_two'
File: Mathlib/NumberTheory/Cyclotomic/Rat.lean

tactic: have : IsCyclotomicExtension {p ^ (0 + 1)} ℚ K := by simpa using hcycl
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = ↑↑p
state_after: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
this : IsCyclotomicExtension {p ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = ↑↑p

tactic: replace hζ : IsPrimitiveRoot ζ (p ^ (0 + 1)) := by simpa using hζ
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
this : IsCyclotomicExtension {p ^ (0 + 1)} ℚ K
⊢ (Algebra.norm ℤ) (hζ.toInteger - 1) = ↑↑p
state_after: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ✝ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
this : IsCyclotomicExtension {p ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ (↑p ^ (0 + 1))
⊢ (Algebra.norm ℤ) (hζ✝.toInteger - 1) = ↑↑p

tactic: exact hζ.norm_toInteger_sub_one_of_prime_ne_two h
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ✝ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
this : IsCyclotomicExtension {p ^ (0 + 1)} ℚ K
hζ : IsPrimitiveRoot ζ (↑p ^ (0 + 1))
⊢ (Algebra.norm ℤ) (hζ✝.toInteger - 1) = ↑↑p
state_after: no goals

tactic: simpa using hcycl
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
⊢ IsCyclotomicExtension {p ^ (0 + 1)} ℚ K
state_after: no goals

tactic: simpa using hζ
state_before: p : ℕ+
k : ℕ
K : Type u
inst✝¹ : Field K
inst✝ : CharZero K
ζ : K
hp : Fact (Nat.Prime ↑p)
hcycl : IsCyclotomicExtension {p} ℚ K
hζ : IsPrimitiveRoot ζ ↑p
h : p ≠ 2
this : IsCyclotomicExtension {p ^ (0 + 1)} ℚ K
⊢ IsPrimitiveRoot ζ (↑p ^ (0 + 1))
state_after: no goals
Theorem: Finset.offDiag_insert
File: Mathlib/Data/Finset/Prod.lean

tactic: rw [insert_eq, union_comm, offDiag_union (disjoint_singleton_right.2 has), offDiag_singleton,
  union_empty, union_right_comm]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
inst✝ : DecidableEq α
s t : Finset α
x : α × α
a : α
has : a ∉ s
⊢ (insert a s).offDiag = s.offDiag ∪ {a} ×ˢ s ∪ s ×ˢ {a}
state_after: no goals
Theorem: t2Quotient.compatible
File: Mathlib/Topology/Separation.lean

tactic: change t2Setoid X ≤ Setoid.ker f
state_before: X✝ : Type u_1
Y✝ : Type u_2
inst✝⁴ : TopologicalSpace X✝
inst✝³ : FirstCountableTopology X✝
X : Type u_3
Y : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : T2Space Y
f : X → Y
hf : Continuous f
⊢ ∀ (a b : X), a ≈ b → f a = f b
state_after: X✝ : Type u_1
Y✝ : Type u_2
inst✝⁴ : TopologicalSpace X✝
inst✝³ : FirstCountableTopology X✝
X : Type u_3
Y : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : T2Space Y
f : X → Y
hf : Continuous f
⊢ t2Setoid X ≤ Setoid.ker f

tactic: exact sInf_le <| .of_injective_continuous
  (Setoid.ker_lift_injective _) (hf.quotient_lift fun _ _ ↦ id)
state_before: X✝ : Type u_1
Y✝ : Type u_2
inst✝⁴ : TopologicalSpace X✝
inst✝³ : FirstCountableTopology X✝
X : Type u_3
Y : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : T2Space Y
f : X → Y
hf : Continuous f
⊢ t2Setoid X ≤ Setoid.ker f
state_after: no goals
Theorem: FirstOrder.Language.BoundedFormula.realize_top
File: Mathlib/ModelTheory/Semantics.lean

tactic: simp [Top.top]
state_before: L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : L.Structure M
inst✝¹ : L.Structure N
inst✝ : L.Structure P
α : Type u'
β : Type v'
γ : Type u_3
n l : ℕ
φ ψ : L.BoundedFormula α l
θ : L.BoundedFormula α l.succ
v : α → M
xs : Fin l → M
⊢ ⊤.Realize v xs ↔ True
state_after: no goals
Theorem: Complex.cos_eq_zero_iff
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean

tactic: have h : (exp (θ * I) + exp (-θ * I)) / 2 = 0 ↔ exp (2 * θ * I) = -1 := by
  rw [@div_eq_iff _ _ (exp (θ * I) + exp (-θ * I)) 2 0 two_ne_zero, zero_mul,
    add_eq_zero_iff_eq_neg, neg_eq_neg_one_mul, ← div_eq_iff (exp_ne_zero _), ← exp_sub]
  ring_nf
state_before: θ : ℂ
⊢ cos θ = 0 ↔ ∃ k, θ = (2 * ↑k + 1) * ↑π / 2
state_after: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
⊢ cos θ = 0 ↔ ∃ k, θ = (2 * ↑k + 1) * ↑π / 2

tactic: rw [cos, h, ← exp_pi_mul_I, exp_eq_exp_iff_exists_int, mul_right_comm]
state_before: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
⊢ cos θ = 0 ↔ ∃ k, θ = (2 * ↑k + 1) * ↑π / 2
state_after: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
⊢ (∃ n, 2 * I * θ = ↑π * I + ↑n * (2 * ↑π * I)) ↔ ∃ k, θ = (2 * ↑k + 1) * ↑π / 2

tactic: refine exists_congr fun x => ?_
state_before: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
⊢ (∃ n, 2 * I * θ = ↑π * I + ↑n * (2 * ↑π * I)) ↔ ∃ k, θ = (2 * ↑k + 1) * ↑π / 2
state_after: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
x : ℤ
⊢ 2 * I * θ = ↑π * I + ↑x * (2 * ↑π * I) ↔ θ = (2 * ↑x + 1) * ↑π / 2

tactic: refine (iff_of_eq <| congr_arg _ ?_).trans (mul_right_inj' <| mul_ne_zero two_ne_zero I_ne_zero)
state_before: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
x : ℤ
⊢ 2 * I * θ = ↑π * I + ↑x * (2 * ↑π * I) ↔ θ = (2 * ↑x + 1) * ↑π / 2
state_after: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
x : ℤ
⊢ ↑π * I + ↑x * (2 * ↑π * I) = 2 * I * ((2 * ↑x + 1) * ↑π / 2)

tactic: field_simp
state_before: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
x : ℤ
⊢ ↑π * I + ↑x * (2 * ↑π * I) = 2 * I * ((2 * ↑x + 1) * ↑π / 2)
state_after: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
x : ℤ
⊢ (↑π * I + ↑x * (2 * ↑π * I)) * 2 = 2 * I * ((2 * ↑x + 1) * ↑π)

tactic: ring
state_before: θ : ℂ
h : (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
x : ℤ
⊢ (↑π * I + ↑x * (2 * ↑π * I)) * 2 = 2 * I * ((2 * ↑x + 1) * ↑π)
state_after: no goals

tactic: rw [@div_eq_iff _ _ (exp (θ * I) + exp (-θ * I)) 2 0 two_ne_zero, zero_mul,
  add_eq_zero_iff_eq_neg, neg_eq_neg_one_mul, ← div_eq_iff (exp_ne_zero _), ← exp_sub]
state_before: θ : ℂ
⊢ (cexp (θ * I) + cexp (-θ * I)) / 2 = 0 ↔ cexp (2 * θ * I) = -1
state_after: θ : ℂ
⊢ cexp (θ * I - -θ * I) = -1 ↔ cexp (2 * θ * I) = -1

tactic: ring_nf
state_before: θ : ℂ
⊢ cexp (θ * I - -θ * I) = -1 ↔ cexp (2 * θ * I) = -1
state_after: no goals
Theorem: Matrix.one_div_pow
File: Mathlib/LinearAlgebra/Matrix/ZPow.lean

tactic: simp only [one_div, inv_pow']
state_before: n' : Type u_1
inst✝² : DecidableEq n'
inst✝¹ : Fintype n'
R : Type u_2
inst✝ : CommRing R
A : M
n : ℕ
⊢ (1 / A) ^ n = 1 / A ^ n
state_after: no goals
Theorem: Computation.eq_empty_of_not_terminates
File: Mathlib/Data/Seq/Computation.lean

tactic: apply Subtype.eq
state_before: α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
⊢ s = empty α
state_after: case a
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
⊢ ↑s = ↑(empty α)

tactic: funext n
state_before: case a
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
⊢ ↑s = ↑(empty α)
state_after: case a.h
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
⊢ ↑s n = ↑(empty α) n

tactic: induction' h : s.val n with _
state_before: case a.h
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
⊢ ↑s n = ↑(empty α) n
state_after: case a.h.none
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
h : ↑s n = none
⊢ none = ↑(empty α) n

case a.h.some
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
val✝ : α
h : ↑s n = some val✝
⊢ some val✝ = ↑(empty α) n

tactic: refine absurd ?_ H
state_before: case a.h.some
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
val✝ : α
h : ↑s n = some val✝
⊢ some val✝ = ↑(empty α) n
state_after: case a.h.some
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
val✝ : α
h : ↑s n = some val✝
⊢ s.Terminates

tactic: exact ⟨⟨_, _, h.symm⟩⟩
state_before: case a.h.some
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
val✝ : α
h : ↑s n = some val✝
⊢ s.Terminates
state_after: no goals

tactic: rfl
state_before: case a.h.none
α : Type u
β : Type v
γ : Type w
s : Computation α
H : ¬s.Terminates
n : ℕ
h : ↑s n = none
⊢ none = ↑(empty α) n
state_after: no goals
Theorem: SimpleGraph.Walk.cons_support_tail
File: Mathlib/Combinatorics/SimpleGraph/Connectivity.lean

tactic: rw [← support_cons, cons_tail_eq]
state_before: V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y : V
p : G.Walk x y
hp : ¬p.Nil
⊢ x :: (p.tail hp).support = p.support
state_after: no goals
Theorem: Finset.fold_insert
File: Mathlib/Data/Finset/Fold.lean

tactic: unfold fold
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
op : β → β → β
hc : Std.Commutative op
ha : Std.Associative op
f : α → β
b : β
s : Finset α
a : α
inst✝ : DecidableEq α
h : a ∉ s
⊢ fold op b f (insert a s) = op (f a) (fold op b f s)
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
op : β → β → β
hc : Std.Commutative op
ha : Std.Associative op
f : α → β
b : β
s : Finset α
a : α
inst✝ : DecidableEq α
h : a ∉ s
⊢ Multiset.fold op b (Multiset.map f (insert a s).val) = op (f a) (Multiset.fold op b (Multiset.map f s.val))

tactic: rw [insert_val, ndinsert_of_not_mem h, Multiset.map_cons, fold_cons_left]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
op : β → β → β
hc : Std.Commutative op
ha : Std.Associative op
f : α → β
b : β
s : Finset α
a : α
inst✝ : DecidableEq α
h : a ∉ s
⊢ Multiset.fold op b (Multiset.map f (insert a s).val) = op (f a) (Multiset.fold op b (Multiset.map f s.val))
state_after: no goals
Theorem: MeasureTheory.IsProjectiveMeasureFamily.measure_univ_eq
File: Mathlib/MeasureTheory/Constructions/Projective.lean

tactic: classical
rw [← hP.measure_univ_eq_of_subset I.subset_union_left,
  ← hP.measure_univ_eq_of_subset (I.subset_union_right (s₂:= J))]
state_before: ι : Type u_1
α : ι → Type u_2
inst✝ : (i : ι) → MeasurableSpace (α i)
P : (J : Finset ι) → Measure ((j : { x // x ∈ J }) → α ↑j)
I✝ J✝ : Finset ι
hP : IsProjectiveMeasureFamily P
I J : Finset ι
⊢ (P I) univ = (P J) univ
state_after: no goals

tactic: rw [← hP.measure_univ_eq_of_subset I.subset_union_left,
  ← hP.measure_univ_eq_of_subset (I.subset_union_right (s₂:= J))]
state_before: ι : Type u_1
α : ι → Type u_2
inst✝ : (i : ι) → MeasurableSpace (α i)
P : (J : Finset ι) → Measure ((j : { x // x ∈ J }) → α ↑j)
I✝ J✝ : Finset ι
hP : IsProjectiveMeasureFamily P
I J : Finset ι
⊢ (P I) univ = (P J) univ
state_after: no goals
Theorem: Set.piecewise_univ
File: Mathlib/Data/Set/Function.lean

tactic: ext i
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
δ : α → Sort u_6
s : Set α
f g : (i : α) → δ i
inst✝ : (i : α) → Decidable (i ∈ univ)
⊢ univ.piecewise f g = f
state_after: case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
δ : α → Sort u_6
s : Set α
f g : (i : α) → δ i
inst✝ : (i : α) → Decidable (i ∈ univ)
i : α
⊢ univ.piecewise f g i = f i

tactic: simp [piecewise]
state_before: case h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
δ : α → Sort u_6
s : Set α
f g : (i : α) → δ i
inst✝ : (i : α) → Decidable (i ∈ univ)
i : α
⊢ univ.piecewise f g i = f i
state_after: no goals
Theorem: Nat.choose_mul_succ_eq
File: Mathlib/Data/Nat/Choose/Basic.lean

tactic: simp
state_before: case zero
n : ℕ
⊢ n.choose 0 * (n + 1) = (n + 1).choose 0 * (n + 1 - 0)
state_after: no goals

tactic: obtain hk | hk := le_or_lt (k + 1) (n + 1)
state_before: case succ
n k : ℕ
⊢ n.choose (k + 1) * (n + 1) = (n + 1).choose (k + 1) * (n + 1 - (k + 1))
state_after: case succ.inl
n k : ℕ
hk : k + 1 ≤ n + 1
⊢ n.choose (k + 1) * (n + 1) = (n + 1).choose (k + 1) * (n + 1 - (k + 1))

case succ.inr
n k : ℕ
hk : n + 1 < k + 1
⊢ n.choose (k + 1) * (n + 1) = (n + 1).choose (k + 1) * (n + 1 - (k + 1))

tactic: rw [choose_succ_succ, Nat.add_mul, succ_sub_succ, ← choose_succ_right_eq, ← succ_sub_succ,
  Nat.mul_sub_left_distrib, Nat.add_sub_cancel' (Nat.mul_le_mul_left _ hk)]
state_before: case succ.inl
n k : ℕ
hk : k + 1 ≤ n + 1
⊢ n.choose (k + 1) * (n + 1) = (n + 1).choose (k + 1) * (n + 1 - (k + 1))
state_after: no goals

tactic: rw [choose_eq_zero_of_lt hk, choose_eq_zero_of_lt (n.lt_succ_self.trans hk), Nat.zero_mul,
  Nat.zero_mul]
state_before: case succ.inr
n k : ℕ
hk : n + 1 < k + 1
⊢ n.choose (k + 1) * (n + 1) = (n + 1).choose (k + 1) * (n + 1 - (k + 1))
state_after: no goals
Theorem: DirichletCharacter.changeLevel_trans
File: Mathlib/NumberTheory/DirichletCharacter/Basic.lean

tactic: simp [changeLevel_def, MonoidHom.comp_assoc, ZMod.unitsMap_comp]
state_before: R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
m d : ℕ
hm : n ∣ m
hd : m ∣ d
⊢ (changeLevel ⋯) χ = (changeLevel hd) ((changeLevel hm) χ)
state_after: no goals
Theorem: Part.toFinset_some
File: Mathlib/Data/Finset/PImage.lean

tactic: simp [toFinset]
state_before: α : Type u_1
β : Type u_2
a : α
inst✝ : Decidable (some a).Dom
⊢ (some a).toFinset = {a}
state_after: no goals