url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeSource_inj
[17, 1]
[21, 31]
case idx.idx => simpa [encodeSource] using λ hhd htl ↦ ⟨encodeSource_inj hhd, encodeSource_inj htl⟩
s₀ s₁ hd✝¹ tl✝¹ : Source h₀ : s₀ = Source.idx hd✝¹ tl✝¹ hd✝ tl✝ : Source h₁ : s₁ = Source.idx hd✝ tl✝ ⊢ encodeSource (Source.idx hd✝¹ tl✝¹) = encodeSource (Source.idx hd✝ tl✝) → Source.idx hd✝¹ tl✝¹ = Source.idx hd✝ tl✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeSource_inj
[17, 1]
[21, 31]
all_goals simp[encodeSource]
case nil.nil s₀ s₁ : Source h₀ : s₀ = Source.nil h₁ : s₁ = Source.nil ⊢ encodeSource Source.nil = encodeSource Source.nil → Source.nil = Source.nil case nil.imm s₀ s₁ : Source h₀ : s₀ = Source.nil hd✝ : Bool tl✝ : Source h₁ : s₁ = Source.imm hd✝ tl✝ ⊢ encodeSource Source.nil = encodeSource (Source.imm hd✝ tl✝) → Source.nil = Source.imm hd✝ tl✝ case nil.idx s₀ s₁ : Source h₀ : s₀ = Source.nil hd✝ tl✝ : Source h₁ : s₁ = Source.idx hd✝ tl✝ ⊢ encodeSource Source.nil = encodeSource (Source.idx hd✝ tl✝) → Source.nil = Source.idx hd✝ tl✝ case imm.nil s₀ s₁ : Source hd✝ : Bool tl✝ : Source h₀ : s₀ = Source.imm hd✝ tl✝ h₁ : s₁ = Source.nil ⊢ encodeSource (Source.imm hd✝ tl✝) = encodeSource Source.nil → Source.imm hd✝ tl✝ = Source.nil case imm.idx s₀ s₁ : Source hd✝¹ : Bool tl✝¹ : Source h₀ : s₀ = Source.imm hd✝¹ tl✝¹ hd✝ tl✝ : Source h₁ : s₁ = Source.idx hd✝ tl✝ ⊢ encodeSource (Source.imm hd✝¹ tl✝¹) = encodeSource (Source.idx hd✝ tl✝) → Source.imm hd✝¹ tl✝¹ = Source.idx hd✝ tl✝ case idx.nil s₀ s₁ hd✝ tl✝ : Source h₀ : s₀ = Source.idx hd✝ tl✝ h₁ : s₁ = Source.nil ⊢ encodeSource (Source.idx hd✝ tl✝) = encodeSource Source.nil → Source.idx hd✝ tl✝ = Source.nil case idx.imm s₀ s₁ hd✝¹ tl✝¹ : Source h₀ : s₀ = Source.idx hd✝¹ tl✝¹ hd✝ : Bool tl✝ : Source h₁ : s₁ = Source.imm hd✝ tl✝ ⊢ encodeSource (Source.idx hd✝¹ tl✝¹) = encodeSource (Source.imm hd✝ tl✝) → Source.idx hd✝¹ tl✝¹ = Source.imm hd✝ tl✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeSource_inj
[17, 1]
[21, 31]
simpa [encodeSource] using λ hhd htl ↦ ⟨hhd, encodeSource_inj htl⟩
s₀ s₁ : Source hd✝¹ : Bool tl✝¹ : Source h₀ : s₀ = Source.imm hd✝¹ tl✝¹ hd✝ : Bool tl✝ : Source h₁ : s₁ = Source.imm hd✝ tl✝ ⊢ encodeSource (Source.imm hd✝¹ tl✝¹) = encodeSource (Source.imm hd✝ tl✝) → Source.imm hd✝¹ tl✝¹ = Source.imm hd✝ tl✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeSource_inj
[17, 1]
[21, 31]
simpa [encodeSource] using λ hhd htl ↦ ⟨encodeSource_inj hhd, encodeSource_inj htl⟩
s₀ s₁ hd✝¹ tl✝¹ : Source h₀ : s₀ = Source.idx hd✝¹ tl✝¹ hd✝ tl✝ : Source h₁ : s₁ = Source.idx hd✝ tl✝ ⊢ encodeSource (Source.idx hd✝¹ tl✝¹) = encodeSource (Source.idx hd✝ tl✝) → Source.idx hd✝¹ tl✝¹ = Source.idx hd✝ tl✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeSource_inj
[17, 1]
[21, 31]
simp[encodeSource]
case idx.imm s₀ s₁ hd✝¹ tl✝¹ : Source h₀ : s₀ = Source.idx hd✝¹ tl✝¹ hd✝ : Bool tl✝ : Source h₁ : s₁ = Source.imm hd✝ tl✝ ⊢ encodeSource (Source.idx hd✝¹ tl✝¹) = encodeSource (Source.imm hd✝ tl✝) → Source.idx hd✝¹ tl✝¹ = Source.imm hd✝ tl✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
induction p₀ generalizing p₁ <;> cases p₁
p₀ p₁ : Program ⊢ encodeProgram p₀ = encodeProgram p₁ → p₀ = p₁
case exit.exit ⊢ encodeProgram Program.exit = encodeProgram Program.exit → Program.exit = Program.exit case exit.op inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram Program.exit = encodeProgram (Program.op inst✝ next✝) → Program.exit = Program.op inst✝ next✝ case exit.branch inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram Program.exit = encodeProgram (Program.branch inst✝ next✝) → Program.exit = Program.branch inst✝ next✝ case exit.subroutine dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram Program.exit = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.exit = Program.subroutine dst✝ src✝ func✝ next✝ case exit.recurse dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram Program.exit = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.exit = Program.recurse dst✝ src✝ next✝ case op.exit inst✝ : OpInstruction next✝ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝ = encodeProgram p₁ → next✝ = p₁ ⊢ encodeProgram (Program.op inst✝ next✝) = encodeProgram Program.exit → Program.op inst✝ next✝ = Program.exit case op.op inst✝¹ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.op inst✝¹ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.op inst✝¹ next✝¹ = Program.op inst✝ next✝ case op.branch inst✝¹ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.op inst✝¹ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.op inst✝¹ next✝¹ = Program.branch inst✝ next✝ case op.subroutine inst✝ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.op inst✝ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.op inst✝ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝ case op.recurse inst✝ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.op inst✝ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.op inst✝ next✝¹ = Program.recurse dst✝ src✝ next✝ case branch.exit inst✝ : BranchInstruction next✝ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝ a) = encodeProgram p₁ → next✝ a = p₁ ⊢ encodeProgram (Program.branch inst✝ next✝) = encodeProgram Program.exit → Program.branch inst✝ next✝ = Program.exit case branch.op inst✝¹ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.branch inst✝¹ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.branch inst✝¹ next✝¹ = Program.op inst✝ next✝ case branch.branch inst✝¹ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.branch inst✝¹ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.branch inst✝¹ next✝¹ = Program.branch inst✝ next✝ case branch.subroutine inst✝ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.branch inst✝ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.branch inst✝ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝ case branch.recurse inst✝ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.branch inst✝ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.branch inst✝ next✝¹ = Program.recurse dst✝ src✝ next✝ case subroutine.exit dst✝ src✝ : Source func✝ next✝ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝ = encodeProgram p₁ → next✝ = p₁ ⊢ encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) = encodeProgram Program.exit → Program.subroutine dst✝ src✝ func✝ next✝ = Program.exit case subroutine.op dst✝ src✝ : Source func✝ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.subroutine dst✝ src✝ func✝ next✝¹ = Program.op inst✝ next✝ case subroutine.branch dst✝ src✝ : Source func✝ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.subroutine dst✝ src✝ func✝ next✝¹ = Program.branch inst✝ next✝ case subroutine.subroutine dst✝¹ src✝¹ : Source func✝¹ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝¹ = encodeProgram p₁ → func✝¹ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝¹ src✝¹ func✝¹ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.subroutine dst✝¹ src✝¹ func✝¹ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝ case subroutine.recurse dst✝¹ src✝¹ : Source func✝ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝¹ src✝¹ func✝ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.subroutine dst✝¹ src✝¹ func✝ next✝¹ = Program.recurse dst✝ src✝ next✝ case recurse.exit dst✝ src✝ : Source next✝ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝ = encodeProgram p₁ → next✝ = p₁ ⊢ encodeProgram (Program.recurse dst✝ src✝ next✝) = encodeProgram Program.exit → Program.recurse dst✝ src✝ next✝ = Program.exit case recurse.op dst✝ src✝ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.recurse dst✝ src✝ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.recurse dst✝ src✝ next✝¹ = Program.op inst✝ next✝ case recurse.branch dst✝ src✝ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.recurse dst✝ src✝ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.recurse dst✝ src✝ next✝¹ = Program.branch inst✝ next✝ case recurse.subroutine dst✝¹ src✝¹ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.recurse dst✝¹ src✝¹ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.recurse dst✝¹ src✝¹ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝ case recurse.recurse dst✝¹ src✝¹ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.recurse dst✝¹ src✝¹ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.recurse dst✝¹ src✝¹ next✝¹ = Program.recurse dst✝ src✝ next✝
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
case op.op ih _ _ => simpa [encodeProgram] using λ x y ↦ ⟨x, ih y⟩
inst✝¹ : OpInstruction next✝¹ : Program ih : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.op inst✝¹ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.op inst✝¹ next✝¹ = Program.op inst✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
case branch.branch nih _ _ => simpa [encodeProgram] using λ hop hf ht ↦ ⟨ hop, funext λ | false => nih _ hf | true => nih _ ht ⟩
inst✝¹ : BranchInstruction next✝¹ : Bool → Program nih : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.branch inst✝¹ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.branch inst✝¹ next✝¹ = Program.branch inst✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
case subroutine.subroutine fih nih _ _ _ _ => simpa [encodeProgram] using λ hdst hsrc hfunc hnext ↦ ⟨ hdst, hsrc, fih hfunc, nih hnext ⟩
dst✝¹ src✝¹ : Source func✝¹ next✝¹ : Program fih : ∀ {p₁ : Program}, encodeProgram func✝¹ = encodeProgram p₁ → func✝¹ = p₁ nih : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝¹ src✝¹ func✝¹ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.subroutine dst✝¹ src✝¹ func✝¹ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
case recurse.recurse ih _ _ _ => simpa [encodeProgram] using λ hdst hsrc hnext ↦ ⟨hdst, hsrc, ih hnext⟩
dst✝¹ src✝¹ : Source next✝¹ : Program ih : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.recurse dst✝¹ src✝¹ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.recurse dst✝¹ src✝¹ next✝¹ = Program.recurse dst✝ src✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
all_goals simp [encodeProgram]
case exit.exit ⊢ encodeProgram Program.exit = encodeProgram Program.exit → Program.exit = Program.exit case exit.op inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram Program.exit = encodeProgram (Program.op inst✝ next✝) → Program.exit = Program.op inst✝ next✝ case exit.branch inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram Program.exit = encodeProgram (Program.branch inst✝ next✝) → Program.exit = Program.branch inst✝ next✝ case exit.subroutine dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram Program.exit = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.exit = Program.subroutine dst✝ src✝ func✝ next✝ case exit.recurse dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram Program.exit = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.exit = Program.recurse dst✝ src✝ next✝ case op.exit inst✝ : OpInstruction next✝ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝ = encodeProgram p₁ → next✝ = p₁ ⊢ encodeProgram (Program.op inst✝ next✝) = encodeProgram Program.exit → Program.op inst✝ next✝ = Program.exit case op.branch inst✝¹ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.op inst✝¹ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.op inst✝¹ next✝¹ = Program.branch inst✝ next✝ case op.subroutine inst✝ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.op inst✝ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.op inst✝ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝ case op.recurse inst✝ : OpInstruction next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.op inst✝ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.op inst✝ next✝¹ = Program.recurse dst✝ src✝ next✝ case branch.exit inst✝ : BranchInstruction next✝ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝ a) = encodeProgram p₁ → next✝ a = p₁ ⊢ encodeProgram (Program.branch inst✝ next✝) = encodeProgram Program.exit → Program.branch inst✝ next✝ = Program.exit case branch.op inst✝¹ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.branch inst✝¹ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.branch inst✝¹ next✝¹ = Program.op inst✝ next✝ case branch.subroutine inst✝ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.branch inst✝ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.branch inst✝ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝ case branch.recurse inst✝ : BranchInstruction next✝¹ : Bool → Program next_ih✝ : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.branch inst✝ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.branch inst✝ next✝¹ = Program.recurse dst✝ src✝ next✝ case subroutine.exit dst✝ src✝ : Source func✝ next✝ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝ = encodeProgram p₁ → next✝ = p₁ ⊢ encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) = encodeProgram Program.exit → Program.subroutine dst✝ src✝ func✝ next✝ = Program.exit case subroutine.op dst✝ src✝ : Source func✝ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.subroutine dst✝ src✝ func✝ next✝¹ = Program.op inst✝ next✝ case subroutine.branch dst✝ src✝ : Source func✝ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.subroutine dst✝ src✝ func✝ next✝¹ = Program.branch inst✝ next✝ case subroutine.recurse dst✝¹ src✝¹ : Source func✝ next✝¹ : Program func_ih✝ : ∀ {p₁ : Program}, encodeProgram func✝ = encodeProgram p₁ → func✝ = p₁ next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝¹ src✝¹ func✝ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.subroutine dst✝¹ src✝¹ func✝ next✝¹ = Program.recurse dst✝ src✝ next✝ case recurse.exit dst✝ src✝ : Source next✝ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝ = encodeProgram p₁ → next✝ = p₁ ⊢ encodeProgram (Program.recurse dst✝ src✝ next✝) = encodeProgram Program.exit → Program.recurse dst✝ src✝ next✝ = Program.exit case recurse.op dst✝ src✝ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.recurse dst✝ src✝ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.recurse dst✝ src✝ next✝¹ = Program.op inst✝ next✝ case recurse.branch dst✝ src✝ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.recurse dst✝ src✝ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.recurse dst✝ src✝ next✝¹ = Program.branch inst✝ next✝ case recurse.subroutine dst✝¹ src✝¹ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.recurse dst✝¹ src✝¹ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.recurse dst✝¹ src✝¹ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
simpa [encodeProgram] using λ x y ↦ ⟨x, ih y⟩
inst✝¹ : OpInstruction next✝¹ : Program ih : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ inst✝ : OpInstruction next✝ : Program ⊢ encodeProgram (Program.op inst✝¹ next✝¹) = encodeProgram (Program.op inst✝ next✝) → Program.op inst✝¹ next✝¹ = Program.op inst✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
simpa [encodeProgram] using λ hop hf ht ↦ ⟨ hop, funext λ | false => nih _ hf | true => nih _ ht ⟩
inst✝¹ : BranchInstruction next✝¹ : Bool → Program nih : ∀ (a : Bool) {p₁ : Program}, encodeProgram (next✝¹ a) = encodeProgram p₁ → next✝¹ a = p₁ inst✝ : BranchInstruction next✝ : Bool → Program ⊢ encodeProgram (Program.branch inst✝¹ next✝¹) = encodeProgram (Program.branch inst✝ next✝) → Program.branch inst✝¹ next✝¹ = Program.branch inst✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
simpa [encodeProgram] using λ hdst hsrc hfunc hnext ↦ ⟨ hdst, hsrc, fih hfunc, nih hnext ⟩
dst✝¹ src✝¹ : Source func✝¹ next✝¹ : Program fih : ∀ {p₁ : Program}, encodeProgram func✝¹ = encodeProgram p₁ → func✝¹ = p₁ nih : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.subroutine dst✝¹ src✝¹ func✝¹ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.subroutine dst✝¹ src✝¹ func✝¹ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
simpa [encodeProgram] using λ hdst hsrc hnext ↦ ⟨hdst, hsrc, ih hnext⟩
dst✝¹ src✝¹ : Source next✝¹ : Program ih : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source next✝ : Program ⊢ encodeProgram (Program.recurse dst✝¹ src✝¹ next✝¹) = encodeProgram (Program.recurse dst✝ src✝ next✝) → Program.recurse dst✝¹ src✝¹ next✝¹ = Program.recurse dst✝ src✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Encoding/Emulator.lean
HMem.Encoding.encodeProgram_inj
[64, 1]
[74, 33]
simp [encodeProgram]
case recurse.subroutine dst✝¹ src✝¹ : Source next✝¹ : Program next_ih✝ : ∀ {p₁ : Program}, encodeProgram next✝¹ = encodeProgram p₁ → next✝¹ = p₁ dst✝ src✝ : Source func✝ next✝ : Program ⊢ encodeProgram (Program.recurse dst✝¹ src✝¹ next✝¹) = encodeProgram (Program.subroutine dst✝ src✝ func✝ next✝) → Program.recurse dst✝¹ src✝¹ next✝¹ = Program.subroutine dst✝ src✝ func✝ next✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.toNatHelper_acc
[253, 1]
[258, 59]
simpa [toNatHelper, bound_zero] using Nat.add_comm _ _
val✝ : Fin 2 x✝ : ℕ ⊢ toNatHelper [] (bit val✝) x✝ = bound [] * x✝ + toNatHelper [] (bit val✝) 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.toNatHelper_acc
[253, 1]
[258, 59]
simp [bound_cons, toNatHelper, toNatHelper_acc H _ x, toNatHelper_acc H _ (_ + _), toNatHelper_acc H _ (toNatHelper _ _ _), left_distrib, right_distrib, ← mul_assoc, ← add_assoc]
H : List Unit left✝ right✝ : BitTree lhs✝ : Perfect H left✝ rhs✝ : Perfect H right✝ x : ℕ ⊢ toNatHelper (() :: H) (node left✝ right✝) x = bound (() :: H) * x + toNatHelper (() :: H) (node left✝ right✝) 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.addWithCarry_eq_ofNat_add
[394, 1]
[412, 72]
simp [addWithCarry, toNat, toNatHelper, bound_zero]
val✝¹ val✝ x✝ : Fin 2 ⊢ addWithCarry (bit val✝¹) (bit val✝) x✝ = ({ val := (toNat [] (bit val✝¹) + toNat [] (bit val✝) + ↑x✝) / bound [], isLt := (_ : (toNat [] (bit val✝¹) + toNat [] (bit val✝) + ↑x✝) / bound [] < 2) }, ofNat [] (toNat [] (bit val✝¹) + toNat [] (bit val✝) + ↑x✝))
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.addWithCarry_eq_ofNat_add
[394, 1]
[412, 72]
intro _ _ _ _ _ _
H : List Unit l✝¹ r✝¹ : BitTree lhs✝¹ : Perfect H l✝¹ rhs✝¹ : Perfect H r✝¹ l✝ r✝ : BitTree lhs✝ : Perfect H l✝ rhs✝ : Perfect H r✝ x✝ : Fin 2 ⊢ ∀ {m xh xl yh yl c : ℕ}, m * xh + xl + (m * yh + yl) + c = m * (xh + yh) + (xl + yl + c)
H : List Unit l✝¹ r✝¹ : BitTree lhs✝¹ : Perfect H l✝¹ rhs✝¹ : Perfect H r✝¹ l✝ r✝ : BitTree lhs✝ : Perfect H l✝ rhs✝ : Perfect H r✝ x✝ : Fin 2 m✝ xh✝ xl✝ yh✝ yl✝ c✝ : ℕ ⊢ m✝ * xh✝ + xl✝ + (m✝ * yh✝ + yl✝) + c✝ = m✝ * (xh✝ + yh✝) + (xl✝ + yl✝ + c✝)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.addWithCarry_eq_ofNat_add
[394, 1]
[412, 72]
ring
H : List Unit l✝¹ r✝¹ : BitTree lhs✝¹ : Perfect H l✝¹ rhs✝¹ : Perfect H r✝¹ l✝ r✝ : BitTree lhs✝ : Perfect H l✝ rhs✝ : Perfect H r✝ x✝ : Fin 2 m✝ xh✝ xl✝ yh✝ yl✝ c✝ : ℕ ⊢ m✝ * xh✝ + xl✝ + (m✝ * yh✝ + yl✝) + c✝ = m✝ * (xh✝ + yh✝) + (xl✝ + yl✝ + c✝)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.addWithCarry_eq_ofNat_add
[394, 1]
[412, 72]
simp [addWithCarry, @addWithCarry_eq_ofNat_add H, rearrange, toNat_node, bound_cons, ← Nat.div_div_eq_div_mul, Nat.mul_add_div (bound_pos _), divBound]
H : List Unit l✝¹ r✝¹ : BitTree lhs✝¹ : Perfect H l✝¹ rhs✝¹ : Perfect H r✝¹ l✝ r✝ : BitTree lhs✝ : Perfect H l✝ rhs✝ : Perfect H r✝ x✝ : Fin 2 rearrange : ∀ {m xh xl yh yl c : ℕ}, m * xh + xl + (m * yh + yl) + c = m * (xh + yh) + (xl + yl + c) ⊢ addWithCarry (node l✝¹ r✝¹) (node l✝ r✝) x✝ = ({ val := (toNat (() :: H) (node l✝¹ r✝¹) + toNat (() :: H) (node l✝ r✝) + ↑x✝) / bound (() :: H), isLt := (_ : (toNat (() :: H) (node l✝¹ r✝¹) + toNat (() :: H) (node l✝ r✝) + ↑x✝) / bound (() :: H) < 2) }, ofNat (() :: H) (toNat (() :: H) (node l✝¹ r✝¹) + toNat (() :: H) (node l✝ r✝) + ↑x✝))
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.addWithCarry_negate
[436, 1]
[439, 78]
simp [addWithCarry, addWithCarry_negate (H := H)]
H : List Unit l✝ r✝ : BitTree lhs✝ : Perfect H l✝ rhs✝ : Perfect H r✝ ⊢ addWithCarry (node l✝ r✝) (negate (node l✝ r✝)) 1 = (1, ofNat (() :: H) 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.add_toNat_negate
[441, 1]
[448, 111]
intro _ _ _ _ _ _
H✝ : List Unit l✝ r✝ : BitTree lhs✝ : Perfect H✝ l✝ rhs✝ : Perfect H✝ r✝ ⊢ ∀ {m a b c d e : ℕ}, m * a + b + (m * c + d) + e = m * (a + c) + (b + d + e)
H✝ : List Unit l✝ r✝ : BitTree lhs✝ : Perfect H✝ l✝ rhs✝ : Perfect H✝ r✝ m✝ a✝ b✝ c✝ d✝ e✝ : ℕ ⊢ m✝ * a✝ + b✝ + (m✝ * c✝ + d✝) + e✝ = m✝ * (a✝ + c✝) + (b✝ + d✝ + e✝)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.add_toNat_negate
[441, 1]
[448, 111]
ring
H✝ : List Unit l✝ r✝ : BitTree lhs✝ : Perfect H✝ l✝ rhs✝ : Perfect H✝ r✝ m✝ a✝ b✝ c✝ d✝ e✝ : ℕ ⊢ m✝ * a✝ + b✝ + (m✝ * c✝ + d✝) + e✝ = m✝ * (a✝ + c✝) + (b✝ + d✝ + e✝)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.add_toNat_negate
[441, 1]
[448, 111]
simp [toNat_node, rearrange, negate, add_toNat_negate _, ← Nat.mul_succ, Nat.succ_eq_add_one, bound_cons]
H✝ : List Unit l✝ r✝ : BitTree lhs✝ : Perfect H✝ l✝ rhs✝ : Perfect H✝ r✝ rearrange : ∀ {m a b c d e : ℕ}, m * a + b + (m * c + d) + e = m * (a + c) + (b + d + e) ⊢ toNat (() :: H✝) (node l✝ r✝) + toNat (() :: H✝) (negate (node l✝ r✝)) + 1 = bound (() :: H✝)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.sub_toNat
[492, 1]
[496, 68]
intro _ _ _ _
H : List Unit x y : BitTree inst✝¹ : Perfect H x inst✝ : Perfect H y ⊢ ∀ {a b c d : ℕ}, a + b + c + d = a + (d + b + c)
H : List Unit x y : BitTree inst✝¹ : Perfect H x inst✝ : Perfect H y a✝ b✝ c✝ d✝ : ℕ ⊢ a✝ + b✝ + c✝ + d✝ = a✝ + (d✝ + b✝ + c✝)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.sub_toNat
[492, 1]
[496, 68]
ring
H : List Unit x y : BitTree inst✝¹ : Perfect H x inst✝ : Perfect H y a✝ b✝ c✝ d✝ : ℕ ⊢ a✝ + b✝ + c✝ + d✝ = a✝ + (d✝ + b✝ + c✝)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.lshift2_toNat
[506, 1]
[513, 27]
simp only [ toNat_node, lo, hi, lshift2, bound_cons, left_distrib, right_distrib, ← mul_assoc, mul_right_comm _ _ (bound H), mul_comm (toNat _ _) (bound H), Nat.add_assoc, Nat.mul_add_mod, toNat_zero, add_zero]
H : List Unit left✝¹ right✝¹ left✝ right✝ : BitTree lhs✝¹ : Perfect H left✝¹ rhs✝¹ : Perfect H right✝¹ lhs✝ : Perfect H left✝ rhs✝ : Perfect H right✝ ⊢ toNat (() :: () :: H) (lshift2 H (node (node left✝¹ right✝¹) (node left✝ right✝))) % bound (() :: () :: H) = toNat (() :: () :: H) (node (node left✝¹ right✝¹) (node left✝ right✝)) * bound H % bound (() :: () :: H)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₃_toNat
[524, 1]
[557, 63]
have h₀: ∀ {x y: Fin 2} {H: List Unit}, x.val * y.val % (bound H * bound H) = x.val * y.val := Nat.mod_eq_of_lt (Nat.mul_lt_mul_for_real (lt_of_lt_of_le (Fin.isLt _) (two_le_bound _)) (lt_of_lt_of_le (Fin.isLt _) (two_le_bound _)))
H : List Unit xy : BitTree xc : Fin 2 x : BitTree yc : Fin 2 y : BitTree x✝² : Perfect (() :: H) xy x✝¹ : Perfect H (xc, x).2 x✝ : Perfect H (yc, y).2 h : toNat (() :: H) xy = toNat H (xc, x).2 * toNat H (yc, y).2 ⊢ toNat (() :: () :: H) (karatsubaHelper₃ H xy (xc, x) (yc, y)) = (bound H * ↑(xc, x).1 + toNat H (xc, x).2) * (bound H * ↑(yc, y).1 + toNat H (yc, y).2)
H : List Unit xy : BitTree xc : Fin 2 x : BitTree yc : Fin 2 y : BitTree x✝² : Perfect (() :: H) xy x✝¹ : Perfect H (xc, x).2 x✝ : Perfect H (yc, y).2 h : toNat (() :: H) xy = toNat H (xc, x).2 * toNat H (yc, y).2 h₀ : ∀ {x y : Fin 2} {H : List Unit}, ↑x * ↑y % (bound H * bound H) = ↑x * ↑y ⊢ toNat (() :: () :: H) (karatsubaHelper₃ H xy (xc, x) (yc, y)) = (bound H * ↑(xc, x).1 + toNat H (xc, x).2) * (bound H * ↑(yc, y).1 + toNat H (yc, y).2)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₃_toNat
[524, 1]
[557, 63]
have h₁: ∀ {x: Fin 2} {H: List Unit} {y: BitTree} [Perfect H y], x.val * y.toNat H % bound H = x.val * y.toNat H | 0, _, _, _ => Nat.mod_eq_of_lt (lt_of_eq_of_lt (zero_mul _) (bound_pos _)) | 1, _, _, _ => Nat.mod_eq_of_lt (lt_of_eq_of_lt (one_mul _) (toNat_lt _))
H : List Unit xy : BitTree xc : Fin 2 x : BitTree yc : Fin 2 y : BitTree x✝² : Perfect (() :: H) xy x✝¹ : Perfect H (xc, x).2 x✝ : Perfect H (yc, y).2 h : toNat (() :: H) xy = toNat H (xc, x).2 * toNat H (yc, y).2 h₀ : ∀ {x y : Fin 2} {H : List Unit}, ↑x * ↑y % (bound H * bound H) = ↑x * ↑y ⊢ toNat (() :: () :: H) (karatsubaHelper₃ H xy (xc, x) (yc, y)) = (bound H * ↑(xc, x).1 + toNat H (xc, x).2) * (bound H * ↑(yc, y).1 + toNat H (yc, y).2)
H : List Unit xy : BitTree xc : Fin 2 x : BitTree yc : Fin 2 y : BitTree x✝² : Perfect (() :: H) xy x✝¹ : Perfect H (xc, x).2 x✝ : Perfect H (yc, y).2 h : toNat (() :: H) xy = toNat H (xc, x).2 * toNat H (yc, y).2 h₀ : ∀ {x y : Fin 2} {H : List Unit}, ↑x * ↑y % (bound H * bound H) = ↑x * ↑y h₁ : ∀ {x : Fin 2} {H : List Unit} {y : BitTree} [inst : Perfect H y], ↑x * toNat H y % bound H = ↑x * toNat H y ⊢ toNat (() :: () :: H) (karatsubaHelper₃ H xy (xc, x) (yc, y)) = (bound H * ↑(xc, x).1 + toNat H (xc, x).2) * (bound H * ↑(yc, y).1 + toNat H (yc, y).2)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₃_toNat
[524, 1]
[557, 63]
simpa only [karatsubaHelper₃, add_toNat (()::()::H), mulBit_ofNat, mulBit'_ofNat, bound_cons, ← mul_assoc, mul_zero, mul_right_comm _ _ (bound H), mul_right_comm _ (toNat _ _) (Fin.val _), mul_comm (toNat _ _) (bound H), Nat.add_right_comm _ (_ * toNat H y) (_ * toNat H x), Nat.add_right_comm _ (toNat _ _ * toNat _ _), left_distrib, right_distrib, toNat_ofNat, toNat_node, h, toNat_zero, add_zero, zero_add, Nat.mod_add_mod, ← Nat.add_assoc, h₀, h₁] using Nat.mod_eq_of_lt (lt_of_eq_of_lt (Nat.add_assoc _ _ _) (add_lt_mul_bound (add_le_mul_bound (le_trans (mul_le_of_le_one_right' (Nat.le_of_lt_succ (Fin.isLt _))) (mul_le_of_le_one_right' (Nat.le_of_lt_succ (Fin.isLt _)))) (Nat.mul_le_mul (mul_le_of_le_one_right' (Nat.le_of_lt_succ (Fin.isLt _))) (le_of_lt (toNat_lt _)))) (add_lt_mul_bound (Nat.mul_le_mul (mul_le_of_le_one_right' (Nat.le_of_lt_succ (Fin.isLt _))) (le_of_lt (toNat_lt _))) (Nat.mul_lt_mul_for_real (toNat_lt _) (toNat_lt _)))))
H : List Unit xy : BitTree xc : Fin 2 x : BitTree yc : Fin 2 y : BitTree x✝² : Perfect (() :: H) xy x✝¹ : Perfect H (xc, x).2 x✝ : Perfect H (yc, y).2 h : toNat (() :: H) xy = toNat H (xc, x).2 * toNat H (yc, y).2 h₀ : ∀ {x y : Fin 2} {H : List Unit}, ↑x * ↑y % (bound H * bound H) = ↑x * ↑y h₁ : ∀ {x : Fin 2} {H : List Unit} {y : BitTree} [inst : Perfect H y], ↑x * toNat H y % bound H = ↑x * toNat H y ⊢ toNat (() :: () :: H) (karatsubaHelper₃ H xy (xc, x) (yc, y)) = (bound H * ↑(xc, x).1 + toNat H (xc, x).2) * (bound H * ↑(yc, y).1 + toNat H (yc, y).2)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₁_toNat
[563, 1]
[609, 39]
intro h₀ h₂ h₃
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ ⊢ toNat (() :: H) z₀ = toNat H xlo * toNat H ylo → toNat (() :: H) z₂ = toNat H xhi * toNat H yhi → toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) → toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₁_toNat
[563, 1]
[609, 39]
have h: ∀ {H: List Unit} {a b c d e f: BitTree} [Perfect H a] [Perfect H a] [Perfect H b] [Perfect H c] [Perfect H d] [Perfect H e] [Perfect H f], (a.toNat H * b.toNat H + c.toNat H * d.toNat H + e.toNat H * f.toNat H) % (bound H * bound H * bound H * bound H) = a.toNat H * b.toNat H + c.toNat H * d.toNat H + e.toNat H * f.toNat H := Nat.mod_eq_of_lt (add_lt_mul_bound (add_le_mul_bound (Nat.mul_le_mul (le_of_lt (toNat_lt _)) (le_of_lt (toNat_lt _))) (Nat.mul_le_mul (le_of_lt (toNat_lt _)) (le_of_lt (toNat_lt _)))) (add_lt_mul_bound (Nat.mul_le_mul (le_of_lt (toNat_lt _)) (le_of_lt (toNat_lt _))) (Nat.mul_lt_mul_for_real (bound_pos _) (bound_pos _))))
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) h : ∀ {H : List Unit} {a b c d e f : BitTree} [inst : Perfect H a] [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d] [inst : Perfect H e] [inst : Perfect H f], (toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₁_toNat
[563, 1]
[609, 39]
have h': ∀ {H: List Unit} {a b c d: BitTree} [Perfect H a] [Perfect H b] [Perfect H c] [Perfect H d], (a.toNat H * b.toNat H + c.toNat H * d.toNat H) % (bound H * bound H * bound H * bound H) = a.toNat H * b.toNat H + c.toNat H * d.toNat H := (congrArg₂ _ (congrArg _ (congrArg₂ _ toNat_zero.symm toNat_zero.symm)) rfl).trans (h.trans (congrArg _ (congrArg₂ _ toNat_zero toNat_zero)))
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) h : ∀ {H : List Unit} {a b c d e f : BitTree} [inst : Perfect H a] [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d] [inst : Perfect H e] [inst : Perfect H f], (toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) h : ∀ {H : List Unit} {a b c d e f : BitTree} [inst : Perfect H a] [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d] [inst : Perfect H e] [inst : Perfect H f], (toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f h' : ∀ {H : List Unit} {a b c d : BitTree} [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d], (toNat H a * toNat H b + toNat H c * toNat H d) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₁_toNat
[563, 1]
[609, 39]
have hs: ∀ {a b c: ℕ}, a + b + c - b = a + c := (congrArg₂ _ (Nat.add_right_comm _ _ _) rfl).trans (Nat.add_sub_cancel _ _)
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) h : ∀ {H : List Unit} {a b c d e f : BitTree} [inst : Perfect H a] [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d] [inst : Perfect H e] [inst : Perfect H f], (toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f h' : ∀ {H : List Unit} {a b c d : BitTree} [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d], (toNat H a * toNat H b + toNat H c * toNat H d) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) h : ∀ {H : List Unit} {a b c d e f : BitTree} [inst : Perfect H a] [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d] [inst : Perfect H e] [inst : Perfect H f], (toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f h' : ∀ {H : List Unit} {a b c d : BitTree} [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d], (toNat H a * toNat H b + toNat H c * toNat H d) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d hs : ∀ {a b c : ℕ}, a + b + c - b = a + c ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsubaHelper₁_toNat
[563, 1]
[609, 39]
simpa only [karatsubaHelper₁, sub_toNat (()::()::H), h₃, left_distrib, right_distrib, add_comm (xhi.toNat _ * yhi.toNat _), ← add_assoc, add_right_comm _ (xhi.toNat _ * yhi.toNat _), bound_cons, ← mul_assoc, toNat_node, toNat_zero, mul_zero, h₂, zero_add, add_tsub_cancel_right, toNat_ofNat, Nat.add_mod_right, h, h₀, hs, h'] using Nat.add_comm _ _
H : List Unit xhi xlo yhi ylo : BitTree inst✝⁶ : Perfect H xhi inst✝⁵ : Perfect H xlo inst✝⁴ : Perfect H yhi inst✝³ : Perfect H ylo z₀ z₂ z₃ : BitTree inst✝² : Perfect (() :: H) z₀ inst✝¹ : Perfect (() :: H) z₂ inst✝ : Perfect (() :: () :: H) z₃ h₀ : toNat (() :: H) z₀ = toNat H xlo * toNat H ylo h₂ : toNat (() :: H) z₂ = toNat H xhi * toNat H yhi h₃ : toNat (() :: () :: H) z₃ = (toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo) h : ∀ {H : List Unit} {a b c d e f : BitTree} [inst : Perfect H a] [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d] [inst : Perfect H e] [inst : Perfect H f], (toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d + toNat H e * toNat H f h' : ∀ {H : List Unit} {a b c d : BitTree} [inst : Perfect H a] [inst : Perfect H b] [inst : Perfect H c] [inst : Perfect H d], (toNat H a * toNat H b + toNat H c * toNat H d) % (bound H * bound H * bound H * bound H) = toNat H a * toNat H b + toNat H c * toNat H d hs : ∀ {a b c : ℕ}, a + b + c - b = a + c ⊢ toNat (() :: () :: H) (karatsubaHelper₁ (() :: H) z₀ z₂ z₃) = toNat H xhi * toNat H ylo + toNat H xlo * toNat H yhi
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
have h: ∀ {H: List Unit} {x y: BitTree} [Perfect H x] [Perfect H y], x.toNat H * y.toNat H % (bound (()::H)) = x.toNat H * y.toNat H := Nat.mod_eq_of_lt (lt_of_lt_of_eq (Nat.mul_lt_mul_for_real (toNat_lt _) (toNat_lt _)) (bound_cons _).symm)
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
have karatsuba_toNat: ∀ {x y} [Perfect H x] [Perfect H y], toNat (()::H) (karatsuba H x y) = x.toNat H * y.toNat H := (congrArg _ (karatsuba_eq_mul _ _ _)).trans ((toNat_ofNat _ _).trans h)
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
have h₃: (karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0)) = ofNat (()::()::H) ((xhi.toNat H + xlo.toNat H) * (yhi.toNat H + ylo.toNat H)) := toNat_inj (H := (()::()::H)) (((karatsubaHelper₃_toNat _ _ _ karatsuba_toNat).trans (congrArg₂ _ (addWithCarry_eq_add₀ _ _) (addWithCarry_eq_add₀ _ _))).trans (toNat_ofNat_lt (mul_lt_bound_cons (add_lt_bound_cons (toNat_lt _) (toNat_lt _)) (add_lt_bound_cons (toNat_lt _) (toNat_lt _)))).symm)
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
have h₁: (karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)))) = ofNat (()::()::H) (xlo.toNat H * yhi.toNat H + xhi.toNat H * ylo.toNat H) := toNat_inj (H := (()::()::H)) (((karatsubaHelper₁_toNat xhi xlo yhi ylo _ _ _ karatsuba_toNat karatsuba_toNat (toNat_ofNat_lt (mul_lt_bound_cons (add_lt_bound_cons (toNat_lt _) (toNat_lt _)) (add_lt_bound_cons (toNat_lt _) (toNat_lt _))))).trans (add_comm _ _)).trans (toNat_ofNat_lt (add_lt_bound_cons (mul_lt_bound_cons (toNat_lt _) (toNat_lt _)) (mul_lt_bound_cons (toNat_lt _) (toNat_lt _)))).symm)
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
simp only [karatsuba, h₃, h₁, mkPerfect_id, hi, lo]
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ karatsuba (() :: H) (node xhi xlo) (node yhi ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) + node (zero (() :: H)) (karatsuba H xlo ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Eq.trans
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) + node (zero (() :: H)) (karatsuba H xlo ylo) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
case h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) + node (zero (() :: H)) (karatsuba H xlo ylo) = ?b case h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?b = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)) case b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply add_toNat (()::()::H)
case h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) + node (zero (() :: H)) (karatsuba H xlo ylo) = ?b case h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?b = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)) case b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree
case h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo))) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg
case h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo))) = ofNat (() :: () :: H) (toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo))
case h₂.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Eq.trans
case h₂.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.b case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.b = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) case h₂.h.b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg₂
case h₂.h.h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.b case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.b = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) case h₂.h.b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ
case h₂.h.h₁.hx H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) = ?h₂.h.h₁.x' case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.x' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₁.x' + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg
case h₂.h.h₁.hx H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) = ?h₂.h.h₁.x' case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.x' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₁.x' + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁.hx.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) = ?h₂.h.h₁.hx.a₂ case h₂.h.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) ?h₂.h.h₁.hx.a₂ + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Eq.trans
case h₂.h.h₁.hx.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) = ?h₂.h.h₁.hx.a₂ case h₂.h.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) ?h₂.h.h₁.hx.a₂ + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁.hx.h.h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) = ?h₂.h.h₁.hx.h.b case h₂.h.h₁.hx.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₁.hx.h.b = ?h₂.h.h₁.hx.a₂ case h₂.h.h₁.hx.h.b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) ?h₂.h.h₁.hx.a₂ + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply add_toNat (()::()::H)
case h₂.h.h₁.hx.h.h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ node (karatsuba H xhi yhi) (zero (() :: H)) + lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) = ?h₂.h.h₁.hx.h.b case h₂.h.h₁.hx.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₁.hx.h.b = ?h₂.h.h₁.hx.a₂ case h₂.h.h₁.hx.h.b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) ?h₂.h.h₁.hx.a₂ + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁.hx.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)))) = ?h₂.h.h₁.hx.a₂ case h₂.h.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) ?h₂.h.h₁.hx.a₂ + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg
case h₂.h.h₁.hx.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)))) = ?h₂.h.h₁.hx.a₂ case h₂.h.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ BitTree case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) ?h₂.h.h₁.hx.a₂ + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁.hx.h.h₂.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) = ?h₂.h.h₁.hx.h.h₂.a₂ case h₂.h.h₁.hx.h.h₂.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) ?h₂.h.h₁.hx.h.h₂.a₂) + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg
case h₂.h.h₁.hx.h.h₂.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) = ?h₂.h.h₁.hx.h.h₂.a₂ case h₂.h.h₁.hx.h.h₂.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) ?h₂.h.h₁.hx.h.h₂.a₂) + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁.hx.h.h₂.h.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) = ?h₂.h.h₁.hx.h.h₂.h.a₂ case h₂.h.h₁.hx.h.h₂.h.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + ?h₂.h.h₁.hx.h.h₂.h.a₂)) + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply lshift2_toNat
case h₂.h.h₁.hx.h.h₂.h.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (lshift2 H (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo))) = ?h₂.h.h₁.hx.h.h₂.h.a₂ case h₂.h.h₁.hx.h.h₂.h.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + ?h₂.h.h₁.hx.h.h₂.h.a₂)) + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) * bound H % bound (() :: () :: H))) + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
rfl
case h₂.h.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = ?h₂.h.h₁.y' case h₂.h.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) * bound H % bound (() :: () :: H))) + ?h₂.h.h₁.y' = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) * bound H % bound (() :: () :: H))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
simp only [toNat_ofNat, toNat_node, toNat_zero, add_zero, karatsuba_toNat, mul_zero, zero_add, left_distrib, right_distrib, bound_cons, ← mul_assoc, ← add_assoc, mul_right_comm _ _ (bound H), mul_comm (toNat _ _) (bound H), mul_comm (_ % _) (bound H), Nat.add_mod_mod, add_left_inj]
case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat (() :: () :: H) (node (karatsuba H xhi yhi) (zero (() :: H))) + toNat (() :: () :: H) (ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) * bound H % bound (() :: () :: H))) + toNat (() :: () :: H) (node (zero (() :: H)) (karatsuba H xlo ylo)) = toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H))) % (bound H * bound H * bound H * bound H) = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Eq.trans
case h₂.h.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H))) % (bound H * bound H * bound H * bound H) = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H))) % (bound H * bound H * bound H * bound H) = ?h₂.h.h₂.b case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₂.b = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo case h₂.h.h₂.b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg₂
case h₂.h.h₂.h₁ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H))) % (bound H * bound H * bound H * bound H) = ?h₂.h.h₂.b case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₂.b = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo case h₂.h.h₂.b H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ
case h₂.h.h₂.h₁.hx H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H)) = ?h₂.h.h₂.h₁.x' case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.x' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₂.h₁.x' % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg
case h₂.h.h₂.h₁.hx H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H)) = ?h₂.h.h₂.h₁.x' case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.x' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?h₂.h.h₂.h₁.x' % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H)) = ?h₂.h.h₂.h₁.hx.a₂ case h₂.h.h₂.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + ?h₂.h.h₂.h₁.hx.a₂) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply congrArg
case h₂.h.h₂.h₁.hx.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * ((toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H)) = ?h₂.h.h₂.h₁.hx.a₂ case h₂.h.h₂.h₁.hx.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + ?h₂.h.h₂.h₁.hx.a₂) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H) = ?h₂.h.h₂.h₁.hx.h.a₂ case h₂.h.h₂.h₁.hx.h.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * ?h₂.h.h₂.h₁.hx.h.a₂) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.mod_eq_of_lt
case h₂.h.h₂.h₁.hx.h.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H) = ?h₂.h.h₂.h₁.hx.h.a₂ case h₂.h.h₂.h₁.hx.h.a₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * ?h₂.h.h₂.h₁.hx.h.a₂) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h.h.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo < bound H * bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply add_lt_mul_bound
case h₂.h.h₂.h₁.hx.h.h.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo < bound H * bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h.h.h.ha H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi ≤ bound H * bound H * bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply le_trans _
case h₂.h.h₂.h₁.hx.h.h.h.ha H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi ≤ bound H * bound H * bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h.h.h.ha H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?m.127684 ≤ bound H * bound H * bound H H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi ≤ ?m.127684 case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.le_mul_of_pos_right (bound_pos _)
case h₂.h.h₂.h₁.hx.h.h.h.ha H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?m.127684 ≤ bound H * bound H * bound H H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi ≤ ?m.127684 case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi ≤ bound H * bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply le_of_lt
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi ≤ bound H * bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi < bound H * bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.mul_lt_mul_for_real
case a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo * toNat H yhi < bound H * bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case a.hax H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo < bound H case a.hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H yhi < bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply toNat_lt _
case a.hax H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xlo < bound H case a.hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H yhi < bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case a.hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H yhi < bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply toNat_lt _
case a.hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H yhi < bound H case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply lt_of_lt_of_le _
case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?m.127933 ≤ bound H * bound H * bound H H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < ?m.127933 case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.le_mul_of_pos_right (bound_pos _)
case h₂.h.h₂.h₁.hx.h.h.h.hb H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ?m.127933 ≤ bound H * bound H * bound H H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < ?m.127933 case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.mul_lt_mul_for_real
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi * toNat H ylo < bound H * bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case hax H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi < bound H case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H ylo < bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply toNat_lt _
case hax H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H xhi < bound H case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H ylo < bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H ylo < bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply toNat_lt _
case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat H ylo < bound H case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
rfl
case h₂.h.h₂.h₁.hy H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * bound H * bound H = ?h₂.h.h₂.h₁.y' case h₂.h.h₂.h₁.y' H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ ℕ case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % ?h₂.h.h₂.h₁.y' = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % (bound H * bound H * bound H * bound H) = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
simp only [left_distrib, ← add_assoc, ← mul_assoc]
case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo)) % (bound H * bound H * bound H * bound H) = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H) = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.mod_eq_of_lt
case h₂.h.h₂.h₂ H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ (bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo) % (bound H * bound H * bound H * bound H) = bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo
case h₂.h.h₂.h₂.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo < bound H * bound H * bound H * bound H
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply lt_of_le_of_lt (b := (node xhi xlo).toNat (()::H) * (node yhi ylo).toNat (()::H))
case h₂.h.h₂.h₂.h H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo < bound H * bound H * bound H * bound H
case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo ≤ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) < bound H * bound H * bound H * bound H
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
{ simp [toNat_node, left_distrib, right_distrib, add_assoc, ← mul_assoc, mul_right_comm _ (toNat _ _) (bound _), mul_comm (toNat _ _) (bound _)] }
case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo ≤ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) < bound H * bound H * bound H * bound H
case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) < bound H * bound H * bound H * bound H
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply lt_of_lt_of_eq _ (mul_assoc _ _ _).symm
case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) < bound H * bound H * bound H * bound H
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) < bound H * bound H * (bound H * bound H)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply Nat.mul_lt_mul_for_real
H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo) < bound H * bound H * (bound H * bound H)
case hax H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) < bound H * bound H case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node yhi ylo) < bound H * bound H
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply lt_of_lt_of_eq (toNat_lt _) (bound_cons _)
case hax H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node xhi xlo) < bound H * bound H case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node yhi ylo) < bound H * bound H
case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node yhi ylo) < bound H * bound H
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
apply lt_of_lt_of_eq (toNat_lt _) (bound_cons _)
case hby H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ toNat (() :: H) (node yhi ylo) < bound H * bound H
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Karatsuba.lean
BitTree.karatsuba_eq_mul
[651, 1]
[730, 51]
simp [toNat_node, left_distrib, right_distrib, add_assoc, ← mul_assoc, mul_right_comm _ (toNat _ _) (bound _), mul_comm (toNat _ _) (bound _)]
case h₂.h.h₂.h₂.h.a H : List Unit xhi xlo yhi ylo : BitTree lhs✝¹ : Perfect H xhi rhs✝¹ : Perfect H xlo lhs✝ : Perfect H yhi rhs✝ : Perfect H ylo h : ∀ {H : List Unit} {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat H x * toNat H y % bound (() :: H) = toNat H x * toNat H y karatsuba_toNat : ∀ {x y : BitTree} [inst : Perfect H x] [inst : Perfect H y], toNat (() :: H) (karatsuba H x y) = toNat H x * toNat H y h₃ : karatsubaHelper₃ H (karatsuba H (addWithCarry xhi xlo 0).2 (addWithCarry yhi ylo 0).2) (addWithCarry xhi xlo 0) (addWithCarry yhi ylo 0) = ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo)) h₁ : karatsubaHelper₁ (() :: H) (karatsuba H xlo ylo) (karatsuba H xhi yhi) (ofNat (() :: () :: H) ((toNat H xhi + toNat H xlo) * (toNat H yhi + toNat H ylo))) = ofNat (() :: () :: H) (toNat H xlo * toNat H yhi + toNat H xhi * toNat H ylo) ⊢ bound H * bound H * toNat H xhi * toNat H yhi + bound H * toNat H xlo * toNat H yhi + bound H * toNat H xhi * toNat H ylo ≤ toNat (() :: H) (node xhi xlo) * toNat (() :: H) (node yhi ylo)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.setm_setm
[133, 9]
[133, 91]
cases b <;> simp
m : Memory b : Bool ma₀ ma₁ : Memory ⊢ setm (setm m b ma₀) b ma₁ = setm m b ma₁
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.getv_setv
[135, 1]
[135, 50]
simp
m : Memory v : Bool ⊢ getv (setv m v) = v
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.getm_setv
[136, 9]
[136, 85]
funext b
m : Memory v : Bool ⊢ getm (setv m v) = getm m
case h m : Memory v b : Bool ⊢ getm (setv m v) b = getm m b
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.getm_setv
[136, 9]
[136, 85]
cases b <;> simp
case h m : Memory v b : Bool ⊢ getm (setv m v) b = getm m b
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.getv_setm
[137, 9]
[137, 78]
cases b <;> simp
m : Memory b : Bool ma : Memory ⊢ getv (setm m b ma) = getv m
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.getm_setm_eq
[138, 9]
[138, 79]
cases b <;> simp
m : Memory b : Bool ma : Memory ⊢ getm (setm m b ma) b = ma
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Memory/Basic.lean
HMem.Memory.setmp_setmp
[156, 9]
[158, 49]
simp [setmp_setmp (bs := bs)]
ma₀ ma₁ m : Memory b : Bool bs : List Bool ⊢ setmp (setmp m (b :: bs) ma₀) (b :: bs) ma₁ = setmp m (b :: bs) ma₁
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Program/Step.lean
HMem.Stack.exit_of_step_result
[88, 1]
[89, 34]
cases is <;> cases cs <;> simp
m : Memory is p : Program cs : List (Thunk × List Bool) r : Memory ⊢ step (execution { state := m, current := is, function := p } cs) = result r → m = r ∧ is = Program.exit ∧ cs = []
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Program/Step.lean
HMem.Stack.exit_of_step_result'
[91, 1]
[92, 50]
simp [exit_of_step_result h]
cs : List (Thunk × List Bool) r state✝ : Memory current✝ function✝ : Program h : step (execution { state := state✝, current := current✝, function := function✝ } cs) = result r ⊢ execution { state := state✝, current := current✝, function := function✝ } cs = execution { state := r, current := Program.exit, function := { state := state✝, current := current✝, function := function✝ }.function } []
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Program/Step.lean
HMem.Stack.step_eq_execution
[109, 1]
[110, 19]
cases s <;> simp
s : Stack t : Thunk cs : List (Thunk × List Bool) ⊢ step s = execution t cs → ∃ t' cs', s = execution t' cs'
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Program/Step.lean
HMem.Stack.step_execution_append
[116, 1]
[118, 83]
cases t₀ with | _ m c p => cases c <;> cases cs₀ <;> simp [List.append_left_inj]
t₀ : Thunk cs₀ : List (Thunk × List Bool) t₁ : Thunk cs₁ cs : List (Thunk × List Bool) ⊢ step (execution t₀ cs₀) = execution t₁ cs₁ → step (execution t₀ (cs₀ ++ cs)) = execution t₁ (cs₁ ++ cs)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Program/Step.lean
HMem.Stack.step_execution_append
[116, 1]
[118, 83]
cases c <;> cases cs₀ <;> simp [List.append_left_inj]
case mk cs₀ : List (Thunk × List Bool) t₁ : Thunk cs₁ cs : List (Thunk × List Bool) m : Memory c p : Program ⊢ step (execution { state := m, current := c, function := p } cs₀) = execution t₁ cs₁ → step (execution { state := m, current := c, function := p } (cs₀ ++ cs)) = execution t₁ (cs₁ ++ cs)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Program/Step.lean
HMem.Stack.istep_execution_append
[120, 1]
[127, 69]
simp
cs : List (Thunk × List Bool) x✝³ x✝² : Thunk x✝¹ x✝ : List (Thunk × List Bool) ⊢ step^[0] (execution x✝³ x✝¹) = execution x✝² x✝ → step^[0] (execution x✝³ (x✝¹ ++ cs)) = execution x✝² (x✝ ++ cs)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Cost.lean
HMem.Trace.CostedProgram.splitTimeCost
[244, 1]
[349, 16]
apply Stack.hasTimeCost_subroutine_le _
α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := m, current := toProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next), function := toProgram fcp } []) ((subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a)
case hr α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasResult (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173014 case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ ?m.173014, current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Memory α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Cost.lean
HMem.Trace.CostedProgram.splitTimeCost
[244, 1]
[349, 16]
rw [TracedProgram.sound_subroutine_arg (TracedProgram.sound_of_sound' h _ _ hm)]
case hr α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasResult (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173014 case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ ?m.173014, current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Memory α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
case hr α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasResult (Stack.execution { state := Complexity.encode (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)), current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173014 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Memory case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ ?m.173014, current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Memory α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Cost.lean
HMem.Trace.CostedProgram.splitTimeCost
[244, 1]
[349, 16]
apply hcost.toComputable.has_result
case hr α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasResult (Stack.execution { state := Complexity.encode (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)), current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173014 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Memory case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ ?m.173014, current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Memory α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ (Complexity.encode (fs✝ (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)))), current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Cost.lean
HMem.Trace.CostedProgram.splitTimeCost
[244, 1]
[349, 16]
rw [TracedProgram.sound_subroutine_arg (TracedProgram.sound_of_sound' h _ _ hm)]
case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.getms m src✝, current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ (Complexity.encode (fs✝ (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)))), current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Complexity.encode (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)), current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ (Complexity.encode (fs✝ (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)))), current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Cost.lean
HMem.Trace.CostedProgram.splitTimeCost
[244, 1]
[349, 16]
apply (Stack.timeCost_le_iff _ _).mpr
case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Complexity.encode (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)), current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173011 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ (Complexity.encode (fs✝ (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)))), current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a
case h₀ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.timeCost (Stack.execution { state := Complexity.encode (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)), current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) ?m.173938 ≤ ?m.173011 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.halts (Stack.execution { state := Complexity.encode (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)), current := Encoding.getProgram fs✝, function := Encoding.getProgram fs✝ } []) α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ case h₁ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ Stack.hasTimeCost (Stack.execution { state := Memory.setms m dst✝ (Complexity.encode (fs✝ (Option.get (Complexity.decode γ✝ (Memory.getms m src✝)) (_ : Option.isSome (Complexity.decode γ✝ (Memory.getms m src✝)) = true)))), current := TracedProgram.toProgram (toTracedProgram next), function := toProgram fcp } []) ?m.173010 α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ℕ α : Type u_1 inst✝⁷ : Complexity.Coding α Memory β : Type u_2 inst✝⁶ : Complexity.Encoding β Memory f : α → β tp : TracedProgram γ δ : Type inst✝⁵ : Complexity.Coding γ Memory inst✝⁴ : Complexity.Encoding δ Memory fs : γ → δ cs : Complexity.CostFunction γ ℕ inst✝³ : Complexity.Computable Encoding.Model fs inst✝² : Complexity Encoding.Model fs cs size : α → ℕ fm : α → Option Memory fcp : CostedProgram hf : Program.sound (TracedProgram.toProgram (toTracedProgram fcp)) f size dst✝ src✝ : Source γ✝ δ✝ : Type inst✝¹ : Complexity.Coding γ✝ Memory inst✝ : Complexity.Encoding δ✝ Memory fs✝ : γ✝ → δ✝ cs✝ : Complexity.CostFunction γ✝ ℕ hcost : Complexity Encoding.Model fs✝ cs✝ next : CostedProgram h : TracedProgram.sound' f size (toTracedProgram (subroutine' dst✝ src✝ inst✝¹ inst✝ fs✝ cs✝ hcost next)) fm a : α m : Memory hm : m ∈ fm a ⊢ ?m.173010 + ?m.173011 + 1 ≤ (subroutineTimeCost h + recurseTimeCost hf h + localTimeCost h) a