tasksource/leandojo huggingface dataset:
Theorem: rank_mul_rank
File: Mathlib/FieldTheory/Tower.lean

tactic: convert lift_rank_mul_lift_rank F K A <;> rw [lift_id]
state_before: F✝ : Type u
K✝ : Type v
A✝ : Type w
inst✝²¹ : CommRing F✝
inst✝²⁰ : Ring K✝
inst✝¹⁹ : AddCommGroup A✝
inst✝¹⁸ : Algebra F✝ K✝
inst✝¹⁷ : Module K✝ A✝
inst✝¹⁶ : Module F✝ A✝
inst✝¹⁵ : IsScalarTower F✝ K✝ A✝
inst✝¹⁴ : StrongRankCondition F✝
inst✝¹³ : StrongRankCondition K✝
inst✝¹² : Module.Free F✝ K✝
inst✝¹¹ : Module.Free K✝ A✝
F : Type u
K A : Type v
inst✝¹⁰ : CommRing F
inst✝⁹ : Ring K
inst✝⁸ : AddCommGroup A
inst✝⁷ : Algebra F K
inst✝⁶ : Module K A
inst✝⁵ : Module F A
inst✝⁴ : IsScalarTower F K A
inst✝³ : StrongRankCondition F
inst✝² : StrongRankCondition K
inst✝¹ : Module.Free F K
inst✝ : Module.Free K A
⊢ Module.rank F K * Module.rank K A = Module.rank F A
Theorem: OreLocalization.mul_zero
File: Mathlib/RingTheory/OreLocalization/Basic.lean

tactic: induction' x using OreLocalization.ind with r s
state_before: R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
x : OreLocalization R S
⊢ x * 0 = 0

tactic: rw [OreLocalization.zero_def, oreDiv_mul_char r 0 s 1 0 1 (by simp)]
state_before: case c
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r : R
s : { x // x ∈ S }
⊢ r /ₒ s * 0 = 0

tactic: simp
state_before: case c
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r : R
s : { x // x ∈ S }
⊢ r * 0 /ₒ (1 * 1) = 0 /ₒ 1

tactic: simp
state_before: R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r : R
s : { x // x ∈ S }
⊢ 0 * ↑1 = ↑s * 0
Theorem: zsmul_int_int
File: Mathlib/Algebra/GroupPower/Lemmas.lean

tactic: simp
state_before: α : Type ?u.285397
M : Type u
N : Type v
G : Type w
H : Type x
A : Type y
B : Type z
R : Type u₁
S : Type u₂
a b : ℤ
⊢ a • b = a * b
Theorem: span_gramSchmidtNormed
File: Mathlib/Analysis/InnerProductSpace/GramSchmidtOrtho.lean

tactic: refine' span_eq_span
  (Set.image_subset_iff.2 fun i hi => smul_mem _ _ <| subset_span <| mem_image_of_mem _ hi)
  (Set.image_subset_iff.2 fun i hi =>
    span_mono (image_subset _ <| singleton_subset_set_iff.2 hi) _)
state_before: 𝕜 : Type u_3
E : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
s : Set ι
⊢ span 𝕜 (gramSchmidtNormed 𝕜 f '' s) = span 𝕜 (gramSchmidt 𝕜 f '' s)

tactic: simp only [coe_singleton, Set.image_singleton]
state_before: 𝕜 : Type u_3
E : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
s : Set ι
i : ι
hi : i ∈ s
⊢ gramSchmidt 𝕜 f i ∈ span 𝕜 (gramSchmidtNormed 𝕜 f '' ↑{i})

tactic: by_cases h : gramSchmidt 𝕜 f i = 0
state_before: 𝕜 : Type u_3
E : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
s : Set ι
i : ι
hi : i ∈ s
⊢ gramSchmidt 𝕜 f i ∈ span 𝕜 {gramSchmidtNormed 𝕜 f i}

tactic: simp [h]
state_before: case pos
𝕜 : Type u_3
E : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
s : Set ι
i : ι
hi : i ∈ s
h : gramSchmidt 𝕜 f i = 0
⊢ gramSchmidt 𝕜 f i ∈ span 𝕜 {gramSchmidtNormed 𝕜 f i}

tactic: refine' mem_span_singleton.2 ⟨‖gramSchmidt 𝕜 f i‖, smul_inv_smul₀ _ _⟩
state_before: case neg
𝕜 : Type u_3
E : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
s : Set ι
i : ι
hi : i ∈ s
h : ¬gramSchmidt 𝕜 f i = 0
⊢ gramSchmidt 𝕜 f i ∈ span 𝕜 {gramSchmidtNormed 𝕜 f i}

tactic: exact_mod_cast norm_ne_zero_iff.2 h
state_before: case neg
𝕜 : Type u_3
E : Type u_2
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
ι : Type u_1
inst✝² : LinearOrder ι
inst✝¹ : LocallyFiniteOrderBot ι
inst✝ : IsWellOrder ι fun x x_1 => x < x_1
f : ι → E
s : Set ι
i : ι
hi : i ∈ s
h : ¬gramSchmidt 𝕜 f i = 0
⊢ ↑‖gramSchmidt 𝕜 f i‖ ≠ 0
Theorem: CategoryTheory.Limits.colimit.map_post
File: Mathlib/CategoryTheory/Limits/HasLimits.lean

tactic: ext
state_before: J : Type u₁
inst✝⁵ : Category J
K : Type u₂
inst✝⁴ : Category K
C : Type u
inst✝³ : Category C
F : J ⥤ C
inst✝² : HasColimitsOfShape J C
G : J ⥤ C
α : F ⟶ G
D : Type u'
inst✝¹ : Category D
inst✝ : HasColimitsOfShape J D
H : C ⥤ D
⊢ post F H ≫ H.map (colim.map α) = colim.map (whiskerRight α H) ≫ post G H

tactic: rw [← assoc, colimit.ι_post, ← H.map_comp, colimit.ι_map, H.map_comp]
state_before: case w
J : Type u₁
inst✝⁵ : Category J
K : Type u₂
inst✝⁴ : Category K
C : Type u
inst✝³ : Category C
F : J ⥤ C
inst✝² : HasColimitsOfShape J C
G : J ⥤ C
α : F ⟶ G
D : Type u'
inst✝¹ : Category D
inst✝ : HasColimitsOfShape J D
H : C ⥤ D
j✝ : J
⊢ ι (F ⋙ H) j✝ ≫ post F H ≫ H.map (colim.map α) = ι (F ⋙ H) j✝ ≫ colim.map (whiskerRight α H) ≫ post G H

tactic: rw [← assoc, colimit.ι_map, assoc, colimit.ι_post]
state_before: case w
J : Type u₁
inst✝⁵ : Category J
K : Type u₂
inst✝⁴ : Category K
C : Type u
inst✝³ : Category C
F : J ⥤ C
inst✝² : HasColimitsOfShape J C
G : J ⥤ C
α : F ⟶ G
D : Type u'
inst✝¹ : Category D
inst✝ : HasColimitsOfShape J D
H : C ⥤ D
j✝ : J
⊢ H.map (α.app j✝) ≫ H.map (ι G j✝) = ι (F ⋙ H) j✝ ≫ colim.map (whiskerRight α H) ≫ post G H

tactic: rfl
state_before: case w
J : Type u₁
inst✝⁵ : Category J
K : Type u₂
inst✝⁴ : Category K
C : Type u
inst✝³ : Category C
F : J ⥤ C
inst✝² : HasColimitsOfShape J C
G : J ⥤ C
α : F ⟶ G
D : Type u'
inst✝¹ : Category D
inst✝ : HasColimitsOfShape J D
H : C ⥤ D
j✝ : J
⊢ H.map (α.app j✝) ≫ H.map (ι G j✝) = (whiskerRight α H).app j✝ ≫ H.map (ι G j✝)
Theorem: CategoryTheory.Limits.image.map_comp
File: Mathlib/CategoryTheory/Limits/Shapes/Images.lean

tactic: congr
state_before: C : Type u
inst✝⁶ : Category C
f g : Arrow C
inst✝⁵ : HasImage f.hom
inst✝⁴ : HasImage g.hom
sq : f ⟶ g
inst✝³ : HasImageMap sq
h : Arrow C
inst✝² : HasImage h.hom
sq' : g ⟶ h
inst✝¹ : HasImageMap sq'
inst✝ : HasImageMap (sq ≫ sq')
⊢ (HasImageMap.imageMap (sq ≫ sq')).map = (imageMapComp sq sq').map

tactic: simp only [eq_iff_true_of_subsingleton]
state_before: case e_self
C : Type u
inst✝⁶ : Category C
f g : Arrow C
inst✝⁵ : HasImage f.hom
inst✝⁴ : HasImage g.hom
sq : f ⟶ g
inst✝³ : HasImageMap sq
h : Arrow C
inst✝² : HasImage h.hom
sq' : g ⟶ h
inst✝¹ : HasImageMap sq'
inst✝ : HasImageMap (sq ≫ sq')
⊢ HasImageMap.imageMap (sq ≫ sq') = imageMapComp sq sq'
Theorem: Fin.map_valEmbedding_Ioc
File: Mathlib/Data/Fin/Interval.lean

tactic: simp [Ioc_eq_finset_subtype, Finset.fin, Finset.map_map, Ioc_filter_lt_of_lt_right]
state_before: n : ℕ
a b : Fin n
⊢ map valEmbedding (Ioc a b) = Ioc ↑a ↑b
Theorem: ofMul_list_prod
File: Mathlib/Algebra/BigOperators/Basic.lean

tactic: simp [ofMul]
state_before: ι : Type ?u.987998
β : Type u
α : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a : α
f g : α → β
inst✝ : Monoid α
s : List α
⊢ ↑ofMul (List.prod s) = List.sum (List.map (↑ofMul) s)

tactic: rfl
state_before: ι : Type ?u.987998
β : Type u
α : Type v
γ : Type w
s✝ s₁ s₂ : Finset α
a : α
f g : α → β
inst✝ : Monoid α
s : List α
⊢ List.prod s = List.sum s
Theorem: upperCentralSeriesStep_eq_comap_center
File: Mathlib/GroupTheory/Nilpotent.lean

tactic: ext
state_before: G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
⊢ upperCentralSeriesStep H = comap (mk' H) (center (G ⧸ H))

tactic: rw [mem_comap, mem_center_iff, forall_mk]
state_before: case h
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
x✝ : G
⊢ x✝ ∈ upperCentralSeriesStep H ↔ x✝ ∈ comap (mk' H) (center (G ⧸ H))

tactic: apply forall_congr'
state_before: case h
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
x✝ : G
⊢ x✝ ∈ upperCentralSeriesStep H ↔ ∀ (x : G), ↑x * ↑(mk' H) x✝ = ↑(mk' H) x✝ * ↑x

tactic: intro y
state_before: case h.h
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
x✝ : G
⊢ ∀ (a : G), x✝ * a * x✝⁻¹ * a⁻¹ ∈ H ↔ ↑a * ↑(mk' H) x✝ = ↑(mk' H) x✝ * ↑a

tactic: rw [coe_mk', ← QuotientGroup.mk_mul, ← QuotientGroup.mk_mul, eq_comm, eq_iff_div_mem,
  div_eq_mul_inv, mul_inv_rev, mul_assoc]
state_before: case h.h
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
x✝ y : G
⊢ x✝ * y * x✝⁻¹ * y⁻¹ ∈ H ↔ ↑y * ↑(mk' H) x✝ = ↑(mk' H) x✝ * ↑y
Theorem: CategoryTheory.Abelian.mono_inl_of_factor_thru_epi_mono_factorization
File: Mathlib/CategoryTheory/Abelian/Basic.lean

tactic: apply mono_inl_of_isColimit _ _ (PushoutCocone.isColimitOfFactors _ _ _ _ _ hf hg t ht)
state_before: C : Type u
inst✝⁴ : Category C
inst✝³ : Abelian C
inst✝² : HasPushouts C
W X Y Z : C
f✝ : X ⟶ Y
g✝ : X ⟶ Z
f : X ⟶ Y
g : X ⟶ Z
g₁ : X ⟶ W
inst✝¹ : Epi g₁
g₂ : W ⟶ Z
inst✝ : Mono g₂
hg : g₁ ≫ g₂ = g
f' : W ⟶ Y
hf : g₁ ≫ f' = f
t : PushoutCocone f g
ht : IsColimit t
⊢ Mono (PushoutCocone.inl t)
Theorem: CategoryTheory.nat_trans_from_is_connected
File: Mathlib/CategoryTheory/IsConnected.lean

tactic: have := α.naturality f
state_before: J : Type u₁
inst✝³ : Category J
K : Type u₂
inst✝² : Category K
C : Type u₂
inst✝¹ : Category C
inst✝ : IsPreconnected J
X Y : C
α : (Functor.const J).obj X ⟶ (Functor.const J).obj Y
x✝¹ x✝ : J
f : x✝¹ ⟶ x✝
⊢ (fun j => α.app j) x✝¹ = (fun j => α.app j) x✝

tactic: erw [id_comp, comp_id] at this
state_before: J : Type u₁
inst✝³ : Category J
K : Type u₂
inst✝² : Category K
C : Type u₂
inst✝¹ : Category C
inst✝ : IsPreconnected J
X Y : C
α : (Functor.const J).obj X ⟶ (Functor.const J).obj Y
x✝¹ x✝ : J
f : x✝¹ ⟶ x✝
this : ((Functor.const J).obj X).map f ≫ α.app x✝ = α.app x✝¹ ≫ ((Functor.const J).obj Y).map f
⊢ (fun j => α.app j) x✝¹ = (fun j => α.app j) x✝

tactic: exact this.symm
state_before: J : Type u₁
inst✝³ : Category J
K : Type u₂
inst✝² : Category K
C : Type u₂
inst✝¹ : Category C
inst✝ : IsPreconnected J
X Y : C
α : (Functor.const J).obj X ⟶ (Functor.const J).obj Y
x✝¹ x✝ : J
f : x✝¹ ⟶ x✝
this : α.app x✝ = α.app x✝¹
⊢ (fun j => α.app j) x✝¹ = (fun j => α.app j) x✝
Theorem: ZMod.χ₄_eq_neg_one_pow
File: Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean

tactic: rw [χ₄_nat_eq_if_mod_four]
state_before: n : ℕ
hn : n % 2 = 1
⊢ ↑χ₄ ↑n = (-1) ^ (n / 2)

tactic: simp only [hn, Nat.one_ne_zero, if_false]
state_before: n : ℕ
hn : n % 2 = 1
⊢ (if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1) = (-1) ^ (n / 2)

tactic: nth_rw 3 [← Nat.div_add_mod n 4]
state_before: n : ℕ
hn : n % 2 = 1
⊢ (if n % 4 = 1 then 1 else -1) = (-1) ^ (n / 2)

tactic: nth_rw 3 [(by norm_num : 4 = 2 * 2)]
state_before: n : ℕ
hn : n % 2 = 1
⊢ (if n % 4 = 1 then 1 else -1) = (-1) ^ ((4 * (n / 4) + n % 4) / 2)

tactic: rw [mul_assoc, add_comm, Nat.add_mul_div_left _ _ (by norm_num : 0 < 2), pow_add, pow_mul,
  neg_one_sq, one_pow, mul_one]
state_before: n : ℕ
hn : n % 2 = 1
⊢ (if n % 4 = 1 then 1 else -1) = (-1) ^ ((2 * 2 * (n / 4) + n % 4) / 2)

tactic: have help : ∀ m : ℕ, m < 4 → m % 2 = 1 → ite (m = 1) (1 : ℤ) (-1) = (-1) ^ (m / 2) := by decide
state_before: n : ℕ
hn : n % 2 = 1
⊢ (if n % 4 = 1 then 1 else -1) = (-1) ^ (n % 4 / 2)

tactic: exact
  help (n % 4) (Nat.mod_lt n (by norm_num))
    ((Nat.mod_mod_of_dvd n (by norm_num : 2 ∣ 4)).trans hn)
state_before: n : ℕ
hn : n % 2 = 1
help : ∀ (m : ℕ), m < 4 → m % 2 = 1 → (if m = 1 then 1 else -1) = (-1) ^ (m / 2)
⊢ (if n % 4 = 1 then 1 else -1) = (-1) ^ (n % 4 / 2)

tactic: norm_num
state_before: n : ℕ
hn : n % 2 = 1
⊢ 4 = 2 * 2

tactic: norm_num
state_before: n : ℕ
hn : n % 2 = 1
⊢ 0 < 2

tactic: decide
state_before: n : ℕ
hn : n % 2 = 1
⊢ ∀ (m : ℕ), m < 4 → m % 2 = 1 → (if m = 1 then 1 else -1) = (-1) ^ (m / 2)

tactic: norm_num
state_before: n : ℕ
hn : n % 2 = 1
help : ∀ (m : ℕ), m < 4 → m % 2 = 1 → (if m = 1 then 1 else -1) = (-1) ^ (m / 2)
⊢ 4 > 0

tactic: norm_num
state_before: n : ℕ
hn : n % 2 = 1
help : ∀ (m : ℕ), m < 4 → m % 2 = 1 → (if m = 1 then 1 else -1) = (-1) ^ (m / 2)
⊢ 2 ∣ 4
Theorem: SimpleGraph.adjMatrix_dotProduct
File: Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean

tactic: simp [neighborFinset_eq_filter, dotProduct, sum_filter]
state_before: V : Type u_2
α : Type u_1
β : Type ?u.32376
G : SimpleGraph V
inst✝² : DecidableRel G.Adj
inst✝¹ : Fintype V
inst✝ : NonAssocSemiring α
v : V
vec : V → α
⊢ adjMatrix α G v ⬝ᵥ vec = ∑ u in neighborFinset G v, vec u
Theorem: Fin.card_Ici
File: Mathlib/Data/Fin/Interval.lean

tactic: cases n with
| zero => exact Fin.elim0 a
| succ =>
  rw [← card_map, map_valEmbedding_Ici, Nat.card_Icc, Nat.succ_sub_one]
  assumption
state_before: n : ℕ
a b : Fin n
⊢ card (Ici a) = n - ↑a

tactic: exact Fin.elim0 a
state_before: case zero
a b : Fin Nat.zero
⊢ card (Ici a) = Nat.zero - ↑a

tactic: rw [← card_map, map_valEmbedding_Ici, Nat.card_Icc, Nat.succ_sub_one]
state_before: case succ
n✝ : ℕ
a b : Fin (Nat.succ n✝)
⊢ card (Ici a) = Nat.succ n✝ - ↑a

tactic: assumption
state_before: case succ.b
n✝ : ℕ
a b : Fin (Nat.succ n✝)
⊢ Fin (Nat.succ n✝)
Theorem: card_perms_of_finset
File: Mathlib/Data/Fintype/Perm.lean

tactic: rintro ⟨⟨l⟩, hs⟩
state_before: α : Type u_1
β : Type ?u.52511
γ : Type ?u.52514
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
⊢ ∀ (s : Finset α), card (permsOfFinset s) = (card s)!

tactic: exact length_permsOfList l
state_before: case mk.mk
α : Type u_1
β : Type ?u.52511
γ : Type ?u.52514
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
val✝ : Multiset α
l : List α
hs : Multiset.Nodup (Quot.mk Setoid.r l)
⊢ card (permsOfFinset { val := Quot.mk Setoid.r l, nodup := hs }) = (card { val := Quot.mk Setoid.r l, nodup := hs })!
Theorem: ProbabilityTheory.condCount_isProbabilityMeasure
File: Mathlib/Probability/CondCount.lean

tactic: rw [condCount, cond_apply _ hs.measurableSet, Set.inter_univ, ENNReal.inv_mul_cancel]
state_before: Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
inst✝ : MeasurableSingletonClass Ω
s : Set Ω
hs : Set.Finite s
hs' : Set.Nonempty s
⊢ ↑↑(condCount s) Set.univ = 1

tactic: exact fun h => hs'.ne_empty <| Measure.empty_of_count_eq_zero h
state_before: case h0
Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
inst✝ : MeasurableSingletonClass Ω
s : Set Ω
hs : Set.Finite s
hs' : Set.Nonempty s
⊢ ↑↑Measure.count s ≠ 0

tactic: exact (Measure.count_apply_lt_top.2 hs).ne
state_before: case ht
Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
inst✝ : MeasurableSingletonClass Ω
s : Set Ω
hs : Set.Finite s
hs' : Set.Nonempty s
⊢ ↑↑Measure.count s ≠ ⊤
Theorem: sum_range_diag_flip
File: Mathlib/Data/Complex/Exponential.lean

tactic: rw [sum_sigma', sum_sigma']
state_before: α✝ : Type ?u.61826
inst✝⁴ : LinearOrderedField α✝
inst✝³ : Archimedean α✝
β : Type ?u.61890
inst✝² : Ring β
abv : β → α✝
inst✝¹ : IsAbsoluteValue abv
α : Type u_1
inst✝ : AddCommMonoid α
n : ℕ
f : ℕ → ℕ → α
⊢ ∑ m in range n, ∑ k in range (m + 1), f k (m - k) = ∑ m in range n, ∑ k in range (n - m), f m k

tactic: exact
  sum_bij (fun a _ => ⟨a.2, a.1 - a.2⟩)
    (fun a ha =>
      have h₁ : a.1 < n := mem_range.1 (mem_sigma.1 ha).1
      have h₂ : a.2 < Nat.succ a.1 := mem_range.1 (mem_sigma.1 ha).2
      mem_sigma.2
        ⟨mem_range.2 (lt_of_lt_of_le h₂ h₁),
          mem_range.2 ((tsub_lt_tsub_iff_right (Nat.le_of_lt_succ h₂)).2 h₁)⟩)
    (fun _ _ => rfl)
    (fun ⟨a₁, a₂⟩ ⟨b₁, b₂⟩ ha hb h =>
      have ha : a₁ < n ∧ a₂ ≤ a₁ :=
        ⟨mem_range.1 (mem_sigma.1 ha).1, Nat.le_of_lt_succ (mem_range.1 (mem_sigma.1 ha).2)⟩
      have hb : b₁ < n ∧ b₂ ≤ b₁ :=
        ⟨mem_range.1 (mem_sigma.1 hb).1, Nat.le_of_lt_succ (mem_range.1 (mem_sigma.1 hb).2)⟩
      have h : a₂ = b₂ ∧ _ := by simpa using h
      have h' : a₁ = b₁ - b₂ + a₂ := (tsub_eq_iff_eq_add_of_le ha.2).1 (eq_of_heq h.2)
      Sigma.mk.inj_iff.2 ⟨tsub_add_cancel_of_le hb.2 ▸ h'.symm ▸ h.1 ▸ rfl, heq_of_eq h.1⟩)
    fun ⟨a₁, a₂⟩ ha =>
    have ha : a₁ < n ∧ a₂ < n - a₁ :=
      ⟨mem_range.1 (mem_sigma.1 ha).1, mem_range.1 (mem_sigma.1 ha).2⟩
    ⟨⟨a₂ + a₁, a₁⟩,
      ⟨mem_sigma.2
          ⟨mem_range.2 (lt_tsub_iff_right.1 ha.2),
            mem_range.2 (Nat.lt_succ_of_le (Nat.le_add_left _ _))⟩,
        Sigma.mk.inj_iff.2 ⟨rfl, heq_of_eq (add_tsub_cancel_right _ _).symm⟩⟩⟩
state_before: α✝ : Type ?u.61826
inst✝⁴ : LinearOrderedField α✝
inst✝³ : Archimedean α✝
β : Type ?u.61890
inst✝² : Ring β
abv : β → α✝
inst✝¹ : IsAbsoluteValue abv
α : Type u_1
inst✝ : AddCommMonoid α
n : ℕ
f : ℕ → ℕ → α
⊢ ∑ x in Finset.sigma (range n) fun m => range (m + 1), f x.snd (x.fst - x.snd) =
    ∑ x in Finset.sigma (range n) fun m => range (n - m), f x.fst x.snd

tactic: simpa using h
state_before: α✝ : Type ?u.61826
inst✝⁴ : LinearOrderedField α✝
inst✝³ : Archimedean α✝
β : Type ?u.61890
inst✝² : Ring β
abv : β → α✝
inst✝¹ : IsAbsoluteValue abv
α : Type u_1
inst✝ : AddCommMonoid α
n : ℕ
f : ℕ → ℕ → α
x✝¹ x✝ : (_ : ℕ) × ℕ
a₁ a₂ : ℕ
ha✝ : { fst := a₁, snd := a₂ } ∈ Finset.sigma (range n) fun m => range (m + 1)
b₁ b₂ : ℕ
hb✝ : { fst := b₁, snd := b₂ } ∈ Finset.sigma (range n) fun m => range (m + 1)
h :
  (fun a x => { fst := a.snd, snd := a.fst - a.snd }) { fst := a₁, snd := a₂ } ha✝ =
    (fun a x => { fst := a.snd, snd := a.fst - a.snd }) { fst := b₁, snd := b₂ } hb✝
ha : a₁ < n ∧ a₂ ≤ a₁
hb : b₁ < n ∧ b₂ ≤ b₁
⊢ a₂ = b₂ ∧ HEq (a₁ - a₂) (b₁ - b₂)
Theorem: CategoryTheory.Subobject.factorThru_ofLE
File: Mathlib/CategoryTheory/Subobject/FactorThru.lean

tactic: ext
state_before: C : Type u₁
inst✝¹ : Category C
X Y✝ Z✝ : C
D : Type u₂
inst✝ : Category D
Y Z : C
P Q : Subobject Y
f : Z ⟶ Y
h : P ≤ Q
w : Factors P f
⊢ factorThru Q f (_ : Factors Q f) = factorThru P f w ≫ ofLE P Q h

tactic: simp
state_before: case h
C : Type u₁
inst✝¹ : Category C
X Y✝ Z✝ : C
D : Type u₂
inst✝ : Category D
Y Z : C
P Q : Subobject Y
f : Z ⟶ Y
h : P ≤ Q
w : Factors P f
⊢ factorThru Q f (_ : Factors Q f) ≫ arrow Q = (factorThru P f w ≫ ofLE P Q h) ≫ arrow Q
Theorem: contDiffOn_of_continuousOn_differentiableOn_deriv
File: Mathlib/Analysis/Calculus/IteratedDeriv.lean

tactic: apply contDiffOn_of_continuousOn_differentiableOn
state_before: 𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type ?u.34703
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
n✝ : ℕ
f : 𝕜 → F
s : Set 𝕜
x : 𝕜
n : ℕ∞
Hcont : ∀ (m : ℕ), ↑m ≤ n → ContinuousOn (fun x => iteratedDerivWithin m f s x) s
Hdiff : ∀ (m : ℕ), ↑m < n → DifferentiableOn 𝕜 (fun x => iteratedDerivWithin m f s x) s
⊢ ContDiffOn 𝕜 n f s

tactic: simpa only [iteratedFDerivWithin_eq_equiv_comp, LinearIsometryEquiv.comp_continuousOn_iff]
state_before: case Hcont
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type ?u.34703
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
n✝ : ℕ
f : 𝕜 → F
s : Set 𝕜
x : 𝕜
n : ℕ∞
Hcont : ∀ (m : ℕ), ↑m ≤ n → ContinuousOn (fun x => iteratedDerivWithin m f s x) s
Hdiff : ∀ (m : ℕ), ↑m < n → DifferentiableOn 𝕜 (fun x => iteratedDerivWithin m f s x) s
⊢ ∀ (m : ℕ), ↑m ≤ n → ContinuousOn (fun x => iteratedFDerivWithin 𝕜 m f s x) s

tactic: simpa only [iteratedFDerivWithin_eq_equiv_comp, LinearIsometryEquiv.comp_differentiableOn_iff]
state_before: case Hdiff
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type ?u.34703
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
n✝ : ℕ
f : 𝕜 → F
s : Set 𝕜
x : 𝕜
n : ℕ∞
Hcont : ∀ (m : ℕ), ↑m ≤ n → ContinuousOn (fun x => iteratedDerivWithin m f s x) s
Hdiff : ∀ (m : ℕ), ↑m < n → DifferentiableOn 𝕜 (fun x => iteratedDerivWithin m f s x) s
⊢ ∀ (m : ℕ), ↑m < n → DifferentiableOn 𝕜 (fun x => iteratedFDerivWithin 𝕜 m f s x) s
Theorem: CategoryTheory.Limits.pushout.mapLift_comp
File: Mathlib/CategoryTheory/Limits/Shapes/Pullbacks.lean

tactic: aesop_cat
state_before: C : Type u
inst✝⁵ : Category C
D : Type u₂
inst✝⁴ : Category D
W X✝ Y✝ Z X Y S T S' : C
f : T ⟶ X
g : T ⟶ Y
i : S ⟶ T
i' : S' ⟶ S
inst✝³ : HasPushout f g
inst✝² : HasPushout (i ≫ f) (i ≫ g)
inst✝¹ : HasPushout (i' ≫ i ≫ f) (i' ≫ i ≫ g)
inst✝ : HasPushout ((i' ≫ i) ≫ f) ((i' ≫ i) ≫ g)
⊢ mapLift f g (i' ≫ i) =
    (congrHom (_ : (i' ≫ i) ≫ f = i' ≫ i ≫ f) (_ : (i' ≫ i) ≫ g = i' ≫ i ≫ g)).hom ≫
      mapLift (i ≫ f) (i ≫ g) i' ≫ mapLift f g i
Theorem: sameRay_neg_swap
File: Mathlib/LinearAlgebra/Ray.lean

tactic: rw [← sameRay_neg_iff, neg_neg]
state_before: R : Type u_1
inst✝⁴ : StrictOrderedCommRing R
M : Type u_2
N : Type ?u.144746
inst✝³ : AddCommGroup M
inst✝² : AddCommGroup N
inst✝¹ : Module R M
inst✝ : Module R N
x y : M
⊢ SameRay R (-x) y ↔ SameRay R x (-y)
Theorem: Ordinal.mem_closed_iff_bsup
File: Mathlib/SetTheory/Ordinal/Topology.lean

tactic: rw [← mem_closure_iff_bsup, hs.closure_eq]
state_before: s : Set Ordinal
a : Ordinal
hs : IsClosed s
⊢ a ∈ s ↔ ∃ o _ho f, (∀ (i : Ordinal) (hi : i < o), f i hi ∈ s) ∧ bsup o f = a
Theorem: Real.volume_le_diam
File: Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean

tactic: by_cases hs : Metric.Bounded s
state_before: ι : Type ?u.374130
inst✝ : Fintype ι
s : Set ℝ
⊢ ↑↑volume s ≤ EMetric.diam s

tactic: rw [Real.ediam_eq hs, ← volume_Icc]
state_before: case pos
ι : Type ?u.374130
inst✝ : Fintype ι
s : Set ℝ
hs : Metric.Bounded s
⊢ ↑↑volume s ≤ EMetric.diam s

tactic: exact volume.mono (Real.subset_Icc_sInf_sSup_of_bounded hs)
state_before: case pos
ι : Type ?u.374130
inst✝ : Fintype ι
s : Set ℝ
hs : Metric.Bounded s
⊢ ↑↑volume s ≤ ↑↑volume (Icc (sInf s) (sSup s))

tactic: rw [Metric.ediam_of_unbounded hs]
state_before: case neg
ι : Type ?u.374130
inst✝ : Fintype ι
s : Set ℝ
hs : ¬Metric.Bounded s
⊢ ↑↑volume s ≤ EMetric.diam s

tactic: exact le_top
state_before: case neg
ι : Type ?u.374130
inst✝ : Fintype ι
s : Set ℝ
hs : ¬Metric.Bounded s
⊢ ↑↑volume s ≤ ⊤
Theorem: IsFreeGroup.unique_lift
File: Mathlib/GroupTheory/IsFreeGroup.lean

tactic: simpa only [Function.funext_iff] using lift.symm.bijective.existsUnique f
state_before: G : Type u_1
inst✝² : Group G
inst✝¹ : IsFreeGroup G
H : Type u_2
inst✝ : Group H
f : Generators G → H
⊢ ∃! F, ∀ (a : Generators G), ↑F (of a) = f a
Theorem: Nat.dist_comm
File: Mathlib/Data/Nat/Dist.lean

tactic: simp [dist.def, add_comm]
state_before: n m : ℕ
⊢ dist n m = dist m n
Theorem: Int.lcm_assoc
File: Mathlib/Data/Int/GCD.lean

tactic: rw [Int.lcm, Int.lcm, Int.lcm, Int.lcm, natAbs_ofNat, natAbs_ofNat]
state_before: i j k : ℤ
⊢ lcm (↑(lcm i j)) k = lcm i ↑(lcm j k)

tactic: apply Nat.lcm_assoc
state_before: i j k : ℤ
⊢ Nat.lcm (Nat.lcm (natAbs i) (natAbs j)) (natAbs k) = Nat.lcm (natAbs i) (Nat.lcm (natAbs j) (natAbs k))
Theorem: Nat.prod_divisors_prime_pow
File: Mathlib/NumberTheory/Divisors.lean

tactic: simp [h, divisors_prime_pow]
state_before: n : ℕ
α : Type u_1
inst✝ : CommMonoid α
k p : ℕ
f : ℕ → α
h : Prime p
⊢ ∏ x in divisors (p ^ k), f x = ∏ x in range (k + 1), f (p ^ x)
Theorem: Set.Ico_bot
File: Mathlib/Data/Set/Intervals/Basic.lean

tactic: simp [← Ici_inter_Iio]
state_before: α : Type u_1
β : Type ?u.57096
inst✝¹ : Preorder α
inst✝ : OrderBot α
a : α
⊢ Ico ⊥ a = Iio a
Theorem: SimpleGraph.Walk.length_append
File: Mathlib/Combinatorics/SimpleGraph/Connectivity.lean

tactic: induction p with
| nil => simp
| cons _ _ ih => simp [ih, add_comm, add_left_comm, add_assoc]
state_before: V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ length (append p q) = length p + length q

tactic: simp
state_before: case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (append nil q) = length nil + length q

tactic: simp [ih, add_comm, add_left_comm, add_assoc]
state_before: case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), length (append p✝ q) = length p✝ + length q
q : Walk G w✝ w
⊢ length (append (cons h✝ p✝) q) = length (cons h✝ p✝) + length q
Theorem: Real.volume_pi_Ioo_toReal
File: Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean

tactic: simp only [volume_pi_Ioo, ENNReal.toReal_prod, ENNReal.toReal_ofReal (sub_nonneg.2 (h _))]
state_before: ι : Type u_1
inst✝ : Fintype ι
a b : ι → ℝ
h : a ≤ b
⊢ ENNReal.toReal (↑↑volume (Set.pi univ fun i => Ioo (a i) (b i))) = ∏ i : ι, (b i - a i)