mathlib-initiative/mathlib-tactics huggingface dataset:
Module: Mathlib.Computability.AkraBazzi.AkraBazzi

Goal state before:
pp: case n_gt_one
α : Type u_1
inst✝¹ : Fintype α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
inst✝ : Nonempty α
R : AkraBazziRecurrence T g a b r
i : α
q : ℝ → ℝ := fun x ↦ x ^ p a b * (1 + ε x)
h_diff_q : DifferentiableOn ℝ q (Set.Ioi 1)
h_deriv_q : deriv q =O[atTop] fun x ↦ x ^ (p a b - 1)
h_main_norm : (fun n ↦ ‖q ↑(r i n) - q (b i * ↑n)‖) ≤ᶠ[atTop] fun n ↦ ‖b i ^ p a b * ↑n ^ p a b * (ε (b i * ↑n) - ε ↑n)‖
n : ℕ
hn : ⌈(b i)⁻¹⌉₊ < n
hn' : 1 < n
h₁ : 0 < b i
⊢ ↑n ∈ Set.Ioi 1

pp: case bn_gt_one
α : Type u_1
inst✝¹ : Fintype α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
inst✝ : Nonempty α
R : AkraBazziRecurrence T g a b r
i : α
q : ℝ → ℝ := fun x ↦ x ^ p a b * (1 + ε x)
h_diff_q : DifferentiableOn ℝ q (Set.Ioi 1)
h_deriv_q : deriv q =O[atTop] fun x ↦ x ^ (p a b - 1)
h_main_norm : (fun n ↦ ‖q ↑(r i n) - q (b i * ↑n)‖) ≤ᶠ[atTop] fun n ↦ ‖b i ^ p a b * ↑n ^ p a b * (ε (b i * ↑n) - ε ↑n)‖
n : ℕ
hn : ⌈(b i)⁻¹⌉₊ < n
hn' : 1 < n
h₁ : 0 < b i
⊢ b i * ↑n ∈ Set.Ioi 1

pp: case le
α : Type u_1
inst✝¹ : Fintype α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
inst✝ : Nonempty α
R : AkraBazziRecurrence T g a b r
i : α
q : ℝ → ℝ := fun x ↦ x ^ p a b * (1 + ε x)
h_diff_q : DifferentiableOn ℝ q (Set.Ioi 1)
h_deriv_q : deriv q =O[atTop] fun x ↦ x ^ (p a b - 1)
h_main_norm : (fun n ↦ ‖q ↑(r i n) - q (b i * ↑n)‖) ≤ᶠ[atTop] fun n ↦ ‖b i ^ p a b * ↑n ^ p a b * (ε (b i * ↑n) - ε ↑n)‖
n : ℕ
hn : ⌈(b i)⁻¹⌉₊ < n
hn' : 1 < n
h₁ : 0 < b i
⊢ b i * ↑n ≤ ↑n

Tactic:
case n_gt_one =>
            change 1 < (n : ℝ)
            rw [Nat.one_lt_cast]
            exact hn'

Goal state after:
case bn_gt_one
α : Type u_1
inst✝¹ : Fintype α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
inst✝ : Nonempty α
R : AkraBazziRecurrence T g a b r
i : α
q : ℝ → ℝ := fun x ↦ x ^ p a b * (1 + ε x)
h_diff_q : DifferentiableOn ℝ q (Set.Ioi 1)
h_deriv_q : deriv q =O[atTop] fun x ↦ x ^ (p a b - 1)
h_main_norm : (fun n ↦ ‖q ↑(r i n) - q (b i * ↑n)‖) ≤ᶠ[atTop] fun n ↦ ‖b i ^ p a b * ↑n ^ p a b * (ε (b i * ↑n) - ε ↑n)‖
n : ℕ
hn : ⌈(b i)⁻¹⌉₊ < n
hn' : 1 < n
h₁ : 0 < b i
⊢ b i * ↑n ∈ Set.Ioi 1

case le
α : Type u_1
inst✝¹ : Fintype α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
inst✝ : Nonempty α
R : AkraBazziRecurrence T g a b r
i : α
q : ℝ → ℝ := fun x ↦ x ^ p a b * (1 + ε x)
h_diff_q : DifferentiableOn ℝ q (Set.Ioi 1)
h_deriv_q : deriv q =O[atTop] fun x ↦ x ^ (p a b - 1)
h_main_norm : (fun n ↦ ‖q ↑(r i n) - q (b i * ↑n)‖) ≤ᶠ[atTop] fun n ↦ ‖b i ^ p a b * ↑n ^ p a b * (ε (b i * ↑n) - ε ↑n)‖
n : ℕ
hn : ⌈(b i)⁻¹⌉₊ < n
hn' : 1 < n
h₁ : 0 < b i
⊢ b i * ↑n ≤ ↑n
Module: Mathlib.Computability.AkraBazzi.GrowsPolynomially

Goal state before:
pp: f g : ℝ → ℝ
hf✝¹ : GrowsPolynomially f
hg✝¹ : GrowsPolynomially g
hf'✝ : 0 ≤ᶠ[atTop] f
hg'✝ : 0 ≤ᶠ[atTop] g
b : ℝ
hb : b ∈ Set.Ioo 0 1
c₁ : ℝ
hc₁_mem : c₁ > 0
c₂ : ℝ
hc₂_mem : c₂ > 0
hf✝ : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
c₃ : ℝ
hc₃_mem : c₃ > 0
c₄ : ℝ
left✝ : c₄ > 0
hg✝ : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, g u ∈ Set.Icc (c₃ * g x) (c₄ * g x)
x : ℝ
hf : ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
hg : ∀ u ∈ Set.Icc (b * x) x, g u ∈ Set.Icc (c₃ * g x) (c₄ * g x)
hf' : ∀ (y : ℝ), b * id x ≤ y → 0 y ≤ f y
hg' : ∀ (y : ℝ), b * id x ≤ y → 0 y ≤ g y
hx_pos : 0 ≤ x
u : ℝ
hu : u ∈ Set.Icc (b * x) x
hbx : b * x ≤ x
fx_nonneg : 0 ≤ f x
gx_nonneg : 0 ≤ g x
⊢ min c₁ c₃ * (f x + g x) = min c₁ c₃ * f x + min c₁ c₃ * g x

Tactic:
simp only [mul_add]

Goal state after:
Module: Mathlib.Computability.PartrecCode

Goal state before:
pp: case refine_1.zero
f : ℕ →. ℕ
⊢ ∃ c, c.eval = pure 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.AkraBazzi.GrowsPolynomially

Goal state before:
pp: f g : ℝ → ℝ
hf✝¹ : GrowsPolynomially f
hg✝¹ : GrowsPolynomially g
hf'✝ : 0 ≤ᶠ[atTop] f
hg'✝ : 0 ≤ᶠ[atTop] g
b : ℝ
hb : b ∈ Set.Ioo 0 1
c₁ : ℝ
hc₁_mem : c₁ > 0
c₂ : ℝ
hc₂_mem : c₂ > 0
hf✝ : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
c₃ : ℝ
hc₃_mem : c₃ > 0
c₄ : ℝ
left✝ : c₄ > 0
hg✝ : ∀ᶠ (x : ℝ) in atTop, ∀ u ∈ Set.Icc (b * x) x, g u ∈ Set.Icc (c₃ * g x) (c₄ * g x)
x : ℝ
hf : ∀ u ∈ Set.Icc (b * x) x, f u ∈ Set.Icc (c₁ * f x) (c₂ * f x)
hg : ∀ u ∈ Set.Icc (b * x) x, g u ∈ Set.Icc (c₃ * g x) (c₄ * g x)
hf' : ∀ (y : ℝ), b * id x ≤ y → 0 y ≤ f y
hg' : ∀ (y : ℝ), b * id x ≤ y → 0 y ≤ g y
hx_pos : 0 ≤ x
u : ℝ
hu : u ∈ Set.Icc (b * x) x
hbx : b * x ≤ x
fx_nonneg : 0 ≤ f x
gx_nonneg : 0 ≤ g x
⊢ max c₂ c₄ * (f x + g x) = max c₂ c₄ * f x + max c₂ c₄ * g x

Tactic:
simp only [mul_add]

Goal state after:
Module: Mathlib.Computability.PartrecCode

Goal state before:
pp: case refine_2.zero
⊢ Nat.Partrec zero.eval

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.PartrecCode

Goal state before:
pp: case zero
k : ℕ
cf cg : Code
hf : ∀ (n x : ℕ), x ∈ evaln (k + 1) cf n → x ∈ cf.eval n
hg : ∀ (n x : ℕ), x ∈ evaln (k + 1) cg n → x ∈ cg.eval n
n : ℕ
left✝ : n ≤ k
x : ℕ
⊢ evaln (k + 1) cf (unpair n).1 = some x → x ∈ cf.eval (unpair n).1

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.PartrecCode

Goal state before:
pp: case prec.zero
cf cg : Code
hf : ∀ {n x : ℕ}, x ∈ cf.eval n → ∃ k, x ∈ evaln (k + 1) cf n
hg : ∀ {n x : ℕ}, x ∈ cg.eval n → ∃ k, x ∈ evaln (k + 1) cg n
n₁ n x : ℕ
⊢ x ∈ cf.eval n₁ → ∃ k, n ≤ k ∧ evaln (k + 1) cf n₁ = some x

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.PartrecCode

Goal state before:
pp: case rfind'.zero
cf : Code
hf : ∀ {n x : ℕ}, x ∈ cf.eval n → ∃ k, x ∈ evaln (k + 1) cf n
n m : ℕ
hy₁ : 0 ∈ cf.eval (Nat.pair (unpair n).1 (0 + m))
hy₂ : ∀ {m_1 : ℕ}, m_1 < 0 → ∃ a ∈ cf.eval (Nat.pair (unpair n).1 (m_1 + m)), ¬a = 0
⊢ ∃ k,
    Nat.pair (unpair n).1 m ≤ k ∧
      ∃ a,
        evaln (k + 1) cf (Nat.pair (unpair n).1 m) = some a ∧
          (¬a = 0 → evaln k cf.rfind' (Nat.pair (unpair n).1 (m + 1)) = some m)

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.Language

Goal state before:
pp: case zero
α : Type u_1
l : Language α
x : List α
⊢ x ∈ l ^ 0 ↔ ∃ S, x = S.flatten ∧ S.length = 0 ∧ ∀ y ∈ S, y ∈ l

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.Language

Goal state before:
pp: case zero
α : Type u_1
β : Type u_2
γ : Type u_3
l✝ m✝ : Language α
a b x : List α
l m : Language α
h : m * l ≤ m
⊢ m * l ^ 0 ≤ m

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.Language

Goal state before:
pp: case zero
α : Type u_1
β : Type u_2
γ : Type u_3
l✝ m✝ : Language α
a b x : List α
l m : Language α
h : l * m ≤ m
⊢ l ^ 0 * m ≤ m

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.Language

Goal state before:
pp: case a.zero
α : Type u_1
l m n : Language α
hm : [] ∉ m
h : l = m * l + n
⊢ m ^ 0 * n ≤ m * l + n

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.ContextFreeGrammar

Goal state before:
pp: T : Type u_1
N : Type u_2
r : ContextFreeRule T N
u v p x y : List (Symbol T N)
hxy : u = x ++ [Symbol.nonterminal r.input] ++ y ∧ v = x ++ r.output ++ y
⊢ ∃ p_1 q, p ++ u = p_1 ++ [Symbol.nonterminal r.input] ++ q ∧ p ++ v = p_1 ++ r.output ++ q

Tactic:
use p ++ x, y

Goal state after:
case h
T : Type u_1
N : Type u_2
r : ContextFreeRule T N
u v p x y : List (Symbol T N)
hxy : u = x ++ [Symbol.nonterminal r.input] ++ y ∧ v = x ++ r.output ++ y
⊢ p ++ u = p ++ x ++ [Symbol.nonterminal r.input] ++ y ∧ p ++ v = p ++ x ++ r.output ++ y
Module: Mathlib.Computability.ContextFreeGrammar

Goal state before:
pp: T : Type u_1
N : Type u_2
r : ContextFreeRule T N
u v : List (Symbol T N)
⊢ r.reverse.Rewrites u v ↔ r.Rewrites u.reverse v.reverse

Tactic:
rw [← rewrites_reverse, reverse_reverse]

Goal state after:
Module: Mathlib.Computability.DFA

Goal state before:
pp: α : Type u
σ : Type v
M : DFA α σ
inst✝ : Fintype σ
x : List α
s t : σ
hlen : Fintype.card σ ≤ x.length
hx : M.evalFrom s x = t
n m : Fin (Fintype.card σ + 1)
hneq : n ≠ m
heq : M.evalFrom s (List.take (↑n) x) = M.evalFrom s (List.take (↑m) x)
hle : ↑n ≤ ↑m
⊢ M.evalFrom (M.evalFrom s (List.take (↑n) (List.take (↑m) x))) (List.drop (↑n) (List.take (↑m) x)) =
    M.evalFrom s (List.take (↑n) (List.take (↑m) x))

Tactic:
rw [List.take_take, min_eq_left hle, ← evalFrom_of_append, heq, ← min_eq_left hle, ←
      List.take_take, min_eq_left hle, List.take_append_drop]

Goal state after:
Module: Mathlib.Computability.DFA

Goal state before:
pp: α : Type u
σ : Type v
M : DFA α σ
α' : Type u_1
f : α' → α
s : σ
x : List α'
⊢ (comap f M).evalFrom s x = M.evalFrom s (List.map f x)

Tactic:
by
  induction x using List.reverseRecOn with
  | nil => simp
  | append_singleton x a ih => simp [ih]

Goal state after:
Module: Mathlib.Computability.DFA

Goal state before:
pp: α : Type u
σ : Type v
M : DFA α σ
σ' : Type u_2
g : σ ≃ σ'
s : σ'
x : List α
⊢ ((reindex g) M).evalFrom s x = g (M.evalFrom (g.symm s) x)

Tactic:
by
  induction x using List.reverseRecOn with
  | nil => simp
  | append_singleton x a ih => simp [ih]

Goal state after:
Module: Mathlib.Computability.AkraBazzi.GrowsPolynomially

Goal state before:
pp: case hba
f : ℝ → ℝ
hf✝¹ : GrowsPolynomially f
hf_pos_or_neg : (∀ᶠ (x : ℝ) in atTop, 0 < f x) ∨ ∀ᶠ (x : ℝ) in atTop, f x < 0
hf' : ∀ᶠ (x : ℝ) in atTop, f x ≠ 0
hf✝ : GrowsPolynomially fun x ↦ |f x|
b : ℝ
hb : b ∈ Set.Ioo 0 1
hb_pos : 0 < b
c₁ : ℝ
hc₁_mem : c₁ > 0
c₂ : ℝ
hc₂_mem : c₂ > 0
hf :
  ∀ᶠ (x : ℝ) in atTop,
    ∀ u ∈ Set.Icc (b * x) x, (fun x ↦ |f x|) u ∈ Set.Icc (c₁ * (fun x ↦ |f x|) x) (c₂ * (fun x ↦ |f x|) x)
x : ℝ
hx : ∀ u ∈ Set.Icc (b * x) x, |f u| ∈ Set.Icc (c₁ * |f x|) (c₂ * |f x|)
hx' : f x ≠ 0
hx'' : ∀ (y : ℝ), b * id x ≤ y → f y ≠ 0
u : ℝ
hu : u ∈ Set.Icc (b * x) x
h₁ : 0 < |f u|
⊢ |f u| ≤ c₂ * |f x|

Tactic:
exact (hx u hu).2

Goal state after:
Module: Mathlib.Data.Nat.Size

Goal state before:
pp: case zero
b : Bool
m : ℕ
h : shiftLeft' b m 0 ≠ 0
⊢ (shiftLeft' b m 0).size = m.size + 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Size

Goal state before:
pp: case zero
⊢ 0 < 2 ^ size 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Size

Goal state before:
pp: case zero
n : ℕ
h : 0 < 2 ^ n
⊢ size 0 ≤ n

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Size

Goal state before:
pp: case bit.zero
b : Bool
m : ℕ
e : bit b m ≠ 0
IH : ∀ {n : ℕ}, m < 2 ^ n → m.size ≤ n
h : bit b m < 2 ^ 0
⊢ m.size.succ ≤ 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Size

Goal state before:
pp: case zero
⊢ (bits 0).length = size 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
f : Bool → Bool → Bool
y : ℕ
⊢ bitwise f 0 y =
    binaryRec (motive := fun x ↦ ℕ → ℕ) (fun n ↦ bif f false true then n else 0)
      (fun a m Ia n ↦ binaryRec (bif f true false then bit a m else 0) (fun b n x ↦ bit (f a b) (Ia n)) n) 0 y

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case bit.zero
f : Bool → Bool → Bool
xb : Bool
x : ℕ
hxb : bit xb x ≠ 0
ih :
  ∀ (y : ℕ),
    bitwise f x y =
      binaryRec (motive := fun x ↦ ℕ → ℕ) (fun n ↦ bif f false true then n else 0)
        (fun a m Ia n ↦ binaryRec (bif f true false then bit a m else 0) (fun b n x ↦ bit (f a b) (Ia n)) n) x y
⊢ bitwise f (bit xb x) 0 =
    binaryRec (bif f true false then bit xb x else 0)
      (fun b n x_1 ↦
        bit (f xb b)
          (binaryRec (motive := fun x ↦ ℕ → ℕ) (fun n ↦ bif f false true then n else 0)
            (fun a m Ia n ↦ binaryRec (bif f true false then bit a m else 0) (fun b n x ↦ bit (f a b) (Ia n)) n) x n))
      0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
h : ∀ (i : ℕ), testBit 0 i = false
⊢ 0 = 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
n : ℕ
⊢ n.testBit 0 = n.bits.getI 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
h : 0 ≠ 0
⊢ ∃ i, testBit 0 i = true ∧ ∀ (j : ℕ), i < j → testBit 0 j = false

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
m i : ℕ
hn : testBit 0 i = false
hm : m.testBit i = true
hnm : ∀ (j : ℕ), i < j → testBit 0 j = m.testBit j
⊢ 0 < m

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case bit.zero
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), n.testBit i = false → m.testBit i = true → (∀ (j : ℕ), i < j → n.testBit j = m.testBit j) → n < m
i : ℕ
hn : (bit b n).testBit i = false
hm : testBit 0 i = true
hnm : ∀ (j : ℕ), i < j → (bit b n).testBit j = testBit 0 j
⊢ bit b n < 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
f : Bool → Bool → Bool
n : ℕ
⊢ bitwise (swap f) 0 n = bitwise f n 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case bit.zero
f : Bool → Bool → Bool
bm : Bool
m : ℕ
hm : m = 0 → bm = true
ihm : ∀ (n : ℕ), bitwise (swap f) m n = bitwise f n m
⊢ bitwise (swap f) (bit bm m) 0 = bitwise f 0 (bit bm m)

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.AkraBazzi.GrowsPolynomially

Goal state before:
pp: f : ℝ → ℝ
p : ℤ
hf : GrowsPolynomially f
hf_nonneg : ∀ᶠ (x : ℝ) in atTop, 0 ≤ f x
⊢ GrowsPolynomially fun x ↦ f x ^ p

Tactic:
simp_rw [← rpow_intCast]
  exact hf.rpow p hf_nonneg

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
h : Even 0
⊢ 0 ^^^ 1 = 0 + 1

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
h : Odd 0
⊢ 0 ^^^ 1 = 0 - 1

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Data.Nat.Bitwise

Goal state before:
pp: case zero
⊢ List.foldl (fun x1 x2 ↦ x1 ^^^ x2) 0 (List.range (0 + 1)) =
    match Fin.ofNat 4 0 with
    | 0 => 0
    | 1 => 1
    | 2 => 0 + 1
    | 3 => 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.PartrecCode

Goal state before:
pp: c : Code
n x : ℕ
⊢ ∀ {a m n_1 : ℕ}, m ≤ n_1 → a ∈ evaln m c n → a ∈ evaln n_1 c n

Tactic:
intro a

Goal state after:
c : Code
n x a : ℕ
⊢ ∀ {m n_1 : ℕ}, m ≤ n_1 → a ∈ evaln m c n → a ∈ evaln n_1 c n
Module: Mathlib.Computability.EpsilonNFA

Goal state before:
pp: α : Type u
σ : Type v
M : εNFA α σ
S : Set σ
s : σ
h : s ∈ M.εClosure S
⊢ ∃ t ∈ S, s ∈ M.εClosure {t}

Tactic:
by
    induction h with
    | base => tauto
    | step _ _ _ _ ih =>
      obtain ⟨s, _, _⟩ := ih
      use s
      solve_by_elim [εClosure.step]

Goal state after:
Module: Mathlib.Data.Num.Lemmas

Goal state before:
pp: ⊢ ∀ (a b : Num), a ≤ b ∨ b ≤ a

Tactic:
intro a

Goal state after:
a : Num
⊢ ∀ (b : Num), a ≤ b ∨ b ≤ a
Module: Mathlib.Data.Num.Lemmas

Goal state before:
pp: α : Type u_1
⊢ ∀ (a b c : PosNum), a ≤ b → b ≤ c → a ≤ c

Tactic:
intro a

Goal state after:
α : Type u_1
a : PosNum
⊢ ∀ (b c : PosNum), a ≤ b → b ≤ c → a ≤ c
Module: Mathlib.Data.Num.Lemmas

Goal state before:
pp: α : Type u_1
⊢ ∀ (a b : PosNum), a < b ↔ a ≤ b ∧ ¬b ≤ a

Tactic:
intro a

Goal state after:
α : Type u_1
a : PosNum
⊢ ∀ (b : PosNum), a < b ↔ a ≤ b ∧ ¬b ≤ a
Module: Mathlib.Data.Num.Lemmas

Goal state before:
pp: α : Type u_1
⊢ ∀ (a b : PosNum), a ≤ b → b ≤ a → a = b

Tactic:
intro a

Goal state after:
α : Type u_1
a : PosNum
⊢ ∀ (b : PosNum), a ≤ b → b ≤ a → a = b
Module: Mathlib.Data.Num.Lemmas

Goal state before:
pp: α : Type u_1
⊢ ∀ (a b : PosNum), a ≤ b ∨ b ≤ a

Tactic:
intro a

Goal state after:
α : Type u_1
a : PosNum
⊢ ∀ (b : PosNum), a ≤ b ∨ b ≤ a
Module: Mathlib.Computability.RE

Goal state before:
pp: α : Type u_1
inst✝¹ : Primcodable α
p : α → Prop
inst✝ : DecidablePred p
x✝ : REPred p ∧ REPred fun a ↦ ¬p a
h₁ : REPred p
h₂ : REPred fun a ↦ ¬p a
⊢ ∀ (a : α),
    ∀ x ∈ Part.map (fun b ↦ true) (Part.assert (p a) fun x ↦ Part.some ()),
      ∀ y ∈ Part.map (fun b ↦ false) (Part.assert ((fun a ↦ ¬p a) a) fun x ↦ Part.some ()), x = y

Tactic:
intro a

Goal state after:
α : Type u_1
inst✝¹ : Primcodable α
p : α → Prop
inst✝ : DecidablePred p
x✝ : REPred p ∧ REPred fun a ↦ ¬p a
h₁ : REPred p
h₂ : REPred fun a ↦ ¬p a
a : α
⊢ ∀ x ∈ Part.map (fun b ↦ true) (Part.assert (p a) fun x ↦ Part.some ()),
    ∀ y ∈ Part.map (fun b ↦ false) (Part.assert ((fun a ↦ ¬p a) a) fun x ↦ Part.some ()), x = y
Module: Mathlib.Computability.TuringMachine.Tape

Goal state before:
pp: case zero
Γ : Type u_1
inst✝ : Inhabited Γ
f : Γ → Γ
i : ℕ
L : ListBlank Γ
⊢ (modifyNth f 0 L).nth i = if i = 0 then f (L.nth i) else L.nth i

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.TuringMachine.Tape

Goal state before:
pp: case e_a.zero
Γ : Type ?u.8
Γ' : Type ?u.12
inst✝¹ : Inhabited Γ
inst✝ : Inhabited Γ'
l✝ : ListBlank Γ
f : Γ → List Γ'
l : List Γ
n : ℕ
e : f default = List.replicate n default
⊢ List.flatMap f (List.replicate 0 default) = List.replicate (n * 0) default

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.RecursiveIn

Goal state before:
pp: case zero
O O' : Set (ℕ →. ℕ)
f : ℕ →. ℕ
hO : ∀ g ∈ O, Nat.RecursiveIn O' g
⊢ Nat.RecursiveIn O' fun x ↦ 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.RecursiveIn

Goal state before:
pp: case zero
f : ℕ →. ℕ
O : Set (ℕ →. ℕ)
hO : ∀ g ∈ O, Nat.Partrec g
⊢ Nat.Partrec fun x ↦ 0

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.RecursiveIn

Goal state before:
pp: case zero
f : ℕ →. ℕ
O : Set (ℕ →. ℕ)
⊢ Nat.RecursiveIn O (pure 0)

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case branch.inl
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
S : Finset Λ
p : Γ → σ → Bool
q₁ q₂ : Stmt Γ Λ σ
hs : SupportsStmt S q₁ ∧ SupportsStmt S q₂
IH₁ : branch p q₁ q₂ ∈ stmts₁ q₁ → SupportsStmt S q₁ → SupportsStmt S (branch p q₁ q₂)
IH₂ : branch p q₁ q₂ ∈ stmts₁ q₂ → SupportsStmt S q₂ → SupportsStmt S (branch p q₁ q₂)
⊢ SupportsStmt S (branch p q₁ q₂)

pp: case branch.inr.inl
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
S : Finset Λ
q₁✝ : Stmt Γ Λ σ
p : Γ → σ → Bool
q₁ q₂ : Stmt Γ Λ σ
IH₁ : q₁✝ ∈ stmts₁ q₁ → SupportsStmt S q₁ → SupportsStmt S q₁✝
IH₂ : q₁✝ ∈ stmts₁ q₂ → SupportsStmt S q₂ → SupportsStmt S q₁✝
hs : SupportsStmt S q₁ ∧ SupportsStmt S q₂
h : q₁✝ ∈ stmts₁ q₁
⊢ SupportsStmt S q₁✝

pp: case branch.inr.inr
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
S : Finset Λ
q₁✝ : Stmt Γ Λ σ
p : Γ → σ → Bool
q₁ q₂ : Stmt Γ Λ σ
IH₁ : q₁✝ ∈ stmts₁ q₁ → SupportsStmt S q₁ → SupportsStmt S q₁✝
IH₂ : q₁✝ ∈ stmts₁ q₂ → SupportsStmt S q₂ → SupportsStmt S q₁✝
hs : SupportsStmt S q₁ ∧ SupportsStmt S q₂
h : q₁✝ ∈ stmts₁ q₂
⊢ SupportsStmt S q₁✝

Tactic:
exacts [hs, IH₁ h hs.1, IH₂ h hs.2]

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case move.inr
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
S : Finset Λ
q₁ : Stmt Γ Λ σ
a✝ : Dir
q : Stmt Γ Λ σ
IH : q₁ ∈ stmts₁ q → SupportsStmt S q → SupportsStmt S q₁
hs : SupportsStmt S q
h : q₁ ∈ stmts₁ q
⊢ SupportsStmt S q₁

Tactic:
exact IH h hs

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case write.inr
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
S : Finset Λ
q₁ : Stmt Γ Λ σ
a✝ : Γ → σ → Γ
q : Stmt Γ Λ σ
IH : q₁ ∈ stmts₁ q → SupportsStmt S q → SupportsStmt S q₁
hs : SupportsStmt S q
h : q₁ ∈ stmts₁ q
⊢ SupportsStmt S q₁

Tactic:
exact IH h hs

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case load.inr
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
S : Finset Λ
q₁ : Stmt Γ Λ σ
a✝ : Γ → σ → σ
q : Stmt Γ Λ σ
IH : q₁ ∈ stmts₁ q → SupportsStmt S q → SupportsStmt S q₁
hs : SupportsStmt S q
h : q₁ ∈ stmts₁ q
⊢ SupportsStmt S q₁

Tactic:
exact IH h hs

Goal state after:
Module: Mathlib.Data.Num.Lemmas

Goal state before:
pp: case pos.pos.one.one
f : Num → Num → Num
g : Bool → Bool → Bool
p : PosNum → PosNum → Num
gff : g false false = false
f00 : f 0 0 = 0
f0n : ∀ (n : PosNum), f 0 (pos n) = bif g false true then pos n else 0
fn0 : ∀ (n : PosNum), f (pos n) 0 = bif g true false then pos n else 0
fnn : ∀ (m n : PosNum), f (pos m) (pos n) = p m n
p11 : p 1 1 = bif g true true then 1 else 0
p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = bit (g true b) (bif g false true then pos n else 0)
pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = bit (g a true) (bif g true false then pos m else 0)
pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)
this : ∀ (b : Bool) (n : PosNum), (bif b then ↑n else 0) = ↑(bif b then pos n else 0)
this' : ∀ (b : Bool) (n : PosNum), ↑(pos (PosNum.bit b n)) = Nat.bit b ↑n
⊢ ↑(bif g true true then 1 else 0) = Nat.bit (g true true) 0

Tactic:
cases g true true <;> rfl

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case some.branch
Γ : Type u_1
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
M : Λ → TM1.Stmt Γ Λ σ
inst✝ : Inhabited Γ
x✝ : TM1.Cfg Γ Λ σ
l₁ : Λ
p : Γ → σ → Bool
a✝¹ a✝ : TM1.Stmt Γ Λ σ
IH₁ :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some a✝¹, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux a✝¹ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux a✝¹ v T).var),
        Tape := (TM1.stepAux a✝¹ v T).Tape }
IH₂ :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some a✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux a✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux a✝ v T).var),
        Tape := (TM1.stepAux a✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.branch p a✝¹ a✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.branch p a✝¹ a✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.branch p a✝¹ a✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.branch p a✝¹ a✝) v T).Tape }

Tactic:
| branch p _ _ IH₁ IH₂ =>

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case zero
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
n : ℕ
d : Dir
q : Stmt Bool (Λ' Γ Λ σ) σ
v : σ
T : Tape Bool
⊢ stepAux ((Stmt.move d)^[0] q) v T = stepAux q v ((Tape.move d)^[0] T)

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case zero
Γ : Type u_1
Λ : Type u_2
σ : Type u_3
n : ℕ
dec : List.Vector Bool n → Γ
S : Finset (Λ' Γ Λ σ)
f✝ : Γ → Stmt Bool (Λ' Γ Λ σ) σ
f : List.Vector Bool 0 → Stmt Bool (Λ' Γ Λ σ) σ
hf : ∀ (v : List.Vector Bool 0), SupportsStmt S (f v)
⊢ SupportsStmt S (readAux 0 f)

Tactic:
| zero =>

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: Γ : Type u_1
n : ℕ
enc : Γ → List.Vector Bool n
inst✝ : Inhabited Γ
enc0 : enc default = List.Vector.replicate n false
R : ListBlank Γ
a : Γ
L : ListBlank Γ
this :
  ∀ {L' R' : ListBlank Bool} {l₁ l₂ : List Bool},
    (enc a).toList = l₁.reverseAux l₂ →
      (Tape.move Dir.left)^[l₁.length] (Tape.mk' (ListBlank.append l₁ L') (ListBlank.append l₂ R')) =
        Tape.mk' L' (ListBlank.append (enc a).toList R')
⊢ (Tape.move Dir.left)^[n]
      (Tape.mk' (ListBlank.append (enc a).toList.reverse (L.flatMap (fun x ↦ (enc x).toList.reverse) ⋯))
        (R.flatMap (fun x ↦ (enc x).toList) ⋯)) =
    Tape.mk' (L.flatMap (fun x ↦ (enc x).toList.reverse) ⋯)
      (ListBlank.append (enc a).toList (R.flatMap (fun x ↦ (enc x).toList) ⋯))

Tactic:
simpa only [List.length_reverse, Vector.toList_length] using! this (List.reverse_reverse _).symm

Goal state after:
Module: Mathlib.Computability.TuringMachine.PostTuringMachine

Goal state before:
pp: case zero
Γ : Type u_1
n : ℕ
enc : Γ → List.Vector Bool n
inst✝ : Inhabited Γ
enc0 : enc default = List.Vector.replicate n false
L R : ListBlank Γ
L✝ : Tape Bool
⊢ (Tape.move Dir.right)^[0] ((Tape.move Dir.left)^[0] L✝) = L✝

Tactic:
| zero =>

Goal state after: