1337xyz1337xyz/leandojo-benchmark4-v10 huggingface dataset:
Theorem: MeasurableEmbedding.measurable_comp_iff
File: Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean

tactic: refine ⟨fun H => ?_, hg.measurable.comp⟩
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
δ' : Type u_5
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
⊢ Measurable (g ∘ f) ↔ Measurable f
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
δ' : Type u_5
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
⊢ Measurable f

tactic: suffices Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f) by
  rwa [(rightInverse_rangeSplitting hg.injective).comp_eq_id] at this
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
δ' : Type u_5
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
⊢ Measurable f
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
δ' : Type u_5
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
⊢ Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f)

tactic: exact hg.measurable_rangeSplitting.comp H.subtype_mk
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
δ' : Type u_5
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
⊢ Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f)
state_after: no goals

tactic: rwa [(rightInverse_rangeSplitting hg.injective).comp_eq_id] at this
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
δ' : Type u_5
ι : Sort uι
s t u : Set α
mα : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
f : α → β
g : β → γ
hg : MeasurableEmbedding g
H : Measurable (g ∘ f)
this : Measurable ((rangeSplitting g ∘ rangeFactorization g) ∘ f)
⊢ Measurable f
state_after: no goals
Theorem: Nat.descFactorial_one
File: Mathlib/Data/Nat/Factorial/Basic.lean

tactic: simp
state_before: n : ℕ
⊢ n.descFactorial 1 = n
state_after: no goals
Theorem: ne_zero_or_ne_zero_of_nat_coprime
File: Mathlib/RingTheory/Coprime/Lemmas.lean

tactic: simpa only [map_natCast] using IsCoprime.map (Nat.Coprime.isCoprime h) (Int.castRingHom A)
state_before: R : Type u
I : Type v
inst✝² : CommSemiring R
x y z : R
s : I → R
t : Finset I
A : Type u
inst✝¹ : CommRing A
inst✝ : Nontrivial A
a b : ℕ
h : a.Coprime b
⊢ IsCoprime ↑a ↑b
state_after: no goals
Theorem: MeasureTheory.OuterMeasure.trim_le_trim_iff
File: Mathlib/MeasureTheory/OuterMeasure/Induced.lean

tactic: rw [trim_eq _ hs]
state_before: α : Type u_1
inst✝ : MeasurableSpace α
m m₁ m₂ : OuterMeasure α
s : Set α
hs : MeasurableSet s
⊢ m₁.trim s ≤ m₂ s ↔ m₁ s ≤ m₂ s
state_after: no goals
Theorem: String.map_eq
File: .lake/packages/batteries/Batteries/Data/String/Lemmas.lean

tactic: simpa using mapAux_of_valid f [] s.1
state_before: f : Char → Char
s : String
⊢ map f s = { data := List.map f s.data }
state_after: no goals
Theorem: cthickening_thickening
File: Mathlib/Analysis/NormedSpace/Pointwise.lean

tactic: simp_rw [mem_cthickening_iff, ENNReal.ofReal_add hε hδ.le, infEdist_thickening hδ]
state_before: 𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace ℝ E
x✝ y z : E
δ ε : ℝ
hε : 0 ≤ ε
hδ : 0 < δ
s : Set E
x : E
⊢ x ∈ cthickening (ε + δ) s → x ∈ cthickening ε (thickening δ s)
state_after: 𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace ℝ E
x✝ y z : E
δ ε : ℝ
hε : 0 ≤ ε
hδ : 0 < δ
s : Set E
x : E
⊢ infEdist x s ≤ ENNReal.ofReal ε + ENNReal.ofReal δ → infEdist x s - ENNReal.ofReal δ ≤ ENNReal.ofReal ε

tactic: exact tsub_le_iff_right.2
state_before: 𝕜 : Type u_1
E : Type u_2
inst✝³ : NormedField 𝕜
inst✝² : SeminormedAddCommGroup E
inst✝¹ : NormedSpace 𝕜 E
inst✝ : NormedSpace ℝ E
x✝ y z : E
δ ε : ℝ
hε : 0 ≤ ε
hδ : 0 < δ
s : Set E
x : E
⊢ infEdist x s ≤ ENNReal.ofReal ε + ENNReal.ofReal δ → infEdist x s - ENNReal.ofReal δ ≤ ENNReal.ofReal ε
state_after: no goals
Theorem: Matrix.bit1_apply_eq
File: Mathlib/Data/Matrix/Basic.lean

tactic: simp [bit1_apply]
state_before: l : Type u_1
m : Type u_2
n : Type u_3
o : Type u_4
m' : o → Type u_5
n' : o → Type u_6
R : Type u_7
S : Type u_8
α : Type v
β : Type w
γ : Type u_9
inst✝² : DecidableEq n
inst✝¹ : AddZeroClass α
inst✝ : One α
M : Matrix n n α
i : n
⊢ bit1 M i i = bit1 (M i i)
state_after: no goals
Theorem: Antivary.card_smul_sum_le_sum_smul_sum
File: Mathlib/Algebra/Order/Chebyshev.lean

tactic: exact (hfg.dual_right.monovaryOn _).sum_smul_sum_le_card_smul_sum
state_before: ι : Type u_1
α : Type u_2
β : Type u_3
inst✝⁴ : LinearOrderedRing α
inst✝³ : LinearOrderedAddCommGroup β
inst✝² : Module α β
inst✝¹ : OrderedSMul α β
s : Finset ι
σ : Perm ι
f : ι → α
g : ι → β
inst✝ : Fintype ι
hfg : Antivary f g
⊢ Fintype.card ι • ∑ i : ι, f i • g i ≤ (∑ i : ι, f i) • ∑ i : ι, g i
state_after: no goals
Theorem: UniqueFactorizationMonoid.normalizedFactors_of_irreducible_pow
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: rw [normalizedFactors_pow, normalizedFactors_irreducible hp, Multiset.nsmul_singleton]
state_before: α : Type u_1
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : NormalizationMonoid α
inst✝ : UniqueFactorizationMonoid α
p : α
hp : Irreducible p
k : ℕ
⊢ normalizedFactors (p ^ k) = Multiset.replicate k (normalize p)
state_after: no goals
Theorem: Bitraversable.comp_tfst
File: Mathlib/Control/Bitraversable/Lemmas.lean

tactic: rw [← comp_bitraverse]
state_before: t : Type u → Type u → Type u
inst✝⁵ : Bitraversable t
β✝ : Type u
F G : Type u → Type u
inst✝⁴ : Applicative F
inst✝³ : Applicative G
inst✝² : LawfulBitraversable t
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α₀ α₁ α₂ β : Type u
f : α₀ → F α₁
f' : α₁ → G α₂
x : t α₀ β
⊢ Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk ∘ map f' ∘ f) x
state_after: t : Type u → Type u → Type u
inst✝⁵ : Bitraversable t
β✝ : Type u
F G : Type u → Type u
inst✝⁴ : Applicative F
inst✝³ : Applicative G
inst✝² : LawfulBitraversable t
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α₀ α₁ α₂ β : Type u
f : α₀ → F α₁
f' : α₁ → G α₂
x : t α₀ β
⊢ bitraverse (Comp.mk ∘ map f' ∘ f) (Comp.mk ∘ map pure ∘ pure) x = tfst (Comp.mk ∘ map f' ∘ f) x

tactic: simp only [Function.comp, tfst, map_pure, Pure.pure]
state_before: t : Type u → Type u → Type u
inst✝⁵ : Bitraversable t
β✝ : Type u
F G : Type u → Type u
inst✝⁴ : Applicative F
inst✝³ : Applicative G
inst✝² : LawfulBitraversable t
inst✝¹ : LawfulApplicative F
inst✝ : LawfulApplicative G
α₀ α₁ α₂ β : Type u
f : α₀ → F α₁
f' : α₁ → G α₂
x : t α₀ β
⊢ bitraverse (Comp.mk ∘ map f' ∘ f) (Comp.mk ∘ map pure ∘ pure) x = tfst (Comp.mk ∘ map f' ∘ f) x
state_after: no goals
Theorem: Nat.coprime_of_mul_modEq_one
File: Mathlib/Data/Nat/ModEq.lean

tactic: obtain ⟨g, hh⟩ := Nat.gcd_dvd_right a n
state_before: m n✝ a✝ b✝ c d b a n : ℕ
h : a * b ≡ 1 [MOD n]
⊢ a.Coprime n
state_after: case intro
m n✝ a✝ b✝ c d b a n : ℕ
h : a * b ≡ 1 [MOD n]
g : ℕ
hh : n = a.gcd n * g
⊢ a.Coprime n

tactic: rw [Nat.coprime_iff_gcd_eq_one, ← Nat.dvd_one, ← Nat.modEq_zero_iff_dvd]
state_before: case intro
m n✝ a✝ b✝ c d b a n : ℕ
h : a * b ≡ 1 [MOD n]
g : ℕ
hh : n = a.gcd n * g
⊢ a.Coprime n
state_after: case intro
m n✝ a✝ b✝ c d b a n : ℕ
h : a * b ≡ 1 [MOD n]
g : ℕ
hh : n = a.gcd n * g
⊢ 1 ≡ 0 [MOD a.gcd n]

tactic: calc
  1 ≡ a * b [MOD a.gcd n] := (hh ▸ h).symm.of_mul_right g
  _ ≡ 0 * b [MOD a.gcd n] := (Nat.modEq_zero_iff_dvd.mpr (Nat.gcd_dvd_left _ _)).mul_right b
  _ = 0 := by rw [zero_mul]
state_before: case intro
m n✝ a✝ b✝ c d b a n : ℕ
h : a * b ≡ 1 [MOD n]
g : ℕ
hh : n = a.gcd n * g
⊢ 1 ≡ 0 [MOD a.gcd n]
state_after: no goals

tactic: rw [zero_mul]
state_before: m n✝ a✝ b✝ c d b a n : ℕ
h : a * b ≡ 1 [MOD n]
g : ℕ
hh : n = a.gcd n * g
⊢ 0 * b = 0
state_after: no goals
Theorem: Finset.image₂_distrib_subset_left
File: Mathlib/Data/Finset/NAry.lean

tactic: push_cast
state_before: α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ✝ : Type u_5
γ' : Type u_6
δ : Type u_7
δ' : Type u_8
ε : Type u_9
ε' : Type u_10
ζ : Type u_11
ζ' : Type u_12
ν : Type u_13
inst✝⁷ : DecidableEq α'
inst✝⁶ : DecidableEq β'
inst✝⁵ : DecidableEq γ✝
inst✝⁴ : DecidableEq γ'
inst✝³ : DecidableEq δ
inst✝² : DecidableEq δ'
inst✝¹ : DecidableEq ε
inst✝ : DecidableEq ε'
f✝ f' : α → β → γ✝
g✝ g'✝ : α → β → γ✝ → δ
s s' : Finset α
t t' : Finset β
u✝ u' : Finset γ✝
a a' : α
b b' : β
c : γ✝
γ : Type u_14
u : Finset γ
f : α → δ → ε
g : β → γ → δ
f₁ : α → β → β'
f₂ : α → γ → γ'
g' : β' → γ' → ε
h_distrib : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' (f₁ a b) (f₂ a c)
⊢ ↑(image₂ f s (image₂ g t u)) ⊆ ↑(image₂ g' (image₂ f₁ s t) (image₂ f₂ s u))
state_after: α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ✝ : Type u_5
γ' : Type u_6
δ : Type u_7
δ' : Type u_8
ε : Type u_9
ε' : Type u_10
ζ : Type u_11
ζ' : Type u_12
ν : Type u_13
inst✝⁷ : DecidableEq α'
inst✝⁶ : DecidableEq β'
inst✝⁵ : DecidableEq γ✝
inst✝⁴ : DecidableEq γ'
inst✝³ : DecidableEq δ
inst✝² : DecidableEq δ'
inst✝¹ : DecidableEq ε
inst✝ : DecidableEq ε'
f✝ f' : α → β → γ✝
g✝ g'✝ : α → β → γ✝ → δ
s s' : Finset α
t t' : Finset β
u✝ u' : Finset γ✝
a a' : α
b b' : β
c : γ✝
γ : Type u_14
u : Finset γ
f : α → δ → ε
g : β → γ → δ
f₁ : α → β → β'
f₂ : α → γ → γ'
g' : β' → γ' → ε
h_distrib : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' (f₁ a b) (f₂ a c)
⊢ image2 f (↑s) (image2 g ↑t ↑u) ⊆ image2 g' (image2 f₁ ↑s ↑t) (image2 f₂ ↑s ↑u)

tactic: exact Set.image2_distrib_subset_left h_distrib
state_before: α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ✝ : Type u_5
γ' : Type u_6
δ : Type u_7
δ' : Type u_8
ε : Type u_9
ε' : Type u_10
ζ : Type u_11
ζ' : Type u_12
ν : Type u_13
inst✝⁷ : DecidableEq α'
inst✝⁶ : DecidableEq β'
inst✝⁵ : DecidableEq γ✝
inst✝⁴ : DecidableEq γ'
inst✝³ : DecidableEq δ
inst✝² : DecidableEq δ'
inst✝¹ : DecidableEq ε
inst✝ : DecidableEq ε'
f✝ f' : α → β → γ✝
g✝ g'✝ : α → β → γ✝ → δ
s s' : Finset α
t t' : Finset β
u✝ u' : Finset γ✝
a a' : α
b b' : β
c : γ✝
γ : Type u_14
u : Finset γ
f : α → δ → ε
g : β → γ → δ
f₁ : α → β → β'
f₂ : α → γ → γ'
g' : β' → γ' → ε
h_distrib : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' (f₁ a b) (f₂ a c)
⊢ image2 f (↑s) (image2 g ↑t ↑u) ⊆ image2 g' (image2 f₁ ↑s ↑t) (image2 f₂ ↑s ↑u)
state_after: no goals
Theorem: Module.card_fintype
File: Mathlib/LinearAlgebra/Basis.lean

tactic: classical
  calc
    card M = card (ι → R) := card_congr b.equivFun.toEquiv
    _ = card R ^ card ι := card_fun
state_before: ι : Type u_1
ι' : Type u_2
R : Type u_3
R₂ : Type u_4
K : Type u_5
M : Type u_6
M' : Type u_7
M'' : Type u_8
V : Type u
V' : Type u_9
inst✝⁷ : Semiring R
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : AddCommMonoid M'
inst✝³ : Module R M'
inst✝² : Fintype ι
b : Basis ι R M
inst✝¹ : Fintype R
inst✝ : Fintype M
⊢ card M = card R ^ card ι
state_after: no goals

tactic: calc
  card M = card (ι → R) := card_congr b.equivFun.toEquiv
  _ = card R ^ card ι := card_fun
state_before: ι : Type u_1
ι' : Type u_2
R : Type u_3
R₂ : Type u_4
K : Type u_5
M : Type u_6
M' : Type u_7
M'' : Type u_8
V : Type u
V' : Type u_9
inst✝⁷ : Semiring R
inst✝⁶ : AddCommMonoid M
inst✝⁵ : Module R M
inst✝⁴ : AddCommMonoid M'
inst✝³ : Module R M'
inst✝² : Fintype ι
b : Basis ι R M
inst✝¹ : Fintype R
inst✝ : Fintype M
⊢ card M = card R ^ card ι
state_after: no goals
Theorem: Set.mem_pow
File: Mathlib/Data/Set/Pointwise/ListOfFn.lean

tactic: rw [← mem_prod_list_ofFn, List.ofFn_const, List.prod_replicate]
state_before: F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : Monoid α
s t : Set α
a✝ : α
m n✝ : ℕ
a : α
n : ℕ
⊢ a ∈ s ^ n ↔ ∃ f, (List.ofFn fun i => ↑(f i)).prod = a
state_after: no goals
Theorem: Complex.IsExpCmpFilter.of_boundedUnder_abs_im
File: Mathlib/Analysis/SpecialFunctions/CompareExp.lean

tactic: simpa only [pow_zero] using him.isBigO_const (f := im) one_ne_zero
state_before: l : Filter ℂ
hre : Tendsto re l atTop
him : IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun z => |z.im|
⊢ im =O[l] fun z => z.re ^ 0
state_after: no goals
Theorem: List.getI_eq_iget_get?
File: Mathlib/Data/List/GetD.lean

tactic: rw [← getD_default_eq_getI, getD_eq_getD_get?, Option.getD_default_eq_iget]
state_before: α : Type u
β : Type v
l : List α
x : α
xs : List α
n✝ : ℕ
inst✝ : Inhabited α
n : ℕ
⊢ l.getI n = (l.get? n).iget
state_after: no goals
Theorem: Finset.nonempty_Ioc
File: Mathlib/Order/Interval/Finset/Basic.lean

tactic: rw [← coe_nonempty, coe_Ioc, Set.nonempty_Ioc]
state_before: ι : Type u_1
α : Type u_2
inst✝¹ : Preorder α
inst✝ : LocallyFiniteOrder α
a a₁ a₂ b b₁ b₂ c x : α
⊢ (Ioc a b).Nonempty ↔ a < b
state_after: no goals
Theorem: ContinuousLinearMap.opNorm_flip
File: Mathlib/Analysis/NormedSpace/OperatorNorm/Bilinear.lean

tactic: simpa only [flip_flip] using le_norm_flip f.flip
state_before: 𝕜 : Type u_1
𝕜₂ : Type u_2
𝕜₃ : Type u_3
E : Type u_4
Eₗ : Type u_5
F : Type u_6
Fₗ : Type u_7
G : Type u_8
Gₗ : Type u_9
𝓕 : Type u_10
inst✝¹⁸ : SeminormedAddCommGroup E
inst✝¹⁷ : SeminormedAddCommGroup Eₗ
inst✝¹⁶ : SeminormedAddCommGroup F
inst✝¹⁵ : SeminormedAddCommGroup Fₗ
inst✝¹⁴ : SeminormedAddCommGroup G
inst✝¹³ : SeminormedAddCommGroup Gₗ
inst✝¹² : NontriviallyNormedField 𝕜
inst✝¹¹ : NontriviallyNormedField 𝕜₂
inst✝¹⁰ : NontriviallyNormedField 𝕜₃
inst✝⁹ : NormedSpace 𝕜 E
inst✝⁸ : NormedSpace 𝕜 Eₗ
inst✝⁷ : NormedSpace 𝕜₂ F
inst✝⁶ : NormedSpace 𝕜 Fₗ
inst✝⁵ : NormedSpace 𝕜₃ G
inst✝⁴ : NormedSpace 𝕜 Gₗ
σ₁₂ : 𝕜 →+* 𝕜₂
σ₂₃ : 𝕜₂ →+* 𝕜₃
σ₁₃ : 𝕜 →+* 𝕜₃
inst✝³ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝² : FunLike 𝓕 E F
inst✝¹ : RingHomIsometric σ₂₃
inst✝ : RingHomIsometric σ₁₃
f : E →SL[σ₁₃] F →SL[σ₂₃] G
⊢ ‖f.flip‖ ≤ ‖f‖
state_after: no goals
Theorem: NNReal.rpow_natCast
File: Mathlib/Analysis/SpecialFunctions/Pow/NNReal.lean

tactic: simpa only [coe_rpow, coe_pow] using Real.rpow_natCast x n
state_before: w x✝ y z : ℝ
x : ℝ≥0
n : ℕ
⊢ ↑(x ^ ↑n) = ↑(x ^ n)
state_after: no goals
Theorem: SimpleGraph.deleteEdges_eq_inter_edgeSet
File: Mathlib/Combinatorics/SimpleGraph/Basic.lean

tactic: ext
state_before: ι : Sort u_1
V : Type u
G : SimpleGraph V
a b c u v w : V
e : Sym2 V
H : SimpleGraph V
s✝ s₁ s₂ s : Set (Sym2 V)
⊢ G.deleteEdges s = G.deleteEdges (s ∩ G.edgeSet)
state_after: case Adj.h.h.a
ι : Sort u_1
V : Type u
G : SimpleGraph V
a b c u v w : V
e : Sym2 V
H : SimpleGraph V
s✝ s₁ s₂ s : Set (Sym2 V)
x✝¹ x✝ : V
⊢ (G.deleteEdges s).Adj x✝¹ x✝ ↔ (G.deleteEdges (s ∩ G.edgeSet)).Adj x✝¹ x✝

tactic: simp (config := { contextual := true }) [imp_false]
state_before: case Adj.h.h.a
ι : Sort u_1
V : Type u
G : SimpleGraph V
a b c u v w : V
e : Sym2 V
H : SimpleGraph V
s✝ s₁ s₂ s : Set (Sym2 V)
x✝¹ x✝ : V
⊢ (G.deleteEdges s).Adj x✝¹ x✝ ↔ (G.deleteEdges (s ∩ G.edgeSet)).Adj x✝¹ x✝
state_after: no goals
Theorem: εNFA.mem_stepSet_iff
File: Mathlib/Computability/EpsilonNFA.lean

tactic: simp_rw [stepSet, mem_iUnion₂, exists_prop]
state_before: α : Type u
σ σ' : Type v
M : εNFA α σ
S : Set σ
x : List α
s : σ
a : α
⊢ s ∈ M.stepSet S a ↔ ∃ t ∈ S, s ∈ M.εClosure (M.step t (some a))
state_after: no goals
Theorem: Zsqrtd.exists_coprime_of_gcd_pos
File: Mathlib/NumberTheory/Zsqrtd/Basic.lean

tactic: obtain ⟨re, im, H1, Hre, Him⟩ := Int.exists_gcd_one hgcd
state_before: d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
⊢ ∃ b, a = ↑↑(a.re.gcd a.im) * b ∧ IsCoprime b.re b.im
state_after: case intro.intro.intro.intro
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = re * ↑(a.re.gcd a.im)
Him : a.im = im * ↑(a.re.gcd a.im)
⊢ ∃ b, a = ↑↑(a.re.gcd a.im) * b ∧ IsCoprime b.re b.im

tactic: rw [mul_comm] at Hre Him
state_before: case intro.intro.intro.intro
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = re * ↑(a.re.gcd a.im)
Him : a.im = im * ↑(a.re.gcd a.im)
⊢ ∃ b, a = ↑↑(a.re.gcd a.im) * b ∧ IsCoprime b.re b.im
state_after: case intro.intro.intro.intro
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = ↑(a.re.gcd a.im) * re
Him : a.im = ↑(a.re.gcd a.im) * im
⊢ ∃ b, a = ↑↑(a.re.gcd a.im) * b ∧ IsCoprime b.re b.im

tactic: refine ⟨⟨re, im⟩, ?_, ?_⟩
state_before: case intro.intro.intro.intro
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = ↑(a.re.gcd a.im) * re
Him : a.im = ↑(a.re.gcd a.im) * im
⊢ ∃ b, a = ↑↑(a.re.gcd a.im) * b ∧ IsCoprime b.re b.im
state_after: case intro.intro.intro.intro.refine_1
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = ↑(a.re.gcd a.im) * re
Him : a.im = ↑(a.re.gcd a.im) * im
⊢ a = ↑↑(a.re.gcd a.im) * { re := re, im := im }

case intro.intro.intro.intro.refine_2
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = ↑(a.re.gcd a.im) * re
Him : a.im = ↑(a.re.gcd a.im) * im
⊢ IsCoprime { re := re, im := im }.re { re := re, im := im }.im

tactic: rw [smul_val, ← Hre, ← Him]
state_before: case intro.intro.intro.intro.refine_1
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = ↑(a.re.gcd a.im) * re
Him : a.im = ↑(a.re.gcd a.im) * im
⊢ a = ↑↑(a.re.gcd a.im) * { re := re, im := im }
state_after: no goals

tactic: rw [← Int.gcd_eq_one_iff_coprime, H1]
state_before: case intro.intro.intro.intro.refine_2
d : ℤ
a : ℤ√d
hgcd : 0 < a.re.gcd a.im
re im : ℤ
H1 : re.gcd im = 1
Hre : a.re = ↑(a.re.gcd a.im) * re
Him : a.im = ↑(a.re.gcd a.im) * im
⊢ IsCoprime { re := re, im := im }.re { re := re, im := im }.im
state_after: no goals
Theorem: CategoryTheory.typesGrothendieckTopology_eq_canonical
File: Mathlib/CategoryTheory/Sites/Types.lean

tactic: refine le_antisymm subcanonical_typesGrothendieckTopology (sInf_le ?_)
state_before: ⊢ typesGrothendieckTopology = Sheaf.canonicalTopology (Type u)
state_after: ⊢ typesGrothendieckTopology ∈ Sheaf.finestTopologySingle '' Set.range yoneda.obj

tactic: refine ⟨yoneda.obj (ULift Bool), ⟨_, rfl⟩, GrothendieckTopology.ext ?_⟩
state_before: ⊢ typesGrothendieckTopology ∈ Sheaf.finestTopologySingle '' Set.range yoneda.obj
state_after: ⊢ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves = typesGrothendieckTopology.sieves

tactic: funext α
state_before: ⊢ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves = typesGrothendieckTopology.sieves
state_after: case h
α : Type u
⊢ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α = typesGrothendieckTopology.sieves α

tactic: ext S
state_before: case h
α : Type u
⊢ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α = typesGrothendieckTopology.sieves α
state_after: case h.h
α : Type u
S : Sieve α
⊢ S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α ↔ S ∈ typesGrothendieckTopology.sieves α

tactic: refine ⟨fun hs x => ?_, fun hs β f => isSheaf_yoneda' _ fun y => hs _⟩
state_before: case h.h
α : Type u
S : Sieve α
⊢ S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α ↔ S ∈ typesGrothendieckTopology.sieves α
state_after: case h.h
α : Type u
S : Sieve α
hs : S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α
x : α
⊢ S.arrows fun x_1 => x

tactic: by_contra hsx
state_before: case h.h
α : Type u
S : Sieve α
hs : S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α
x : α
⊢ S.arrows fun x_1 => x
state_after: case h.h
α : Type u
S : Sieve α
hs : S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α
x : α
hsx : ¬S.arrows fun x_1 => x
⊢ False

tactic: have : (fun _ => ULift.up true) = fun _ => ULift.up false :=
  (hs PUnit fun _ => x).isSeparatedFor.ext
    fun β f hf => funext fun y => hsx.elim <| S.2 hf fun _ => y
state_before: case h.h
α : Type u
S : Sieve α
hs : S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α
x : α
hsx : ¬S.arrows fun x_1 => x
⊢ False
state_after: case h.h
α : Type u
S : Sieve α
hs : S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α
x : α
hsx : ¬S.arrows fun x_1 => x
this : (fun x => { down := true }) = fun x => { down := false }
⊢ False

tactic: simp [Function.funext_iff] at this
state_before: case h.h
α : Type u
S : Sieve α
hs : S ∈ (Sheaf.finestTopologySingle (yoneda.obj (ULift.{u, 0} Bool))).sieves α
x : α
hsx : ¬S.arrows fun x_1 => x
this : (fun x => { down := true }) = fun x => { down := false }
⊢ False
state_after: no goals
Theorem: padicNorm.mul
File: Mathlib/NumberTheory/Padics/PadicNorm.lean

tactic: simp [hq]
state_before: p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q = 0
⊢ padicNorm p (q * r) = padicNorm p q * padicNorm p r
state_after: no goals

tactic: simp [hr]
state_before: p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : ¬q = 0
hr : r = 0
⊢ padicNorm p (q * r) = padicNorm p q * padicNorm p r
state_after: no goals

tactic: have : (p : ℚ) ≠ 0 := by simp [hp.1.ne_zero]
state_before: p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : ¬q = 0
hr : ¬r = 0
⊢ padicNorm p (q * r) = padicNorm p q * padicNorm p r
state_after: p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : ¬q = 0
hr : ¬r = 0
this : ↑p ≠ 0
⊢ padicNorm p (q * r) = padicNorm p q * padicNorm p r

tactic: simp [padicNorm, *, padicValRat.mul, zpow_add₀ this, mul_comm]
state_before: p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : ¬q = 0
hr : ¬r = 0
this : ↑p ≠ 0
⊢ padicNorm p (q * r) = padicNorm p q * padicNorm p r
state_after: no goals

tactic: simp [hp.1.ne_zero]
state_before: p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : ¬q = 0
hr : ¬r = 0
⊢ ↑p ≠ 0
state_after: no goals