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
Lib.lean
Nat.log_mul_add
[206, 1]
[223, 21]
apply congrArg _ (Nat.div_eq_of_lt hc)
case a.hβ‚‚.a.h.a.hβ‚‚ b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ n + c / b = n case a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b n + 1 ≀ log b (b * n + c)
case a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b n + 1 ≀ log b (b * n + c)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.log_mul_add
[206, 1]
[223, 21]
apply le_trans
case a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b n + 1 ≀ log b (b * n + c)
case a.a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b n + 1 ≀ ?a.b✝ case a.a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ ?a.b✝ ≀ log b (b * n + c) case a.b b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ β„•
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.log_mul_add
[206, 1]
[223, 21]
rw [← Nat.log_mul hb hn]
case a.a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b n + 1 ≀ ?a.b✝ case a.a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ ?a.b✝ ≀ log b (b * n + c) case a.b b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ β„•
case a.a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b (b * n) ≀ log b (b * n + c)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.log_mul_add
[206, 1]
[223, 21]
apply Nat.log_mono_right
case a.a b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ log b (b * n) ≀ log b (b * n + c)
case a.a.h b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ b * n ≀ b * n + c
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.log_mul_add
[206, 1]
[223, 21]
apply le_add_right
case a.a.h b n c : β„• hb : 1 < b hn : 1 ≀ n hc : c < b ⊒ b * n ≀ b * n + c
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
refine binaryRec' (n := n) ?hz ?hi
n : β„• ⊒ size n ≀ log 2 n + 1
case hz n : β„• ⊒ size 0 ≀ log 2 0 + 1 case hi n : β„• ⊒ βˆ€ (b : Bool) (n : β„•), (n = 0 β†’ b = true) β†’ size n ≀ log 2 n + 1 β†’ size (bit b n) ≀ log 2 (bit b n) + 1
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
exact zero_le _
case hz n : β„• ⊒ size 0 ≀ log 2 0 + 1 case hi n : β„• ⊒ βˆ€ (b : Bool) (n : β„•), (n = 0 β†’ b = true) β†’ size n ≀ log 2 n + 1 β†’ size (bit b n) ≀ log 2 (bit b n) + 1
case hi n : β„• ⊒ βˆ€ (b : Bool) (n : β„•), (n = 0 β†’ b = true) β†’ size n ≀ log 2 n + 1 β†’ size (bit b n) ≀ log 2 (bit b n) + 1
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
intro b n hb ih
case hi n : β„• ⊒ βˆ€ (b : Bool) (n : β„•), (n = 0 β†’ b = true) β†’ size n ≀ log 2 n + 1 β†’ size (bit b n) ≀ log 2 (bit b n) + 1
case hi n✝ : β„• b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ log 2 n + 1 ⊒ size (bit b n) ≀ log 2 (bit b n) + 1
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
cases n
case hi n✝ : β„• b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ log 2 n + 1 ⊒ size (bit b n) ≀ log 2 (bit b n) + 1
case hi.zero n : β„• b : Bool hb : zero = 0 β†’ b = true ih : size zero ≀ log 2 zero + 1 ⊒ size (bit b zero) ≀ log 2 (bit b zero) + 1 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ size (bit b (succ n✝)) ≀ log 2 (bit b (succ n✝)) + 1
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
cases b <;> simp
case hi.zero n : β„• b : Bool hb : zero = 0 β†’ b = true ih : size zero ≀ log 2 zero + 1 ⊒ size (bit b zero) ≀ log 2 (bit b zero) + 1 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ size (bit b (succ n✝)) ≀ log 2 (bit b (succ n✝)) + 1
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ size (bit b (succ n✝)) ≀ log 2 (bit b (succ n✝)) + 1
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
rw [size_bit, bit_val, Nat.log_mul_add]
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ size (bit b (succ n✝)) ≀ log 2 (bit b (succ n✝)) + 1
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ succ (size (succ n✝)) ≀ log 2 (succ n✝) + 1 + 1 case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
apply Nat.succ_le_succ ih
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ succ (size (succ n✝)) ≀ log 2 (succ n✝) + 1 + 1 case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
apply one_lt_two
case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
apply Nat.succ_le_succ (zero_le _)
case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
cases b <;> simp
case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_succ_log
[225, 1]
[236, 19]
cases b <;> simp
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) ≀ log 2 (succ n✝) + 1 ⊒ bit b (succ n✝) β‰  0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
refine binaryRec' (n := n) rfl ?hi
n : β„• ⊒ size n - 1 = log 2 n
case hi n : β„• ⊒ βˆ€ (b : Bool) (n : β„•), (n = 0 β†’ b = true) β†’ size n - 1 = log 2 n β†’ size (bit b n) - 1 = log 2 (bit b n)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
intro b n hb ih
case hi n : β„• ⊒ βˆ€ (b : Bool) (n : β„•), (n = 0 β†’ b = true) β†’ size n - 1 = log 2 n β†’ size (bit b n) - 1 = log 2 (bit b n)
case hi n✝ : β„• b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n - 1 = log 2 n ⊒ size (bit b n) - 1 = log 2 (bit b n)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
cases n
case hi n✝ : β„• b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n - 1 = log 2 n ⊒ size (bit b n) - 1 = log 2 (bit b n)
case hi.zero n : β„• b : Bool hb : zero = 0 β†’ b = true ih : size zero - 1 = log 2 zero ⊒ size (bit b zero) - 1 = log 2 (bit b zero) case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ size (bit b (succ n✝)) - 1 = log 2 (bit b (succ n✝))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
cases b <;> rfl
case hi.zero n : β„• b : Bool hb : zero = 0 β†’ b = true ih : size zero - 1 = log 2 zero ⊒ size (bit b zero) - 1 = log 2 (bit b zero) case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ size (bit b (succ n✝)) - 1 = log 2 (bit b (succ n✝))
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ size (bit b (succ n✝)) - 1 = log 2 (bit b (succ n✝))
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
rw [size_bit, bit_val, Nat.log_mul_add, Nat.succ_eq_add_one, Nat.add_sub_cancel, ← ih, Nat.sub_add_cancel]
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ size (bit b (succ n✝)) - 1 = log 2 (bit b (succ n✝))
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ size (succ n✝) case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
exact tsub_add_cancel_iff_le.mp rfl
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ size (succ n✝) case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
exact one_lt_two
case hi.succ.hb n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 < 2 case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
exact Nat.succ_le_succ (Nat.zero_le _)
case hi.succ.hn n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ 1 ≀ succ n✝ case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
{ cases b <;> simp }
case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2 case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
{ simp }
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
cases b <;> simp
case hi.succ.hc n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ (bif b then 1 else 0) < 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.pred_size_eq_log
[238, 1]
[248, 11]
simp
case hi.succ n : β„• b : Bool n✝ : β„• hb : succ n✝ = 0 β†’ b = true ih : size (succ n✝) - 1 = log 2 (succ n✝) ⊒ bit b (succ n✝) β‰  0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_succ_eq_succ_log_succ
[250, 1]
[252, 38]
rw [← Nat.pred_size_eq_log, Nat.sub_add_cancel]
n : β„• ⊒ size (n + 1) = log 2 (n + 1) + 1
n : β„• ⊒ 1 ≀ size (n + 1)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_succ_eq_succ_log_succ
[250, 1]
[252, 38]
exact tsub_add_cancel_iff_le.mp rfl
n : β„• ⊒ 1 ≀ size (n + 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.mod2_succ_eq_one
[254, 9]
[257, 65]
cases n using binaryRec with | z => simp | f b _ _ => cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
n : β„• ⊒ (n + 1) % 2 = 1 ↔ n % 2 = 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.mod2_succ_eq_one
[254, 9]
[257, 65]
simp
case z ⊒ (0 + 1) % 2 = 1 ↔ 0 % 2 = 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.mod2_succ_eq_one
[254, 9]
[257, 65]
cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
case f b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ ((bit b n✝ + 1) % 2 = 1 ↔ bit b n✝ % 2 = 0) ⊒ (bit b n✝ + 1) % 2 = 1 ↔ bit b n✝ % 2 = 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.mod2_succ_eq_zero
[259, 9]
[262, 65]
cases n using binaryRec with | z => simp | f b _ _ => cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
n : β„• ⊒ (n + 1) % 2 = 0 ↔ n % 2 = 1
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.mod2_succ_eq_zero
[259, 9]
[262, 65]
simp
case z ⊒ (0 + 1) % 2 = 0 ↔ 0 % 2 = 1
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.mod2_succ_eq_zero
[259, 9]
[262, 65]
cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
case f b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ ((bit b n✝ + 1) % 2 = 0 ↔ bit b n✝ % 2 = 1) ⊒ (bit b n✝ + 1) % 2 = 0 ↔ bit b n✝ % 2 = 1
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.bnot_mod2_eq_zero
[264, 9]
[267, 65]
cases n using binaryRec with | z => simp | f b _ _ => cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
n : β„• ⊒ (!decide (n % 2 = 0)) = decide (n % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.bnot_mod2_eq_zero
[264, 9]
[267, 65]
simp
case z ⊒ (!decide (0 % 2 = 0)) = decide (0 % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.bnot_mod2_eq_zero
[264, 9]
[267, 65]
cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
case f b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ (!decide (bit b n✝ % 2 = 0)) = decide (bit b n✝ % 2 = 1) ⊒ (!decide (bit b n✝ % 2 = 0)) = decide (bit b n✝ % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.toNat_decide_mod2
[269, 9]
[272, 65]
cases n using binaryRec with | z => simp | f b _ _ => cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
n : β„• ⊒ Bool.toNat (decide (n % 2 = 0)) = (n + 1) % 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.toNat_decide_mod2
[269, 9]
[272, 65]
simp
case z ⊒ Bool.toNat (decide (0 % 2 = 0)) = (0 + 1) % 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.toNat_decide_mod2
[269, 9]
[272, 65]
cases b <;> simp [← Nat.two_mul, Nat.mul_add_mod]
case f b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ Bool.toNat (decide (bit b n✝ % 2 = 0)) = (bit b n✝ + 1) % 2 ⊒ Bool.toNat (decide (bit b n✝ % 2 = 0)) = (bit b n✝ + 1) % 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2β‚€β‚€
[274, 9]
[281, 85]
cases n using binaryRec with | z => simp | f b _ _ => cases m using binaryRec with | z => cases b <;> simp [← Nat.two_mul] | f c _ _ => cases b <;> cases c <;> simp [← Nat.two_mul, Nat.mul_add_mod, ← Nat.add_assoc]
n m : β„• ⊒ Bool.xor (decide (n % 2 = 0)) (decide (m % 2 = 0)) = decide ((n + m) % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2β‚€β‚€
[274, 9]
[281, 85]
simp
case z m : β„• ⊒ Bool.xor (decide (0 % 2 = 0)) (decide (m % 2 = 0)) = decide ((0 + m) % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2β‚€β‚€
[274, 9]
[281, 85]
cases m using binaryRec with | z => cases b <;> simp [← Nat.two_mul] | f c _ _ => cases b <;> cases c <;> simp [← Nat.two_mul, Nat.mul_add_mod, ← Nat.add_assoc]
case f m : β„• b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ Bool.xor (decide (bit b n✝ % 2 = 0)) (decide (m % 2 = 0)) = decide ((bit b n✝ + m) % 2 = 1) ⊒ Bool.xor (decide (bit b n✝ % 2 = 0)) (decide (m % 2 = 0)) = decide ((bit b n✝ + m) % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2β‚€β‚€
[274, 9]
[281, 85]
cases b <;> simp [← Nat.two_mul]
case f.z b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ Bool.xor (decide (bit b n✝ % 2 = 0)) (decide (0 % 2 = 0)) = decide ((bit b n✝ + 0) % 2 = 1) ⊒ Bool.xor (decide (bit b n✝ % 2 = 0)) (decide (0 % 2 = 0)) = decide ((bit b n✝ + 0) % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2β‚€β‚€
[274, 9]
[281, 85]
cases b <;> cases c <;> simp [← Nat.two_mul, Nat.mul_add_mod, ← Nat.add_assoc]
case f.f b : Bool n✝¹ : β„• c : Bool n✝ : β„• a✝¹ : bit b n✝¹ = n✝¹ β†’ Bool.xor (decide (bit b n✝¹ % 2 = 0)) (decide (bit c n✝ % 2 = 0)) = decide ((bit b n✝¹ + bit c n✝) % 2 = 1) a✝ : bit c n✝ = n✝ β†’ Bool.xor (decide (bit b n✝¹ % 2 = 0)) (decide (bit c n✝ % 2 = 0)) = decide ((bit b n✝¹ + bit c n✝) % 2 = 1) ⊒ Bool.xor (decide (bit b n✝¹ % 2 = 0)) (decide (bit c n✝ % 2 = 0)) = decide ((bit b n✝¹ + bit c n✝) % 2 = 1)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2₀₁
[283, 9]
[290, 85]
cases m using binaryRec with | z => simp | f b _ _ => cases n using binaryRec with | z => cases b <;> simp [← Nat.two_mul] | f c _ _ => cases b <;> cases c <;> simp [← Nat.two_mul, Nat.mul_add_mod, ← Nat.add_assoc]
n m : β„• ⊒ Bool.xor (decide (n % 2 = 0)) (decide (m % 2 = 1)) = decide ((n + m) % 2 = 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2₀₁
[283, 9]
[290, 85]
simp
case z n : β„• ⊒ Bool.xor (decide (n % 2 = 0)) (decide (0 % 2 = 1)) = decide ((n + 0) % 2 = 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2₀₁
[283, 9]
[290, 85]
cases n using binaryRec with | z => cases b <;> simp [← Nat.two_mul] | f c _ _ => cases b <;> cases c <;> simp [← Nat.two_mul, Nat.mul_add_mod, ← Nat.add_assoc]
case f n : β„• b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ Bool.xor (decide (n % 2 = 0)) (decide (bit b n✝ % 2 = 1)) = decide ((n + bit b n✝) % 2 = 0) ⊒ Bool.xor (decide (n % 2 = 0)) (decide (bit b n✝ % 2 = 1)) = decide ((n + bit b n✝) % 2 = 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2₀₁
[283, 9]
[290, 85]
cases b <;> simp [← Nat.two_mul]
case f.z b : Bool n✝ : β„• a✝ : bit b n✝ = n✝ β†’ Bool.xor (decide (0 % 2 = 0)) (decide (bit b n✝ % 2 = 1)) = decide ((0 + bit b n✝) % 2 = 0) ⊒ Bool.xor (decide (0 % 2 = 0)) (decide (bit b n✝ % 2 = 1)) = decide ((0 + bit b n✝) % 2 = 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.xor_mod2₀₁
[283, 9]
[290, 85]
cases b <;> cases c <;> simp [← Nat.two_mul, Nat.mul_add_mod, ← Nat.add_assoc]
case f.f b : Bool n✝¹ : β„• c : Bool n✝ : β„• a✝¹ : bit b n✝¹ = n✝¹ β†’ Bool.xor (decide (bit c n✝ % 2 = 0)) (decide (bit b n✝¹ % 2 = 1)) = decide ((bit c n✝ + bit b n✝¹) % 2 = 0) a✝ : bit c n✝ = n✝ β†’ Bool.xor (decide (bit c n✝ % 2 = 0)) (decide (bit b n✝¹ % 2 = 1)) = decide ((bit c n✝ + bit b n✝¹) % 2 = 0) ⊒ Bool.xor (decide (bit c n✝ % 2 = 0)) (decide (bit b n✝¹ % 2 = 1)) = decide ((bit c n✝ + bit b n✝¹) % 2 = 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.div_mod2
[292, 9]
[295, 70]
induction n using Nat.binaryRec' with | z => rfl | f b _ _ _ => cases b <;> simp [bit_val, mul_add_div, mul_add_mod]
n : β„• ⊒ n / 2 + n % 2 = (n + 1) / 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.div_mod2
[292, 9]
[295, 70]
rfl
case z ⊒ 0 / 2 + 0 % 2 = (0 + 1) / 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.div_mod2
[292, 9]
[295, 70]
cases b <;> simp [bit_val, mul_add_div, mul_add_mod]
case f b : Bool n✝ : β„• a✝¹ : n✝ = 0 β†’ b = true a✝ : n✝ / 2 + n✝ % 2 = (n✝ + 1) / 2 ⊒ bit b n✝ / 2 + bit b n✝ % 2 = (bit b n✝ + 1) / 2
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
intro n
C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) ⊒ (n : β„•) β†’ C n
C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) n : β„• ⊒ C n
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
cases n using Nat.binaryRec' with | z => exact z | f b n hb => cases b with | true => simpa [← Nat.two_mul] using o _ | false => match n with | 0 => exact absurd (hb rfl) Bool.noConfusion | n+1 => simpa [← Nat.add_assoc, Nat.add_right_comm _ 1, ← Nat.two_mul] using e _
C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) n : β„• ⊒ C n
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
exact z
case z C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) ⊒ C 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
cases b with | true => simpa [← Nat.two_mul] using o _ | false => match n with | 0 => exact absurd (hb rfl) Bool.noConfusion | n+1 => simpa [← Nat.add_assoc, Nat.add_right_comm _ 1, ← Nat.two_mul] using e _
case f C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) b : Bool n : β„• hb : n = 0 β†’ b = true a✝ : bit b n = n β†’ C (bit b n) ⊒ C (bit b n)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
simpa [← Nat.two_mul] using o _
case f.true C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) n : β„• hb : n = 0 β†’ true = true a✝ : bit true n = n β†’ C (bit true n) ⊒ C (bit true n)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
match n with | 0 => exact absurd (hb rfl) Bool.noConfusion | n+1 => simpa [← Nat.add_assoc, Nat.add_right_comm _ 1, ← Nat.two_mul] using e _
case f.false C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) n : β„• hb : n = 0 β†’ false = true a✝ : bit false n = n β†’ C (bit false n) ⊒ C (bit false n)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
exact absurd (hb rfl) Bool.noConfusion
C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) n : β„• hb : 0 = 0 β†’ false = true a✝ : bit false 0 = 0 β†’ C (bit false 0) ⊒ C (bit false 0)
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.parityZeroCases
[298, 1]
[308, 88]
simpa [← Nat.add_assoc, Nat.add_right_comm _ 1, ← Nat.two_mul] using e _
C : β„• β†’ Sort u z : C 0 o : (n : β„•) β†’ C (2 * n + 1) e : (n : β„•) β†’ C (2 * n + 2) n✝ n : β„• hb : n + 1 = 0 β†’ false = true a✝ : bit false (n + 1) = n + 1 β†’ C (bit false (n + 1)) ⊒ C (bit false (n + 1))
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
induction n using Nat.binaryRec' with | z => exact le_refl _ | f b n hb ih => rw [size_bit] cases b simp apply Nat.add_le_add (c := 1) ih { cases n exact absurd (hb rfl) Bool.noConfusion exact Nat.succ_le_succ (Nat.zero_le _) } simp apply Nat.succ_le_succ apply le_trans apply ih apply le_add_left cases b simpa using Ξ» h ↦ absurd (hb h) Bool.noConfusion simp
n : β„• ⊒ size n ≀ n
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
exact le_refl _
case z ⊒ size 0 ≀ 0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
rw [size_bit]
case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ size (bit b n) ≀ bit b n
case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ succ (size n) ≀ bit b n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
cases b
case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ succ (size n) ≀ bit b n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ succ (size n) ≀ bit false n case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
simp
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ succ (size n) ≀ bit false n case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ succ (size n) ≀ n + n case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
apply Nat.add_le_add (c := 1) ih
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ succ (size n) ≀ n + n case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ 1 ≀ n case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
{ cases n exact absurd (hb rfl) Bool.noConfusion exact Nat.succ_le_succ (Nat.zero_le _) }
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ 1 ≀ n case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
simp
case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ bit true n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ n + n + 1 case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
apply Nat.succ_le_succ
case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ succ (size n) ≀ n + n + 1 case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.true.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ size n ≀ n + n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
apply le_trans
case f.true.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ size n ≀ n + n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.true.a.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ size n ≀ ?f.true.a.b case f.true.a.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ ?f.true.a.b ≀ n + n case f.true.a.b n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ β„• case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
apply ih
case f.true.a.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ size n ≀ ?f.true.a.b case f.true.a.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ ?f.true.a.b ≀ n + n case f.true.a.b n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ β„• case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.true.a.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ n ≀ n + n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
apply le_add_left
case f.true.a.a n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ n ≀ n + n case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
cases b
case f b : Bool n : β„• hb : n = 0 β†’ b = true ih : size n ≀ n ⊒ bit b n β‰  0
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ bit false n β‰  0 case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ bit true n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
simpa using Ξ» h ↦ absurd (hb h) Bool.noConfusion
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ bit false n β‰  0 case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ bit true n β‰  0
case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ bit true n β‰  0
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
simp
case f.true n : β„• ih : size n ≀ n hb : n = 0 β†’ true = true ⊒ bit true n β‰  0
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
cases n
case f.false n : β„• ih : size n ≀ n hb : n = 0 β†’ false = true ⊒ 1 ≀ n
case f.false.zero ih : size zero ≀ zero hb : zero = 0 β†’ false = true ⊒ 1 ≀ zero case f.false.succ n✝ : β„• ih : size (succ n✝) ≀ succ n✝ hb : succ n✝ = 0 β†’ false = true ⊒ 1 ≀ succ n✝
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
exact absurd (hb rfl) Bool.noConfusion
case f.false.zero ih : size zero ≀ zero hb : zero = 0 β†’ false = true ⊒ 1 ≀ zero case f.false.succ n✝ : β„• ih : size (succ n✝) ≀ succ n✝ hb : succ n✝ = 0 β†’ false = true ⊒ 1 ≀ succ n✝
case f.false.succ n✝ : β„• ih : size (succ n✝) ≀ succ n✝ hb : succ n✝ = 0 β†’ false = true ⊒ 1 ≀ succ n✝
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
Lib.lean
Nat.size_le_self
[320, 1]
[338, 9]
exact Nat.succ_le_succ (Nat.zero_le _)
case f.false.succ n✝ : β„• ih : size (succ n✝) ≀ succ n✝ hb : succ n✝ = 0 β†’ false = true ⊒ 1 ≀ succ n✝
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah
[4, 1]
[10, 24]
ring_nf
a x : β„• ⊒ (x + 1) ^ a + x ^ (a + 1) ≀ (x + 1) ^ (a + 1) + x ^ a
a x : β„• ⊒ x * x ^ a + (1 + x) ^ a ≀ x * (1 + x) ^ a + x ^ a + (1 + x) ^ a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah
[4, 1]
[10, 24]
apply add_le_add_right
a x : β„• ⊒ x * x ^ a + (1 + x) ^ a ≀ x * (1 + x) ^ a + x ^ a + (1 + x) ^ a
case bc a x : β„• ⊒ x * x ^ a ≀ x * (1 + x) ^ a + x ^ a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah
[4, 1]
[10, 24]
apply le_add_right
case bc a x : β„• ⊒ x * x ^ a ≀ x * (1 + x) ^ a + x ^ a
case bc.h a x : β„• ⊒ x * x ^ a ≀ x * (1 + x) ^ a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah
[4, 1]
[10, 24]
apply Nat.mul_le_mul_left
case bc.h a x : β„• ⊒ x * x ^ a ≀ x * (1 + x) ^ a
case bc.h.h a x : β„• ⊒ x ^ a ≀ (1 + x) ^ a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah
[4, 1]
[10, 24]
apply Nat.pow_le_pow_left
case bc.h.h a x : β„• ⊒ x ^ a ≀ (1 + x) ^ a
case bc.h.h.h a x : β„• ⊒ x ≀ 1 + x
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah
[4, 1]
[10, 24]
apply Nat.le_add_left
case bc.h.h.h a x : β„• ⊒ x ≀ 1 + x
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah2
[12, 1]
[18, 25]
apply Nat.sub_le_of_le_add
a x : β„• ⊒ (x + 1) ^ a - x ^ a ≀ (x + 1) ^ (a + 1) - x ^ (a + 1)
case h a x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + 1) - x ^ (a + 1) + x ^ a
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah2
[12, 1]
[18, 25]
rw [← Nat.sub_add_comm]
case h a x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + 1) - x ^ (a + 1) + x ^ a
case h a x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + 1) + x ^ a - x ^ (a + 1) case h a x : β„• ⊒ x ^ (a + 1) ≀ (x + 1) ^ (a + 1)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah2
[12, 1]
[18, 25]
apply Nat.le_sub_of_add_le
case h a x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + 1) + x ^ a - x ^ (a + 1) case h a x : β„• ⊒ x ^ (a + 1) ≀ (x + 1) ^ (a + 1)
case h.h a x : β„• ⊒ (x + 1) ^ a + x ^ (a + 1) ≀ (x + 1) ^ (a + 1) + x ^ a case h a x : β„• ⊒ x ^ (a + 1) ≀ (x + 1) ^ (a + 1)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah2
[12, 1]
[18, 25]
apply blah
case h.h a x : β„• ⊒ (x + 1) ^ a + x ^ (a + 1) ≀ (x + 1) ^ (a + 1) + x ^ a case h a x : β„• ⊒ x ^ (a + 1) ≀ (x + 1) ^ (a + 1)
case h a x : β„• ⊒ x ^ (a + 1) ≀ (x + 1) ^ (a + 1)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah2
[12, 1]
[18, 25]
apply Nat.pow_le_pow_left
case h a x : β„• ⊒ x ^ (a + 1) ≀ (x + 1) ^ (a + 1)
case h.h a x : β„• ⊒ x ≀ x + 1
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah2
[12, 1]
[18, 25]
apply Nat.le_add_right
case h.h a x : β„• ⊒ x ≀ x + 1
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
cases a <;> cases b <;> simp
a b : β„• ⊒ 0 ^ (a + b) - 0 ^ a ≀ (0 + 1) ^ (a + b) - (0 + 1) ^ a
no goals
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
apply Nat.le_sub_of_add_le
a b x : β„• ⊒ (x + 1) ^ (a + b) - (x + 1) ^ a ≀ (x + 1 + 1) ^ (a + b) - (x + 1 + 1) ^ a
case h a b x : β„• ⊒ (x + 1) ^ (a + b) - (x + 1) ^ a + (x + 1 + 1) ^ a ≀ (x + 1 + 1) ^ (a + b)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
rw [← Nat.sub_add_comm, add_comm, Nat.sub_add_comm]
case h a b x : β„• ⊒ (x + 1) ^ (a + b) - (x + 1) ^ a + (x + 1 + 1) ^ a ≀ (x + 1 + 1) ^ (a + b)
case h a b x : β„• ⊒ (x + 1 + 1) ^ a - (x + 1) ^ a + (x + 1) ^ (a + b) ≀ (x + 1 + 1) ^ (a + b) case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1 + 1) ^ a case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
apply Nat.add_le_of_le_sub _ blah3
case h a b x : β„• ⊒ (x + 1 + 1) ^ a - (x + 1) ^ a + (x + 1) ^ (a + b) ≀ (x + 1 + 1) ^ (a + b) case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1 + 1) ^ a case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
a b x : β„• ⊒ (x + 1) ^ (a + b) ≀ (x + 1 + 1) ^ (a + b) case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1 + 1) ^ a case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
apply Nat.pow_le_pow_left (Nat.le_succ _)
a b x : β„• ⊒ (x + 1) ^ (a + b) ≀ (x + 1 + 1) ^ (a + b) case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1 + 1) ^ a case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1 + 1) ^ a case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
apply Nat.pow_le_pow_left (Nat.le_succ _)
case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1 + 1) ^ a case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
https://github.com/calcu16/lean_complexity.git
d267eb4f3952c654f130a119311692c1c1a7cd71
HMem/Trace/Master.lean
blah4
[24, 1]
[33, 25]
apply Nat.pow_le_pow_right (Nat.zero_lt_succ _)
case h a b x : β„• ⊒ (x + 1) ^ a ≀ (x + 1) ^ (a + b)
case h a b x : β„• ⊒ a ≀ a + b