ex_double_the_differencemade with verso-snippets
View
not needed — no prose in this code
def double_the_difference := fun (lst : List Int) ↦ (do let mut ans : Int := (0 : Int) for num in (PastaLean.pyIter lst)do let _ := Libraries.passta.pyPassInvariant (decide (ans ≥ (0 : Int))) if h_1 : (num %ₚ (2 : Int) = (1 : Int) ∧ num > (0 : Int)) ∧ !(PastaLean.pyStrContainsSubstr (PastaLean.pyStr num) ".") then ans := ans +ₚ num ^ₚ (2 : Int) else let _ := () let _ := Libraries.passta.pyPassAssert (decide (ans ≥ (0 : Int))) return ans : Id _) private theorem pyMod_two (a : Int) : a %ₚ (2 : Int) = a % 2 := a:ℤ⊢ a %ₚ 2 = a % 2 a:ℤ⊢ pyMod a 2 = a % 2 a:ℤh1:0 ≤ a % 2⊢ pyMod a 2 = a % 2 a:ℤh1:0 ≤ a % 2⊢ (if (2 == 0) = true then a else have r := a % 2; if (decide (r < 0) && decide (2 > 0) || decide (r > 0) && decide (2 < 0)) = true then r + 2 else r) = a % 2; a:ℤh1:0 ≤ a % 2h✝:(2 == 0) = true⊢ a = a % 2a:ℤh1:0 ≤ a % 2h✝:¬(2 == 0) = true⊢ (have r := a % 2; if (decide (r < 0) && decide (2 > 0) || decide (r > 0) && decide (2 < 0)) = true then r + 2 else r) = a % 2 a:ℤh1:0 ≤ a % 2h✝:(2 == 0) = true⊢ a = a % 2a:ℤh1:0 ≤ a % 2h✝:¬(2 == 0) = true⊢ (have r := a % 2; if (decide (r < 0) && decide (2 > 0) || decide (r > 0) && decide (2 < 0)) = true then r + 2 else r) = a % 2 All goals completed! 🐙 private theorem foldl_padd_shift (l : List Int) (s : Int) : l.foldl (fun acc x => acc +ₚ x) s = s + l.foldl (fun acc x => acc +ₚ x) 0 := l:List ℤs:ℤ⊢ List.foldl (fun acc x => acc +ₚ x) s l = s + List.foldl (fun acc x => acc +ₚ x) 0 l induction l generalizing s with s:ℤ⊢ List.foldl (fun acc x => acc +ₚ x) s [] = s + List.foldl (fun acc x => acc +ₚ x) 0 [] All goals completed! 🐙 h:ℤt:List ℤih:∀ (s : ℤ), List.foldl (fun acc x => acc +ₚ x) s t = s + List.foldl (fun acc x => acc +ₚ x) 0 ts:ℤ⊢ List.foldl (fun acc x => acc +ₚ x) s (h :: t) = s + List.foldl (fun acc x => acc +ₚ x) 0 (h :: t) h:ℤt:List ℤih:∀ (s : ℤ), List.foldl (fun acc x => acc +ₚ x) s t = s + List.foldl (fun acc x => acc +ₚ x) 0 ts:ℤ⊢ List.foldl (fun acc x => acc +ₚ x) (s +ₚ h) t = s + List.foldl (fun acc x => acc +ₚ x) (0 +ₚ h) t h:ℤt:List ℤih:∀ (s : ℤ), List.foldl (fun acc x => acc +ₚ x) s t = s + List.foldl (fun acc x => acc +ₚ x) 0 ts:ℤ⊢ s +ₚ h + List.foldl (fun acc x => acc +ₚ x) 0 t = s + (0 +ₚ h + List.foldl (fun acc x => acc +ₚ x) 0 t) h:ℤt:List ℤih:∀ (s : ℤ), List.foldl (fun acc x => acc +ₚ x) s t = s + List.foldl (fun acc x => acc +ₚ x) 0 ts:ℤ⊢ s + h + List.foldl (fun acc x => acc + x) 0 t = s + (0 + h + List.foldl (fun acc x => acc + x) 0 t) All goals completed! 🐙 private theorem pySum_int_append (a b : List Int) : PastaLean.pySum (a ++ b) = PastaLean.pySum a + PastaLean.pySum b := a:List ℤb:List ℤ⊢ pySum (a ++ b) = pySum a + pySum b a:List ℤb:List ℤ⊢ List.foldl (fun acc x => acc +ₚ x) (List.foldl (fun acc x => acc +ₚ x) 0 a) b = List.foldl (fun acc x => acc +ₚ x) 0 a + List.foldl (fun acc x => acc +ₚ x) 0 b All goals completed! 🐙 private theorem pySum_int_singleton (x : Int) : PastaLean.pySum [x] = x := x:ℤ⊢ pySum [x] = x x:ℤ⊢ 0 +ₚ x = x All goals completed! 🐙 private theorem sq_odd_emod_two {c : Int} (h : c % 2 = 1) : c * c % 2 = 1 := c:ℤh:c % 2 = 1⊢ c * c % 2 = 1 c:ℤh:c % 2 = 1⊢ 1 * 1 % 2 = 1; All goals completed! 🐙 private theorem pySum_int_nil : PastaLean.pySum ([] : List Int) = 0 := rfl @[spec] theorem double_the_difference_spec : ⦃⌜True⌝⦄ double_the_difference lst ⦃⇓ans => ⌜(ans = PastaLean.pySum ((List.filter (fun v => (v %ₚ (2 : Int) = (1 : Int) ∧ v > (0 : Int)) ∧ !(PastaLean.pyStrContainsSubstr (PastaLean.pyStr v) ".")) (PastaLean.pyIter lst)).map fun v => v *ₚ v) ∧ ans %ₚ (2 : Int) = PastaLean.pyLen ((List.filter (fun v => (v %ₚ (2 : Int) = (1 : Int) ∧ v > (0 : Int)) ∧ !(PastaLean.pyStrContainsSubstr (PastaLean.pyStr v) ".")) (PastaLean.pyIter lst)).map fun v => v) %ₚ (2 : Int)) ∧ ans ≥ (0 : Int)⌝⦄ := lst:List ℤ⊢ ⦃⌜True⌝⦄ double_the_difference lst ⦃PostCond.noThrow fun ans => ⌜(ans = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pyIter lst))) ∧ ans %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pyIter lst))) %ₚ 2) ∧ ans ≥ 0⌝⦄ lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:pyIter lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:(cur✝ %ₚ 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = trueans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝:(b✝ = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) %ₚ 2) ∧ b✝ ≥ 0⊢ (ans✝ = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pref✝ ++ [cur✝]))) ∧ ans✝ %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pref✝ ++ [cur✝]))) %ₚ 2) ∧ ans✝ ≥ 0lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:pyIter lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:¬((cur✝ %ₚ 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true)h✝:(b✝ = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) %ₚ 2) ∧ b✝ ≥ 0⊢ (b✝ = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pref✝ ++ [cur✝]))) ∧ b✝ %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pref✝ ++ [cur✝]))) %ₚ 2) ∧ b✝ ≥ 0 all_goals lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:¬((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true)h✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0⊢ (b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ b✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ b✝ ≥ 0 lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = trueh✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0⊢ (ans✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ ans✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ ans✝ ≥ 0 -- vc1.step.isTrue: contributing element lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = trueh✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2⊢ (ans✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ ans✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ ans✝ ≥ 0 lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = trueh✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hg:(cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true⊢ (ans✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ ans✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ ans✝ ≥ 0 lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = trueh✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hg:(cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = truehsq:cur✝ * cur✝ % 2 = 1⊢ (ans✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ ans✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ ans✝ ≥ 0 lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hsq:cur✝ * cur✝ % 2 = 1h✝:Truehg:True⊢ (b✝ + cur✝ * cur✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + cur✝ * cur✝ ∧ (b✝ + cur✝ * cur✝) % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (0 + 1)) % 2) ∧ b✝ + cur✝ * cur✝ ≥ 0 refine ⟨⟨lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hsq:cur✝ * cur✝ % 2 = 1h✝:Truehg:True⊢ b✝ + cur✝ * cur✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + cur✝ * cur✝ All goals completed! 🐙, lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hsq:cur✝ * cur✝ % 2 = 1h✝:Truehg:True⊢ (b✝ + cur✝ * cur✝) % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (0 + 1)) % 2 All goals completed! 🐙⟩, lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤans✝:ℤ := b✝ +ₚ cur✝ ^ₚ 2h✝¹:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hsq:cur✝ * cur✝ % 2 = 1h✝:Truehg:True⊢ b✝ + cur✝ * cur✝ ≥ 0 All goals completed! 🐙⟩ lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:¬((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true)h✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0⊢ (b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ b✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ b✝ ≥ 0 -- vc2.step.isFalse: non-contributing element lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:¬((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true)h✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2⊢ (b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ b✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ b✝ ≥ 0 lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:¬((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true)h✝:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2hg:¬((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true)⊢ (b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) + pySum (List.map (fun v => v * v) (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else [])) ∧ b✝ % 2 = ↑((List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length + (if decide ((cur✝ % 2 = 1 ∧ cur✝ > 0) ∧ (!pyStrContainsSubstr (pyStr cur✝) ".") = true) = true then [cur✝] else []).length) % 2) ∧ b✝ ≥ 0 lst:List ℤpref✝:List ℤcur✝:ℤsuff✝:List ℤh✝²:lst = pref✝ ++ cur✝ :: suff✝b✝:ℤh✝¹:(b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0hpos:b✝ ≥ 0hsum:b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝))hpar:b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2h✝:¬Falsehg:¬False⊢ (b✝ = pySum (List.map (fun v => v * v) (List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝)) ∧ b✝ % 2 = ↑(List.filter (fun v => decide ((v % 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) pref✝).length % 2) ∧ b✝ ≥ 0 All goals completed! 🐙 theorem double_the_difference_correct : ∀ (lst : List Int), let ans := (double_the_difference lst).run; (ans = PastaLean.pySum ((List.filter (fun v => (v %ₚ (2 : Int) = (1 : Int) ∧ v > (0 : Int)) ∧ !(PastaLean.pyStrContainsSubstr (PastaLean.pyStr v) ".")) (PastaLean.pyIter lst)).map fun v => v *ₚ v) ∧ ans %ₚ (2 : Int) = PastaLean.pyLen ((List.filter (fun v => (v %ₚ (2 : Int) = (1 : Int) ∧ v > (0 : Int)) ∧ !(PastaLean.pyStrContainsSubstr (PastaLean.pyStr v) ".")) (PastaLean.pyIter lst)).map fun v => v) %ₚ (2 : Int)) ∧ ans ≥ (0 : Int) := ⊢ ∀ (lst : List ℤ), let ans := (double_the_difference lst).run; (ans = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pyIter lst))) ∧ ans %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pyIter lst))) %ₚ 2) ∧ ans ≥ 0 lst:List ℤ⊢ let ans := (double_the_difference lst).run; (ans = pySum (List.map (fun v => v *ₚ v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pyIter lst))) ∧ ans %ₚ 2 = pyLen (List.map (fun v => v) (List.filter (fun v => decide ((v %ₚ 2 = 1 ∧ v > 0) ∧ (!pyStrContainsSubstr (pyStr v) ".") = true)) (pyIter lst))) %ₚ 2) ∧ ans ≥ 0 All goals completed! 🐙