full_name
stringlengths 3
121
| state
stringlengths 7
9.32k
| tactic
stringlengths 3
5.35k
| target_state
stringlengths 7
19k
| url
stringclasses 1
value | commit
stringclasses 1
value | file_path
stringlengths 21
79
|
---|---|---|---|---|---|---|
Turing.ToPartrec.Code.exists_code
|
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
this :
∀ (a b : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
⊢ ((Part.some
(n.succ ::
0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail)).bind
fun x => Part.some [x.tail.tail.headI]) =
Part.some [g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail)]
|
simp only [<a>List.headI</a>, <a>Part.bind_some</a>, <a>List.tail_cons</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case prim.prec.intro.intro.succ.zero
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
a : ℕ
e : a + 0 = n
⊢ n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
|
refine <a>PFun.mem_fix_iff</a>.2 (<a>Or.inl</a> <| <a>Part.eq_some_iff</a>.1 ?_)
|
case prim.prec.intro.intro.succ.zero
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
a : ℕ
e : a + 0 = n
⊢ ((cg.eval
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail)).bind
fun x =>
Part.some
(if (a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI = 0 then
Sum.inl
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail)
else
Sum.inr
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a ::
0 ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail))) =
Part.some
(Sum.inl
(n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case prim.prec.intro.intro.succ.zero
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
a : ℕ
e : a + 0 = n
⊢ ((cg.eval
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail)).bind
fun x =>
Part.some
(if (a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI = 0 then
Sum.inl
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail)
else
Sum.inr
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a ::
0 ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail))) =
Part.some
(Sum.inl
(n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail))
|
simp only [hg, ← e, <a>Part.bind_some</a>, <a>List.tail_cons</a>, <a>Pure.pure</a>]
|
case prim.prec.intro.intro.succ.zero
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
a : ℕ
e : a + 0 = n
⊢ Part.some
(if (0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI = 0 then
Sum.inl
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail)
else
Sum.inr
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail)) =
Part.some
(Sum.inl
((a + 0).succ ::
0 ::
g ((a + 0) ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) (a + 0) ::ᵥ v.tail) :: (↑v).tail))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case prim.prec.intro.intro.succ.zero
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
a : ℕ
e : a + 0 = n
⊢ Part.some
(if (0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI = 0 then
Sum.inl
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail)
else
Sum.inr
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a :: 0 :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail)) =
Part.some
(Sum.inl
((a + 0).succ ::
0 ::
g ((a + 0) ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) (a + 0) ::ᵥ v.tail) :: (↑v).tail))
|
rfl
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case prim.prec.intro.intro.succ.succ
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
b : ℕ
IH :
∀ (a : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
a : ℕ
e : a + (b + 1) = n
⊢ n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
|
refine <a>PFun.mem_fix_iff</a>.2 (<a>Or.inr</a> ⟨_, ?_, IH (a + 1) (by rwa [<a>add_right_comm</a>])⟩)
|
case prim.prec.intro.intro.succ.succ
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
b : ℕ
IH :
∀ (a : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
a : ℕ
e : a + (b + 1) = n
⊢ Sum.inr ((a + 1) :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) (a + 1) :: (↑v).tail) ∈
(cg.eval
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::
(a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail)).bind
fun x =>
Part.some
(if
(a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI =
0 then
Sum.inl
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail)
else
Sum.inr
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case prim.prec.intro.intro.succ.succ
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
b : ℕ
IH :
∀ (a : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
a : ℕ
e : a + (b + 1) = n
⊢ Sum.inr ((a + 1) :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) (a + 1) :: (↑v).tail) ∈
(cg.eval
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::
(a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail)).bind
fun x =>
Part.some
(if
(a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI =
0 then
Sum.inl
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail)
else
Sum.inr
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.headI.pred ::
x.headI ::
(a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).tail.tail.tail))
|
simp only [hg, <a>Turing.ToPartrec.Code.eval</a>, <a>Part.bind_some</a>, <a>Nat.rec_add_one</a>, <a>List.tail_nil</a>, <a>List.tail_cons</a>, <a>Pure.pure</a>]
|
case prim.prec.intro.intro.succ.succ
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
b : ℕ
IH :
∀ (a : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
a : ℕ
e : a + (b + 1) = n
⊢ Sum.inr
((a + 1) :: b :: g (a ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail) :: (↑v).tail) ∈
Part.some
(if ((b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI = 0 then
Sum.inl
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
((b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail)
else
Sum.inr
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
((b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case prim.prec.intro.intro.succ.succ
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
b : ℕ
IH :
∀ (a : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
a : ℕ
e : a + (b + 1) = n
⊢ Sum.inr
((a + 1) :: b :: g (a ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail) :: (↑v).tail) ∈
Part.some
(if ((b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI = 0 then
Sum.inl
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
((b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail)
else
Sum.inr
((a :: (b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.succ ::
((b + 1) :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI.pred ::
(List.pure
(g
((a ::
(b + 1) ::
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail).headI ::ᵥ
Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a ::ᵥ v.tail))).headI ::
(↑v).tail))
|
exact <a>Part.mem_some_iff</a>.2 <a>rfl</a>
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
n✝² : ℕ
f✝¹ : Vector ℕ n✝² →. ℕ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ → ℕ
n✝ : ℕ
f : Vector ℕ n✝ → ℕ
g : Vector ℕ (n✝ + 2) → ℕ
a✝² : Nat.Primrec' f
a✝¹ : Nat.Primrec' g
cf cg : Code
v : Vector ℕ (n✝ + 1)
hf : cf.eval (↑v).tail = pure (pure (f v.tail))
hg : ∀ (a b : ℕ), cg.eval (a :: b :: (↑v).tail) = pure (pure (g (a ::ᵥ b ::ᵥ v.tail)))
n : ℕ
a✝ : (cf.prec cg).eval (n :: (↑v).tail) = pure (pure (Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n))
b : ℕ
IH :
∀ (a : ℕ),
a + b = n →
n.succ :: 0 :: g (n ::ᵥ Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) n ::ᵥ v.tail) :: (↑v).tail ∈
PFun.fix
(fun v =>
(cg.eval (v.headI :: v.tail.tail)).bind fun x =>
Part.some
(if v.tail.headI = 0 then Sum.inl (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)
else Sum.inr (v.headI.succ :: v.tail.headI.pred :: x.headI :: v.tail.tail.tail)))
(a :: b :: Nat.rec (f v.tail) (fun y IH => g (y ::ᵥ IH ::ᵥ v.tail)) a :: (↑v).tail)
a : ℕ
e : a + (b + 1) = n
⊢ a + 1 + b = n
|
rwa [<a>add_right_comm</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case comp
n : ℕ
f : Vector ℕ n →. ℕ
m✝ n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
g : Fin n✝ → Vector ℕ m✝ →. ℕ
a✝¹ : Nat.Partrec' f✝
a✝ : ∀ (i : Fin n✝), Nat.Partrec' (g i)
IHf : ∃ c, ∀ (v : Vector ℕ n✝), c.eval ↑v = pure <$> f✝ v
IHg : ∀ (i : Fin n✝), ∃ c, ∀ (v : Vector ℕ m✝), c.eval ↑v = pure <$> g i v
⊢ ∃ c, ∀ (v : Vector ℕ m✝), c.eval ↑v = pure <$> (fun v => (Vector.mOfFn fun i => g i v) >>= f✝) v
|
exact <a>Turing.ToPartrec.Code.exists_code.comp</a> IHf IHg
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
IHf : ∃ c, ∀ (v : Vector ℕ (n + 1)), c.eval ↑v = pure <$> ↑f v
⊢ ∃ c, ∀ (v : Vector ℕ n), c.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
obtain ⟨cf, hf⟩ := IHf
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
hf : ∀ (v : Vector ℕ (n + 1)), cf.eval ↑v = pure <$> ↑f v
⊢ ∃ c, ∀ (v : Vector ℕ n), c.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
hf : ∀ (v : Vector ℕ (n + 1)), cf.eval ↑v = pure <$> ↑f v
⊢ ∃ c, ∀ (v : Vector ℕ n), c.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
refine ⟨<a>Turing.ToPartrec.Code.rfind</a> cf, fun v => ?_⟩
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
hf : ∀ (v : Vector ℕ (n + 1)), cf.eval ↑v = pure <$> ↑f v
v : Vector ℕ n
⊢ cf.rfind.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
hf : ∀ (v : Vector ℕ (n + 1)), cf.eval ↑v = pure <$> ↑f v
v : Vector ℕ n
⊢ cf.rfind.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
replace hf := fun a => hf (a ::ᵥ v)
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval ↑(a ::ᵥ v) = pure <$> ↑f (a ::ᵥ v)
⊢ cf.rfind.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval ↑(a ::ᵥ v) = pure <$> ↑f (a ::ᵥ v)
⊢ cf.rfind.eval ↑v = pure <$> (fun v => Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0))) v
|
simp only [<a>Part.map_eq_map</a>, <a>Part.map_some</a>, <a>Vector.cons_val</a>, <a>PFun.coe_val</a>, show ∀ x, <a>Pure.pure</a> x = [x] from fun _ => <a>rfl</a>] at hf ⊢
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
⊢ cf.rfind.eval ↑v = Part.map pure (Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0)))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
⊢ cf.rfind.eval ↑v = Part.map pure (Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0)))
|
refine <a>Part.ext</a> fun x => ?_
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ x ∈ cf.rfind.eval ↑v ↔ x ∈ Part.map pure (Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0)))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ x ∈ cf.rfind.eval ↑v ↔ x ∈ Part.map pure (Nat.rfind fun n_1 => Part.some (decide (f (n_1 ::ᵥ v) = 0)))
|
simp only [<a>Turing.ToPartrec.Code.rfind</a>, <a>Part.bind_eq_bind</a>, <a>Part.pure_eq_some</a>, <a>Part.map_eq_map</a>, <a>Part.bind_some</a>, <a>exists_prop</a>, <a>Turing.ToPartrec.Code.cons_eval</a>, <a>Turing.ToPartrec.Code.comp_eval</a>, <a>Turing.ToPartrec.Code.fix_eval</a>, <a>Turing.ToPartrec.Code.tail_eval</a>, <a>Turing.ToPartrec.Code.succ_eval</a>, <a>Turing.ToPartrec.Code.zero'_eval</a>, <a>List.headI_nil</a>, <a>List.headI_cons</a>, <a>Turing.ToPartrec.Code.pred_eval</a>, <a>Part.map_some</a>, <a>false_eq_decide_iff</a>, <a>Part.mem_bind_iff</a>, <a>List.length</a>, <a>Part.mem_map_iff</a>, <a>Nat.mem_rfind</a>, <a>List.tail_nil</a>, <a>List.tail_cons</a>, <a>true_eq_decide_iff</a>, <a>Part.mem_some_iff</a>, <a>Part.map_bind</a>]
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ (∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
x = [a.headI.pred]) ↔
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = x
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ (∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
x = [a.headI.pred]) ↔
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = x
|
constructor
|
case rfind.intro.mp
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ (∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
x = [a.headI.pred]) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = x
case rfind.intro.mpr
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ (∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = x) →
∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
x = [a.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ (∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
x = [a.headI.pred]) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = x
|
rintro ⟨v', h1, rfl⟩
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = [v'.headI.pred]
|
suffices ∀ v₁ : <a>List</a> ℕ, v' ∈ <a>PFun.fix</a> (fun v => (cf.eval v).<a>Part.bind</a> fun y => <a>Part.some</a> <| if y.headI = 0 then <a>Sum.inl</a> (v.headI.succ :: v.tail) else <a>Sum.inr</a> (v.headI.succ :: v.tail)) v₁ → ∀ n, (v₁ = n :: v.val) → (∀ m < n, ¬f (m ::ᵥ v) = 0) → ∃ a : ℕ, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred] by exact this _ h1 0 <a>rfl</a> (by rintro _ ⟨⟩)
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
⊢ ∀ (v₁ : List ℕ),
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁ →
∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
⊢ ∀ (v₁ : List ℕ),
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁ →
∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
clear h1
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
⊢ ∀ (v₁ : List ℕ),
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁ →
∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
⊢ ∀ (v₁ : List ℕ),
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁ →
∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
intro v₀ h1
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₀
⊢ ∀ (n_1 : ℕ),
v₀ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₀
⊢ ∀ (n_1 : ℕ),
v₀ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
refine <a>PFun.fixInduction</a> h1 fun v₁ h2 IH => ?_
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₀
v₁ : List ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval v₁).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v₁.headI.succ :: v₁.tail) else Sum.inr (v₁.headI.succ :: v₁.tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
⊢ ∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₀
v₁ : List ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval v₁).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v₁.headI.succ :: v₁.tail) else Sum.inr (v₁.headI.succ :: v₁.tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
⊢ ∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
clear h1
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ v₁ : List ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval v₁).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v₁.headI.succ :: v₁.tail) else Sum.inr (v₁.headI.succ :: v₁.tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
⊢ ∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ v₁ : List ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval v₁).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v₁.headI.succ :: v₁.tail) else Sum.inr (v₁.headI.succ :: v₁.tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
⊢ ∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
rintro n rfl hm
|
case rfind.intro.mp.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
have := <a>PFun.mem_fix_iff</a>.1 h2
|
case rfind.intro.mp.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
this :
(Sum.inl v' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) ∨
∃ a',
(Sum.inr a' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
this :
(Sum.inl v' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) ∨
∃ a',
(Sum.inr a' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
simp only [hf, <a>Part.bind_some</a>] at this
|
case rfind.intro.mp.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
this :
Sum.inl v' ∈
Part.some
(if [f (n ::ᵥ v)].headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈
Part.some
(if [f (n ::ᵥ v)].headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mp.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
this :
Sum.inl v' ∈
Part.some
(if [f (n ::ᵥ v)].headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈
Part.some
(if [f (n ::ᵥ v)].headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
split_ifs at this with h
|
case pos
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : [f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
case neg
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
this :
∀ (v₁ : List ℕ),
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁ →
∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = [v'.headI.pred]
|
exact this _ h1 0 <a>rfl</a> (by rintro _ ⟨⟩)
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' : List ℕ
h1 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
this :
∀ (v₁ : List ℕ),
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
v₁ →
∀ (n_1 : ℕ),
v₁ = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
⊢ ∀ m < 0, ¬f (m ::ᵥ v) = 0
|
rintro _ ⟨⟩
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case pos
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : [f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
simp only [<a>List.headI_nil</a>, <a>List.headI_cons</a>, <a>exists_false</a>, <a>or_false_iff</a>, <a>Part.mem_some_iff</a>, <a>List.tail_cons</a>, <a>false_and_iff</a>, Sum.inl.injEq] at this
|
case pos
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : [f (n ::ᵥ v)].headI = 0
this : v' = n.succ :: ↑v
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case pos
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : [f (n ::ᵥ v)].headI = 0
this : v' = n.succ :: ↑v
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
subst this
|
case pos
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v₀ : List ℕ
n : ℕ
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : [f (n ::ᵥ v)].headI = 0
h2 :
n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [(n.succ :: ↑v).headI.pred]
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [(n.succ :: ↑v).headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case pos
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v₀ : List ℕ
n : ℕ
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : [f (n ::ᵥ v)].headI = 0
h2 :
n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [(n.succ :: ↑v).headI.pred]
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [(n.succ :: ↑v).headI.pred]
|
exact ⟨_, ⟨h, @(hm)⟩, <a>rfl</a>⟩
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case neg
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ ∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
|
refine IH (n.succ::v.val) (by simp_all) _ <a>rfl</a> fun m h' => ?_
|
case neg
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
m : ℕ
h' : m < n.succ
⊢ ¬f (m ::ᵥ v) = 0
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case neg
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
m : ℕ
h' : m < n.succ
⊢ ¬f (m ::ᵥ v) = 0
|
obtain h | rfl := <a>Nat.lt_succ_iff_lt_or_eq</a>.1 h'
|
case neg.inl
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h✝ : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
m : ℕ
h' : m < n.succ
h : m < n
⊢ ¬f (m ::ᵥ v) = 0
case neg.inr
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
m : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(m :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (m :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((m :: ↑v).headI.succ :: (m :: ↑v).tail)
else Sum.inr ((m :: ↑v).headI.succ :: (m :: ↑v).tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m_1 < m, ¬f (m_1 ::ᵥ v) = 0
h : ¬[f (m ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((m :: ↑v).headI.succ :: (m :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((m :: ↑v).headI.succ :: (m :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
h' : m < m.succ
⊢ ¬f (m ::ᵥ v) = 0
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case neg.inl
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h✝ : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
m : ℕ
h' : m < n.succ
h : m < n
⊢ ¬f (m ::ᵥ v) = 0
case neg.inr
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
m : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(m :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (m :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((m :: ↑v).headI.succ :: (m :: ↑v).tail)
else Sum.inr ((m :: ↑v).headI.succ :: (m :: ↑v).tail))) →
∀ (n_1 : ℕ),
a'' = n_1 :: ↑v →
(∀ m < n_1, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m_1 < m, ¬f (m_1 ::ᵥ v) = 0
h : ¬[f (m ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((m :: ↑v).headI.succ :: (m :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((m :: ↑v).headI.succ :: (m :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
h' : m < m.succ
⊢ ¬f (m ::ᵥ v) = 0
|
exacts [hm _ h, h]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
v' v₀ : List ℕ
n : ℕ
h2 :
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
IH :
∀ (a'' : List ℕ),
(Sum.inr a'' ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))) →
∀ (n : ℕ),
a'' = n :: ↑v →
(∀ m < n, ¬f (m ::ᵥ v) = 0) →
∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ [a] = [v'.headI.pred]
hm : ∀ m < n, ¬f (m ::ᵥ v) = 0
h : ¬[f (n ::ᵥ v)].headI = 0
this :
Sum.inl v' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∨
∃ a',
Sum.inr a' ∈ Part.some (Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail)) ∧
v' ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
a'
⊢ Sum.inr (n.succ :: ↑v) ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))
|
simp_all
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
x : List ℕ
⊢ (∃ a, (f (a ::ᵥ v) = 0 ∧ ∀ {m : ℕ}, m < a → ¬f (m ::ᵥ v) = 0) ∧ pure a = x) →
∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
x = [a.headI.pred]
|
rintro ⟨n, ⟨hn, hm⟩, rfl⟩
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
⊢ ∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
pure n = [a.headI.pred]
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
⊢ ∃
a ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v),
pure n = [a.headI.pred]
|
refine ⟨n.succ::v.1, ?_, <a>rfl</a>⟩
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
⊢ n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
⊢ n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
have : (n.succ::v.1 : <a>List</a> ℕ) ∈ <a>PFun.fix</a> (fun v => (cf.eval v).<a>Part.bind</a> fun y => <a>Part.some</a> <| if y.headI = 0 then <a>Sum.inl</a> (v.headI.succ :: v.tail) else <a>Sum.inr</a> (v.headI.succ :: v.tail)) (n::v.val) := <a>PFun.mem_fix_iff</a>.2 (<a>Or.inl</a> (by simp [hf, hn]))
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
this :
n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
⊢ n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
this :
n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
⊢ n.succ :: ↑v ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
generalize (n.succ :: v.1 : <a>List</a> ℕ) = w at this ⊢
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
w : List ℕ
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
w : List ℕ
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
clear hn
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
w : List ℕ
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
w : List ℕ
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
induction' n with n IH
|
case rfind.intro.mpr.intro.intro.intro.zero
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
w : List ℕ
hm : ∀ {m : ℕ}, m < 0 → ¬f (m ::ᵥ v) = 0
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
case rfind.intro.mpr.intro.intro.intro.succ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
w : List ℕ
n : ℕ
IH :
(∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
hm : ∀ {m : ℕ}, m < n + 1 → ¬f (m ::ᵥ v) = 0
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
((n + 1) :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro.succ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
w : List ℕ
n : ℕ
IH :
(∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
hm : ∀ {m : ℕ}, m < n + 1 → ¬f (m ::ᵥ v) = 0
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
((n + 1) :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
refine IH (fun {m} h' => hm (<a>Nat.lt_succ_of_lt</a> h')) (<a>PFun.mem_fix_iff</a>.2 (<a>Or.inr</a> ⟨_, ?_, this⟩))
|
case rfind.intro.mpr.intro.intro.intro.succ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
w : List ℕ
n : ℕ
IH :
(∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
hm : ∀ {m : ℕ}, m < n + 1 → ¬f (m ::ᵥ v) = 0
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
((n + 1) :: ↑v)
⊢ Sum.inr ((n + 1) :: ↑v) ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro.succ
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
w : List ℕ
n : ℕ
IH :
(∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(n :: ↑v) →
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
hm : ∀ {m : ℕ}, m < n + 1 → ¬f (m ::ᵥ v) = 0
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
((n + 1) :: ↑v)
⊢ Sum.inr ((n + 1) :: ↑v) ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))
|
simp only [hf, hm n.lt_succ_self, <a>Part.bind_some</a>, <a>List.headI</a>, <a>eq_self_iff_true</a>, <a>if_false</a>, <a>Part.mem_some_iff</a>, <a>and_self_iff</a>, <a>List.tail_cons</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
n✝¹ : ℕ
f✝ : Vector ℕ n✝¹ →. ℕ
n✝ : ℕ
f : Vector ℕ (n✝ + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n✝
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
n : ℕ
hn : f (n ::ᵥ v) = 0
hm : ∀ {m : ℕ}, m < n → ¬f (m ::ᵥ v) = 0
⊢ Sum.inl (n.succ :: ↑v) ∈
(cf.eval (n :: ↑v)).bind fun y =>
Part.some
(if y.headI = 0 then Sum.inl ((n :: ↑v).headI.succ :: (n :: ↑v).tail)
else Sum.inr ((n :: ↑v).headI.succ :: (n :: ↑v).tail))
|
simp [hf, hn]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Turing.ToPartrec.Code.exists_code
|
case rfind.intro.mpr.intro.intro.intro.zero
n✝ : ℕ
f✝ : Vector ℕ n✝ →. ℕ
n : ℕ
f : Vector ℕ (n + 1) → ℕ
a✝ : Nat.Partrec' ↑f
cf : Code
v : Vector ℕ n
hf : ∀ (a : ℕ), cf.eval (a :: ↑v) = Part.some [f (a ::ᵥ v)]
w : List ℕ
hm : ∀ {m : ℕ}, m < 0 → ¬f (m ::ᵥ v) = 0
this :
w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
⊢ w ∈
PFun.fix
(fun v =>
(cf.eval v).bind fun y =>
Part.some (if y.headI = 0 then Sum.inl (v.headI.succ :: v.tail) else Sum.inr (v.headI.succ :: v.tail)))
(0 :: ↑v)
|
exact this
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Computability/TMToPartrec.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
have hbε : 0 < <a>Polynomial.cardPowDegree</a> b • ε := by rw [<a>Algebra.smul_def</a>, <a>eq_intCast</a>] exact <a>mul_pos</a> (Int.cast_pos.mpr (<a>AbsoluteValue.pos</a> _ hb)) hε
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
have one_lt_q : 1 < <a>Fintype.card</a> Fq := <a>Fintype.one_lt_card</a>
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
have one_lt_q' : (1 : ℝ) < <a>Fintype.card</a> Fq := by assumption_mod_cast
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
have q_pos : 0 < <a>Fintype.card</a> Fq := by omega
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
have q_pos' : (0 : ℝ) < <a>Fintype.card</a> Fq := by assumption_mod_cast
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
by_cases le_b : b.natDegree ≤ ⌈-<a>Real.log</a> ε / <a>Real.log</a> (<a>Fintype.card</a> Fq)⌉₊
|
case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ¬b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ¬b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
rw [<a>not_le</a>] at le_b
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
obtain ⟨i₀, i₁, i_ne, deg_lt⟩ := <a>Polynomial.exists_approx_polynomial_aux</a> <a>le_rfl</a> b (fun i => A i % b) fun i => <a>EuclideanDomain.mod_lt</a> (A i) hb
|
case neg.intro.intro.intro
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case neg.intro.intro.intro
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
use i₀, i₁, i_ne
|
case right
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case right
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
by_cases h : A i₁ % b = A i₀ % b
|
case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : A i₁ % b = A i₀ % b
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
have h' : A i₁ % b - A i₀ % b ≠ 0 := <a>mt</a> sub_eq_zero.mp h
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
suffices (<a>Polynomial.natDegree</a> (A i₁ % b - A i₀ % b) : ℝ) < b.natDegree + <a>Real.log</a> ε / <a>Real.log</a> (<a>Fintype.card</a> Fq) by rwa [← <a>Real.log_lt_log_iff</a> (Int.cast_pos.mpr (cardPowDegree.pos h')) hbε, <a>Polynomial.cardPowDegree_nonzero</a> _ h', <a>Polynomial.cardPowDegree_nonzero</a> _ hb, <a>Algebra.smul_def</a>, <a>eq_intCast</a>, <a>Int.cast_pow</a>, <a>Int.cast_natCast</a>, <a>Int.cast_pow</a>, <a>Int.cast_natCast</a>, <a>Real.log_mul</a> (<a>pow_ne_zero</a> _ q_pos'.ne') hε.ne', ← <a>Real.rpow_natCast</a>, ← <a>Real.rpow_natCast</a>, <a>Real.log_rpow</a> q_pos', <a>Real.log_rpow</a> q_pos', ← <a>lt_div_iff</a> (<a>Real.log_pos</a> one_lt_q'), <a>add_div</a>, <a>mul_div_cancel_right₀</a> _ (<a>Real.log_pos</a> one_lt_q').<a>LT.lt.ne'</a>]
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree < ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree < ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
|
apply <a>lt_of_lt_of_le</a> (Nat.cast_lt.mpr (WithBot.coe_lt_coe.mp _)) _
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ℕ
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree < ↑?m.43707
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑?m.43707 ≤ ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ℕ
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree < ↑?m.43707
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑?m.43707 ≤ ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
|
swap
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree < ↑?m.43707
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ℕ
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑?m.43707 ≤ ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊) ≤ ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
|
rw [← <a>sub_neg_eq_add</a>, <a>neg_div</a>]
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-(log ε / log ↑(Fintype.card Fq))⌉₊) ≤ ↑b.natDegree - -(log ε / log ↑(Fintype.card Fq))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-(log ε / log ↑(Fintype.card Fq))⌉₊) ≤ ↑b.natDegree - -(log ε / log ↑(Fintype.card Fq))
|
refine <a>le_trans</a> ?_ (<a>sub_le_sub_left</a> (<a>Nat.le_ceil</a> _) (b.natDegree : ℝ))
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-(log ε / log ↑(Fintype.card Fq))⌉₊) ≤ ↑b.natDegree - ↑⌈-(log ε / log ↑(Fintype.card Fq))⌉₊
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-(log ε / log ↑(Fintype.card Fq))⌉₊) ≤ ↑b.natDegree - ↑⌈-(log ε / log ↑(Fintype.card Fq))⌉₊
|
rw [← <a>neg_div</a>]
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊) ≤ ↑b.natDegree - ↑⌈-log ε / log ↑(Fintype.card Fq)⌉₊
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊) ≤ ↑b.natDegree - ↑⌈-log ε / log ↑(Fintype.card Fq)⌉₊
|
exact <a>le_of_eq</a> (<a>Nat.cast_sub</a> le_b.le)
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
⊢ 0 < cardPowDegree b • ε
|
rw [<a>Algebra.smul_def</a>, <a>eq_intCast</a>]
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
⊢ 0 < ↑(cardPowDegree b) * ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
⊢ 0 < ↑(cardPowDegree b) * ε
|
exact <a>mul_pos</a> (Int.cast_pos.mpr (<a>AbsoluteValue.pos</a> _ hb)) hε
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
⊢ 1 < ↑(Fintype.card Fq)
|
assumption_mod_cast
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
⊢ 0 < Fintype.card Fq
|
omega
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
⊢ 0 < ↑(Fintype.card Fq)
|
assumption_mod_cast
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
obtain ⟨i₀, i₁, i_ne, mod_eq⟩ := <a>Polynomial.exists_eq_polynomial</a> <a>le_rfl</a> b le_b (fun i => A i % b) fun i => <a>EuclideanDomain.mod_lt</a> (A i) hb
|
case pos.intro.intro.intro
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
mod_eq : A i₁ % b = A i₀ % b
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case pos.intro.intro.intro
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
mod_eq : A i₁ % b = A i₀ % b
⊢ ∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
refine ⟨i₀, i₁, i_ne, ?_⟩
|
case pos.intro.intro.intro
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
mod_eq : A i₁ % b = A i₀ % b
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case pos.intro.intro.intro
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : b.natDegree ≤ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
mod_eq : A i₁ % b = A i₀ % b
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
rwa [mod_eq, <a>sub_self</a>, <a>map_zero</a>, <a>Int.cast_zero</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : A i₁ % b = A i₀ % b
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
rwa [h, <a>sub_self</a>, <a>map_zero</a>, <a>Int.cast_zero</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
this : ↑(A i₁ % b - A i₀ % b).natDegree < ↑b.natDegree + log ε / log ↑(Fintype.card Fq)
⊢ ↑(cardPowDegree (A i₁ % b - A i₀ % b)) < cardPowDegree b • ε
|
rwa [← <a>Real.log_lt_log_iff</a> (Int.cast_pos.mpr (cardPowDegree.pos h')) hbε, <a>Polynomial.cardPowDegree_nonzero</a> _ h', <a>Polynomial.cardPowDegree_nonzero</a> _ hb, <a>Algebra.smul_def</a>, <a>eq_intCast</a>, <a>Int.cast_pow</a>, <a>Int.cast_natCast</a>, <a>Int.cast_pow</a>, <a>Int.cast_natCast</a>, <a>Real.log_mul</a> (<a>pow_ne_zero</a> _ q_pos'.ne') hε.ne', ← <a>Real.rpow_natCast</a>, ← <a>Real.rpow_natCast</a>, <a>Real.log_rpow</a> q_pos', <a>Real.log_rpow</a> q_pos', ← <a>lt_div_iff</a> (<a>Real.log_pos</a> one_lt_q'), <a>add_div</a>, <a>mul_div_cancel_right₀</a> _ (<a>Real.log_pos</a> one_lt_q').<a>LT.lt.ne'</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree < ↑?m.43707
|
convert deg_lt
|
case h.e'_3
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree = (A i₁ % b - A i₀ % b).degree
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case h.e'_3
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree = (A i₁ % b - A i₀ % b).degree
|
rw [<a>Polynomial.degree_eq_natDegree</a> h']
|
case h.e'_3
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree = ↑(A i₁ % b - A i₀ % b).natDegree
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
Polynomial.exists_approx_polynomial
|
case h.e'_3
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
b : Fq[X]
hb : b ≠ 0
ε : ℝ
hε : 0 < ε
A : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ → Fq[X]
hbε : 0 < cardPowDegree b • ε
one_lt_q : 1 < Fintype.card Fq
one_lt_q' : 1 < ↑(Fintype.card Fq)
q_pos : 0 < Fintype.card Fq
q_pos' : 0 < ↑(Fintype.card Fq)
le_b : ⌈-log ε / log ↑(Fintype.card Fq)⌉₊ < b.natDegree
i₀ i₁ : Fin (Fintype.card Fq ^ ⌈-log ε / log ↑(Fintype.card Fq)⌉₊).succ
i_ne : i₀ ≠ i₁
deg_lt : (A i₁ % b - A i₀ % b).degree < ↑(b.natDegree - ⌈-log ε / log ↑(Fintype.card Fq)⌉₊)
h : ¬A i₁ % b = A i₀ % b
h' : A i₁ % b - A i₀ % b ≠ 0
⊢ ↑(A i₁ % b - A i₀ % b).natDegree = ↑(A i₁ % b - A i₀ % b).natDegree
|
rfl
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
|
descPochhammer_succ_eval
|
R : Type u
inst✝¹ : Ring R
S : Type u_1
inst✝ : Ring S
n : ℕ
k : S
⊢ eval k (descPochhammer S (n + 1)) = eval k (descPochhammer S n) * (k - ↑n)
|
rw [<a>descPochhammer_succ_right</a>, <a>mul_sub</a>, <a>Polynomial.eval_sub</a>, <a>Polynomial.eval_mul_X</a>, ← <a>Nat.cast_comm</a>, ← <a>Polynomial.C_eq_natCast</a>, <a>Polynomial.eval_C_mul</a>, <a>Nat.cast_comm</a>, ← <a>mul_sub</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/RingTheory/Polynomial/Pochhammer.lean
|
Ordinal.sup_typein_succ
|
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : succ (sup (typein fun x x_1 => x < x_1)) = lsub (typein fun x x_1 => x < x_1)
⊢ sup (typein fun x x_1 => x < x_1) = o
|
rw [← <a>Order.succ_eq_succ_iff</a>, h]
|
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : succ (sup (typein fun x x_1 => x < x_1)) = lsub (typein fun x x_1 => x < x_1)
⊢ lsub (typein fun x x_1 => x < x_1) = succ o
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/SetTheory/Ordinal/Arithmetic.lean
|
Ordinal.sup_typein_succ
|
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : succ (sup (typein fun x x_1 => x < x_1)) = lsub (typein fun x x_1 => x < x_1)
⊢ lsub (typein fun x x_1 => x < x_1) = succ o
|
apply <a>Ordinal.lsub_typein</a>
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/SetTheory/Ordinal/Arithmetic.lean
|
Ordinal.sup_typein_succ
|
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : sup (typein fun x x_1 => x < x_1) = lsub (typein fun x x_1 => x < x_1)
⊢ sup (typein fun x x_1 => x < x_1) = o
|
rw [<a>Ordinal.sup_eq_lsub_iff_succ</a>] at h
|
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : ∀ a < lsub (typein fun x x_1 => x < x_1), succ a < lsub (typein fun x x_1 => x < x_1)
⊢ sup (typein fun x x_1 => x < x_1) = o
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/SetTheory/Ordinal/Arithmetic.lean
|
Ordinal.sup_typein_succ
|
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : ∀ a < lsub (typein fun x x_1 => x < x_1), succ a < lsub (typein fun x x_1 => x < x_1)
⊢ sup (typein fun x x_1 => x < x_1) = o
|
simp only [<a>Ordinal.lsub_typein</a>] at h
|
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : ∀ a < succ o, succ a < succ o
⊢ sup (typein fun x x_1 => x < x_1) = o
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/SetTheory/Ordinal/Arithmetic.lean
|
Ordinal.sup_typein_succ
|
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u}
h : ∀ a < succ o, succ a < succ o
⊢ sup (typein fun x x_1 => x < x_1) = o
|
exact (h o (<a>Order.lt_succ</a> o)).false.elim
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/SetTheory/Ordinal/Arithmetic.lean
|
Polynomial.mul_eq_sum_sum
|
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ p * q = ∑ i ∈ p.support, q.sum fun j a => (monomial (i + j)) (p.coeff i * a)
|
apply <a>Polynomial.toFinsupp_injective</a>
|
case a
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ (p * q).toFinsupp = (∑ i ∈ p.support, q.sum fun j a => (monomial (i + j)) (p.coeff i * a)).toFinsupp
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Algebra/Polynomial/Basic.lean
|
Polynomial.mul_eq_sum_sum
|
case a
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
p q : R[X]
⊢ (p * q).toFinsupp = (∑ i ∈ p.support, q.sum fun j a => (monomial (i + j)) (p.coeff i * a)).toFinsupp
|
rcases p with ⟨⟩
|
case a.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : R[ℕ]
⊢ ({ toFinsupp := toFinsupp✝ } * q).toFinsupp =
(∑ i ∈ { toFinsupp := toFinsupp✝ }.support,
q.sum fun j a => (monomial (i + j)) ({ toFinsupp := toFinsupp✝ }.coeff i * a)).toFinsupp
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Algebra/Polynomial/Basic.lean
|
Polynomial.mul_eq_sum_sum
|
case a.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
q : R[X]
toFinsupp✝ : R[ℕ]
⊢ ({ toFinsupp := toFinsupp✝ } * q).toFinsupp =
(∑ i ∈ { toFinsupp := toFinsupp✝ }.support,
q.sum fun j a => (monomial (i + j)) ({ toFinsupp := toFinsupp✝ }.coeff i * a)).toFinsupp
|
rcases q with ⟨⟩
|
case a.ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
toFinsupp✝¹ toFinsupp✝ : R[ℕ]
⊢ ({ toFinsupp := toFinsupp✝¹ } * { toFinsupp := toFinsupp✝ }).toFinsupp =
(∑ i ∈ { toFinsupp := toFinsupp✝¹ }.support,
{ toFinsupp := toFinsupp✝ }.sum fun j a =>
(monomial (i + j)) ({ toFinsupp := toFinsupp✝¹ }.coeff i * a)).toFinsupp
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Algebra/Polynomial/Basic.lean
|
Polynomial.mul_eq_sum_sum
|
case a.ofFinsupp.ofFinsupp
R : Type u
a b : R
m n : ℕ
inst✝ : Semiring R
toFinsupp✝¹ toFinsupp✝ : R[ℕ]
⊢ ({ toFinsupp := toFinsupp✝¹ } * { toFinsupp := toFinsupp✝ }).toFinsupp =
(∑ i ∈ { toFinsupp := toFinsupp✝¹ }.support,
{ toFinsupp := toFinsupp✝ }.sum fun j a =>
(monomial (i + j)) ({ toFinsupp := toFinsupp✝¹ }.coeff i * a)).toFinsupp
|
simp_rw [<a>Polynomial.sum</a>, <a>Polynomial.coeff</a>, <a>Polynomial.toFinsupp_sum</a>, <a>Polynomial.support</a>, <a>Polynomial.toFinsupp_mul</a>, <a>Polynomial.toFinsupp_monomial</a>, <a>AddMonoidAlgebra.mul_def</a>, <a>Finsupp.sum</a>]
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Algebra/Polynomial/Basic.lean
|
Set.image_subtype_val_Ioc
|
α : Type u_1
β : Type u_2
inst✝² : Preorder α
inst✝¹ : Preorder β
s✝ t s : Set α
inst✝ : s.OrdConnected
x y : ↑s
⊢ (range ⇑(OrderEmbedding.subtype fun x => x ∈ s)).OrdConnected
|
simpa
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Order/Interval/Set/OrdConnected.lean
|
suffixLevenshtein_cons_cons_fst_get_zero
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (suffixLevenshtein C (x :: xs) (y :: ys)).val[0] =
match suffixLevenshtein C xs (y :: ys) with
| ⟨dx, property⟩ =>
match suffixLevenshtein C (x :: xs) ys with
| ⟨dy, property_1⟩ =>
match suffixLevenshtein C xs ys with
| ⟨dxy, property_2⟩ => min (C.delete x + dx[0]) (min (C.insert y + dy[0]) (C.substitute x y + dxy[0]))
|
conv => lhs dsimp only [<a>suffixLevenshtein_cons₂</a>]
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (impl C (x :: xs) y (suffixLevenshtein C (x :: xs) ys)).val[0] =
match suffixLevenshtein C xs (y :: ys) with
| ⟨dx, property⟩ =>
match suffixLevenshtein C (x :: xs) ys with
| ⟨dy, property_1⟩ =>
match suffixLevenshtein C xs ys with
| ⟨dxy, property_2⟩ => min (C.delete x + dx[0]) (min (C.insert y + dy[0]) (C.substitute x y + dxy[0]))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Data/List/EditDistance/Defs.lean
|
suffixLevenshtein_cons_cons_fst_get_zero
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (impl C (x :: xs) y (suffixLevenshtein C (x :: xs) ys)).val[0] =
match suffixLevenshtein C xs (y :: ys) with
| ⟨dx, property⟩ =>
match suffixLevenshtein C (x :: xs) ys with
| ⟨dy, property_1⟩ =>
match suffixLevenshtein C xs ys with
| ⟨dxy, property_2⟩ => min (C.delete x + dx[0]) (min (C.insert y + dy[0]) (C.substitute x y + dxy[0]))
|
simp only [<a>suffixLevenshtein_cons₁</a>]
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (impl C (x :: xs) y ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩).val[0] =
min (C.delete x + (suffixLevenshtein C xs (y :: ys)).val[0])
(min (C.insert y + (levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val)[0])
(C.substitute x y + (suffixLevenshtein C xs ys).val[0]))
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Data/List/EditDistance/Defs.lean
|
suffixLevenshtein_cons_cons_fst_get_zero
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (impl C (x :: xs) y ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩).val[0] =
min (C.delete x + (suffixLevenshtein C xs (y :: ys)).val[0])
(min (C.insert y + (levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val)[0])
(C.substitute x y + (suffixLevenshtein C xs ys).val[0]))
|
rw [<a>Levenshtein.impl_cons_fst_zero</a>]
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (match impl C xs y ⟨(suffixLevenshtein C xs ys).val, ?w'⟩ with
| ⟨r, w⟩ =>
min (C.delete x + r[0])
(min (C.insert y + levenshtein C (x :: xs) ys) (C.substitute x y + (suffixLevenshtein C xs ys).val[0]))) =
min (C.delete x + (suffixLevenshtein C xs (y :: ys)).val[0])
(min (C.insert y + (levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val)[0])
(C.substitute x y + (suffixLevenshtein C xs ys).val[0]))
case w'
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ 0 < (suffixLevenshtein C xs ys).val.length
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Data/List/EditDistance/Defs.lean
|
suffixLevenshtein_cons_cons_fst_get_zero
|
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ (match impl C xs y ⟨(suffixLevenshtein C xs ys).val, ?w'⟩ with
| ⟨r, w⟩ =>
min (C.delete x + r[0])
(min (C.insert y + levenshtein C (x :: xs) ys) (C.substitute x y + (suffixLevenshtein C xs ys).val[0]))) =
min (C.delete x + (suffixLevenshtein C xs (y :: ys)).val[0])
(min (C.insert y + (levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val)[0])
(C.substitute x y + (suffixLevenshtein C xs ys).val[0]))
case w'
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length
⊢ 0 < (suffixLevenshtein C xs ys).val.length
|
rfl
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Data/List/EditDistance/Defs.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
⊢ Tendsto (fun n => u n / ↑n) atTop (𝓝 l)
|
have lnonneg : 0 ≤ l := by rcases hlim 2 <a>one_lt_two</a> with ⟨c, _, ctop, clim⟩ have : <a>Filter.Tendsto</a> (fun n => u 0 / c n) <a>Filter.atTop</a> (𝓝 0) := tendsto_const_nhds.div_atTop (<a>tendsto_natCast_atTop_iff</a>.2 ctop) apply <a>le_of_tendsto_of_tendsto'</a> this clim fun n => ?_ gcongr exact hmono (<a>zero_le</a> _)
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
⊢ Tendsto (fun n => u n / ↑n) atTop (𝓝 l)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
A : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
⊢ Tendsto (fun n => u n / ↑n) atTop (𝓝 l)
|
have B : ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in <a>Filter.atTop</a>, (n : ℝ) * l - u n ≤ ε * (1 + l) * n := by intro ε εpos rcases hlim (1 + ε) ((<a>lt_add_iff_pos_right</a> _).2 εpos) with ⟨c, cgrowth, ctop, clim⟩ have L : ∀ᶠ n : ℕ in <a>Filter.atTop</a>, (c n : ℝ) * l - u (c n) ≤ ε * c n := by rw [← <a>tendsto_sub_nhds_zero_iff</a>, ← <a>Asymptotics.isLittleO_one_iff</a> ℝ, <a>Asymptotics.isLittleO_iff</a>] at clim filter_upwards [clim εpos, ctop (<a>Filter.Ioi_mem_atTop</a> 0)] with n hn cnpos' have cnpos : 0 < c n := cnpos' calc (c n : ℝ) * l - u (c n) = -(u (c n) / c n - l) * c n := by simp only [cnpos.ne', <a>Ne</a>, <a>Nat.cast_eq_zero</a>, <a>not_false_iff</a>, <a>neg_sub</a>, field_simps] _ ≤ ε * c n := by gcongr refine <a>le_trans</a> (<a>neg_le_abs</a> _) ?_ simpa using hn obtain ⟨a, ha⟩ : ∃ a : ℕ, ∀ b : ℕ, a ≤ b → (c (b + 1) : ℝ) ≤ (1 + ε) * c b ∧ (c b : ℝ) * l - u (c b) ≤ ε * c b := <a>Filter.eventually_atTop</a>.1 (cgrowth.and L) let M := ((<a>Finset.range</a> (a + 1)).<a>Finset.image</a> fun i => c i).<a>Finset.max'</a> (by simp) filter_upwards [<a>Filter.Ici_mem_atTop</a> M] with n hn have exN : ∃ N, n < c N := by rcases (<a>Filter.tendsto_atTop</a>.1 ctop (n + 1)).<a>Filter.Eventually.exists</a> with ⟨N, hN⟩ exact ⟨N, by linarith only [hN]⟩ let N := <a>Nat.find</a> exN have ncN : n < c N := <a>Nat.find_spec</a> exN have aN : a + 1 ≤ N := by by_contra! h have cNM : c N ≤ M := by apply <a>Finset.le_max'</a> apply <a>Finset.mem_image_of_mem</a> exact <a>Finset.mem_range</a>.2 h exact <a>lt_irrefl</a> _ ((cNM.trans hn).<a>LE.le.trans_lt</a> ncN) have Npos : 0 < N := <a>lt_of_lt_of_le</a> <a>Nat.succ_pos'</a> aN have aN' : a ≤ N - 1 := by apply @<a>Nat.le_of_add_le_add_right</a> a 1 (N - 1) rw [<a>Nat.sub_add_cancel</a> Npos] exact aN have cNn : c (N - 1) ≤ n := by have : N - 1 < N := <a>Nat.pred_lt</a> Npos.ne' simpa only [<a>not_lt</a>] using <a>Nat.find_min</a> exN this calc (n : ℝ) * l - u n ≤ c N * l - u (c (N - 1)) := by gcongr exact hmono cNn _ ≤ (1 + ε) * c (N - 1) * l - u (c (N - 1)) := by gcongr have B : N - 1 + 1 = N := <a>Nat.succ_pred_eq_of_pos</a> Npos simpa [B] using (ha _ aN').1 _ = c (N - 1) * l - u (c (N - 1)) + ε * c (N - 1) * l := by ring _ ≤ ε * c (N - 1) + ε * c (N - 1) * l := <a>add_le_add</a> (ha _ aN').2 <a>le_rfl</a> _ = ε * (1 + l) * c (N - 1) := by ring _ ≤ ε * (1 + l) * n := by gcongr
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
A : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
B : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, ↑n * l - u n ≤ ε * (1 + l) * ↑n
⊢ Tendsto (fun n => u n / ↑n) atTop (𝓝 l)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
A : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
B : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, ↑n * l - u n ≤ ε * (1 + l) * ↑n
⊢ Tendsto (fun n => u n / ↑n) atTop (𝓝 l)
|
refine <a>tendsto_order</a>.2 ⟨fun d hd => ?_, fun d hd => ?_⟩
|
case refine_1
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
A : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
B : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, ↑n * l - u n ≤ ε * (1 + l) * ↑n
d : ℝ
hd : d < l
⊢ ∀ᶠ (b : ℕ) in atTop, d < u b / ↑b
case refine_2
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
A : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
B : ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, ↑n * l - u n ≤ ε * (1 + l) * ↑n
d : ℝ
hd : d > l
⊢ ∀ᶠ (b : ℕ) in atTop, u b / ↑b < d
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
⊢ 0 ≤ l
|
rcases hlim 2 <a>one_lt_two</a> with ⟨c, _, ctop, clim⟩
|
case intro.intro.intro
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
⊢ 0 ≤ l
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
case intro.intro.intro
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
⊢ 0 ≤ l
|
have : <a>Filter.Tendsto</a> (fun n => u 0 / c n) <a>Filter.atTop</a> (𝓝 0) := tendsto_const_nhds.div_atTop (<a>tendsto_natCast_atTop_iff</a>.2 ctop)
|
case intro.intro.intro
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
this : Tendsto (fun n => u 0 / ↑(c n)) atTop (𝓝 0)
⊢ 0 ≤ l
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
case intro.intro.intro
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
this : Tendsto (fun n => u 0 / ↑(c n)) atTop (𝓝 0)
⊢ 0 ≤ l
|
apply <a>le_of_tendsto_of_tendsto'</a> this clim fun n => ?_
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
this : Tendsto (fun n => u 0 / ↑(c n)) atTop (𝓝 0)
n : ℕ
⊢ u 0 / ↑(c n) ≤ u (c n) / ↑(c n)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
this : Tendsto (fun n => u 0 / ↑(c n)) atTop (𝓝 0)
n : ℕ
⊢ u 0 / ↑(c n) ≤ u (c n) / ↑(c n)
|
gcongr
|
case hab
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
this : Tendsto (fun n => u 0 / ↑(c n)) atTop (𝓝 0)
n : ℕ
⊢ u 0 ≤ u (c n)
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
case hab
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
c : ℕ → ℕ
left✝ : ∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ 2 * ↑(c n)
ctop : Tendsto c atTop atTop
clim : Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
this : Tendsto (fun n => u 0 / ↑(c n)) atTop (𝓝 0)
n : ℕ
⊢ u 0 ≤ u (c n)
|
exact hmono (<a>zero_le</a> _)
|
no goals
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
tendsto_div_of_monotone_of_exists_subseq_tendsto_div
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
⊢ ∀ (ε : ℝ), 0 < ε → ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
|
intro ε εpos
|
u : ℕ → ℝ
l : ℝ
hmono : Monotone u
hlim :
∀ (a : ℝ),
1 < a →
∃ c,
(∀ᶠ (n : ℕ) in atTop, ↑(c (n + 1)) ≤ a * ↑(c n)) ∧
Tendsto c atTop atTop ∧ Tendsto (fun n => u (c n) / ↑(c n)) atTop (𝓝 l)
lnonneg : 0 ≤ l
ε : ℝ
εpos : 0 < ε
⊢ ∀ᶠ (n : ℕ) in atTop, u n - ↑n * l ≤ ε * (1 + ε + l) * ↑n
|
https://github.com/leanprover-community/mathlib4
|
29dcec074de168ac2bf835a77ef68bbe069194c5
|
Mathlib/Analysis/SpecificLimits/FloorPow.lean
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.