diff --git a/Benchmarks/Catalog/RelocFixtureA/lean-toolchain b/Benchmarks/Catalog/RelocFixtureA/lean-toolchain index a8afa7d1b..ba8ebf2db 100644 --- a/Benchmarks/Catalog/RelocFixtureA/lean-toolchain +++ b/Benchmarks/Catalog/RelocFixtureA/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.34.1 diff --git a/Benchmarks/Catalog/RelocFixtureB/lean-toolchain b/Benchmarks/Catalog/RelocFixtureB/lean-toolchain index a8afa7d1b..ba8ebf2db 100644 --- a/Benchmarks/Catalog/RelocFixtureB/lean-toolchain +++ b/Benchmarks/Catalog/RelocFixtureB/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.34.1 diff --git a/Benchmarks/Compile/TruthMines/lean-toolchain b/Benchmarks/Compile/TruthMines/lean-toolchain index a8afa7d1b..ba8ebf2db 100644 --- a/Benchmarks/Compile/TruthMines/lean-toolchain +++ b/Benchmarks/Compile/TruthMines/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.34.1 diff --git a/Benchmarks/Compile/lake-manifest.json b/Benchmarks/Compile/lake-manifest.json index 1112621d5..c304ef45b 100644 --- a/Benchmarks/Compile/lake-manifest.json +++ b/Benchmarks/Compile/lake-manifest.json @@ -5,10 +5,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "0df444a360eaa60ab8c11dca51a86af692955474", + "rev": "d13f23b723b8a846827a245b89c10fc7d3f11612", "name": "mathlib", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.1", + "inputRev": "v4.34.1", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/TauCetiProject/TauCeti", @@ -65,10 +65,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "45eb9afc55ce36516fc98ba10618c010fdced7dc", + "rev": "43420557744f04b5b62d74ac5c7b63eccf2cb7cd", "name": "flt", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.toml"}, {"type": "path", @@ -82,7 +82,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "b7eb3304aeae834b12dda98993a37f6a41f6f0bb", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", "name": "plausible", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -92,7 +92,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "5f4d51b81cbd3f6b32b156bfad9056621a040404", + "rev": "ddf04cf3949fa556442341e87d47f9f6e6074707", "name": "LeanSearchClient", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -102,7 +102,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "16f02aa7642864af59f1ff0e384a015994db9118", + "rev": "e928b72544873815af278d38681b31c0293588e3", "name": "importGraph", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -112,7 +112,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "4be2e3d5087eeb272cf5a8853b8f9dd025ef5957", + "rev": "106ff4fafc74ef4ac99d81dbf3ab399118f497a5", "name": "proofwidgets", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -122,7 +122,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "3448c0bcc5ce01b2d1546e483ec3620e32df3d0e", + "rev": "355695d523e41d0554926416cba2a2b3544fbbc9", "name": "aesop", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -132,7 +132,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "92c15be17b7caf78c2ad767ec40f89052d908d81", + "rev": "6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259", "name": "Qq", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -142,7 +142,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "4488d40d070b9700d4d5a6aa342f0d40c31b2a2d", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", "name": "batteries", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -172,40 +172,40 @@ "type": "git", "subDir": null, "scope": "", - "rev": "a4188d7c2979378d85c6bb41fdd96c3a48a71371", + "rev": "a5621ecfe6416360d4e310c0ed40f3e79ae0710e", "name": "lean4lean", "manifestFile": "lake-manifest.json", - "inputRev": "a4188d7c2979378d85c6bb41fdd96c3a48a71371", + "inputRev": "a5621ecfe6416360d4e310c0ed40f3e79ae0710e", "inherited": true, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover/lean4-cli", "type": "git", "subDir": null, "scope": "leanprover", - "rev": "6130a47896ce867c6a4a55373441e59e565bad0f", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": true, "configFile": "lakefile.toml"}, {"url": "https://github.com/argumentcomputer/Blake3.lean", "type": "git", "subDir": null, "scope": "", - "rev": "e6e908bfd3af607ab44fb462fa2276a2c81addba", + "rev": "3f8b805614a0bae1c033469ff893a8f0ee85f601", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "e6e908bfd3af607ab44fb462fa2276a2c81addba", + "inputRev": "3f8b805614a0bae1c033469ff893a8f0ee85f601", "inherited": true, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", "type": "git", "subDir": null, "scope": "", - "rev": "e780f4188c9649aef988270f4d126651460ca9c4", + "rev": "d8eb3e0d9a8e33fc116e6700df0418a1d8114508", "name": "LSpec", "manifestFile": "lake-manifest.json", - "inputRev": "e780f4188c9649aef988270f4d126651460ca9c4", + "inputRev": "d8eb3e0d9a8e33fc116e6700df0418a1d8114508", "inherited": true, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover/leansqlite", diff --git a/Benchmarks/Compile/lakefile.toml b/Benchmarks/Compile/lakefile.toml index a4cb62724..d555389ce 100644 --- a/Benchmarks/Compile/lakefile.toml +++ b/Benchmarks/Compile/lakefile.toml @@ -42,7 +42,7 @@ path = "../.." [[require]] name = "flt" git = "https://github.com/ImperialCollegeLondon/FLT" -rev = "v4.33.0" +rev = "v4.34.0" [[require]] name = "flt_e2e" @@ -74,4 +74,4 @@ rev = "afb1aacb3632d3236eee756ea1683290c07270a3" [[require]] name = "mathlib" git = "https://github.com/leanprover-community/mathlib4" -rev = "v4.33.1" +rev = "v4.34.1" diff --git a/Benchmarks/Compile/lean-toolchain b/Benchmarks/Compile/lean-toolchain index a8afa7d1b..ba8ebf2db 100644 --- a/Benchmarks/Compile/lean-toolchain +++ b/Benchmarks/Compile/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.34.1 diff --git a/Benchmarks/TruthMines/lean-toolchain b/Benchmarks/TruthMines/lean-toolchain index a8afa7d1b..ba8ebf2db 100644 --- a/Benchmarks/TruthMines/lean-toolchain +++ b/Benchmarks/TruthMines/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.34.1 diff --git a/Ix/Compile/Verify/Audit/Statements.lean b/Ix/Compile/Verify/Audit/Statements.lean index 8e02e4c8d..29a1c66fd 100644 --- a/Ix/Compile/Verify/Audit/Statements.lean +++ b/Ix/Compile/Verify/Audit/Statements.lean @@ -83,8 +83,12 @@ def roots : Array RootAllowance := #[ { root := ``Ix.Compile.Verify.ExprTableWF.mono }, { root := ``Ix.Compile.Verify.Catalog.empty_wf, standardAxioms := standard, nativeAxioms := blake3Native }, + -- `Std.HashMap`'s well-formedness proof reaches core's `Nat.le_iff_lt_add_one` + -- and `Nat.pow_lt_pow_iff_right`, which are classical as of Lean v4.34, so + -- any statement over `Ixon.Env` (hash-map fields) now carries + -- `Classical.choice` regardless of its own proof. { root := ``Ix.Compile.Verify.Catalog.ofEnv_finite, - standardAxioms := noChoice }, + standardAxioms := standard }, { root := ``Ix.Compile.Verify.BlockState.internRef_wf, standardAxioms := standard }, { root := ``Ix.Compile.Verify.BlockState.internUniv_wf, @@ -141,8 +145,10 @@ def roots : Array RootAllowance := #[ { root := ``Ix.Compile.Verify.PreseedCollectionCovers.compileExprRef_of_indexed, standardAxioms := standard, nativeAxioms := blake3Native }, + -- Over hash-map state: carries `Classical.choice` for the reason given at + -- `Catalog.ofEnv_finite` above. { root := ``Ix.Compile.Verify.BlockWireTablesWF.of_preseed, - standardAxioms := noChoice }, + standardAxioms := standard }, { root := ``Ix.Compile.Verify.preseedExprTables_singleton_run_ready, standardAxioms := standard, nativeAxioms := blake3Native }, { root := ``Ix.Compile.Verify.preseedExprTables_singleton_run_ready_wireWF, @@ -477,7 +483,7 @@ def roots : Array RootAllowance := #[ -- Compiled component search (`@[csimp]`): the loop of `searchComponents` -- runs the area- and closure-local search. { root := ``Ix.Sharing.Exact.searchComponents_eq_via, - standardAxioms := noChoice }, + standardAxioms := standard }, { root := ``Ix.Sharing.Exact.searchComponentsWith_eq_fast, standardAxioms := standard }, { root := ``Ix.Compile.Verify.Tiered.canonicalTieredCore_select, @@ -586,7 +592,7 @@ def roots : Array RootAllowance := #[ { root := ``Ix.Sharing.Exact.propagateCounts_eq_fast, standardAxioms := noChoice }, { root := ``Ix.Sharing.Exact.SCtx.phiE_eq_fast, - standardAxioms := noChoice }, + standardAxioms := standard }, { root := ``Ix.Sharing.Exact.csBase_eq_fast, standardAxioms := noChoice } ] diff --git a/Ix/Compile/Verify/Codec.lean b/Ix/Compile/Verify/Codec.lean index 0e71ae373..063a1229d 100644 --- a/Ix/Compile/Verify/Codec.lean +++ b/Ix/Compile/Verify/Codec.lean @@ -63,7 +63,7 @@ theorem Reads.checkCount {getm : Ixon.GetM α} {bytes : ByteArray} {value : α} unfold Ixon.checkCount change (EStateM.bind EStateM.get _) _ = _ simp only [EStateM.bind, EStateM.get] - rw [if_neg hremaining] + rw [ite_eq_right hremaining] rfl change (EStateM.bind (Ixon.checkCount count minBytes) _) _ = _ rw [EStateM.bind, hcheck] @@ -102,7 +102,7 @@ theorem getU8_reads (byte : UInt8) : bytes := before ++ [byte].toByteArray ++ after } : Ixon.GetState) = _ simp only [EStateM.bind, EStateM.get] - rw [if_pos (by + rw [ite_eq_left (by simp only [ByteArray.size_append, List.size_toByteArray, List.length_cons, List.length_nil] omega)] @@ -372,44 +372,44 @@ theorem getTagN_reads (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) (flag : UInt8) unfold tagNBytes Ixon.getTagN simp only by_cases h1 : value.toNat < Ixon.tagNEnd1 f - · rw [if_pos h1, ← ByteArray.append_empty (b := [_].toByteArray)] + · rw [ite_eq_left h1, ← ByteArray.append_empty (b := [_].toByteArray)] refine Reads.bind (getU8_reads _) ?_ obtain ⟨hdiv, hmod⟩ := tagNHeader_fields f hf flag hflag value.toNat (by omega) simp only [hdiv, hmod] - rw [if_pos (by omega)] + rw [ite_eq_left (by omega)] exact Reads.pure_of_eq (tagN_mk_eq rfl rfl) by_cases h2 : value.toNat < Ixon.tagNEnd2 f - · rw [if_neg h1, if_pos h2] + · rw [ite_eq_right h1, ite_eq_left h2] refine Reads.bind (getU8_reads _) ?_ obtain ⟨hdiv, hmod⟩ := tagNHeader_fields f hf flag hflag (2 ^ (8 - f - 1) + (value.toNat - Ixon.tagNEnd1 f) / 256) (by omega) simp only [hdiv, hmod] - rw [if_neg (by omega), if_pos (by omega), ← ByteArray.append_empty (b := [_].toByteArray)] + rw [ite_eq_right (by omega), ite_eq_left (by omega), ← ByteArray.append_empty (b := [_].toByteArray)] refine Reads.bind (getU8_reads _) ?_ exact Reads.pure_of_eq (tagN_mk_eq rfl (by simp; omega)) by_cases h3 : value.toNat < Ixon.tagNEnd3 f - · rw [if_neg h1, if_neg h2, if_pos h3] + · rw [ite_eq_right h1, ite_eq_right h2, ite_eq_left h3] refine Reads.bind (getU8_reads _) ?_ obtain ⟨hdiv, hmod⟩ := tagNHeader_fields f hf flag hflag (2 ^ (8 - f - 1) + 2 ^ (8 - f - 2)) (by omega) simp only [hdiv, hmod] - rw [if_neg (by omega), if_neg (by omega)] + rw [ite_eq_right (by omega), ite_eq_right (by omega)] unfold Ixon.getTagNWide - rw [if_pos (by omega), ← ByteArray.append_empty (b := trimmedBytes _ _)] + rw [ite_eq_left (by omega), ← ByteArray.append_empty (b := trimmedBytes _ _)] have hx : ((value.toNat - Ixon.tagNEnd2 f).toUInt64).toNat = value.toNat - Ixon.tagNEnd2 f := by simp; omega refine Reads.bind (getU64TrimmedLEAux_reads _ 2 (shiftBytes_eq_zero_of_lt _ _ (by rw [hx]; omega))) ?_ exact Reads.pure_of_eq (tagN_mk_eq rfl (by rw [hx]; omega)) by_cases h4 : value.toNat < Ixon.tagNEnd4 f - · rw [if_neg h1, if_neg h2, if_neg h3, if_pos h4] + · rw [ite_eq_right h1, ite_eq_right h2, ite_eq_right h3, ite_eq_left h4] refine Reads.bind (getU8_reads _) ?_ obtain ⟨hdiv, hmod⟩ := tagNHeader_fields f hf flag hflag (2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) + 1) (by omega) simp only [hdiv, hmod] - rw [if_neg (by omega), if_neg (by omega)] + rw [ite_eq_right (by omega), ite_eq_right (by omega)] unfold Ixon.getTagNWide - rw [if_neg (by omega), if_pos (by omega), + rw [ite_eq_right (by omega), ite_eq_left (by omega), ← ByteArray.append_empty (b := trimmedBytes _ _)] have hx : ((value.toNat - Ixon.tagNEnd3 f).toUInt64).toNat = value.toNat - Ixon.tagNEnd3 f := by simp; omega @@ -417,34 +417,34 @@ theorem getTagN_reads (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) (flag : UInt8) (shiftBytes_eq_zero_of_lt _ _ (by rw [hx]; omega))) ?_ exact Reads.pure_of_eq (tagN_mk_eq rfl (by rw [hx]; omega)) by_cases h5 : value.toNat < Ixon.tagNEnd5 f - · rw [if_neg h1, if_neg h2, if_neg h3, if_neg h4, if_pos h5] + · rw [ite_eq_right h1, ite_eq_right h2, ite_eq_right h3, ite_eq_right h4, ite_eq_left h5] refine Reads.bind (getU8_reads _) ?_ obtain ⟨hdiv, hmod⟩ := tagNHeader_fields f hf flag hflag (2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) + 2) (by omega) simp only [hdiv, hmod] - rw [if_neg (by omega), if_neg (by omega)] + rw [ite_eq_right (by omega), ite_eq_right (by omega)] unfold Ixon.getTagNWide - rw [if_neg (by omega), if_neg (by omega), if_pos (by omega), + rw [ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left (by omega), ← ByteArray.append_empty (b := trimmedBytes _ _)] have hx : ((value.toNat - Ixon.tagNEnd4 f).toUInt64).toNat = value.toNat - Ixon.tagNEnd4 f := by simp; omega refine Reads.bind (getU64TrimmedLEAux_reads _ 4 (shiftBytes_eq_zero_of_lt _ _ (by rw [hx]; omega))) ?_ exact Reads.pure_of_eq (tagN_mk_eq rfl (by rw [hx]; omega)) - · rw [if_neg h1, if_neg h2, if_neg h3, if_neg h4, if_neg h5] + · rw [ite_eq_right h1, ite_eq_right h2, ite_eq_right h3, ite_eq_right h4, ite_eq_right h5] refine Reads.bind (getU8_reads _) ?_ obtain ⟨hdiv, hmod⟩ := tagNHeader_fields f hf flag hflag (2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) + 3) (by omega) simp only [hdiv, hmod] - rw [if_neg (by omega), if_neg (by omega)] + rw [ite_eq_right (by omega), ite_eq_right (by omega)] unfold Ixon.getTagNWide - rw [if_neg (by omega), if_neg (by omega), if_neg (by omega), if_pos (by omega), + rw [ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left (by omega), ← ByteArray.append_empty (b := trimmedBytes _ _)] have hx : ((value.toNat - Ixon.tagNEnd5 f).toUInt64).toNat = value.toNat - Ixon.tagNEnd5 f := by simp; omega refine Reads.bind (getU64TrimmedLEAux_reads _ 8 (shiftBytes_eq_zero_of_lt _ _ (by rw [hx]; omega))) ?_ - rw [if_pos (by rw [hx]; omega)] + rw [ite_eq_left (by rw [hx]; omega)] exact Reads.pure_of_eq (tagN_mk_eq rfl (by rw [hx]; omega)) /-- A read law gives the exact full-buffer decode. -/ @@ -513,7 +513,7 @@ theorem tag2Bytes_small (flag : UInt8) (size : UInt64) have hs : size.toNat < Ixon.tagNEnd1 2 := by simpa [UInt64.lt_iff_toNat_lt, show Ixon.tagNEnd1 2 = 32 by decide] using hsize unfold tag2Bytes tagNBytes - simp only [if_pos hs] + simp only [ite_eq_left hs] congr 1 rcases uint8_cases4 flag hflag with rfl | rfl | rfl | rfl <;> rcases uint64_cases32 size hsize with diff --git a/Ix/Compile/Verify/CompileMutualCodec.lean b/Ix/Compile/Verify/CompileMutualCodec.lean index 548abd897..50523c88f 100644 --- a/Ix/Compile/Verify/CompileMutualCodec.lean +++ b/Ix/Compile/Verify/CompileMutualCodec.lean @@ -1951,13 +1951,13 @@ theorem compareExpr_run_ready rw [run_bind, hunivs] simp only by_cases horder : univs.ord != .eq - · rw [if_pos horder] + · rw [ite_eq_left horder] exact ⟨_, rfl⟩ - · rw [if_neg horder] + · rw [ite_eq_right horder] by_cases hname : xname == yname - · rw [if_pos hname] + · rw [ite_eq_left hname] exact ⟨_, rfl⟩ - · rw [if_neg hname] + · rw [ite_eq_right hname] cases hxctx : ctx.get? xname with | some nx => cases hyctx : ctx.get? yname <;> exact ⟨_, rfl⟩ @@ -2084,9 +2084,9 @@ theorem compareExpr_run_ready exact htail ⟨true, .gt⟩ | none => by_cases hname : xtypeName == ytypeName - · rw [if_pos hname] + · rw [ite_eq_left hname] exact htail ⟨true, .eq⟩ - · rw [if_neg hname] + · rw [ite_eq_right hname] obtain ⟨xaddr, hxaddr⟩ := hxresolve hxctx obtain ⟨yaddr, hyaddr⟩ := hyresolve hyctx rw [run_bind, run_lookupConstAddr_resolved_entry @@ -3120,9 +3120,9 @@ private theorem insertSortMutConstMemberByName_length | cons current rest ih => rw [Ix.CompileM.insertSortMutConstMemberByName] by_cases horder : compare source.1.name current.1.name == .gt - · rw [if_pos horder] + · rw [ite_eq_left horder] simp only [List.length_cons, ih] - · rw [if_neg horder] + · rw [ite_eq_right horder] simp private theorem sortMutConstMembersByName_length @@ -3652,15 +3652,15 @@ theorem sortConsts_run_classesWF else pure mappedClasses) = .ok (classes, sortState) at hsort by_cases hempty : mappedClasses.any (fun constClass => constClass.isEmpty) = true - · rw [if_pos hempty, + · rw [ite_eq_left hempty, run_throw compileEnv blockEnv taggedState] at hsort contradiction - · rw [if_neg hempty] at hsort + · rw [ite_eq_right hempty] at hsort by_cases htooMany : sources.length < mappedClasses.length - · rw [if_pos htooMany, + · rw [ite_eq_left htooMany, run_throw compileEnv blockEnv taggedState] at hsort contradiction - · rw [if_neg htooMany, + · rw [ite_eq_right htooMany, run_pure compileEnv blockEnv taggedState] at hsort have hpair : (mappedClasses, taggedState) = (classes, sortState) := Except.ok.inj hsort @@ -3772,7 +3772,7 @@ theorem sortConsts_run_ready else if sources.length < classes.length then throw (.invalidMutualBlock "too many classes after sortConsts") else pure classes) = .ok (classes, taggedState) - rw [if_neg hempty, if_neg htooMany] + rw [ite_eq_right hempty, ite_eq_right htooMany] rfl exact ⟨classes, taggedState, hsort, hloopView, sortConsts_run_classesWF compileEnv blockEnv state taggedState sources diff --git a/Ix/Compile/Verify/CompilePreseed.lean b/Ix/Compile/Verify/CompilePreseed.lean index 33a804f9f..a6d3f5b3e 100644 --- a/Ix/Compile/Verify/CompilePreseed.lean +++ b/Ix/Compile/Verify/CompilePreseed.lean @@ -1059,10 +1059,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.bvar idx hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ | @sort level hash hlevel href => @@ -1070,10 +1070,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.sort level hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨target, href, htargetWire⟩ := href obtain ⟨state', hrun, huniv, htables, hexpr, hcanon, harena⟩ := compileUniv_run_refines compileEnv blockEnv hclosed hfaithful @@ -1092,10 +1092,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.const name levels hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] have hlevelsList : ∀ level ∈ levels.toList, levelSupport level ∧ ∃ u, compileUnivRef (univParamIndex blockEnv.univCtx) level = some u ∧ Codec.Ixon.Univ.WireWF (Ixon.canonUniv u) := by @@ -1144,7 +1144,7 @@ theorem collectExprTablesStructural_run_ready rw [run_bind, hunivsRun] simp only rw [hmut] - simp only [Option.isNone, if_true] + simp only [Option.isNone, ite_true] rw [run_bind, hlookup] rfl | @app fn arg hash hfn harg ihfn iharg => @@ -1152,10 +1152,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.app fn arg hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨fnAcc, fnState, hfnRun, hfnState, hfnCollection, hfnSize⟩ := ihfn (refs, univs, @@ -1181,10 +1181,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.lam name ty body bi hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨tyAcc, tyState, htyRun, htyState, htyCollection, htySize⟩ := ihty (refs, univs, seen.insert @@ -1210,10 +1210,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.forallE name ty body bi hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨tyAcc, tyState, htyRun, htyState, htyCollection, htySize⟩ := ihty (refs, univs, seen.insert @@ -1239,10 +1239,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.letE name ty val body nonDep hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨tyAcc, tyState, htyRun, htyState, htyCollection, htySize⟩ := ihty (refs, univs, seen.insert @@ -1275,10 +1275,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.lit literal hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] cases literal with | natVal n => let bytes := ByteArray.mk (Nat.toBytesLE n) @@ -1307,10 +1307,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.proj typeName field val hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨addr, haddr, haddrWire⟩ := hresolve have haddrLive : resolveConstAddr? compileEnv state typeName = some addr := by @@ -1339,10 +1339,10 @@ theorem collectExprTablesStructural_run_ready rw [Ix.CompileM.collectExprTablesStructural] by_cases hseen : seen.contains ((Ix.Expr.mdata data inner hash).getHash, ctxKey) = true - · rw [if_pos hseen] + · rw [ite_eq_left hseen] exact ⟨_, state, rfl, hstate, hcollection.withSeen, PreseedCollectionSizeBound.same ..⟩ - · rw [if_neg hseen] + · rw [ite_eq_right hseen] obtain ⟨innerAcc, innerState, hinnerRun, hinnerState, hinnerCollection, hinnerSize⟩ := ihinner (refs, univs, @@ -1404,11 +1404,11 @@ theorem collectExprTablesStructural_run_ready_covers have hordinary : OrdinaryExpr source := .bvar rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] have hinsert := hseen.insert source hordinary have hcovered : PreseedCollectionCovers compileEnv blockEnv origin refs univs source := .bvar @@ -1421,11 +1421,11 @@ theorem collectExprTablesStructural_run_ready_covers have hordinary : OrdinaryExpr source := .sort rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] obtain ⟨target, href, htargetWire⟩ := href obtain ⟨state', hrun, huniv, htables, hexpr, hcanon, harena⟩ := compileUniv_run_refines compileEnv blockEnv hclosed hlevelFaithful @@ -1456,11 +1456,11 @@ theorem collectExprTablesStructural_run_ready_covers have hordinary : OrdinaryExpr source := .const rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] have hlevelsList : ∀ level ∈ levels.toList, levelSupport level ∧ ∃ u, compileUnivRef (univParamIndex blockEnv.univCtx) level = some u ∧ @@ -1534,7 +1534,7 @@ theorem collectExprTablesStructural_run_ready_covers rw [run_bind, hunivsRun] simp only rw [hmut] - simp only [Option.isNone, if_true] + simp only [Option.isNone, ite_true] rw [run_bind, hlookup] rfl | @app fn arg hash hfn harg ihfn iharg => @@ -1544,11 +1544,11 @@ theorem collectExprTablesStructural_run_ready_covers .app hfn.supported.ordinary harg.supported.ordinary rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] let inserted : Ix.CompileM.ExprTableCollection := (refs, univs, seen.insert (source.getHash, ctxKey) ()) have hinsert := hseen.insert source hordinary @@ -1586,11 +1586,11 @@ theorem collectExprTablesStructural_run_ready_covers .lam hty.supported.ordinary hbody.supported.ordinary rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] let inserted : Ix.CompileM.ExprTableCollection := (refs, univs, seen.insert (source.getHash, ctxKey) ()) have hinsert := hseen.insert source hordinary @@ -1628,11 +1628,11 @@ theorem collectExprTablesStructural_run_ready_covers .all hty.supported.ordinary hbody.supported.ordinary rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] let inserted : Ix.CompileM.ExprTableCollection := (refs, univs, seen.insert (source.getHash, ctxKey) ()) have hinsert := hseen.insert source hordinary @@ -1672,11 +1672,11 @@ theorem collectExprTablesStructural_run_ready_covers hbody.supported.ordinary rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] let inserted : Ix.CompileM.ExprTableCollection := (refs, univs, seen.insert (source.getHash, ctxKey) ()) have hinsert := hseen.insert source hordinary @@ -1726,11 +1726,11 @@ theorem collectExprTablesStructural_run_ready_covers have hordinary : OrdinaryExpr source := .lit rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] have hinsert := hseen.insert source hordinary cases literal with | natVal n => @@ -1773,11 +1773,11 @@ theorem collectExprTablesStructural_run_ready_covers have hordinary : OrdinaryExpr source := .proj hvalue.supported.ordinary rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] obtain ⟨addr, haddr, haddrWire⟩ := hresolve have haddrLive : resolveConstAddr? compileEnv state typeName = some addr := by @@ -1819,11 +1819,11 @@ theorem collectExprTablesStructural_run_ready_covers have hordinary : OrdinaryExpr source := .mdata hplain hinner.supported.ordinary rw [Ix.CompileM.collectExprTablesStructural] by_cases hhit : seen.contains (source.getHash, ctxKey) = true - · rw [if_pos hhit] + · rw [ite_eq_left hhit] have hcovered := hseen.cover_of_hit hexprFaithful hordinary hactive hhit exact ⟨_, state, rfl, hstate, hcollection, .refl _, hcovered, hseen⟩ - · rw [if_neg hhit] + · rw [ite_eq_right hhit] let inserted : Ix.CompileM.ExprTableCollection := (refs, univs, seen.insert (source.getHash, ctxKey) ()) have hinsert := hseen.insert source hordinary @@ -2833,7 +2833,7 @@ theorem internPreseedRefs_run_wf harena.trans hnextArena, hunivs.trans hnextUnivs⟩ · rw [Ix.CompileM.internPreseedRefs, hnew] - simp only [if_pos] + simp only [ite_eq_left] rw [run_bind, run_discard_internRef] change Ix.CompileM.CompileM.run compileEnv blockEnv next (Ix.CompileM.internPreseedRefs rest (some addr)) = _ @@ -2890,7 +2890,7 @@ theorem internPreseedRefs_run_total harena.trans hnextArena, hunivs.trans hnextUnivs⟩ rw [Ix.CompileM.internPreseedRefs, hnew] - simp only [if_pos] + simp only [ite_eq_left] rw [run_bind, run_discard_internRef] change Ix.CompileM.CompileM.run compileEnv blockEnv next (Ix.CompileM.internPreseedRefs rest (some addr)) = _ @@ -3204,7 +3204,7 @@ theorem internPreseedUnivs_run_wf harena.trans hnextArena, hrefs.trans hnextRefs⟩ · rw [Ix.CompileM.internPreseedUnivs, hnew] - simp only [if_pos] + simp only [ite_eq_left] rw [run_bind, run_discard_internUniv] change Ix.CompileM.CompileM.run compileEnv blockEnv next (Ix.CompileM.internPreseedUnivs rest (some key)) = _ @@ -3263,7 +3263,7 @@ theorem internPreseedUnivs_run_total harena.trans hnextArena, hrefs.trans hnextRefs⟩ rw [Ix.CompileM.internPreseedUnivs, hnew] - simp only [if_pos] + simp only [ite_eq_left] rw [run_bind, run_discard_internUniv] change Ix.CompileM.CompileM.run compileEnv blockEnv next (Ix.CompileM.internPreseedUnivs rest (some key)) = _ diff --git a/Ix/Compile/Verify/CompileSharingCodec.lean b/Ix/Compile/Verify/CompileSharingCodec.lean index 136fb8ed5..fb73b776b 100644 --- a/Ix/Compile/Verify/CompileSharingCodec.lean +++ b/Ix/Compile/Verify/CompileSharingCodec.lean @@ -297,7 +297,7 @@ theorem withRoots_ok_of_size {info : Ixon.ConstantInfo} {roots : Array Ixon.Expr ∃ info', withRoots info roots = .ok info' := by have hlen : roots.toList.length = (constantInfoRoots info).size := by simpa using hsize simp only [withRoots] - rw [if_neg (by simp [hsize])] + rw [ite_eq_right (by simp [hsize])] cases info with | defn d => match roots.toList, hlen with diff --git a/Ix/Compile/Verify/ConstantCodec.lean b/Ix/Compile/Verify/ConstantCodec.lean index 6aa18db31..dd6a7b144 100644 --- a/Ix/Compile/Verify/ConstantCodec.lean +++ b/Ix/Compile/Verify/ConstantCodec.lean @@ -116,7 +116,7 @@ theorem getDefinition_reads (definition : Ixon.Definition) return (⟨kind, safety, lvls, typ, value⟩ : Ixon.Definition)) (tag0Bytes definition.lvls ++ Expr.spineWireEncode definition.typ ++ Expr.spineWireEncode definition.value) definition := by - simpa only [packDefKindSafety_valid, Bool.false_eq_true, if_false] + simpa only [packDefKindSafety_valid, Bool.false_eq_true, ite_false] using hafterLvls' have hall := Reads.bind (next := fun packed : UInt8 => do diff --git a/Ix/Compile/Verify/ConstantTablesCodec.lean b/Ix/Compile/Verify/ConstantTablesCodec.lean index 3549eb50d..743f1428e 100644 --- a/Ix/Compile/Verify/ConstantTablesCodec.lean +++ b/Ix/Compile/Verify/ConstantTablesCodec.lean @@ -45,7 +45,7 @@ theorem getBytes_reads (bytes : ByteArray) : bytes := before ++ bytes ++ after } : Ixon.GetState) = _ simp only [EStateM.bind, EStateM.get] - rw [if_pos (by simp [ByteArray.size_append])] + rw [ite_eq_left (by simp [ByteArray.size_append])] change (EStateM.bind (EStateM.set _) _) _ = _ simp only [EStateM.bind, EStateM.set] change (EStateM.pure _) _ = _ diff --git a/Ix/Compile/Verify/ExprCodec.lean b/Ix/Compile/Verify/ExprCodec.lean index a8495e28f..43338414a 100644 --- a/Ix/Compile/Verify/ExprCodec.lean +++ b/Ix/Compile/Verify/ExprCodec.lean @@ -738,7 +738,7 @@ theorem getExprFuel_reads_single (e : Ixon.Expr) (h : SingleWireWF e) wireEncode ty ++ wireEncode val ++ wireEncode body) (.letE nonDep ty val body) := by simp only [Ixon.getExprFromTag, Ixon.Expr.FLAG_LET, - if_neg (letFlags_not_gt nonDep)] + ite_eq_right (letFlags_not_gt nonDep)] simp only [ByteArray.append_assoc] apply Reads.bind (getBinderContract_reads nonDep.binder) simpa only [Ixon.LetContract.ofFlags?_flags, ByteArray.append_assoc, diff --git a/Ix/Compile/Verify/ExprSpineCodec.lean b/Ix/Compile/Verify/ExprSpineCodec.lean index ce258c2e6..5ba269482 100644 --- a/Ix/Compile/Verify/ExprSpineCodec.lean +++ b/Ix/Compile/Verify/ExprSpineCodec.lean @@ -1152,7 +1152,7 @@ theorem getExprFuel_reads_spine (expr : Ixon.Expr) (h : expr.wireWF) (spineWireEncode base ++ exprListBytes spineWireEncode args) whole := by simp only [Ixon.getExprFromTag, Ixon.Expr.FLAG_APP, hcountBeq, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] apply Reads.checkCount args.length.toUInt64 1 (by have hbytes := exprListBytes_size_ge_length args @@ -1271,7 +1271,7 @@ theorem getExprFuel_reads_spine (expr : Ixon.Expr) (h : expr.wireWF) (lamBinderListBytes spineWireEncode binders ++ spineWireEncode base) whole := by simp only [Ixon.getExprFromTag, Ixon.Expr.FLAG_LAM, hcountBeq, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] apply Reads.checkCount binders.length.toUInt64 2 (by have hbytes := lamBinderListBytes_size_ge_length binders @@ -1391,7 +1391,7 @@ theorem getExprFuel_reads_spine (expr : Ixon.Expr) (h : expr.wireWF) (allBinderListBytes spineWireEncode binders ++ spineWireEncode base) whole := by simp only [Ixon.getExprFromTag, Ixon.Expr.FLAG_ALL, hcountBeq, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] apply Reads.checkCount binders.length.toUInt64 2 (by have hbytes := allBinderListBytes_size_ge_length binders @@ -1443,7 +1443,7 @@ theorem getExprFuel_reads_spine (expr : Ixon.Expr) (h : expr.wireWF) ([nonDep.binder.toBits].toByteArray ++ spineWireEncode ty ++ spineWireEncode val ++ spineWireEncode body) (.letE nonDep ty val body) := by simp only [Ixon.getExprFromTag, Ixon.Expr.FLAG_LET, - if_neg (letFlags_not_gt nonDep)] + ite_eq_right (letFlags_not_gt nonDep)] simp only [ByteArray.append_assoc] apply Reads.bind (getBinderContract_reads nonDep.binder) simpa only [Ixon.LetContract.ofFlags?_flags, ByteArray.append_assoc, diff --git a/Ix/Compile/Verify/SharingExact.lean b/Ix/Compile/Verify/SharingExact.lean index 71d02cc86..b771c96e3 100644 --- a/Ix/Compile/Verify/SharingExact.lean +++ b/Ix/Compile/Verify/SharingExact.lean @@ -93,37 +93,37 @@ theorem tagNWidth_mono {i j : Nat} (h : i ≤ j) : tagNWidth i ≤ tagNWidth j : theorem tagNWidth_rung1 {i : Nat} (h : i < tagNRung1End) : tagNWidth i = 1 := by rw [tagNRung1End_eq] at h - rw [tagNWidth_eq, if_pos h] + rw [tagNWidth_eq, ite_eq_left h] theorem tagNWidth_rung2 {i : Nat} (h1 : tagNRung1End ≤ i) (h2 : i < tagNRung2End) : tagNWidth i = 2 := by rw [tagNRung1End_eq] at h1 rw [tagNRung2End_eq] at h2 - rw [tagNWidth_eq, if_neg (by omega), if_pos h2] + rw [tagNWidth_eq, ite_eq_right (by omega), ite_eq_left h2] theorem tagNWidth_rung3 {i : Nat} (h1 : tagNRung2End ≤ i) (h2 : i < tagNRung3End) : tagNWidth i = 3 := by rw [tagNRung2End_eq] at h1 rw [tagNRung3End_eq] at h2 - rw [tagNWidth_eq, if_neg (by omega), if_neg (by omega), if_pos h2] + rw [tagNWidth_eq, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left h2] theorem tagNWidth_rung4 {i : Nat} (h1 : tagNRung3End ≤ i) (h2 : i < tagNRung4End) : tagNWidth i = 4 := by rw [tagNRung3End_eq] at h1 rw [tagNRung4End_eq] at h2 - rw [tagNWidth_eq, if_neg (by omega), if_neg (by omega), if_neg (by omega), if_pos h2] + rw [tagNWidth_eq, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left h2] theorem tagNWidth_rung5 {i : Nat} (h1 : tagNRung4End ≤ i) (h2 : i < tagNRung5End) : tagNWidth i = 5 := by rw [tagNRung4End_eq] at h1 rw [tagNRung5End_eq] at h2 - rw [tagNWidth_eq, if_neg (by omega), if_neg (by omega), if_neg (by omega), - if_neg (by omega), if_pos h2] + rw [tagNWidth_eq, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), + ite_eq_right (by omega), ite_eq_left h2] theorem tagNWidth_rung6 {i : Nat} (h1 : tagNRung5End ≤ i) : tagNWidth i = 9 := by rw [tagNRung5End_eq] at h1 - rw [tagNWidth_eq, if_neg (by omega), if_neg (by omega), if_neg (by omega), - if_neg (by omega), if_neg (by omega)] + rw [tagNWidth_eq, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), + ite_eq_right (by omega), ite_eq_right (by omega)] /-- The Share width is the `f = 4` instance of the TagN width function. -/ theorem tagNWidth_eq_byteWidth : tagNWidth = Ixon.tagNByteWidth 4 := rfl diff --git a/Ix/Compile/Verify/SharingExactCanon.lean b/Ix/Compile/Verify/SharingExactCanon.lean index 8d19fa19a..bbe0fc1de 100644 --- a/Ix/Compile/Verify/SharingExactCanon.lean +++ b/Ix/Compile/Verify/SharingExactCanon.lean @@ -83,8 +83,8 @@ theorem children_corr {temp₁ temp₂ : Array Node} (hcp₁ : CP temp₁) (hcp refine ⟨hhead, hsize, fun k hk₁ hk₂ => ?_⟩ have := hk k (by rw [← har₁ t ht]; exact hk₁) rw [child_eq_getElem _ k hk₁, child_eq_getElem _ k hk₂] at this - rw [if_pos (hcp₁ t ht _ (Array.getElem_mem hk₁)), - if_pos (hcp₂ s hs _ (Array.getElem_mem hk₂))] at this + rw [ite_eq_left (hcp₁ t ht _ (Array.getElem_mem hk₁)), + ite_eq_left (hcp₂ s hs _ (Array.getElem_mem hk₂))] at this exact this /-! ## Reachability -/ @@ -150,7 +150,7 @@ theorem foldl_setTrue_getElem (l : List Nat) (arr : Array Bool) (t : Nat) : by_cases hx : x = t · subst hx by_cases hlt : x < arr.size <;> simp [hlt] - · simp only [hx, if_false] + · simp only [hx, ite_false] constructor · rintro (h | ⟨h1, h2⟩) · exact Or.inl h @@ -351,7 +351,7 @@ theorem nodeHeights_spec {temp : Array Node} (hcp : CP temp) (t : Nat) (ht : t < have hsame : ∀ c, c < m → (step H m)[c]! = H[c]! := by intro c hc simp only [step, setBang_getElem!] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] refine ⟨by simp [step, hsize], fun t' ht' => ?_⟩ have hcongr : heightOf temp (step H m) t' = heightOf temp H t' := heightOf_congr temp _ _ t' fun c hc => @@ -360,7 +360,7 @@ theorem nodeHeights_spec {temp : Array Node} (hcp : CP temp) (t : Nat) (ht : t < by_cases htm : t' = m · subst htm simp only [step, setBang_getElem!, hsize] - rw [if_pos (by simp; omega)] + rw [ite_eq_left (by simp; omega)] · rw [hsame t' (by omega)] exact hprev t' (by omega) have := (hinv temp.size (Nat.le_refl _)).2 t ht @@ -622,11 +622,11 @@ theorem placeFold_spec : · rw [hout] simp · simp only [List.map_cons, List.mem_cons, not_or] at hu - rw [hother u hu.2, setBang_getElem!, if_neg (by intro h; exact hu.1 h.1.symm)] + rw [hother u hu.2, setBang_getElem!, ite_eq_right (by intro h; exact hu.1 h.1.symm)] · cases i with | zero => simp only [List.getElem_cons_zero] - rw [hother t htnot, setBang_getElem!, if_pos ⟨rfl, ht⟩] + rw [hother t htnot, setBang_getElem!, ite_eq_left ⟨rfl, ht⟩] simp | succ i => simp only [List.getElem_cons_succ] @@ -742,7 +742,7 @@ theorem bucket_perm have hφ : ∀ t, Reach temp₁ roots₁ t → Corr temp₁ temp₂ roots₁ roots₂ t (φ t) := by intro t ht have hex := corr_total h₁ h₂ hroots ht - simp only [φ, dif_pos hex] + simp only [φ, dite_eq_left hex] exact hex.choose_spec have hnd : (B₁.toList.map φ).Nodup := by refine nodup_map_on ?_ (bucket_nodup hB₁) @@ -810,7 +810,7 @@ theorem bucket_step (h₁ : Run temp₁ roots₁) (h₂ : Run temp₂ roots₂) rw [placeBucket_eq, placeBucket_eq, placeSorted_eq, placeSorted_eq, ← hnodes] by_cases hk : keysIncreasing none ((sortedGroup temp₁ st₁.1 B₁).map (·.2)) = true · right - rw [if_pos hk, if_pos hk] + rw [ite_eq_left hk, ite_eq_left hk] refine ⟨_, _, rfl, rfl, ?_⟩ obtain ⟨hout, hs₁, hs₂, hagree⟩ := hinv obtain ⟨canon₁, out₁⟩ := st₁ @@ -862,7 +862,7 @@ theorem bucket_step (h₁ : Run temp₁ roots₁) (h₂ : Run temp₂ roots₂) ((sortedGroup temp₁ canon₁ B₁).map (·.2))[j]'hj' := by rw [hni, hkey, ← hnj] simp only [hnodes] - exact (List.getElem_inj hnd).mp this + exact (List.Nodup.getElem_inj hnd).mp this subst hij have e₁ := hp₁ i hi have e₂ := hp₂ i hj @@ -871,7 +871,7 @@ theorem bucket_step (h₁ : Run temp₁ roots₁) (h₂ : Run temp₂ roots₂) simp only at e₁ e₂ rw [e₁, e₂] · left - rw [if_neg hk, if_neg hk] + rw [ite_eq_right hk, ite_eq_right hk] exact ⟨_, rfl, rfl⟩ /-! ## All height groups -/ diff --git a/Ix/Compile/Verify/TagN.lean b/Ix/Compile/Verify/TagN.lean index 2df62fab6..04bec6adc 100644 --- a/Ix/Compile/Verify/TagN.lean +++ b/Ix/Compile/Verify/TagN.lean @@ -201,19 +201,19 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) generalize b.toNat % 2 ^ (8 - f) = p at h hhdr hpR generalize (b.toNat / 2 ^ (8 - f)).toUInt8 = flag at h hhdr hflag by_cases h1 : p < 2 ^ (8 - f - 1) - · rw [if_pos h1] at h + · rw [ite_eq_left h1] at h obtain ⟨rfl, rfl⟩ := pure_ok_inv h have hv : p.toUInt64.toNat = p := toUInt64_toNat_of_lt (by omega) refine ⟨?_, hflag⟩ have henc : tagNBytes f flag p.toUInt64 = [b].toByteArray ++ ByteArray.empty := by unfold tagNBytes simp only - rw [hv, if_pos (by omega), hhdr, ByteArray.append_empty] + rw [hv, ite_eq_left (by omega), hhdr, ByteArray.append_empty] rw [henc] exact hc1.trans (Consumed.empty _) - rw [if_neg h1] at h + rw [ite_eq_right h1] at h by_cases h2 : p - 2 ^ (8 - f - 1) < 2 ^ (8 - f - 2) - · rw [if_pos h2] at h + · rw [ite_eq_left h2] at h obtain ⟨lo, s2, hlo, h⟩ := bind_ok_inv h obtain ⟨rfl, rfl⟩ := pure_ok_inv h obtain ⟨hc2, -⟩ := getU8_ok hlo @@ -225,7 +225,7 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) lo.toNat).toUInt64 = [b].toByteArray ++ [lo].toByteArray := by unfold tagNBytes simp only - rw [hv, if_neg (by omega), if_pos (by omega)] + rw [hv, ite_eq_right (by omega), ite_eq_left (by omega)] have e1 : 2 ^ (8 - f - 1) + (Ixon.tagNEnd1 f + (p - 2 ^ (8 - f - 1)) * 256 + lo.toNat - Ixon.tagNEnd1 f) / 256 = p := by omega have e2 : ((Ixon.tagNEnd1 f + (p - 2 ^ (8 - f - 1)) * 256 + lo.toNat - @@ -236,10 +236,10 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) rw [e1, e2, hhdr] rw [henc] exact hc1.trans hc2 - rw [if_neg h2] at h + rw [ite_eq_right h2] at h unfold Ixon.getTagNWide at h by_cases h3 : p - 2 ^ (8 - f - 1) - 2 ^ (8 - f - 2) = 0 - · rw [if_pos h3] at h + · rw [ite_eq_left h3] at h obtain ⟨x, s2, hx, h⟩ := bind_ok_inv h obtain ⟨rfl, rfl⟩ := pure_ok_inv h obtain ⟨hc2, hxlt⟩ := getU64TrimmedLEAux_ok (by omega) hx @@ -250,15 +250,15 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) [b].toByteArray ++ trimmedBytes x 2 := by unfold tagNBytes simp only - rw [hv, if_neg (by omega), if_neg (by omega), if_pos (by omega), + rw [hv, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left (by omega), show 2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) = p by omega, hhdr, show Ixon.tagNEnd2 f + x.toNat - Ixon.tagNEnd2 f = x.toNat by omega] simp rw [henc] exact hc1.trans hc2 - rw [if_neg h3] at h + rw [ite_eq_right h3] at h by_cases h4 : p - 2 ^ (8 - f - 1) - 2 ^ (8 - f - 2) = 1 - · rw [if_pos h4] at h + · rw [ite_eq_left h4] at h obtain ⟨x, s2, hx, h⟩ := bind_ok_inv h obtain ⟨rfl, rfl⟩ := pure_ok_inv h obtain ⟨hc2, hxlt⟩ := getU64TrimmedLEAux_ok (by omega) hx @@ -269,15 +269,15 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) [b].toByteArray ++ trimmedBytes x 3 := by unfold tagNBytes simp only - rw [hv, if_neg (by omega), if_neg (by omega), if_neg (by omega), if_pos (by omega), + rw [hv, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left (by omega), show 2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) + 1 = p by omega, hhdr, show Ixon.tagNEnd3 f + x.toNat - Ixon.tagNEnd3 f = x.toNat by omega] simp rw [henc] exact hc1.trans hc2 - rw [if_neg h4] at h + rw [ite_eq_right h4] at h by_cases h5 : p - 2 ^ (8 - f - 1) - 2 ^ (8 - f - 2) = 2 - · rw [if_pos h5] at h + · rw [ite_eq_left h5] at h obtain ⟨x, s2, hx, h⟩ := bind_ok_inv h obtain ⟨rfl, rfl⟩ := pure_ok_inv h obtain ⟨hc2, hxlt⟩ := getU64TrimmedLEAux_ok (by omega) hx @@ -288,20 +288,20 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) [b].toByteArray ++ trimmedBytes x 4 := by unfold tagNBytes simp only - rw [hv, if_neg (by omega), if_neg (by omega), if_neg (by omega), if_neg (by omega), - if_pos (by omega), + rw [hv, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), + ite_eq_left (by omega), show 2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) + 2 = p by omega, hhdr, show Ixon.tagNEnd4 f + x.toNat - Ixon.tagNEnd4 f = x.toNat by omega] simp rw [henc] exact hc1.trans hc2 - rw [if_neg h5] at h + rw [ite_eq_right h5] at h by_cases h6 : p - 2 ^ (8 - f - 1) - 2 ^ (8 - f - 2) = 3 - · rw [if_pos h6] at h + · rw [ite_eq_left h6] at h obtain ⟨x, s2, hx, h⟩ := bind_ok_inv h obtain ⟨hc2, hxlt⟩ := getU64TrimmedLEAux_ok (by omega) hx by_cases hov : Ixon.tagNEnd5 f + x.toNat < 2 ^ 64 - · rw [if_pos hov] at h + · rw [ite_eq_left hov] at h obtain ⟨rfl, rfl⟩ := pure_ok_inv h have hv := toUInt64_toNat_of_lt hov refine ⟨?_, hflag⟩ @@ -309,16 +309,16 @@ theorem getTagN_consumed (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) [b].toByteArray ++ trimmedBytes x 8 := by unfold tagNBytes simp only - rw [hv, if_neg (by omega), if_neg (by omega), if_neg (by omega), if_neg (by omega), - if_neg (by omega), + rw [hv, ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), + ite_eq_right (by omega), show 2 ^ (8 - f - 1) + 2 ^ (8 - f - 2) + 3 = p by omega, hhdr, show Ixon.tagNEnd5 f + x.toNat - Ixon.tagNEnd5 f = x.toNat by omega] simp rw [henc] exact hc1.trans hc2 - · rw [if_neg hov] at h + · rw [ite_eq_right hov] at h exact (throw_ok_false h).elim - rw [if_neg h6] at h + rw [ite_eq_right h6] at h exact (throw_ok_false h).elim /-- Every byte string accepted by the full-buffer TagN decoder is the @@ -395,9 +395,9 @@ theorem getTagN_rejects_code (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) rw [hbyte] at hcode simp only at h generalize b.toNat % 2 ^ (8 - f) = p at h hcode - rw [if_neg (by omega), if_neg (by omega)] at h + rw [ite_eq_right (by omega), ite_eq_right (by omega)] at h unfold Ixon.getTagNWide at h - rw [if_neg (by omega), if_neg (by omega), if_neg (by omega), if_neg (by omega)] at h + rw [ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega)] at h exact throw_ok_false h /-- With a 4-bit flag every header code is valid: the `L = M = 1` code has two @@ -431,9 +431,9 @@ theorem getTagN_rejects_overflow (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) simp [ByteArray.append_assoc], getU8_reads hdr before (trimmedBytes x 8 ++ after)] at hb cases hb simp only [hdiv, hmod] at h - rw [if_neg (by omega), if_neg (by omega)] at h + rw [ite_eq_right (by omega), ite_eq_right (by omega)] at h unfold Ixon.getTagNWide at h - rw [if_neg (by omega), if_neg (by omega), if_neg (by omega), if_pos (by omega)] at h + rw [ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_right (by omega), ite_eq_left (by omega)] at h obtain ⟨y, s2, hy, h⟩ := bind_ok_inv h have hr := getU64TrimmedLEAux_reads x 8 (shiftBytes_eq_zero_of_lt x 8 (by simpa using x.toNat_lt)) @@ -443,7 +443,7 @@ theorem getTagN_rejects_overflow (f : Nat) (hf : f = 0 ∨ f = 2 ∨ f = 4) before ++ [hdr].toByteArray ++ trimmedBytes x 8 ++ after by simp [ByteArray.append_assoc], hr] at hy cases hy - rw [if_neg (by omega)] at h + rw [ite_eq_right (by omega)] at h exact throw_ok_false h end Ix.Compile.Verify.TagN diff --git a/Ix/Compile/Verify/TieredGuard.lean b/Ix/Compile/Verify/TieredGuard.lean index 5c7c1bf19..9ecef6d25 100644 --- a/Ix/Compile/Verify/TieredGuard.lean +++ b/Ix/Compile/Verify/TieredGuard.lean @@ -276,7 +276,7 @@ theorem PrepWF.gBuild_tree {p : Prep} (hp : PrepWF p) intro c e' hc he have hc' : ∃ e', c < p.dag.size ∧ p.build ev index width false fuel c = .ok e' := ⟨e', hc, he⟩ - simp only [Tof, dif_pos hc'] + simp only [Tof, dite_eq_left hc'] have hsame : Classical.choose hc' = e' := by have h2 : (Except.ok (Classical.choose hc') : Except SharingError Ixon.Expr) = .ok e' := (Classical.choose_spec hc').2.symm.trans he @@ -292,7 +292,7 @@ theorem PrepWF.gBuild_tree {p : Prep} (hp : PrepWF p) have hent : entry = true → choice ≠ .share := by intro he subst he - simp only [if_true] at hpick + simp only [ite_true] at hpick exact pickOption_filter_ne_share _ hpick split at h · rename_i hcheck @@ -700,7 +700,7 @@ theorem prefix_lookup {n : Nat} {table : Array Nat} (hnd : table.toList.Nodup) apply indexOfPairs_isSome _ _ d (by simp; exact hd) refine Or.inr ⟨j, List.mem_zipIdx_iff_getElem?.mpr ?_⟩ simp only [List.getElem?_take] - rw [if_pos hjk] + rw [ite_eq_left hjk] simpa using hj obtain ⟨i, hi⟩ := Option.isSome_iff_exists.mp hsome obtain ⟨hik, hti⟩ := indexOfPrefix_spec n table k d i hi diff --git a/Ix/Compile/Verify/TieredModel.lean b/Ix/Compile/Verify/TieredModel.lean index 82f27641b..e100cd87a 100644 --- a/Ix/Compile/Verify/TieredModel.lean +++ b/Ix/Compile/Verify/TieredModel.lean @@ -133,7 +133,7 @@ theorem PrepWF.gCost_eq (wd : Nat → Nat) (avail : Nat → Bool) (t : Nat) (ht have hsame : ∀ c, c < m → (step A m)[c]! = A[c]! := by intro c hc simp only [step, setBang_getElem!] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] refine ⟨by simp [step, hsize], fun t' ht' => ?_⟩ have hcongr : gCostOf p wd avail ((step A m)[·]!) t' = gCostOf p wd avail (A[·]!) t' := hp.gCostOf_congr (by omega) fun c hc => hsame c (by omega) @@ -141,7 +141,7 @@ theorem PrepWF.gCost_eq (wd : Nat → Nat) (avail : Nat → Bool) (t : Nat) (ht by_cases htm : t' = m · subst htm simp only [step, setBang_getElem!, hsize] - rw [if_pos (by simp; omega)] + rw [ite_eq_left (by simp; omega)] · rw [hsame t' (by omega)] exact hprev t' (by omega) have := (hinv p.dag.size (Nat.le_refl _)).2 t ht @@ -219,7 +219,7 @@ theorem PrepWF.gCutScan_spec {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {avai have hcand : tag4Size (p.spineLen[t]! - p.spineLen[spineAt p t k]!) + (prefixSides p cost t p.spineLen[t]! - sides[spineAt p t k]!) + (widthOf width (spineAt p t k)).getD 0 = gCutCost p wd cost t k := by - rw [hlenk, hsides k (by omega) hkl, hwidth, if_pos hav] + rw [hlenk, hsides k (by omega) hkl, hwidth, ite_eq_left hav] have hsplit := prefixSides_add p cost k (p.spineLen[t]! - k) t rw [show k + (p.spineLen[t]! - k) = p.spineLen[t]! by omega] at hsplit unfold gCutCost @@ -251,18 +251,18 @@ theorem PrepWF.gEvalStep_spec {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava obtain ⟨hcs, hss, hbs⟩ := hsz have keepN : ∀ (v : Nat) (arr : Array Nat) (i : Nat), i ≠ m → (arr.set! m v)[i]! = arr[i]! := by intro v arr i hi - rw [setBang_getElem!, if_neg (by intro h; exact hi h.1.symm)] + rw [setBang_getElem!, ite_eq_right (by intro h; exact hi h.1.symm)] have keepO : ∀ (v : Option Nat) (arr : Array (Option Nat)) (i : Nat), i ≠ m → (arr.set! m v)[i]! = arr[i]! := by intro v arr i hi - rw [setBang_getElem!, if_neg (by intro h; exact hi h.1.symm)] + rw [setBang_getElem!, ite_eq_right (by intro h; exact hi h.1.symm)] have atN : ∀ (v : Nat) (arr : Array Nat), arr.size = p.dag.size → (arr.set! m v)[m]! = v := by intro v arr hs - rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩] + rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩] have atO : ∀ (v : Option Nat) (arr : Array (Option Nat)), arr.size = p.dag.size → (arr.set! m v)[m]! = v := by intro v arr hs - rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩] + rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩] have hcostLt : ∀ c, c < m → st.cost[c]! = gCost p wd avail c := fun c hc => (hrows c hc).1 have hcm := hp.gCost_eq wd avail m hm have hcostOf : ∀ inl, gInlOf p wd avail (gCost p wd avail) m = inl → @@ -279,11 +279,11 @@ theorem PrepWF.gEvalStep_spec {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava have hfold : (p.dag.node m).children.foldl (fun acc c => acc + st.cost[c]!) (p.dag.node m).head.ownBytes = gInlOf p wd avail (gCost p wd avail) m := by unfold gInlOf - rw [if_pos hf] + rw [ite_eq_left hf] exact foldl_add_congr _ _ fun c hc => hcostLt c (hp.dag.child_lt hm hc) have hst' : st'.cost = st.cost.set! m (gCost p wd avail m) ∧ st'.sides = st.sides ∧ st'.below = st.below := by - simp only [st', evalStep, haff, if_true, hf, beq_self_eq_true] + simp only [st', evalStep, haff, ite_true, hf, beq_self_eq_true] refine ⟨?_, trivial, trivial⟩ congr 1 exact hcostOf _ hfold.symm @@ -306,28 +306,28 @@ theorem PrepWF.gEvalStep_spec {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava prefixSides p (gCost p wd avail) m p.spineLen[m]! := by rw [hcostLt _ hside] rcases hp.spine_step hm hf with ⟨hs, hl, _⟩ | ⟨hs, hl, _⟩ - · rw [if_pos hs, ((hrows _ hlt).2 (by rw [hs]; exact hf)).1, hl] + · rw [ite_eq_left hs, ((hrows _ hlt).2 (by rw [hs]; exact hf)).1, hl] rfl - · rw [if_neg hs, hl] + · rw [ite_eq_right hs, hl] simp [prefixSides, sideCost] have hB : FirstAvail p avail m 1 (if p.family[snext p m]! = p.family[m]! then (if (widthOf width (snext p m)).isSome then some (snext p m) else st.below[snext p m]!) else none) := by rcases hp.spine_step hm hf with ⟨hs, hl, _⟩ | ⟨hs, hl, _⟩ - · rw [if_pos hs, hwidth] + · rw [ite_eq_left hs, hwidth] have hn1 := (hp.spine (snext p m) (by omega) (by rw [hs]; exact hf)).1 by_cases hav : avail (snext p m) = true - · rw [if_pos hav] + · rw [ite_eq_left hav] exact ⟨1, Nat.le_refl _, by omega, rfl, hav, fun k' h1 h2 => by omega⟩ - · rw [if_neg hav] - simp only [Option.isSome_none, Bool.false_eq_true, if_false] + · rw [ite_eq_right hav] + simp only [Option.isSome_none, Bool.false_eq_true, ite_false] have hrow := ((hrows _ hlt).2 (by rw [hs]; exact hf)).2 have hlen1 : p.spineLen[spineAt p m 1]! = p.spineLen[m]! - 1 := by simp only [spineAt]; omega exact FirstAvail.unshift (by omega) (by simpa [spineAt] using hav) (FirstAvail.shift hlen1 hrow) - · rw [if_neg hs] + · rw [ite_eq_right hs] intro k h1 h2 omega generalize hBdef : (if p.family[snext p m]! = p.family[m]! then @@ -365,12 +365,12 @@ theorem PrepWF.gEvalStep_spec {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava p.spineLen[m]! B (tag4Size p.spineLen[m]! + S + st.cost[p.tail[m]!]!) st.work).1 := by rw [hscan, hcostLt _ htl] unfold gInlOf - rw [if_neg hf, gCutCosts_eq, naturalCost, hSdef] + rw [ite_eq_right hf, gCutCosts_eq, naturalCost, hSdef] have hst' : st'.cost = st.cost.set! m (gCost p wd avail m) ∧ st'.sides = st.sides.set! m S ∧ st'.below = st.below.set! m B := by - simp only [st', evalStep, haff, if_true] + simp only [st', evalStep, haff, ite_true] have hfb : (p.family[m]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] simp only [ite_beq_family] rw [show (p.dag.node m).spineNext = snext p m from rfl, hS, hBdef] refine ⟨?_, rfl, rfl⟩ @@ -519,14 +519,14 @@ theorem PrepWF.gCutOptions_spec {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {a have hcand : tag4Size (p.spineLen[t]! - p.spineLen[spineAt p t k]!) + (prefixSides p (gCost p wd avail) t p.spineLen[t]! - ev.sides[spineAt p t k]!) + (widthOf width (spineAt p t k)).getD 0 = gCutCost p wd (gCost p wd avail) t k := by - rw [hlenk, hsides k (by omega) hkl, hwidth, if_pos hav] + rw [hlenk, hsides k (by omega) hkl, hwidth, ite_eq_left hav] have hsplit := prefixSides_add p (gCost p wd avail) k (p.spineLen[t]! - k) t rw [show k + (p.spineLen[t]! - k) = p.spineLen[t]! by omega] at hsplit unfold gCutCost rw [show p.spineLen[t]! - (p.spineLen[t]! - k) = k by omega, hsplit] simp have hidx : (index[spineAt p t k]?.getD none).isSome = true := by rw [hindex]; exact hav - simp only [Prep.cutOptions, hidx, if_true] + simp only [Prep.cutOptions, hidx, ite_true] obtain ⟨L, hL, hcost, hnot⟩ := ih (k + 1) _ _ (by omega) (by omega) (by omega) (FirstAvail.shift hlenk (hbelow k (by omega) hkl)) refine ⟨(Choice.cut (p.spineLen[t]! - p.spineLen[spineAt p t k]!), @@ -562,11 +562,11 @@ theorem PrepWF.gInlineCost_eq {p : Prep} (hp : PrepWF p) unfold Prep.inlineCost Prep.options gInl by_cases hf : p.family[t]! = .none · have hfb : (p.family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true] + simp only [hfb, ite_true] have hfold : (p.dag.node t).children.foldl (fun acc c => acc + ev.cost[c]!) (p.dag.node t).head.ownBytes = gInlOf p wd avail (gCost p wd avail) t := by unfold gInlOf - rw [if_pos hf] + rw [ite_eq_left hf] exact foldl_add_congr _ _ fun c hc => hcost c (by have := hp.dag.child_lt ht hc; omega) rw [pickOption_cost _ (Choice.inline, gInlOf p wd avail (gCost p wd avail) t, @@ -577,7 +577,7 @@ theorem PrepWF.gInlineCost_eq {p : Prep} (hp : PrepWF p) rw [hbase, hfold] rfl · have hfb : (p.family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] obtain ⟨hs, hb⟩ := (hrow t ht).2 hf obtain ⟨_, hk, _, htl, _⟩ := hp.spine t ht hf have hspine : ∀ k, 1 ≤ k → k < p.spineLen[t]! → @@ -610,7 +610,7 @@ theorem PrepWF.gInlineCost_eq {p : Prep} (hp : PrepWF p) rw [pickOption_cost _ natOpt L] · rw [hLcost, hnat] unfold gInlOf - rw [if_neg hf, gCutCosts_eq] + rw [ite_eq_right hf, gCutCosts_eq] · simp only [base, natOpt] at hL hbase rw [Array.toList_filter] refine (congrArg (List.filter _) hL).trans ?_ @@ -704,14 +704,14 @@ theorem PrepWF.gCutOptions_pairs {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} { have hcand : tag4Size (p.spineLen[t]! - p.spineLen[spineAt p t k]!) + (prefixSides p (gCost p wd avail) t p.spineLen[t]! - ev.sides[spineAt p t k]!) + (widthOf width (spineAt p t k)).getD 0 = gCutCost p wd (gCost p wd avail) t k := by - rw [hlenk, hsides k (by omega) hkl, hwidth, if_pos hav] + rw [hlenk, hsides k (by omega) hkl, hwidth, ite_eq_left hav] have hsplit := prefixSides_add p (gCost p wd avail) k (p.spineLen[t]! - k) t rw [show k + (p.spineLen[t]! - k) = p.spineLen[t]! by omega] at hsplit unfold gCutCost rw [show p.spineLen[t]! - (p.spineLen[t]! - k) = k by omega, hsplit] simp have hidx : (index[spineAt p t k]?.getD none).isSome = true := by rw [hindex]; exact hav - simp only [Prep.cutOptions, hidx, if_true] + simp only [Prep.cutOptions, hidx, ite_true] obtain ⟨L, hL, hcost⟩ := ih (k + 1) _ _ (by omega) (by omega) (by omega) (FirstAvail.shift hlenk (hbelow k (by omega) hkl)) refine ⟨(Choice.cut (p.spineLen[t]! - p.spineLen[spineAt p t k]!), @@ -758,7 +758,7 @@ theorem PrepWF.gOptions_mem {p : Prep} (hp : PrepWF p) unfold Prep.options at h by_cases hf : p.family[t]! = .none · have hfb : (p.family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true, Array.toList_push, List.mem_append, List.mem_singleton] at h + simp only [hfb, ite_true, Array.toList_push, List.mem_append, List.mem_singleton] at h rcases h with h | h · obtain ⟨h1, h2, h3⟩ := hbase _ h exact Or.inl ⟨h1, h2, h3⟩ @@ -766,10 +766,10 @@ theorem PrepWF.gOptions_mem {p : Prep} (hp : PrepWF p) obtain ⟨rfl, rfl, _⟩ := h refine Or.inr (Or.inl ⟨rfl, hf, ?_⟩) unfold gInl gInlOf - rw [if_pos hf] + rw [ite_eq_left hf] exact foldl_add_congr _ _ fun c _ => hcost c · have hfb : (p.family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] at h + simp only [hfb, Bool.false_eq_true, ite_false] at h obtain ⟨hs, hb⟩ := (hrow t ht).2 hf obtain ⟨hl1, hk, _, htl, _⟩ := hp.spine t ht hf have hspine : ∀ k, 1 ≤ k → k < p.spineLen[t]! → @@ -852,13 +852,13 @@ theorem PrepWF.gBuild_size {p : Prep} (hp : PrepWF p) cases entry with | false => simp only [Bool.false_or, beq_iff_eq] at hcheck - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [← hcost, hcheck] | true => - simp only [if_true] + simp only [ite_true] rw [← hp.gInlineCost_eq ev hev index width hwidth hindex t ht] unfold Prep.inlineCost - simp only [if_true] at hpick + simp only [ite_true] at hpick rw [hpick] rfl rw [hc] @@ -878,7 +878,7 @@ theorem PrepWF.gBuild_size {p : Prep} (hp : PrepWF p) · cases h1 · rw [hcv] unfold gInl gInlOf - rw [if_pos hf] + rw [ite_eq_left hf] have har := hp.dag.arity t ht rw [← dag_node_eq ht] at har cases hh : (p.dag.node t).head <;> simp only [hh] at h har @@ -888,7 +888,7 @@ theorem PrepWF.gBuild_size {p : Prep} (hp : PrepWF p) have hc0 : (p.dag.node t).child 0 < t := hp.dag.childAt_lt ht (by simp [hh, Head.arity]) obtain ⟨hvs, _⟩ := ih false _ v (by omega) hv - simp only [Bool.false_eq_true, if_false] at hvs + simp only [Bool.false_eq_true, ite_false] at hvs refine ⟨?_, fun F' _ => by cases F' <;> rfl⟩ rw [← Array.foldl_toList, children_toList (m := 1) (by simpa [Head.arity] using har)] simp [sizeInfoWith, SizeInfo.plain, hvs, Head.ownBytes] <;> omega @@ -906,7 +906,7 @@ theorem PrepWF.gBuild_size {p : Prep} (hp : PrepWF p) obtain ⟨hs0, _⟩ := ih false _ ty (by omega) hty obtain ⟨hs1, _⟩ := ih false _ v (by omega) hv obtain ⟨hs2, _⟩ := ih false _ bd (by omega) hbd - simp only [Bool.false_eq_true, if_false] at hs0 hs1 hs2 + simp only [Bool.false_eq_true, ite_false] at hs0 hs1 hs2 refine ⟨?_, fun F' _ => by cases F' <;> rfl⟩ rw [← Array.foldl_toList, children_toList (m := 3) (by simpa [Head.arity] using har)] simp [sizeInfoWith, SizeInfo.plain, hs0, hs1, hs2, Head.ownBytes, @@ -986,7 +986,7 @@ theorem PrepWF.gBuild_size {p : Prep} (hp : PrepWF p) simp only at htl' rw [hjeq, hend] at htl' obtain ⟨htfull, htonly⟩ := ih false _ tl (by omega) htl' - simp only [Bool.false_eq_true, if_false] at htfull + simp only [Bool.false_eq_true, ite_false] at htfull obtain ⟨_, hfull, honly⟩ := spineFold_size sc p.family[t]! _ (fun n => gCost p wd avail n.sideChild) _ _ _ hfam hsz (htonly _ (Ne.symm htf)) hfold @@ -1030,7 +1030,7 @@ theorem PrepWF.gInl_node {p : Prep} (hp : PrepWF p) (wd : Nat → Nat) (S : Nat gInlOf p wd S f x = (p.dag.node x).head.ownBytes + ((List.range (p.dag.node x).head.arity).map fun i => f ((p.dag.node x).child i)).sum := by unfold gInlOf - rw [if_pos hf, ← Array.foldl_toList, foldl_add_eq_sum] + rw [ite_eq_left hf, ← Array.foldl_toList, foldl_add_eq_sum] have har := hp.dag.arity x hx rw [← dag_node_eq hx] at har rw [children_toList har, List.map_map] @@ -1040,7 +1040,7 @@ theorem gInl_tele {p : Prep} (wd : Nat → Nat) (S : Nat → Bool) (f : Nat → {x : Nat} (hf : p.family[x]! ≠ .none) : gInlOf p wd S f x = (gCutCosts p wd S f x).foldl min (naturalCost p f x) := by unfold gInlOf - rw [if_neg hf] + rw [ite_eq_right hf] theorem gCut_mem_cutCosts (p : Prep) (wd : Nat → Nat) (S : Nat → Bool) (f : Nat → Nat) {x j : Nat} (hj1 : 1 ≤ j) (hj : j < p.spineLen[x]!) (hS : S (spineAt p x j) = true) : @@ -1049,7 +1049,7 @@ theorem gCut_mem_cutCosts (p : Prep) (wd : Nat → Nat) (S : Nat → Bool) (f : unfold gCutsFrom apply List.mem_filterMap.mpr refine ⟨j, List.mem_range'_1.mpr ⟨hj1, by omega⟩, ?_⟩ - rw [if_pos hS] + rw [ite_eq_left hS] theorem gcosts_eq_range (p : Prep) (wd : Nat → Nat) (l : List WTree) : WTree.gcosts p wd l = ((List.range l.length).map fun k => (l[k]?.getD default).gcost p wd).sum := by @@ -1073,7 +1073,7 @@ theorem PrepWF.gValid_cost {p : Prep} (hp : PrepWF p) (wd : Nat → Nat) (S : Na refine ⟨?_, fun h => by simp [WTree.isShare] at h⟩ rw [hp.gCost_eq wd S _ hx] unfold gCostOf - simp only [hS, if_true, WTree.gcost] + simp only [hS, ite_true, WTree.gcost] omega | @node x kids hf hlen _ ih => intro hx @@ -1173,7 +1173,7 @@ theorem PrepWF.gExists_opt {p : Prep} (hp : PrepWF p) (wd : Nat → Nat) (S : Na have hg : ∀ c, c < x → Valid p S c (g c) ∧ (g c).gcost p wd = gCost p wd S c := by intro c hc have hcn : c < p.dag.size := by omega - simp only [g, dif_pos (And.intro hc hcn)] + simp only [g, dite_eq_left (And.intro hc hcn)] exact Classical.choose_spec (ih c hc hcn).1 -- an optimal inline writing have hinl : ∃ T, Valid p S x T ∧ T.isShare = false ∧ T.gcost p wd = gInl p wd S x := by @@ -1243,14 +1243,14 @@ theorem PrepWF.gExists_opt {p : Prep} (hp : PrepWF p) (wd : Nat → Nat) (S : Na by_cases hS : S x = true · by_cases hle : wd x ≤ gInlOf p wd S (gCost p wd S) x · refine ⟨.share x, Valid.share hS, ?_⟩ - simp only [hS, if_true, WTree.gcost] + simp only [hS, ite_true, WTree.gcost] omega · refine ⟨T, hT, ?_⟩ - simp only [hS, if_true] + simp only [hS, ite_true] unfold gInl at hTc omega · refine ⟨T, hT, ?_⟩ - simp only [hS, Bool.false_eq_true, if_false] + simp only [hS, Bool.false_eq_true, ite_false] exact hTc /-! ## Locality and the incremental re-evaluation -/ @@ -1513,7 +1513,7 @@ theorem evalUp_ok {dag : Dag} (hwf : DagWF dag) {wd wd' : Nat → Nat} {A A' : N exact ⟨k1.trans r1, k2.trans r2, k3.trans r3⟩ · have hid : step st (t + m) = st := by simp only [step, evalStep] - rw [if_neg hmark] + rw [ite_eq_right hmark] rw [hid] refine ⟨hs, fun u hu => ?_, fun u hu => hrest u (by omega)⟩ by_cases hum : u < t + m @@ -1670,10 +1670,10 @@ theorem options_split (p : Prep) (ev : DictEval) (index width : Array (Option Na p.options ev index width t = optShare index width t ++ optRest p ev index width t := by unfold Prep.options optShare optRest by_cases hf : (p.family[t]! == Family.none) = true - · simp only [hf, if_true] + · simp only [hf, ite_true] rw [Array.push_eq_append] rfl - · simp only [hf, if_false, Bool.false_eq_true] + · simp only [hf, ite_false, Bool.false_eq_true] rw [Array.push_eq_append, cutOptions_append] rfl @@ -1787,9 +1787,9 @@ theorem optRest_congr {t : Nat} (ht : t < dag.size) hagB w (hc.trans hw) (by have := Desc.le_of_wf hwf hw (by omega); omega) unfold optRest by_cases hf : ((Prep.ofDag dag).family[t]! == .none) = true - · simp only [hf, if_true, ofDag_dag] + · simp only [hf, ite_true, ofDag_dag] rw [foldl_add_congr _ _ fun c hc => hcostBelow c (desc_of_child hc) (hwf.child_lt ht hc)] - · simp only [hf, if_false, Bool.false_eq_true] + · simp only [hf, ite_false, Bool.false_eq_true] have hf' : (Prep.ofDag dag).family[t]! ≠ .none := by simpa using hf obtain ⟨_, _, hend, htl, _⟩ := hp.spine t ht hf' obtain ⟨hs, hb⟩ := rows_agree_strict hwf hev hev' ht hf' hagB @@ -1857,7 +1857,7 @@ theorem build_congr : have hopt' := hp.gOptions_mem ev' hev' index' width' hwB hiB ht hmem simp only [ofDag_dag] by_cases hchk : (entry || c == ev'.cost[t]!) = true - · simp only [hchk, if_true] + · simp only [hchk, ite_true] cases choice with | share => rw [(hag t (.refl _)).1] | inline => @@ -1921,7 +1921,7 @@ theorem build_congr : (spineAt (Prep.ofDag dag) t j) with | error e => rfl | ok tl => exact foldrM_congr_mem hside _ - · simp only [hchk, Bool.false_eq_true, if_false] + · simp only [hchk, Bool.false_eq_true, ite_false] rfl end Congr @@ -2010,9 +2010,9 @@ theorem PrepWF.gEvalStep_work {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava have keepO : ∀ (v : Option Nat) (arr : Array (Option Nat)) (i : Nat), i ≠ m → (arr.set! m v)[i]! = arr[i]! := by intro v arr i hi - rw [setBang_getElem!, if_neg (by intro h; exact hi h.1.symm)] + rw [setBang_getElem!, ite_eq_right (by intro h; exact hi h.1.symm)] by_cases hf : p.family[m]! = .none - · simp only [evalStep, haff, if_true, hf, beq_self_eq_true] + · simp only [evalStep, haff, ite_true, hf, beq_self_eq_true] · obtain ⟨hl1, hk, _, _, _⟩ := hp.spine m hm hf have hlt := hp.snext_lt hm hf have hB : FirstAvail p avail m 1 @@ -2020,19 +2020,19 @@ theorem PrepWF.gEvalStep_work {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava (if (widthOf width (snext p m)).isSome then some (snext p m) else st.below[snext p m]!) else none) := by rcases hp.spine_step hm hf with ⟨hs, hl, _⟩ | ⟨hs, hl, _⟩ - · rw [if_pos hs, hwidth] + · rw [ite_eq_left hs, hwidth] have hn1 := (hp.spine (snext p m) (by omega) (by rw [hs]; exact hf)).1 by_cases hav : avail (snext p m) = true - · rw [if_pos hav] + · rw [ite_eq_left hav] exact ⟨1, Nat.le_refl _, by omega, rfl, hav, fun k' h1 h2 => by omega⟩ - · rw [if_neg hav] - simp only [Option.isSome_none, Bool.false_eq_true, if_false] + · rw [ite_eq_right hav] + simp only [Option.isSome_none, Bool.false_eq_true, ite_false] have hrow := ((hrows _ hlt).2 (by rw [hs]; exact hf)).2 have hlen1 : p.spineLen[spineAt p m 1]! = p.spineLen[m]! - 1 := by simp only [spineAt]; omega exact FirstAvail.unshift (by omega) (by simpa [spineAt] using hav) (FirstAvail.shift hlen1 hrow) - · rw [if_neg hs] + · rw [ite_eq_right hs] intro k h1 h2 omega generalize hBdef : (if p.family[snext p m]! = p.family[m]! then @@ -2052,11 +2052,11 @@ theorem PrepWF.gEvalStep_work {p : Prep} (hp : PrepWF p) {wd : Nat → Nat} {ava ((p.dag.node m).sideExtra + st.cost[(p.dag.node m).sideChild]! + (if p.family[snext p m]! = p.family[m]! then st.sides[snext p m]! else 0)) hbelow p.spineLen[m]! 1 B best st.work (Nat.le_refl _) (by omega) (by omega) hB - simp only [evalStep, haff, if_true] + simp only [evalStep, haff, ite_true] have hfb : (p.family[m]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] simp only [ite_beq_family] - rw [show (p.dag.node m).spineNext = snext p m from rfl, hBdef, if_neg hf] + rw [show (p.dag.node m).spineNext = snext p m from rfl, hBdef, ite_eq_right hf] rw [hwork] omega @@ -2117,13 +2117,13 @@ theorem evalUp_work {dag : Dag} (hwf : DagWF dag) {wd wd' : Nat → Nat} {A A' : obtain ⟨r1, r2, r3⟩ := hrest u (by omega) exact ⟨k1.trans r1, k2.trans r2, k3.trans r3⟩ · rw [hw', hwork] - simp only [List.filter_cons, List.filter_nil, hmark, if_true, List.map_cons, + simp only [List.filter_cons, List.filter_nil, hmark, ite_true, List.map_cons, List.map_nil, List.sum_cons, List.sum_nil] unfold nodeWork omega · have hid : step st (t + m) = st := by simp only [step, evalStep] - rw [if_neg hmark] + rw [ite_eq_right hmark] rw [hid] refine ⟨hs, fun u hu => ?_, fun u hu => hrest u (by omega), ?_⟩ · by_cases hum : u < t + m @@ -2150,7 +2150,7 @@ theorem evalAll_none_work {dag : Dag} (hwf : DagWF dag) : have hwidth : ∀ u, widthOf (Array.replicate dag.size none) u = if (fun _ => false) u then some ((fun _ => 0) u) else none := by intro u - simp only [widthOf, Array.getElem?_replicate, Bool.false_eq_true, if_false] + simp only [widthOf, Array.getElem?_replicate, Bool.false_eq_true, ite_false] split <;> rfl let step := evalStep (Prep.ofDag dag).dag (Prep.ofDag dag).family (Prep.ofDag dag).spineLen (Prep.ofDag dag).tail (Array.replicate dag.size none) (Array.replicate dag.size true) diff --git a/Ix/Compile/Verify/TieredPhase3.lean b/Ix/Compile/Verify/TieredPhase3.lean index bac5d4983..ea8a0d6a6 100644 --- a/Ix/Compile/Verify/TieredPhase3.lean +++ b/Ix/Compile/Verify/TieredPhase3.lean @@ -349,11 +349,11 @@ theorem spineParentLists_spec {dag : Dag} (x : Nat) (hx : x < dag.size) : rw [Array.getElem?_modify] by_cases hxj : (dag.node j).spineNext = x · subst hxj - rw [if_pos rfl, Array.getElem?_eq_getElem (by rw [hs]; exact hx)] + rw [ite_eq_left rfl, Array.getElem?_eq_getElem (by rw [hs]; exact hx)] simp only [Option.map_some, Option.getD_some, Array.toList_push] rw [← hl _ hx, Array.getElem?_eq_getElem (by rw [hs]; exact hx)] simp [cond, hc] - · rw [if_neg hxj, hl x hx] + · rw [ite_eq_right hxj, hl x hx] simp [hxj] · rename_i hc rw [hl x hx] @@ -487,7 +487,7 @@ theorem filter_length_unique {L : List Nat} (hL : L.Nodup) (q : Nat → Prop) [D subst this exact ha hy simp [hqa, hnone] - · simp only [List.filter_cons, hqa, decide_false, Bool.false_eq_true, if_false, ih'] + · simp only [List.filter_cons, hqa, decide_false, Bool.false_eq_true, ite_false, ih'] congr 1 apply propext constructor @@ -606,7 +606,7 @@ theorem spineCount_add {A A' : Nat → Bool} {t : Nat} (hA't : A' t = true) (hAt by_cases hf : (Prep.ofDag dag).family[u]! = .none · have : ¬ OnSpine (Prep.ofDag dag) t u := fun h => h.1 hf simp [hf, this] - · simp only [hf, if_false] + · simp only [hf, ite_false] unfold spineAvailCount rw [filter_length_or _ (fun k => A (spineAt (Prep.ofDag dag) u k)) (fun k => A' (spineAt (Prep.ofDag dag) u k)) (fun k => decide (spineAt (Prep.ofDag dag) u k = t)) @@ -714,7 +714,7 @@ theorem awGo_spec : · rw [setBang_getElem!, Array.mem_push] by_cases hv : v = ((parentEdgeLists dag)[queue[k]]?.getD #[])[j] · subst hv; simp [hinv.size, hpar.1] - · simp only [hv, false_and, if_false, Ne.symm hv] + · simp only [hv, false_and, ite_false, Ne.symm hv] rw [hinv.marked v] simp · rw [setBang_getElem!] @@ -804,7 +804,7 @@ theorem ancestorWork_spec (hwf : DagWF dag) {mark queue mark' queue' : Array Nat · rw [setBang_getElem!, ← Array.mem_toList_iff, hq0, List.mem_singleton] by_cases hut : u = t · subst hut; simp [hms, ht] - · rw [if_neg (fun h => hut h.1.symm)] + · rw [ite_eq_right (fun h => hut h.1.symm)] have := hlt u constructor · intro h; omega @@ -866,7 +866,7 @@ theorem evalHidden_model {wdK wdi : Nat → Nat} {AK Ai : Nat → Bool} {ev : Di rw [widthOf_setBang_none] by_cases hu : u = t · simp [hu] - · simp only [hu, if_false]; exact hwidth u + · simp only [hu, ite_false]; exact hwidth u have hrows : ∀ u, u < t → GEvalRow (Prep.ofDag dag) (fun u => if u = t then 0 else wdK u) (fun u => if u = t then false else AK u) ev u := by intro u hu @@ -881,7 +881,7 @@ theorem evalHidden_model {wdK wdi : Nat → Nat} {AK Ai : Nat → Bool} {ev : Di refine gCost_local hwf t ht fun v hv => ?_ by_cases hvt : v = t · subst hvt; simp [hAi, hwdi] - · simp only [hvt, if_false]; exact hag v hv hvt + · simp only [hvt, ite_false]; exact hag v hv hvt variable {wdA wdB : Nat → Nat} {A B : Nat → Bool} {ev ev' : DictEval} {index index' width width' : Array (Option Nat)} @@ -916,9 +916,9 @@ theorem buildTop_eq {t : Nat} (ht : t < dag.size) (hnone : index'[t]?.getD none have hpick : (Prep.ofDag dag).pickBuild ev index width true t = pickOption ((Prep.ofDag dag).options ev' index' width' t) := by have h1 := pick_options_lazy (Prep.ofDag dag) ev index width true t - rw [pickLazy_eq_pickBuild, if_pos rfl] at h1 + rw [pickLazy_eq_pickBuild, ite_eq_left rfl] at h1 rw [← h1, options_filter, hopts, optRest_congr hwf hev hev' hwA hwB hiA hiB ht hag] - simp only [Prep.buildTop, Prep.build, hpick, Bool.false_eq_true, if_false, Bool.false_or] + simp only [Prep.buildTop, Prep.build, hpick, Bool.false_eq_true, ite_false, Bool.false_or] generalize hpk : pickOption ((Prep.ofDag dag).options ev' index' width' t) = pk rcases pk with _ | ⟨choice, c⟩ · rfl @@ -926,7 +926,7 @@ theorem buildTop_eq {t : Nat} (ht : t < dag.size) (hnone : index'[t]?.getD none have hopt' := hp.gOptions_mem ev' hev' index' width' hwB hiB ht hb simp only [ofDag_dag] by_cases hchk : (c == ev'.cost[t]!) = true - · simp only [hchk, if_true] + · simp only [hchk, ite_true] cases choice with | share => rw [hopts] at hb @@ -994,7 +994,7 @@ theorem buildTop_eq {t : Nat} (ht : t < dag.size) (hnone : index'[t]?.getD none (spineAt (Prep.ofDag dag) t j) with | error e => rfl | ok tl => exact foldrM_congr_mem hside _ - · simp only [hchk, Bool.false_eq_true, if_false] + · simp only [hchk, Bool.false_eq_true, ite_false] rfl end Entry @@ -1041,7 +1041,7 @@ theorem maxBelow_ge {dag : Dag} (hwf : DagWF dag) (pos : Nat → Nat) : have hkeep : ∀ x, x ≠ m → (F st m)[x]! = st[x]! := by intro x hx simp only [F] - rw [setBang_getElem!, if_neg (fun h => hx h.1.symm)] + rw [setBang_getElem!, ite_eq_right (fun h => hx h.1.symm)] refine ⟨by simp [F, hs], fun u hu c hc => ?_⟩ have hcu := hwf.child_lt (by omega) hc rw [hkeep c (by omega)] @@ -1050,7 +1050,7 @@ theorem maxBelow_ge {dag : Dag} (hwf : DagWF dag) (pos : Nat → Nat) : have hset : (F st u)[u]! = (dag.node u).children.foldl (fun m c => max m (max (pos c) st[c]!)) 0 := by simp only [F] - rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩] + rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩] rw [hset, ← Array.foldl_toList] have := (foldl_max_bound (fun c => max (pos c) st[c]!) (dag.node u).children.toList 0).2 c (Array.mem_toList_iff.mpr hc) @@ -1094,12 +1094,12 @@ theorem indexOfPrefix_iff {n : Nat} {table : Array Nat} have htk := htab k (by omega) by_cases hut : u = table[k]! · subst hut - rw [if_pos ⟨rfl, htk⟩, Option.some.injEq] + rw [ite_eq_left ⟨rfl, htk⟩, Option.some.injEq] constructor · rintro rfl; exact ⟨by omega, rfl⟩ · rintro ⟨hj, hjk⟩ exact (hdist j k (by omega) (by omega) hjk).symm - · rw [if_neg (fun h => hut h.1.symm), hiff] + · rw [ite_eq_right (fun h => hut h.1.symm), hiff] constructor · rintro ⟨hj, rfl⟩; exact ⟨by omega, rfl⟩ · rintro ⟨hj, rfl⟩ @@ -1313,12 +1313,12 @@ theorem onePassLoop_sim : simp only [hE1] at h simp only [ofDag_dag] at h by_cases hc : st.ev.cost[table[i]!]! > limits.maxMaterialize - · simp only [hc, if_true, Option.some.injEq] at h + · simp only [hc, ite_true, Option.some.injEq] at h subst h apply loopRel_error rw [materializeStep_eq] simp [hc] - · simp only [hc, if_false] at h + · simp only [hc, ite_false] at h rw [hE2] at h cases hb : (Prep.ofDag dag).build st.ev st.index st.width false (dag.size + 1) table[i]! with | error e => @@ -1332,12 +1332,12 @@ theorem onePassLoop_sim : rw [hb] at h simp only at h by_cases hw : st.work + st.ev.work + st.ev.cost[table[i]!]! > limits.maxMaterializeWork - · simp only [hw, if_true, Option.some.injEq] at h + · simp only [hw, ite_true, Option.some.injEq] at h subst h apply loopRel_error rw [materializeStep_eq] simp [hc, hb, hw, ofDag_dag] - · simp only [hw, if_false] at h + · simp only [hw, ite_false] at h cases hsa : spineAdd (spineParentLists dag (Prep.ofDag dag).family) sc table[i]! with | none => rw [hsa] at h; cases h | some sc' => @@ -1356,7 +1356,7 @@ theorem onePassLoop_sim : st.predicted + st.ev.cost[table[i]!]!, st.work + st.ev.work + st.ev.cost[table[i]!]!⟩ have hstep : materializeStep (Prep.ofDag dag) table limits widthAt st i = .ok st' := by rw [materializeStep_eq] - simp only [ofDag_dag, hc, if_false, hb, hw] + simp only [ofDag_dag, hc, ite_false, hb, hw] rfl have hI' := tableEvInv_step hwf hsize hrange ⟨by omega, hidx, hwid, hev, by assumption, by assumption, by assumption⟩ hi hstep @@ -1423,7 +1423,7 @@ theorem materializeTableOnePass_eq (dag : Dag) (table roots : Array Nat) (limits · unfold materializeTable; simp [h1] cases h2 : table.all (· < (Prep.ofDag dag).dag.size) · unfold materializeTable; simp [h1, h2] - simp only [h1, if_false, Bool.not_true, Bool.false_eq_true] + simp only [h1, ite_false, Bool.not_true, Bool.false_eq_true] by_cases h3f : onePassOrder (Prep.ofDag dag).dag table roots (indexOfPrefix (Prep.ofDag dag).dag.size table table.size) = false · simp [h3f] @@ -1434,7 +1434,7 @@ theorem materializeTableOnePass_eq (dag : Dag) (table roots : Array Nat) (limits have h3' : (!onePassOrder (Prep.ofDag dag).dag table roots (indexOfPrefix (Prep.ofDag dag).dag.size table table.size)) = false := by rw [ofDag_dag, h3]; rfl - simp only [h3', Bool.false_eq_true, if_false] + simp only [h3', Bool.false_eq_true, ite_false] obtain ⟨hwf, hroots, hord⟩ := onePassOrder_spec h3 have hp := prepWF_ofDag hwf have htab : ∀ i, i < table.size → table[i]! < dag.size := by @@ -1497,7 +1497,7 @@ theorem materializeTableOnePass_eq (dag : Dag) (table roots : Array Nat) (limits (by simp [ofDag_dag]) (fun u => by by_cases hu : u < dag.size <;> simp [hu, ofDag_dag]) hloop unfold materializeTable - simp only [h1, h2, if_false, Bool.not_true, Bool.false_eq_true] + simp only [h1, h2, ite_false, Bool.not_true, Bool.false_eq_true] rw [List.range_eq_range'] rcases res with e | ⟨entries, work, evWork, predicted⟩ · simp only [LoopRel] at hrel diff --git a/Ix/Compile/Verify/TieredSelect.lean b/Ix/Compile/Verify/TieredSelect.lean index e9dee26a3..d13eefd7d 100644 --- a/Ix/Compile/Verify/TieredSelect.lean +++ b/Ix/Compile/Verify/TieredSelect.lean @@ -89,25 +89,25 @@ theorem select_three (c₁ c₂ c₃ : TieredSharingResult) (h₁ : c₁.stats.w rcases hc with rfl | rfl | rfl <;> assumption by_cases b₁ : tieredBetter c₂ c₁ = true · have f₁ := e₁.mp b₁ - rw [if_pos b₁] + rw [ite_eq_left b₁] by_cases b₂ : tieredBetter c₃ c₂ = true · have f₂ := e₃.mp b₂ - rw [if_pos b₂] + rw [ite_eq_left b₂] exact key c₃ (by simp) (mem3 _ (by omega) (by omega) (by omega)) (mem3 _ (by rw [h₁, h₃]; omega) (by rw [h₂, h₃]; omega) (fun _ => by omega)) · have f₂ := mt e₃.mpr b₂ - rw [if_neg b₂] + rw [ite_eq_right b₂] exact key c₂ (by simp) (mem3 _ (by omega) (by omega) (by omega)) (mem3 _ (by rw [h₁, h₂]; omega) (fun _ => by omega) (by rw [h₂, h₃]; omega)) · have f₁ := mt e₁.mpr b₁ - rw [if_neg b₁] + rw [ite_eq_right b₁] by_cases b₂ : tieredBetter c₃ c₁ = true · have f₂ := e₂.mp b₂ - rw [if_pos b₂] + rw [ite_eq_left b₂] exact key c₃ (by simp) (mem3 _ (by omega) (by omega) (by omega)) (mem3 _ (by rw [h₁, h₃]; omega) (by rw [h₂, h₃]; omega) (fun _ => by omega)) · have f₂ := mt e₂.mpr b₂ - rw [if_neg b₂] + rw [ite_eq_right b₂] exact key c₁ (by simp) (mem3 _ (by omega) (by omega) (by omega)) (mem3 _ (fun _ => by omega) (by rw [h₁, h₂]; omega) (by rw [h₁, h₃]; omega)) diff --git a/Ix/Compile/Verify/TieredTier.lean b/Ix/Compile/Verify/TieredTier.lean index 6066d68ab..5d12ee293 100644 --- a/Ix/Compile/Verify/TieredTier.lean +++ b/Ix/Compile/Verify/TieredTier.lean @@ -91,16 +91,16 @@ theorem tierBound_eq (weight : Nat → Nat) (inF : List Nat) : simp only [tierBound] by_cases hr : room = 0 · subst hr - simp only [if_true] + simp only [ite_true] cases h : (t :: ts).filter (fun x => !inF.contains x) <;> simp [topSum] - · rw [if_neg hr] + · rw [ite_eq_right hr] by_cases hc : inF.contains t = true - · rw [if_pos hc, ih] + · rw [ite_eq_left hc, ih] have hc' : t ∈ inF := by simpa using hc simp [hc'] - · rw [if_neg hc, ih] + · rw [ite_eq_right hc, ih] obtain ⟨r, rfl⟩ : ∃ r, room = r + 1 := ⟨room - 1, by omega⟩ - simp only [List.filter_cons, hc, Bool.not_false, if_true, topSum, + simp only [List.filter_cons, hc, Bool.not_false, ite_true, topSum, Nat.add_sub_cancel] omega @@ -388,7 +388,7 @@ theorem tierClosures_fold {deps : Nat → List Nat} {cap : Nat} : exact hok x hx · rw [List.mem_singleton] at hx subst hx - simp only [beq_self_eq_true, if_true] + simp only [beq_self_eq_true, ite_true] exact closureEntry_spec hdok · rcases List.mem_append.mp hx with hx | hx · exact List.mem_append_left _ (hclosed x hx d hd) @@ -568,11 +568,11 @@ theorem leaves_shape {deps : Nat → List Nat} {closure : Nat → Option (List N have hitems' : items = (pre ++ [t]) ++ ts := by rw [hitems]; simp simp only [tierLeaves] at hF by_cases ht : inF.contains t = true - · rw [if_pos ht] at hF + · rw [ite_eq_left ht] at hF obtain ⟨X, rfl, hX, hXr, hfin⟩ := ih _ _ _ hitems' (hinv.skip (contains_iff.mp ht)) F hF exact ⟨X, rfl, hX, fun x hx => ⟨List.mem_cons_of_mem _ (hXr x hx).1, (hXr x hx).2⟩, hfin⟩ · have ht' : t ∉ inF := fun h => ht (contains_iff.mpr h) - rw [if_neg ht] at hF + rw [ite_eq_right ht] at hF rcases List.mem_append.mp hF with hI | hE · cases hc : closure t with | none => rw [hc] at hI; cases hI @@ -650,14 +650,14 @@ theorem leaves_complete {deps : Nat → List Nat} {closure : Nat → Option (Lis have hitems' : items = (pre ++ [t]) ++ ts := by rw [hitems]; simp simp only [tierLeaves] by_cases ht : inF.contains t = true - · rw [if_pos ht] + · rw [ite_eq_left ht] have ht' := contains_iff.mp ht refine ih _ _ _ hitems' (hinv.skip ht') hin hex fun x hx hxG => ?_ rcases List.mem_append.mp hx with h | h · exact hpre x h hxG · rw [List.mem_singleton] at h; exact h ▸ ht' · have ht' : t ∉ inF := fun h => ht (contains_iff.mpr h) - rw [if_neg ht] + rw [ite_eq_right ht] have htI : t ∈ items := by rw [hitems]; simp by_cases htG : t ∈ G · -- include @@ -705,7 +705,7 @@ theorem leaves_complete {deps : Nat → List Nat} {closure : Nat → Option (Lis exact List.mem_append_right _ htN) refine ⟨F, List.mem_append_left _ ?_, hFG⟩ dsimp only - rw [if_pos hcond] + rw [ite_eq_left hcond] exact hF · -- exclude obtain ⟨F, hF, hFG⟩ := ih _ _ _ hitems' (hinv.exclude ht') hin @@ -732,7 +732,7 @@ theorem leaves_order {deps : Nat → List Nat} {closure : Nat → Option (List N have hitems' : items = (pre ++ [t]) ++ ts := by rw [hitems]; simp simp only [tierLeaves] by_cases ht : inF.contains t = true - · rw [if_pos ht] + · rw [ite_eq_left ht] have ht' := contains_iff.mp ht have hsub := ih _ _ _ hitems' (hinv.skip ht') refine hsub.imp_of_mem fun {A B} hA hB hAB => Or.inr ⟨?_, hAB⟩ @@ -740,7 +740,7 @@ theorem leaves_order {deps : Nat → List Nat} {closure : Nat → Option (List N obtain ⟨Y, rfl, -⟩ := leaves_shape hctx ts _ _ _ hitems' (hinv.skip ht') B hB exact iff_of_true (List.mem_append_left _ ht') (List.mem_append_left _ ht') · have ht' : t ∉ inF := fun h => ht (contains_iff.mpr h) - rw [if_neg ht] + rw [ite_eq_right ht] have hE := ih _ _ _ hitems' (hinv.exclude ht') have hEt : ∀ B ∈ tierLeaves closure cap ts inF (t :: ex), t ∉ B := by intro B hB @@ -809,7 +809,7 @@ theorem fold_noop (weight : Nat → Nat) {b : Nat} {B : List Nat} : | cons F L ih => intro h simp only [List.foldl_cons, leafUpd, tierUpd] - rw [if_neg (by have := h F List.mem_cons_self; omega)] + rw [ite_eq_right (by have := h F List.mem_cons_self; omega)] exact ih fun G hG => h G (List.mem_cons_of_mem _ hG) /-- The fold over the leaves keeps the first heaviest leaf. -/ @@ -981,12 +981,12 @@ theorem tierDfs_spec {deps : Nat → List Nat} {closure : Nat → Option (List N have hb1 : st1.best = st.best := by rw [← hst1] split at h · rename_i hin - rw [if_pos hin, ← hb1] + rw [ite_eq_left hin, ← hb1] refine ih _ _ _ _ _ _ _ hcur hex ?_ h rw [htake] exact hinv.skip (contains_iff.mp hin) · rename_i hin - rw [if_neg hin, List.foldl_append] + rw [ite_eq_right hin, List.foldl_append] have ht' : items[pos]! ∉ inF := fun h => hin (contains_iff.mpr h) have hex' : ∀ u, (excluded.insert items[pos]!).contains u = true ↔ u ∈ items[pos]! :: ex := by @@ -1021,7 +1021,7 @@ theorem tierDfs_spec {deps : Nat → List Nat} {closure : Nat → Option (List N rw [hany c] at h split at h · rename_i hcond - rw [if_pos hcond] + rw [ite_eq_left hcond] obtain ⟨st2, hst2, h⟩ := Ix.Compile.Verify.SharingExact.bind_eq_ok h simp only [Bool.and_eq_true, Bool.not_eq_true', decide_eq_true_eq] at hcond obtain ⟨hinv', -⟩ := hinv.include hctx hitems ht' hc hcond.1 hcond.2 @@ -1029,7 +1029,7 @@ theorem tierDfs_spec {deps : Nat → List Nat} {closure : Nat → Option (List N ih _ _ _ _ _ _ _ (by rw [foldl_weight, hcur, wsum_append]) hex (by rw [htake]; exact hinv') hst2, hb1] · rename_i hcond - rw [if_neg hcond] + rw [ite_eq_right hcond] obtain ⟨st2, hst2, h⟩ := Ix.Compile.Verify.SharingExact.bind_eq_ok h simp only [pure, Except.pure, Except.ok.injEq] at hst2 subst hst2 diff --git a/Ix/Compile/Verify/UniformChecks.lean b/Ix/Compile/Verify/UniformChecks.lean index 88d07ae9d..d27ced882 100644 --- a/Ix/Compile/Verify/UniformChecks.lean +++ b/Ix/Compile/Verify/UniformChecks.lean @@ -182,7 +182,7 @@ theorem reachLabels_allows {dag : Dag} (hwf : DagWF dag) (opq : Nat → Bool) refine ⟨(dag.node y).child k, ?_, ?_⟩ · rw [child_eq_getElem _ k (by omega)] exact Array.mem_toList_iff.mpr (Array.getElem_mem _) - · rw [if_pos hO, hℓ]; exact Or.inr rfl + · rw [ite_eq_left hO, hℓ]; exact Or.inr rfl · right have har := hwf.arity y hy rw [← dag_node_eq hy] at har @@ -191,7 +191,7 @@ theorem reachLabels_allows {dag : Dag} (hwf : DagWF dag) (opq : Nat → Bool) refine ⟨(dag.node y).child k, ?_, ?_⟩ · rw [child_eq_getElem _ k (by omega)] exact Array.mem_toList_iff.mpr (Array.getElem_mem _) - · rw [if_neg (by simp [hO])] + · rw [ite_eq_right (by simp [hO])] exact ih _ hlt (by omega) v hc ℓ hℓ /-- **Checked separation.** If the check passes, every listed term carries a @@ -327,8 +327,8 @@ theorem setBang_getElem!_le {a a' : Array Nat} {t v v' : Nat} (u : Nat) (a.set! t v)[u]! ≤ (a'.set! t v')[u]! := by rw [Ix.Compile.Verify.SharingExact.setBang_getElem!, Ix.Compile.Verify.SharingExact.setBang_getElem!] by_cases h : t = u ∧ t < a.size - · rw [if_pos h, if_pos ⟨h.1, hs ▸ h.2⟩]; exact hv - · rw [if_neg h, if_neg (fun h' => h ⟨h'.1, hs ▸ h'.2⟩)]; exact hle + · rw [ite_eq_left h, ite_eq_left ⟨h.1, hs ▸ h.2⟩]; exact hv + · rw [ite_eq_right h, ite_eq_right (fun h' => h ⟨h'.1, hs ▸ h'.2⟩)]; exact hle /-- Fields of equal sizes. -/ def BSize (b : UBounds) (n : Nat) : Prop := @@ -400,7 +400,7 @@ theorem uniformBounds_antitone (p : Prep) (w : Nat) {ms ms' : Array Bool} theorem setBang_self {α : Type} [Inhabited α] (a : Array α) {t : Nat} (ht : t < a.size) : a.set! t a[t]! = a := by - rw [Array.set!_eq_setIfInBounds, Array.setIfInBounds_def, dif_pos ht, getElem!_pos a t ht] + rw [Array.set!_eq_setIfInBounds, Array.setIfInBounds_def, dite_eq_left ht, getElem!_pos a t ht] exact Array.set_getElem_self ht theorem uniformBounds_size (p : Prep) (w : Nat) (ms : Array Bool) : diff --git a/Ix/Compile/Verify/UniformClasses.lean b/Ix/Compile/Verify/UniformClasses.lean index 47d4b210a..984f53c74 100644 --- a/Ix/Compile/Verify/UniformClasses.lean +++ b/Ix/Compile/Verify/UniformClasses.lean @@ -34,7 +34,7 @@ def edgeAll (p : Prep) (y t : Nat) : Nat := edgeMult p y t false + edgeMult p y theorem count_singleton' (a b : Nat) : [a].count b = if a = b then 1 else 0 := by by_cases h : a = b · subst h; simp - · rw [if_neg h, List.count_singleton] + · rw [ite_eq_right h, List.count_singleton] simp only [beq_iff_eq] split <;> omega @@ -134,9 +134,9 @@ theorem PrepWF.spine_count {p : Prep} (hp : PrepWF p) {x j t : Nat} (hx : x < p. have := hp.spineAt_strict hx hf (a := 0) (b := k) (by omega) (by omega) rw [hk] at this exact absurd this (Nat.lt_irrefl _) - rw [if_pos ⟨0, by omega, rfl⟩, if_pos rfl, hnone] + rw [ite_eq_left ⟨0, by omega, rfl⟩, ite_eq_left rfl, hnone] rfl - · rw [if_neg hxt, Nat.zero_add] + · rw [ite_eq_right hxt, Nat.zero_add] congr 1 apply propext rw [spineHit_isSome_iff] @@ -161,7 +161,7 @@ theorem PrepWF.count_written {p : Prep} (hp : PrepWF p) {S : Nat → Bool} (t : by_cases hxt : x = t · subst hxt have hle := hp.written_le (.node hf hlen hkids) hx - simp only [WTree.written, List.count_cons, WTree.occH, WTree.occC, if_true, beq_self_eq_true] + simp only [WTree.written, List.count_cons, WTree.occH, WTree.occC, ite_true, beq_self_eq_true] have : (WTree.writtens p kids).count x = 0 := by apply count_zero_of_lt intro y hy @@ -171,7 +171,7 @@ theorem PrepWF.count_written {p : Prep} (hp : PrepWF p) {S : Nat → Bool} (t : have := hp.written_le (hkids i hi) (by omega) y hyT omega simp [this] - · simp only [WTree.written, List.count_cons, WTree.occH, WTree.occC, hxt, if_false, + · simp only [WTree.written, List.count_cons, WTree.occH, WTree.occC, hxt, ite_false, occHs_eq, occCs_eq, writtens_count, beq_iff_eq] rw [Nat.add_zero, ← sum_map_add'] apply congrArg @@ -197,7 +197,7 @@ theorem PrepWF.count_written {p : Prep} (hp : PrepWF p) {S : Nat → Bool} (t : sum_map_eq_zero fun T hT => count_zero_of_lt (hside T hT).2 rw [hs0] simp [WTree.occH, WTree.occC, hp.spineHit_self hx hf (Nat.le_of_lt hj)] - · simp only [WTree.occH, WTree.occC, hxt, if_false, occHs_eq, occCs_eq, Nat.zero_add] + · simp only [WTree.occH, WTree.occC, hxt, ite_false, occHs_eq, occCs_eq, Nat.zero_add] rw [List.map_congr_left (fun T hT => (hside T hT).1), sum_map_add'] simp omega @@ -225,7 +225,7 @@ theorem PrepWF.count_written {p : Prep} (hp : PrepWF p) {S : Nat → Bool} (t : omega rw [← htl', hs0, ht0] simp [WTree.occH, WTree.occC, hp.spineHit_self hx hf (Nat.le_refl _)] - · simp only [WTree.occH, WTree.occC, hxt, if_false, occHs_eq, occCs_eq, Nat.zero_add] + · simp only [WTree.occH, WTree.occC, hxt, ite_false, occHs_eq, occCs_eq, Nat.zero_add] rw [List.map_congr_left (fun T hT => (hside T hT).1), sum_map_add'] omega @@ -308,18 +308,18 @@ theorem PrepWF.spine_cont_cut {p : Prep} (hp : PrepWF p) {x j t : Nat} (hx : x < rw [hsome, sum_range_succ'] at h1 have hlast : (if snext p (spineAt p x j) = t ∧ p.family[t]! = p.family[spineAt p x j]! then 1 else 0) = 0 := by - rw [if_neg] + rw [ite_eq_right] rintro ⟨h, _⟩ rw [snext_spineAt] at h have := hp.spineAt_strict hx hf (a := j) (b := j + 1) (by omega) (by omega) omega - simp only [if_true] at h1 + simp only [ite_true] at h1 rw [hlast] at h1 - rw [hcont j (Nat.le_refl _), hnone, if_pos hjt] - simp only [Bool.false_eq_true, if_false] + rw [hcont j (Nat.le_refl _), hnone, ite_eq_left hjt] + simp only [Bool.false_eq_true, ite_false] omega · rw [hcont j (Nat.le_refl _), hp.spine_cont_edges hx hf (Nat.le_of_lt hj) (fun _ => hjt), - if_neg hjt, Nat.add_zero] + ite_eq_right hjt, Nat.add_zero] /-- **Slots.** In a writing of `x`, the inline occurrences of `t` plus its Shares are the top (if `x = t`) plus one per edge from a written node into @@ -358,7 +358,7 @@ theorem PrepWF.slots_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Na rw [List.mem_range] at hi rw [List.getElem?_eq_getElem (by omega), Option.getD_some, label_eq (hkids i (by omega))] simp - simp only [WTree.occH, WTree.occC, WTree.shares, WTree.written, hxt, if_false, + simp only [WTree.occH, WTree.occC, WTree.shares, WTree.written, hxt, ite_false, occHs_eq, occCs_eq, sharess_count, List.map_cons, List.sum_cons, writtens_sum] have e := congrArg List.sum (List.map_congr_left hper) simp only [sum_map_add'] at e @@ -389,7 +389,7 @@ theorem PrepWF.slots_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Na have hH := hp.spine_head_sides hx htn hf (Nat.le_of_lt hj) have hC := hp.spine_cont_cut hx htn hf hj hj1 have hne : ¬(j = p.spineLen[x]! ∧ p.tail[x]! = t) := fun h => by omega - rw [if_neg hne] at hH + rw [ite_eq_right hne] at hH have e := congrArg List.sum (List.map_congr_left hper) simp only [sum_map_add'] at e have hsplit : (((List.range j).map (spineAt p x)).map fun y => edgeAll p y t).sum = @@ -397,7 +397,7 @@ theorem PrepWF.slots_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Na ((List.range j).map fun k => edgeMult p (spineAt p x k) t true).sum := by rw [List.map_map, ← sum_map_add'] rfl - simp only [WTree.occH, WTree.occC, WTree.shares, WTree.written, hxt, if_false, occHs_eq, + simp only [WTree.occH, WTree.occC, WTree.shares, WTree.written, hxt, ite_false, occHs_eq, occCs_eq, sharess_count, List.count_append, count_singleton', writtens_sum, List.map_append, List.sum_append, List.append_nil, Nat.zero_add, Nat.add_zero] rw [hsplit, hH, hC] @@ -432,8 +432,8 @@ theorem PrepWF.slots_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Na have hti : (if p.spineLen[x]! = p.spineLen[x]! ∧ p.tail[x]! = t then 1 else 0) = (if p.tail[x]! = t then 1 else 0) := by by_cases h : p.tail[x]! = t - · rw [if_pos ⟨rfl, h⟩, if_pos h] - · rw [if_neg (fun h' => h h'.2), if_neg h] + · rw [ite_eq_left ⟨rfl, h⟩, ite_eq_left h] + · rw [ite_eq_right (fun h' => h h'.2), ite_eq_right h] rw [hti] at hH have e := congrArg List.sum (List.map_congr_left hper) simp only [sum_map_add'] at e @@ -442,7 +442,7 @@ theorem PrepWF.slots_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Na ((List.range p.spineLen[x]!).map fun k => edgeMult p (spineAt p x k) t true).sum := by rw [List.map_map, ← sum_map_add'] rfl - simp only [WTree.occH, WTree.occC, WTree.shares, WTree.written, hxt, if_false, occHs_eq, + simp only [WTree.occH, WTree.occC, WTree.shares, WTree.written, hxt, ite_false, occHs_eq, occCs_eq, sharess_count, List.count_append, writtens_sum, List.map_append, List.sum_append, Nat.zero_add] rw [hsplit, hH, hC] @@ -474,9 +474,9 @@ theorem sum_ind_range {n y : Nat} (hy : y < n) (f : Nat → Nat) : rw [sum_range_succ'] by_cases hyn : y = n · subst hyn - rw [sum_zero_of_forall fun z hz => by rw [if_neg (by omega), Nat.zero_mul]] + rw [sum_zero_of_forall fun z hz => by rw [ite_eq_right (by omega), Nat.zero_mul]] simp - · rw [ih (by omega), if_neg (Ne.symm hyn)] + · rw [ih (by omega), ite_eq_right (Ne.symm hyn)] simp /-- A sum over a list of terms below `n` as a sum over `0 … n-1` weighted by @@ -634,7 +634,7 @@ theorem vis_inner (ch : Nat → Nat) (ce : Nat → Bool) (wy : Nat) : · rw [h2, List.filter_cons] by_cases hce : ce i · simp [hce] - · simp only [hce, Bool.false_eq_true, if_false, Bool.not_false, Bool.and_true] + · simp only [hce, Bool.false_eq_true, ite_false, Bool.not_false, Bool.and_true] rw [modify_addc_getElem!] by_cases hc : ch i = c · subst hc @@ -740,8 +740,8 @@ theorem propagateCounts_spec {dag : Dag} (h : DagWF dag) (roots : Array Nat) intro _ simp only [List.range_zero, List.foldl_nil] refine ⟨(hbase 0).2, (hbase 0).2, fun t _ => ⟨?_, ?_⟩⟩ - · rw [(hbase t).1, sum_zero_of_forall fun y hy => if_neg (by omega), Nat.add_zero] - · rw [(hbase t).1, sum_zero_of_forall fun y hy => if_neg (by omega), Nat.add_zero] + · rw [(hbase t).1, sum_zero_of_forall fun y hy => ite_eq_right (by omega), Nat.add_zero] + · rw [(hbase t).1, sum_zero_of_forall fun y hy => ite_eq_right (by omega), Nat.add_zero] | succ k ih => intro hk obtain ⟨hs1, hs2, hv⟩ := ih (by omega) @@ -771,12 +771,12 @@ theorem propagateCounts_spec {dag : Dag} (h : DagWF dag) (roots : Array Nat) rw [List.mem_range] at hy by_cases hy0 : y = dag.size - 1 - k · subst hy0 - rw [if_pos (by omega), if_neg (by omega), if_pos rfl, hw _ (Nat.le_refl _)] + rw [ite_eq_left (by omega), ite_eq_right (by omega), ite_eq_left rfl, hw _ (Nat.le_refl _)] simp [Nat.mul_comm] - · simp only [if_neg hy0, Nat.zero_mul, Nat.add_zero] + · simp only [ite_eq_right hy0, Nat.zero_mul, Nat.add_zero] by_cases hyk : dag.size - k ≤ y - · rw [if_pos (by omega), if_pos hyk, hw y (by omega)] - · rw [if_neg (by omega), if_neg hyk] + · rw [ite_eq_left (by omega), ite_eq_left hyk, hw y (by omega)] + · rw [ite_eq_right (by omega), ite_eq_right hyk] rw [List.map_congr_left hpt, sum_map_add', sum_ind_range (by omega)] refine ⟨h3, h4, fun t ht => ⟨?_, ?_⟩⟩ · rw [h1, (hv t ht).1, hsum (fun y => edgeAll (Prep.ofDag dag) y t)] @@ -791,12 +791,12 @@ theorem propagateCounts_spec {dag : Dag} (h : DagWF dag) (roots : Array Nat) congr 2 apply List.map_congr_left intro y _ - rw [if_pos (by omega)] + rw [ite_eq_left (by omega)] · rw [e2] congr 2 apply List.map_congr_left intro y _ - rw [if_pos (by omega)] + rw [ite_eq_left (by omega)] /-! ## The gain algebra with occurrence lower bounds -/ @@ -805,8 +805,8 @@ theorem pos_part_cases (x w : Nat) : (w ≤ x ∧ (((if w ≤ x then x - w else 0 : Nat)) : _root_.Int) = (x : _root_.Int) - w) ∨ (x < w ∧ (((if w ≤ x then x - w else 0 : Nat)) : _root_.Int) = 0) := by by_cases h : w ≤ x - · left; rw [if_pos h]; exact ⟨h, by omega⟩ - · right; rw [if_neg h]; exact ⟨by omega, rfl⟩ + · left; rw [ite_eq_left h]; exact ⟨h, by omega⟩ + · right; rw [ite_eq_right h]; exact ⟨by omega, rfl⟩ theorem int_mul_le_mul_right' {a b c : _root_.Int} (hab : a ≤ b) (hc : 0 ≤ c) : a * c ≤ b * c := _root_.Int.mul_le_mul_of_nonneg_right hab hc @@ -1048,7 +1048,7 @@ theorem PrepWF.heads_eq {p : Prep} (hp : PrepWF p) {S : List Nat} {E : Nat → W have htopS : (S.map fun s => if (E s).topIs t then 1 else 0).sum = 0 := by apply sum_map_eq_zero intro s hs - rw [if_neg] + rw [ite_eq_right] intro h have := (top_iff hSt (hEnc.1 s hs).1).mp h exact htS (this ▸ hs) @@ -1188,18 +1188,18 @@ theorem uniformCost_insert_le_counts {dag : Dag} (hwf : DagWF dag) (roots : Arra exact hp.conts_zero hEnc hSin' hroots' htn' htS hf subst hC0 have hfb : ((Prep.ofDag dag).family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true] + simp only [hfb, ite_true] have e := gain_alg_node (d : _root_.Int) (H : _root_.Int) (I : _root_.Int) (b.inlineLB[t]! : _root_.Int) (w : _root_.Int) (Ah : _root_.Int) (by omega) (by omega) (by have := hb.2.1; omega) (by omega) (by rcases hAh with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> omega) simp only [_root_.Int.natCast_zero, _root_.Int.zero_mul, _root_.Int.add_zero] at hexI omega · have hfb : ((Prep.ofDag dag).family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] have hmLB := (hb.2.2 hf).1 obtain ⟨hIM1, hIM2⟩ := hIMb hf by_cases hH1 : h ≥ 1 - · rw [if_pos hH1] + · rw [ite_eq_left hH1] have e := gain_alg_head (d : _root_.Int) (h : _root_.Int) (H : _root_.Int) (C : _root_.Int) (I : _root_.Int) (M : _root_.Int) (b.mergedLB[t]! : _root_.Int) (w : _root_.Int) (Ah : _root_.Int) (Ac : _root_.Int) (by omega) (by omega) (by omega) (by omega) (by omega) @@ -1207,7 +1207,7 @@ theorem uniformCost_insert_le_counts {dag : Dag} (hwf : DagWF dag) (roots : Arra (by rcases hAh with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> omega) (by rcases hAc with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> omega) omega - · rw [if_neg hH1] + · rw [ite_eq_right hH1] have e := gain_alg_cont (d : _root_.Int) (H : _root_.Int) (C : _root_.Int) (I : _root_.Int) (M : _root_.Int) (b.mergedLB[t]! : _root_.Int) (tag4Size (Prep.ofDag dag).spineLen[t]! : _root_.Int) (w : _root_.Int) @@ -1486,9 +1486,9 @@ theorem PrepWF.unshare_spec {p : Prep} (hp : PrepWF p) (hsp : SpinesFit p) (w : intro hx by_cases hxt : x = t · subst hxt - simp only [WTree.unshare, if_true, WTree.shares, count_singleton', WTree.cost] + simp only [WTree.unshare, ite_true, WTree.shares, count_singleton', WTree.cost] refine ⟨hW, fun h => by simp [WTree.isShare] at h, by omega⟩ - · simp only [WTree.unshare, hxt, if_false, WTree.shares, count_singleton', WTree.isShare] + · simp only [WTree.unshare, hxt, ite_false, WTree.shares, count_singleton', WTree.isShare] refine ⟨.share ((hA' x).mpr ⟨hS, hxt⟩), fun h => by simp at h, by omega⟩ | @node x kids hf hlen hkids ih => intro hx @@ -1532,7 +1532,7 @@ theorem PrepWF.unshare_spec {p : Prep} (hp : PrepWF p) (hsp : SpinesFit p) (w : exact (hside k (by simpa using hk)).1 simp only [WTree.unshare, unshares_eq, unshareTele] by_cases hut : spineAt p x j = t - · rw [if_pos ⟨hut, hj⟩] + · rw [ite_eq_left ⟨hut, hj⟩] obtain ⟨hts, htf, htlen, httail, hspat, hsideat, hse⟩ := hp.spine_shift hx hf (k := j) hj rw [hut] at hts htf htlen httail hspat hsideat hse have hft : p.family[t]! ≠ .none := by rw [htf]; exact hf @@ -1577,7 +1577,7 @@ theorem PrepWF.unshare_spec {p : Prep} (hp : PrepWF p) (hsp : SpinesFit p) (w : (WTree.tele x j sides (.share (spineAt p x j))).shares.count t * W.cost p w := by simp only [WTree.cost, WTree.costs_eq, List.map_append, List.sum_append, List.map_map, Function.comp_def, WTree.shares, sharess_count, List.count_append, count_singleton', hut, - if_true] + ite_true] rw [hse] at hcW simp only [Nat.add_mul, Nat.one_mul] at hsum ⊢ omega @@ -1591,11 +1591,11 @@ theorem PrepWF.unshare_spec {p : Prep} (hp : PrepWF p) (hsp : SpinesFit p) (w : refine ⟨?_, fun _ => rfl, hcost⟩ rw [hlenx] exact .teleFull hf (by rw [hlenL, hlenx]) hsidesV (by rw [← httail]; exact htl') - · rw [if_neg (fun h => hut h.1)] - simp only [hut, if_false] + · rw [ite_eq_right (fun h => hut h.1)] + simp only [hut, ite_false] refine ⟨.teleCut hf hj1 hj (by simp [hlen]) hL1 ((hA' _).mpr ⟨hS, hut⟩), fun _ => rfl, ?_⟩ simp only [WTree.cost, WTree.costs_eq, List.map_map, Function.comp_def, WTree.shares, - sharess_count, List.count_append, count_singleton', hut, if_false, Nat.add_zero] + sharess_count, List.count_append, count_singleton', hut, ite_false, Nat.add_zero] omega | @teleFull x sides tail hf hlen hsides htail ih iht => intro hx @@ -1623,7 +1623,7 @@ theorem PrepWF.unshare_spec {p : Prep} (hp : PrepWF p) (hsp : SpinesFit p) (w : .tele x p.spineLen[x]! (sides.map (WTree.unshare p t W)) (WTree.unshare p t W tail) := by unfold unshareTele split - · rw [if_neg (fun h => Nat.lt_irrefl _ h.2)] + · rw [ite_eq_right (fun h => Nat.lt_irrefl _ h.2)] · rfl simp only [WTree.unshare, unshares_eq] rw [hU] @@ -1883,7 +1883,7 @@ theorem refs_le_occ {dag : Dag} (hwf : DagWF dag) (roots : Array Nat) have hwr := writes_le_occ hwf roots hroots w hX hEnc hcost have hsl := hp.enc_slots hEnc hXin hroots' (t := t) (by rw [ofDag_dag]; exact htn) rw [ofDag_dag] at hsl - have hcnt : X.count t = 1 := by rw [hX.1.1.count, if_pos htX] + have hcnt : X.count t = 1 := by rw [hX.1.1.count, ite_eq_left htX] have hw1 : 1 ≤ encWrites (Prep.ofDag dag) X E R t := by have h1 : 1 ≤ ((E t).written (Prep.ofDag dag)).count t := List.count_pos_iff.mpr (hp.written_self (hEnc.1 t htX).1 (hXin t htX) (hEnc.1 t htX).2) @@ -1910,7 +1910,7 @@ theorem base_eq_uInl {dag : Dag} (hwf : DagWF dag) (w : Nat) {t : Nat} (ht : t < have hrow := hp.evalFrom_spec (w := w) (avail := fun _ => false) (Array.replicate dag.size none) (fun u => by - simp only [widthOf, Array.getElem?_replicate, Bool.false_eq_true, if_false] + simp only [widthOf, Array.getElem?_replicate, Bool.false_eq_true, ite_false] split <;> rfl) { cost := Array.replicate dag.size 0, sides := Array.replicate dag.size 0, below := Array.replicate dag.size none } @@ -1926,7 +1926,7 @@ theorem base_eq_uInl {dag : Dag} (hwf : DagWF dag) (w : Nat) {t : Nat} (ht : t < (Array.replicate dag.size none) (Array.replicate dag.size true)).cost := rfl rw [hb, hrow.1, hp.uCost_eq w _ t (by rw [ofDag_dag]; exact ht)] unfold costOf - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rfl /-- Inline costs only drop when terms become available. -/ diff --git a/Ix/Compile/Verify/UniformDecomp.lean b/Ix/Compile/Verify/UniformDecomp.lean index 1bf62b13e..36f3e2e05 100644 --- a/Ix/Compile/Verify/UniformDecomp.lean +++ b/Ix/Compile/Verify/UniformDecomp.lean @@ -130,7 +130,7 @@ theorem PrepWF.opaque_cost {p : Prep} (hp : PrepWF p) {w : Nat} {A : Nat → Boo (ht : t < p.dag.size) (h : OpaqueAt p w A t) : uCost p w A t = w := by rw [hp.uCost_eq w A t ht] unfold costOf - rw [if_pos h.1] + rw [ite_eq_left h.1] have hinl : w ≤ inlOf p w A (uCost p w A) t := by by_cases hf : p.family[t]! = .none · exact h.2.1 hf @@ -192,7 +192,7 @@ theorem PrepWF.inl_split {p : Prep} (_hp : PrepWF p) (w : Nat) (A : Nat → Bool (hkl : k ≤ p.spineLen[y]!) (hnone : ∀ j, 1 ≤ j → j < k → A (spineAt p y j) = false) : inlOf p w A cost y = prefixSides p cost y k + teleFrom p w A cost y k := by unfold inlOf teleFrom - rw [if_neg hf] + rw [ite_eq_right hf] have hcuts : cutCosts p w A cost y = (cutsRange p w A cost y k p.spineLen[y]!).map (prefixSides p cost y k + ·) := by unfold cutCosts cutsRange @@ -243,7 +243,7 @@ theorem mem_cutsRange {p : Prep} {w : Nat} {A : Nat → Bool} {cost : Nat → Na exact ⟨j, hj.1, by omega, hA, (Option.some.inj he).symm⟩ · cases he · rintro ⟨j, h1, h2, hA, rfl⟩ - exact ⟨j, List.mem_range'_1.mpr ⟨h1, by omega⟩, by rw [if_pos hA]⟩ + exact ⟨j, List.mem_range'_1.mpr ⟨h1, by omega⟩, by rw [ite_eq_left hA]⟩ theorem prefixSides_mono (p : Prep) (cost : Nat → Nat) (t : Nat) {a b : Nat} (h : a ≤ b) : prefixSides p cost t a ≤ prefixSides p cost t b := by @@ -466,7 +466,7 @@ theorem PrepWF.uCost_local {p : Prep} (hp : PrepWF p) (w : Nat) (O : Nat → Boo unfold uInl by_cases hf : p.family[y]! = .none · unfold inlOf - rw [if_pos hf, if_pos hf] + rw [ite_eq_left hf, ite_eq_left hf] apply foldl_add_congr intro c hcm obtain ⟨i, hi, rfl⟩ := Array.mem_iff_getElem.mp hcm @@ -592,7 +592,7 @@ theorem PrepWF.uCost_modular {p : Prep} (hp : PrepWF p) (w : Nat) (O A0 Z1 Z2 : unfold uInl by_cases hf : p.family[y]! = .none · unfold inlOf - simp only [if_pos hf] + simp only [ite_eq_left hf] rw [arr_foldl_add_eq_sum, arr_foldl_add_eq_sum, arr_foldl_add_eq_sum, arr_foldl_add_eq_sum] have hch : ∀ c ∈ (p.dag.node y).children.toList, @@ -695,7 +695,7 @@ theorem PrepWF.uCost_modular {p : Prep} (hp : PrepWF p) (w : Nat) (O A0 Z1 Z2 : hp.uCost_eq w (addAvail A0 Z2) y hy] unfold costOf rw [hA, hA0, hA1, hA2] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] unfold uInl at hinl exact hinl @@ -803,7 +803,7 @@ theorem gain_opaque_bounds {p : Prep} {b : UBounds} {w t d h : Nat} (hhd : h ≤ simp only [_root_.Int.ofNat_eq_natCast] at hg refine ⟨fun hf => ?_, fun hf => ?_⟩ · have hfb : (p.family[t]! == Family.none) = true := by simp [hf] - rw [if_pos hfb] at hg + rw [ite_eq_left hfb] at hg by_cases hlt : w < b.inlineLB[t]! · exact hlt · exfalso @@ -812,7 +812,7 @@ theorem gain_opaque_bounds {p : Prep} {b : UBounds} {w t d h : Nat} (hhd : h ≤ simp only [_root_.Int.sub_mul, _root_.Int.one_mul] at e hg omega · have hfb : (p.family[t]! == Family.none) = false := by simpa using hf - rw [if_neg (by simp [hfb])] at hg + rw [ite_eq_right (by simp [hfb])] at hg by_cases hle : w ≤ b.mergedLB[t]! · exact hle · exfalso @@ -908,10 +908,10 @@ theorem components_modular {dag : Dag} (hwf : DagWF dag) (roots : Array Nat) rw [getElem!_range_map _ (by rw [ofDag_dag]; exact ht)] simp only [Bool.and_eq_true, Bool.not_eq_true', decide_eq_true_eq] by_cases hce : certainExcludedTest (Prep.ofDag dag) (graphFacts dag roots) w t = true - · exact absurd (by rw [if_pos hce]) h1 - · rw [if_neg hce] at h1 h2 + · exact absurd (by rw [ite_eq_left hce]) h1 + · rw [ite_eq_right hce] at h1 h2 by_cases hdeg : (graphFacts dag roots).deg[t]! < 2 - · exact absurd (by rw [if_pos hdeg]) h2 + · exact absurd (by rw [ite_eq_left hdeg]) h2 · exact ⟨by simpa using hce, by omega⟩ have hin : ∀ t ∈ cs ++ z1 ++ z2, t < dag.size := by intro t ht diff --git a/Ix/Compile/Verify/UniformExchange.lean b/Ix/Compile/Verify/UniformExchange.lean index ac309d15a..3d8b48ced 100644 --- a/Ix/Compile/Verify/UniformExchange.lean +++ b/Ix/Compile/Verify/UniformExchange.lean @@ -47,7 +47,7 @@ theorem merged_mem_mergedCuts (p : Prep) (w : Nat) (S : Nat → Bool) (f : Nat unfold mergedCuts apply List.mem_filterMap.mpr refine ⟨j, List.mem_range'_1.mpr ⟨hj1, by omega⟩, ?_⟩ - rw [if_pos hS] + rw [ite_eq_left hS] theorem tag4Size_pos (n : Nat) : 1 ≤ tag4Size n := Ix.Compile.Verify.TagN.tagNByteWidth_pos 4 n @@ -239,7 +239,7 @@ theorem PrepWF.below_t {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} ( a.subst p t rh rc = a) fun i hi => by have hc := hp.dag.childAt_lt hx (k := i) (by omega) exact ih i hi (by omega) (by omega) - simp only [WTree.occH, WTree.occC, WTree.subst, hne, if_false, occHs_eq, occCs_eq, + simp only [WTree.occH, WTree.occC, WTree.subst, hne, ite_false, occHs_eq, occCs_eq, substs_eq] exact ⟨sum_map_eq_zero fun a ha => (hk a ha).1, sum_map_eq_zero fun a ha => (hk a ha).2.1, by rw [map_eq_self fun a ha => (hk a ha).2.2]⟩ @@ -252,7 +252,7 @@ theorem PrepWF.below_t {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} ( exact ih i hi (by omega) (by omega) have hhit : spineHit p x j t = none := spineHit_none fun k h1 h2 => by have := hp.spineAt_le hx hf (k := k) (by omega); omega - simp only [WTree.occH, WTree.occC, WTree.subst, hne, if_false, occHs_eq, occCs_eq, + simp only [WTree.occH, WTree.occC, WTree.subst, hne, ite_false, occHs_eq, occCs_eq, substs_eq, hhit, Option.isSome_none, Bool.false_eq_true] exact ⟨by rw [sum_map_eq_zero fun a ha => (hk a ha).1], by rw [sum_map_eq_zero fun a ha => (hk a ha).2.1], @@ -268,7 +268,7 @@ theorem PrepWF.below_t {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} ( have hhit : spineHit p x p.spineLen[x]! t = none := spineHit_none fun k h1 h2 => by have := hp.spineAt_le hx hf (k := k) (by omega); omega obtain ⟨ht1, ht2, ht3⟩ := iht (by omega) (by omega) - simp only [WTree.occH, WTree.occC, WTree.subst, hne, if_false, occHs_eq, occCs_eq, + simp only [WTree.occH, WTree.occC, WTree.subst, hne, ite_false, occHs_eq, occCs_eq, substs_eq, hhit, Option.isSome_none, Bool.false_eq_true] exact ⟨by rw [sum_map_eq_zero fun a ha => (hk a ha).1, ht1], by rw [sum_map_eq_zero fun a ha => (hk a ha).2.1, ht2], @@ -400,7 +400,7 @@ theorem PrepWF.subst_spec {p : Prep} (hp : PrepWF p) (w : Nat) {S : Nat → Bool | true => refine ⟨.share (addT_self S t), ?_⟩ have := hrh rfl - simp only [if_true, WTree.cost] + simp only [ite_true, WTree.cost] omega | false => exact ⟨hT.mono (addT_le S t), by simp⟩ @@ -422,7 +422,7 @@ theorem PrepWF.subst_spec {p : Prep} (hp : PrepWF p) (w : Nat) {S : Nat → Bool kids[i].occC p t * (if rc then mergedOf p w S (uCost p w S) t - w else 0) ≤ kids[i].cost p w := fun i hi => ih i hi (by have := hp.dag.childAt_lt hx (k := i) (by omega); omega) - simp only [WTree.subst, hxt, if_false, WTree.occH, WTree.occC, WTree.cost, substs_eq, + simp only [WTree.subst, hxt, ite_false, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq] refine ⟨.node hf (by simp [hlen]) fun i hi => by simp only [List.getElem_map] @@ -460,9 +460,9 @@ theorem PrepWF.subst_spec {p : Prep} (hp : PrepWF p) (w : Nat) {S : Nat → Bool a.cost p w) fun i hi => (hk i hi).2) cases hhit : spineHit p x j t with | none => - simp only [WTree.subst, hxt, if_false, hhit, WTree.occH, WTree.occC, WTree.cost, + simp only [WTree.subst, hxt, ite_false, hhit, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq, Option.isSome_none, Bool.false_eq_true, - if_false, Nat.add_zero, Nat.zero_add] + ite_false, Nat.add_zero, Nat.zero_add] refine ⟨.teleCut hf hj1 hj (by simp [hlen]) hvalid (addT_le S t _ hS), ?_⟩ simp only [List.map_map, Function.comp_def] omega @@ -470,15 +470,15 @@ theorem PrepWF.subst_spec {p : Prep} (hp : PrepWF p) (w : Nat) {S : Nat → Bool obtain ⟨hk1, hkj, hkt⟩ := spineHit_spec hhit cases rc with | false => - simp only [WTree.subst, hxt, if_false, hhit, WTree.occH, WTree.occC, WTree.cost, + simp only [WTree.subst, hxt, ite_false, hhit, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq, Bool.false_eq_true, Nat.add_zero] refine ⟨.teleCut hf hj1 hj (by simp [hlen]) hvalid (addT_le S t _ hS), ?_⟩ simp only [List.map_map, Function.comp_def] at hsum ⊢ - simp only [Bool.false_eq_true, if_false, Nat.mul_zero] at hsum ⊢ + simp only [Bool.false_eq_true, ite_false, Nat.mul_zero] at hsum ⊢ omega | true => - simp only [WTree.subst, hxt, if_false, hhit, if_true, WTree.occH, WTree.occC, WTree.cost, + simp only [WTree.subst, hxt, ite_false, hhit, ite_true, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq, Option.isSome_some, Nat.add_zero] have hM := hp.merged_le_rest w S hx hf hlen hsides @@ -561,9 +561,9 @@ theorem PrepWF.subst_spec {p : Prep} (hp : PrepWF p) (w : Nat) {S : Nat → Bool obtain ⟨htv, htc⟩ := iht (by omega) cases hhit : spineHit p x p.spineLen[x]! t with | none => - simp only [WTree.subst, hxt, if_false, hhit, WTree.occH, WTree.occC, WTree.cost, + simp only [WTree.subst, hxt, ite_false, hhit, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq, Option.isSome_none, Bool.false_eq_true, - if_false, Nat.zero_add] + ite_false, Nat.zero_add] refine ⟨.teleFull hf (by simp [hlen]) hvalid htv, ?_⟩ simp only [List.map_map, Function.comp_def, Nat.add_mul] at hsum htc ⊢ omega @@ -571,14 +571,14 @@ theorem PrepWF.subst_spec {p : Prep} (hp : PrepWF p) (w : Nat) {S : Nat → Bool obtain ⟨hk1, hkj, hkt⟩ := spineHit_spec hhit cases rc with | false => - simp only [WTree.subst, hxt, if_false, hhit, WTree.occH, WTree.occC, WTree.cost, + simp only [WTree.subst, hxt, ite_false, hhit, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq, Bool.false_eq_true] refine ⟨.teleFull hf (by simp [hlen]) hvalid htv, ?_⟩ simp only [List.map_map, Function.comp_def, Nat.add_mul] at hsum htc ⊢ - simp only [Bool.false_eq_true, if_false, Nat.mul_zero, Nat.add_zero] at hsum htc ⊢ + simp only [Bool.false_eq_true, ite_false, Nat.mul_zero, Nat.add_zero] at hsum htc ⊢ omega | true => - simp only [WTree.subst, hxt, if_false, hhit, if_true, WTree.occH, WTree.occC, WTree.cost, + simp only [WTree.subst, hxt, ite_false, hhit, ite_true, WTree.occH, WTree.occC, WTree.cost, substs_eq, occHs_eq, occCs_eq, WTree.costs_eq, Option.isSome_some] obtain ⟨hts, htf, hlen', httail, _, hsideat, _⟩ := hp.spine_shift hx hf (k := k) (by omega) @@ -731,12 +731,12 @@ theorem sum_indicator_unique (P : Nat → Prop) [DecidablePred P] (j : Nat) rintro ⟨k, hk, hPk⟩ have := huniq k j (by omega) (by omega) hPk hj omega - rw [if_neg hnone, if_pos hj, if_pos ⟨j, by omega, hj⟩] - · rw [if_neg hj, Nat.add_zero] + rw [ite_eq_right hnone, ite_eq_left hj, ite_eq_left ⟨j, by omega, hj⟩] + · rw [ite_eq_right hj, Nat.add_zero] by_cases hex : ∃ k, k < j ∧ P k · obtain ⟨k, hk, hPk⟩ := hex - rw [if_pos ⟨k, hk, hPk⟩, if_pos ⟨k, by omega, hPk⟩] - · rw [if_neg hex, if_neg] + rw [ite_eq_left ⟨k, hk, hPk⟩, ite_eq_left ⟨k, by omega, hPk⟩] + · rw [ite_eq_right hex, ite_eq_right] rintro ⟨k, hk, hPk⟩ by_cases hkj : k = j · subst hkj; exact hj hPk @@ -773,7 +773,7 @@ theorem PrepWF.spine_head_edges {p : Prep} (hp : PrepWF p) {x j t : Nat} (hx : x have hzero : ∀ k, k + 1 < p.spineLen[x]! → (if snext p (spineAt p x k) = t ∧ p.family[t]! ≠ p.family[spineAt p x k]! then 1 else 0) = 0 := by intro k hk1 - rw [if_neg] + rw [ite_eq_right] rintro ⟨hn, hne⟩ rw [snext_spineAt] at hn apply hne @@ -786,9 +786,9 @@ theorem PrepWF.spine_head_edges {p : Prep} (hp : PrepWF p) {x j t : Nat} (hx : x have hfm := (hk m (by omega)).2.1 by_cases htt : p.tail[x]! = t · subst htt - rw [if_pos ⟨rfl, by rw [hfm]; exact htf⟩, if_pos ⟨rfl, rfl⟩] - · rw [if_neg (fun h => htt h.1), if_neg (fun h => htt h.2)] - · rw [sum_zero_of_forall fun k hk => hzero k (by omega), if_neg (fun h => hjl h.1)] + rw [ite_eq_left ⟨rfl, by rw [hfm]; exact htf⟩, ite_eq_left ⟨rfl, rfl⟩] + · rw [ite_eq_right (fun h => htt h.1), ite_eq_right (fun h => htt h.2)] + · rw [sum_zero_of_forall fun k hk => hzero k (by omega), ite_eq_right (fun h => hjl h.1)] /-- The continuation spine edges of a telescope prefix into `t`: one if `t` is among its inner spine nodes. -/ @@ -809,10 +809,10 @@ theorem PrepWF.spine_cont_edges {p : Prep} (hp : PrepWF p) {x j t : Nat} (hx : x · have hfam : p.family[spineAt p x (k + 1)]! = p.family[spineAt p x k]! := by rw [(hk (k + 1) (by omega)).2.1, (hk k (by omega)).2.1] by_cases ht : spineAt p x (k + 1) = t - · rw [if_pos ⟨ht, by rw [← ht, hfam]⟩, if_pos ⟨ht, hkj⟩] - · rw [if_neg (fun h => ht h.1), if_neg (fun h => ht h.1)] - · rw [if_neg (show ¬(spineAt p x (k + 1) = t ∧ k + 1 < j) from fun h => hkj h.2)] - rw [if_neg] + · rw [ite_eq_left ⟨ht, by rw [← ht, hfam]⟩, ite_eq_left ⟨ht, hkj⟩] + · rw [ite_eq_right (fun h => ht h.1), ite_eq_right (fun h => ht h.1)] + · rw [ite_eq_right (show ¬(spineAt p x (k + 1) = t ∧ k + 1 < j) from fun h => hkj h.2)] + rw [ite_eq_right] rintro ⟨ht, hfam⟩ have hkj' : k + 1 = j := by omega by_cases hjl : j < p.spineLen[x]! @@ -963,9 +963,9 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} rw [h1] congr 1 by_cases hct : (p.dag.node x).child i = t - · rw [if_pos ((top_iff hSt (hkids i hi)).mpr hct), if_pos hct] - · rw [if_neg (fun h => hct ((top_iff hSt (hkids i hi)).mp (by simpa using h))), - if_neg hct] + · rw [ite_eq_left ((top_iff hSt (hkids i hi)).mpr hct), ite_eq_left hct] + · rw [ite_eq_right (fun h => hct ((top_iff hSt (hkids i hi)).mp (by simpa using h))), + ite_eq_right hct] have hwle : ∀ y ∈ (WTree.node x kids).written p, y ≤ x := by intro y hy simp only [WTree.written] at hy @@ -981,7 +981,7 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} · subst hxt rw [hzero false _ hwle] simp [WTree.occH, WTree.topIs] - · simp only [WTree.occH, hxt, if_false, WTree.topIs, occHs_eq, WTree.written, + · simp only [WTree.occH, hxt, ite_false, WTree.topIs, occHs_eq, WTree.written, List.map_cons, List.sum_cons, writtens_sum, beq_iff_eq] have hper : ∀ T ∈ kids, T.occH t = (if T.topIs t then 1 else 0) + ((T.written p).map fun y => edgeMult p y t false).sum := by @@ -999,8 +999,8 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} rw [List.mem_range] at hi rw [List.getElem?_eq_getElem (by omega), Option.getD_some] by_cases hct : (p.dag.node x).child i = t - · rw [if_pos ((top_iff hSt (hkids i (by omega))).mpr hct)]; simp [hct] - · rw [if_neg (fun h => hct ((top_iff hSt (hkids i (by omega))).mp (by simpa using h)))] + · rw [ite_eq_left ((top_iff hSt (hkids i (by omega))).mpr hct)]; simp [hct] + · rw [ite_eq_right (fun h => hct ((top_iff hSt (hkids i (by omega))).mp (by simpa using h)))] simp [hct] rw [hind] omega @@ -1008,7 +1008,7 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} · subst hxt rw [hzero true _ hwle] simp [WTree.occC] - · simp only [WTree.occC, hxt, if_false, occCs_eq, WTree.written, List.map_cons, + · simp only [WTree.occC, hxt, ite_false, occCs_eq, WTree.written, List.map_cons, List.sum_cons, writtens_sum] rw [(hp.edgeMult_node hx hf t).1, Nat.zero_add] congr 1 @@ -1042,7 +1042,7 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} simp [WTree.occH, WTree.topIs] · have hjt : spineAt p x j ≠ t := by intro h; rw [h] at hS; rw [hS] at hSt; cases hSt obtain ⟨hF, _⟩ := hp.spine_edges hx htn hf (Nat.le_of_lt hj) (fun _ => hjt) - simp only [WTree.occH, hxt, if_false, WTree.topIs, occHs_eq, WTree.written, + simp only [WTree.occH, hxt, ite_false, WTree.topIs, occHs_eq, WTree.written, List.map_append, List.sum_append, writtens_sum, beq_iff_eq, List.append_nil] rw [hF, List.map_congr_left (fun T hT => (hside T hT).1), sum_map_add'] have hind : (sides.map fun T => if T.topIs t then 1 else 0).sum = @@ -1054,10 +1054,10 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} rw [List.mem_range] at hi rw [List.getElem?_eq_getElem (by omega), Option.getD_some] by_cases hct : sideAt p x i = t - · rw [if_pos ((top_iff hSt (hsides i (by omega))).mpr hct), if_pos hct] - · rw [if_neg (fun h => hct ((top_iff hSt (hsides i (by omega))).mp (by simpa using h))), - if_neg hct] - rw [hind, if_neg (fun h => by omega)] + · rw [ite_eq_left ((top_iff hSt (hsides i (by omega))).mpr hct), ite_eq_left hct] + · rw [ite_eq_right (fun h => hct ((top_iff hSt (hsides i (by omega))).mp (by simpa using h))), + ite_eq_right hct] + rw [hind, ite_eq_right (fun h => by omega)] simp · by_cases hxt : x = t · subst hxt @@ -1065,7 +1065,7 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} simp [WTree.occC] · have hjt : spineAt p x j ≠ t := by intro h; rw [h] at hS; rw [hS] at hSt; cases hSt obtain ⟨_, hT⟩ := hp.spine_edges hx htn hf (Nat.le_of_lt hj) (fun _ => hjt) - simp only [WTree.occC, hxt, if_false, occCs_eq, WTree.written, List.map_append, + simp only [WTree.occC, hxt, ite_false, occCs_eq, WTree.written, List.map_append, List.sum_append, writtens_sum, List.append_nil] rw [hT, List.map_congr_left (fun T hT => (hside T hT).2.1)] simp @@ -1097,7 +1097,7 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} rw [hzero false _ hwle] simp [WTree.occH, WTree.topIs] · obtain ⟨hF, _⟩ := hp.spine_edges hx htn hf (Nat.le_refl _) (fun h => absurd h (by omega)) - simp only [WTree.occH, hxt, if_false, WTree.topIs, occHs_eq, WTree.written, + simp only [WTree.occH, hxt, ite_false, WTree.topIs, occHs_eq, WTree.written, List.map_append, List.sum_append, writtens_sum, beq_iff_eq] rw [hF, List.map_congr_left (fun T hT => (hside T hT).1), sum_map_add', ht1] have hind : (sides.map fun T => if T.topIs t then 1 else 0).sum = @@ -1109,15 +1109,15 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} rw [List.mem_range] at hi rw [List.getElem?_eq_getElem (by omega), Option.getD_some] by_cases hct : sideAt p x i = t - · rw [if_pos ((top_iff hSt (hsides i (by omega))).mpr hct), if_pos hct] - · rw [if_neg (fun h => hct ((top_iff hSt (hsides i (by omega))).mp (by simpa using h))), - if_neg hct] + · rw [ite_eq_left ((top_iff hSt (hsides i (by omega))).mpr hct), ite_eq_left hct] + · rw [ite_eq_right (fun h => hct ((top_iff hSt (hsides i (by omega))).mp (by simpa using h))), + ite_eq_right hct] have htop : (if tail.topIs t then 1 else 0) = (if p.spineLen[x]! = p.spineLen[x]! ∧ p.tail[x]! = t then 1 else 0) := by by_cases htt : p.tail[x]! = t - · rw [if_pos ((top_iff hSt htail).mpr htt), if_pos ⟨rfl, htt⟩] - · rw [if_neg (fun h => htt ((top_iff hSt htail).mp (by simpa using h))), - if_neg (fun h => htt h.2)] + · rw [ite_eq_left ((top_iff hSt htail).mpr htt), ite_eq_left ⟨rfl, htt⟩] + · rw [ite_eq_right (fun h => htt ((top_iff hSt htail).mp (by simpa using h))), + ite_eq_right (fun h => htt h.2)] rw [hind, htop] omega · by_cases hxt : x = t @@ -1125,7 +1125,7 @@ theorem PrepWF.occ_edges {p : Prep} (hp : PrepWF p) {S : Nat → Bool} {t : Nat} rw [hzero true _ hwle] simp [WTree.occC] · obtain ⟨_, hT⟩ := hp.spine_edges hx htn hf (Nat.le_refl _) (fun h => absurd h (by omega)) - simp only [WTree.occC, hxt, if_false, occCs_eq, WTree.written, List.map_append, + simp only [WTree.occC, hxt, ite_false, occCs_eq, WTree.written, List.map_append, List.sum_append, writtens_sum] rw [hT, List.map_congr_left (fun T hT => (hside T hT).2.1), ht2] /-! ## Every reachable term is written -/ diff --git a/Ix/Compile/Verify/UniformGain.lean b/Ix/Compile/Verify/UniformGain.lean index b1a70bf3f..2d460cd2c 100644 --- a/Ix/Compile/Verify/UniformGain.lean +++ b/Ix/Compile/Verify/UniformGain.lean @@ -114,14 +114,14 @@ theorem edgeCounts_spec {dag : Dag} (h : DagWF dag) (roots : Array Nat) rw [ofDag_dag, ← har] cases headOnly with | true => - simp only [if_true] + simp only [ite_true] congr 1 apply List.filter_congr intro i _ cases hc : continuationEdge (dag.node y) i (dag.node ((dag.node y).child i)) <;> by_cases hct : (dag.node y).child i = t <;> simp_all | false => - simp only [Bool.false_eq_true, if_false, Bool.false_and, Bool.not_false, Bool.true_and] + simp only [Bool.false_eq_true, ite_false, Bool.false_and, Bool.not_false, Bool.true_and] rw [filter_length_split (fun i => (dag.node y).child i == t) (fun i => continuationEdge (dag.node y) i (dag.node t))] have hinv : ∀ m, m ≤ dag.size → @@ -193,11 +193,11 @@ theorem BoundsRow.congr {p : Prep} (hp : PrepWF p) {w : Nat} {ms : Array Bool} { theorem setBang_getElem!_ne {α : Type} [Inhabited α] (a : Array α) {i j : Nat} (v : α) (h : j ≠ i) : (a.set! i v)[j]! = a[j]! := by - rw [Ix.Compile.Verify.SharingExact.setBang_getElem!, if_neg (fun h' => h h'.1.symm)] + rw [Ix.Compile.Verify.SharingExact.setBang_getElem!, ite_eq_right (fun h' => h h'.1.symm)] theorem setBang_getElem!_self {α : Type} [Inhabited α] (a : Array α) {i : Nat} (v : α) (h : i < a.size) : (a.set! i v)[i]! = v := by - rw [Ix.Compile.Verify.SharingExact.setBang_getElem!, if_pos ⟨rfl, h⟩] + rw [Ix.Compile.Verify.SharingExact.setBang_getElem!, ite_eq_left ⟨rfl, h⟩] /-- `uniformBounds` satisfies its recurrence at every term. -/ theorem PrepWF.uniformBounds_spec {p : Prep} (hp : PrepWF p) (w : Nat) (ms : Array Bool) (t : Nat) @@ -238,7 +238,7 @@ theorem PrepWF.uniformBounds_spec {p : Prep} (hp : PrepWF p) (w : Nat) (ms : Arr simp only by_cases hf : p.family[t]! = .none · have hfb : (p.family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true] + simp only [hfb, ite_true] refine ⟨fun _ => ⟨?_, ?_⟩, fun h => absurd hf h, ?_, ?_⟩ · rw [setBang_getElem!_self _ _ (by omega)] exact foldl_add_congr _ _ fun c hc => (setBang_getElem!_ne _ _ (by @@ -247,7 +247,7 @@ theorem PrepWF.uniformBounds_spec {p : Prep} (hp : PrepWF p) (w : Nat) (ms : Arr · rw [setBang_getElem!_self _ _ (by omega), setBang_getElem!_self _ _ (by omega)] · rw [setBang_getElem!_self _ _ (by omega), setBang_getElem!_self _ _ (by omega)] · have hfb : (p.family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] have hs := hp.sideChild_lt hmn hf have hn := hp.snext_lt hmn hf refine ⟨fun h => absurd h hf, fun _ => ⟨?_, ?_⟩, ?_, ?_⟩ @@ -289,7 +289,7 @@ theorem PrepWF.merged_ge {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool) (prefixSides p (uCost p w S) t p.spineLen[t]! + uCost p w S p.tail[t]!)) with h | h · rw [h] rcases hp.spine_step ht hf with ⟨hs, hl, htl⟩ | ⟨hs, hl, htl⟩ - · rw [if_pos hs, hl, htl] + · rw [ite_eq_left hs, hl, htl] simp only [prefixSides] have := contVal_le p w S (snext p t) have := foldl_min_le (mergedCuts p w S (uCost p w S) (snext p t)) @@ -297,12 +297,12 @@ theorem PrepWF.merged_ge {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool) uCost p w S p.tail[snext p t]!) _ List.mem_cons_self unfold mergedOf at * omega - · rw [if_neg hs, hl, htl] + · rw [ite_eq_right hs, hl, htl] simp [prefixSides] · obtain ⟨j, hj1, hj, hSj, hc⟩ := mem_mergedCuts h rw [hc] rcases hp.spine_step ht hf with ⟨hs, hl, htl⟩ | ⟨hs, hl, htl⟩ - · rw [if_pos hs] + · rw [ite_eq_left hs] obtain ⟨j', rfl⟩ : ∃ j', j = j' + 1 := ⟨j - 1, by omega⟩ simp only [prefixSides] by_cases hj' : j' = 0 @@ -311,7 +311,7 @@ theorem PrepWF.merged_ge {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool) have : contVal p w S (snext p t) ≤ w := by unfold contVal simp only [spineAt] at hSj - rw [if_pos hSj]; omega + rw [ite_eq_left hSj]; omega omega · have hmem := merged_mem_mergedCuts p w S (uCost p w S) (x := snext p t) (j := j') (by omega) (by omega) (by simpa [spineAt] using hSj) @@ -347,7 +347,7 @@ theorem PrepWF.bounds_sound {p : Prep} (hp : PrepWF p) (w : Nat) (ms : Array Boo refine ⟨?_, fun h => absurd hf h⟩ rw [a] unfold uInl inlOf - rw [if_pos hf, ← Array.foldl_toList, ← Array.foldl_toList, foldl_add_eq_sum, + rw [ite_eq_left hf, ← Array.foldl_toList, ← Array.foldl_toList, foldl_add_eq_sum, foldl_add_eq_sum] have : ∀ c ∈ (p.dag.node t).children.toList, (uniformBounds p w ms).headLB[c]! ≤ uCost p w S c := by @@ -365,10 +365,10 @@ theorem PrepWF.bounds_sound {p : Prep} (hp : PrepWF p) (w : Nat) (ms : Array Boo have hside := (ih _ hs (by omega)).1 unfold sideCost at hge by_cases hsame : p.family[snext p t]! = p.family[t]! - · rw [if_pos hsame] at hge ⊢ + · rw [ite_eq_left hsame] at hge ⊢ have := ((ih _ hn (by omega)).2.2 (by rw [hsame]; exact hf)).2 omega - · rw [if_neg hsame] at hge ⊢ + · rw [ite_eq_right hsame] at hge ⊢ have := (ih _ hn (by omega)).1 omega refine ⟨?_, fun _ => hm⟩ @@ -382,15 +382,15 @@ theorem PrepWF.bounds_sound {p : Prep} (hp : PrepWF p) (w : Nat) (ms : Array Boo have := hinl.1 unfold uInl at this by_cases hSt : S t = true - · rw [if_pos (hS t hSt), if_pos hSt]; omega - · simp only [hSt, Bool.false_eq_true, if_false] + · rw [ite_eq_left (hS t hSt), ite_eq_left hSt]; omega + · simp only [hSt, Bool.false_eq_true, ite_false] split <;> omega · rw [r4] unfold contVal have := hinl.2 hf by_cases hSt : S t = true - · rw [if_pos (hS t hSt), if_pos hSt]; omega - · simp only [hSt, Bool.false_eq_true, if_false] + · rw [ite_eq_left (hS t hSt), ite_eq_left hSt]; omega + · simp only [hSt, Bool.false_eq_true, ite_false] split <;> omega where sum_le_sum_of_le' {f g : Nat → Nat} {l : List Nat} (h : ∀ k ∈ l, f k ≤ g k) : @@ -452,10 +452,10 @@ theorem subst_isShare {p : Prep} {S : Nat → Bool} {t : Nat} (rh rc : Bool) {x | share => simp [WTree.isShare] at hs | node => simp [WTree.subst, hxt, WTree.isShare] | teleCut => - simp only [WTree.subst, hxt, if_false] + simp only [WTree.subst, hxt, ite_false] split <;> (try split) <;> rfl | teleFull => - simp only [WTree.subst, hxt, if_false] + simp only [WTree.subst, hxt, ite_false] split <;> (try split) <;> rfl theorem topIs_root {p : Prep} {S : Nat → Bool} {t : Nat} (hSt : S t = false) : @@ -465,8 +465,8 @@ theorem topIs_root {p : Prep} {S : Nat → Bool} {t : Nat} (hSt : S t = false) : | r :: rs, T :: Ts, .cons hv hs => by simp only [List.map_cons, List.sum_cons, List.count_cons, topIs_root hSt hs] by_cases hrt : r = t - · rw [if_pos ((top_iff hSt hv).mpr hrt)]; simp [hrt]; omega - · rw [if_neg (fun h => hrt ((top_iff hSt hv).mp (by simpa using h)))] + · rw [ite_eq_left ((top_iff hSt hv).mpr hrt)]; simp [hrt]; omega + · rw [ite_eq_right (fun h => hrt ((top_iff hSt hv).mp (by simpa using h)))] simp [hrt] theorem forall₂_imp_mem {α β : Type} {R R' : α → β → Prop} : @@ -554,13 +554,13 @@ theorem PrepWF.exchange_counts {p : Prep} (hp : PrepWF p) (w : Nat) {S : List Na refine ⟨fun y hy => ?_, hR'⟩ by_cases hyt : y = t · subst hyt - simp only [E', if_true] + simp only [E', ite_true] exact ⟨hTt.mono (addT_le A y), hTts⟩ · have hyS : y ∈ S := by rcases List.mem_cons.mp hy with h | h · exact absurd h hyt · exact h - simp only [E', if_neg hyt] + simp only [E', ite_eq_right hyt] exact ⟨(hsubE y hyS).1, subst_isShare rh rc (hEnc.1 y hyS).1 (hEnc.1 y hyS).2 hyt⟩ have hle := hp.uniformCost_le w (addT A t) (fun s hs => by rcases List.mem_cons.mp hs with rfl | h @@ -570,12 +570,12 @@ theorem PrepWF.exchange_counts {p : Prep} (hp : PrepWF p) (w : Nat) {S : List Na -- the new entry costs have hE' : ((t :: S).map fun s => (E' s).cost p w).sum = Tt.cost p w + (S.map fun s => ((E s).subst p t rh rc).cost p w).sum := by - simp only [List.map_cons, List.sum_cons, E', if_true] + simp only [List.map_cons, List.sum_cons, E', ite_true] congr 1 apply congrArg apply List.map_congr_left intro s hs - rw [if_neg (fun h => htS (by rw [← h]; exact hs))] + rw [ite_eq_right (fun h => htS (by rw [← h]; exact hs))] have hR'c : (R'.map (WTree.cost p w)).sum = (R.map fun T => (T.subst p t rh rc).cost p w).sum := by simp only [R', List.map_map, Function.comp_def] -- the savings @@ -734,7 +734,7 @@ theorem uniformCost_insert_le {dag : Dag} (hwf : DagWF dag) (roots : Array Nat) -- in-degrees have hdegE := edgeCounts_spec hwf roots hroots false t have hheadE := edgeCounts_spec hwf roots hroots true t - simp only [Bool.false_eq_true, if_false, if_true] at hdegE hheadE + simp only [Bool.false_eq_true, ite_false, ite_true] at hdegE hheadE rw [sum_map_add'] at hdegE rw [ofDag_dag] at hex generalize hHc : roots.toList.count t + @@ -774,7 +774,7 @@ theorem uniformCost_insert_le {dag : Dag} (hwf : DagWF dag) (roots : Array Nat) exact sum_map_eq_zero fun y _ => edgeMult_cont_zero hp (by rw [ofDag_dag]; exact htn) hf y subst hCc0 have hfb : ((Prep.ofDag dag).family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true] + simp only [hfb, ite_true] have hiLB := hb.2.1 have e2 := prod_nonneg_expand (Hc : _root_.Int) 1 I (uniformBounds (Prep.ofDag dag) w ms).inlineLB[t]! (by omega) (by omega) @@ -783,18 +783,18 @@ theorem uniformCost_insert_le {dag : Dag} (hwf : DagWF dag) (roots : Array Nat) _root_.Int.sub_mul, _root_.Int.one_mul] at hexI hAc hdeg ⊢ omega · have hfb : ((Prep.ofDag dag).family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] have hmLB := (hb.2.2 hf).1 obtain ⟨hIM1, hIM2⟩ := hIMb hf by_cases hH : Hc ≥ 1 - · rw [if_pos (by omega)] + · rw [ite_eq_left (by omega)] have f3 := prod_nonneg_expand (Hc : _root_.Int) 1 I (1 + M) (by omega) (by omega) have f4 := prod_nonneg_expand ((Hc + Cc : Nat) : _root_.Int) 1 M (uniformBounds (Prep.ofDag dag) w ms).mergedLB[t]! (by omega) (by omega) simp only [_root_.Int.one_mul, _root_.Int.mul_add, _root_.Int.mul_one, _root_.Int.natCast_add, _root_.Int.add_mul, _root_.Int.sub_mul] at f3 f4 ⊢ omega - · rw [if_neg (by omega)] + · rw [ite_eq_right (by omega)] have hH0 : Hc = 0 := by omega subst hH0 have f5 := prod_nonneg_expand (Cc : _root_.Int) 1 M diff --git a/Ix/Compile/Verify/UniformKnapsack.lean b/Ix/Compile/Verify/UniformKnapsack.lean index 317c64c9f..2227f6192 100644 --- a/Ix/Compile/Verify/UniformKnapsack.lean +++ b/Ix/Compile/Verify/UniformKnapsack.lean @@ -78,11 +78,11 @@ theorem setBang_improves {ndp : CTable} {j : Nat} {e : Entry} (hb : betterEntry intro i x hx by_cases hij : j = i ∧ j < ndp.size · obtain ⟨rfl, hj⟩ := hij - refine ⟨e, by rw [setBang_getElem!, if_pos ⟨rfl, hj⟩], ?_⟩ + refine ⟨e, by rw [setBang_getElem!, ite_eq_left ⟨rfl, hj⟩], ?_⟩ rw [hx] at hb simp only [betterEntry, Bool.or_eq_true, decide_eq_true_eq, Bool.and_eq_true, beq_iff_eq] at hb omega - · exact ⟨x, by rw [setBang_getElem!, if_neg hij, hx], Int.le_refl _⟩ + · exact ⟨x, by rw [setBang_getElem!, ite_eq_right hij, hx], Int.le_refl _⟩ theorem knapIn_improves (cap c : Nat) (d : _root_.Int) (s : Array Nat) (bySize ndp : CTable) (k : Nat) : Improves ndp (knapIn cap c d s bySize ndp k) := by @@ -103,9 +103,9 @@ theorem knapIn_hasAt (cap c : Nat) (d : _root_.Int) (s : Array Nat) (bySize ndp (hsz : cap < ndp.size) : HasAt (knapIn cap c d s bySize ndp k) (c + k) (d + dk) := by rw [knapIn_eq, hk] simp only - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] split - · exact ⟨_, by rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩], Int.le_refl _⟩ + · exact ⟨_, by rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩], Int.le_refl _⟩ · rename_i hbet cases ho : ndp[c + k]! with | none => rw [ho] at hbet; simp [betterEntry] at hbet @@ -363,10 +363,10 @@ theorem knapIn_tie {cap c : Nat} {d : _root_.Int} {s : Array Nat} {bySize ndp : · intro j x hx by_cases hij : c + k = j ∧ c + k < ndp.size · obtain ⟨rfl, hj⟩ := hij - refine ⟨_, by rw [setBang_getElem!, if_pos ⟨rfl, hj⟩], ?_⟩ + refine ⟨_, by rw [setBang_getElem!, ite_eq_left ⟨rfl, hj⟩], ?_⟩ rw [hx] at hbet exact (better_tle hm (hn _ x hx)).1 hbet - · exact ⟨x, by rw [setBang_getElem!, if_neg hij, hx], tle_refl x⟩ + · exact ⟨x, by rw [setBang_getElem!, ite_eq_right hij, hx], tle_refl x⟩ · exact ⟨hn, improvesT_refl _⟩ theorem knapIn_hasAtT {cap c : Nat} {d : _root_.Int} {s : Array Nat} {bySize ndp : CTable} {k : Nat} @@ -375,9 +375,9 @@ theorem knapIn_hasAtT {cap c : Nat} {d : _root_.Int} {s : Array Nat} {bySize ndp HasAtT (knapIn cap c d s bySize ndp k) (c + k) (d + dk) (mergeSorted s sk).toList := by rw [knapIn_eq, hk] simp only - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] split - · exact ⟨_, by rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩], Or.inr ⟨rfl, leL_refl _⟩⟩ + · exact ⟨_, by rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩], Or.inr ⟨rfl, leL_refl _⟩⟩ · rename_i hbet cases ho : ndp[c + k]! with | none => rw [ho] at hbet; simp [betterEntry] at hbet diff --git a/Ix/Compile/Verify/UniformLength.lean b/Ix/Compile/Verify/UniformLength.lean index e9b7b4314..88038874f 100644 --- a/Ix/Compile/Verify/UniformLength.lean +++ b/Ix/Compile/Verify/UniformLength.lean @@ -210,14 +210,14 @@ theorem PrepWF.cutOptions_pairs {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Na have hcand : tag4Size (p.spineLen[t]! - p.spineLen[spineAt p t k]!) + (prefixSides p (uCost p w avail) t p.spineLen[t]! - ev.sides[spineAt p t k]!) + (widthOf width (spineAt p t k)).getD 0 = cutCost p w (uCost p w avail) t k := by - rw [hlenk, hsides k (by omega) hkl, hwidth, if_pos hav] + rw [hlenk, hsides k (by omega) hkl, hwidth, ite_eq_left hav] have hsplit := prefixSides_add p (uCost p w avail) k (p.spineLen[t]! - k) t rw [show k + (p.spineLen[t]! - k) = p.spineLen[t]! by omega] at hsplit unfold cutCost rw [show p.spineLen[t]! - (p.spineLen[t]! - k) = k by omega, hsplit] simp have hidx : (index[spineAt p t k]?.getD none).isSome = true := by rw [hindex]; exact hav - simp only [Prep.cutOptions, hidx, if_true] + simp only [Prep.cutOptions, hidx, ite_true] obtain ⟨L, hL, hcost⟩ := ih (k + 1) _ _ (by omega) (by omega) (by omega) (FirstAvail.shift hlenk (hbelow k (by omega) hkl)) refine ⟨(Choice.cut (p.spineLen[t]! - p.spineLen[spineAt p t k]!), @@ -266,7 +266,7 @@ theorem PrepWF.options_mem {p : Prep} (hp : PrepWF p) unfold Prep.options at h by_cases hf : p.family[t]! = .none · have hfb : (p.family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true, Array.toList_push, List.mem_append, List.mem_singleton] at h + simp only [hfb, ite_true, Array.toList_push, List.mem_append, List.mem_singleton] at h rcases h with h | h · obtain ⟨h1, h2, h3⟩ := hbase _ h exact Or.inl ⟨h1, h2, h3⟩ @@ -274,10 +274,10 @@ theorem PrepWF.options_mem {p : Prep} (hp : PrepWF p) obtain ⟨rfl, rfl, _⟩ := h refine Or.inr (Or.inl ⟨rfl, hf, ?_⟩) unfold uInl inlOf - rw [if_pos hf] + rw [ite_eq_left hf] exact foldl_add_congr _ _ fun c _ => hcost c · have hfb : (p.family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] at h + simp only [hfb, Bool.false_eq_true, ite_false] at h obtain ⟨hs, hb⟩ := (hrow t ht).2 hf obtain ⟨hl1, hk, _, htl, _⟩ := hp.spine t ht hf have hspine : ∀ k, 1 ≤ k → k < p.spineLen[t]! → @@ -373,13 +373,13 @@ theorem PrepWF.build_size {p : Prep} (hp : PrepWF p) cases entry with | false => simp only [Bool.false_or, beq_iff_eq] at hcheck - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [← hcost, hcheck] | true => - simp only [if_true] + simp only [ite_true] rw [← hp.inlineCost_eq hempty index width hwidth hindex t ht] unfold Prep.inlineCost - simp only [if_true] at hpick + simp only [ite_true] at hpick rw [hpick] rfl rw [hc] @@ -399,7 +399,7 @@ theorem PrepWF.build_size {p : Prep} (hp : PrepWF p) · cases h1 · rw [hcv] unfold uInl inlOf - rw [if_pos hf] + rw [ite_eq_left hf] have har := hp.dag.arity t ht rw [← dag_node_eq ht] at har cases hh : (p.dag.node t).head <;> simp only [hh] at h har @@ -409,7 +409,7 @@ theorem PrepWF.build_size {p : Prep} (hp : PrepWF p) have hc0 : (p.dag.node t).child 0 < t := hp.dag.childAt_lt ht (by simp [hh, Head.arity]) obtain ⟨hvs, _⟩ := ih false _ v (by omega) hv - simp only [Bool.false_eq_true, if_false] at hvs + simp only [Bool.false_eq_true, ite_false] at hvs refine ⟨?_, fun F' _ => by cases F' <;> rfl⟩ rw [← Array.foldl_toList, children_toList (m := 1) (by simpa [Head.arity] using har)] simp [sizeInfoWith, SizeInfo.plain, hvs, Head.ownBytes] <;> omega @@ -427,7 +427,7 @@ theorem PrepWF.build_size {p : Prep} (hp : PrepWF p) obtain ⟨hs0, _⟩ := ih false _ ty (by omega) hty obtain ⟨hs1, _⟩ := ih false _ v (by omega) hv obtain ⟨hs2, _⟩ := ih false _ bd (by omega) hbd - simp only [Bool.false_eq_true, if_false] at hs0 hs1 hs2 + simp only [Bool.false_eq_true, ite_false] at hs0 hs1 hs2 refine ⟨?_, fun F' _ => by cases F' <;> rfl⟩ rw [← Array.foldl_toList, children_toList (m := 3) (by simpa [Head.arity] using har)] simp [sizeInfoWith, SizeInfo.plain, hs0, hs1, hs2, Head.ownBytes, @@ -506,7 +506,7 @@ theorem PrepWF.build_size {p : Prep} (hp : PrepWF p) simp only at htl' rw [hjeq, hend] at htl' obtain ⟨htfull, htonly⟩ := ih false _ tl (by omega) htl' - simp only [Bool.false_eq_true, if_false] at htfull + simp only [Bool.false_eq_true, ite_false] at htfull obtain ⟨_, hfull, honly⟩ := spineFold_size sc p.family[t]! _ (fun n => uCost p w avail n.sideChild) _ _ _ hfam hsz (htonly _ (Ne.symm htf)) hfold diff --git a/Ix/Compile/Verify/UniformModel.lean b/Ix/Compile/Verify/UniformModel.lean index 25f22d739..91677700c 100644 --- a/Ix/Compile/Verify/UniformModel.lean +++ b/Ix/Compile/Verify/UniformModel.lean @@ -182,18 +182,18 @@ theorem spineTables_spec {dag : Dag} (h : DagWF dag) {family : Array Family} let vtl := if family[nxt]! = family[m]! then tl[nxt]! else nxt have hstep : spineStep dag family (len, tl) m = (len.set! m vlen, tl.set! m vtl) := by unfold spineStep - simp only [hf, hnx, vlen, vtl, bne_iff_ne, ne_eq, not_false_eq_true, if_true, + simp only [hf, hnx, vlen, vtl, bne_iff_ne, ne_eq, not_false_eq_true, ite_true, beq_iff_eq] split <;> rfl rw [hstep] have keep : ∀ (v : Nat) (arr : Array Nat) (i : Nat), i ≠ m → (arr.set! m v)[i]! = arr[i]! := by intro v arr i hi - rw [setBang_getElem!, if_neg (by intro h; exact hi h.1.symm)] + rw [setBang_getElem!, ite_eq_right (by intro h; exact hi h.1.symm)] have hat : ∀ (v : Nat) (arr : Array Nat), arr.size = dag.size → (arr.set! m v)[m]! = v := by intro v arr hs - rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩] + rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩] refine ⟨by simp [hs1], by simp [hs2], fun t ht => ?_, fun t ht => ?_⟩ · by_cases htm : t = m · subst htm @@ -257,9 +257,9 @@ theorem PrepWF.spine_step {t : Nat} (ht : t < p.dag.size) (hf : p.family[t]! ≠ obtain ⟨hl, htl⟩ := hrow hf unfold snext by_cases hs : p.family[(p.dag.node t).spineNext]! = p.family[t]! - · rw [if_pos hs] at hl htl + · rw [ite_eq_left hs] at hl htl exact Or.inl ⟨hs, hl, htl⟩ - · rw [if_neg hs] at hl htl + · rw [ite_eq_right hs] at hl htl exact Or.inr ⟨hs, hl, htl⟩ /-- The spine of a telescope node: every node before the tail is a @@ -438,7 +438,7 @@ theorem PrepWF.uCost_eq (w : Nat) (avail : Nat → Bool) (t : Nat) (ht : t < p.d have hsame : ∀ c, c < m → (step A m)[c]! = A[c]! := by intro c hc simp only [step, setBang_getElem!] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] refine ⟨by simp [step, hsize], fun t' ht' => ?_⟩ have hcongr : costOf p w avail ((step A m)[·]!) t' = costOf p w avail (A[·]!) t' := hp.costOf_congr (by omega) fun c hc => hsame c (by omega) @@ -446,7 +446,7 @@ theorem PrepWF.uCost_eq (w : Nat) (avail : Nat → Bool) (t : Nat) (ht : t < p.d by_cases htm : t' = m · subst htm simp only [step, setBang_getElem!, hsize] - rw [if_pos (by simp; omega)] + rw [ite_eq_left (by simp; omega)] · rw [hsame t' (by omega)] exact hprev t' (by omega) have := (hinv p.dag.size (Nat.le_refl _)).2 t ht @@ -587,7 +587,7 @@ theorem PrepWF.cutScan_spec {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Nat have hcand : tag4Size (p.spineLen[t]! - p.spineLen[spineAt p t k]!) + (prefixSides p cost t p.spineLen[t]! - sides[spineAt p t k]!) + (widthOf width (spineAt p t k)).getD 0 = cutCost p w cost t k := by - rw [hlenk, hsides k (by omega) hkl, hwidth, if_pos hav] + rw [hlenk, hsides k (by omega) hkl, hwidth, ite_eq_left hav] have hsplit := prefixSides_add p cost k (p.spineLen[t]! - k) t rw [show k + (p.spineLen[t]! - k) = p.spineLen[t]! by omega] at hsplit unfold cutCost @@ -668,18 +668,18 @@ theorem PrepWF.evalStep_spec {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Nat obtain ⟨hcs, hss, hbs⟩ := hsz have keepN : ∀ (v : Nat) (arr : Array Nat) (i : Nat), i ≠ m → (arr.set! m v)[i]! = arr[i]! := by intro v arr i hi - rw [setBang_getElem!, if_neg (by intro h; exact hi h.1.symm)] + rw [setBang_getElem!, ite_eq_right (by intro h; exact hi h.1.symm)] have keepO : ∀ (v : Option Nat) (arr : Array (Option Nat)) (i : Nat), i ≠ m → (arr.set! m v)[i]! = arr[i]! := by intro v arr i hi - rw [setBang_getElem!, if_neg (by intro h; exact hi h.1.symm)] + rw [setBang_getElem!, ite_eq_right (by intro h; exact hi h.1.symm)] have atN : ∀ (v : Nat) (arr : Array Nat), arr.size = p.dag.size → (arr.set! m v)[m]! = v := by intro v arr hs - rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩] + rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩] have atO : ∀ (v : Option Nat) (arr : Array (Option Nat)), arr.size = p.dag.size → (arr.set! m v)[m]! = v := by intro v arr hs - rw [setBang_getElem!, if_pos ⟨rfl, by omega⟩] + rw [setBang_getElem!, ite_eq_left ⟨rfl, by omega⟩] have hcostLt : ∀ c, c < m → st.cost[c]! = uCost p w avail c := fun c hc => (hrows c hc).1 have hcm := hp.uCost_eq w avail m hm have hcostOf : ∀ inl, inlOf p w avail (uCost p w avail) m = inl → @@ -696,11 +696,11 @@ theorem PrepWF.evalStep_spec {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Nat have hfold : (p.dag.node m).children.foldl (fun acc c => acc + st.cost[c]!) (p.dag.node m).head.ownBytes = inlOf p w avail (uCost p w avail) m := by unfold inlOf - rw [if_pos hf] + rw [ite_eq_left hf] exact foldl_add_congr _ _ fun c hc => hcostLt c (hp.dag.child_lt hm hc) have hst' : st'.cost = st.cost.set! m (uCost p w avail m) ∧ st'.sides = st.sides ∧ st'.below = st.below := by - simp only [st', evalStep, haff, if_true, hf, beq_self_eq_true] + simp only [st', evalStep, haff, ite_true, hf, beq_self_eq_true] refine ⟨?_, trivial, trivial⟩ congr 1 exact hcostOf _ hfold.symm @@ -723,28 +723,28 @@ theorem PrepWF.evalStep_spec {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Nat prefixSides p (uCost p w avail) m p.spineLen[m]! := by rw [hcostLt _ hside] rcases hp.spine_step hm hf with ⟨hs, hl, _⟩ | ⟨hs, hl, _⟩ - · rw [if_pos hs, ((hrows _ hlt).2 (by rw [hs]; exact hf)).1, hl] + · rw [ite_eq_left hs, ((hrows _ hlt).2 (by rw [hs]; exact hf)).1, hl] rfl - · rw [if_neg hs, hl] + · rw [ite_eq_right hs, hl] simp [prefixSides, sideCost] have hB : FirstAvail p avail m 1 (if p.family[snext p m]! = p.family[m]! then (if (widthOf width (snext p m)).isSome then some (snext p m) else st.below[snext p m]!) else none) := by rcases hp.spine_step hm hf with ⟨hs, hl, _⟩ | ⟨hs, hl, _⟩ - · rw [if_pos hs, hwidth] + · rw [ite_eq_left hs, hwidth] have hn1 := (hp.spine (snext p m) (by omega) (by rw [hs]; exact hf)).1 by_cases hav : avail (snext p m) = true - · rw [if_pos hav] + · rw [ite_eq_left hav] exact ⟨1, Nat.le_refl _, by omega, rfl, hav, fun k' h1 h2 => by omega⟩ - · rw [if_neg hav] - simp only [Option.isSome_none, Bool.false_eq_true, if_false] + · rw [ite_eq_right hav] + simp only [Option.isSome_none, Bool.false_eq_true, ite_false] have hrow := ((hrows _ hlt).2 (by rw [hs]; exact hf)).2 have hlen1 : p.spineLen[spineAt p m 1]! = p.spineLen[m]! - 1 := by simp only [spineAt]; omega exact FirstAvail.unshift (by omega) (by simpa [spineAt] using hav) (FirstAvail.shift hlen1 hrow) - · rw [if_neg hs] + · rw [ite_eq_right hs] intro k h1 h2 omega generalize hBdef : (if p.family[snext p m]! = p.family[m]! then @@ -782,12 +782,12 @@ theorem PrepWF.evalStep_spec {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Nat p.spineLen[m]! B (tag4Size p.spineLen[m]! + S + st.cost[p.tail[m]!]!) st.work).1 := by rw [hscan, hcostLt _ htl] unfold inlOf - rw [if_neg hf, cutCosts_eq, naturalCost, hSdef] + rw [ite_eq_right hf, cutCosts_eq, naturalCost, hSdef] have hst' : st'.cost = st.cost.set! m (uCost p w avail m) ∧ st'.sides = st.sides.set! m S ∧ st'.below = st.below.set! m B := by - simp only [st', evalStep, haff, if_true] + simp only [st', evalStep, haff, ite_true] have hfb : (p.family[m]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] simp only [ite_beq_family] rw [show (p.dag.node m).spineNext = snext p m from rfl, hS, hBdef] refine ⟨?_, rfl, rfl⟩ @@ -973,9 +973,9 @@ theorem pickStep_spec (init : Option (Choice × Nat × ByteArray)) (x : Choice unfold pickStep simp only by_cases hlt : x.2.1 < c.2.1 - · rw [if_pos hlt] + · rw [ite_eq_left hlt] exact ⟨x, rfl, Or.inl rfl, Nat.le_refl _, fun b' h => by cases h; omega⟩ - · rw [if_neg hlt] + · rw [ite_eq_right hlt] split · rename_i heq have hxc : x.2.1 = c.2.1 := by @@ -1100,14 +1100,14 @@ theorem PrepWF.cutOptions_spec {p : Prep} (hp : PrepWF p) {w : Nat} {avail : Nat have hcand : tag4Size (p.spineLen[t]! - p.spineLen[spineAt p t k]!) + (prefixSides p (uCost p w avail) t p.spineLen[t]! - ev.sides[spineAt p t k]!) + (widthOf width (spineAt p t k)).getD 0 = cutCost p w (uCost p w avail) t k := by - rw [hlenk, hsides k (by omega) hkl, hwidth, if_pos hav] + rw [hlenk, hsides k (by omega) hkl, hwidth, ite_eq_left hav] have hsplit := prefixSides_add p (uCost p w avail) k (p.spineLen[t]! - k) t rw [show k + (p.spineLen[t]! - k) = p.spineLen[t]! by omega] at hsplit unfold cutCost rw [show p.spineLen[t]! - (p.spineLen[t]! - k) = k by omega, hsplit] simp have hidx : (index[spineAt p t k]?.getD none).isSome = true := by rw [hindex]; exact hav - simp only [Prep.cutOptions, hidx, if_true] + simp only [Prep.cutOptions, hidx, ite_true] obtain ⟨L, hL, hcost, hnot⟩ := ih (k + 1) _ _ (by omega) (by omega) (by omega) (FirstAvail.shift hlenk (hbelow k (by omega) hkl)) refine ⟨(Choice.cut (p.spineLen[t]! - p.spineLen[spineAt p t k]!), @@ -1189,11 +1189,11 @@ theorem PrepWF.inlineCost_eq {p : Prep} (hp : PrepWF p) unfold Prep.inlineCost Prep.options uInl by_cases hf : p.family[t]! = .none · have hfb : (p.family[t]! == Family.none) = true := by simp [hf] - simp only [hfb, if_true] + simp only [hfb, ite_true] have hfold : (p.dag.node t).children.foldl (fun acc c => acc + (p.evalAll width).cost[c]!) (p.dag.node t).head.ownBytes = inlOf p w avail (uCost p w avail) t := by unfold inlOf - rw [if_pos hf] + rw [ite_eq_left hf] exact foldl_add_congr _ _ fun c hc => hcost c (by have := hp.dag.child_lt ht hc; omega) rw [pickOption_cost _ (Choice.inline, inlOf p w avail (uCost p w avail) t, @@ -1204,7 +1204,7 @@ theorem PrepWF.inlineCost_eq {p : Prep} (hp : PrepWF p) rw [hbase, hfold] rfl · have hfb : (p.family[t]! == Family.none) = false := by simpa using hf - simp only [hfb, Bool.false_eq_true, if_false] + simp only [hfb, Bool.false_eq_true, ite_false] obtain ⟨hs, hb⟩ := (hrow t ht).2 hf obtain ⟨_, hk, _, htl, _⟩ := hp.spine t ht hf have hspine : ∀ k, 1 ≤ k → k < p.spineLen[t]! → @@ -1237,7 +1237,7 @@ theorem PrepWF.inlineCost_eq {p : Prep} (hp : PrepWF p) rw [pickOption_cost _ natOpt L] · rw [hLcost, hnat] unfold inlOf - rw [if_neg hf, cutCosts_eq] + rw [ite_eq_right hf, cutCosts_eq] · simp only [base, natOpt] at hL hbase rw [Array.toList_filter] refine (congrArg (List.filter _) hL).trans ?_ diff --git a/Ix/Compile/Verify/UniformOptimal.lean b/Ix/Compile/Verify/UniformOptimal.lean index 7d15c30fa..c0db2d5e1 100644 --- a/Ix/Compile/Verify/UniformOptimal.lean +++ b/Ix/Compile/Verify/UniformOptimal.lean @@ -481,7 +481,7 @@ theorem msOf_spec (cand : Array Bool) (O : Array Nat) (v : Nat) : by_cases hv : v ∈ O.toList · by_cases hs : v < cand.size · simp [hv, hs] - · simp only [hv, hs, and_false, if_false, not_true_eq_false, and_false, iff_false] + · simp only [hv, hs, and_false, ite_false, not_true_eq_false, and_false, iff_false] simp [hs] · simp [hv] @@ -538,13 +538,13 @@ theorem opaqueArr_opaqueOn {dag : Dag} (hwf : DagWF dag) {roots : Array Nat} rw [hcx.prep, hcx.width] at hun refine ⟨hAin t htI, fun hf => ?_, fun hf => ?_⟩ · have hfb : ((Prep.ofDag dag).family[t]! == .none) = true := by simp [hf] - rw [if_pos hfb] at hun + rw [ite_eq_left hfb] at hun have h1 := (hble t).1 have h2 := hbs.2.1 simp only [ge_iff_le, decide_eq_true_eq] at hun omega · have hfb : ((Prep.ofDag dag).family[t]! == .none) = false := by simpa using hf - rw [if_neg (by simp [hfb])] at hun + rw [ite_eq_right (by simp [hfb])] at hun have h1 := (hble t).2.1 have h2 := (hbs.2.2 hf).1 simp only [ge_iff_le, decide_eq_true_eq] at hun @@ -565,10 +565,10 @@ theorem ucand_of_ucls {dag : Dag} {roots : Array Nat} {w : Nat} {θ : _root_.Int rw [getElem!_range_map _ (by rw [ofDag_dag]; exact ht)] simp only [Bool.and_eq_true, Bool.not_eq_true', decide_eq_true_eq] by_cases hce : certainExcludedTest (Prep.ofDag dag) (graphFacts dag roots) w t = true - · exact absurd (by rw [if_pos hce]) h1 - · rw [if_neg hce] at h1 h2 + · exact absurd (by rw [ite_eq_left hce]) h1 + · rw [ite_eq_right hce] at h1 h2 by_cases hdeg : (graphFacts dag roots).deg[t]! < 2 - · exact absurd (by rw [if_pos hdeg]) h2 + · exact absurd (by rw [ite_eq_left hdeg]) h2 · exact ⟨by simpa using hce, by omega⟩ /-- **Groups are modular.** If a group passes the separation check under the @@ -756,10 +756,10 @@ theorem deg_of_ucls {dag : Dag} {roots : Array Nat} {w : Nat} {θ : _root_.Int} 2 ≤ (graphFacts dag roots).deg[t]! := by rw [ucls_eq ht] at h by_cases hce : certainExcludedTest (Prep.ofDag dag) (graphFacts dag roots) w t = true - · rw [if_pos hce] at h; rcases h with h | h <;> cases h - · rw [if_neg hce] at h + · rw [ite_eq_left hce] at h; rcases h with h | h <;> cases h + · rw [ite_eq_right hce] at h by_cases hdeg : (graphFacts dag roots).deg[t]! < 2 - · rw [if_pos hdeg] at h; rcases h with h | h <;> cases h + · rw [ite_eq_left hdeg] at h; rcases h with h | h <;> cases h · omega /-- The threshold condition of `classify_sound` at a candidate a minimum omits. -/ @@ -803,7 +803,7 @@ theorem GlobalWF.min_class {dag : Dag} {roots : Array Nat} {w : Nat} {θ : _root unfold certainExcludedTest at hce simp only [decide_eq_true_eq] at hce exact excluded_of_minimum hG.wf hG.spines roots hG.hroots w hX htn hce ht - · rw [if_neg hce, if_neg (by omega)] + · rw [ite_eq_right hce, ite_eq_right (by omega)] split · exact Or.inl rfl · exact Or.inr rfl diff --git a/Ix/Compile/Verify/UniformOptimality.lean b/Ix/Compile/Verify/UniformOptimality.lean index 5283e9158..47b8a8637 100644 --- a/Ix/Compile/Verify/UniformOptimality.lean +++ b/Ix/Compile/Verify/UniformOptimality.lean @@ -51,14 +51,14 @@ theorem stage_cls_theta : by_cases hc : (tag0Size ((ucand ex.dag ex.roots w).filter id).size == tag0Size ((ucls ex.dag ex.roots w (uthetaMax ex.dag ex.roots w)).filter (· == .certainStored)).size) = true - · have ht : (stg w ex).theta = 1 := by rw [htheta, if_pos hc] + · have ht : (stg w ex).theta = 1 := by rw [htheta, ite_eq_left hc] refine ⟨?_, Or.inr ⟨ht, by simpa using hc⟩⟩ rw [hcls, ht] rfl - · have ht : (stg w ex).theta = uthetaMax ex.dag ex.roots w := by rw [htheta, if_neg hc] + · have ht : (stg w ex).theta = uthetaMax ex.dag ex.roots w := by rw [htheta, ite_eq_right hc] refine ⟨?_, Or.inl ht⟩ rw [hcls, ht] - simp only [hmax, Bool.false_eq_true, if_false] + simp only [hmax, Bool.false_eq_true, ite_false] theorem stage_pick (c : UClass) : ((Array.range ex.dag.size).filter ((stg w ex).cls[·]! == c)).toList = @@ -86,7 +86,7 @@ theorem stage_opaq (u : Nat) : (stg w ex).opaq[u]! = decide (u ∈ (stg w ex).cs by_cases hu : u ∈ (stg w ex).cs.toList · have := stage_cs_lt w ex u hu simp [hu, this] - · simp only [hu, false_and, if_false, decide_false] + · simp only [hu, false_and, ite_false, decide_false] by_cases hn : u < ex.dag.size · rw [getElem!_pos _ u (by simpa using hn)]; simp · simp [hn] @@ -136,9 +136,9 @@ theorem edgeCount_fold (dag : Dag) (q y : Nat) (node : Node) : | i :: l, a, b => by rw [List.foldl_cons] by_cases hi : (node.child i == y) = true - · rw [if_pos hi, edgeCount_fold dag q y node l] + · rw [ite_eq_left hi, edgeCount_fold dag q y node l] cases hc : continuationEdge node i (dag.node y) <;> simp [hi, hc] <;> omega - · rw [if_neg hi, edgeCount_fold dag q y node l] + · rw [ite_eq_right hi, edgeCount_fold dag q y node l] simp only [Bool.not_eq_true] at hi simp [hi] @@ -360,7 +360,7 @@ theorem searchComponents_spec {w : Nat} {limits : Limits} {ex : Expanded} rw [List.foldlM_cons] at hres obtain ⟨acc', hstep, hres⟩ := bind_eq_ok hres obtain ⟨results0, states0, costEvals0⟩ := acc - simp only [hsub, Bool.false_eq_true, if_false] at hstep + simp only [hsub, Bool.false_eq_true, ite_false] at hstep obtain ⟨⟨r, s1, c1⟩, hsc, hstep⟩ := bind_eq_ok hstep simp only [pure, Except.pure, Except.ok.injEq] at hstep subst hstep @@ -983,7 +983,7 @@ theorem bestSetOf_spec {tb : CTable} (hs : SortedT tb) {bd : _root_.Int} {bs : A subst he obtain ⟨d, s⟩ := e simp only at hed - simp only [bestStepSet, hed, beq_self_eq_true, if_true] at hst + simp only [bestStepSet, hed, beq_self_eq_true, ite_true] at hst cases acc with | none => cases hst | some a0 => simp only at hst; split at hst <;> cases hst diff --git a/Ix/Compile/Verify/UniformOptimizer.lean b/Ix/Compile/Verify/UniformOptimizer.lean index 3cab8e611..0b3423f0d 100644 --- a/Ix/Compile/Verify/UniformOptimizer.lean +++ b/Ix/Compile/Verify/UniformOptimizer.lean @@ -91,9 +91,9 @@ theorem indexOfPairs_isSome : by_cases htu : t = u · subst htu left - rw [getD_setBang, if_pos ⟨rfl, hu⟩] + rw [getD_setBang, ite_eq_left ⟨rfl, hu⟩] rfl - · rw [getD_setBang, if_neg (fun h => htu h.1)] + · rw [getD_setBang, ite_eq_right (fun h => htu h.1)] rcases h with h | ⟨i', hi'⟩ · exact Or.inl h · rcases List.mem_cons.mp hi' with h | h @@ -137,7 +137,7 @@ theorem widthOfStored (n w : Nat) (stored : List Nat) (hin : ∀ t ∈ stored, t rw [h stored _ (by simp) hin] by_cases hu : u ∈ stored · simp [hu] - · simp only [hu, decide_false, if_false, Bool.false_eq_true] + · simp only [hu, decide_false, ite_false, Bool.false_eq_true] simp only [Array.getElem?_replicate] split <;> rfl intro l @@ -269,7 +269,7 @@ theorem optimizeUniform_parts {w : Nat} {limits : Limits} {ex : Expanded} ↓reduceIte] at h cases h | true => - simp only [hw, hcp, har, hr, hm, Bool.false_eq_true, if_false, if_true] at h + simp only [hw, hcp, har, hr, hm, Bool.false_eq_true, ite_false, ite_true] at h cases hs : (List.range ex.dag.size).all (fun t => (Prep.ofDag ex.dag).spineLen[t]! < teleSubaddEnd) with | false => diff --git a/Ix/Compile/Verify/UniformRevisible.lean b/Ix/Compile/Verify/UniformRevisible.lean index 6f9bfc36a..0ec7bb743 100644 --- a/Ix/Compile/Verify/UniformRevisible.lean +++ b/Ix/Compile/Verify/UniformRevisible.lean @@ -106,14 +106,14 @@ theorem vis_mono {dag : Dag} (hwf : DagWF dag) (roots : Array Nat) have hyn := List.mem_range.mp hy unfold visWeight by_cases h1 : ms'[y]! = true - · rw [if_pos h1, if_pos (hms y h1)] + · rw [ite_eq_left h1, ite_eq_left (hms y h1)] exact Nat.le_refl 1 - · rw [if_neg h1] + · rw [ite_eq_right h1] by_cases h2 : ms[y]! = true - · rw [if_pos h2] + · rw [ite_eq_left h2] have := vis_pos hwf roots hroots hreach ms' y hyn unfold visibleCap; simp only [Nat.le_min]; omega - · rw [if_neg h2] + · rw [ite_eq_right h2] have := (ih (dag.size - y) (by omega) y rfl hyn).1 simp only [Nat.min_def]; split <;> split <;> omega have hterm : ∀ (e : Nat → Nat), (∀ y, y ≤ t → e y = 0) → @@ -249,18 +249,18 @@ theorem revisible_le {dag : Dag} (hwf : DagWF dag) {roots : Array Nat} have e := visibleCounts_spec hwf roots hroots ms ht refine ⟨?_, ?_⟩ · by_cases hs : y < ds.size - · rw [if_pos ⟨rfl, hs⟩] + · rw [ite_eq_left ⟨rfl, hs⟩] have := hbound false ht - simp only [Bool.false_eq_true, if_false] at this + simp only [Bool.false_eq_true, ite_false] at this rw [e.1]; exact this - · rw [if_neg (fun h => hs h.2)]; exact (hinv y ht).1 + · rw [ite_eq_right (fun h => hs h.2)]; exact (hinv y ht).1 · by_cases hs : y < hs.size - · rw [if_pos ⟨rfl, hs⟩] + · rw [ite_eq_left ⟨rfl, hs⟩] have := hbound true ht - simp only [if_true] at this + simp only [ite_true] at this rw [e.2]; exact this - · rw [if_neg (fun h => hs h.2)]; exact (hinv y ht).2 - · rw [if_neg (fun h => hyt h.1), if_neg (fun h => hyt h.1)] + · rw [ite_eq_right (fun h => hs h.2)]; exact (hinv y ht).2 + · rw [ite_eq_right (fun h => hyt h.1), ite_eq_right (fun h => hyt h.1)] exact hinv t ht have hall : ∀ (l : List Nat) (acc : Array Nat × Array Nat), (∀ k ∈ l, k < cx.area.size) → Inv acc → Inv (l.foldl (fun (acc : Array Nat × Array Nat) k => diff --git a/Ix/Compile/Verify/UniformSearch.lean b/Ix/Compile/Verify/UniformSearch.lean index 254c1ff60..8316a34f8 100644 --- a/Ix/Compile/Verify/UniformSearch.lean +++ b/Ix/Compile/Verify/UniformSearch.lean @@ -61,10 +61,10 @@ theorem markTable_spec (n : Nat) (ts : Array Nat) (x : Nat) : unfold markTable rw [← Array.foldl_toList, foldl_setBang_const] by_cases h : x ∈ ts.toList ∧ x < (Array.replicate n false).size - · rw [if_pos h] + · rw [ite_eq_left h] simp only [Array.size_replicate, Array.mem_toList_iff] at h simp [h] - · rw [if_neg h] + · rw [ite_eq_right h] simp only [Array.size_replicate, Array.mem_toList_iff, not_and] at h constructor · intro hx @@ -275,14 +275,14 @@ theorem reachLabelsOn_allows {dag : Dag} (hwf : DagWF dag) (order : Array Nat) refine ⟨(dag.node y).child k, ?_, ?_⟩ · rw [child_eq_getElem _ k (by rw [hwf.children_size hx]; exact hk)] exact Array.mem_toList_iff.mpr (Array.getElem_mem _) - · rw [if_pos hO, hℓ]; exact Or.inr rfl + · rw [ite_eq_left hO, hℓ]; exact Or.inr rfl · right simp only [ofDag_dag] at hk hO hc ⊢ have hclt := hwf.childAt_lt hx hk refine ⟨(dag.node y).child k, ?_, ?_⟩ · rw [child_eq_getElem _ k (by rw [hwf.children_size hx]; exact hk)] exact Array.mem_toList_iff.mpr (Array.getElem_mem _) - · rw [if_neg (by simp [hO])] + · rw [ite_eq_right (by simp [hO])] rcases hcl y List.mem_cons_self k hk hO v ℓ hc hℓ with hcP | hcl' · exact hinv _ hcP v hc ℓ hℓ · rcases List.mem_cons.mp hcl' with he | he @@ -343,7 +343,7 @@ theorem sepCheck_spec {cx : SCtx} (hwf : DagWF cx.up.prep.dag) rw [sepLabels_spec] at h2 by_cases hc : t < dag.size ∧ t ∉ inRed ∧ t ∉ outRed · exact ⟨h1.1, hc⟩ - · rw [if_neg hc] at h2; cases h2 + · rw [ite_eq_right hc] at h2; cases h2 refine ⟨hga, ?_⟩ intro v hvm hvo hvO a b ha hb hag hbm hbg hbi hbo have hvn := hmem v hvm @@ -353,24 +353,24 @@ theorem sepCheck_spec {cx : SCtx} (hwf : DagWF cx.up.prep.dag) have hla : lab[a]! = some 1 := by obtain ⟨_, han, hai, hao⟩ := hga a hag show (sepLabels dag.size cx.members g inRed outRed)[a]! = some 1 - rw [sepLabels_spec, if_pos ⟨han, hai, hao⟩, if_pos hag] + rw [sepLabels_spec, ite_eq_left ⟨han, hai, hao⟩, ite_eq_left hag] have hlb : lab[b]! = some 2 := by show (sepLabels dag.size cx.members g inRed outRed)[b]! = some 2 - rw [sepLabels_spec, if_pos ⟨hbn, hbi, hbo⟩, if_neg hbg, if_pos hbm] + rw [sepLabels_spec, ite_eq_left ⟨hbn, hbi, hbo⟩, ite_eq_right hbg, ite_eq_left hbm] -- every labeled term is a member have hlabm : ∀ x ℓ, lab[x]! = some ℓ → x ∈ cx.members ∧ x < dag.size := by intro x ℓ hx have hx' : (sepLabels dag.size cx.members g inRed outRed)[x]! = some ℓ := hx rw [sepLabels_spec] at hx' by_cases hc : x < dag.size ∧ x ∉ inRed ∧ x ∉ outRed - · rw [if_pos hc] at hx' + · rw [ite_eq_left hc] at hx' by_cases hxg : x ∈ g · exact ⟨(hga x hxg).1, hc.1⟩ - · rw [if_neg hxg] at hx' + · rw [ite_eq_right hxg] at hx' by_cases hxm : x ∈ cx.members · exact ⟨hxm, hc.1⟩ - · rw [if_neg hxm] at hx'; cases hx' - · rw [if_neg hc] at hx'; cases hx' + · rw [ite_eq_right hxm] at hx'; cases hx' + · rw [ite_eq_right hc] at hx'; cases hx' -- the closure facts let isMem := markTable dag.size cx.members have hcl_mem : ∀ t, t ∈ cx.closure.toList ↔ t < dag.size ∧ ∃ m, isMem[m]! = true ∧ Desc dag t m := by @@ -435,7 +435,7 @@ theorem widthFold_spec (w : Nat) (avail : Nat → Bool) : by_cases hut : u = t · subst hut by_cases hav : avail u = true - · simp only [hav, if_true, widthOf_eq] + · simp only [hav, ite_true, widthOf_eq] by_cases hu : u < a.size · simp [hu] · simp [hu] @@ -614,7 +614,7 @@ theorem entry_inl {dag : Dag} (hwf : DagWF dag) {w : Nat} {A : Nat → Bool} ev x hx (by simp [hx]) hsz rows' rw [(hr x (Nat.lt_succ_self x)).1, hp.uCost_eq w A' x hx] unfold costOf uInl - rw [if_neg (by simp [A'])] + rw [ite_eq_right (by simp [A'])] rw [hp.inlOf_congr (avail := A') hx (g := uCost (Prep.ofDag dag) w A) (fun c hc => uCost_desc_local hwf w (Nat.lt_trans hc hx) (fun v hv => (hag c hc v hv).symm))] apply inlOf_avail_congr diff --git a/Ix/Compile/Verify/UniformSearchSpec.lean b/Ix/Compile/Verify/UniformSearchSpec.lean index 68f022a0c..50f997933 100644 --- a/Ix/Compile/Verify/UniformSearchSpec.lean +++ b/Ix/Compile/Verify/UniformSearchSpec.lean @@ -855,7 +855,7 @@ theorem Env.nodeP_step {E : Env} (hE : E.WF) {limits : Limits} {fuel : Nat} obtain ⟨st1, hst1, h⟩ := bind_eq_ok h have hm1 : st1.memo = st.memo := chargeP_memo hst1 by_cases hemp : (open_.map (·.1)).isEmpty = true - · rw [if_pos hemp] at h + · rw [ite_eq_left hemp] at h -- every undecided member is decided: one entry simp only [pure, Except.pure, Except.ok.injEq, Prod.mk.injEq] at h obtain ⟨rfl, rfl⟩ := h @@ -880,9 +880,9 @@ theorem Env.nodeP_step {E : Env} (hE : E.WF) {limits : Limits} {fuel : Nat} rw [hp.length_eq, E.delta_perm hp, ← hval, Array.length_toList] exact (add_hasAtT pre.tab.sorted hL's (e := ((phi : _root_.Int) - phi0, localIn'))).congr (fun u => hp.mem_iff.symm) - rw [if_neg hemp] at h + rw [ite_eq_right hemp] at h by_cases hpr : tb.prunes ((phi : _root_.Int) - phi0) E.cx.slack = true - · rw [if_pos hpr] at h + · rw [ite_eq_left hpr] at h -- pruned: no minimum respects the node simp only [pure, Except.pure, Except.ok.injEq, Prod.mk.injEq] at h obtain ⟨rfl, rfl⟩ := h @@ -897,7 +897,7 @@ theorem Env.nodeP_step {E : Env} (hE : E.WF) {limits : Limits} {fuel : Nat} simp only [decide_eq_true_eq] at hpr omega · cases hpr - rw [if_neg hpr] at h + rw [ite_eq_right hpr] at h split at h next hpc => generalize hgr : E.cx.groups _ _ (Array.map (fun x => x.fst) open_) = groups at h hpc @@ -906,7 +906,7 @@ theorem Env.nodeP_step {E : Env} (hE : E.WF) {limits : Limits} {fuel : Nat} generalize hrt : (if groups.size > 1 then true else _ : Bool) = route at h cases route case true => - rw [if_pos rfl] at h + rw [ite_eq_left rfl] at h -- split into groups have hphiN := phiE_cost hE.G.wf hE.cx (I ++ localIn') hinM (fun t => ((I ++ localIn').foldl (·.insert ·) (∅ : Std.HashSet Nat)).contains t) @@ -970,7 +970,7 @@ theorem Env.nodeP_step {E : Env} (hE : E.WF) {limits : Limits} {fuel : Nat} rw [E.delta_perm hpp] exact Or.inr ⟨rfl, leL_refl _⟩ case false => - rw [if_neg (by decide)] at h + rw [ite_eq_right (by decide)] at h split at h · rename_i t gt hpick have htU : t ∈ Un := by diff --git a/Ix/Compile/Verify/UniformTables.lean b/Ix/Compile/Verify/UniformTables.lean index 016013bc0..241b4367e 100644 --- a/Ix/Compile/Verify/UniformTables.lean +++ b/Ix/Compile/Verify/UniformTables.lean @@ -96,17 +96,17 @@ theorem add_getElem! (tb : CTable) (e : Entry) (j : Nat) : · omega rw [hget] by_cases hb : betterEntry e tb[e.2.size]! = true - · rw [if_pos hb, setBang_getElem!] + · rw [ite_eq_left hb, setBang_getElem!] by_cases hj : j = e.2.size · subst hj; simp [hsz, hb] - · rw [if_neg (fun h => hj h.1.symm), if_neg (fun h => hj h.1), hget] - · rw [if_neg hb, if_neg (fun h => hb h.2), hget] + · rw [ite_eq_right (fun h => hj h.1.symm), ite_eq_right (fun h => hj h.1), hget] + · rw [ite_eq_right hb, ite_eq_right (fun h => hb h.2), hget] theorem add_hasAt (tb : CTable) (e : Entry) : HasAt (tb.add e) e.2.size e.1 := by by_cases hb : betterEntry e tb[e.2.size]! = true - · exact ⟨e, by rw [add_getElem!, if_pos ⟨rfl, hb⟩], Int.le_refl _⟩ + · exact ⟨e, by rw [add_getElem!, ite_eq_left ⟨rfl, hb⟩], Int.le_refl _⟩ · have hget : (tb.add e)[e.2.size]! = tb[e.2.size]! := by - rw [add_getElem!, if_neg (fun h => hb h.2)] + rw [add_getElem!, ite_eq_right (fun h => hb h.2)] rw [Bool.not_eq_true] at hb cases ho : tb[e.2.size]! with | none => rw [ho] at hb; simp [betterEntry] at hb @@ -121,11 +121,11 @@ theorem add_improves (tb : CTable) (e : Entry) : Improves tb (tb.add e) := by intro j x hx by_cases hj : j = e.2.size ∧ betterEntry e tb[e.2.size]! = true · obtain ⟨rfl, hb⟩ := hj - refine ⟨e, by rw [add_getElem!, if_pos ⟨rfl, hb⟩], ?_⟩ + refine ⟨e, by rw [add_getElem!, ite_eq_left ⟨rfl, hb⟩], ?_⟩ rw [hx] at hb simp only [betterEntry, Bool.or_eq_true, decide_eq_true_eq, Bool.and_eq_true, beq_iff_eq] at hb omega - · exact ⟨x, by rw [add_getElem!, if_neg hj, hx], Int.le_refl _⟩ + · exact ⟨x, by rw [add_getElem!, ite_eq_right hj, hx], Int.le_refl _⟩ theorem add_entries {tb : CTable} {P : Entry → Prop} (h : Entries tb P) {e : Entry} (he : P e) : Entries (tb.add e) P := by @@ -331,7 +331,7 @@ theorem trim_hasAt {tb : CTable} {s k : Nat} {v : _root_.Int} (h : HasAt tb k v) rw [he] simp only have := hv b hb - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] /-! ## Convolution -/ @@ -536,17 +536,17 @@ theorem add_improvesT {tb : CTable} {e : Entry} (hs : SortedT tb) (he : e.2.toLi intro j x hx by_cases hj : j = e.2.size ∧ betterEntry e tb[e.2.size]! = true · obtain ⟨rfl, hb⟩ := hj - refine ⟨e, by rw [add_getElem!, if_pos ⟨rfl, hb⟩], ?_⟩ + refine ⟨e, by rw [add_getElem!, ite_eq_left ⟨rfl, hb⟩], ?_⟩ rw [hx] at hb exact (better_tle he (hs _ x hx)).1 hb - · exact ⟨x, by rw [add_getElem!, if_neg hj, hx], tle_refl x⟩ + · exact ⟨x, by rw [add_getElem!, ite_eq_right hj, hx], tle_refl x⟩ theorem add_hasAtT {tb : CTable} {e : Entry} (hs : SortedT tb) (he : e.2.toList.Pairwise (· < ·)) : HasAtT (tb.add e) e.2.size e.1 e.2.toList := by by_cases hb : betterEntry e tb[e.2.size]! = true - · exact ⟨e, by rw [add_getElem!, if_pos ⟨rfl, hb⟩], Or.inr ⟨rfl, leL_refl _⟩⟩ + · exact ⟨e, by rw [add_getElem!, ite_eq_left ⟨rfl, hb⟩], Or.inr ⟨rfl, leL_refl _⟩⟩ · have hget : (tb.add e)[e.2.size]! = tb[e.2.size]! := by - rw [add_getElem!, if_neg (fun h => hb h.2)] + rw [add_getElem!, ite_eq_right (fun h => hb h.2)] cases ho : tb[e.2.size]! with | none => rw [ho] at hb; simp [betterEntry] at hb | some x => @@ -660,7 +660,7 @@ theorem trim_tie {tb : CTable} (s : Nat) (hs : SortedT tb) : rw [he] simp only have := hv b hb - rw [if_neg (by rcases hgood with h | ⟨h, _⟩ <;> omega)] + rw [ite_eq_right (by rcases hgood with h | ⟨h, _⟩ <;> omega)] theorem mergeSorted_strict {a b : Array Nat} (ha : a.toList.Pairwise (· < ·)) (hb : b.toList.Pairwise (· < ·)) (hd : ∀ x ∈ a.toList, x ∉ b.toList) : diff --git a/Ix/Compile/Verify/UniformWritings.lean b/Ix/Compile/Verify/UniformWritings.lean index 683fc75c5..72d65e540 100644 --- a/Ix/Compile/Verify/UniformWritings.lean +++ b/Ix/Compile/Verify/UniformWritings.lean @@ -123,7 +123,7 @@ theorem PrepWF.inl_node {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool) inlOf p w S f x = (p.dag.node x).head.ownBytes + ((List.range (p.dag.node x).head.arity).map fun i => f ((p.dag.node x).child i)).sum := by unfold inlOf - rw [if_pos hf, ← Array.foldl_toList, foldl_add_eq_sum] + rw [ite_eq_left hf, ← Array.foldl_toList, foldl_add_eq_sum] have har := hp.dag.arity x hx rw [← dag_node_eq hx] at har rw [children_toList har, List.map_map] @@ -133,7 +133,7 @@ theorem inl_tele {p : Prep} (w : Nat) (S : Nat → Bool) (f : Nat → Nat) {x : Nat} (hf : p.family[x]! ≠ .none) : inlOf p w S f x = (cutCosts p w S f x).foldl min (naturalCost p f x) := by unfold inlOf - rw [if_neg hf] + rw [ite_eq_right hf] theorem cut_mem_cutCosts (p : Prep) (w : Nat) (S : Nat → Bool) (f : Nat → Nat) {x j : Nat} (hj1 : 1 ≤ j) (hj : j < p.spineLen[x]!) (hS : S (spineAt p x j) = true) : @@ -142,7 +142,7 @@ theorem cut_mem_cutCosts (p : Prep) (w : Nat) (S : Nat → Bool) (f : Nat → Na unfold cutsFrom apply List.mem_filterMap.mpr refine ⟨j, List.mem_range'_1.mpr ⟨hj1, by omega⟩, ?_⟩ - rw [if_pos hS] + rw [ite_eq_left hS] theorem sum_le_sum_of_le {f g : Nat → Nat} : ∀ (l : List Nat), (∀ k ∈ l, f k ≤ g k) → (l.map f).sum ≤ (l.map g).sum := by @@ -178,7 +178,7 @@ theorem PrepWF.valid_cost {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool refine ⟨?_, fun h => by simp [WTree.isShare] at h⟩ rw [hp.uCost_eq w S _ hx] unfold costOf - simp only [hS, if_true, WTree.cost] + simp only [hS, ite_true, WTree.cost] omega | @node x kids hf hlen _ ih => intro hx @@ -278,7 +278,7 @@ theorem PrepWF.exists_opt {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool have hg : ∀ c, c < x → Valid p S c (g c) ∧ (g c).cost p w = uCost p w S c := by intro c hc have hcn : c < p.dag.size := by omega - simp only [g, dif_pos (And.intro hc hcn)] + simp only [g, dite_eq_left (And.intro hc hcn)] exact Classical.choose_spec (ih c hc hcn).1 -- an optimal inline writing have hinl : ∃ T, Valid p S x T ∧ T.isShare = false ∧ T.cost p w = uInl p w S x := by @@ -348,14 +348,14 @@ theorem PrepWF.exists_opt {p : Prep} (hp : PrepWF p) (w : Nat) (S : Nat → Bool by_cases hS : S x = true · by_cases hle : w ≤ inlOf p w S (uCost p w S) x · refine ⟨.share x, Valid.share hS, ?_⟩ - simp only [hS, if_true, WTree.cost] + simp only [hS, ite_true, WTree.cost] omega · refine ⟨T, hT, ?_⟩ - simp only [hS, if_true] + simp only [hS, ite_true] unfold uInl at hTc omega · refine ⟨T, hT, ?_⟩ - simp only [hS, Bool.false_eq_true, if_false] + simp only [hS, Bool.false_eq_true, ite_false] exact hTc /-! ## Complete encodings -/ @@ -413,14 +413,14 @@ theorem PrepWF.uniformCost_attained {p : Prep} (hp : PrepWF p) (w : Nat) (avail have hentry : ∀ s, s < p.dag.size → Valid p avail s (entry s) ∧ (entry s).isShare = false ∧ (entry s).cost p w = uInl p w avail s := by intro s hs - simp only [entry, dif_pos hs] + simp only [entry, dite_eq_left hs] exact Classical.choose_spec (hp.exists_opt w avail s hs).2 let rootW : Nat → WTree := fun r => if h : r < p.dag.size then Classical.choose (hp.exists_opt w avail r h).1 else default have hrootW : ∀ r, r < p.dag.size → Valid p avail r (rootW r) ∧ (rootW r).cost p w = uCost p w avail r := by intro r hr - simp only [rootW, dif_pos hr] + simp only [rootW, dite_eq_left hr] exact Classical.choose_spec (hp.exists_opt w avail r hr).1 refine ⟨entry, roots.map rootW, ⟨fun s hs => ⟨(hentry s (htable s hs)).1, (hentry s (htable s hs)).2.1⟩, ?_⟩, ?_⟩ diff --git a/Ix/IxVM/Kernel/NatPrim.lean b/Ix/IxVM/Kernel/NatPrim.lean index e9ab11a50..15a0aaa7c 100644 --- a/Ix/IxVM/Kernel/NatPrim.lean +++ b/Ix/IxVM/Kernel/NatPrim.lean @@ -123,24 +123,24 @@ def natPrim := ⟦ } fn nat_land_addr() -> Addr { - store([0xd9u8, 0x8bu8, 0xedu8, 0x1eu8, 0x14u8, 0xcdu8, 0xa0u8, 0xeeu8, - 0xa4u8, 0x70u8, 0xa5u8, 0xa4u8, 0x9fu8, 0xf7u8, 0x92u8, 0x6cu8, - 0x80u8, 0xebu8, 0x4bu8, 0xc7u8, 0xbfu8, 0xbdu8, 0xd0u8, 0xc3u8, - 0xe1u8, 0x4du8, 0x4bu8, 0xaau8, 0x5cu8, 0x2du8, 0xd0u8, 0xd7u8]) + store([0xdeu8, 0x8cu8, 0x10u8, 0x0cu8, 0x22u8, 0xf8u8, 0x2au8, 0x5cu8, + 0x35u8, 0x33u8, 0xc6u8, 0x7eu8, 0x43u8, 0x70u8, 0x67u8, 0x18u8, + 0x13u8, 0x43u8, 0x4au8, 0x6fu8, 0xecu8, 0x5du8, 0x02u8, 0x39u8, + 0x98u8, 0xdeu8, 0xd0u8, 0x90u8, 0xdfu8, 0x4au8, 0x49u8, 0x34u8]) } fn nat_lor_addr() -> Addr { - store([0x88u8, 0xffu8, 0x34u8, 0xddu8, 0x42u8, 0xe5u8, 0x77u8, 0x66u8, - 0xbeu8, 0xefu8, 0xc2u8, 0x29u8, 0xd8u8, 0xb6u8, 0x2du8, 0xabu8, - 0xbau8, 0x9cu8, 0xefu8, 0x6au8, 0xadu8, 0xccu8, 0x85u8, 0xc8u8, - 0x8au8, 0xd6u8, 0x73u8, 0x23u8, 0xd0u8, 0x2bu8, 0xbfu8, 0x21u8]) + store([0x93u8, 0xafu8, 0xc1u8, 0xcdu8, 0x29u8, 0x8cu8, 0x63u8, 0x60u8, + 0x6eu8, 0x5fu8, 0x46u8, 0x8du8, 0x1eu8, 0x59u8, 0x89u8, 0xabu8, + 0x46u8, 0x80u8, 0xd2u8, 0x56u8, 0xe9u8, 0x5du8, 0x07u8, 0xa8u8, + 0x64u8, 0x2au8, 0x88u8, 0xb5u8, 0xc6u8, 0xb8u8, 0x58u8, 0xe1u8]) } fn nat_xor_addr() -> Addr { - store([0x1bu8, 0x0au8, 0xcdu8, 0xd4u8, 0x08u8, 0x0au8, 0xbeu8, 0x5bu8, - 0xc4u8, 0xacu8, 0xb5u8, 0xf0u8, 0x65u8, 0x27u8, 0xcbu8, 0x62u8, - 0xadu8, 0x92u8, 0x79u8, 0x2eu8, 0xb4u8, 0x29u8, 0xc2u8, 0xb3u8, - 0xbcu8, 0xb6u8, 0xf4u8, 0x71u8, 0xd7u8, 0x94u8, 0x50u8, 0x85u8]) + store([0x77u8, 0xddu8, 0x40u8, 0xd7u8, 0xb6u8, 0xcau8, 0x31u8, 0x0cu8, + 0xc5u8, 0x94u8, 0x66u8, 0xd1u8, 0xf2u8, 0x4du8, 0xf4u8, 0xf1u8, + 0x80u8, 0xefu8, 0x50u8, 0xe1u8, 0xb0u8, 0x0fu8, 0xd8u8, 0x50u8, + 0x69u8, 0x84u8, 0x58u8, 0xcdu8, 0x26u8, 0x90u8, 0x1cu8, 0x5du8]) } fn nat_shift_left_addr() -> Addr { @@ -645,17 +645,17 @@ def natPrim := ⟦ } fn string_back_addr() -> Addr { - store([0xb0u8, 0x52u8, 0xe8u8, 0x14u8, 0x12u8, 0x0eu8, 0xa6u8, 0x29u8, - 0x9au8, 0xecu8, 0xf4u8, 0xe9u8, 0xbbu8, 0x2bu8, 0x65u8, 0x6du8, - 0x67u8, 0xc1u8, 0xf9u8, 0x53u8, 0x7eu8, 0x8fu8, 0x0eu8, 0x9fu8, - 0x16u8, 0x47u8, 0x9cu8, 0x98u8, 0xa0u8, 0x4fu8, 0xdeu8, 0x93u8]) + store([0x61u8, 0x6eu8, 0xeeu8, 0xb0u8, 0x73u8, 0x5fu8, 0x93u8, 0xddu8, + 0x10u8, 0x89u8, 0x1bu8, 0x72u8, 0xbbu8, 0x65u8, 0x9du8, 0xd8u8, + 0x04u8, 0x18u8, 0xa6u8, 0xe8u8, 0x4au8, 0x9cu8, 0xe1u8, 0x31u8, + 0x3eu8, 0xcbu8, 0x41u8, 0xb0u8, 0xadu8, 0xc7u8, 0x62u8, 0x3au8]) } fn string_legacy_back_addr() -> Addr { - store([0x10u8, 0xafu8, 0x1du8, 0xecu8, 0xd5u8, 0xd2u8, 0xcdu8, 0x08u8, - 0x5au8, 0xdfu8, 0xf8u8, 0xaeu8, 0x7fu8, 0xb4u8, 0x4cu8, 0xfcu8, - 0x5du8, 0x22u8, 0xa8u8, 0x9bu8, 0xbcu8, 0x40u8, 0xb8u8, 0x1bu8, - 0x80u8, 0x9du8, 0x3du8, 0x55u8, 0x6fu8, 0xdau8, 0x3eu8, 0x8fu8]) + store([0x2fu8, 0x4eu8, 0x03u8, 0x26u8, 0x75u8, 0xb9u8, 0x15u8, 0xbfu8, + 0xd4u8, 0x4cu8, 0x20u8, 0x99u8, 0xb4u8, 0x1cu8, 0x81u8, 0x99u8, + 0x71u8, 0xc2u8, 0x59u8, 0xecu8, 0x42u8, 0xf4u8, 0xb5u8, 0xe2u8, + 0x4fu8, 0xddu8, 0xdfu8, 0x20u8, 0xc0u8, 0x3fu8, 0xe5u8, 0x73u8]) } fn string_to_byte_array_addr() -> Addr { diff --git a/Ix/Lib.lean b/Ix/Lib.lean index de0dc4c1b..36ca17c04 100644 --- a/Ix/Lib.lean +++ b/Ix/Lib.lean @@ -159,7 +159,7 @@ theorem Std.HashMap.getElem?_foldl_insert_of_pairwise_distinct_aux (p := fun x => x.1 == name) hhd rw [hfind_cons] simp only [Option.map_none, Option.or, Option.map_some, - Std.HashMap.getElem?_insert, hhd, if_true] + Std.HashMap.getElem?_insert, hhd, ite_true] · have hhd_ff : (hd.1 == name) = false := Bool.not_eq_true _ |>.mp hhd have hfind_cons : (hd :: tl).find? (fun x => x.1 == name) = tl.find? (fun x => x.1 == name) := diff --git a/Ix/Sharing/Exact/Dictionary.lean b/Ix/Sharing/Exact/Dictionary.lean index 70a3b816e..4afb37b55 100644 --- a/Ix/Sharing/Exact/Dictionary.lean +++ b/Ix/Sharing/Exact/Dictionary.lean @@ -259,7 +259,7 @@ theorem evalHidden_eq (dag : Dag) (family : Array Family) (spineLen tail : Array evalHidden dag family spineLen tail width affected st t := by unfold evalStep evalHidden by_cases ha : affected[t]! = true - · simp only [ha, if_true] + · simp only [ha, ite_true] split · simp only [widthOf_setBang_none, getElem!_setBang] by_cases ht : t < st.cost.size <;> simp [ht] @@ -535,7 +535,7 @@ theorem options_eq_lazy (p : Prep) (ev : DictEval) (index width : Array (Option generalize index[t]?.getD none = o by_cases hf : (p.family[t]! == Family.none) = true · cases o <;> simp [hf, LazyOpt.bytes, tag4Bytes] - · simp only [hf, if_false, Bool.false_eq_true] + · simp only [hf, ite_false, Bool.false_eq_true] rw [← cutOptions_eq_lazy] cases o <;> simp [LazyOpt.bytes, tag4Bytes] @@ -654,7 +654,7 @@ theorem pickLazy_eq_pickBuild (p : Prep) (ev : DictEval) (index width : Array (O generalize index[t]?.getD none = o cases entry <;> cases o <;> by_cases hf : (p.family[t]! == Family.none) = true <;> - simp only [hf, if_true, if_false, Bool.false_eq_true, Array.filter_push, + simp only [hf, ite_true, ite_false, Bool.false_eq_true, Array.filter_push, cutOptionsLazy_filter, cutOptionsLazy_fold, foldl_push_eq] <;> rfl /-- `build` over the lazy options (`build_eq_fast`). -/ @@ -706,7 +706,7 @@ theorem pick_options_lazy (p : Prep) (ev : DictEval) (index width : Array (Optio rw [options_eq_lazy] cases entry · exact pickOption_lazy _ - · simp only [if_true] + · simp only [ite_true] rw [Array.filter_map] exact pickOption_lazy _ diff --git a/Ix/Sharing/Exact/KnapsackFast.lean b/Ix/Sharing/Exact/KnapsackFast.lean index 69086d237..645a144eb 100644 --- a/Ix/Sharing/Exact/KnapsackFast.lean +++ b/Ix/Sharing/Exact/KnapsackFast.lean @@ -163,7 +163,7 @@ theorem foldl_least {α β : Type} (P : α → Prop) (abs : α → β) (lt : β have ha := hacc a rfl rw [hf2 a t ha ht] by_cases hb : lt (abs t) (abs a) = true - · simp only [hb, if_true] + · simp only [hb, ite_true] obtain ⟨hnone, hsome⟩ := ih (some t) hts (fun a ha => by cases ha; exact ht) refine ⟨⟨fun h => absurd (hnone.mp h).1 (by simp), fun h => by simp at h⟩, fun m hm => ?_⟩ obtain ⟨hmem, hle, hlea⟩ := hsome m hm @@ -182,7 +182,7 @@ theorem foldl_least {α β : Type} (P : α → Prop) (abs : α → β) (lt : β rcases hmt with h | h · subst h; exact Or.inr hb · exact Or.inr (htrans _ _ _ h hb) - · simp only [hb, Bool.false_eq_true, if_false] + · simp only [hb, Bool.false_eq_true, ite_false] obtain ⟨hnone, hsome⟩ := ih (some a) hts (fun a' ha' => by cases ha'; exact ha) refine ⟨⟨fun h => absurd (hnone.mp h).1 (by simp), fun h => by simp at h⟩, fun m hm => ?_⟩ obtain ⟨hmem, hle, hlea⟩ := hsome m hm @@ -295,21 +295,21 @@ theorem knapInner_fold (cap c : Nat) (e : _root_.Int × Array Nat) (bySize : CTa unfold srcCands by_cases h1 : c ≤ t ∧ t - c < n ∧ t ≤ cap · have : c ≤ t ∧ t - c < n + 1 ∧ t ≤ cap := ⟨h1.1, by omega, h1.2.2⟩ - rw [if_pos this, if_pos h1] + rw [ite_eq_left this, ite_eq_left h1] · have : ¬(c ≤ t ∧ t - c < n + 1 ∧ t ≤ cap) := by omega - rw [if_neg this, if_neg h1] + rw [ite_eq_right this, ite_eq_right h1] -- the target `c + n` gets entry `n`'s candidate, if any have hnew : c + n ≤ cap → srcCands cap c e bySize (n + 1) (c + n) = (bySize[n]!).elim [] fun x => [knapCand e x] := by intro hle unfold srcCands have : c ≤ c + n ∧ c + n - c < n + 1 ∧ c + n ≤ cap := ⟨by omega, by omega, hle⟩ - rw [if_pos this, Nat.add_sub_cancel_left] + rw [ite_eq_left this, Nat.add_sub_cancel_left] have hold : c + n ≤ cap → srcCands cap c e bySize n (c + n) = [] := by intro _ unfold srcCands have : ¬(c ≤ c + n ∧ c + n - c < n ∧ c + n ≤ cap) := by omega - rw [if_neg this] + rw [ite_eq_right this] unfold knapInner cases hb : bySize[n]! with | none => @@ -324,12 +324,12 @@ theorem knapInner_fold (cap c : Nat) (e : _root_.Int × Array Nat) (bySize : CTa | some x => simp only [Option.elim_some] by_cases hcap : c + n > cap - · simp only [hcap, if_true] + · simp only [hcap, ite_true] refine ⟨hsz, fun t ht => ?_⟩ rw [hval t ht] have htn : t ≠ c + n := by omega rw [hsame t ht htn] - · simp only [hcap, if_false] + · simp only [hcap, ite_false] have hle : c + n ≤ cap := by omega have hlt : c + n < r.size := by omega have hrcn : r[c + n]! = ndp[c + n]! := by @@ -634,13 +634,13 @@ theorem dedupSorted_mem : ∀ (l : List Nat) (z : Nat), z ∈ dedupSorted l ↔ have ih := dedupSorted_mem (b :: l) z by_cases hab : a = b · subst hab - simp only [dedupSorted, if_true, ih, List.mem_cons] + simp only [dedupSorted, ite_true, ih, List.mem_cons] constructor · intro h; exact Or.inr h · rintro (h | h) · exact Or.inl h · exact h - · simp only [dedupSorted, hab, if_false, List.mem_cons, ih] + · simp only [dedupSorted, hab, ite_false, List.mem_cons, ih] /-- The terms of the entries of a table. -/ def InTable (tab : CTable) (z : Nat) : Prop := @@ -732,8 +732,8 @@ theorem LayerInv.prevFD_eq {cap : Nat} {tabs : Array CTable} {j : Nat} {dp} {L : unfold prevFD by_cases hab : a = b · subst hab - rw [if_pos rfl, (firstDiff_none (h.sorted a ha hda) (h.sorted a ha hda)).mpr rfl] - · rw [if_neg hab] + rw [ite_eq_left rfl, (firstDiff_none (h.sorted a ha hda) (h.sorted a ha hda)).mpr rfl] + · rw [ite_eq_right hab] rcases Nat.lt_trichotomy L.rank[a]! L.rank[b]! with hlt | heq | hgt · rw [Nat.min_eq_left (Nat.le_of_lt hlt), Nat.max_eq_right (Nat.le_of_lt hlt)] exact (h.fd a b ha hb hda hdb hlt).symm @@ -846,7 +846,7 @@ theorem candPrec_eq (hok : tablesOK tabs = true) (hj : j < tabs.size) have hcand := hfd ▸ hm unfold candFD at hcand by_cases hpm : prevFD L a b = some m - · simp only [hpm, beq_self_eq_true, if_true, decide_eq_true_eq] + · simp only [hpm, beq_self_eq_true, ite_true, decide_eq_true_eq] have hab : a ≠ b := by intro e; subst e; simp [prevFD] at hpm rw [h.prevFD_eq ha hb hda hdb] at hpm have hrm := (firstDiff_eq_some_iff (h.sorted a ha hda) (h.sorted b hb hdb)).mp hpm @@ -867,7 +867,7 @@ theorem candPrec_eq (hok : tablesOK tabs = true) (hj : j < tabs.size) simp [hmY] · have hpm' : (prevFD L a b == some m) = false := by simp only [beq_eq_false_iff_ne, ne_eq]; exact hpm - simp only [hpm', Bool.false_eq_true, if_false, Bool.not_eq_true'] + simp only [hpm', Bool.false_eq_true, ite_false, Bool.not_eq_true'] rcases minOpt_some hcand with hp | ⟨hq, _⟩ · exact absurd hp hpm · have hxy := (firstDiff_eq_some_iff (entrySet_shape hok hj ka) (entrySet_shape hok hj kb)).mp hq @@ -983,7 +983,7 @@ theorem specCands_iff (h : LayerInv cap tabs j dp L recon) {tab : CTable} {t : N simp only [Option.map_some, Option.elim_some] unfold srcCands have hcond : t - k ≤ t ∧ t - (t - k) < tab.size ∧ t ≤ cap := ⟨by omega, by omega, ht⟩ - rw [if_pos hcond, show t - (t - k) = k by omega, htk] + rw [ite_eq_left hcond, show t - (t - k) = k by omega, htk] simp only [Option.elim_some, List.mem_singleton] unfold candVal candSet knapCand entrySet rw [htk] @@ -1083,20 +1083,20 @@ theorem rankOf_aux (n : Nat) : rw [hval x hx] by_cases hxa : x = a · subst hxa - simp only [hnd.1, if_false, List.mem_cons_self, if_true, List.idxOf_cons_self] + simp only [hnd.1, ite_false, List.mem_cons_self, ite_true, List.idxOf_cons_self] rw [getElem!_set!_self' _ _ _ (by omega)] omega · have hax : (a == x) = false := by simp only [beq_eq_false_iff_ne, ne_eq]; exact fun h => hxa h.symm rw [getElem!_set!_ne' _ _ _ _ (fun h => hxa h.symm)] by_cases hxl : x ∈ l - · simp only [hxl, if_true, List.mem_cons, hxa, false_or, List.idxOf_cons, hax, cond_false] + · simp only [hxl, ite_true, List.mem_cons, hxa, false_or, List.idxOf_cons, hax, Bool.false_eq_true, ite_false] omega - · simp only [hxl, if_false, List.mem_cons, hxa, false_or] + · simp only [hxl, ite_false, List.mem_cons, hxa, false_or] theorem rankOf_get {n : Nat} {l : List Nat} (hnd : l.Nodup) {x : Nat} (hx : x < n) (hxl : x ∈ l) : (rankOf n l)[x]! = l.idxOf x := by unfold rankOf - rw [(rankOf_aux n l 0 (Array.replicate n 0) hnd (by simp)).2 x hx, if_pos hxl] + rw [(rankOf_aux n l 0 (Array.replicate n 0) hnd (by simp)).2 x hx, ite_eq_left hxl] rfl /-! ## Ranks of the next layer -/ @@ -1136,7 +1136,7 @@ theorem mergeSort_setPrec (S : Nat → Array Nat) (cells : List Nat) (r : Nat have hndo : (cells.mergeSort r).Nodup := hnd.perm (List.mergeSort_perm cells r).symm have hne : (cells.mergeSort r)[i] ≠ (cells.mergeSort r)[k] := by intro he - have := (List.getElem_inj hndo).mp he + have := (List.Nodup.getElem_inj hndo).mp he omega have hmi : (cells.mergeSort r)[i] ∈ cells := List.mem_mergeSort.mp (List.getElem_mem (by omega)) @@ -1423,7 +1423,7 @@ theorem knapInit_inv (cap : Nat) (tabs : Array CTable) (recon : Nat → Array Na rw [getElem!_pos _ c (by simp; omega)] by_cases h0 : c = 0 · subst h0; simp - · simp only [h0, if_false] + · simp only [h0, ite_false] rw [Array.getElem_append_right (by simp; omega)] simp have hnon : ∀ c, c ≤ cap → ((knapInit cap).delta[c]!).isSome → c = 0 := by @@ -1443,7 +1443,7 @@ theorem knapInit_inv (cap : Nat) (tabs : Array CTable) (recon : Nat → Array Na · rw [hdel c hc, getElem!_pos _ c (by simp; omega)] by_cases h0 : c = 0 · subst h0; simp [hr] - · simp only [h0, if_false, Option.map_none] + · simp only [h0, ite_false, Option.map_none] rw [Array.getElem_append_right (by simp; omega)] simp · have := hnon a ha hsa @@ -1598,7 +1598,7 @@ theorem foldl_least_init {α β : Type} (abs : α → β) (lt : β → β → Bo obtain ⟨hmem, hle, hlea⟩ := ih (g init t) rw [hg] at hmem hle hlea ⊢ by_cases hb : lt (abs t) (abs init) = true - · simp only [hb, if_true] at hmem hle hlea ⊢ + · simp only [hb, ite_true] at hmem hle hlea ⊢ refine ⟨?_, fun x hx => ?_, ?_⟩ · rcases hmem with h | h · exact Or.inl (List.mem_cons_of_mem _ h) @@ -1612,7 +1612,7 @@ theorem foldl_least_init {α β : Type} (abs : α → β) (lt : β → β → Bo · rcases hlea with h | h · rw [h]; exact Or.inr hb · exact Or.inr (htrans _ _ _ h hb) - · simp only [hb, Bool.false_eq_true, if_false] at hmem hle hlea ⊢ + · simp only [hb, Bool.false_eq_true, ite_false] at hmem hle hlea ⊢ refine ⟨?_, fun x hx => ?_, hlea⟩ · rcases hmem with h | h · exact Or.inl (List.mem_cons_of_mem _ h) @@ -1849,7 +1849,7 @@ theorem knapChooseFast_eq {kCS cap : Nat} {tabs : Array CTable} {init : _root_.I setPrec (recon c) init.2.1)) = true := by rw [hkv] at hlt exact hlt - rw [if_pos hcond] + rw [ite_eq_left hcond] -- `r` is the cell's candidate rcases hrmem with hrV | hrinit' · have : chooseKey kCS r = chooseKey kCS (d, recon c, true) := by @@ -1876,7 +1876,7 @@ theorem knapChooseFast_eq {kCS cap : Nat} {tabs : Array CTable} {init : _root_.I simpa using hlt rw [hkv] at h2 exact h2 - rw [if_neg (by simp [hcond])] + rw [ite_eq_right (by simp [hcond])] rcases hrinit with hri | hri · exact hri.symm · exfalso diff --git a/Ix/Sharing/Exact/Phase3.lean b/Ix/Sharing/Exact/Phase3.lean index 15f5f9337..51ce49231 100644 --- a/Ix/Sharing/Exact/Phase3.lean +++ b/Ix/Sharing/Exact/Phase3.lean @@ -254,7 +254,7 @@ theorem ancestorMarks_spec {dag : Dag} (hcp : childrenPrecede dag.nodes = true) rw [getElem!_setBang] by_cases huj : u = j · subst huj - rw [if_pos ⟨rfl, by rw [hsz]; exact hjn⟩] + rw [ite_eq_left ⟨rfl, by rw [hsz]; exact hjn⟩] simp only [Bool.or_eq_true, beq_iff_eq, Array.any_eq_true', hacc] constructor · rintro (rfl | ⟨c, hm, _, _, hc⟩) @@ -265,7 +265,7 @@ theorem ancestorMarks_spec {dag : Dag} (hcp : childrenPrecede dag.nodes = true) · exact Or.inl h · have hcu := child_lt_of_childrenPrecede hcp hjn hm exact Or.inr ⟨c, hm, hcu, by omega, hc⟩ - · simp only [huj, false_and, if_false, hacc] + · simp only [huj, false_and, ite_false, hacc] constructor · rintro ⟨h1, h2, h3⟩; exact ⟨by omega, h2, h3⟩ · rintro ⟨h1, h2, h3⟩; exact ⟨by omega, h2, h3⟩) @@ -299,7 +299,7 @@ theorem modify_push_fold (u : Nat) : rw [h2, Array.getElem?_modify, Array.size_modify, List.mem_cons] by_cases hdc : d = c · subst hdc - rw [if_pos rfl] + rw [ite_eq_left rfl] by_cases hd : d < ps.size · rw [Array.getElem?_eq_getElem hd] simp only [Option.map_some, Option.getD_some, Array.mem_push] @@ -307,7 +307,7 @@ theorem modify_push_fold (u : Nat) : · rw [Array.getElem?_eq_none (Nat.le_of_not_lt hd)] simp only [Option.map_none] grind - · rw [if_neg hdc] + · rw [ite_eq_right hdc] grind theorem parentEdgeLists_ok (dag : Dag) : ParentsOK dag (parentEdgeLists dag) := by @@ -375,7 +375,7 @@ theorem ancVisit_fold {dag : Dag} {t : Nat} : have hl' : ∀ q ∈ l, q < dag.size ∧ AncOf dag t q := fun q hq => hl q (by simp [hq]) rw [ancVisit_pair] by_cases hmp : mark[p]! = true - · simp only [hmp, if_true] + · simp only [hmp, ite_true] obtain ⟨h1, h2, h3, h4, l', h5⟩ := ancVisit_fold l mark out hs hm ha hl' refine ⟨h1, h2, h3, ?_, l', h5⟩ intro q hq @@ -384,7 +384,7 @@ theorem ancVisit_fold {dag : Dag} {t : Nat} : · rw [Array.mem_def, h5, List.mem_append] exact Or.inl (Array.mem_def.mp ((hm q).mp hmp)) · exact h4 q hq - · simp only [hmp, Bool.false_eq_true, if_false] + · simp only [hmp, Bool.false_eq_true, ite_false] have hs' : (mark.set! p true).size = dag.size := by simp [Array.set!_eq_setIfInBounds, hs] have hm' : ∀ u, (mark.set! p true)[u]! = true ↔ u ∈ out.push p := by @@ -502,10 +502,10 @@ theorem unmark_spec (mark : Array Bool) (s : Array Nat) : · subst huv by_cases hs : u < m.size · simp [hs] at a - · simp only [hs, and_false, if_false] at a + · simp only [hs, and_false, ite_false] at a rw [getElem!_neg m u hs] at a exact absurd a (by decide) - · simp only [huv, false_and, if_false] at a + · simp only [huv, false_and, ite_false] at a exact ⟨a, by simp [huv, b]⟩ theorem getElem!_replicate_false (n u : Nat) : (Array.replicate n false)[u]! = false := by @@ -565,7 +565,7 @@ theorem Prep.evalUpFast_eq (p : Prep) (ev : DictEval) (width : Array (Option Nat · rfl · obtain ⟨h3, h4⟩ := h2 u hu exact absurd ((hinv.marked u).mp h3) h4 - simp only [if_true] + simp only [ite_true] rw [evalMarked_eq, hun, hmark] rfl diff --git a/Ix/Sharing/Exact/PinnedDeps.lean b/Ix/Sharing/Exact/PinnedDeps.lean index 2857d0940..74bb9c74b 100644 --- a/Ix/Sharing/Exact/PinnedDeps.lean +++ b/Ix/Sharing/Exact/PinnedDeps.lean @@ -88,9 +88,9 @@ theorem forIn_pinnedStep (dag : Dag) (isStored : Array Bool) | some u => simp only [Option.elim_some] by_cases hs : seen.contains u = true - · simp only [hs, if_true] + · simp only [hs, ite_true] exact ih _ _ _ _ - · simp only [hs, Bool.false_eq_true, if_false] + · simp only [hs, Bool.false_eq_true, ite_false] split · exact ih _ _ _ _ · exact ih _ _ _ _ @@ -125,12 +125,12 @@ theorem pinnedWalk_eq (dag : Dag) (isStored : Array Bool) (hiS : isStored.size = · -- a term of the DAG: the two visited sets agree on it by_cases hs : seen.contains u = true · have hm : (stamp[u]! == mark) = true := by simpa using (hrel u hu).mp hs - simp only [hs, if_true, hm] + simp only [hs, ite_true, hm] exact ih _ _ _ _ ⟨hsz, hrel⟩ · have hm : (stamp[u]! == mark) = false := by simp only [beq_eq_false_iff_ne, ne_eq] exact fun h' => hs ((hrel u hu).mpr h') - simp only [hs, Bool.false_eq_true, if_false, hm] + simp only [hs, Bool.false_eq_true, ite_false, hm] have hrel' : WalkRel dag.size mark (seen.insert u) (stamp.set! u mark) := by refine ⟨by simp [hsz], fun v hv => ?_⟩ rw [Std.HashSet.contains_insert] @@ -185,7 +185,7 @@ theorem pinnedWalk_eq (dag : Dag) (isStored : Array Bool) (hiS : isStored.size = have hset : stamp.set! u mark = stamp := by simp only [Array.set!_eq_setIfInBounds] exact Array.setIfInBounds_eq_of_size_le (by omega) - simp only [hm, hst, Bool.false_eq_true, if_false, hnode, Array.append_empty, hset] + simp only [hm, hst, Bool.false_eq_true, ite_false, hnode, Array.append_empty, hset] have hrel' : WalkRel dag.size mark (seen.insert u) stamp := by refine ⟨hsz, fun v hv => ?_⟩ rw [Std.HashSet.contains_insert] @@ -194,9 +194,9 @@ theorem pinnedWalk_eq (dag : Dag) (isStored : Array Bool) (hiS : isStored.size = rw [this, Bool.false_or] exact hrel v hv by_cases hs : seen.contains u = true - · simp only [hs, if_true] + · simp only [hs, ite_true] exact ih _ _ _ _ ⟨hsz, hrel⟩ - · simp only [hs, Bool.false_eq_true, if_false] + · simp only [hs, Bool.false_eq_true, ite_false] exact ih _ _ _ _ hrel' /-! ## All walks -/ diff --git a/Ix/Sharing/Exact/PinnedFast.lean b/Ix/Sharing/Exact/PinnedFast.lean index e212f38fd..fe1e7eddb 100644 --- a/Ix/Sharing/Exact/PinnedFast.lean +++ b/Ix/Sharing/Exact/PinnedFast.lean @@ -173,7 +173,7 @@ theorem pinnedPick_fold {deg : Array Nat} {D B : Nat} (f : Option Nat → Nat rw [hf2] have ha := hacc a rfl by_cases hb : (deg[t]! > deg[a]! || (deg[t]! == deg[a]! && t < a)) = true - · simp only [hb, if_true] + · simp only [hb, ite_true] have hlt := (better_iff_key ht ha).mp hb obtain ⟨hnone, hsome⟩ := ih (some t) hts (fun a ha => by cases ha; exact ht) refine ⟨⟨fun h => absurd (hnone.mp h).1 (by simp), fun h => by simp at h⟩, fun m hm => ?_⟩ @@ -187,7 +187,7 @@ theorem pinnedPick_fold {deg : Array Nat} {D B : Nat} (f : Option Nat → Nat · subst h; exact hmt · exact hle x h · cases ha'; omega - · simp only [hb, Bool.false_eq_true, if_false] + · simp only [hb, Bool.false_eq_true, ite_false] have hge : pinnedKey deg D B a ≤ pinnedKey deg D B t := by have := mt (better_iff_key ht ha).mpr hb omega @@ -269,7 +269,7 @@ theorem users_inner (u : Nat) : · subst hd have hp : ∀ a : Array Nat, x ∈ (a.push u).toList ↔ x ∈ a.toList ∨ x = u := by intro a; simp only [Array.toList_push, List.mem_append, List.mem_singleton] - simp only [beq_self_eq_true, if_true, Option.getD_some, hp, + simp only [beq_self_eq_true, ite_true, Option.getD_some, hp, ← Std.HashMap.getD_eq_getD_getElem?, List.mem_cons_self, and_true] constructor · rintro ((h | h) | ⟨h, _⟩) @@ -280,7 +280,7 @@ theorem users_inner (u : Nat) : · exact Or.inl (Or.inl h) · exact Or.inl (Or.inr h) · have h1 : (d0 == d) = false := by simpa using hd - simp only [h1, Bool.false_eq_true, if_false, List.mem_cons] + simp only [h1, Bool.false_eq_true, ite_false, List.mem_cons] constructor · rintro (h | ⟨h1, h2⟩) · exact Or.inl h diff --git a/Ix/Sharing/Exact/Reexpand.lean b/Ix/Sharing/Exact/Reexpand.lean index a7722a434..6bcf135d7 100644 --- a/Ix/Sharing/Exact/Reexpand.lean +++ b/Ix/Sharing/Exact/Reexpand.lean @@ -91,7 +91,7 @@ theorem ofNodes_get? (nodes : Array Node) (k : Node) (u : Nat) : rw [Std.HashMap.getElem?_insert] have hni : nodes[i.1]! = nodes[i.1] := getElem!_pos nodes i.1 hi' by_cases hk : nodes[i.1] = k - · rw [if_pos ((Node.beq_iff _ _).mpr hk), Option.some.injEq] + · rw [ite_eq_left ((Node.beq_iff _ _).mpr hk), Option.some.injEq] constructor · rintro rfl exact ⟨by omega, by rw [hni, hk], fun v h1 h2 => by omega⟩ @@ -99,7 +99,7 @@ theorem ofNodes_get? (nodes : Array Node) (k : Node) (u : Nat) : by_cases hui : u = i.1 · exact hui.symm · exact absurd (by rw [hni, hk]) (h3 i.1 (by omega) (by omega)) - · rw [if_neg (fun h => hk ((Node.beq_iff _ _).mp h)), ih u] + · rw [ite_eq_right (fun h => hk ((Node.beq_iff _ _).mp h)), ih u] constructor · rintro ⟨h1, h2, h3⟩ refine ⟨by omega, h2, fun v h4 h5 => ?_⟩ @@ -138,7 +138,7 @@ theorem leafIndex_get? (dag : Dag) (h : Head) (u : Nat) : by_cases hk : dag.nodes[i.1] = ⟨h, #[]⟩ · have he : dag.nodes[i.1].children.isEmpty = true := by rw [hk]; rfl have hh : (dag.nodes[i.1].head == h) = true := by rw [hk]; exact (Head.beq_iff _ _).mpr rfl - rw [if_pos he, Std.HashMap.getElem?_insert, if_pos hh, Option.some.injEq] + rw [ite_eq_left he, Std.HashMap.getElem?_insert, ite_eq_left hh, Option.some.injEq] constructor · rintro rfl exact ⟨by omega, by rw [hni, hk], fun v h1 h2 => by omega⟩ @@ -150,7 +150,7 @@ theorem leafIndex_get? (dag : Dag) (h : Head) (u : Nat) : m.insert dag.nodes[i.1].head i.1 else m)[h]? = m[h]? := by split · rename_i he - rw [Std.HashMap.getElem?_insert, if_neg] + rw [Std.HashMap.getElem?_insert, ite_eq_right] intro hh apply hk have h1 := (Head.beq_iff _ _).mp hh @@ -212,7 +212,7 @@ theorem lastMatch_spec (dag : Dag) (n : Node) (ps : Array Nat) (u : Nat) simp only [List.foldl_cons] at h obtain ⟨h1, h2, h3⟩ := ih _ u h by_cases hw : (w < dag.size && dag.node w == n) = true - · rw [if_pos hw] at h1 h2 + · rw [ite_eq_left hw] at h1 h2 simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at hw have hacc : ∀ a, acc = some a → a ≤ u := by intro a ha @@ -242,7 +242,7 @@ theorem lastMatch_spec (dag : Dag) (n : Node) (ps : Array Nat) (u : Nat) rcases hv with rfl | hv · exact hwu · exact h3 v hv hv1 hv2 - · rw [if_neg hw] at h1 h2 + · rw [ite_eq_right hw] at h1 h2 refine ⟨?_, h2, ?_⟩ · rcases h1 with h1 | h1 · exact Or.inl h1 @@ -512,8 +512,8 @@ theorem sim_prefix (limits : Limits) (dag : Dag) (depth : Nat) (e : Ixon.Expr) | some id => simp only [ReSim]; rfl | none => by_cases hd : depth > limits.maxDepth - · simp only [hd, if_true, ReSim]; rfl - · simp only [hd, if_false] + · simp only [hd, ite_true, ReSim]; rfl + · simp only [hd, ite_false] cases hbv : bump visits 1 limits.maxExprVisits .exprVisits with | error err => simp [hbv, liftExcept, ReSim]; rfl | ok v => @@ -585,8 +585,8 @@ theorem reIngestExpr_sim (limits : Limits) (dag : Dag) (ctx : ShareCtx) : | some id => simp only [ReSim]; rfl | none => by_cases hd : depth > limits.maxDepth - · simp only [hd, if_true, ReSim]; rfl - · simp only [hd, if_false] + · simp only [hd, ite_true, ReSim]; rfl + · simp only [hd, ite_false] cases hbv : bump visits 1 limits.maxExprVisits .exprVisits with | error err => simp [hbv, liftExcept, ReSim]; rfl | ok w => @@ -602,8 +602,8 @@ theorem reIngestExpr_sim (limits : Limits) (dag : Dag) (ctx : ShareCtx) : | some id => simp only [ReSim]; rfl | none => by_cases hd : depth > limits.maxDepth - · simp only [hd, if_true, ReSim]; rfl - · simp only [hd, if_false] + · simp only [hd, ite_true, ReSim]; rfl + · simp only [hd, ite_false] cases hbv : bump visits 1 limits.maxExprVisits .exprVisits with | error err => simp [hbv, liftExcept, ReSim]; rfl | ok w => @@ -620,8 +620,8 @@ theorem reIngestExpr_sim (limits : Limits) (dag : Dag) (ctx : ShareCtx) : | some id => simp only [ReSim]; rfl | none => by_cases hd : depth > limits.maxDepth - · simp only [hd, if_true, ReSim]; rfl - · simp only [hd, if_false] + · simp only [hd, ite_true, ReSim]; rfl + · simp only [hd, ite_false] cases hbv : bump visits 1 limits.maxExprVisits .exprVisits with | error err => simp [hbv, liftExcept, ReSim]; rfl | ok w => @@ -638,8 +638,8 @@ theorem reIngestExpr_sim (limits : Limits) (dag : Dag) (ctx : ShareCtx) : | some id => simp only [ReSim]; rfl | none => by_cases hd : depth > limits.maxDepth - · simp only [hd, if_true, ReSim]; rfl - · simp only [hd, if_false] + · simp only [hd, ite_true, ReSim]; rfl + · simp only [hd, ite_false] cases hbv : bump visits 1 limits.maxExprVisits .exprVisits with | error err => simp [hbv, liftExcept, ReSim]; rfl | ok w => @@ -656,8 +656,8 @@ theorem reIngestExpr_sim (limits : Limits) (dag : Dag) (ctx : ShareCtx) : | some id => simp only [ReSim]; rfl | none => by_cases hd : depth > limits.maxDepth - · simp only [hd, if_true, ReSim]; rfl - · simp only [hd, if_false] + · simp only [hd, ite_true, ReSim]; rfl + · simp only [hd, ite_false] cases hbv : bump visits 1 limits.maxExprVisits .exprVisits with | error err => simp [hbv, liftExcept, ReSim]; rfl | ok w => @@ -741,7 +741,7 @@ theorem ingestTable_sim (limits : Limits) (dag : Dag) (sharing roots : Array Ixo ((ingestTable limits sharing roots true).run { interner := Interner.ofNodes dag.nodes, ptrCache := {}, visits := 0 }) := by unfold ingestTable reIngestTable - simp only [hw, if_false, Std.Legacy.Range.forIn'_eq_forIn'_range', StateT.run_bind] + simp only [hw, ite_false, Std.Legacy.Range.forIn'_eq_forIn'_range', StateT.run_bind] refine ReSim.bind' (loop_sim limits dag sharing (fun i acc => { resolved := acc, tableSize := sharing.size, entry := some i, root := 0, allowShare := true }) @@ -790,11 +790,11 @@ def reexpandFast (limits : Limits) (dag : Dag) (sharing roots : Array Ixon.Expr) funext limits dag sharing roots unfold reexpandFast by_cases hw : sharing.size ≥ wordBound - · simp only [hw, if_true] + · simp only [hw, ite_true] unfold reexpand ingestTable - simp only [hw, if_true] + simp only [hw, ite_true] rfl - · simp only [hw, if_false] + · simp only [hw, ite_false] have hs := ingestTable_sim limits dag sharing roots hw cases hr : reIngestTable limits dag (ReIndex.ofDag dag) sharing roots with | ok p cache visits => diff --git a/Ix/Sharing/Exact/Search.lean b/Ix/Sharing/Exact/Search.lean index 3c39ba80c..d658d83a9 100644 --- a/Ix/Sharing/Exact/Search.lean +++ b/Ix/Sharing/Exact/Search.lean @@ -365,7 +365,7 @@ theorem materializeLoopFast_eq (p : Prep) (table : Array Nat) (limits : Limits) predicted := tag0Size table.size, work := 0 } (by omega) rw [← List.range_eq_range'] at hl unfold materializeTable - simp only [h1, h2, h3, hl, if_false, Bool.not_true, Bool.false_eq_true] + simp only [h1, h2, h3, hl, ite_false, Bool.not_true, Bool.false_eq_true] · simp [h1, h2, h3] · unfold materializeTable simp [h1, h2] diff --git a/Ix/Sharing/Exact/SortedSets.lean b/Ix/Sharing/Exact/SortedSets.lean index 3f6a0f14f..43aacbdb8 100644 --- a/Ix/Sharing/Exact/SortedSets.lean +++ b/Ix/Sharing/Exact/SortedSets.lean @@ -75,7 +75,7 @@ theorem firstDiff_spec : ∀ (A B : List Nat), A.Pairwise (· < ·) → B.Pairwi by_cases hxy : x = y · subst hxy obtain ⟨ih1, ih2⟩ := firstDiff_spec xs ys hxs hys - simp only [firstDiff, if_true] + simp only [firstDiff, ite_true] refine ⟨by rw [ih1]; simp, fun m h => ?_⟩ obtain ⟨h1, h2⟩ := ih2 m h -- `m` is in `xs` or `ys`, so it is above `x` @@ -104,7 +104,7 @@ theorem firstDiff_spec : ∀ (A B : List Nat), A.Pairwise (· < ·) → B.Pairwi · simp [hzx] · simp only [hzx, false_or] exact h2 z hz - · simp only [firstDiff, hxy, if_false] + · simp only [firstDiff, hxy, ite_false] refine ⟨by simp [hxy], fun m h => ?_⟩ simp only [Option.some.injEq] at h subst h @@ -171,7 +171,7 @@ theorem setPrec_iff_list : ∀ (A B : List Nat), A.Pairwise (· < ·) → B.Pair rw [List.compareLex_cons_cons, compareDesc_eq] by_cases hxy : x = y · subst hxy - simp only [Nat.compare_eq_eq.mpr rfl, Ordering.eq_then, firstDiff, if_true] + simp only [Nat.compare_eq_eq.mpr rfl, Ordering.eq_then, firstDiff, ite_true] rw [setPrec_iff_list xs ys hA.of_cons hB.of_cons] constructor · rintro ⟨m, h1, h2⟩; exact ⟨m, h1, List.mem_cons_of_mem _ h2⟩ @@ -190,7 +190,7 @@ theorem setPrec_iff_list : ∀ (A B : List Nat), A.Pairwise (· < ·) → B.Pair · exact absurd (hfd.mpr hc) hm have := List.rel_of_pairwise_cons hB this; omega · exact h - · simp only [firstDiff, hxy, if_false, Option.some.injEq, exists_eq_left'] + · simp only [firstDiff, hxy, ite_false, Option.some.injEq, exists_eq_left'] rcases Nat.lt_or_gt_of_ne hxy with hlt | hgt · rw [Nat.compare_eq_gt.mpr hlt, Nat.min_eq_left (Nat.le_of_lt hlt)] simp only [Ordering.gt_then, reduceCtorEq, false_iff, List.mem_cons, not_or] @@ -474,11 +474,11 @@ theorem sparseLevels_ok (adj : Array Nat) : rw [getElem!_def, Array.getElem?_push] by_cases hil : i ≤ l · have hne : i ≠ acc.size := by omega - simp only [hne, if_false] + simp only [hne, ite_false] rw [← getElem!_def] exact hall i hil · have : i = acc.size := by omega - simp only [this, if_true] + simp only [this, ite_true] rw [show acc.size = l + 1 by omega] exact hnext · have hp := Nat.two_pow_pos l diff --git a/Ix/Sharing/Exact/TierFast.lean b/Ix/Sharing/Exact/TierFast.lean index 0d76d59ec..def667b23 100644 --- a/Ix/Sharing/Exact/TierFast.lean +++ b/Ix/Sharing/Exact/TierFast.lean @@ -113,7 +113,7 @@ theorem firstPosMap_getElem? (l : List Nat) (i : Nat) (m : Std.HashMap Nat Nat) · have hn : m[t]? = none := Std.HashMap.getElem?_eq_none hm simp [hm] · have h1 : (t == u) = false := by simpa using htu - simp only [h1, Bool.false_eq_true, false_and, if_false, Option.map_map] + simp only [h1, Bool.false_eq_true, false_and, ite_false, Option.map_map] congr 2 funext q simp only [Function.comp] @@ -144,11 +144,11 @@ theorem idxBefore_succ (l : List Nat) (u : Nat) : cases pos with | zero => simp | succ p => - simp only [beq_self_eq_true, if_true, Option.any_some] + simp only [beq_self_eq_true, ite_true, Option.any_some] have : 0 < p + 1 := Nat.zero_lt_succ p simp [this] · have h1 : (a == u) = false := by simpa using hau - simp only [h1, Bool.false_eq_true, if_false, Option.any_map] + simp only [h1, Bool.false_eq_true, ite_false, Option.any_map] cases pos with | zero => have h2 : (u == a) = false := by @@ -274,18 +274,18 @@ theorem tierDfs_eq_fast (items : Array Nat) (weight : Nat → Nat) · rfl · by_cases hpos : pos ≥ items.size · have hd : items.toList.drop pos = [] := by simp; omega - simp only [hpos, if_true, hd] + simp only [hpos, ite_true, hd] · have hlt : pos < items.size := by omega have hd : items.toList.drop pos = items[pos] :: items.toList.drop (pos + 1) := by rw [List.drop_eq_getElem_cons (by simpa using hlt)] simp - simp only [hpos, if_false, hd, getElem!_pos items pos hlt] + simp only [hpos, ite_false, hd, getElem!_pos items pos hlt] by_cases hin : items[pos] ∈ inF · have hc : inF.contains items[pos] = true := by simpa using hin - simp only [hc, if_true] + simp only [hc, ite_true] exact ih _ _ _ _ _ (hinv.skip hlt hin) · have hc : inF.contains items[pos] = false := by simpa using hin - simp only [hc, Bool.false_eq_true, if_false] + simp only [hc, Bool.false_eq_true, ite_false] have hfun : excluded.contains = tierExcluded (firstPosMap items.toList 0 {}) pos inF := funext hinv have hex := hinv.exclude hlt hin diff --git a/Ix/Sharing/Exact/TieredFast.lean b/Ix/Sharing/Exact/TieredFast.lean index 9ecf6a521..dbeb2089b 100644 --- a/Ix/Sharing/Exact/TieredFast.lean +++ b/Ix/Sharing/Exact/TieredFast.lean @@ -280,7 +280,7 @@ theorem tieredAtWidth_eq_F (layout : ShareLayout) (limits : Limits) (ex : Expand (tieredCandidateCount ex.dag.size (Prep.ofDag ex.dag) (graphFacts ex.dag ex.roots)) := by unfold tieredAtWidth tieredAtWidthF rw [optimizeUniformExpanded_eq_F] - simp only [hw, Bool.false_eq_true, if_false, tieredResult_eq_F, rematerialize_eq_P] + simp only [hw, Bool.false_eq_true, ite_false, tieredResult_eq_F, rematerialize_eq_P] cases uniformDagChecks ex <;> rfl /-- `tieredAtWidth` with the width-independent tables computed once for its @@ -302,7 +302,7 @@ def tieredAtWidthC (layout : ShareLayout) (limits : Limits) (ex : Expanded) (w : · rename_i hw unfold tieredAtWidth rw [optimizeUniformExpanded_eq_F] - simp only [hw, if_true] + simp only [hw, ite_true] rfl · rename_i hw exact tieredAtWidth_eq_F layout limits ex w (by simpa using hw) diff --git a/Ix/Sharing/Exact/UniformSearchLocal.lean b/Ix/Sharing/Exact/UniformSearchLocal.lean index 4569df35f..cde0c528c 100644 --- a/Ix/Sharing/Exact/UniformSearchLocal.lean +++ b/Ix/Sharing/Exact/UniformSearchLocal.lean @@ -733,12 +733,12 @@ theorem fold_local {S V : Type} [Inhabited V] (get : S → Nat → V) (step : S have hxm : posf (xsAt m) = some m := (hpos _ m).mpr ⟨by omega, rfl⟩ by_cases hu : u = xsAt m · subst hu - simp only [if_true] + simp only [ite_true] unfold readAtF rw [hxm] subst hsz simp - · simp only [hu, if_false] + · simp only [hu, ite_false] rw [hrd u] unfold readAtF cases hp : posf u with @@ -750,10 +750,10 @@ theorem fold_local {S V : Type} [Inhabited V] (get : S → Nat → V) (step : S exact hu ((hpos u j).mp hp).2.symm simp only [Array.size_push, hsz] by_cases hj : j < m - · simp only [hj, if_true, show j < m + 1 by omega] + · simp only [hj, ite_true, show j < m + 1 by omega] rw [getElem!_pos (L.push _) j (by simp [hsz]; omega), getElem!_pos L j (by omega)] simp [Array.getElem_push_lt (show j < L.size by omega)] - · simp only [hj, if_false, show ¬ j < m + 1 by omega] + · simp only [hj, ite_false, show ¬ j < m + 1 by omega] obtain ⟨hok, _, h⟩ := key k (Nat.le_refl _) exact ⟨hok, h⟩ @@ -856,7 +856,7 @@ theorem phiWidth_eq (cx : SCtx) (avail : Nat → Bool) (u : Nat) : intro a ha rw [List.foldl_cons] by_cases hat : avail t - · simp only [hat, if_true] + · simp only [hat, ite_true] rw [ih _ (by simp [ha])] unfold widthOf simp only [Array.set!_eq_setIfInBounds, Array.getElem?_setIfInBounds] @@ -866,7 +866,7 @@ theorem phiWidth_eq (cx : SCtx) (avail : Nat → Bool) (u : Nat) : · simp [h, ha.symm ▸ h, hat] · simp [h, ha ▸ h, hat] · simp [hut, Ne.symm hut] - · simp only [hat, Bool.false_eq_true, if_false] + · simp only [hat, Bool.false_eq_true, ite_false] rw [ih _ ha] by_cases hut : u = t · subst hut; simp [hat] @@ -950,30 +950,30 @@ theorem evalStep_get (dag : Dag) (family : Array Family) (spineLen tail : Array obtain ⟨hc, hs, hb⟩ := hst unfold evalStep by_cases ha : affected[t]! = true - · simp only [ha, if_true] + · simp only [ha, ite_true] by_cases hf : (family[t]! == Family.none) = true - · simp only [hf, if_true] + · simp only [hf, ite_true] refine ⟨⟨by simp [hc], hs, hb⟩, fun u => ?_⟩ unfold eget evalRowG - simp only [hf, if_true] + simp only [hf, ite_true] rw [setBang_read ht _ _ hc] by_cases hu : u = t · subst hu - simp only [if_true] + simp only [ite_true] rcases widthOf width u with _ | w <;> rfl · simp [hu] - · simp only [hf, Bool.false_eq_true, if_false] + · simp only [hf, Bool.false_eq_true, ite_false] refine ⟨⟨by simp [hc], by simp [hs], by simp [hb]⟩, fun u => ?_⟩ unfold eget evalRowG - simp only [hf, Bool.false_eq_true, if_false] + simp only [hf, Bool.false_eq_true, ite_false] rw [setBang_read ht _ _ hc, setBang_read ht _ _ hs, setBang_read ht _ _ hb] by_cases hu : u = t · subst hu - simp only [if_true] + simp only [ite_true] rw [cutScan_set_fst _ _ _ _ _ _ _ _ (by omega) (by omega)] rcases widthOf width u with _ | w <;> rfl · simp [hu] - · simp only [ha, Bool.false_eq_true, if_false] + · simp only [ha, Bool.false_eq_true, ite_false] refine ⟨⟨hc, hs, hb⟩, fun u => ?_⟩ by_cases hu : u = t · subst hu; simp @@ -988,17 +988,17 @@ theorem evalHidden_eq_G (dag : Dag) (family : Array Family) (spineLen tail : Arr (decide (t < st.cost.size)) (st.cost[·]!) (st.sides[·]!) (st.below[·]!) t := by unfold evalHidden evalHiddenG by_cases ha : affected[t]! = true - · simp only [ha, if_true] + · simp only [ha, ite_true] split · by_cases ht : t < st.cost.size <;> simp [ht] · by_cases ht : t < st.cost.size - · simp only [ht, decide_true, if_true] + · simp only [ht, decide_true, ite_true] rw [cutScanAt_eq_G, cutScanG_fst _ _ _ _ _ _ _ _ _ _ 0] congr 2 · funext v; simp only [hs, ht, and_true] · funext v; simp only [hb, ht, and_true] · simp [ht] - · simp only [ha, Bool.false_eq_true, if_false] + · simp only [ha, Bool.false_eq_true, ite_false] /-- The bounds of a term. -/ def bget (b : UBounds) (u : Nat) : Nat × Nat × Nat × Nat := @@ -1019,8 +1019,8 @@ theorem boundsStep_get (p : Prep) (w : Nat) (ms : Array Bool) {n : Nat} (b : UBo unfold bget boundsValsG by_cases hu : u = t · subst hu - simp only [getElem!_setBang, h1, h2, h3, h4, ht, and_self, if_true] - · simp only [getElem!_setBang, hu, false_and, if_false] + simp only [getElem!_setBang, h1, h2, h3, h4, ht, and_self, ite_true] + · simp only [getElem!_setBang, hu, false_and, ite_false] end LocalSearch @@ -1130,7 +1130,7 @@ theorem foldl_setOr_read (l : List Nat) (f : Nat → Bool) (a : Array Bool) (u : by_cases hut : u = t · subst hut by_cases h : u < a.size - · simp only [h, and_self, if_true, decide_true, Bool.true_and] + · simp only [h, and_self, ite_true, decide_true, Bool.true_and] cases a[u]! <;> cases f u <;> simp · simp [h] · have hne : (u == t) = false := by simpa using hut @@ -1174,7 +1174,7 @@ theorem phiFold_read {cx : SCtx} {posA posC : Array Nat} (hr : Ready cx posA pos exact evalStep_get _ _ _ _ _ _ s hs (hclo i hi) · intro L i hL hi by_cases ha : cx.allTrue[cx.closure[i]!]! = true - · simp only [ha, if_true] + · simp only [ha, ite_true] rw [hwid, readAtF_field_fun (posOf posC) L (fun e : Nat × Nat × Option Nat => e.1) (eget cx.baseEv) (fun x => cx.baseEv.cost[x]!) (fun _ => rfl), @@ -1182,7 +1182,7 @@ theorem phiFold_read {cx : SCtx} {posA posC : Array Nat} (hr : Ready cx posA pos (fun x => cx.baseEv.sides[x]!) (fun _ => rfl), readAtF_field_fun (posOf posC) L (fun e : Nat × Nat × Option Nat => e.2.2) (eget cx.baseEv) (fun x => cx.baseEv.below[x]!) (fun _ => rfl)] - · simp only [ha, Bool.false_eq_true, if_false] + · simp only [ha, Bool.false_eq_true, ite_false] rw [readAtF_at_new hr.closure L id (eget cx.baseEv) hi hL] rfl @@ -1260,10 +1260,10 @@ theorem readAtF_map {α β : Type} [Inhabited α] [Inhabited β] (posf : Nat → | some j => simp only [Array.size_map, id] by_cases hj : j < L.size - · simp only [hj, if_true] + · simp only [hj, ite_true] rw [getElem!_pos (L.map proj) j (by simpa using hj), getElem!_pos L j hj] simp - · simp only [hj, if_false] + · simp only [hj, ite_false] theorem readAtF_map_fun {α β : Type} [Inhabited α] [Inhabited β] (posf : Nat → Option Nat) (L : Array α) (proj : α → β) (base : Nat → β) : @@ -1313,13 +1313,13 @@ theorem memberFlags_spec {cx : SCtx} {posA : Array Nat} simp only obtain ⟨hj', hm⟩ := (hA m j').mp hp by_cases ha : avail m = true - · simp only [ha, if_true, and_true] + · simp only [ha, ite_true, and_true] rw [getElem!_setBang] by_cases hjj : j = j' · subst hjj have hm' : cx.area[j]! = m := hm have hT : (j = j ∧ j < fl.size) := ⟨rfl, by rw [hfl]; exact hj'⟩ - simp only [hT, and_self, if_true, true_iff] + simp only [hT, and_self, ite_true, true_iff] exact Or.inr hm' · have : cx.area[j]! ≠ m := fun h => by have := (hA m j).mpr ⟨hj, h⟩ @@ -1381,7 +1381,7 @@ theorem flagWidth_eq {cx : SCtx} {posA posC : Array Nat} (hr : Ready cx posA pos · have := hm u hc rw [hp] at this cases this - simp only [hc, Bool.and_false, Bool.false_and, Bool.false_eq_true, if_false] + simp only [hc, Bool.and_false, Bool.false_and, Bool.false_eq_true, ite_false] | some j => obtain ⟨hj, hu⟩ := (hr.area u j).mp hp have hu' : cx.area[j]! = u := hu @@ -1393,15 +1393,15 @@ theorem flagWidth_eq {cx : SCtx} {posA posC : Array Nat} (hr : Ready cx posA pos cases hf : (memberFlags cx posA avail)[j]! with | true => obtain ⟨h1, h2⟩ := hfj.mp hf - simp only [h1, h2, Bool.and_self, if_true] + simp only [h1, h2, Bool.and_self, ite_true] | false => have hn : ¬ (cx.members.contains u = true ∧ avail u = true) := fun h => by rw [hfj.mpr h] at hf; cases hf cases hc : cx.members.contains u with - | false => simp only [Bool.false_and, Bool.false_eq_true, if_false] + | false => simp only [Bool.false_and, Bool.false_eq_true, ite_false] | true => cases ha : avail u with - | false => simp only [Bool.and_false, Bool.false_eq_true, if_false] + | false => simp only [Bool.and_false, Bool.false_eq_true, ite_false] | true => exact absurd ⟨hc, ha⟩ hn /-- A fold that pushes one row per step, kept as three tables. -/ @@ -1525,8 +1525,8 @@ theorem revisible_read {cx : SCtx} {posA posC : Array Nat} (hr : Ready cx posA p simp only rw [setBang_read (by omega) _ _ h1, setBang_read (by omega) _ _ h2] by_cases hv : v = cx.area[cx.area.size - 1 - i]! - · simp only [hv, if_true] - · simp only [hv, if_false] + · simp only [hv, ite_true] + · simp only [hv, ite_false] · intro L i hL hi simp only [ms_read, maybeStoredAt] simp only [readAtF_field (posRev cx.area.size posA) L (fun e : Nat × Nat => e.1) @@ -1740,7 +1740,7 @@ theorem setPositions_read (pos xs : Array Nat) (hd : strictInc xs = true) intro _ refine ⟨rfl, fun u => ?_⟩ have : ¬ ∃ j, j < 0 ∧ xs[j]! = u := by omega - simp only [foldRange_zero, this, dif_neg, not_false_eq_true] + simp only [foldRange_zero, this, dite_eq_right, not_false_eq_true] | succ m ih => intro hm obtain ⟨hsz, hrd⟩ := ih (by omega) @@ -1750,17 +1750,17 @@ theorem setPositions_read (pos xs : Array Nat) (hd : strictInc xs = true) by_cases hu : u = xs[m]! · have hex : ∃ j, j < m + 1 ∧ xs[j]! = u := ⟨m, by omega, hu.symm⟩ have hlt : xs[m]! < pos.size := hin m (by omega) - simp only [hu, hsz, hlt, and_self, if_true] - rw [dif_pos (hu ▸ hex)] + simp only [hu, hsz, hlt, and_self, ite_true] + rw [dite_eq_left (hu ▸ hex)] have hc := Classical.choose_spec (hu ▸ hex) have := strictInc_inj hd (i := Classical.choose (hu ▸ hex)) (j := m) (by omega) (by omega) hc.2 omega - · simp only [hu, false_and, if_false] + · simp only [hu, false_and, ite_false] by_cases hex : ∃ j, j < m ∧ xs[j]! = u · have hex' : ∃ j, j < m + 1 ∧ xs[j]! = u := by obtain ⟨j, hj, hx⟩ := hex; exact ⟨j, by omega, hx⟩ - rw [dif_pos hex, dif_pos hex'] + rw [dite_eq_left hex, dite_eq_left hex'] have h1 := Classical.choose_spec hex have h2 := Classical.choose_spec hex' have : Classical.choose hex = Classical.choose hex' := @@ -1771,14 +1771,14 @@ theorem setPositions_read (pos xs : Array Nat) (hd : strictInc xs = true) by_cases hjm : j = m · subst hjm; exact hu hx.symm · exact hex ⟨j, by omega, hx⟩ - rw [dif_neg hex, dif_neg hex'] + rw [dite_eq_right hex, dite_eq_right hex'] exact key xs.size (Nat.le_refl _) theorem posOf_some (pos : Array Nat) (u j : Nat) : posOf pos u = some j ↔ pos[u]! = j + 1 := by unfold posOf by_cases h : pos[u]! = 0 · simp [h] - · simp only [h, beq_iff_eq, if_false, Option.some.injEq] + · simp only [h, beq_iff_eq, ite_false, Option.some.injEq] omega /-- `setPositions` of an all-`0` table is a position table. -/ @@ -1789,7 +1789,7 @@ theorem setPositions_posFn (xs : Array Nat) (n : Nat) (hd : strictInc xs = true) intro u j rw [posOf_some, hrd u] by_cases hex : ∃ j, j < xs.size ∧ xs[j]! = u - · rw [dif_pos hex] + · rw [dite_eq_left hex] have hc := Classical.choose_spec hex constructor · intro h @@ -1799,7 +1799,7 @@ theorem setPositions_posFn (xs : Array Nat) (n : Nat) (hd : strictInc xs = true) · rintro ⟨hj, hx⟩ have := strictInc_inj hd hc.1 hj (hc.2.trans hx.symm) omega - · rw [dif_neg hex] + · rw [dite_eq_right hex] have h0 : (Array.replicate n 0)[u]! = 0 := by by_cases h : u < n · rw [getElem!_pos _ u (by simpa using h)]; simp @@ -1844,7 +1844,7 @@ theorem clearPositions_zero (pos xs : Array Nat) (n : Nat) (hsz : pos.size = n) rw [this] by_cases hm : i ∈ xs.toList · simp [hm] - · simp only [hm, if_false, Array.getElem_replicate] + · simp only [hm, ite_false, Array.getElem_replicate] have hne : ∀ j, j < xs.size → xs[j]! ≠ i := by intro j hj hx apply hm @@ -1901,7 +1901,7 @@ theorem mem_parentsOf (dag : Dag) (c q : Nat) : by_cases hc : c0 = c · subst hc by_cases hlt : c0 < P.size - · simp only [hlt, and_self, if_true, Array.mem_push, List.mem_cons, true_or, and_true] + · simp only [hlt, and_self, ite_true, Array.mem_push, List.mem_cons, true_or, and_true] rw [hP] at hlt simp only [hlt, true_and] constructor @@ -1909,7 +1909,7 @@ theorem mem_parentsOf (dag : Dag) (c q : Nat) : · rintro (h | h) <;> simp_all · have : ¬ c0 < dag.size := by omega simp [hlt, this] - · simp only [hc, false_and, if_false, List.mem_cons] + · simp only [hc, false_and, ite_false, List.mem_cons] constructor · rintro (h | ⟨h1, h2, h3⟩) · exact Or.inl h @@ -2000,7 +2000,7 @@ theorem mem_upClosure {dag : Dag} (hcp : childrenPrecede dag.nodes = true) rw [getElem!_setBang] by_cases htm : t = m · subst htm - simp only [hs, show t < dag.size by omega, and_self, if_true, Bool.or_eq_true, + simp only [hs, show t < dag.size by omega, and_self, ite_true, Bool.or_eq_true, Array.any_eq_true] constructor · rintro (h | ⟨k, hk, hc⟩) @@ -2014,7 +2014,7 @@ theorem mem_upClosure {dag : Dag} (hcp : childrenPrecede dag.nodes = true) right obtain ⟨k, hk, rfl⟩ := Array.mem_iff_getElem.mp hc exact ⟨k, hk, (hr _).mpr ⟨node_children_lt hcp (by omega) hc, hu'⟩⟩ - · simp only [htm, false_and, if_false] + · simp only [htm, false_and, ite_false] rw [hr t] constructor · rintro ⟨h1, h2⟩; exact ⟨by omega, h2⟩ @@ -2066,9 +2066,9 @@ theorem walkPush_spec {dag : Dag} {isMember : Nat → Bool} {P : Array (Array Na unfold r walkPush by_cases hnew : q < n ∧ vis[q]! = 0 · have hc : (decide (q < n) && vis[q]! == 0) = true := by simp [hnew.1, hnew.2] - simp only [hc, if_true] + simp only [hc, ite_true] have hqo : q ∉ out.toList := by - intro h; have := hmk q; rw [if_pos h] at this; omega + intro h; have := hmk q; rw [ite_eq_left h] at this; omega refine ⟨by rw [Array.set!_eq_setIfInBounds, Array.size_setIfInBounds, hsz], fun t => ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · rw [setBang_read (n := n) hnew.1 _ _ hsz, hmk t] @@ -2112,13 +2112,13 @@ theorem walkPush_spec {dag : Dag} {isMember : Nat → Bool} {P : Array (Array Na by_cases h1 : q < n · exact Or.inr (fun h2 => hnew ⟨h1, h2⟩) · exact Or.inl h1 - simp only [hc, Bool.false_eq_true, if_false] + simp only [hc, Bool.false_eq_true, ite_false] refine ⟨hsz, hmk, hnd, hup, hsi, hsn, hdn, fun t ht => ht, fun hqn => ?_⟩ have h0 : vis[q]! ≠ 0 := fun h => hnew ⟨hqn, h⟩ have := hmk q by_cases hm : q ∈ out.toList · exact hm - · rw [if_neg hm] at this; exact absurd this h0 + · rw [ite_eq_right hm] at this; exact absurd this h0 end LocalSearch @@ -2297,8 +2297,8 @@ theorem setPositions_congr (a b xs : Array Nat) (hs : strictInc xs = true) rw [getElem!_pos _ i hi2] at e2 rw [e1, e2] by_cases hex : ∃ j, j < xs.size ∧ xs[j]! = i - · rw [dif_pos hex, dif_pos hex] - · rw [dif_neg hex, dif_neg hex] + · rw [dite_eq_left hex, dite_eq_left hex] + · rw [dite_eq_right hex, dite_eq_right hex] exact h i (fun j hj hx => hex ⟨j, hj, hx⟩) /-- **Context.** With children before their parents, `mkSCtxL` builds the @@ -2341,7 +2341,7 @@ theorem mkSCtxL_eq (ex : Expanded) (f : GraphFacts) (up : UPrep) (cand : Array B generalize upWalk (parentsOf ex.dag) members (Array.replicate ex.dag.size 0) = r at hinv hdone obtain ⟨vis, out, stack⟩ := r by_cases he : stack.isEmpty = true - · simp only [he, if_true] + · simp only [he, ite_true] have hst : stack.toList = [] := by rw [Array.isEmpty_iff] at he; subst he; rfl have hfound := hdone hst @@ -2359,11 +2359,11 @@ theorem mkSCtxL_eq (ex : Expanded) (f : GraphFacts) (up : UPrep) (cand : Array B rw [Array.mem_toList_iff, Array.mem_iff_getElem] at hmC obtain ⟨i, hi, rfl⟩ := hmC exact hu i hi (by rw [getElem!_pos _ i hi]) - rw [if_neg hnot] + rw [ite_eq_right hnot] by_cases hlt : u < ex.dag.size · rw [getElem!_pos _ u (by simpa using hlt)]; simp · rw [getElem!_neg _ u (by simpa using hlt)]; rfl - · simp only [he, Bool.false_eq_true, if_false] + · simp only [he, Bool.false_eq_true, ite_false] refine ⟨trivial, ?_⟩ rw [clearPositions_zero vis out ex.dag.size hinv.size (fun u hu => by rw [hinv.marks u] @@ -2372,7 +2372,7 @@ theorem mkSCtxL_eq (ex : Expanded) (f : GraphFacts) (up : UPrep) (cand : Array B rw [Array.mem_toList_iff, Array.mem_iff_getElem] at hm obtain ⟨i, hi, rfl⟩ := hm exact hu i hi (by rw [getElem!_pos _ i hi]) - rw [if_neg hnot])] + rw [ite_eq_right hnot])] obtain ⟨hcl, hpos⟩ := hres unfold mkSCtxL mkSCtx simp only @@ -2429,7 +2429,7 @@ theorem clear_set_zero (n : Nat) (xs : Array Nat) (hs : strictInc xs = true) obtain ⟨h1, h2⟩ := setPositions_read (Array.replicate n 0) xs hs (by simpa using hin) apply clearPositions_zero _ _ n (by rw [h1]; simp) intro u hu - rw [h2 u, dif_neg (fun ⟨j, hj, hx⟩ => hu j hj hx)] + rw [h2 u, dite_eq_right (fun ⟨j, hj, hx⟩ => hu j hj hx)] by_cases h : u < n · rw [getElem!_pos _ u (by simpa using h)]; simp · rw [getElem!_neg _ u (by simpa using h)]; rfl @@ -2465,7 +2465,7 @@ theorem fastStep_eq (limits : Limits) (ex : Expanded) (f : GraphFacts) (up : UPr (fun a => (a, Array.replicate up.prep.dag.size 0, Array.replicate ex.dag.size 0)) := by obtain ⟨results, states, costEvals⟩ := a unfold fastStep specStep - simp only [hss, Bool.false_eq_true, if_false] + simp only [hss, Bool.false_eq_true, ite_false] rw [mkSCtxL_eq ex f up cand b0 vis0 rootCount slack theta baseEv widthCs allTrue unc members hcp] simp only have hCs := upClosure_sorted ex.dag ((markTable ex.dag.size members)[·]!) @@ -2485,7 +2485,7 @@ theorem fastStep_eq (limits : Limits) (ex : Expanded) (f : GraphFacts) (up : UPr have hup : cx.up = up := by rw [← hcx]; unfold mkSCtx; rfl rw [hcl, hzC] by_cases hok : localSearchOK cx = true - · rw [if_pos hok] + · rw [ite_eq_left hok] obtain ⟨_, _, _, _, _, _, _, _, harea, _⟩ := localSearchOK_spec hok have hainc := (localSearchOK_inc hok).1 have hain : ∀ i, i < cx.area.size → cx.area[i]! < up.prep.dag.size := by @@ -2501,7 +2501,7 @@ theorem fastStep_eq (limits : Limits) (ex : Expanded) (f : GraphFacts) (up : UPr cases searchComponent cx limits states costEvals with | error _ => rfl | ok v => rfl - · rw [if_neg hok] + · rw [ite_eq_right hok] cases searchComponent cx limits states costEvals with | error _ => rfl | ok v => rfl @@ -2517,8 +2517,8 @@ walk, the area- and closure-local search, two shared position tables) computes funext limits ex f up cand b0 vis0 rootCount slack theta baseEv widthCs allTrue unc opaq comps unfold searchComponentsWithFast by_cases hg : (limits.uniformSubsetSearch || !childrenPrecede ex.dag.nodes) = true - · rw [if_pos hg] - · rw [if_neg hg] + · rw [ite_eq_left hg] + · rw [ite_eq_right hg] simp only [Bool.or_eq_true, Bool.not_eq_true', not_or, Bool.not_eq_false] at hg obtain ⟨hss, hcp⟩ := hg unfold searchComponentsWith diff --git a/Ix/Tc/Primitive.lean b/Ix/Tc/Primitive.lean index d2f5b0cd1..5b39f8c30 100644 --- a/Ix/Tc/Primitive.lean +++ b/Ix/Tc/Primitive.lean @@ -143,12 +143,12 @@ def canonical : PrimAddrs where natGcd := h "aba94bfb41351d4db36172c379a512f04219ef21dc5454d71590967d4e8f913f" natMod := h "11abbf986481c53a21c8cb21ee2581ae6238aedbec15f972959d086bef1a1985" natDiv := h "824d1c53d8c1c3cf0a27f24639ec2be1ecc13d4a01c993171595edccf6949737" - natBitwise := h "6eff55f72c856bd08aa02896fb78d93c28e11aae2be05c318b9d1f9fab8d7a53" + natBitwise := h "adaf32f49aa6fee4ac8b0742563494b381e0742d9ea685fe2456eb71b25fec08" natBeq := h "d3d8ff924af9dc4b5cd869760615b3e7ee80916bb617259d45890c69f4128337" natBle := h "9e445b9d5f8252772347872e909b5db4e7eca7086cedf4fec6de840f6b7b5f92" - natLand := h "d98bed1e14cda0eea470a5a49ff7926c80eb4bc7bfbdd0c3e14d4baa5c2dd0d7" - natLor := h "88ff34dd42e57766beefc229d8b62dabba9cef6aadcc85c88ad67323d02bbf21" - natXor := h "1b0acdd4080abe5bc4acb5f06527cb62ad92792eb429c2b3bcb6f471d7945085" + natLand := h "de8c100c22f82a5c3533c67e4370671813434a6fec5d023998ded090df4a4934" + natLor := h "93afc1cd298c63606e5f468d1e5989ab4680d256e95d07a8642a88b5c6b858e1" + natXor := h "77dd40d7b6ca310cc59466d1f24df4f180ef50e1b00fd850698458cd26901c5d" natShiftLeft := h "05bb657e8b9d5dc224e7ef3d53e54153ce3ac26da8d1f1b1d61069a3726566cd" natShiftRight := h "25019ff485fcf5709597cd1e07fcc3ce796776ef3f715a6d187eb5831c63b4be" boolType := h "e6eba3c8b4d19f6a1076b39fa89aec61dccbb960f83d9a62e6acf35a69c9a0a4" @@ -220,8 +220,8 @@ def canonical : PrimAddrs where unit := h "9232498667f765f437dedaac828e555f6cc67a20e6db28f614fdf3c262710feb" punitSizeOf1 := h "523699b6e827b74a950d4718bdf5b13c193e3c7c371aaad4d635667be74b05fa" sizeOfSizeOf := h "ea81aee4a7d154faa8211a2594406dfdc7442020c0f29d2d0f79b4e62314da51" - stringBack := h "b052e814120ea6299aecf4e9bb2b656d67c1f9537e8f0e9f16479c98a04fde93" - stringLegacyBack := h "10af1decd5d2cd085adff8ae7fb44cfc5d22a89bbc40b81b809d3d556fda3e8f" + stringBack := h "616eeeb0735f93dd10891b72bb659dd80418a6e84a9ce1313ecb41b0adc7623a" + stringLegacyBack := h "2f4e032675b915bfd44c2099b41c819971c259ec42f4b5e24fdddf20c03fe573" stringUtf8ByteSize := h "4c086826cc679df3b6aa57a29f3d093a8a92d0de4edecef46a908d8398733dc0" stringAppend := h "0eae69f3f8b198d1ffac67b9e88d39526b1b039ff519cd87eec106f63974860c" stringDecEq := h "da7bb331e098f9bf5cdabcb9609a7e953dffc609ad9d90871a14c016c52a3011" diff --git a/Ix/Tc/Verify/Audit/Completed.lean b/Ix/Tc/Verify/Audit/Completed.lean index 920f76509..57860c7df 100644 --- a/Ix/Tc/Verify/Audit/Completed.lean +++ b/Ix/Tc/Verify/Audit/Completed.lean @@ -148,6 +148,11 @@ open Ix.Tc.Verify.Audit private def standard : Array Lean.Name := #[``propext, ``Classical.choice, ``Quot.sound] +-- Lean v4.34 proves `Nat.le_iff_lt_add_one` and `Nat.pow_lt_pow_iff_right` +-- classically, and `Std.DHashMap.Raw.WF` reaches them, so any statement over +-- hash-map state depends on `Classical.choice` through the type alone. Roots +-- whose statements mention such state are on `standard` for that reason; the +-- ones still here are genuinely choice-free. private def standardWithoutChoice : Array Lean.Name := #[``propext, ``Quot.sound] @@ -3216,21 +3221,21 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.abstractFVars_eq, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.InternPreservesUnivs.pure, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.InternPreservesUnivs.runWalk, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.WalkPreservesUnivs.pure, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.WalkPreservesUnivs.bind, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.WalkPreservesUnivs.scratchGet, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.WalkPreservesUnivs.scratchInsert, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.WalkPreservesUnivs.liftIntern, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.WalkPreservesUnivs.internExpr, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.lift_preservesUnivs, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.subst_preservesUnivs, @@ -3256,19 +3261,19 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.CheckConstSupport.abstractFVars, standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.ExecutionRequests.bind, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.ExecutionRequests.tryCatch, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.ExecutionRequests.runRec, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.ExecutionRequests.isolateCheckErrors, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.ExecutionRequests.modify, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.ExecutionRequests.weaken, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.ExecutionRequests.of_eq, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.ExecutionRequests.intern_eq_of_nil, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RunAssumptions.initial, @@ -3280,7 +3285,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RunAssumptions.internUniv_spec, standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunSupport.CoversIntern.of_expr_univs, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RunAssumptions.lift_spec, standardAxioms := standard, nativeAxioms := levelNative }, { root := ``Ix.Tc.RunAssumptions.subst_spec, @@ -3365,13 +3370,13 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.VerifyWorld.LE.catalogued_iff, standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.LoadedAgrees.world_iff, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.LoadedAgrees.insert, standardAxioms := standard }, { root := ``Ix.Tc.LoadedAgrees.of_extension, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.VerifyWorld.ofCatalog_loaded, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.VerifyWorld.ofCatalog_loaded_not_trusted, standardAxioms := standard }, @@ -3928,7 +3933,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := inferNative, forbiddenDependencies := occurrenceValidationForbiddenDependencies }, { root := ``Ix.Tc.RecM.runBounded_flatAuxHistory, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := occurrenceValidationForbiddenDependencies }, { root := ``Ix.Tc.RecM.seedFlatBlockMembers_exact, standardAxioms := standard, nativeAxioms := levelNative, @@ -4661,7 +4666,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.KEnv.restoreBlockCheckResultsOnError_origin, standardAxioms := standard }, { root := ``Ix.Tc.CacheInvariant.mono, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.CacheInvariant.insertWhnf, standardAxioms := standard }, { root := ``Ix.Tc.CacheInvariant.insertWhnfNoDelta, @@ -4673,13 +4678,13 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.CacheInvariant.insertWhnfCoreCheap, standardAxioms := standard }, { root := ``Ix.Tc.CacheInvariant.of_intern_update, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.CacheInvariant.clearReductionCaches, standardAxioms := standard }, { root := ``Ix.Tc.CacheInvariant.restoreCheckCachesOnError, standardAxioms := standard }, { root := ``Ix.Tc.TcM.isolateCheckErrors_error, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.reset_cache_frame, standardAxioms := standard, nativeAxioms := #[nativeAxiom `Blake3 @@ -5076,11 +5081,11 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.WhnfStateInv.of_semantic_fields_eq, standardAxioms := standard, nativeAxioms := blake3Native }, { root := ``Ix.Tc.TcM.stepTrace_disabled, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.bumpStats_disabled, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.tick_success, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.WhnfNoDeltaTrace.no_zero, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RecM.WhnfNoDeltaTrace.eval, @@ -5124,7 +5129,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.whnfWithNatSuccModePrefix_disabled, standardAxioms := standard }, { root := ``Ix.Tc.RecM.whnfWithNatSuccModeMissCharge_disabled, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.whnfNoDeltaImplNonLeaf_fullHit, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RecM.whnfNoDeltaImplNonLeaf_cheapHit, @@ -5253,7 +5258,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.WhnfPost.meaning, standardAxioms := standard }, { root := ``Ix.Tc.TcM.isLetVar_wf, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.stepTrace_whnf_wf, standardAxioms := standard, nativeAxioms := blake3Native }, { root := ``Ix.Tc.TcM.bumpStats_whnf_wf, @@ -5377,17 +5382,17 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.methodsN_succ_isDefEq, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.methodsOut_whnf, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.methodsOut_whnfCore, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.methodsOut_whnfMode, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.methodsOut_whnfCoreFlags, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.methodsOut_infer, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.methodsOut_isDefEq, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.runRec_apply, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.TcM.runRec_directInfer_zero, @@ -5417,7 +5422,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.applyIotaArg_true_lam, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.isNatLiteralRecursorApp_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isTransientNatLiteralWork_equation, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.cleanupNatOffsetMajor_equation, @@ -5429,11 +5434,11 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.tryReduceProjectionDefinition_equation, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.natRecLiteralParts_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isNatStuckRecursorAddr_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isStuckNatPredicateProbe_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.bitvecOfNatArgs_equation, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.charOfNatExpr_equation, @@ -5441,11 +5446,11 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.tryReduceString_equation, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.discoverBlockInductives_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.runBounded_zero, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.runBounded_succ, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.consumeBetaLams_equation, standardAxioms := standard, nativeAxioms := expressionNative }, @@ -5458,33 +5463,33 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.compareRank_equation, standardAxioms := propextOnly }, { root := ``Ix.Tc.RecM.isNatLike_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isNatZero_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.natSuccOf_equation, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.isBoolTrue_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isDelta_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isRegular_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.defRankId_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.infer_eq_inferWith, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RecM.inferCall_run, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.inferOnlyCall_run, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isDefEqCall_run, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.whnfRec_run, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.whnfModeRec_run, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.whnfCoreFlagsRec_run, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.whnf_eq_whnfWithNatSuccMode, standardAxioms := standard, nativeAxioms := inferNative }, { root := ``Ix.Tc.RecM.whnfCore_eq_whnfCoreWithFlags, @@ -5504,17 +5509,17 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.RecM.checkNoUnsafeRefs_go_app, standardAxioms := standard }, { root := ``Ix.Tc.RecM.validateUnivParamsSeen_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.validateUnivParamsSeen_go_nil, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.validateUnivParamsSeen_go_max, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.validateExprWellScoped_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.validateExprWellScoped_go_nil, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.validateExprWellScoped_go_app, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.peelRuleIhForalls_equation, standardAxioms := standardWithoutChoice }, { root := ``Ix.Tc.RecM.checkPositivityDomain_equation, @@ -5544,7 +5549,7 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.projectionDefinitionInfo_go_equation, standardAxioms := propextOnly }, { root := ``Ix.Tc.EquivManager.find_equation, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.EquivManager.find_go_zero }, { root := ``Ix.Tc.EquivManager.find_go_succ }, { root := ``Ix.Tc.LocalContext.truncate_equation, @@ -5691,9 +5696,9 @@ private def roots : Array RootAllowance := #[ -- equations consume that helper boundary. The Nat fixtures make argument -- reversal, a trailing argument, and physically changed heads observable. { root := ``Ix.Tc.InternUpdateFrame.refl, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.InternUpdateFrame.trans, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RunAssumptions.internExpr_whnf_eval, standardAxioms := standard, nativeAxioms := levelNative, forbiddenDependencies := legacyWholeEnv }, @@ -5749,14 +5754,14 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := contextNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.tryGetConst_noLazy, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.lazyIngressAddr_wf, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.TcM.tryGetConst_wf, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.KId.anon_eq_of_addr_eq }, { root := ``Ix.Tc.TcM.tryGetConst_success_loaded, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.NatRecLiteralPartsSuccessTrace.eval, standardAxioms := standard }, { root := ``Ix.Tc.RecM.NatRecLiteralPartsSuccessTrace.complete, @@ -6100,7 +6105,7 @@ private def roots : Array RootAllowance := #[ sorryOrigins := typingDebt, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.intern_success_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.strLitListToConstructor_empty, standardAxioms := standard, nativeAxioms := expressionNative, @@ -6140,7 +6145,7 @@ private def roots : Array RootAllowance := #[ nativeAxioms := expressionNative.push nameDecideNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.AmbientNat.iotaStringCallback, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.AmbientNat.iotaStringCleanup, standardAxioms := standard, @@ -6164,10 +6169,10 @@ private def roots : Array RootAllowance := #[ -- error-side state, candidate synthesis records the DefEq gate and counter -- order, and the inhabited fixture reaches the real bounded WHNF driver. { root := ``Ix.Tc.RecM.tryOptional_success, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryOptional_error, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.VerifyKSynthCandidateSuccessTrace.eval, standardAxioms := standard, nativeAxioms := expressionNative, @@ -6404,7 +6409,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.structEtaIntern_total, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.finishStructEtaFields_total, standardAxioms := standard, nativeAxioms := expressionNative, @@ -6510,16 +6515,16 @@ private def roots : Array RootAllowance := #[ -- CallbackPrefix: the exact infer-only and optional-catch wrappers preserve the -- complete fixed-world invariant while retaining callback mutations. { root := ``Ix.Tc.TcM.withInferOnly_eq, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.withInferOnly_whnf_wf, standardAxioms := standard, nativeAxioms := blake3Native, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.inferOnlyRec_run, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryOptional_run, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryOptional_wf, standardAxioms := standard, nativeAxioms := blake3Native, @@ -6554,13 +6559,13 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := blake3ContextNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.getConst_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.tryGetBlock_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.WhnfCallbackSupports.preserves, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.getMajorInductiveId_wf, standardAxioms := standard, nativeAxioms := blake3ContextNative, @@ -6572,7 +6577,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := blake3ContextNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.discoverBlockInductives_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.computeIsRec_wf, standardAxioms := standard, nativeAxioms := blake3ContextNative, @@ -6601,10 +6606,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := blake3ContextNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryOptional_state_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryOptional_fixed_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.tryStructEtaAfterInductive_wf, standardAxioms := standard, nativeAxioms := inferNative, @@ -6802,7 +6807,7 @@ private def roots : Array RootAllowance := #[ -- environment; hook identity remains visible because `TcState.lazyFault` -- otherwise stores an arbitrary function. { root := ``Ix.Tc.LazyIngressEnvFrame.refl, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.LazyIngressEnvFrame.kernelStateWF, standardAxioms := standard, nativeAxioms := blake3Native, @@ -6840,10 +6845,10 @@ private def roots : Array RootAllowance := #[ -- constructor/struct-eta dispatch all preserve the complete K1 invariant. -- Only the ordinary-constructor and struct-eta tails remain named inputs. { root := ``Ix.Tc.RecM.prims_state_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.isNatBinArithAddr_state_wf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.natOffsetReaders_state_wf, standardAxioms := standard, nativeAxioms := expressionNative, @@ -6864,7 +6869,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := expressionNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.WF.with_run_eq, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.OptionalGeneratedInput, standardAxioms := standard, @@ -6948,10 +6953,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := inferNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.IsDefEqCallbackPreserves, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.WF.tryFinally_const, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.enterDispatch_whnf_wf, standardAxioms := standard, nativeAxioms := blake3Native, @@ -7445,9 +7450,9 @@ private def roots : Array RootAllowance := #[ { root := ``Ix.Tc.AmbientNat.linearRecPartsTrace, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.TcM.LazyFaultPreserves.of_none, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.natRecLiteralParts_wf, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.NatRecLiteralPartsPreserves.of_lazy, standardAxioms := standard, nativeAxioms := blake3Native, forbiddenDependencies := legacyWholeEnv }, @@ -7455,7 +7460,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := blake3Native, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.isNatLiteralRecursorApp_wf, - standardAxioms := standardWithoutChoice }, + standardAxioms := standard }, { root := ``Ix.Tc.RecM.isTransientNatLiteralWork_wf, standardAxioms := standard, nativeAxioms := expressionNative }, { root := ``Ix.Tc.RecM.TransientNatWork.preserving, @@ -7755,10 +7760,10 @@ private def roots : Array RootAllowance := #[ -- semantic optional-reduction Hoare slice. Predicate precedence remains -- operationally exhaustive even before canonical classifier separation. { root := ``Ix.Tc.RecM.isNatBinArithAddr_eval, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.isNatBinPredAddr_eval, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.isNatBinPredAddr_true, standardAxioms := standard, @@ -7958,7 +7963,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := contextNative, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.recordNatSuccStuck_eval, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.recordNatSuccStuck_wf, standardAxioms := standard, nativeAxioms := blake3Native, @@ -8294,7 +8299,7 @@ private def roots : Array RootAllowance := #[ -- transport explicit for WHNF, inference, and DefEq. Collision-robust -- provenance constructors quantify over every supported address peer. { root := ``Ix.Tc.TcM.withEquiv_eq, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.TcM.withEquiv_whnf_wf, standardAxioms := standard, nativeAxioms := blake3Native, @@ -8574,7 +8579,7 @@ private def roots : Array RootAllowance := #[ -- recursive equality is transported forward through the common successor -- suffix, without assuming offset injectivity or completeness. { root := ``Ix.Tc.TcM.WF.withInvRunEq, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := legacyWholeEnv }, { root := ``Ix.Tc.RecM.natOffsetDecompose_state_wf, standardAxioms := standard, nativeAxioms := expressionNative, @@ -9218,34 +9223,34 @@ private def roots : Array RootAllowance := #[ sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateUnivParamsSeen_go_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateUnivParamsSeen_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateUnivRootsList_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateUnivRootsArray_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.getConst_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.hasConst_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateExprWellScoped_go_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateExprWellScoped_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.validateConstWellScoped_frame, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.LazyFaultPreserves.withInferOnly, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.checkTypePipeline_sound, standardAxioms := standard, nativeAxioms := inferNative, @@ -9321,7 +9326,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.WF.withInv, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.inferWith_fullHit_pre_acceptance, standardAxioms := standard, nativeAxioms := inferNative, @@ -9354,10 +9359,10 @@ private def roots : Array RootAllowance := #[ sorryOrigins := typingDebt, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.PreservesInferOnly.strengthenWFValue, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.PreservesInferOnly.withInferOnly, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.TcM.PreservesInferOnly.openBinder, standardAxioms := standard, nativeAxioms := expressionNative, @@ -9366,7 +9371,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := contextNative, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.cacheInferResult_preservesInferOnly, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.RecM.withLctxScope_preservesInferOnly, standardAxioms := standard, nativeAxioms := expressionNative, @@ -9378,7 +9383,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := inferNative, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.Methods.methodsOut_preservesInferOnly, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := k1ForbiddenDependencies }, { root := ``Ix.Tc.Methods.methodsN_preservesInferOnly, standardAxioms := standard, nativeAxioms := inferNative, @@ -9528,7 +9533,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.CacheInvariant.replayCoordinatedMember, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.CacheInvariant.rejectsSuccessWithUntrustedMember, standardAxioms := standardWithoutChoice, @@ -9665,10 +9670,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standardWithoutChoice, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.IxonEnv.dependencyCatalog_blockOf, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.IxonEnv.dependencyCatalog_dependsOn_iff, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.IxonExpr.DeclReference.target_mem_refs, standardAxioms := standardWithoutChoice, @@ -9677,10 +9682,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standardWithoutChoice, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.ExactAnonEntry.getConst, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.ExactAnonEntry.constant_unique, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.ExactAnonEntry.buildAnonWorkItem_eq, standardAxioms := standard, nativeAxioms := blake3Native, @@ -9710,10 +9715,10 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := blake3Native, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.ExactAnonEntry.blockOfAddr_eq_owner, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.ExactAnonEntry.blockOfAddr_eq_self, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.AnonWorkEnvWF.matches_blockOfAddr, standardAxioms := standard, nativeAxioms := blake3Native, @@ -9728,7 +9733,7 @@ private def roots : Array RootAllowance := #[ standardAxioms := standard, nativeAxioms := blake3Native, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.finishAnonCheckItem_results, - standardAxioms := standardWithoutChoice, + standardAxioms := standard, forbiddenDependencies := boundedKnotForbiddenDependencies }, { root := ``Ix.Tc.runAnonCheckItem_preserves_result, standardAxioms := standard, nativeAxioms := inductiveNative, diff --git a/Ix/Tc/Verify/Check/BinderRoundTrip.lean b/Ix/Tc/Verify/Check/BinderRoundTrip.lean index 4321a91af..ce19debfa 100644 --- a/Ix/Tc/Verify/Check/BinderRoundTrip.lean +++ b/Ix/Tc/Verify/Check/BinderRoundTrip.lean @@ -91,7 +91,7 @@ theorem abstractFVarsSpec_instantiateRevSpec_singleton have hwindow : ((depth ≥ depth && depth < depth + 1) = true) := by simp [hlt] - rw [if_pos hwindow] + rw [ite_eq_left hwindow] have hindex : (1 - 1 - (depth - depth)).toNat = 0 := by simp rw [hindex, getElem!_pos #[KExpr.mkFVar fv name] 0 (by simp)] change abstractFVarsSpec (KExpr.mkFVar fv name) @@ -133,8 +133,8 @@ theorem abstractFVarsSpec_instantiateRevSpec_singleton show (1 : UInt64).toNat = 1 from rfl] rw [Nat.sub_add_cancel honeNat] exact Nat.mod_eq_of_lt (Nat.lt_trans (Nat.lt_succ_self _) hidx) - rw [if_neg hwindow, if_pos hgeSucc, mkVar_shape, - abstractFVarsSpec, if_pos hshift, hround] + rw [ite_eq_right hwindow, ite_eq_left hgeSucc, mkVar_shape, + abstractFVarsSpec, ite_eq_left hshift, hround] exact mkVar_shape idx varName info · have hnge : ¬idx ≥ depth := fun hge => by have hle := UInt64.le_iff_toNat_le.mp hge @@ -149,8 +149,8 @@ theorem abstractFVarsSpec_instantiateRevSpec_singleton have hgeNat := UInt64.le_iff_toNat_le.mp hge rw [hsucc] at hgeNat omega)) - rw [if_neg hwindow, if_neg hngeSucc, abstractFVarsSpec, - if_neg hnge] + rw [ite_eq_right hwindow, ite_eq_right hngeSucc, abstractFVarsSpec, + ite_eq_right hnge] | @fvar id fvarName info => have hne : id ≠ fv := by rw [mkFVar_shape] at hfresh diff --git a/Ix/Tc/Verify/Check/BoundedPipelines.lean b/Ix/Tc/Verify/Check/BoundedPipelines.lean index 30055a116..48068e34d 100644 --- a/Ix/Tc/Verify/Check/BoundedPipelines.lean +++ b/Ix/Tc/Verify/Check/BoundedPipelines.lean @@ -457,7 +457,7 @@ theorem checkValuePipeline_bounded_sound intro answer _ heq cases answer with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.WF.throw fun _ => trivial | true => simp only [Bool.not_true, Bool.false_eq] diff --git a/Ix/Tc/Verify/Check/CheckerEvidence.lean b/Ix/Tc/Verify/Check/CheckerEvidence.lean index adc4a0035..3e72c43cb 100644 --- a/Ix/Tc/Verify/Check/CheckerEvidence.lean +++ b/Ix/Tc/Verify/Check/CheckerEvidence.lean @@ -157,7 +157,7 @@ theorem checkValuePipeline_sound intro answer _ heq cases answer with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.WF.throw fun _ => trivial | true => simp only [Bool.not_true, Bool.false_eq] diff --git a/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean b/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean index 1b2e5ff0e..c83ae21a1 100644 --- a/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqBasicPolicy.lean @@ -271,7 +271,7 @@ theorem quickBinder_preservesInferOnly cases typesEqual with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply withLctxScope_preservesInferOnly simp only [ReaderT.run_bind, ReaderT.run_monadLift] apply TcM.PreservesInferOnly.bind @@ -310,7 +310,7 @@ theorem allDefEqSpineArgsList_preservesInferOnly cases equal with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact allDefEqSpineArgsList_preservesInferOnly hmethods rest theorem allDefEqSpineArgs_preservesInferOnly @@ -337,16 +337,16 @@ theorem trySameHeadSpine_preservesInferOnly cases hshape : (leftId.addr != rightId.addr || leftArgs.size != rightArgs.size) with | true => - simp only [hshape, if_true] + simp only [hshape, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hshape, Bool.false_eq_true, if_false, pure_bind] + simp only [hshape, Bool.false_eq_true, ite_false, pure_bind] cases huniverses : sameDefEqUniverses leftLevels rightLevels with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.PreservesInferOnly.pure none | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (allDefEqSpineArgs_preservesInferOnly hmethods (leftArgs.zip rightArgs)) ?_ @@ -354,7 +354,7 @@ theorem trySameHeadSpine_preservesInferOnly cases accepted with | false => exact TcM.PreservesInferOnly.pure none | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure (some true) /-- Bounded speculation restores the caller-visible fuel frame and preserves @@ -373,10 +373,10 @@ theorem trySameHeadSpineSpeculative_preservesInferOnly saved.fuelBudget - saved.recFuel >= sameHeadSpeculationStartFuel) with | true => - simp only [hskip, if_true] + simp only [hskip, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hskip, Bool.false_eq_true, if_false, pure_bind] + simp only [hskip, Bool.false_eq_true, ite_false, pure_bind] refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.modify (f := fun state : TcState .anon => @@ -431,10 +431,10 @@ theorem trySameHeadSpineCached_preservesInferOnly (by cases speculative with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact trySameHeadSpine_preservesInferOnly hmethods left right | true => - simp only [if_true] + simp only [ite_true] exact trySameHeadSpineSpeculative_preservesInferOnly hmethods left right) intro result @@ -456,7 +456,7 @@ theorem tryDefEqWhnfApp_preservesInferOnly cases functionsEqual with | false => exact TcM.PreservesInferOnly.pure none | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (isDefEqCall_preservesInferOnly hmethods argumentLeft argumentRight) ?_ intro argumentsEqual diff --git a/Ix/Tc/Verify/Check/DefEqCachePolicy.lean b/Ix/Tc/Verify/Check/DefEqCachePolicy.lean index 60f09a723..4b55d8e53 100644 --- a/Ix/Tc/Verify/Check/DefEqCachePolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqCachePolicy.lean @@ -41,7 +41,7 @@ private theorem finishDefEqCacheWrite_preservesInferOnly defEqCache := state.env.defEqCache.insert cacheKey answer } } pure answer : RecM .anon Bool).run methods) := by by_cases hanswer : answer - · simp only [hanswer, if_true] + · simp only [hanswer, ite_true] apply bind_preservesInferOnly (modifyRec_preservesInferOnly (fun state => { state with @@ -49,7 +49,7 @@ private theorem finishDefEqCacheWrite_preservesInferOnly fun _ => rfl) intro _ by_cases hcheap : cheapMode - · simp only [hcheap, if_true] + · simp only [hcheap, ite_true] apply bind_preservesInferOnly (modifyRec_preservesInferOnly (fun state => { state with env := { state.env with @@ -58,7 +58,7 @@ private theorem finishDefEqCacheWrite_preservesInferOnly fun _ => rfl) intro _ exact TcM.PreservesInferOnly.pure true - · simp only [hcheap, Bool.false_eq_true, if_false] + · simp only [hcheap, Bool.false_eq_true, ite_false] apply bind_preservesInferOnly (modifyRec_preservesInferOnly (fun state => { state with env := { state.env with @@ -66,9 +66,9 @@ private theorem finishDefEqCacheWrite_preservesInferOnly fun _ => rfl) intro _ exact TcM.PreservesInferOnly.pure true - · simp only [hanswer, Bool.false_eq_true, if_false, pure_bind] + · simp only [hanswer, Bool.false_eq_true, ite_false, pure_bind] by_cases hcheap : cheapMode - · simp only [hcheap, if_true] + · simp only [hcheap, ite_true] apply bind_preservesInferOnly (modifyRec_preservesInferOnly (fun state => { state with env := { state.env with @@ -77,7 +77,7 @@ private theorem finishDefEqCacheWrite_preservesInferOnly fun _ => rfl) intro _ exact TcM.PreservesInferOnly.pure false - · simp only [hcheap, Bool.false_eq_true, if_false] + · simp only [hcheap, Bool.false_eq_true, ite_false] apply bind_preservesInferOnly (modifyRec_preservesInferOnly (fun state => { state with env := { state.env with @@ -106,12 +106,12 @@ theorem isDefEqAfterRootCacheMiss_preservesInferOnly refine bindTcM_preservesInferOnly TcM.PreservesInferOnly.get ?_ intro state by_cases hdepth : state.defEqDepth > maxDefEqDepth - · simp only [hdepth, if_true] + · simp only [hdepth, ite_true] refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.modify fun _ => rfl) ?_ intro _ exact TcM.PreservesInferOnly.throw .maxRecDepth - · simp only [hdepth, if_false, pure_bind] + · simp only [hdepth, ite_false, pure_bind] refine bind_preservesInferOnly (captureErrors_preservesInferOnly (hinner left right)) ?_ intro result @@ -176,10 +176,10 @@ theorem isDefEqAfterDirectCacheMiss_preservesInferOnly | some rightRoot => simp only by_cases hchanged : leftRoot != leftKey || rightRoot != rightKey - · simp only [hchanged, if_true] + · simp only [hchanged, ite_true] by_cases hscope : leftRoot.rootCacheScopeMatches rightRoot contextAddress (max left.lbr right.lbr) - · simp only [hscope, if_true] + · simp only [hscope, ite_true] let rootPair := canonicalPair leftRoot.exprAddr rightRoot.exprAddr let rootCacheKey := (rootPair.1, rootPair.2, contextAddress) refine bind_preservesInferOnly @@ -193,7 +193,7 @@ theorem isDefEqAfterDirectCacheMiss_preservesInferOnly cacheKey cheapMode cached false | none => by_cases hcheap : cheapMode - · simp only [hcheap, if_true] + · simp only [hcheap, ite_true] refine bind_preservesInferOnly (show ((get : RecM .anon (TcState .anon)).run methods).PreservesInferOnly by intro before; rfl) ?_ @@ -208,13 +208,13 @@ theorem isDefEqAfterDirectCacheMiss_preservesInferOnly simp only [pure_bind] exact hrootMiss left right leftKey rightKey cacheKey true - · simp only [hcheap, Bool.false_eq_true, if_false, + · simp only [hcheap, Bool.false_eq_true, ite_false, pure_bind] exact hrootMiss left right leftKey rightKey cacheKey false - · simp only [hscope, Bool.false_eq_true, if_false] + · simp only [hscope, Bool.false_eq_true, ite_false] exact hrootMiss left right leftKey rightKey cacheKey cheapMode - · simp only [hchanged, Bool.false_eq_true, if_false] + · simp only [hchanged, Bool.false_eq_true, ite_false] exact hrootMiss left right leftKey rightKey cacheKey cheapMode private theorem finishDirectFullCacheHit_preservesInferOnly @@ -264,9 +264,9 @@ theorem isDefEq_preservesInferOnly (TcM.PreservesInferOnly.bumpStats _ fun _ => rfl) ?_ intro _ by_cases haddress : left.addr == right.addr - · simp only [haddress, if_true] + · simp only [haddress, ite_true] exact TcM.PreservesInferOnly.pure true - · simp only [haddress, Bool.false_eq_true, if_false, pure_bind] + · simp only [haddress, Bool.false_eq_true, ite_false, pure_bind] refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.defEqCtxKey left right) ?_ intro contextAddress @@ -282,7 +282,7 @@ theorem isDefEq_preservesInferOnly cases equivalent with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] let pair := canonicalPair left.addr right.addr let cacheKey := (pair.1, pair.2, contextAddress) refine bind_preservesInferOnly diff --git a/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean b/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean index b2d0f9021..ed9f7adb4 100644 --- a/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqEtaPolicy.lean @@ -113,10 +113,10 @@ theorem etaExpansionBaseLoop_preservesInferOnly (projectionId.addr != inductiveId.addr || projectionIndex.toNat != field) with | true => - simp only [hshape, if_true] + simp only [hshape, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hshape, Bool.false_eq_true, if_false, pure_bind] + simp only [hshape, Bool.false_eq_true, ite_false, pure_bind] unfold etaExpansionBaseAfterProjection refine bind_preservesInferOnly (tryQuestion_preservesInferOnly (hnoDelta value)) ?_ @@ -132,10 +132,10 @@ theorem etaExpansionBaseLoop_preservesInferOnly | some prior => cases hsame : (prior.addr != normalizedValue.addr) with | true => - simp only [hsame, if_true] + simp only [hsame, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hsame, Bool.false_eq_true, if_false, + simp only [hsame, Bool.false_eq_true, ite_false, pure_bind] exact etaExpansionBaseLoop_preservesInferOnly hnoDelta inductiveId numParams arguments fuel (field + 1) @@ -149,10 +149,10 @@ theorem etaExpansionBaseLoop_preservesInferOnly | some prior => cases hsame : (prior.addr != value.addr) with | true => - simp only [hsame, if_true] + simp only [hsame, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hsame, Bool.false_eq_true, if_false, + simp only [hsame, Bool.false_eq_true, ite_false, pure_bind] exact etaExpansionBaseLoop_preservesInferOnly hnoDelta inductiveId numParams arguments fuel (field + 1) @@ -177,10 +177,10 @@ theorem etaExpansionBaseAfterValue_preservesInferOnly | some prior => cases hsame : (prior.addr != value.addr) with | true => - simp only [hsame, if_true] + simp only [hsame, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hsame, Bool.false_eq_true, if_false, pure_bind] + simp only [hsame, Bool.false_eq_true, ite_false, pure_bind] exact etaExpansionBaseLoop_preservesInferOnly hnoDelta inductiveId numParams arguments fuel (field + 1) (some prior) @@ -236,7 +236,7 @@ theorem tryEtaStructFields_preservesInferOnly cases equal with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact tryEtaStructFields_preservesInferOnly hmethods inductiveId numParams target arguments fuel (field + 1) @@ -265,7 +265,7 @@ theorem tryEtaStructAfterTypes_preservesInferOnly cases equal with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact tryEtaStructFields_preservesInferOnly hmethods inductiveId numParams target arguments numFields 0 @@ -286,7 +286,7 @@ theorem tryEtaStructAfterConstructor_preservesInferOnly cases isStructure with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (tryQuestion_preservesInferOnly (inferOnlyCall_preservesInferOnly hmethods source)) ?_ @@ -310,7 +310,7 @@ theorem tryEtaStructAfterConstructor_preservesInferOnly cases typesEqual with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact tryEtaStructAfterTypes_preservesInferOnly hmethods hnoDelta inductiveId numParams numFields target arguments diff --git a/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean b/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean index 086e4cfe4..c38c8ce4c 100644 --- a/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqFinalWhnfPolicy.lean @@ -28,14 +28,14 @@ theorem tryDefEqWhnfLet_preservesInferOnly cases typesEqual with | false => exact TcM.PreservesInferOnly.pure none | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (isDefEqCall_preservesInferOnly hmethods valueLeft valueRight) ?_ intro valuesEqual cases valuesEqual with | false => exact TcM.PreservesInferOnly.pure none | true => - simp only [if_true] + simp only [ite_true] have hbody : ((withLctxScope do let (leftOpen, fresh, _) ← @@ -158,10 +158,10 @@ theorem tryDefEqWhnfNat_preservesInferOnly intro rightNat cases hboth : (leftNat && rightNat) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (isDefEqNat_preservesInferOnly hmethods left right) ?_ intro answer @@ -181,7 +181,7 @@ theorem tryDefEqWhnfEtaAfterGuard_preservesInferOnly cases firstAccepted with | true => exact TcM.PreservesInferOnly.pure (some true) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryEtaExpansion_preservesInferOnly hmethods hwhnf right left) ?_ intro secondAccepted @@ -210,7 +210,7 @@ theorem tryDefEqWhnfStringAfterGuard_preservesInferOnly cases firstAccepted with | true => exact TcM.PreservesInferOnly.pure (some true) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryStringLitExpansion_preservesInferOnly hmethods right left) ?_ intro secondAccepted @@ -239,7 +239,7 @@ theorem tryDefEqWhnfStructEta_preservesInferOnly cases firstAccepted with | true => exact TcM.PreservesInferOnly.pure (some true) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryEtaStruct_preservesInferOnly hmethods hnoDelta right left) ?_ intro secondAccepted @@ -269,7 +269,7 @@ theorem isDefEqWhnfAfterStructEta_preservesInferOnly cases accepted with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact isDefEqWhnfAfterUnit_preservesInferOnly hmethods hwhnf left right theorem isDefEqWhnfAfterString_preservesInferOnly diff --git a/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean b/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean index 09ff9bc13..3745e69ee 100644 --- a/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqLazyDeltaPolicy.lean @@ -27,10 +27,10 @@ theorem finishDefEqLazyDeltaStep_preservesInferOnly methods).PreservesInferOnly := by unfold finishDefEqLazyDeltaStep by_cases haddress : left.addr == right.addr - · simp only [haddress, if_true] + · simp only [haddress, ite_true] exact TcM.PreservesInferOnly.pure (BoundedStep.done (LazyDeltaLoopResult.answer true)) - · simp only [haddress, Bool.false_eq_true, if_false, pure_bind] + · simp only [haddress, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (quickDefEq_preservesInferOnly hmethods left right) ?_ intro equal @@ -141,7 +141,7 @@ theorem defEqLazyDeltaStepWithEqualRank_preservesInferOnly hcheapNoDelta left right | some rightId => by_cases hguard : leftId.addr == rightId.addr - · simp only [hguard, if_true] + · simp only [hguard, ite_true] refine bind_preservesInferOnly (isRegular_preservesInferOnly leftId) ?_ intro regular @@ -156,7 +156,7 @@ theorem defEqLazyDeltaStepWithEqualRank_preservesInferOnly | none => exact defEqLazyDeltaStepAfterSameHeadMiss_preservesInferOnly hmethods hcheapNoDelta left right - · simp only [hguard, Bool.false_eq_true, if_false] + · simp only [hguard, Bool.false_eq_true, ite_false] exact defEqLazyDeltaStepAfterSameHeadMiss_preservesInferOnly hmethods hcheapNoDelta left right @@ -171,7 +171,7 @@ theorem defEqLazyDeltaStepAfterProjectionMiss_preservesInferOnly leftDelta rightDelta).run methods).PreservesInferOnly := by unfold defEqLazyDeltaStepAfterProjectionMiss by_cases hboth : leftDelta && rightDelta - · simp only [hboth, if_true] + · simp only [hboth, ite_true] refine bind_preservesInferOnly (rankDeltaHead_preservesInferOnly leftHead) ?_ intro leftRank @@ -179,21 +179,21 @@ theorem defEqLazyDeltaStepAfterProjectionMiss_preservesInferOnly (rankDeltaHead_preservesInferOnly rightHead) ?_ intro rightRank by_cases hequal : leftRank == rightRank - · simp only [hequal, if_true] + · simp only [hequal, ite_true] exact defEqLazyDeltaStepWithEqualRank_preservesInferOnly hmethods hcheapNoDelta left right leftHead rightHead - · simp only [hequal, Bool.false_eq_true, if_false] + · simp only [hequal, Bool.false_eq_true, ite_false] split · exact defEqLazyDeltaStepWithLeftDelta_preservesInferOnly hmethods hcheapNoDelta left right · exact defEqLazyDeltaStepWithRightDelta_preservesInferOnly hmethods hcheapNoDelta left right - · simp only [hboth, Bool.false_eq_true, if_false] + · simp only [hboth, Bool.false_eq_true, ite_false] by_cases hleft : leftDelta - · simp only [hleft, if_true] + · simp only [hleft, ite_true] exact defEqLazyDeltaStepWithLeftDelta_preservesInferOnly hmethods hcheapNoDelta left right - · simp only [hleft, Bool.false_eq_true, if_false] + · simp only [hleft, Bool.false_eq_true, ite_false] exact defEqLazyDeltaStepWithRightDelta_preservesInferOnly hmethods hcheapNoDelta left right @@ -210,7 +210,7 @@ theorem defEqLazyDeltaStepAfterDeltaClassification_preservesInferOnly leftDelta rightDelta).run methods).PreservesInferOnly := by unfold defEqLazyDeltaStepAfterDeltaClassification by_cases hleftOnly : leftDelta && !rightDelta - · simp only [hleftOnly, if_true] + · simp only [hleftOnly, ite_true] refine bind_preservesInferOnly (tryUnfoldProjApp_preservesInferOnly hnoDelta right) ?_ intro result @@ -221,9 +221,9 @@ theorem defEqLazyDeltaStepAfterDeltaClassification_preservesInferOnly | none => exact defEqLazyDeltaStepAfterProjectionMiss_preservesInferOnly hmethods hcheapNoDelta left right leftHead rightHead leftDelta rightDelta - · simp only [hleftOnly, Bool.false_eq_true, if_false] + · simp only [hleftOnly, Bool.false_eq_true, ite_false] by_cases hrightOnly : rightDelta && !leftDelta - · simp only [hrightOnly, if_true] + · simp only [hrightOnly, ite_true] refine bind_preservesInferOnly (tryUnfoldProjApp_preservesInferOnly hnoDelta left) ?_ intro result @@ -235,7 +235,7 @@ theorem defEqLazyDeltaStepAfterDeltaClassification_preservesInferOnly exact defEqLazyDeltaStepAfterProjectionMiss_preservesInferOnly hmethods hcheapNoDelta left right leftHead rightHead leftDelta rightDelta - · simp only [hrightOnly, Bool.false_eq_true, if_false, pure_bind] + · simp only [hrightOnly, Bool.false_eq_true, ite_false, pure_bind] exact defEqLazyDeltaStepAfterProjectionMiss_preservesInferOnly hmethods hcheapNoDelta left right leftHead rightHead leftDelta rightDelta @@ -256,10 +256,10 @@ theorem defEqLazyDeltaStepAfterAcceleratorMiss_preservesInferOnly (classifyDeltaHead_preservesInferOnly right) ?_ intro rightDelta by_cases hnone : !leftDelta && !rightDelta - · simp only [hnone, if_true] + · simp only [hnone, ite_true] exact TcM.PreservesInferOnly.pure (BoundedStep.done (LazyDeltaLoopResult.stopped left right)) - · simp only [hnone, Bool.false_eq_true, if_false, pure_bind] + · simp only [hnone, Bool.false_eq_true, ite_false, pure_bind] exact defEqLazyDeltaStepAfterDeltaClassification_preservesInferOnly hmethods hnoDelta hcheapNoDelta left right (headConstId left) (headConstId right) leftDelta rightDelta @@ -337,7 +337,7 @@ theorem defEqLazyDeltaStepAfterOffsetMiss_preservesInferOnly apply TcM.PreservesInferOnly.bind TcM.PreservesInferOnly.get intro state by_cases hnat : (!left.hasFVars && !right.hasFVars) || state.eagerReduce - · simp only [hnat, if_true] + · simp only [hnat, ite_true] apply TcM.PreservesInferOnly.bind (tryReduceNat_preservesInferOnly hmethods left) intro leftNat @@ -362,7 +362,7 @@ theorem defEqLazyDeltaStepAfterOffsetMiss_preservesInferOnly | none => exact defEqLazyDeltaStepAfterNatMiss_preservesInferOnly hmethods hnoDelta hcheapNoDelta left right - · simp only [hnat, Bool.false_eq_true, if_false, pure_bind] + · simp only [hnat, Bool.false_eq_true, ite_false, pure_bind] exact defEqLazyDeltaStepAfterNatMiss_preservesInferOnly hmethods hnoDelta hcheapNoDelta left right @@ -419,34 +419,34 @@ theorem isDefEqAfterLazyDeltaStopped_preservesInferOnly cases structural with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (hcore left) ?_ intro leftCore refine bind_preservesInferOnly (hcore right) ?_ intro rightCore by_cases hchanged : (leftCore.addr != left.addr) || (rightCore.addr != right.addr) - · simp only [hchanged, if_true] + · simp only [hchanged, ite_true] exact isDefEqCall_preservesInferOnly hmethods leftCore rightCore - · simp only [hchanged, Bool.false_eq_true, if_false] + · simp only [hchanged, Bool.false_eq_true, ite_false] by_cases haddress : leftCore.addr == rightCore.addr - · simp only [haddress, if_true] + · simp only [haddress, ite_true] exact TcM.PreservesInferOnly.pure true - · simp only [haddress, Bool.false_eq_true, if_false] + · simp only [haddress, Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (quickDefEq_preservesInferOnly hmethods leftCore rightCore) ?_ intro quick cases quick with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (tryDefEqApp_preservesInferOnly hmethods leftCore rightCore) ?_ intro application cases application with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact isDefEqWhnf_preservesInferOnly hmethods hwhnf hnoDelta leftCore rightCore diff --git a/Ix/Tc/Verify/Check/DefEqNatPolicy.lean b/Ix/Tc/Verify/Check/DefEqNatPolicy.lean index 21675013f..b689d8f4e 100644 --- a/Ix/Tc/Verify/Check/DefEqNatPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqNatPolicy.lean @@ -46,10 +46,10 @@ theorem natOffsetRebuild_preservesInferOnly | some source => cases hzero : (offset == 0) with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure source | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact mkNatAdd_preservesInferOnly source (natExprFromValue offset) theorem isDefEqNatAfterLiteral_preservesInferOnly @@ -64,10 +64,10 @@ theorem isDefEqNatAfterLiteral_preservesInferOnly intro rightZero cases hzero : (leftZero && rightZero) with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (natSuccOf_preservesInferOnly left) ?_ intro leftPredecessor refine bind_preservesInferOnly (natSuccOf_preservesInferOnly right) ?_ @@ -114,10 +114,10 @@ theorem tryDefEqOffsetAfterCandidates_preservesInferOnly simp only cases hshared : (min leftOffset rightOffset == 0) with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (natOffsetRebuild_preservesInferOnly leftBase (leftOffset - min leftOffset rightOffset)) ?_ @@ -156,10 +156,10 @@ theorem tryDefEqOffsetAfterLiteral_preservesInferOnly intro rightZero cases hzero : (leftZero && rightZero) with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure (some true) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact tryDefEqOffsetAfterZeroMiss_preservesInferOnly hmethods left right theorem tryDefEqOffset_preservesInferOnly diff --git a/Ix/Tc/Verify/Check/DefEqPipelinePolicy.lean b/Ix/Tc/Verify/Check/DefEqPipelinePolicy.lean index ff1d54d36..2feb2f2ef 100644 --- a/Ix/Tc/Verify/Check/DefEqPipelinePolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqPipelinePolicy.lean @@ -32,7 +32,7 @@ theorem isDefEqInnerAfterNoDeltaPass_preservesInferOnly cases proofIrrelevant with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact isDefEqInnerAfterProofIrrelevance_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapNoDelta left right @@ -55,16 +55,16 @@ theorem isDefEqInnerAfterCorePass_preservesInferOnly refine bind_preservesInferOnly (hcheapNoDelta right) ?_ intro normalizedRight by_cases haddress : normalizedLeft.addr == normalizedRight.addr - · simp only [haddress, if_true] + · simp only [haddress, ite_true] exact TcM.PreservesInferOnly.pure true - · simp only [haddress, Bool.false_eq_true, if_false, pure_bind] + · simp only [haddress, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (quickDefEq_preservesInferOnly hmethods normalizedLeft normalizedRight) ?_ intro quick cases quick with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact isDefEqInnerAfterNoDeltaPass_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapNoDelta normalizedLeft normalizedRight @@ -89,16 +89,16 @@ theorem isDefEqInnerAfterStringExpansion_preservesInferOnly refine bind_preservesInferOnly (hcheapCore right) ?_ intro coreRight by_cases haddress : coreLeft.addr == coreRight.addr - · simp only [haddress, if_true] + · simp only [haddress, ite_true] exact TcM.PreservesInferOnly.pure true - · simp only [haddress, Bool.false_eq_true, if_false, pure_bind] + · simp only [haddress, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (quickDefEq_preservesInferOnly hmethods coreLeft coreRight) ?_ intro quick cases quick with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact isDefEqInnerAfterCorePass_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapNoDelta left right @@ -119,24 +119,24 @@ theorem isDefEqInnerAfterBoolTrue_preservesInferOnly methods).PreservesInferOnly := by unfold isDefEqInnerAfterBoolTrue by_cases hstring : hasStringLiteralPair left right - · simp only [hstring, if_true] + · simp only [hstring, ite_true] refine bind_preservesInferOnly (tryStringLitExpansion_preservesInferOnly hmethods left right) ?_ intro forward cases forward with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryStringLitExpansion_preservesInferOnly hmethods right left) ?_ intro backward cases backward with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact isDefEqInnerAfterStringExpansion_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right - · simp only [hstring, Bool.false_eq_true, if_false] + · simp only [hstring, Bool.false_eq_true, ite_false] exact isDefEqInnerAfterStringExpansion_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right @@ -162,17 +162,17 @@ theorem isDefEqInnerAfterFirstBoolGuardMiss_preservesInferOnly (boolTrueReductionAllowed_preservesInferOnly right) ?_ intro rightAllowed by_cases hguard : leftIsTrue && rightAllowed - · simp only [hguard, if_true] + · simp only [hguard, ite_true] refine bind_preservesInferOnly (whnfIsBoolTrue_preservesInferOnly hwhnf right) ?_ intro normalizedTrue cases normalizedTrue with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact isDefEqInnerAfterBoolTrue_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right - · simp only [hguard, Bool.false_eq_true, if_false] + · simp only [hguard, Bool.false_eq_true, ite_false] exact isDefEqInnerAfterBoolTrue_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right @@ -198,17 +198,17 @@ theorem isDefEqInnerAfterQuick_preservesInferOnly (boolTrueReductionAllowed_preservesInferOnly left) ?_ intro leftAllowed by_cases hguard : rightIsTrue && leftAllowed - · simp only [hguard, if_true] + · simp only [hguard, ite_true] refine bind_preservesInferOnly (whnfIsBoolTrue_preservesInferOnly hwhnf left) ?_ intro normalizedTrue cases normalizedTrue with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact isDefEqInnerAfterBoolTrue_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right - · simp only [hguard, Bool.false_eq_true, if_false] + · simp only [hguard, Bool.false_eq_true, ite_false] exact isDefEqInnerAfterFirstBoolGuardMiss_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right @@ -233,7 +233,7 @@ theorem isDefEqInner_preservesInferOnly cases quick with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact isDefEqInnerAfterQuick_preservesInferOnly hmethods hwhnf hcore hnoDelta hcheapCore hcheapNoDelta left right diff --git a/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean b/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean index 7a1e5a5ab..046aefb89 100644 --- a/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqProjectionDeltaPolicy.lean @@ -127,13 +127,13 @@ theorem lazyDeltaReductionStepWithEqualRank_preservesInferOnly methods).PreservesInferOnly := by unfold lazyDeltaReductionStepWithEqualRank by_cases hguard : leftId.addr == rightId.addr - · simp only [hguard, if_true] + · simp only [hguard, ite_true] refine bind_preservesInferOnly (isRegular_preservesInferOnly leftId) ?_ intro regular cases regular with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (trySameHeadSpineSpeculative_preservesInferOnly hmethods left right) ?_ intro result @@ -150,7 +150,7 @@ theorem lazyDeltaReductionStepWithEqualRank_preservesInferOnly exact lazyDeltaReductionStepAfterSameHeadMiss_preservesInferOnly hmethods hcore left right | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (trySameHeadSpine_preservesInferOnly hmethods left right) ?_ intro result @@ -166,7 +166,7 @@ theorem lazyDeltaReductionStepWithEqualRank_preservesInferOnly | false => exact lazyDeltaReductionStepAfterSameHeadMiss_preservesInferOnly hmethods hcore left right - · simp only [hguard, Bool.false_eq_true, if_false] + · simp only [hguard, Bool.false_eq_true, ite_false] exact lazyDeltaReductionStepAfterSameHeadMiss_preservesInferOnly hmethods hcore left right @@ -208,7 +208,7 @@ theorem lazyDeltaReductionStepAfterActive_preservesInferOnly rightDelta).run methods).PreservesInferOnly := by unfold lazyDeltaReductionStepAfterActive by_cases hleftOnly : leftDelta && !rightDelta - · simp only [hleftOnly, if_true] + · simp only [hleftOnly, ite_true] refine bind_preservesInferOnly (tryUnfoldProjApp_preservesInferOnly hnoDelta right) ?_ intro projectionResult @@ -219,9 +219,9 @@ theorem lazyDeltaReductionStepAfterActive_preservesInferOnly | none => exact lazyDeltaReductionStepWithLeftDelta_preservesInferOnly hmethods hcore left right - · simp only [hleftOnly, Bool.false_eq_true, if_false] + · simp only [hleftOnly, Bool.false_eq_true, ite_false] by_cases hrightOnly : !leftDelta && rightDelta - · simp only [hrightOnly, if_true] + · simp only [hrightOnly, ite_true] refine bind_preservesInferOnly (tryUnfoldProjApp_preservesInferOnly hnoDelta left) ?_ intro projectionResult @@ -232,7 +232,7 @@ theorem lazyDeltaReductionStepAfterActive_preservesInferOnly | none => exact lazyDeltaReductionStepWithRightDelta_preservesInferOnly hmethods hcore left right - · simp only [hrightOnly, Bool.false_eq_true, if_false] + · simp only [hrightOnly, Bool.false_eq_true, ite_false] exact lazyDeltaReductionStepWithBothDelta_preservesInferOnly hmethods hcore left right leftHead rightHead @@ -433,7 +433,7 @@ theorem tryDefEqApp_preservesInferOnly (rightFunction.app rightArgument rightInfo).collectSpine with ⟨rightHead, rightArguments⟩ simp only [tryDefEqApp, hleft, hright, Bool.not_true, - Bool.false_or, Bool.false_eq_true, if_false, pure_bind] + Bool.false_or, Bool.false_eq_true, ite_false, pure_bind] split · exact TcM.PreservesInferOnly.pure false · refine bind_preservesInferOnly @@ -442,7 +442,7 @@ theorem tryDefEqApp_preservesInferOnly cases headsEqual with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact allDefEqSpineArgs_preservesInferOnly hmethods (leftArguments.zip rightArguments) | var | fvar | sort | const | lam | all | letE | prj | nat | str => diff --git a/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean b/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean index 6681c55fb..a4b100f79 100644 --- a/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean +++ b/Ix/Tc/Verify/Check/DefEqPropositionPolicy.lean @@ -79,7 +79,7 @@ theorem tryProofIrrel_preservesInferOnly cases isProposition with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryQuestion_preservesInferOnly (inferOnlyCall_preservesInferOnly hmethods right)) ?_ @@ -148,7 +148,7 @@ theorem tryDefEqUnit_preservesInferOnly cases isUnitLike with | false => exact TcM.PreservesInferOnly.pure false | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryQuestion_preservesInferOnly diff --git a/Ix/Tc/Verify/Check/FullInferenceApplications.lean b/Ix/Tc/Verify/Check/FullInferenceApplications.lean index ec85c364c..b6d97f089 100644 --- a/Ix/Tc/Verify/Check/FullInferenceApplications.lean +++ b/Ix/Tc/Verify/Check/FullInferenceApplications.lean @@ -376,7 +376,7 @@ theorem inferUncached_app_full_wf obtain ⟨hfunSupport, hargSupport, hsubst⟩ := hcensus hsourceSupport unfold inferUncached - simp only [Bool.not_false, if_true, ReaderT.run_bind, + simp only [Bool.not_false, ite_true, ReaderT.run_bind, ReaderT.run_monadLift, pure_bind] apply TcM.WF.bind (callbacks.infer hpolicy hfunSupport hfunPre) @@ -402,7 +402,7 @@ theorem inferUncached_app_full_wf rcases heager with ⟨rfl, hpolicyEager⟩ cases eager with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply TcM.WF.bind (callbacks.isDefEq hpolicyEager haTySupport hdomSupport haTyCoreTr hdomTr) @@ -410,7 +410,7 @@ theorem inferUncached_app_full_wf rcases hequal with ⟨hpolicyEq, heq⟩ cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact throwApplicationMismatch_full_wf (α := KExpr .anon) (aTy := aTy) (dom := dom) (rest := liftM (TcM.runIntern (subst cod a 0))) @@ -420,12 +420,12 @@ theorem inferUncached_app_full_wf (.app f a info) (.app fV aV) result) hmethods hpolicyEq | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact finishFullApplication_wf hrun theory hpolicyEq hfunTr hargTr hfTy hview haTy haTyEq (heq rfl) hcodTr (hsubst hcodSupport) | true => - simp only [if_true, ReaderT.run_bind] + simp only [ite_true, ReaderT.run_bind] apply TcM.WF.bind (setEagerReduce_full_wf true hpolicyEager) intro _ afterSet hpolicySet @@ -439,7 +439,7 @@ theorem inferUncached_app_full_wf intro _ afterReset hpolicyReset cases equal with | false => - simp only [Bool.not_false, if_true, ReaderT.run_bind, + simp only [Bool.not_false, ite_true, ReaderT.run_bind, ReaderT.run_monadLift] exact throwApplicationMismatch_full_wf (α := KExpr .anon) (aTy := aTy) (dom := dom) @@ -450,7 +450,7 @@ theorem inferUncached_app_full_wf (.app f a info) (.app fV aV) result) hmethods hpolicyReset | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact finishFullApplication_wf hrun theory hpolicyReset hfunTr hargTr hfTy hview haTy haTyEq (heq rfl) hcodTr (hsubst hcodSupport) diff --git a/Ix/Tc/Verify/Check/FullInferenceBinders.lean b/Ix/Tc/Verify/Check/FullInferenceBinders.lean index fcb7b9a07..3918e2493 100644 --- a/Ix/Tc/Verify/Check/FullInferenceBinders.lean +++ b/Ix/Tc/Verify/Check/FullInferenceBinders.lean @@ -177,7 +177,7 @@ theorem inferUncached_lam_full_wf | lam htyPre hbodyPre => rename_i tyV bodyV unfold inferUncached - simp only [Bool.not_false, if_true, ReaderT.run_bind, + simp only [Bool.not_false, ite_true, ReaderT.run_bind, ReaderT.run_monadLift, inferCall, pure_bind] apply TcM.WF.bind (TcM.WF.withInv <| callbacks.infer hpolicy htySupport htyPre) @@ -575,7 +575,7 @@ theorem inferUncached_let_full_wf | letE htypePre hvaluePre hbodyPre => rename_i typeV valueV unfold inferUncached - simp only [Bool.not_false, if_true, ReaderT.run_bind, + simp only [Bool.not_false, ite_true, ReaderT.run_bind, ReaderT.run_monadLift, inferCall, isDefEqCall, pure_bind] apply TcM.WF.bind (TcM.WF.withInv <| callbacks.infer hpolicy htypeSupport htypePre) @@ -603,10 +603,10 @@ theorem inferUncached_let_full_wf rcases hequal with ⟨hIEq, hpolicyEq, heq⟩ cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.WF.throw fun _ => hpolicyEq | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] have hvalueType : world.venv.HasType uvars Delta.toCtx valueV typeV := hvalueTy.defeqU_r world.venvWF hIEq.2.1.wf.toCtx <| diff --git a/Ix/Tc/Verify/Check/FullInferenceCache.lean b/Ix/Tc/Verify/Check/FullInferenceCache.lean index ecb196aa4..9706715dd 100644 --- a/Ix/Tc/Verify/Check/FullInferenceCache.lean +++ b/Ix/Tc/Verify/Check/FullInferenceCache.lean @@ -163,7 +163,7 @@ theorem inferWith_full_wf | none => have hfullMiss : afterRead.env.inferCache[key]? = none := by simpa [fullFound] using hfullFound - simp only [hfullMiss, hpolicy, Bool.false_eq_true, if_false] + simp only [hfullMiss, hpolicy, Bool.false_eq_true, ite_false] exact context.missTail_full_wf hmatch hsourceSupport hsource hpolicyAfterRead diff --git a/Ix/Tc/Verify/Check/InferencePolicy.lean b/Ix/Tc/Verify/Check/InferencePolicy.lean index e4cde5e74..834777c42 100644 --- a/Ix/Tc/Verify/Check/InferencePolicy.lean +++ b/Ix/Tc/Verify/Check/InferencePolicy.lean @@ -369,9 +369,9 @@ theorem freshFVarId : intro before by_cases hroom : before.env.nextFVarId.toNat + 1 < UInt64.size · rw [TcM.freshFVarId] - simp only [if_pos hroom] + simp only [ite_eq_left hroom] · rw [TcM.freshFVarId] - simp only [if_neg hroom] + simp only [ite_eq_right hroom] /-- Binder opening changes the fvar counter, intern table, and local-context stack, but never the inference policy. -/ @@ -513,10 +513,10 @@ theorem inferWith_preservesInferOnly · exact TcM.PreservesInferOnly.pure _ · cases hpolicy : before.inferOnly with | false => - simpa only [Bool.false_eq_true, if_false, pure_bind] using + simpa only [Bool.false_eq_true, ite_false, pure_bind] using inferMissTail_preservesInferOnly methods huncached false source key | true => - simp only [if_true, pure_bind, ReaderT.run_bind] + simp only [ite_true, pure_bind, ReaderT.run_bind] apply TcM.PreservesInferOnly.bind TcM.PreservesInferOnly.get intro afterFullMiss split diff --git a/Ix/Tc/Verify/Check/MemberEvidence.lean b/Ix/Tc/Verify/Check/MemberEvidence.lean index b3e45b2ab..ff425755f 100644 --- a/Ix/Tc/Verify/Check/MemberEvidence.lean +++ b/Ix/Tc/Verify/Check/MemberEvidence.lean @@ -119,7 +119,7 @@ theorem checkConstMember_axiom_sound have hframe := validateConstWellScoped_frame hresources methods (hfault.withInferOnly false) state ⟨hI, hpolicy⟩ unfold checkConstMember at hrun - simp only [Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind, pure_bind] at hrun cases hvalidation : (validateConstWellScoped @@ -197,7 +197,7 @@ theorem checkConstMember_defn_sound have hframe := validateConstWellScoped_frame hresources methods (hfault.withInferOnly false) state ⟨hI, hpolicy⟩ unfold checkConstMember at hrun - simp only [Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind, pure_bind] at hrun cases hvalidation : (validateConstWellScoped @@ -248,9 +248,9 @@ theorem checkConstMember_defn_sound have htypeTr := htypePost.2.2.1 have htypeEvidence := htypePost.2.2.2 by_cases htheorem : kind == .thm && !univEq level .mkZero - · simp only [htheorem, if_true] at hrun + · simp only [htheorem, ite_true] at hrun contradiction - · simp only [htheorem, Bool.false_eq_true, if_false, + · simp only [htheorem, Bool.false_eq_true, ite_false, ReaderT.run_bind] at hrun cases hinferValue : (infer value).run methods afterType with | error err failed => @@ -267,7 +267,7 @@ theorem checkConstMember_defn_sound simp only [hanswer] at hrun cases answer with | false => - simp only [Bool.not_false, if_true] at hrun + simp only [Bool.not_false, ite_true] at hrun contradiction | true => have hvaluePipeline : @@ -286,8 +286,8 @@ theorem checkConstMember_defn_sound have hvalueEvidence := hvaluePost.2 by_cases hsafety : safety != .unsaf · simp only [Bool.not_true, Bool.false_eq_true, - if_false] at hrun - simp only [hsafety, if_true, + ite_false] at hrun + simp only [hsafety, ite_true, ReaderT.run_bind] at hrun cases htypeSafety : (checkNoUnsafeRefs type safety).run methods @@ -326,7 +326,7 @@ theorem checkConstMember_defn_sound by simpa [huvars] using htypeEvidence, by simpa [huvars] using hvalueEvidence⟩ · simp only [Bool.not_true, Bool.false_eq_true, - if_false] at hrun + ite_false] at hrun simp only [hsafety] at hrun cases hrun exact ⟨hIDefEq, @@ -412,7 +412,7 @@ theorem checkConstMember_validation_success cases hresources with | @«axiom» name levelParams isUnsafe levels type hcoverage hsize => unfold checkConstMember at hrun - simp only [Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind, pure_bind] at hrun cases hvalidation : (validateConstWellScoped @@ -426,7 +426,7 @@ theorem checkConstMember_validation_success | @defn name levelParams kind safety hints levels type value leanAll block htypeCoverage htypeSize hvalueCoverage hvalueSize => unfold checkConstMember at hrun - simp only [Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind, pure_bind] at hrun cases hvalidation : (validateConstWellScoped diff --git a/Ix/Tc/Verify/Check/NatAcceptance.lean b/Ix/Tc/Verify/Check/NatAcceptance.lean index becb4322b..e93c14598 100644 --- a/Ix/Tc/Verify/Check/NatAcceptance.lean +++ b/Ix/Tc/Verify/Check/NatAcceptance.lean @@ -264,7 +264,7 @@ theorem reset_validation : .ok () resetState := by unfold RecM.validateExprWellScoped rw [RecM.validateExprWellScoped.go.eq_def] - simp only [Std.HashSet.contains_empty, Bool.false_eq_true, if_false, + simp only [Std.HashSet.contains_empty, Bool.false_eq_true, ite_false, natRef] rw [ReaderT.run_bind] change EStateM.bind (TcM.getConst natId) _ resetState = _ @@ -302,7 +302,7 @@ theorem reset_member : (RecM.checkConstMember goodId goodConcrete).run methodsOut resetState = .ok () resetState := by unfold RecM.checkConstMember - simp only [goodConcrete, Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [goodConcrete, Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind] change EStateM.bind ((RecM.validateConstWellScoped goodConcrete).run methodsOut) _ @@ -425,7 +425,7 @@ theorem reset_bad_validation : .error (.univParamOutOfRange 0 0) resetState := by unfold RecM.validateExprWellScoped rw [RecM.validateExprWellScoped.go.eq_def] - simp only [Std.HashSet.contains_empty, Bool.false_eq_true, if_false, + simp only [Std.HashSet.contains_empty, Bool.false_eq_true, ite_false, IllTypedPending.badType] rw [ReaderT.run_bind] change EStateM.bind @@ -450,7 +450,7 @@ theorem reset_bad_member : .error (.univParamOutOfRange 0 0) resetState := by unfold RecM.checkConstMember simp only [IllTypedPending.concrete, Mode.F.hasDups, - Bool.false_eq_true, if_false, ReaderT.run_bind] + Bool.false_eq_true, ite_false, ReaderT.run_bind] change EStateM.bind ((RecM.validateConstWellScoped IllTypedPending.concrete).run methodsOut) _ resetState = _ diff --git a/Ix/Tc/Verify/Check/PreTranslationOpening.lean b/Ix/Tc/Verify/Check/PreTranslationOpening.lean index 48f402999..08ba7b064 100644 --- a/Ix/Tc/Verify/Check/PreTranslationOpening.lean +++ b/Ix/Tc/Verify/Check/PreTranslationOpening.lean @@ -48,7 +48,7 @@ theorem PreTrKExprS.openFVar UInt64.lt_iff_toNat_lt.mpr (by rw [hsuccNat]; omega) have hwindow : ((depth ≥ depth && depth < depth + 1) = true) := by simp [hlt] - rw [if_pos hwindow] + rw [ite_eq_left hwindow] simp exact .fvar (W.find?_hit (by simpa [hdepth] using hfind)) · by_cases hgt : depth < i @@ -63,7 +63,7 @@ theorem PreTrKExprS.openFVar omega have hwindow : ¬((i ≥ depth && i < depth + 1) = true) := by simp [hnltSucc] - rw [if_neg hwindow, if_pos hgeSucc, KExpr.mkVar_shape] + rw [ite_eq_right hwindow, ite_eq_left hgeSucc, KExpr.mkVar_shape] refine .var (type := A) ?_ have hOneLe : (1 : UInt64) ≤ i := UInt64.le_iff_toNat_le.mpr (by @@ -93,7 +93,7 @@ theorem PreTrKExprS.openFVar omega)) have hwindow : ¬((i ≥ depth && i < depth + 1) = true) := by simp [hnge] - rw [if_neg hwindow, if_neg hngeSucc] + rw [ite_eq_right hwindow, ite_eq_right hngeSucc] exact .var (W.find?_lt hlt hfind) | @fvar source fv name info e A hfind => intro fvData decl target dk depth fvName W hdepth hfresh hbig diff --git a/Ix/Tc/Verify/Check/ProjectionInferencePolicy.lean b/Ix/Tc/Verify/Check/ProjectionInferencePolicy.lean index 268104ae8..661a578c9 100644 --- a/Ix/Tc/Verify/Check/ProjectionInferencePolicy.lean +++ b/Ix/Tc/Verify/Check/ProjectionInferencePolicy.lean @@ -150,7 +150,7 @@ theorem inferProjFieldStep_preservesInferOnly · cases isPropStruct with | false => exact TcM.PreservesInferOnly.pure (ForInStep.done dom) | true => - simp only [if_true, ReaderT.run_bind, inferCall] + simp only [ite_true, ReaderT.run_bind, inferCall] apply TcM.PreservesInferOnly.bind (hmethods.infer dom) intro fieldSortTy apply TcM.PreservesInferOnly.bind @@ -163,7 +163,7 @@ theorem inferProjFieldStep_preservesInferOnly | false => exact inferProjFieldTail_preservesInferOnly structId i val body | true => - simp only [if_true, ReaderT.run_bind, pure_bind, + simp only [ite_true, ReaderT.run_bind, pure_bind, inferCall] apply TcM.PreservesInferOnly.bind (hmethods.infer dom) intro fieldSortTy diff --git a/Ix/Tc/Verify/Check/ScopedActiveBlock.lean b/Ix/Tc/Verify/Check/ScopedActiveBlock.lean index 082219fde..a0fccee48 100644 --- a/Ix/Tc/Verify/Check/ScopedActiveBlock.lean +++ b/Ix/Tc/Verify/Check/ScopedActiveBlock.lean @@ -289,7 +289,7 @@ theorem isDefEq_eq_activeScoped_wf (fun _ => rfl) (fun _ => rfl) (fun _ => by constructor <;> rfl) afterTrace · intro _ _ _ - simp only [beq_self_eq_true, if_true] + simp only [beq_self_eq_true, ite_true] apply TcM.WF.pure intro hI answerTrue apply DefEqMeaning.of_translations theory hI.context.wf diff --git a/Ix/Tc/Verify/Check/ScopedBoundedPipelines.lean b/Ix/Tc/Verify/Check/ScopedBoundedPipelines.lean index ffdb5cf89..a536e25aa 100644 --- a/Ix/Tc/Verify/Check/ScopedBoundedPipelines.lean +++ b/Ix/Tc/Verify/Check/ScopedBoundedPipelines.lean @@ -393,7 +393,7 @@ theorem checkValuePipeline_scoped_sound intro answer _ heq cases answer with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.WF.throw fun _ => trivial | true => simp only [Bool.not_true, Bool.false_eq] diff --git a/Ix/Tc/Verify/Check/ScopedMemberEvidence.lean b/Ix/Tc/Verify/Check/ScopedMemberEvidence.lean index d30735c47..58134a6b0 100644 --- a/Ix/Tc/Verify/Check/ScopedMemberEvidence.lean +++ b/Ix/Tc/Verify/Check/ScopedMemberEvidence.lean @@ -104,7 +104,7 @@ theorem checkConstMember_axiom_scoped_sound have hframe := validateConstWellScoped_frame hresources methods (hfault.withInferOnly false) state ⟨hI, hpolicy⟩ unfold checkConstMember at hrun - simp only [Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind, pure_bind] at hrun cases hvalidation : (validateConstWellScoped @@ -173,7 +173,7 @@ theorem checkConstMember_defn_scoped_sound have hframe := validateConstWellScoped_frame hresources methods (hfault.withInferOnly false) state ⟨hI, hpolicy⟩ unfold checkConstMember at hrun - simp only [Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind, pure_bind] at hrun cases hvalidation : (validateConstWellScoped @@ -224,9 +224,9 @@ theorem checkConstMember_defn_scoped_sound have htypeTr := htypePost.2.2.1 have htypeEvidence := htypePost.2.2.2 by_cases htheorem : kind == .thm && !univEq level .mkZero - · simp only [htheorem, if_true] at hrun + · simp only [htheorem, ite_true] at hrun contradiction - · simp only [htheorem, Bool.false_eq_true, if_false, + · simp only [htheorem, Bool.false_eq_true, ite_false, ReaderT.run_bind] at hrun cases hinferValue : (infer value).run methods afterType with | error err failed => @@ -243,7 +243,7 @@ theorem checkConstMember_defn_scoped_sound simp only [hanswer] at hrun cases answer with | false => - simp only [Bool.not_false, if_true] at hrun + simp only [Bool.not_false, ite_true] at hrun contradiction | true => have hvaluePipeline : @@ -262,8 +262,8 @@ theorem checkConstMember_defn_scoped_sound have hvalueEvidence := hvaluePost.2 by_cases hsafety : safety != .unsaf · simp only [Bool.not_true, Bool.false_eq_true, - if_false] at hrun - simp only [hsafety, if_true, + ite_false] at hrun + simp only [hsafety, ite_true, ReaderT.run_bind] at hrun cases htypeSafety : (checkNoUnsafeRefs type safety).run methods @@ -301,7 +301,7 @@ theorem checkConstMember_defn_scoped_sound by simpa [huvars] using htypeEvidence, by simpa [huvars] using hvalueEvidence⟩ · simp only [Bool.not_true, Bool.false_eq_true, - if_false] at hrun + ite_false] at hrun simp only [hsafety] at hrun cases hrun exact ⟨hIDefEq, diff --git a/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean b/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean index bbc0a1d44..0cf2d395c 100644 --- a/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean +++ b/Ix/Tc/Verify/Check/ScopedPositiveFuelAxiom.lean @@ -236,7 +236,7 @@ theorem validation_execution : .ok () initialState := by unfold RecM.validateExprWellScoped rw [RecM.validateExprWellScoped.go.eq_def] - simp only [Std.HashSet.contains_empty, Bool.false_eq_true, if_false] + simp only [Std.HashSet.contains_empty, Bool.false_eq_true, ite_false] have hsource : source = .sort sourceUniv source.info := by rfl rw [hsource] rw [ReaderT.run_bind] @@ -250,7 +250,7 @@ theorem validation_execution : .ok seen initialState := by unfold sourceUniv KUniv.mkZero RecM.validateUnivParamsSeen rw [RecM.validateUnivParamsSeen.go.eq_def] - simp only [Std.HashSet.contains_empty, Bool.false_eq_true, if_false] + simp only [Std.HashSet.contains_empty, Bool.false_eq_true, ite_false] rw [RecM.validateUnivParamsSeen.go.eq_def] rfl unfold EStateM.bind @@ -345,7 +345,7 @@ theorem member_execution (separation : AddressSeparation) : (RecM.checkConstMember targetId concreteAxiom).run methods initialState = .ok () after := by unfold RecM.checkConstMember - simp only [concreteAxiom, Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [concreteAxiom, Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind] change EStateM.bind ((RecM.validateConstWellScoped concreteAxiom).run methods) _ diff --git a/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean b/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean index b9060b27e..7aa20e3b2 100644 --- a/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean +++ b/Ix/Tc/Verify/Check/ScopedPositiveFuelCertificate.lean @@ -61,7 +61,7 @@ theorem validation_function : .ok () state := by unfold RecM.validateExprWellScoped rw [RecM.validateExprWellScoped.go.eq_def] - simp only [Std.HashSet.contains_empty, Bool.false_eq_true, if_false] + simp only [Std.HashSet.contains_empty, Bool.false_eq_true, ite_false] have hsource : source = .sort sourceUniv source.info := by rfl rw [hsource] rw [ReaderT.run_bind] @@ -74,7 +74,7 @@ theorem validation_function : .ok seen state := by unfold sourceUniv KUniv.mkZero RecM.validateUnivParamsSeen rw [RecM.validateUnivParamsSeen.go.eq_def] - simp only [Std.HashSet.contains_empty, Bool.false_eq_true, if_false] + simp only [Std.HashSet.contains_empty, Bool.false_eq_true, ite_false] rw [RecM.validateUnivParamsSeen.go.eq_def] rfl unfold EStateM.bind @@ -113,7 +113,7 @@ theorem cacheInferResult_requests (state : TcState .anon) ((RecM.cacheInferResult false inferKey inferred).run methods) state [] := by unfold RecM.cacheInferResult - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact ExecutionRequests.modify state _ rfl theorem inferUncached_function : @@ -150,7 +150,7 @@ theorem inference_requests : simp only have hinferOnly : initialState.inferOnly = false := by rfl rw [hinferOnly] - simp only [Bool.false_eq_true, if_false, ReaderT.run_pure, pure_bind, + simp only [Bool.false_eq_true, ite_false, ReaderT.run_pure, pure_bind, ReaderT.run_bind] apply ExecutionRequests.bind (inferUncached_requests initialState) intro inferred after _hinfer @@ -177,7 +177,7 @@ theorem member_requests (separation : AddressSeparation) : initialState [.internExpr result] := by obtain ⟨afterInfer, hinfer⟩ := inference_run separation unfold RecM.checkConstMember - simp only [concreteAxiom, Mode.F.hasDups, Bool.false_eq_true, if_false, + simp only [concreteAxiom, Mode.F.hasDups, Bool.false_eq_true, ite_false, ReaderT.run_bind] apply ExecutionRequests.bind validation_requests intro _ afterValidation hvalidation diff --git a/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean b/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean index 047063dab..5b372efa8 100644 --- a/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean +++ b/Ix/Tc/Verify/Check/UncachedInferencePolicy.lean @@ -82,12 +82,12 @@ theorem inferUncached_preservesInferOnly intro isEager cases isEager with | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] apply TcM.PreservesInferOnly.bind (hmethods.isDefEq aTy dom) intro equal cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply TcM.PreservesInferOnly.bind TcM.PreservesInferOnly.get intro state @@ -97,7 +97,7 @@ theorem inferUncached_preservesInferOnly simp only [Bool.not_true] exact TcM.PreservesInferOnly.runIntern (subst cod a 0) | true => - simp only [if_true] + simp only [ite_true] show ((do modify fun state : TcState .anon => { state with eagerReduce := true } @@ -124,7 +124,7 @@ theorem inferUncached_preservesInferOnly intro _ cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply TcM.PreservesInferOnly.bind TcM.PreservesInferOnly.get intro state @@ -157,7 +157,7 @@ theorem inferUncached_preservesInferOnly exact TcM.PreservesInferOnly.runIntern (internExprM (.mkAll anonN anonBi ty abstracted)) | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply TcM.PreservesInferOnly.bind (hmethods.infer ty) intro tyTy apply TcM.PreservesInferOnly.bind @@ -226,7 +226,7 @@ theorem inferUncached_preservesInferOnly exact TcM.PreservesInferOnly.runIntern (cheapBetaReduce substituted) | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply TcM.PreservesInferOnly.bind (hmethods.infer ty) intro tyTy apply TcM.PreservesInferOnly.bind @@ -238,7 +238,7 @@ theorem inferUncached_preservesInferOnly intro equal cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.PreservesInferOnly.throw (alpha := KExpr .anon) .declTypeMismatch | true => diff --git a/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean b/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean index 75c10e05c..d9bc6d546 100644 --- a/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfBasicHelperPolicy.lean @@ -301,7 +301,7 @@ theorem tryReduceStringLiteral_preservesInferOnly unfold tryReduceStringLiteral cases hutf8 : id.addr == p.stringUtf8ByteSize.addr with | true => - simp only [if_true] + simp only [ite_true] change (TcM.runIntern (internExprM (natExprFromValue value.utf8ByteSize : KExpr .anon)) >>= fun result => @@ -313,13 +313,13 @@ theorem tryReduceStringLiteral_preservesInferOnly intro result exact TcM.PreservesInferOnly.pure (some result) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] cases hbytes : id.addr == p.stringToByteArray.addr with | true => - simp only [if_true] + simp only [ite_true] cases hempty : value.isEmpty with | true => - simp only [if_true] + simp only [ite_true] change (TcM.runIntern (internExprM (KExpr.mkConst p.byteArrayEmpty #[])) >>= fun result => pure (some result)).PreservesInferOnly @@ -329,10 +329,10 @@ theorem tryReduceStringLiteral_preservesInferOnly intro result exact TcM.PreservesInferOnly.pure (some result) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact charOfNatExpr_preservesInferOnly (methods := methods) _ theorem tryReduceString_preservesInferOnly @@ -342,10 +342,10 @@ theorem tryReduceString_preservesInferOnly rcases hspine : source.collectSpine with ⟨head, args⟩ cases hsize : args.size != 1 with | true => - simp only [hsize, if_true] + simp only [hsize, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hsize, Bool.false_eq_true, if_false] + simp only [hsize, Bool.false_eq_true, ite_false] cases head with | const id levels info => simp only [pure_bind, ReaderT.run_bind] @@ -358,10 +358,10 @@ theorem tryReduceString_preservesInferOnly !(id.addr == p.stringUtf8ByteSize.addr) && !(id.addr == p.stringToByteArray.addr)) with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases args[0]! with | str value blob info => exact tryReduceStringLiteral_preservesInferOnly @@ -389,16 +389,16 @@ theorem tryQuotReduceSelected_preservesInferOnly | const id levels info => cases hctor : id.addr != p.quotCtor.addr with | true => - simp only [hctor, if_true] + simp only [hctor, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hctor, Bool.false_eq_true, if_false] + simp only [hctor, Bool.false_eq_true, ite_false] cases hsize : majorArgs.size != 3 with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind, + simp only [Bool.false_eq_true, ite_false, pure_bind, ReaderT.run_bind, ReaderT.run_monadLift] apply TcM.PreservesInferOnly.bind (TcM.PreservesInferOnly.runIntern @@ -428,26 +428,26 @@ theorem tryQuotReduce_preservesInferOnly intro p cases hlift : id.addr == p.quotLift.addr with | true => - simp only [if_true] + simp only [ite_true] by_cases hsize : args.size < 6 - · simp only [hsize, if_pos] + · simp only [hsize, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hsize, if_false] + · simp only [hsize, ite_false] exact tryQuotReduceSelected_preservesInferOnly hmethods p args 3 5 | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hind : id.addr == p.quotInd.addr with | true => - simp only [if_true] + simp only [ite_true] by_cases hsize : args.size < 5 - · simp only [hsize, if_pos] + · simp only [hsize, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hsize, if_false] + · simp only [hsize, ite_false] exact tryQuotReduceSelected_preservesInferOnly hmethods p args 3 4 | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none | var | fvar | sort | app | lam | all | letE | prj | nat | str => simp only diff --git a/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean b/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean index c161a1354..a8cf7c109 100644 --- a/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfBitVecPolicy.lean @@ -41,10 +41,10 @@ theorem boolLitValue_preservesInferOnly simp only [] cases htrue : id.addr == p.boolTrue.addr with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure (some true) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] split <;> exact TcM.PreservesInferOnly.pure _ | var | fvar | sort | app | lam | all | letE | prj | nat | str => exact TcM.PreservesInferOnly.pure none @@ -160,10 +160,10 @@ theorem tryEvalNatValueForPredFuel_preservesInferOnly intro isStuck cases hstuck : isStuck with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rcases hspine : source.collectSpine with ⟨head, args⟩ cases head with | const id levels info => @@ -171,7 +171,7 @@ theorem tryEvalNatValueForPredFuel_preservesInferOnly cases hsucc : id.addr == p.natSucc.addr && args.size == 1 with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (tryEvalNatValueForPredFuel_preservesInferOnly hmethods fuel args[0]!) ?_ @@ -181,11 +181,11 @@ theorem tryEvalNatValueForPredFuel_preservesInferOnly | some pred => exact TcM.PreservesInferOnly.pure (some (pred + 1)) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hpred : id.addr == p.natPred.addr && args.size == 1 with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (tryEvalNatValueForPredFuel_preservesInferOnly hmethods fuel args[0]!) ?_ @@ -196,13 +196,13 @@ theorem tryEvalNatValueForPredFuel_preservesInferOnly exact TcM.PreservesInferOnly.pure (some (value - 1)) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (isNatBinArithAddr_preservesInferOnly id.addr) ?_ intro isArith cases hbinary : isArith && args.size == 2 with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (tryEvalNatValueForPredFuel_preservesInferOnly hmethods fuel args[0]!) ?_ @@ -224,7 +224,7 @@ theorem tryEvalNatValueForPredFuel_preservesInferOnly (computeNatBin id.addr PrimAddrs.canonical left right) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact tryEvalNatValueForPredFallback_preservesInferOnly hmethods @@ -272,10 +272,10 @@ theorem tryReduceBitvecToNat_preservesInferOnly simp only [] cases hzero : natValue == 0 with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure _ | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryEvalNatValueForPred_preservesInferOnly hmethods width) ?_ intro widthResult @@ -283,7 +283,7 @@ theorem tryReduceBitvecToNat_preservesInferOnly | none => exact TcM.PreservesInferOnly.pure none | some widthValue => by_cases hlarge : widthValue > (1 <<< 24) - · simp only [hlarge, if_pos] + · simp only [hlarge, ite_eq_left] exact TcM.PreservesInferOnly.pure none · simp only [hlarge] exact TcM.PreservesInferOnly.pure _ @@ -362,13 +362,13 @@ theorem tryReduceBitvecUlt_preservesInferOnly simp only [] cases hzero : rightValue == 0 with | true => - simp only [if_true] + simp only [ite_true] refine bindIntern_preservesInferOnly (.mkConst p.boolFalse #[]) ?_ intro result exact TcM.PreservesInferOnly.pure (some result) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (whnfRec_preservesInferOnly hmethods leftNat) ?_ intro leftNormalized @@ -422,10 +422,10 @@ theorem tryReduceBitvec_preservesInferOnly intro state cases hnoAccel : state.noAccel with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (prims_preservesInferOnly methods) ?_ intro p rcases hspine : source.collectSpine with ⟨head, args⟩ @@ -435,7 +435,7 @@ theorem tryReduceBitvec_preservesInferOnly cases htoNat : id.addr == p.bitVecToNat.addr && decide (args.size ≥ 2) with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (tryReduceBitvecToNat_preservesInferOnly hmethods args[1]!) ?_ intro direct @@ -447,11 +447,11 @@ theorem tryReduceBitvec_preservesInferOnly intro finished exact TcM.PreservesInferOnly.pure (some finished) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hult : id.addr == p.bitVecUlt.addr && decide (args.size ≥ 3) with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (tryReduceBitvecUlt_preservesInferOnly hmethods args[0]! args[1]! args[2]!) ?_ @@ -464,12 +464,12 @@ theorem tryReduceBitvec_preservesInferOnly intro finished exact TcM.PreservesInferOnly.pure (some finished) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hdecide : id.addr == p.decidableDecide.addr && decide (args.size ≥ 2) with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (tryReduceBitvecLtProp_preservesInferOnly hmethods args[0]!) ?_ @@ -482,7 +482,7 @@ theorem tryReduceBitvec_preservesInferOnly intro finished exact TcM.PreservesInferOnly.pure (some finished) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none | var | fvar | sort | app | lam | all | letE | prj | nat | str => exact TcM.PreservesInferOnly.pure none diff --git a/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean b/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean index c3a07dc68..abde5bd06 100644 --- a/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfDecidablePolicy.lean @@ -29,7 +29,7 @@ theorem internIntLit_preservesInferOnly refine bind_preservesInferOnly (prims_preservesInferOnly methods) ?_ intro p by_cases hnegative : value < 0 - · simp only [hnegative, if_pos] + · simp only [hnegative, ite_eq_left] refine bindIntern_preservesInferOnly (natExprFromValue ((-value).toNat - 1) : KExpr .anon) ?_ intro natExpr @@ -52,9 +52,9 @@ theorem tryNormalizeIntDecidable_preservesInferOnly ((tryNormalizeIntDecidable addr args).run methods).PreservesInferOnly := by unfold tryNormalizeIntDecidable by_cases hsmall : args.size < 2 - · simp only [hsmall, if_pos] + · simp only [hsmall, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hsmall, if_false, pure_bind] + · simp only [hsmall, ite_false, pure_bind] refine bind_preservesInferOnly (whnfRec_preservesInferOnly hmethods args[0]!) ?_ intro leftNormalized @@ -80,10 +80,10 @@ theorem tryNormalizeIntDecidable_preservesInferOnly cases hsame : left.addr == args[0]!.addr && right.addr == args[1]!.addr with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] let headId := if addr == p.intDecEq.addr then p.intDecEq else if addr == p.intDecLe.addr then p.intDecLe else p.intDecLt @@ -207,7 +207,7 @@ private theorem finishNatDecidable_preservesInferOnly RecM .anon (Option (KExpr .anon))).run methods).PreservesInferOnly := by cases hb : bResult with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (buildNatDecidableTrue_preservesInferOnly p prop args proofTrueFn u1) ?_ intro resultExpr @@ -216,10 +216,10 @@ private theorem finishNatDecidable_preservesInferOnly intro finished exact TcM.PreservesInferOnly.pure (some finished) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases heq : isDecEq with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (buildNatDecidableFalse_preservesInferOnly p prop args proofFalseFn u1) ?_ @@ -229,7 +229,7 @@ private theorem finishNatDecidable_preservesInferOnly intro finished exact TcM.PreservesInferOnly.pure (some finished) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none theorem tryReduceDecidable_preservesInferOnly @@ -241,10 +241,10 @@ theorem tryReduceDecidable_preservesInferOnly intro state cases hnoAccel : state.noAccel with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rcases hspine : source.collectSpine with ⟨head, args⟩ cases head with | const id levels info => @@ -257,21 +257,21 @@ theorem tryReduceDecidable_preservesInferOnly cases hint : id.addr == p.intDecLe.addr || id.addr == p.intDecEq.addr || id.addr == p.intDecLt.addr with | true => - simp only [if_true] + simp only [ite_true] exact tryNormalizeIntDecidable_preservesInferOnly hmethods id.addr args | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hknown : !isDecLe && !isDecEq && !isDecLt with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] by_cases hsmall : args.size < 2 - · simp only [hsmall, if_pos] + · simp only [hsmall, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hsmall, if_false] + · simp only [hsmall, ite_false] focus refine bind_preservesInferOnly (whnfRec_preservesInferOnly hmethods args[0]!) ?_ @@ -289,7 +289,7 @@ theorem tryReduceDecidable_preservesInferOnly simp only [] cases hlt : id.addr == p.natDecLt.addr with | true => - simp only [if_true] + simp only [ite_true] refine bindIntern_preservesInferOnly (natExprFromValue (leftValue + 1) : KExpr .anon) ?_ @@ -310,7 +310,7 @@ theorem tryReduceDecidable_preservesInferOnly exact TcM.PreservesInferOnly.pure (some finished) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (tryInferDecidableProp_preservesInferOnly hmethods source) ?_ @@ -325,7 +325,7 @@ theorem tryReduceDecidable_preservesInferOnly cases hle : id.addr == p.natDecLe.addr with | true => - simp only [if_true] + simp only [ite_true] exact finishNatDecidable_preservesInferOnly p prop args @@ -335,7 +335,7 @@ theorem tryReduceDecidable_preservesInferOnly p.natNotLeOfNotBleEqTrue u1 | false => simp only [Bool.false_eq_true, - if_false] + ite_false] exact finishNatDecidable_preservesInferOnly p prop args diff --git a/Ix/Tc/Verify/Check/WhnfDriverPolicy.lean b/Ix/Tc/Verify/Check/WhnfDriverPolicy.lean index a82b59ff0..027b3fc09 100644 --- a/Ix/Tc/Verify/Check/WhnfDriverPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfDriverPolicy.lean @@ -161,7 +161,7 @@ theorem whnfCoreWithFlags_preservesInferOnly intro isLet cases isLet with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.PreservesInferOnly.pure _ | true => simp only [Bool.not_true, pure_bind] @@ -346,7 +346,7 @@ theorem whnfNoDeltaImpl_preservesInferOnly intro isLet cases isLet with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.PreservesInferOnly.pure _ | true => simp only [Bool.not_true, pure_bind] @@ -512,7 +512,7 @@ theorem whnfWithNatSuccMode_preservesInferOnly intro isLet cases isLet with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.PreservesInferOnly.pure _ | true => simp only [Bool.not_true, pure_bind] diff --git a/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean index 5b085de0c..4edf22509 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaBasePolicy.lean @@ -29,10 +29,10 @@ theorem applyIotaArg_preservesInferOnly unfold applyIotaArg cases transient with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact intern_preservesInferOnly (.mkApp result arg) | true => - simp only [if_true] + simp only [ite_true] split <;> exact TcM.PreservesInferOnly.pure _ theorem applyIotaArgs_preservesInferOnly @@ -84,14 +84,14 @@ theorem tryApplyIotaCtor_preservesInferOnly | some rule => simp only [] by_cases hlevels : recUs.size.toUInt64 != recr.lvls - · simp only [hlevels, if_pos] + · simp only [hlevels, ite_eq_left] exact TcM.PreservesInferOnly.pure none · simp only [hlevels] by_cases hfields : ctorFields > ctorArgs.size - · simp only [hfields, if_pos] + · simp only [hfields, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hfields, if_false] - simpa only [Bool.false_eq_true, if_false, pure_bind] using + · simp only [hfields, ite_false] + simpa only [Bool.false_eq_true, ite_false, pure_bind] using (bind_preservesInferOnly (methods := methods) (next := fun result => pure (some result)) @@ -118,7 +118,7 @@ theorem natOffsetFuel_preservesInferOnly intro p cases hsucc : id.addr == p.natSucc.addr && args.size == 1 with | true => - simp only [if_true] + simp only [ite_true] let arg := args[0]! refine bind_preservesInferOnly (natOffsetFuel_preservesInferOnly fuel arg) ?_ @@ -127,13 +127,13 @@ theorem natOffsetFuel_preservesInferOnly (some ((result.getD (arg, 0)).1, (result.getD (arg, 0)).2 + 1)) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] cases hadd : id.addr == p.natAdd.addr && args.size == 2 with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (evalNatOffsetLiteralFuel_preservesInferOnly fuel args[1]!) ?_ intro rhsResult @@ -172,7 +172,7 @@ theorem evalNatOffsetLiteralFuel_preservesInferOnly | const id levels info => cases hpred : id.addr == p.natPred.addr && args.size == 1 with | true => - simp only [hpred, if_true] + simp only [hpred, ite_true] refine bind_preservesInferOnly (evalNatOffsetLiteralFuel_preservesInferOnly fuel args[0]!) ?_ intro result @@ -181,16 +181,16 @@ theorem evalNatOffsetLiteralFuel_preservesInferOnly | some value => exact TcM.PreservesInferOnly.pure (some (value - 1)) | false => - simp only [hpred, Bool.false_eq_true, if_false] + simp only [hpred, Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (isNatBinArithAddr_preservesInferOnly id.addr) ?_ intro isArith cases hbin : isArith && args.size == 2 with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure none | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (evalNatOffsetLiteralFuel_preservesInferOnly fuel args[0]!) ?_ @@ -244,10 +244,10 @@ theorem cleanupNatOffsetMajor_preservesInferOnly intro literalResult cases literalResult with | some value => - simp only [Option.isSome, if_true] + simp only [Option.isSome, ite_true] exact TcM.PreservesInferOnly.pure none | none => - simp only [Option.isSome, Bool.false_eq_true, if_false, pure_bind] + simp only [Option.isSome, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (natOffset_preservesInferOnly source 0) ?_ intro offsetResult @@ -258,20 +258,20 @@ theorem cleanupNatOffsetMajor_preservesInferOnly rcases baseOffset with ⟨base, offset⟩ cases hzero : offset == 0 with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] let predOffset := offset - 1 cases hpredZero : predOffset == 0 with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (mkNatSucc_preservesInferOnly base) ?_ intro result exact TcM.PreservesInferOnly.pure (some result) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (mkNatAdd_preservesInferOnly base (natExprFromValue predOffset)) ?_ diff --git a/Ix/Tc/Verify/Check/WhnfIotaDispatchPolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaDispatchPolicy.lean index 989acfbce..273b5cd20 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaDispatchPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaDispatchPolicy.lean @@ -82,14 +82,14 @@ theorem tryIotaAfterCleanup_preservesInferOnly intro strCtor cases hcheap : flags.cheapRec with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (whnfCoreFlagsRec_preservesInferOnly hmethods strCtor flags) ?_ intro normalized exact tryIotaCtorOrStructEta_preservesInferOnly hmethods recId recr recUs spine normalized majorWasNatLit | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (whnfRec_preservesInferOnly hmethods strCtor) ?_ intro normalized @@ -159,14 +159,14 @@ private theorem tryIotaMajor_preservesInferOnly let normalizedMajor := cleaned.getD major cases hcheap : flags.cheapRec with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (whnfCoreFlagsRec_preservesInferOnly hmethods normalizedMajor flags) ?_ intro majorWhnf0 exact tryIotaAfterMajorWhnf_preservesInferOnly hmethods flags recId recr recUs spine majorWhnf0 | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (whnfRec_preservesInferOnly hmethods normalizedMajor) ?_ intro majorWhnf0 @@ -193,17 +193,17 @@ private theorem tryIotaSelected_preservesInferOnly tryIotaAfterMajorWhnf flags recId recr recUs spine majorWhnf0 : RecM .anon (Option (KExpr .anon))).run methods).PreservesInferOnly := by by_cases hmajor : spine.size ≤ recr.majorIdx - · simp only [hmajor, if_pos] + · simp only [hmajor, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hmajor, if_false, pure_bind] + · simp only [hmajor, ite_false, pure_bind] let major := spine[recr.majorIdx]! cases hk : recr.k with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact tryIotaMajor_preservesInferOnly hmethods flags recId recr recUs spine major | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (synthCtorWhenK_preservesInferOnly hmethods major recId recr recUs) ?_ intro synthesized @@ -239,17 +239,17 @@ theorem tryIotaWithFlags_preservesInferOnly | some recr => simp only [] by_cases hmajor : spine.size ≤ recr.majorIdx - · simp only [hmajor, if_pos] + · simp only [hmajor, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hmajor, if_false, pure_bind] + · simp only [hmajor, ite_false, pure_bind] let major := spine[recr.majorIdx]! cases hk : recr.k with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact tryIotaMajor_preservesInferOnly hmethods flags recId recr recUs spine major | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (synthCtorWhenK_preservesInferOnly hmethods major recId recr recUs) ?_ diff --git a/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean index 15597b74f..7dd1c10ba 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaRecursionPolicy.lean @@ -119,10 +119,10 @@ theorem computeIsRecFieldStepAfterWhnf_preservesInferOnly cases normalized with | all name bi domain body info => by_cases hmentions : exprMentionsAnyAddr domain blockAddrs - · simp only [hmentions, if_pos] + · simp only [hmentions, ite_eq_left] exact TcM.PreservesInferOnly.pure (BoundedStep.done true) · simp only [hmentions] - simpa only [Bool.false_eq_true, if_false, pure_bind] using + simpa only [Bool.false_eq_true, ite_false, pure_bind] using (bindTcM_preservesInferOnly (methods := methods) (next := fun _ => pure (BoundedStep.next body)) @@ -202,12 +202,12 @@ theorem computeIsRec_preservesInferOnly intro found cases found with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure (ForInStep.done (⟨some true, PUnit.unit⟩ : MProd (Option Bool) PUnit)) | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact TcM.PreservesInferOnly.pure (ForInStep.yield (⟨none, PUnit.unit⟩ : MProd (Option Bool) PUnit)) diff --git a/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean b/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean index 120274ae3..974d90391 100644 --- a/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfIotaSynthesisPolicy.lean @@ -29,7 +29,7 @@ theorem isStructLike_preservesInferOnly | indc name levelParams lvls params indices isUnsafe block memberIdx ty ctors leanAll => by_cases hinvalid : indices != 0 || ctors.size != 1 - · simp only [hinvalid, if_pos] + · simp only [hinvalid, ite_eq_left] exact TcM.PreservesInferOnly.pure false · simp only [hinvalid, pure_bind] refine bind_preservesInferOnly @@ -84,7 +84,7 @@ theorem finishStructEtaAfterSort_preservesInferOnly methods).PreservesInferOnly := by unfold finishStructEtaAfterSort by_cases hrejected : structEtaSortRejected majorSortW - · simp only [hrejected, if_pos] + · simp only [hrejected, ite_eq_left] exact TcM.PreservesInferOnly.pure none · simp only [hrejected] let pmmEnd := recr.params + recr.motives + recr.minors @@ -105,7 +105,7 @@ theorem finishStructEtaAfterSort_preservesInferOnly (spine.extract (recr.majorIdx + 1) spine.size)) ?_ intro result exact TcM.PreservesInferOnly.pure (some result) - simpa only [Bool.false_eq_true, if_false, pure_bind] using htail + simpa only [Bool.false_eq_true, ite_false, pure_bind] using htail theorem tryStructEtaAfterInductive_preservesInferOnly {methods : Methods .anon} (hmethods : methods.PreservesInferOnly) @@ -118,7 +118,7 @@ theorem tryStructEtaAfterInductive_preservesInferOnly intro structLike cases structLike with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact TcM.PreservesInferOnly.pure none | true => simp only [Bool.not_true, pure_bind] @@ -159,13 +159,13 @@ theorem tryStructEtaIota_preservesInferOnly methods).PreservesInferOnly := by unfold tryStructEtaIota by_cases hrules : recr.rules.size != 1 - · simp only [hrules, if_pos] + · simp only [hrules, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hrules, Bool.false_eq_true, if_false, pure_bind] + · simp only [hrules, Bool.false_eq_true, ite_false, pure_bind] by_cases hlevels : recUs.size.toUInt64 != recr.lvls - · simp only [hlevels, if_pos] + · simp only [hlevels, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hlevels, Bool.false_eq_true, if_false] + · simp only [hlevels, Bool.false_eq_true, ite_false] let rule := recr.rules[0]! refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.tryGetConst recId) ?_ @@ -235,7 +235,7 @@ theorem verifyKSynthCandidate_preservesInferOnly exact TcM.PreservesInferOnly.pure (KSynthOutcome.synthesized ctorApp) | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.bumpStats (fun state : TcState .anon => { state with @@ -257,9 +257,9 @@ theorem selectKSynthCandidate_preservesInferOnly methods).PreservesInferOnly := by unfold selectKSynthCandidate by_cases hmismatch : tyHeadId.addr != indId.addr - · simp only [hmismatch, if_pos] + · simp only [hmismatch, ite_eq_left] exact TcM.PreservesInferOnly.pure KSynthOutcome.inconclusive - · simp only [hmismatch, Bool.false_eq_true, if_false, pure_bind] + · simp only [hmismatch, Bool.false_eq_true, ite_false, pure_bind] refine bindTcM_preservesInferOnly (TcM.PreservesInferOnly.tryGetConst indId) ?_ intro declaration @@ -292,9 +292,9 @@ theorem synthCtorWhenK_preservesInferOnly methods).PreservesInferOnly := by unfold synthCtorWhenK by_cases hlevels : recUs.size.toUInt64 != recr.lvls - · simp only [hlevels, if_pos] + · simp only [hlevels, ite_eq_left] exact TcM.PreservesInferOnly.pure KSynthOutcome.inconclusive - · simp only [hlevels, Bool.false_eq_true, if_false, pure_bind] + · simp only [hlevels, Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (tryOptional_preservesInferOnly (inferOnlyRec_preservesInferOnly hmethods major)) ?_ diff --git a/Ix/Tc/Verify/Check/WhnfNatArgumentPolicy.lean b/Ix/Tc/Verify/Check/WhnfNatArgumentPolicy.lean index 6727156cd..ffea13fe1 100644 --- a/Ix/Tc/Verify/Check/WhnfNatArgumentPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfNatArgumentPolicy.lean @@ -30,14 +30,14 @@ theorem whnfNatReducerArg_preservesInferOnly intro observed cases hdirect : !arg.hasFVars || observed.eagerReduce with | true => - simp only [if_true] + simp only [ite_true] refine bind_preservesInferOnly (x := whnfRec arg) (whnfRec_preservesInferOnly hmethods arg) ?_ intro reduced exact TcM.PreservesInferOnly.pure (some reduced) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bindTcM_preservesInferOnly TcM.PreservesInferOnly.get ?_ intro (saved : TcState .anon) refine bindTcM_preservesInferOnly @@ -87,10 +87,10 @@ theorem tryNatOffsetStuck_preservesInferOnly intro p cases hhead : !natOffsetStuckHead p source with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rcases hspine : source.collectSpine with ⟨head, args⟩ cases head with | const id levels info => @@ -99,10 +99,10 @@ theorem tryNatOffsetStuck_preservesInferOnly !(id.addr == p.natDiv.addr || id.addr == p.natMod.addr)) || args.size != 2) with | true => - simp only [hshape, if_true] + simp only [hshape, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hshape, Bool.false_eq_true, if_false] + simp only [hshape, Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (x := whnfNatReducerArg args[1]!) (whnfNatReducerArg_preservesInferOnly hmethods args[1]!) ?_ @@ -121,18 +121,18 @@ theorem tryNatOffsetStuck_preservesInferOnly simp only cases hzero : value == 0 with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hone : (id.addr == p.natDiv.addr || id.addr == p.natMod.addr) && value == 1 with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (x := whnfNatReducerArg args[0]!) (whnfNatReducerArg_preservesInferOnly @@ -147,10 +147,10 @@ theorem tryNatOffsetStuck_preservesInferOnly cases hliteral : (extractNatValue left p).isSome with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bindIntern_preservesInferOnly (KExpr.mkApp (.const id levels info) left) ?_ diff --git a/Ix/Tc/Verify/Check/WhnfNatPolicy.lean b/Ix/Tc/Verify/Check/WhnfNatPolicy.lean index 98ec1977c..d76e5ab46 100644 --- a/Ix/Tc/Verify/Check/WhnfNatPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfNatPolicy.lean @@ -149,10 +149,10 @@ theorem tryReduceNatSuccLinearRec_preservesInferOnly intro isSuccStep cases hnot : !isSuccStep with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (whnfRec_preservesInferOnly hmethods base) ?_ intro baseWhnf @@ -252,11 +252,11 @@ theorem tryReduceNatSuccAfterWhnf_preservesInferOnly intro isSucc cases hsucc : isSucc with | true => - simp only [if_true] + simp only [ite_true] exact tryReduceNatSuccPeel_preservesInferOnly normalized args[0]! offset visited | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (recordNatSuccStuck_preservesInferOnly visited) ?_ intro _ @@ -351,20 +351,20 @@ theorem tryReduceNatWithSuccMode_preservesInferOnly intro p cases hsucc : id.addr == p.natSucc.addr && args.size == 1 with | true => - simp only [if_true] + simp only [ite_true] cases hmode : mode == .stuck with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact tryReduceNatSuccIter_preservesInferOnly hmethods args[0]! | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] by_cases hsmall : args.size < 2 - · simp only [hsmall, if_pos] + · simp only [hsmall, ite_eq_left] exact TcM.PreservesInferOnly.pure none - · simp only [hsmall, if_false] + · simp only [hsmall, ite_false] focus refine bind_preservesInferOnly (isNatBinArithAddr_preservesInferOnly id.addr) ?_ @@ -374,17 +374,17 @@ theorem tryReduceNatWithSuccMode_preservesInferOnly intro isPred cases hknown : !isArith && !isPred with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hpred : isPred with | true => - simp only [if_true] + simp only [ite_true] exact tryReduceNatPredicate_preservesInferOnly hmethods id.addr args | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] refine bind_preservesInferOnly (whnfNatReducerArg_preservesInferOnly hmethods args[0]!) ?_ @@ -413,7 +413,7 @@ theorem tryReduceNatWithSuccMode_preservesInferOnly simp only [] cases harith : isArith with | true => - simp only [if_true] + simp only [ite_true] cases hcomputed : computeNatBin id.addr PrimAddrs.canonical leftValue rightValue with @@ -433,7 +433,7 @@ theorem tryReduceNatWithSuccMode_preservesInferOnly (some result) | false => simp only [Bool.false_eq_true, - if_false] + ite_false] refine bindIntern_preservesInferOnly (.mkConst (if (if id.addr == diff --git a/Ix/Tc/Verify/Check/WhnfNativePolicy.lean b/Ix/Tc/Verify/Check/WhnfNativePolicy.lean index 8a15b3e73..d892ffc24 100644 --- a/Ix/Tc/Verify/Check/WhnfNativePolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfNativePolicy.lean @@ -67,7 +67,7 @@ theorem tryReduceNativeMarker_preservesInferOnly | ok result => cases hbool : isReduceBool with | true => - simp only [if_true] + simp only [ite_true] cases hresult : result with | const resultId resultLevels resultInfo => simp only [] @@ -76,7 +76,7 @@ theorem tryReduceNativeMarker_preservesInferOnly str => exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hresult : result <;> exact TcM.PreservesInferOnly.pure _ all_goals exact TcM.PreservesInferOnly.pure none @@ -92,10 +92,10 @@ theorem tryReduceNative_preservesInferOnly intro state cases hnoAccel : state.noAccel with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rcases hspine : source.collectSpine with ⟨head, args⟩ cases head with | const id levels info => @@ -109,10 +109,10 @@ theorem tryReduceNative_preservesInferOnly intro guardState cases hguard : guardState.inNativeReduce with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases harg : arg with | const argId argLevels argInfo => exact tryReduceNativeMarker_preservesInferOnly hmethods diff --git a/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean b/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean index 21b1fb210..9f946b578 100644 --- a/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfProjectionPolicy.lean @@ -120,28 +120,28 @@ theorem tryReduceFinValDecidableRec_preservesInferOnly intro state cases hnoAccel : state.noAccel with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] refine bind_preservesInferOnly (x := prims) (prims_preservesInferOnly methods) ?_ intro p cases hfin : id.addr != p.fin.addr || field != 0 with | true => - simp only [if_true] + simp only [ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases head with | const recId recLevels recInfo => cases hrec : recId.addr != p.decidableRec.addr || args.size < 5 with | true => - simp only [hrec, if_true] + simp only [hrec, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hrec, Bool.false_eq_true, if_false] + simp only [hrec, Bool.false_eq_true, ite_false] cases args[1]! with | lam motiveName motiveBi motiveDomain motiveBody motiveInfo => diff --git a/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean b/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean index 5e5696d7d..908d2afe0 100644 --- a/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean +++ b/Ix/Tc/Verify/Check/WhnfReductionPolicy.lean @@ -120,7 +120,7 @@ theorem isTransientNatLiteralWork_preservesInferOnly cases direct with | true => exact TcM.PreservesInferOnly.pure true | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rcases hspine : source.collectSpine with ⟨head, args⟩ cases head with | const id levels info => @@ -152,15 +152,15 @@ private theorem tryProjAppReduce_preservesInferOnly rcases hspine : source.collectSpine with ⟨head, args⟩ cases hempty : args.isEmpty with | true => - simp only [hempty, if_true] + simp only [hempty, ite_true] exact TcM.PreservesInferOnly.pure none | false => - simp only [hempty, Bool.false_eq_true, if_false, pure_bind] + simp only [hempty, Bool.false_eq_true, ite_false, pure_bind] cases head with | prj id field value info => cases hcheap : flags.cheapProj with | true => - simp only [if_true, ReaderT.run_bind] + simp only [ite_true, ReaderT.run_bind] apply TcM.PreservesInferOnly.bind (whnfCoreFlagsRec_preservesInferOnly hmethods value flags) intro reduced @@ -168,7 +168,7 @@ private theorem tryProjAppReduce_preservesInferOnly intro projection cases projection <;> exact TcM.PreservesInferOnly.pure _ | false => - simp only [Bool.false_eq_true, if_false, ReaderT.run_bind] + simp only [Bool.false_eq_true, ite_false, ReaderT.run_bind] apply TcM.PreservesInferOnly.bind (whnfRec_preservesInferOnly hmethods value) intro reduced @@ -487,7 +487,7 @@ theorem whnfNoDeltaReducersStep_preservesInferOnly | none => cases hfull : flags.isFull with | true => - simp only [if_true] + simp only [ite_true] apply TcM.PreservesInferOnly.bind (helpers.projectionDefinition source) intro projectionDefinition diff --git a/Ix/Tc/Verify/Ctx.lean b/Ix/Tc/Verify/Ctx.lean index 4e044b8ca..ec0793a52 100644 --- a/Ix/Tc/Verify/Ctx.lean +++ b/Ix/Tc/Verify/Ctx.lean @@ -147,7 +147,7 @@ protected theorem LocalContext.WF.push {m : Mode} simp · obtain ⟨decl, hd⟩ := h.sound hi refine ⟨decl, ?_⟩ - rw [Array.getElem?_push, if_neg] + rw [Array.getElem?_push, ite_eq_right] · exact hd · intro hieq subst i @@ -205,7 +205,7 @@ theorem LocalContext.WF.truncate_pred {m : Mode} obtain ⟨d, hd⟩ := h.sound hi by_cases hlt : i < lctx.decls.pop.size · refine ⟨d, ?_⟩ - rw [Array.getElem?_pop, if_pos (by simpa using hlt)] + rw [Array.getElem?_pop, ite_eq_left (by simpa using hlt)] exact hd · have hiOld : i < lctx.decls.size := (Array.getElem?_eq_some_iff.mp hd).choose diff --git a/Ix/Tc/Verify/DefEq.lean b/Ix/Tc/Verify/DefEq.lean index 03a855cb4..24951f8a3 100644 --- a/Ix/Tc/Verify/DefEq.lean +++ b/Ix/Tc/Verify/DefEq.lean @@ -1947,7 +1947,7 @@ theorem isDefEq_equivHit_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -2091,7 +2091,7 @@ theorem isDefEq_fullHit_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -2110,7 +2110,7 @@ theorem isDefEq_fullHit_true ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -2120,7 +2120,7 @@ theorem isDefEq_fullHit_true change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hhit, if_true] + simp only [hhit, ite_true] rfl /-- A positive non-cheap full-cache hit is accepted by the real DefEq entry @@ -2299,7 +2299,7 @@ theorem isDefEq_rootFullHit_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -2318,7 +2318,7 @@ theorem isDefEq_rootFullHit_true ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -2348,7 +2348,7 @@ theorem isDefEq_rootFullHit_true ((aRoot?, bRoot?), em))) _ s4 = _ unfold EStateM.bind rw [hroots] - simp only [hchanged, hscope, if_true] + simp only [hchanged, hscope, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s5 = _ unfold EStateM.bind @@ -2550,7 +2550,7 @@ theorem isDefEq_cheapHit_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -2569,7 +2569,7 @@ theorem isDefEq_cheapHit_true ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -2579,12 +2579,12 @@ theorem isDefEq_cheapHit_true change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hfullMiss, if_true] + simp only [hfullMiss, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hhit, if_true] + simp only [hhit, ite_true] rfl /-- A positive cheap hit is semantically accepted, promoted with the same @@ -2727,7 +2727,7 @@ theorem isDefEq_addrEq_wf (fun _ => rfl) (fun _ => rfl) (fun _ => rfl) (fun _ => rfl) (fun _ => rfl) (fun _ => rfl) (fun _ => rfl) (fun _ => rfl) s1 · intro _ s2 _ - simp only [haddr, if_true] + simp only [haddr, ite_true] apply RecM.WF.pure intro hI htrue exact DefEqMeaning.of_translations theory hI.2.1.wf ha hb diff --git a/Ix/Tc/Verify/DefEq/ApplicationSpine.lean b/Ix/Tc/Verify/DefEq/ApplicationSpine.lean index 7c0704617..cfee531d6 100644 --- a/Ix/Tc/Verify/DefEq/ApplicationSpine.lean +++ b/Ix/Tc/Verify/DefEq/ApplicationSpine.lean @@ -67,10 +67,10 @@ theorem tryDefEqApp_wf rcases hrightCollect : right.collectSpine with ⟨rightHead, rightArgs⟩ cases hsize : leftArgs.size != rightArgs.size with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ h => by contradiction | false => - simp only [Bool.false_or, Bool.false_eq_true, if_false] + simp only [Bool.false_or, Bool.false_eq_true, ite_false] have hlength : leftArgs.toList.length = rightArgs.toList.length := by simpa only [Array.length_toList] using eq_of_beq (show (leftArgs.size == rightArgs.size) = true by @@ -88,10 +88,10 @@ theorem tryDefEqApp_wf intro headsEqual afterHead hheadsEqual cases headsEqual with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] apply RecM.WF.mono (RecM.WF.withInv <| allDefEqSpineArgs_wf _ (by diff --git a/Ix/Tc/Verify/DefEq/BoolTrue.lean b/Ix/Tc/Verify/DefEq/BoolTrue.lean index 6ac0fc3ec..577665db3 100644 --- a/Ix/Tc/Verify/DefEq/BoolTrue.lean +++ b/Ix/Tc/Verify/DefEq/BoolTrue.lean @@ -102,10 +102,10 @@ theorem boolTrueReductionAllowed_wf unfold boolTrueReductionAllowed cases hfv : source.hasFVars with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ => rfl | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.WF.bind (Q₁ := fun observed after => observed = s ∧ after = s) (RecM.WF.get fun _ => ⟨rfl, rfl⟩) @@ -210,24 +210,24 @@ theorem isDefEqInnerAfterFirstBoolGuardMiss_wf cases aIsTrue with | false => cases allowed <;> - simp only [Bool.false_and, Bool.false_eq_true, if_false] <;> + simp only [Bool.false_and, Bool.false_eq_true, ite_false] <;> exact htail haSupport hbSupport ha hb | true => cases allowed with | false => - simp only [Bool.true_and, Bool.false_eq_true, if_false] + simp only [Bool.true_and, Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb | true => - simp only [Bool.true_and, if_true] + simp only [Bool.true_and, ite_true] apply RecM.WF.bind (whnfThenIsBoolTrue_wf context hcanonical hwhnf hbSupport hb) intro normalizedTrue afterNormalize hnormalized cases normalizedTrue with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => by have haEq := haTrue rfl simpa [haEq] using (hnormalized rfl).symm @@ -261,26 +261,26 @@ theorem DefEqAfterBoolTrue.closesAfterQuick cases bIsTrue with | false => cases allowed <;> - simp only [Bool.false_and, Bool.false_eq_true, if_false] <;> + simp only [Bool.false_and, Bool.false_eq_true, ite_false] <;> exact isDefEqInnerAfterFirstBoolGuardMiss_wf context hcanonical hwhnf htail haSupport hbSupport ha hb | true => cases allowed with | false => - simp only [Bool.true_and, Bool.false_eq_true, if_false] + simp only [Bool.true_and, Bool.false_eq_true, ite_false] exact isDefEqInnerAfterFirstBoolGuardMiss_wf context hcanonical hwhnf htail haSupport hbSupport ha hb | true => - simp only [Bool.true_and, if_true] + simp only [Bool.true_and, ite_true] apply RecM.WF.bind (whnfThenIsBoolTrue_wf context hcanonical hwhnf haSupport ha) intro normalizedTrue afterNormalize hnormalized cases normalizedTrue with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => by have hbEq := hbTrue rfl simpa [hbEq] using hnormalized rfl diff --git a/Ix/Tc/Verify/DefEq/CacheBranches.lean b/Ix/Tc/Verify/DefEq/CacheBranches.lean index f200f3670..fae17b85a 100644 --- a/Ix/Tc/Verify/DefEq/CacheBranches.lean +++ b/Ix/Tc/Verify/DefEq/CacheBranches.lean @@ -61,7 +61,7 @@ theorem isDefEq_fullHitCheapMode_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -80,7 +80,7 @@ theorem isDefEq_fullHitCheapMode_true ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -90,7 +90,7 @@ theorem isDefEq_fullHitCheapMode_true change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hhit, if_true] + simp only [hhit, ite_true] rfl /-- The cheap-mode copy of a positive full entry is justified by re-kinding @@ -271,7 +271,7 @@ theorem isDefEq_rootCheapHit_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -290,7 +290,7 @@ theorem isDefEq_rootCheapHit_true ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -300,7 +300,7 @@ theorem isDefEq_rootCheapHit_true change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hfullMiss, if_true] + simp only [hfullMiss, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -325,7 +325,7 @@ theorem isDefEq_rootCheapHit_true ((aRoot?, bRoot?), em))) _ s4 = _ unfold EStateM.bind rw [hroots] - simp only [hchanged, hscope, if_true] + simp only [hchanged, hscope, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s5 = _ unfold EStateM.bind @@ -334,7 +334,7 @@ theorem isDefEq_rootCheapHit_true change EStateM.bind (get : TcM .anon (TcState .anon)) _ s5 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s5 = .ok s5 s5 from rfl] - simp only [hhit, if_true] + simp only [hhit, ite_true] rfl /-- Soundness of the guarded positive root/cheap branch. Root paths and the @@ -657,7 +657,7 @@ theorem isDefEq_rootFullHitCheapMode_true _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -676,7 +676,7 @@ theorem isDefEq_rootFullHitCheapMode_true ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -686,7 +686,7 @@ theorem isDefEq_rootFullHitCheapMode_true change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hfullMiss, if_true] + simp only [hfullMiss, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -711,12 +711,12 @@ theorem isDefEq_rootFullHitCheapMode_true ((aRoot?, bRoot?), em))) _ s4 = _ unfold EStateM.bind rw [hroots] - simp only [hchanged, hscope, if_true] + simp only [hchanged, hscope, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s5 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s5 = .ok s5 s5 from rfl] - simp only [hhit, if_true] + simp only [hhit, ite_true] rfl /-- Semantic acceptance of the positive root/full hit in cheap mode. -/ diff --git a/Ix/Tc/Verify/DefEq/CacheShell.lean b/Ix/Tc/Verify/DefEq/CacheShell.lean index b6f72ddd9..ef2baad65 100644 --- a/Ix/Tc/Verify/DefEq/CacheShell.lean +++ b/Ix/Tc/Verify/DefEq/CacheShell.lean @@ -54,7 +54,7 @@ theorem isDefEq_directMiss_noncheap _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -73,7 +73,7 @@ theorem isDefEq_directMiss_noncheap ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -83,7 +83,7 @@ theorem isDefEq_directMiss_noncheap change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hfullMiss, Bool.false_eq_true, if_false] + simp only [hfullMiss, Bool.false_eq_true, ite_false] rfl /-- In cheap mode, once both direct partitions miss, the same exact root @@ -129,7 +129,7 @@ theorem isDefEq_directMiss_cheap _ s1 = _ unfold EStateM.bind rw [hstats] - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (TcM.defEqCtxKey a b) _ s2 = _ unfold EStateM.bind @@ -148,7 +148,7 @@ theorem isDefEq_directMiss_cheap ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩)) _ s3 = _ unfold EStateM.bind rw [hequiv] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -158,7 +158,7 @@ theorem isDefEq_directMiss_cheap change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s4 = .ok s4 s4 from rfl] - simp only [hfullMiss, if_true] + simp only [hfullMiss, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s4 = _ unfold EStateM.bind @@ -340,7 +340,7 @@ private theorem applyFullRootResult_wf world.venv.IsDefEqU model.keys.uvars Delta.toCtx va vb) := by cases answer with | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] apply RecM.WF.bind (Q₁ := fun _ _ => True) · exact RecM.WF.modify (fun hI => fullResult_whnfStateInv hI hfull) @@ -348,7 +348,7 @@ private theorem applyFullRootResult_wf · intro _ _ _ exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [if_true] + simp only [ite_true] have hrel := hfull.kernelDefEqEquivCanonical hcollision haSupport hbSupport apply RecM.WF.bind (Q₁ := fun _ _ => True) @@ -408,7 +408,7 @@ private theorem applyCheapRootResult_wf hfull.kernelDefEqRekind cases answer with | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] apply RecM.WF.bind (Q₁ := fun _ _ => True) · exact RecM.WF.modify (fun hI => cheapResult_whnfStateInv hI hcheap @@ -417,7 +417,7 @@ private theorem applyCheapRootResult_wf · intro _ _ _ exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [if_true] + simp only [ite_true] have hrel := hfull.kernelDefEqEquivCanonical hcollision haSupport hbSupport apply RecM.WF.bind (Q₁ := fun _ _ => True) @@ -479,10 +479,10 @@ private theorem applyDirectFullHit_wf | false => cases answer with | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [Bool.false_eq_true, if_false, if_true, pure_bind] + simp only [Bool.false_eq_true, ite_false, ite_true, pure_bind] have hrel := hfull.kernelDefEqEquivCanonical hcollision haSupport hbSupport apply RecM.WF.bind (Q₁ := fun _ _ => True) @@ -502,7 +502,7 @@ private theorem applyDirectFullHit_wf | true => cases answer with | false => - simp only [Bool.false_eq_true, if_false, if_true, pure_bind] + simp only [Bool.false_eq_true, ite_false, ite_true, pure_bind] apply RecM.WF.bind (Q₁ := fun _ _ => True) · exact RecM.WF.modify (fun hI => DefEqCacheUpdate.cheap_whnfStateInv hI hcheap) @@ -510,7 +510,7 @@ private theorem applyDirectFullHit_wf · intro _ _ _ exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [if_true] + simp only [ite_true] have hrel := hfull.kernelDefEqEquivCanonical hcollision haSupport hbSupport apply RecM.WF.bind (Q₁ := fun _ _ => True) @@ -565,10 +565,10 @@ private theorem applyDirectCheapHit_wf world.venv.IsDefEqU model.keys.uvars Delta.toCtx va vb) := by cases answer with | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [if_true] + simp only [ite_true] have hfull : CacheProvenance (kernelCacheSemantics model.keys trProj) (CacheAuthority.stable world) support @@ -656,7 +656,7 @@ theorem isDefEqAfterRootCacheMiss_wf intro read s₄ hread subst read by_cases hdepth : s₄.defEqDepth > maxDefEqDepth - · simp only [hdepth, if_true] + · simp only [hdepth, ite_true] apply RecM.WF.bind (Q₁ := fun _ _ => True) · exact RecM.WF.modify (fun hI => hI.of_semantic_fields_eq @@ -664,7 +664,7 @@ theorem isDefEqAfterRootCacheMiss_wf (fun _ => trivial) · intro _ _ _ exact RecM.WF.throw fun _ => trivial - · simp only [hdepth, if_false, pure_bind] + · simp only [hdepth, ite_false, pure_bind] apply RecM.WF.bind (Q₁ := fun result _ => match result with | .ok answer => answer = true → @@ -818,21 +818,21 @@ theorem isDefEqAfterDirectCacheMiss_wf ⟨a.addr, ctxAddr, max a.lbr b.lbr, a.lbr⟩ || bRoot != ⟨b.addr, ctxAddr, max a.lbr b.lbr, b.lbr⟩) with | false => - simp only [hchanged, Bool.false_eq_true, if_false] + simp only [hchanged, Bool.false_eq_true, ite_false] exact isDefEqAfterRootCacheMiss_wf model hcollision hinner haSupport hbSupport ha hb hctx hreferences (s := s₁) (cheapMode := cheapMode) | true => - simp only [hchanged, if_true] + simp only [hchanged, ite_true] cases hscope : aRoot.rootCacheScopeMatches bRoot ctxAddr (max a.lbr b.lbr) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact isDefEqAfterRootCacheMiss_wf model hcollision hinner haSupport hbSupport ha hb hctx hreferences (s := s₁) (cheapMode := cheapMode) | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind (Q₁ := fun read after => read = after ∧ WhnfStateInv layer @@ -852,20 +852,20 @@ theorem isDefEqAfterDirectCacheMiss_wf hcollision hI₂ haPath hbPath hscope hctx hroot haSupport hbSupport ha hb (hreferences .full answer) simp only [pure_bind, Bool.false_eq_true, - if_false] + ite_false] exact applyFullRootResult_wf hcollision haSupport hbSupport horiginal.1 horiginal.2 (cheapMode := cheapMode) | none => cases cheapMode with | false => - simp only [Bool.false_eq_true, if_false, + simp only [Bool.false_eq_true, ite_false, pure_bind] exact isDefEqAfterRootCacheMiss_wf model hcollision hinner haSupport hbSupport ha hb hctx hreferences (s := s₂) (cheapMode := false) | true => - simp only [if_true, pure_bind] + simp only [ite_true, pure_bind] apply RecM.WF.bind (Q₁ := fun read after => read = after ∧ WhnfStateInv layer @@ -936,13 +936,13 @@ theorem isDefEq_wf · intro _ s₂ _ cases haddr : (a.addr == b.addr) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => DefEqMeaning.of_translations theory hI.2.1.wf ha hb (DefEqMeaning.of_addr_beq theory hI.2.1 hcollision haSupport hbSupport ha haddr) rfl | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] apply RecM.WF.bind · apply RecM.WF.withInv apply RecM.WF.liftTcM @@ -963,12 +963,12 @@ theorem isDefEq_wf rcases hequivPost with ⟨hI₄, hequiv⟩ cases isEq with | true => - simp only [if_true] + simp only [ite_true] have hsemantic := (hequiv rfl).sound theory hI₄.2.1.wf hcollision haSupport rfl hbSupport rfl hrepresented ha hb exact RecM.WF.pure fun _ _ => hsemantic | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (Q₁ := fun read after => read = after ∧ WhnfStateInv layer @@ -999,15 +999,15 @@ theorem isDefEq_wf fun htrue => DefEqMeaning.of_translations theory hI₆.2.1.wf ha hb hmeaning htrue by_cases hcheapMode : s₅.cheapRecursionDepth > 0 - · simp only [hcheapMode, if_true] + · simp only [hcheapMode, ite_true] exact applyDirectFullHit_wf hcollision haSupport hbSupport hfull hsemantic (cheapMode := true) - · simp only [hcheapMode, if_false] + · simp only [hcheapMode, ite_false] exact applyDirectFullHit_wf hcollision haSupport hbSupport hfull hsemantic (cheapMode := false) | none => by_cases hcheapMode : s₅.cheapRecursionDepth > 0 - · simp only [hcheapMode, if_true, decide_true] + · simp only [hcheapMode, ite_true, decide_true] apply RecM.WF.bind (Q₁ := fun read after => read = after ∧ WhnfStateInv layer @@ -1038,7 +1038,7 @@ theorem isDefEq_wf hcollision hinner haSupport hbSupport ha hb hrepresented (hreferences ctxAddr) (s := s₇) (cheapMode := true) - · simp only [hcheapMode, if_false, decide_false] + · simp only [hcheapMode, ite_false, decide_false] exact isDefEqAfterDirectCacheMiss_wf model theory hcollision hinner haSupport hbSupport ha hb hrepresented (hreferences ctxAddr) diff --git a/Ix/Tc/Verify/DefEq/CheapReduction.lean b/Ix/Tc/Verify/DefEq/CheapReduction.lean index 7b68bcd85..0ef6aff4c 100644 --- a/Ix/Tc/Verify/DefEq/CheapReduction.lean +++ b/Ix/Tc/Verify/DefEq/CheapReduction.lean @@ -203,7 +203,7 @@ theorem closesAfterStringExpansion rcases hcb with ⟨hIB, hcbSupport, cbV, hcbTr, hbCb⟩ cases haddr : ca.addr == cb.addr with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => by have herase := hcollision.expr hcaSupport hcbSupport (eq_of_beq haddr) @@ -216,19 +216,19 @@ theorem closesAfterStringExpansion exact haCa.trans world.venvWF hIB.2.1.wf <| hmiddle.trans world.venvWF hIB.2.1.wf hbCb.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (quickDefEq_wf theory hcollision hsorts hstructural hcaSupport hcbSupport hcaTr hcbTr) intro accepted afterQuick haccepted cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => haCa.trans world.venvWF hI.2.1.wf <| (haccepted rfl).trans world.venvWF hI.2.1.wf hbCb.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb end DefEqAfterCorePass @@ -275,7 +275,7 @@ theorem closesAfterCorePass rcases hwb with ⟨hIB, hwbSupport, wbV, hwbTr, hbWb⟩ cases haddr : wa.addr == wb.addr with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => by have herase := hcollision.expr hwaSupport hwbSupport (eq_of_beq haddr) @@ -288,19 +288,19 @@ theorem closesAfterCorePass exact haWa.trans world.venvWF hIB.2.1.wf <| hmiddle.trans world.venvWF hIB.2.1.wf hbWb.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (quickDefEq_wf theory hcollision hsorts hstructural hwaSupport hwbSupport hwaTr hwbTr) intro accepted afterQuick haccepted cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => haWa.trans world.venvWF hI.2.1.wf <| (haccepted rfl).trans world.venvWF hI.2.1.wf hbWb.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.mono (RecM.WF.withInv <| htail hwaSupport hwbSupport hwaTr hwbTr) · intro answer final hpost htrue diff --git a/Ix/Tc/Verify/DefEq/DeltaClassification.lean b/Ix/Tc/Verify/DefEq/DeltaClassification.lean index 7f3d9525f..27cc45f71 100644 --- a/Ix/Tc/Verify/DefEq/DeltaClassification.lean +++ b/Ix/Tc/Verify/DefEq/DeltaClassification.lean @@ -83,10 +83,10 @@ theorem defEqLazyDeltaStepAfterAcceleratorMiss_wf intro rightDelta afterRight _ cases hstopped : (!leftDelta && !rightDelta) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => hpair | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact hafter hstopped hpair namespace DefEqLazyDeltaAfterAcceleratorMiss diff --git a/Ix/Tc/Verify/DefEq/EqualRankCache.lean b/Ix/Tc/Verify/DefEq/EqualRankCache.lean index 30004e11c..21759db56 100644 --- a/Ix/Tc/Verify/DefEq/EqualRankCache.lean +++ b/Ix/Tc/Verify/DefEq/EqualRankCache.lean @@ -228,17 +228,17 @@ theorem trySameHeadSpineCached_wf cases hhit : afterRead.env.defEqFailure.contains (defEqFailureKey left right ctxAddr) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| by cases speculative with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact hsame hleftSupport hrightSupport hleft hright | true => - simp only [if_true] + simp only [ite_true] exact trySameHeadSpineSpeculative_wf hsame hleftSupport hrightSupport hleft hright intro result afterAttempt hresult diff --git a/Ix/Tc/Verify/DefEq/EqualRankPrefix.lean b/Ix/Tc/Verify/DefEq/EqualRankPrefix.lean index c045f9cbf..b449b6be8 100644 --- a/Ix/Tc/Verify/DefEq/EqualRankPrefix.lean +++ b/Ix/Tc/Verify/DefEq/EqualRankPrefix.lean @@ -46,10 +46,10 @@ theorem defEqLazyDeltaStepWithEqualRank_wf | some rightId => cases hguard : (leftId.addr == rightId.addr) with | false => - simp only [hguard, Bool.false_eq_true, if_false] + simp only [hguard, Bool.false_eq_true, ite_false] exact hafter hpair | true => - simp only [hguard, if_true] + simp only [hguard, ite_true] apply RecM.WF.bind (isRegular_wf hfault leftId) intro regular afterRegular _ apply RecM.WF.bind <| diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/Application.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/Application.lean index 4833994da..e5b3655fc 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/Application.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/Application.lean @@ -75,20 +75,20 @@ theorem tryDefEqWhnfApp_wf intro functionsEqual afterFunction hfunctions cases functionsEqual with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind <| RecM.isDefEqCall_wf hleftArgSupport hrightArgSupport hleftArg hrightArg intro argumentsEqual afterArgument harguments cases argumentsEqual with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => by have hDelta : KVLCtx.WF world.venv uvars Delta := hI.2.1.wf diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/EtaExpansion.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/EtaExpansion.lean index 314f923cc..b119611af 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/EtaExpansion.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/EtaExpansion.lean @@ -272,7 +272,7 @@ theorem tryEtaExpansion_wf world.venv.IsDefEqU uvars Delta.toCtx targetV sourceV) := by cases target <;> cases source <;> simp only [tryEtaExpansion, Bool.not_false, Bool.not_true, - Bool.false_or, Bool.true_or, if_true] + Bool.false_or, Bool.true_or, ite_true] all_goals first | exact tryEtaExpansionAfterGuard_wf theory resources hcollision hwhnf htargetSupport hsourceSupport htarget hsource @@ -307,20 +307,20 @@ theorem tryDefEqWhnfEtaAfterGuard_wf intro accepted afterFirst hfirst cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => hfirst rfl | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| tryEtaExpansion_wf theory resources hcollision hwhnf hrightSupport hleftSupport hright hleft intro reverseAccepted afterSecond hsecond cases reverseAccepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => (hsecond rfl).symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial /-- Exhaust the outer "either operand is a lambda" phase guard. -/ @@ -345,7 +345,7 @@ theorem tryDefEqWhnfEta_wf | some answer => answer = true → world.venv.IsDefEqU uvars Delta.toCtx leftV rightV) := by cases left <;> cases right <;> - simp only [tryDefEqWhnfEta, Bool.false_or, Bool.true_or, if_true] + simp only [tryDefEqWhnfEta, Bool.false_or, Bool.true_or, ite_true] all_goals exact tryDefEqWhnfEtaAfterGuard_wf theory resources hcollision hwhnf hleftSupport hrightSupport hleft hright diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/LetDeclaration.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/LetDeclaration.lean index 5445f31de..34530da1e 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/LetDeclaration.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/LetDeclaration.lean @@ -317,19 +317,19 @@ theorem tryDefEqWhnfLet_wf intro typesEqual afterTypes htypes cases typesEqual with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind <| RecM.isDefEqCall_wf hval1Support hval2Support hval1 hval2 intro valuesEqual afterValues hvalues cases valuesEqual with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind <| by apply withLctxScope_openLetWithFV_wf (layer := layer) (semantics := semantics) @@ -422,10 +422,10 @@ theorem tryDefEqWhnfLet_wf intro bodiesEqual afterBodies hbodies cases bodiesEqual with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => hbodies namespace TryDefEqWhnfLet diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/NatBridge.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/NatBridge.lean index 34562eb1b..0508cf1c9 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/NatBridge.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/NatBridge.lean @@ -117,11 +117,11 @@ theorem natSuccOf_wf | nat value blob info => cases value with | zero => - simp only [beq_self_eq_true, if_true] + simp only [beq_self_eq_true, ite_true] exact RecM.WF.pure fun _ => trivial | succ predecessor => have hnonzero : (Nat.succ predecessor == 0) = false := by simp - simp only [hnonzero, Bool.false_eq_true, if_false, + simp only [hnonzero, Bool.false_eq_true, ite_false, Nat.succ_sub_one, pure_bind] apply RecM.WF.bind (RecM.WF.withInv <| RecM.WF.liftTcM <| @@ -148,10 +148,10 @@ theorem natSuccOf_wf | const id levels fnInfo => cases haddr : id.addr == state.prims.natSucc.addr with | false => - simp only [haddr, Bool.false_eq_true, if_false] + simp only [haddr, Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [haddr, if_true] + simp only [haddr, ite_true] exact RecM.WF.pure fun _ => by cases hsource with | app hfnType hargType hfn harg => @@ -234,7 +234,7 @@ theorem isDefEqNatAfterLiteral_wf | true => cases rightZero with | true => - simp only [Bool.true_and, if_true] + simp only [Bool.true_and, ite_true] exact RecM.WF.pure fun hI _ => by have hleftValue := hleftZero rfl have hrightValue := hrightZero rfl @@ -244,7 +244,7 @@ theorem isDefEqNatAfterLiteral_wf hleft.wf world.venvWF.ordered theory.literalWF theory.projections.wf hI.2.1.wf | false => - simp only [Bool.true_and, Bool.false_eq_true, if_false] + simp only [Bool.true_and, Bool.false_eq_true, ite_false] apply RecM.WF.bind <| natSuccOf_wf resources hleftSupport hleft intro leftPred afterLeftPred hleftPred @@ -281,7 +281,7 @@ theorem isDefEqNatAfterLiteral_wf trivial | false => cases rightZero <;> - simp only [Bool.false_and, Bool.false_eq_true, if_false] + simp only [Bool.false_and, Bool.false_eq_true, ite_false] all_goals apply RecM.WF.bind <| natSuccOf_wf resources hleftSupport hleft @@ -376,8 +376,8 @@ theorem tryDefEqWhnfNat_wf intro rightLike afterRight hafterRight subst afterRight cases leftLike <;> cases rightLike <;> - simp only [Bool.false_and, Bool.true_and, Bool.false_eq_true, if_false, - if_true] + simp only [Bool.false_and, Bool.true_and, Bool.false_eq_true, ite_false, + ite_true] all_goals first | exact RecM.WF.pure fun _ => trivial diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/ProofTail.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/ProofTail.lean index 019226425..7e5eb7540 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/ProofTail.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/ProofTail.lean @@ -73,10 +73,10 @@ theorem isDefEqWhnfAfterStructEta_wf intro accepted afterUnit haccepted cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => haccepted rfl | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail hleftSupport hrightSupport hleft hright namespace IsDefEqWhnfAfterStructEta diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StringExpansion.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StringExpansion.lean index c23d6562e..d3d7617ec 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StringExpansion.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StringExpansion.lean @@ -42,20 +42,20 @@ theorem tryDefEqWhnfStringAfterGuard_wf intro accepted afterFirst hfirst cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => hfirst rfl | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| tryStringLitExpansion_wf context hcanonical hrightSupport hleftSupport hright hleft intro reverseAccepted afterSecond hsecond cases reverseAccepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => (hsecond rfl).symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial /-- Exhaust the outer "either operand is a String literal" guard. -/ diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean index 8a48063bd..c37b723f2 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StructuralPrefix.lean @@ -57,10 +57,10 @@ theorem tryDefEqWhnfStructural_wf · rename_i leftIdx leftName leftInfo rightIdx rightName rightInfo cases hidx : leftIdx == rightIdx with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => by have hsameIdx : leftIdx = rightIdx := eq_of_beq hidx subst rightIdx @@ -97,10 +97,10 @@ theorem tryDefEqWhnfStructural_wf (leftId.addr == rightId.addr && sameDefEqUniverses leftLevels rightLevels) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => by obtain ⟨hid, hlevels⟩ := Bool.and_eq_true_iff.mp hguard exact constantHeadsDefEq resources.collision @@ -118,10 +118,10 @@ theorem tryDefEqWhnfStructural_wf intro answer after hanswer cases answer with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => hanswer · apply RecM.WF.bind <| by simpa only [quickDefEq] using @@ -130,10 +130,10 @@ theorem tryDefEqWhnfStructural_wf intro answer after hanswer cases answer with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => hanswer · rename_i leftName leftTy leftVal leftBody leftNondep leftInfo rightName rightTy rightVal rightBody rightNondep rightInfo diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEta.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEta.lean index b29b620ff..03309dd48 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEta.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEta.lean @@ -189,23 +189,23 @@ theorem tryEtaStructAfterConstructor_wf unfold tryEtaStructAfterConstructor cases hsize : (args.size != params.toNat + fields.toNat) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ htrue => by contradiction | false => have hsizeEq : args.size = params.toNat + fields.toNat := by exact eq_of_beq (show (args.size == params.toNat + fields.toNat) = true by simpa using hsize) - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind resources.classifier intro structLike afterClassifier hstructLike cases structLike with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ htrue => by contradiction | true => have heligible : eligible inductId := hstructLike rfl - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.WF.bind (tryOptionalInferOnlyCall_wf hsourceSupport hsource) intro inferredSource afterSourceType hinferredSource @@ -239,11 +239,11 @@ theorem tryEtaStructAfterConstructor_wf rcases htypesEqual with ⟨hITypeEquality, htypesEqual⟩ cases typesEqual with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ htrue => by contradiction | true => simp only [Bool.not_true, Bool.false_eq_true, - if_false] + ite_false] have hDelta : KVLCtx.WF world.venv uvars Delta := hITypeEquality.2.1.wf have hbaseCoreType : world.venv.HasType uvars @@ -293,7 +293,7 @@ theorem tryEtaStructAfterConstructor_wf TrKExprS world.venv uvars world.nameOf trProj Delta args[params.toNat + field]! (fieldV field) := by intro field hlt - simp only [fieldV, dif_pos hlt] + simp only [fieldV, dite_eq_left hlt] exact Classical.choose_spec (hfieldWitness field hlt) obtain ⟨structName, projectedV, hname, hprojection⟩ := @@ -469,19 +469,19 @@ theorem tryDefEqWhnfStructEta_wf intro forward afterForward hforward cases forward with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => hforward rfl | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| tryEtaStruct_wf resources hrightSupport hleftSupport hright hleft intro reverse afterReverse hreverse cases reverse with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => (hreverse rfl).symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial namespace TryDefEqWhnfStructEta diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaBase.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaBase.lean index c8451cf2f..5fa6d552e 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaBase.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaBase.lean @@ -121,7 +121,7 @@ theorem etaExpansionBaseLoop_wf cases hshape : (id.addr != inductId.addr || idx.toNat != field) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial | false => have hshapeParts := Bool.or_eq_false_iff.mp hshape @@ -133,7 +133,7 @@ theorem etaExpansionBaseLoop_wf have hidx : idx.toNat = field := eq_of_beq (show (idx.toNat == field) = true by simpa using hshapeParts.2) - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] unfold etaExpansionBaseAfterProjection have hvalueSupport := hprojectionValue hreducedSupport apply RecM.WF.bind <| RecM.WF.withInv <| tryOptional_wf <| @@ -224,10 +224,10 @@ theorem etaExpansionBaseLoop_wf rcases hseed with ⟨baseV, hbaseSupport, hbase⟩ cases haddr : (base.addr != chosen.addr) with | true => - simp only [haddr, if_true] + simp only [haddr, ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [haddr, Bool.false_eq_true, if_false, + simp only [haddr, Bool.false_eq_true, ite_false, pure_bind] have haddrEq : (base.addr == chosen.addr) = true := by simpa using haddr diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaFields.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaFields.lean index d291cb45f..2800b2c42 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaFields.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaFields.lean @@ -81,10 +81,10 @@ theorem tryEtaStructFields_wf intro equal afterEqual hequal cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ htrue => by contradiction | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.WF.mono <| ih (state := afterEqual) (field := field + 1) (projectedV := fun offset => projectedV (offset + 1)) diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaTail.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaTail.lean index 0b63558ef..c01351fcb 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaTail.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/StructureEtaTail.lean @@ -105,7 +105,7 @@ theorem tryEtaStructAfterTypes_wf rcases hequal with ⟨hIEqual, hequal⟩ cases equal with | false => - simpa only [Bool.false_eq_true, if_false, pure_bind] using + simpa only [Bool.false_eq_true, ite_false, pure_bind] using hexplicit afterEqual | true => exact RecM.WF.pure fun _ _ => by diff --git a/Ix/Tc/Verify/DefEq/FinalWhnf/UnitLike.lean b/Ix/Tc/Verify/DefEq/FinalWhnf/UnitLike.lean index 83418c0ad..ace36bcb0 100644 --- a/Ix/Tc/Verify/DefEq/FinalWhnf/UnitLike.lean +++ b/Ix/Tc/Verify/DefEq/FinalWhnf/UnitLike.lean @@ -93,7 +93,7 @@ theorem isUnitLikeInductive_wf ty ctors leanAll => cases hshape : (indices != 0 || ctors.size != 1) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ htrue => by contradiction | false => have hshapeParts := Bool.or_eq_false_iff.mp hshape @@ -103,7 +103,7 @@ theorem isUnitLikeInductive_wf have hctors : ctors.size = 1 := by exact eq_of_beq (show (ctors.size == 1) = true by simpa using hshapeParts.2) - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] let ctorId := ctors[0]! apply RecM.WF.bind <| RecM.WF.withInv <| RecM.WF.liftTcM <| TcM.tryGetConst_loaded_wf hfault ctorId afterInd @@ -187,7 +187,7 @@ theorem tryDefEqUnit_wf simp only [Bool.not_false] exact RecM.WF.pure fun _ htrue => by contradiction | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] obtain ⟨entry, hentry, hshape⟩ := hisUnit rfl apply RecM.WF.bind (tryOptionalInferOnlyCall_wf hrightSupport hright) diff --git a/Ix/Tc/Verify/DefEq/LoopFinish.lean b/Ix/Tc/Verify/DefEq/LoopFinish.lean index 79e1411de..fc15ca1dd 100644 --- a/Ix/Tc/Verify/DefEq/LoopFinish.lean +++ b/Ix/Tc/Verify/DefEq/LoopFinish.lean @@ -37,7 +37,7 @@ theorem finishDefEqLazyDeltaStep_wf unfold finishDefEqLazyDeltaStep cases haddr : left.addr == right.addr with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => hleftEq.trans world.venvWF hI.2.1.wf <| (DefEqMeaning.of_translations theory hI.2.1.wf hleft hright @@ -45,20 +45,20 @@ theorem finishDefEqLazyDeltaStep_wf hpair.leftSupport hpair.rightSupport hleft haddr) rfl).trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| quickDefEq_wf theory hcollision hsorts hstructural hpair.leftSupport hpair.rightSupport hleft hright intro accepted afterQuick haccepted cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => hleftEq.trans world.venvWF hI.2.1.wf <| (haccepted rfl).trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => hpair end RecM diff --git a/Ix/Tc/Verify/DefEq/NatOffset.lean b/Ix/Tc/Verify/DefEq/NatOffset.lean index 5aeee1ed3..7b62dd8de 100644 --- a/Ix/Tc/Verify/DefEq/NatOffset.lean +++ b/Ix/Tc/Verify/DefEq/NatOffset.lean @@ -167,10 +167,10 @@ theorem tryDefEqOffsetAfterZeroMiss_wf (!natOffsetCandidate state.prims left || !natOffsetCandidate state.prims right) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact hafter hleftSupport hrightSupport hleft hright | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial namespace TryDefEqOffsetAfterZeroMiss @@ -221,15 +221,15 @@ theorem tryDefEqOffsetAfterLiteral_wf cases leftIsZero with | false => cases rightIsZero <;> - simp only [Bool.false_and, Bool.false_eq_true, if_false] <;> + simp only [Bool.false_and, Bool.false_eq_true, ite_false] <;> exact hafter hleftSupport hrightSupport hleft hright | true => cases rightIsZero with | false => - simp only [Bool.true_and, Bool.false_eq_true, if_false] + simp only [Bool.true_and, Bool.false_eq_true, ite_false] exact hafter hleftSupport hrightSupport hleft hright | true => - simp only [Bool.true_and, if_true] + simp only [Bool.true_and, ite_true] exact RecM.WF.pure fun _ _ => by have hleftValue := hleftZero rfl have hrightValue := hrightZero rfl diff --git a/Ix/Tc/Verify/DefEq/NatOffsetDecomposition.lean b/Ix/Tc/Verify/DefEq/NatOffsetDecomposition.lean index 5fb8ce726..48c0edb35 100644 --- a/Ix/Tc/Verify/DefEq/NatOffsetDecomposition.lean +++ b/Ix/Tc/Verify/DefEq/NatOffsetDecomposition.lean @@ -119,10 +119,10 @@ theorem natOffsetDecompose_state_wf {I : TcState .anon → Prop} rcases pair with ⟨base, offset⟩ cases hzero : offset == 0 with | true => - simp only [hzero, if_true] + simp only [hzero, ite_true] exact TcM.WF.pure fun _ => trivial | false => - simp only [hzero, Bool.false_eq_true, if_false] + simp only [hzero, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (prims_state_wf methods afterOffset) intro currentPrims afterSecondRead _ @@ -147,10 +147,10 @@ theorem natOffsetRebuild_state_wf {I : TcState .anon → Prop} | some base => cases hzero : remainder == 0 with | true => - simp only [natOffsetRebuild, hzero, if_true] + simp only [natOffsetRebuild, hzero, ite_true] exact TcM.WF.pure fun _ => trivial | false => - simp only [natOffsetRebuild, hzero, Bool.false_eq_true, if_false] + simp only [natOffsetRebuild, hzero, Bool.false_eq_true, ite_false] exact mkNatAdd_state_wf methods base (natExprFromValue remainder) s @@ -199,10 +199,10 @@ theorem tryDefEqOffsetAfterCandidates_wf rcases rightParts with ⟨baseRight, rightOffset⟩ cases hzero : (min leftOffset rightOffset == 0) with | true => - simp only [hzero, if_true] + simp only [hzero, ite_true] exact TcM.WF.pure fun _ => trivial | false => - simp only [hzero, Bool.false_eq_true, if_false, pure_bind] + simp only [hzero, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] apply TcM.WF.bind (TcM.WF.withInvRunEq <| diff --git a/Ix/Tc/Verify/DefEq/NatReduction.lean b/Ix/Tc/Verify/DefEq/NatReduction.lean index 6327d751a..35849ba41 100644 --- a/Ix/Tc/Verify/DefEq/NatReduction.lean +++ b/Ix/Tc/Verify/DefEq/NatReduction.lean @@ -59,10 +59,10 @@ theorem defEqLazyDeltaStepAfterOffsetMiss_wf cases hgate : ((!left.hasFVars && !right.hasFVars) || state.eagerReduce) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact hafter hpair | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind (RecM.WF.withInv <| hnat hpair.leftSupport hleft) diff --git a/Ix/Tc/Verify/DefEq/ProjectionDeltaActive.lean b/Ix/Tc/Verify/DefEq/ProjectionDeltaActive.lean index 761d03ecb..7de02c7ab 100644 --- a/Ix/Tc/Verify/DefEq/ProjectionDeltaActive.lean +++ b/Ix/Tc/Verify/DefEq/ProjectionDeltaActive.lean @@ -49,8 +49,8 @@ theorem lazyDeltaReductionStepAfterActive_wf case false.false => simp at hactive case false.true => - simp only [Bool.false_and, Bool.false_eq_true, if_false, - Bool.not_false, Bool.true_and, if_true] + simp only [Bool.false_and, Bool.false_eq_true, ite_false, + Bool.not_false, Bool.true_and, ite_true] apply RecM.WF.bind (RecM.WF.withInv <| hprojection hpair.leftSupport hleft) intro reduced afterProjection hreduced @@ -65,7 +65,7 @@ theorem lazyDeltaReductionStepAfterActive_wf exact finishLazyDeltaReductionStep_wf context.finish ⟨hreducedSupport, hpair.rightSupport, hleftReduced, hpair.right⟩ case true.false => - simp only [Bool.not_false, Bool.true_and, if_true] + simp only [Bool.not_false, Bool.true_and, ite_true] apply RecM.WF.bind (RecM.WF.withInv <| hprojection hpair.rightSupport hright) intro reduced afterProjection hreduced @@ -80,7 +80,7 @@ theorem lazyDeltaReductionStepAfterActive_wf exact finishLazyDeltaReductionStep_wf context.finish ⟨hpair.leftSupport, hreducedSupport, hpair.left, hrightReduced⟩ case true.true => - simp only [Bool.not_true, Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.and_false, Bool.false_eq_true, ite_false] exact lazyDeltaReductionStepWithBothDelta_wf hfault hsame context hDelta hpair diff --git a/Ix/Tc/Verify/DefEq/ProjectionDeltaEqualRank.lean b/Ix/Tc/Verify/DefEq/ProjectionDeltaEqualRank.lean index dbb267250..98c763dbf 100644 --- a/Ix/Tc/Verify/DefEq/ProjectionDeltaEqualRank.lean +++ b/Ix/Tc/Verify/DefEq/ProjectionDeltaEqualRank.lean @@ -136,15 +136,15 @@ theorem lazyDeltaReductionStepWithEqualRank_wf unfold lazyDeltaReductionStepWithEqualRank cases hguard : (leftId.addr == rightId.addr) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact lazyDeltaReductionStepAfterSameHeadMiss_wf context hDelta hpair | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind (isRegular_wf hfault leftId) intro regular afterRegular _ cases regular with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| trySameHeadSpineSpeculative_wf hsame hpair.leftSupport hpair.rightSupport hleft hright @@ -163,7 +163,7 @@ theorem lazyDeltaReductionStepWithEqualRank_wf hleftEq.trans world.venvWF hDelta <| (hresult rfl).trans world.venvWF hDelta hrightEq.symm | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind <| hsame hpair.leftSupport hpair.rightSupport hleft hright intro result afterSame hresult diff --git a/Ix/Tc/Verify/DefEq/ProjectionDeltaFinish.lean b/Ix/Tc/Verify/DefEq/ProjectionDeltaFinish.lean index 7dfe06a60..b23a62aad 100644 --- a/Ix/Tc/Verify/DefEq/ProjectionDeltaFinish.lean +++ b/Ix/Tc/Verify/DefEq/ProjectionDeltaFinish.lean @@ -46,10 +46,10 @@ theorem finishLazyDeltaReductionStep_wf intro accepted afterQuick haccepted cases hresult : (left.addr == right.addr || accepted) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => hpair | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI => by have hcurrent : world.venv.IsDefEqU uvars Delta.toCtx leftV rightV := by rcases Bool.or_eq_true_iff.mp hresult with haddr | hquick diff --git a/Ix/Tc/Verify/DefEq/ProjectionDeltaStep.lean b/Ix/Tc/Verify/DefEq/ProjectionDeltaStep.lean index a95be5e66..83f01427e 100644 --- a/Ix/Tc/Verify/DefEq/ProjectionDeltaStep.lean +++ b/Ix/Tc/Verify/DefEq/ProjectionDeltaStep.lean @@ -69,10 +69,10 @@ theorem lazyDeltaReductionStepAfterClassification_wf unfold lazyDeltaReductionStepAfterClassification cases hnone : (!aDelta && !bDelta) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => hpair | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact hactive hnone hpair namespace LazyDeltaReductionAfterClassification diff --git a/Ix/Tc/Verify/DefEq/ProjectionProbe.lean b/Ix/Tc/Verify/DefEq/ProjectionProbe.lean index 5e7944929..342cc7c8d 100644 --- a/Ix/Tc/Verify/DefEq/ProjectionProbe.lean +++ b/Ix/Tc/Verify/DefEq/ProjectionProbe.lean @@ -53,10 +53,10 @@ theorem tryUnfoldProjApp_wf intro reduced afterReduced hreduced cases haddr : reduced.addr == source.addr with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => ⟨hreduced.1, WhnfPost.meaning hsource hreduced.2⟩ @@ -88,8 +88,8 @@ theorem defEqLazyDeltaStepAfterDeltaClassification_wf case false.false => simp at hactive case false.true => - simp only [Bool.false_and, Bool.false_eq_true, if_false, - Bool.not_false, Bool.true_and, if_true] + simp only [Bool.false_and, Bool.false_eq_true, ite_false, + Bool.not_false, Bool.true_and, ite_true] apply RecM.WF.bind (RecM.WF.withInv <| hproj hpair.leftSupport hleft) @@ -120,7 +120,7 @@ theorem defEqLazyDeltaStepAfterDeltaClassification_wf ⟨hpair.leftSupport, hreducedSupport, hpair.left, WhnfPost.transMeaning theory hDelta hpair.right hreducedMeaning⟩ case true.true => - simp only [Bool.not_true, Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.and_false, Bool.false_eq_true, ite_false] exact hafter (aHead := aHead) (bHead := bHead) hactive hpair namespace DefEqLazyDeltaAfterDeltaClassification diff --git a/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean b/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean index 0dc6175be..540c59f07 100644 --- a/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean +++ b/Ix/Tc/Verify/DefEq/ProofIrrelevance.lean @@ -83,7 +83,7 @@ theorem tryProofIrrel_wf simp only [Bool.not_false] exact RecM.WF.pure fun _ htrue => by contradiction | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.WF.bind (tryOptionalInferOnlyCall_wf hbSupport hb) intro bTy afterB hbTy @@ -142,10 +142,10 @@ theorem closesAfterNoDeltaPass intro accepted after haccepted cases accepted with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => haccepted rfl | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb /-- Compose proof irrelevance with both preceding cheap passes. -/ diff --git a/Ix/Tc/Verify/DefEq/RankDispatch.lean b/Ix/Tc/Verify/DefEq/RankDispatch.lean index b0cf3ee57..b985840e3 100644 --- a/Ix/Tc/Verify/DefEq/RankDispatch.lean +++ b/Ix/Tc/Verify/DefEq/RankDispatch.lean @@ -85,23 +85,23 @@ theorem defEqLazyDeltaStepAfterProjectionMiss_wf case false.false => simp at hactive case false.true => - simp only [Bool.false_and, Bool.false_eq_true, if_false] + simp only [Bool.false_and, Bool.false_eq_true, ite_false] exact defEqLazyDeltaStepWithRightDelta_wf context hDelta hpair case true.false => - simp only [Bool.true_and, Bool.false_eq_true, if_false, if_true] + simp only [Bool.true_and, Bool.false_eq_true, ite_false, ite_true] exact defEqLazyDeltaStepWithLeftDelta_wf context hDelta hpair case true.true => - simp only [Bool.true_and, if_true] + simp only [Bool.true_and, ite_true] apply RecM.WF.bind (rankDeltaHead_wf hfault aHead) intro leftRank afterLeftRank _ apply RecM.WF.bind (rankDeltaHead_wf hfault bHead) intro rightRank afterRightRank _ cases heq : leftRank == rightRank with | true => - simp only [if_true] + simp only [ite_true] exact hequal hpair | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hcompare : compareRank leftRank rightRank with | lt => exact defEqLazyDeltaStepWithRightDelta_wf context hDelta hpair diff --git a/Ix/Tc/Verify/DefEq/SameHeadSpine.lean b/Ix/Tc/Verify/DefEq/SameHeadSpine.lean index 85c4dba3c..f40cee8dd 100644 --- a/Ix/Tc/Verify/DefEq/SameHeadSpine.lean +++ b/Ix/Tc/Verify/DefEq/SameHeadSpine.lean @@ -198,10 +198,10 @@ theorem trySameHeadSpine_wf cases hshape : (leftId.addr != rightId.addr || leftArgs.size != rightArgs.size) with | true => - simp only [hshape, if_true] + simp only [hshape, ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [hshape, Bool.false_eq_true, if_false] + simp only [hshape, Bool.false_eq_true, ite_false] have hshapeParts := Bool.or_eq_false_iff.mp hshape have hid : (leftId.addr == rightId.addr) = true := by simpa using hshapeParts.1 @@ -210,10 +210,10 @@ theorem trySameHeadSpine_wf cases huniverses : sameDefEqUniverses leftLevels rightLevels with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ => trivial | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] have hleftSpine := trAppSpine_of_collectSpine hleft hleftCollect have hrightSpine := @@ -237,10 +237,10 @@ theorem trySameHeadSpine_wf intro accepted afterArgs haccepted cases accepted with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ => trivial | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact RecM.WF.pure fun hI _ => by have hDelta : KVLCtx.WF world.venv uvars Delta := hI.2.1.wf diff --git a/Ix/Tc/Verify/DefEq/SpineArguments.lean b/Ix/Tc/Verify/DefEq/SpineArguments.lean index 78cac35f7..84d959d44 100644 --- a/Ix/Tc/Verify/DefEq/SpineArguments.lean +++ b/Ix/Tc/Verify/DefEq/SpineArguments.lean @@ -62,10 +62,10 @@ theorem allDefEqSpineArgsList_wf intro answer after hanswer cases answer with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ htrue => by contradiction | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.WF.mono (ih (fun tail hmem => hinputs tail (by simp [hmem])) after) · intro result final htail hresult candidate hmem diff --git a/Ix/Tc/Verify/DefEq/StoppedContinuation.lean b/Ix/Tc/Verify/DefEq/StoppedContinuation.lean index dde2cdbc3..7e3e928bc 100644 --- a/Ix/Tc/Verify/DefEq/StoppedContinuation.lean +++ b/Ix/Tc/Verify/DefEq/StoppedContinuation.lean @@ -71,12 +71,12 @@ theorem isDefEqAfterLazyDeltaStopped_wf intro structurallyEqual afterStructural hstructural cases structurallyEqual with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => hleftEq.trans world.venvWF hI.2.1.wf <| (hstructural rfl).trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (RecM.WF.withInv <| resources.core hpair.leftSupport hleft) intro leftCore afterLeftCore hleftCore @@ -92,7 +92,7 @@ theorem isDefEqAfterLazyDeltaStopped_wf cases hchanged : (leftCore.addr != left.addr || rightCore.addr != right.addr) with | true => - simp only [if_true, pure_bind] + simp only [ite_true, pure_bind] refine RecM.WF.mono (RecM.WF.withInv <| RecM.isDefEqCall_wf hleftCoreSupport hrightCoreSupport hleftCoreTr hrightCoreTr) ?_ (fun _ _ h => h) @@ -103,10 +103,10 @@ theorem isDefEqAfterLazyDeltaStopped_wf hrightCoreEq.symm.trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases haddr : leftCore.addr == rightCore.addr with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => by have herase := collision.expr hleftCoreSupport hrightCoreSupport (eq_of_beq haddr) @@ -123,7 +123,7 @@ theorem isDefEqAfterLazyDeltaStopped_wf hrightCoreEq.symm.trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| quickDefEq_wf theory collision resources.sorts resources.quick hleftCoreSupport hrightCoreSupport @@ -131,7 +131,7 @@ theorem isDefEqAfterLazyDeltaStopped_wf intro quicklyEqual afterQuick hquick cases quicklyEqual with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => hleftEq.trans world.venvWF hI.2.1.wf <| hleftCoreEq.trans world.venvWF hI.2.1.wf <| @@ -139,14 +139,14 @@ theorem isDefEqAfterLazyDeltaStopped_wf hrightCoreEq.symm.trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind <| resources.application hleftCoreSupport hrightCoreSupport hleftCoreTr hrightCoreTr intro applicationsEqual afterApplication happlication cases applicationsEqual with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun hI _ => hleftEq.trans world.venvWF hI.2.1.wf <| hleftCoreEq.trans world.venvWF hI.2.1.wf <| @@ -155,7 +155,7 @@ theorem isDefEqAfterLazyDeltaStopped_wf hrightCoreEq.symm.trans world.venvWF hI.2.1.wf hrightEq.symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.mono (RecM.WF.withInv <| resources.finalWhnf hleftCoreSupport hrightCoreSupport hleftCoreTr hrightCoreTr) diff --git a/Ix/Tc/Verify/DefEq/StringLiteral.lean b/Ix/Tc/Verify/DefEq/StringLiteral.lean index 2b33592fc..75ab9c1be 100644 --- a/Ix/Tc/Verify/DefEq/StringLiteral.lean +++ b/Ix/Tc/Verify/DefEq/StringLiteral.lean @@ -141,30 +141,30 @@ theorem closesAfterBoolTrue unfold isDefEqInnerAfterBoolTrue cases hguard : hasStringLiteralPair a b with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind (tryStringLitExpansion_wf context hcanonical haSupport hbSupport ha hb) intro acceptedAB afterAB hacceptedAB cases acceptedAB with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => hacceptedAB rfl | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (tryStringLitExpansion_wf context hcanonical hbSupport haSupport hb ha) intro acceptedBA afterBA hacceptedBA cases acceptedBA with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => (hacceptedBA rfl).symm | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb /-- Assemble structural comparison, eager Bool reduction, and literal String diff --git a/Ix/Tc/Verify/DefEq/Structural.lean b/Ix/Tc/Verify/DefEq/Structural.lean index 195fc3905..19d18abfd 100644 --- a/Ix/Tc/Verify/DefEq/Structural.lean +++ b/Ix/Tc/Verify/DefEq/Structural.lean @@ -72,10 +72,10 @@ theorem quickBinder_wf intro domainsEqual afterDomains hdomains cases domainsEqual with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] exact RecM.WF.pure fun _ h => by contradiction | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.withLctxScope_openBinder_wf (layer := layer) (semantics := semantics) (trProj := trProj) (world := world) (uvars := uvars) (Delta := Delta) @@ -305,10 +305,10 @@ theorem closesInner intro quick afterQuick hquick cases quick with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact htail haSupport hbSupport ha hb | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ _ => hquick rfl end DefEqAfterQuick diff --git a/Ix/Tc/Verify/DefEq/StructuralCongruence.lean b/Ix/Tc/Verify/DefEq/StructuralCongruence.lean index 08b130443..1e26e3344 100644 --- a/Ix/Tc/Verify/DefEq/StructuralCongruence.lean +++ b/Ix/Tc/Verify/DefEq/StructuralCongruence.lean @@ -107,10 +107,10 @@ theorem tryStructuralCongruence_wf cases hguard : (leftId.addr != rightId.addr || leftField != rightField) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ h => by contradiction | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] obtain ⟨hid, hfield⟩ := Bool.or_eq_false_iff.mp hguard have hid' : leftId = rightId := KId.anon_eq_of_addr_eq <| eq_of_beq diff --git a/Ix/Tc/Verify/Inductive/AliasFormerFixture.lean b/Ix/Tc/Verify/Inductive/AliasFormerFixture.lean index e31af049b..af5df1140 100644 --- a/Ix/Tc/Verify/Inductive/AliasFormerFixture.lean +++ b/Ix/Tc/Verify/Inductive/AliasFormerFixture.lean @@ -435,7 +435,7 @@ def blockCatalog : BlockCatalog := fun id => familyIngressAfter.getBlock? id private theorem catalogTypeFamilyAliasNative : catalog typeFamilyAliasId = some typeFamilyAliasConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_typeFamilyAlias : catalog typeFamilyAliasId = some typeFamilyAliasConcrete := @@ -444,15 +444,15 @@ theorem catalog_typeFamilyAlias : private theorem catalogFamilyNative : catalog familyId = some familyConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some familyConcrete := catalogFamilyNative private theorem catalogMkNative : catalog mkId = some mkConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_mk : catalog mkId = some mkConcrete := catalogMkNative diff --git a/Ix/Tc/Verify/Inductive/AliasFormerRecursorFixture.lean b/Ix/Tc/Verify/Inductive/AliasFormerRecursorFixture.lean index b29ca8516..ab78cf8e2 100644 --- a/Ix/Tc/Verify/Inductive/AliasFormerRecursorFixture.lean +++ b/Ix/Tc/Verify/Inductive/AliasFormerRecursorFixture.lean @@ -403,7 +403,7 @@ private theorem catalogTypeFamilyAliasNative : catalog typeFamilyAliasId = some AliasFormerFixture.typeFamilyAliasConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_typeFamilyAlias : catalog typeFamilyAliasId = @@ -413,7 +413,7 @@ theorem catalog_typeFamilyAlias : private theorem catalogFamilyNative : catalog familyId = some AliasFormerFixture.familyConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some AliasFormerFixture.familyConcrete := @@ -422,8 +422,8 @@ theorem catalog_family : private theorem catalogMkNative : catalog mkId = some AliasFormerFixture.mkConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_mk : catalog mkId = some AliasFormerFixture.mkConcrete := catalogMkNative @@ -431,8 +431,8 @@ theorem catalog_mk : catalog mkId = some AliasFormerFixture.mkConcrete := private theorem catalogRecursorNative : catalog recursorId = some recursorConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_recursor : catalog recursorId = some recursorConcrete := catalogRecursorNative diff --git a/Ix/Tc/Verify/Inductive/AliasRecFixture.lean b/Ix/Tc/Verify/Inductive/AliasRecFixture.lean index 6106ea15b..1aa6f09ae 100644 --- a/Ix/Tc/Verify/Inductive/AliasRecFixture.lean +++ b/Ix/Tc/Verify/Inductive/AliasRecFixture.lean @@ -439,7 +439,7 @@ def blockCatalog : BlockCatalog := fun id => familyIngressAfter.getBlock? id private theorem catalogRecAliasNative : catalog recAliasId = some recAliasConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_recAlias : catalog recAliasId = some recAliasConcrete := catalogRecAliasNative @@ -447,15 +447,15 @@ theorem catalog_recAlias : catalog recAliasId = some recAliasConcrete := private theorem catalogFamilyNative : catalog familyId = some familyConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some familyConcrete := catalogFamilyNative private theorem catalogMkNative : catalog mkId = some mkConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_mk : catalog mkId = some mkConcrete := catalogMkNative diff --git a/Ix/Tc/Verify/Inductive/AliasRecRecursorFixture.lean b/Ix/Tc/Verify/Inductive/AliasRecRecursorFixture.lean index 8fc9dcbe3..ac43ab388 100644 --- a/Ix/Tc/Verify/Inductive/AliasRecRecursorFixture.lean +++ b/Ix/Tc/Verify/Inductive/AliasRecRecursorFixture.lean @@ -419,7 +419,7 @@ def blockCatalog : BlockCatalog := fun id => recursorIngressAfter.getBlock? id private theorem catalogRecAliasNative : catalog recAliasId = some AliasRecFixture.recAliasConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_recAlias : catalog recAliasId = some AliasRecFixture.recAliasConcrete := @@ -428,7 +428,7 @@ theorem catalog_recAlias : private theorem catalogFamilyNative : catalog familyId = some AliasRecFixture.familyConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some AliasRecFixture.familyConcrete := @@ -437,8 +437,8 @@ theorem catalog_family : private theorem catalogMkNative : catalog mkId = some AliasRecFixture.mkConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_mk : catalog mkId = some AliasRecFixture.mkConcrete := catalogMkNative @@ -446,8 +446,8 @@ theorem catalog_mk : catalog mkId = some AliasRecFixture.mkConcrete := private theorem catalogRecursorNative : catalog recursorId = some recursorConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_recursor : catalog recursorId = some recursorConcrete := catalogRecursorNative diff --git a/Ix/Tc/Verify/Inductive/AnnotatedPiFixture.lean b/Ix/Tc/Verify/Inductive/AnnotatedPiFixture.lean index 1809344e6..8a0ff0c78 100644 --- a/Ix/Tc/Verify/Inductive/AnnotatedPiFixture.lean +++ b/Ix/Tc/Verify/Inductive/AnnotatedPiFixture.lean @@ -440,7 +440,7 @@ def blockCatalog : BlockCatalog := fun id => familyIngressAfter.getBlock? id private theorem catalogOutParamNative : catalog outParamId = some outParamConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_outParam : catalog outParamId = some outParamConcrete := catalogOutParamNative @@ -448,15 +448,15 @@ theorem catalog_outParam : catalog outParamId = some outParamConcrete := private theorem catalogFamilyNative : catalog familyId = some familyConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some familyConcrete := catalogFamilyNative private theorem catalogMkNative : catalog mkId = some mkConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_mk : catalog mkId = some mkConcrete := catalogMkNative diff --git a/Ix/Tc/Verify/Inductive/AnnotatedPiRecursorFixture.lean b/Ix/Tc/Verify/Inductive/AnnotatedPiRecursorFixture.lean index f317169c2..193e0c5ff 100644 --- a/Ix/Tc/Verify/Inductive/AnnotatedPiRecursorFixture.lean +++ b/Ix/Tc/Verify/Inductive/AnnotatedPiRecursorFixture.lean @@ -424,7 +424,7 @@ def blockCatalog : BlockCatalog := fun id => recursorIngressAfter.getBlock? id private theorem catalogOutParamNative : catalog outParamId = some AnnotatedPiFixture.outParamConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_outParam : catalog outParamId = some AnnotatedPiFixture.outParamConcrete := @@ -433,7 +433,7 @@ theorem catalog_outParam : private theorem catalogFamilyNative : catalog familyId = some AnnotatedPiFixture.familyConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some AnnotatedPiFixture.familyConcrete := @@ -442,8 +442,8 @@ theorem catalog_family : private theorem catalogMkNative : catalog mkId = some AnnotatedPiFixture.mkConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_mk : catalog mkId = some AnnotatedPiFixture.mkConcrete := catalogMkNative @@ -451,8 +451,8 @@ theorem catalog_mk : catalog mkId = some AnnotatedPiFixture.mkConcrete := private theorem catalogRecursorNative : catalog recursorId = some recursorConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_recursor : catalog recursorId = some recursorConcrete := catalogRecursorNative diff --git a/Ix/Tc/Verify/Inductive/ConstructorValidationTraversal.lean b/Ix/Tc/Verify/Inductive/ConstructorValidationTraversal.lean index 3b2914fd9..1bab149e5 100644 --- a/Ix/Tc/Verify/Inductive/ConstructorValidationTraversal.lean +++ b/Ix/Tc/Verify/Inductive/ConstructorValidationTraversal.lean @@ -112,7 +112,7 @@ theorem run simp only cases positivity with | safe positivityRun positivityTrace => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] rw [ReaderT.run_bind] change EStateM.bind ((RecM.checkPositivity _ indParams blockAddrs).run methods) _ _ = _ @@ -127,7 +127,7 @@ theorem run simp only exact returnType | skipped => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((RecM.checkFieldUniverses _ indParams indLevel).run methods) _ _ = _ @@ -381,7 +381,7 @@ theorem checkInductiveConstructor_success (methods : Methods m) cases hunsafe : indIsUnsafe with | false => simp only [hunsafe] at hmetadata - simp only [hunsafe, Bool.not_false, if_true] at hrun + simp only [hunsafe, Bool.not_false, ite_true] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((checkPositivity ctorTy indParams blockAddrs).run methods) _ @@ -416,7 +416,7 @@ theorem checkInductiveConstructor_success (methods : Methods m) huniverses hrun | true => simp only [hunsafe] at hmetadata - simp only [hunsafe, Bool.not_true, Bool.false_eq_true, if_false, + simp only [hunsafe, Bool.not_true, Bool.false_eq_true, ite_false, ReaderT.run_pure, pure_bind] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind diff --git a/Ix/Tc/Verify/Inductive/EnumerationFixture.lean b/Ix/Tc/Verify/Inductive/EnumerationFixture.lean index 641e2ef46..b2f42a4b7 100644 --- a/Ix/Tc/Verify/Inductive/EnumerationFixture.lean +++ b/Ix/Tc/Verify/Inductive/EnumerationFixture.lean @@ -1148,7 +1148,7 @@ theorem trustedCatalog : TrustedCatalogRel RawProjRel.none world := private theorem catalogFamilyNative : catalog familyId = some familyConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some familyConcrete := catalogFamilyNative @@ -1156,7 +1156,7 @@ theorem catalog_family : catalog familyId = some familyConcrete := private theorem catalogFalseNative : catalog falseId = some falseConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_false : catalog falseId = some falseConcrete := catalogFalseNative @@ -1164,8 +1164,8 @@ theorem catalog_false : catalog falseId = some falseConcrete := private theorem catalogTrueNative : catalog trueId = some trueConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_true : catalog trueId = some trueConcrete := catalogTrueNative @@ -1173,8 +1173,8 @@ theorem catalog_true : catalog trueId = some trueConcrete := private theorem catalogRecursorNative : catalog recursorId = some recursorConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_recursor : catalog recursorId = some recursorConcrete := catalogRecursorNative diff --git a/Ix/Tc/Verify/Inductive/GeneratedRecursorComparison.lean b/Ix/Tc/Verify/Inductive/GeneratedRecursorComparison.lean index 49b7efd07..46560b3e8 100644 --- a/Ix/Tc/Verify/Inductive/GeneratedRecursorComparison.lean +++ b/Ix/Tc/Verify/Inductive/GeneratedRecursorComparison.lean @@ -105,7 +105,7 @@ theorem checkGeneratedRecursorRules_success generatedRules[index]!.fields = storedRules[index]!.fields := by simpa using hfields - simp only [hfields, Bool.false_eq_true, if_false, pure_bind, + simp only [hfields, Bool.false_eq_true, ite_false, pure_bind, ReaderT.run_bind, runTcBind] at hrun generalize hcomparison : (isDefEq generatedRules[index]!.rhs @@ -116,7 +116,7 @@ theorem checkGeneratedRecursorRules_success | ok answer afterComparison => cases answer with | false => - simp only [Bool.not_false, if_true, throw, ReaderT.run] + simp only [Bool.not_false, ite_true, throw, ReaderT.run] at hrun contradiction | true => @@ -125,7 +125,7 @@ theorem checkGeneratedRecursorRules_success (checkGeneratedRecursorRules_success generatedRules storedRules methods hrun) | true => - simp only [hfields, if_true, throw, ReaderT.run] at hrun + simp only [hfields, ite_true, throw, ReaderT.run] at hrun contradiction /-- Every successful selected-candidate comparison takes all guards and @@ -143,26 +143,26 @@ theorem checkGeneratedRecursorCandidate_success unfold checkGeneratedRecursorCandidate at hrun cases hlevels : (declaredLvls != generated.lvls) with | true => - simp only [hlevels, if_true, throw, ReaderT.run] at hrun + simp only [hlevels, ite_true, throw, ReaderT.run] at hrun contradiction | false => have levels : declaredLvls = generated.lvls := by simpa using hlevels - simp only [hlevels, Bool.false_eq_true, if_false, pure_bind] at hrun + simp only [hlevels, Bool.false_eq_true, ite_false, pure_bind] at hrun cases hsafety : (declaredIsUnsafe != generated.isUnsafe) with | true => - simp only [hsafety, if_true, throw, ReaderT.run] + simp only [hsafety, ite_true, throw, ReaderT.run] at hrun contradiction | false => have safety : declaredIsUnsafe = generated.isUnsafe := by simpa using hsafety - simp only [hsafety, Bool.false_eq_true, if_false] at hrun + simp only [hsafety, Bool.false_eq_true, ite_false] at hrun cases hmetadata : (params != generated.params || motives != generated.motives || minors != generated.minors || indices != generated.indices) with | true => - simp only [hmetadata, if_true, throw, ReaderT.run] + simp only [hmetadata, ite_true, throw, ReaderT.run] at hrun contradiction | false => @@ -172,7 +172,7 @@ theorem checkGeneratedRecursorCandidate_success minors = generated.minors) ∧ indices = generated.indices := by simpa using hmetadata - simp only [hmetadata, Bool.false_eq_true, if_false, + simp only [hmetadata, Bool.false_eq_true, ite_false, ReaderT.run_bind, runTcBind] at hrun generalize htype : (isDefEq generated.ty ty).run methods initial = typeResult @@ -182,7 +182,7 @@ theorem checkGeneratedRecursorCandidate_success | ok answer afterType => cases answer with | false => - simp only [Bool.not_false, if_true, throw, ReaderT.run] + simp only [Bool.not_false, ite_true, throw, ReaderT.run] at hrun contradiction | true => @@ -190,26 +190,26 @@ theorem checkGeneratedRecursorCandidate_success cases hmissing : (generated.rules.isEmpty && !storedRules.isEmpty) with | true => - simp only [hmissing, if_true, throw, + simp only [hmissing, ite_true, throw, ReaderT.run] at hrun contradiction | false => - simp only [hmissing, Bool.false_eq_true, if_false] + simp only [hmissing, Bool.false_eq_true, ite_false] at hrun cases hstoredMissing : (!generated.rules.isEmpty && storedRules.isEmpty) with | true => - simp only [hstoredMissing, if_true, + simp only [hstoredMissing, ite_true, throw, ReaderT.run] at hrun contradiction | false => simp only [hstoredMissing, Bool.false_eq_true, - if_false] at hrun + ite_false] at hrun cases hcount : (generated.rules.size != storedRules.size) with | true => - simp only [hcount, if_true, + simp only [hcount, ite_true, throw, ReaderT.run] at hrun contradiction | false => @@ -218,7 +218,7 @@ theorem checkGeneratedRecursorCandidate_success storedRules.size := by simpa using hcount simp only [hcount, Bool.false_eq_true, - if_false] at hrun + ite_false] at hrun refine ⟨levels, safety, metadata.1.1.1, metadata.1.1.2, metadata.1.2, metadata.2, afterType, htype, count, ?_⟩ diff --git a/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberCheck.lean b/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberCheck.lean index 5ff2c1550..a410ff590 100644 --- a/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberCheck.lean +++ b/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberCheck.lean @@ -243,7 +243,7 @@ theorem checkInductive_cached_run state = _ unfold EStateM.bind rw [scan] - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ state = _ unfold EStateM.bind @@ -428,7 +428,7 @@ theorem findUsableGeneratedRecursorBlock_loaded_run rw [show (get : TcM .anon (TcState .anon)) state = .ok state state from rfl] simp only [cache] - rw [if_pos largeEnough] + rw [ite_eq_left largeEnough] rfl /-- The successful usable-cache branch of block resolution performs no work diff --git a/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberFixture.lean b/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberFixture.lean index 8e50253b5..b16df01c2 100644 --- a/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberFixture.lean +++ b/Ix/Tc/Verify/Inductive/GeneratedRecursorMemberFixture.lean @@ -1914,7 +1914,7 @@ theorem familyMemberComputeKTargetRunNeutral : rw [familyMemberDiscoveryRunNeutral] simp only rw [familyMemberSingletonSizeNative] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] change EStateM.bind ((RecM.checkedMetadataSum "inductive params + indices" #[1, 1]).run checkerMethods) _ familyMemberMajorAfter = _ diff --git a/Ix/Tc/Verify/Inductive/IndexedRecursiveFixture.lean b/Ix/Tc/Verify/Inductive/IndexedRecursiveFixture.lean index 82b0a5bec..10701f6ba 100644 --- a/Ix/Tc/Verify/Inductive/IndexedRecursiveFixture.lean +++ b/Ix/Tc/Verify/Inductive/IndexedRecursiveFixture.lean @@ -1057,49 +1057,49 @@ def blockCatalog : BlockCatalog := fun id => recursorIngressAfter.getBlock? id private theorem catalogFamilyNative : catalog familyId = some familyConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some familyConcrete := catalogFamilyNative private theorem catalogNilNative : catalog nilId = some nilConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_nil : catalog nilId = some nilConcrete := catalogNilNative private theorem catalogConsNative : catalog consId = some consConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_cons : catalog consId = some consConcrete := catalogConsNative private theorem catalogRecursorNative : catalog recursorId = some recursorConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_recursor : catalog recursorId = some recursorConcrete := catalogRecursorNative private theorem catalogNatNative : catalog natId = some natConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_nat : catalog natId = some natConcrete := catalogNatNative private theorem catalogZeroNative : catalog zeroId = some zeroConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_zero : catalog zeroId = some zeroConcrete := catalogZeroNative private theorem catalogSuccNative : catalog succId = some succConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_succ : catalog succId = some succConcrete := catalogSuccNative private theorem natEntryAtZeroNative : diff --git a/Ix/Tc/Verify/Inductive/MutualFamilyAdmission.lean b/Ix/Tc/Verify/Inductive/MutualFamilyAdmission.lean index 1e90ad411..c08444efb 100644 --- a/Ix/Tc/Verify/Inductive/MutualFamilyAdmission.lean +++ b/Ix/Tc/Verify/Inductive/MutualFamilyAdmission.lean @@ -94,109 +94,109 @@ theorem allPhysicalEntriesLoaded_eq : allPhysicalEntriesLoaded = true := theorem catalog_tree : catalog treeId = some treeConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_treeList : catalog treeListId = some treeListConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_leaf : catalog treeLeafId = some treeLeafConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_node : catalog treeNodeId = some treeNodeConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_branch : catalog treeBranchId = some treeBranchConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_nil : catalog treeListNilId = some treeListNilConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_cons : catalog treeListConsId = some treeListConsConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_treeRec : catalog treeRecId = some treeRecConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_treeListRec : catalog treeListRecId = some treeListRecConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nameOf_tree : nameOf treeId.addr = some ``Tree := by unfold nameOf - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem nameOf_treeList : nameOf treeListId.addr = some ``TreeList := by unfold nameOf - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nameOf_leaf : nameOf treeLeafId.addr = some ``Tree.leaf := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nameOf_node : nameOf treeNodeId.addr = some ``Tree.node := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nameOf_branch : nameOf treeBranchId.addr = some ``Tree.branch := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nameOf_nil : nameOf treeListNilId.addr = some ``TreeList.nil := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nameOf_cons : nameOf treeListConsId.addr = some ``TreeList.cons := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nameOf_treeRec : nameOf treeRecId.addr = some ``Tree.rec := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nameOf_treeListRec : nameOf treeListRecId.addr = some ``TreeList.rec := by unfold nameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] def blockCatalog : BlockCatalog := fun id => recursorIngressAfter.getBlock? id diff --git a/Ix/Tc/Verify/Inductive/NestedAdmission.lean b/Ix/Tc/Verify/Inductive/NestedAdmission.lean index d5e632520..aa8268e08 100644 --- a/Ix/Tc/Verify/Inductive/NestedAdmission.lean +++ b/Ix/Tc/Verify/Inductive/NestedAdmission.lean @@ -78,31 +78,31 @@ def nestedNameOf (address : Address) : Option Lean.Name := theorem nestedCatalog_tree : nestedCatalog treeId = some treeConcrete := by unfold nestedCatalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem nestedCatalog_node : nestedCatalog nodeId = some nodeConcrete := by unfold nestedCatalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedNameOf_box : nestedNameOf boxId.addr = some ``LeanBox := by unfold nestedNameOf - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem nestedNameOf_wrap : nestedNameOf wrapId.addr = some ``LeanBox.wrap := by unfold nestedNameOf - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedNameOf_tree : nestedNameOf treeId.addr = some ``LeanTree := by unfold nestedNameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nestedNameOf_node : nestedNameOf nodeId.addr = some ``LeanTree.node := by unfold nestedNameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] def nestedBlockCatalog : BlockCatalog := fun id => treeIngressAfter.getBlock? id diff --git a/Ix/Tc/Verify/Inductive/NestedAuxiliaryExpansion.lean b/Ix/Tc/Verify/Inductive/NestedAuxiliaryExpansion.lean index e45a41f02..c3b47d908 100644 --- a/Ix/Tc/Verify/Inductive/NestedAuxiliaryExpansion.lean +++ b/Ix/Tc/Verify/Inductive/NestedAuxiliaryExpansion.lean @@ -500,7 +500,7 @@ theorem appendNestedAuxiliary_fresh final result := by unfold NestedFlatAuxiliaryRequest.key at fresh unfold appendNestedAuxiliary at run - simp only [fresh, Bool.false_eq_true, if_false, ReaderT.run_bind, + simp only [fresh, Bool.false_eq_true, ite_false, ReaderT.run_bind, ReaderT.run_pure, pure_bind] at run change EStateM.bind ((mkIndUnivs request.lvls univOffset).run methods) _ initial = .ok result final at run @@ -620,18 +620,18 @@ theorem tryDetectNestedCore_transition case const headId occurrenceUs headInfo => simp only at run by_cases hblock : blockAddrs.contains headId.addr = true - · rw [if_pos hblock] at run + · rw [ite_eq_left hblock] at run cases run exact .unchanged - · rw [if_neg hblock] at run + · rw [ite_eq_right hblock] at run simp only [pure_bind] at run by_cases horiginal : flat.any (fun mem => mem.id.addr == headId.addr && !mem.isAux) = true - · rw [if_pos horiginal] at run + · rw [ite_eq_left horiginal] at run cases run exact .unchanged - · rw [if_neg horiginal] at run + · rw [ite_eq_right horiginal] at run simp only [ReaderT.run_bind, ReaderT.run_monadLift] at run change EStateM.bind (TcM.tryGetConst headId) _ after = _ at run unfold EStateM.bind at run @@ -656,19 +656,19 @@ theorem tryDetectNestedCore_transition rename_i indName levelParams extLvls extParams extIndices isUnsafe block memberIdx indTy extCtors leanAll by_cases harity : args.size < extParams.toNat - · rw [if_pos harity] at run + · rw [ite_eq_left harity] at run simp only [ReaderT.run_pure] at run cases run exact .unchanged - · rw [if_neg harity] at run + · rw [ite_eq_right harity] at run by_cases hnested : (!(args.extract 0 extParams.toNat).any (exprMentionsAnyAddr · blockAddrs)) = true - · rw [if_pos hnested] at run + · rw [ite_eq_left hnested] at run simp only [ReaderT.run_pure] at run cases run exact .unchanged - · rw [if_neg hnested] at run + · rw [ite_eq_right hnested] at run rw [ReaderT.run_bind] at run change EStateM.bind ((checkedNatMetadataSum "nested parameter scope" @@ -689,11 +689,11 @@ theorem tryDetectNestedCore_transition (!(args.extract 0 extParams.toNat).all (fun sp => !sp.hasFVars && sp.lbr ≤ paramBound)) = true - · rw [if_pos hs7] at run + · rw [ite_eq_left hs7] at run simp only [ReaderT.run_pure] at run cases run exact .unchanged - · rw [if_neg hs7] at run + · rw [ite_eq_right hs7] at run let request : NestedFlatAuxiliaryRequest m := { id := headId occurrenceUs := occurrenceUs @@ -1050,11 +1050,11 @@ theorem buildFlatBlockQueueStep_history unfold buildFlatBlockQueueStep at run simp only at run by_cases hdone : qi ≥ flat0.size - · rw [if_pos hdone] at run + · rw [ite_eq_left hdone] at run simp only [ReaderT.run_pure] at run cases run exact .refl (flat0, auxSeen0) - · rw [if_neg hdone] at run + · rw [ite_eq_right hdone] at run rw [ReaderT.run_bind] at run change EStateM.bind ((scanFlatConstructors allBlockAddrs nRecParams univOffset flat0[qi]! diff --git a/Ix/Tc/Verify/Inductive/NestedPositivityTraversal.lean b/Ix/Tc/Verify/Inductive/NestedPositivityTraversal.lean index 46a3b46ca..ebec9cfb0 100644 --- a/Ix/Tc/Verify/Inductive/NestedPositivityTraversal.lean +++ b/Ix/Tc/Verify/Inductive/NestedPositivityTraversal.lean @@ -429,7 +429,7 @@ theorem checkNestedPositivityApplicationCheckedFuel_success simp only at hrun cases hmention : nestedParametersMentionRoot args nParams rootAddrs with | false => - simp only [hmention, Bool.not_false, if_true] at hrun + simp only [hmention, Bool.not_false, ite_true] at hrun change EStateM.Result.error _ initial = .ok () final at hrun contradiction | true => @@ -437,7 +437,7 @@ theorem checkNestedPositivityApplicationCheckedFuel_success cases hindependent : positiveIndicesIndependent args nParams rootAddrs with | false => - simp only [hindependent, Bool.not_false, if_true] at hrun + simp only [hindependent, Bool.not_false, ite_true] at hrun change EStateM.Result.error _ initial = .ok () final at hrun contradiction | true => @@ -447,7 +447,7 @@ theorem checkNestedPositivityApplicationCheckedFuel_success simp only at hrun cases hindependent : positiveIndicesIndependent args nParams rootAddrs with | false => - simp only [hindependent, Bool.not_false, if_true] at hrun + simp only [hindependent, Bool.not_false, ite_true] at hrun change EStateM.Result.error _ initial = .ok () final at hrun contradiction | true => diff --git a/Ix/Tc/Verify/Inductive/NestedRecursorPattern.lean b/Ix/Tc/Verify/Inductive/NestedRecursorPattern.lean index 8ea13cd7e..ffabb6d2b 100644 --- a/Ix/Tc/Verify/Inductive/NestedRecursorPattern.lean +++ b/Ix/Tc/Verify/Inductive/NestedRecursorPattern.lean @@ -68,74 +68,74 @@ def nestedRecursorNameOf (address : Address) : Option Lean.Name := theorem nestedRecursorCatalog_box : nestedRecursorCatalog boxId = some boxConcrete := by unfold nestedRecursorCatalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem nestedRecursorCatalog_wrap : nestedRecursorCatalog wrapId = some wrapConcrete := by unfold nestedRecursorCatalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedRecursorCatalog_tree : nestedRecursorCatalog treeId = some treeConcrete := by unfold nestedRecursorCatalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nestedRecursorCatalog_node : nestedRecursorCatalog nodeId = some nodeConcrete := by unfold nestedRecursorCatalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedRecursorCatalog_treeRec : nestedRecursorCatalog treeRecId = some treeRecConcrete := by unfold nestedRecursorCatalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nestedRecursorCatalog_treeRecOne : nestedRecursorCatalog treeRecOneId = some treeRecOneConcrete := by unfold nestedRecursorCatalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedRecursorNameOf_box : nestedRecursorNameOf boxId.addr = some ``LeanBox := by unfold nestedRecursorNameOf - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem nestedRecursorNameOf_wrap : nestedRecursorNameOf wrapId.addr = some ``LeanBox.wrap := by unfold nestedRecursorNameOf - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedRecursorNameOf_tree : nestedRecursorNameOf treeId.addr = some ``LeanTree := by unfold nestedRecursorNameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nestedRecursorNameOf_node : nestedRecursorNameOf nodeId.addr = some ``LeanTree.node := by unfold nestedRecursorNameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem nestedRecursorNameOf_treeRec : nestedRecursorNameOf treeRecId.addr = some ``LeanTree.rec := by unfold nestedRecursorNameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem nestedRecursorNameOf_treeRecOne : nestedRecursorNameOf treeRecOneId.addr = some ``LeanTree.rec_1 := by unfold nestedRecursorNameOf - rw [if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_neg (by native_decide), - if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_right (by native_decide), ite_eq_left (by native_decide)] /-! ## Exact physical rules and finite representation facts -/ diff --git a/Ix/Tc/Verify/Inductive/OccurrenceValidation.lean b/Ix/Tc/Verify/Inductive/OccurrenceValidation.lean index d05995579..4bc2cad5f 100644 --- a/Ix/Tc/Verify/Inductive/OccurrenceValidation.lean +++ b/Ix/Tc/Verify/Inductive/OccurrenceValidation.lean @@ -270,7 +270,7 @@ theorem checkPositiveParametersFrom_success | ok answer afterComparison => cases answer with | false => - simp only [Bool.not_false, if_true] at hrun + simp only [Bool.not_false, ite_true] at hrun change EStateM.Result.error _ afterComparison = .ok () final at hrun contradiction @@ -416,7 +416,7 @@ theorem checkPositiveRecursiveApplicationHeader_success cases hindependent : positiveIndicesIndependent args nParams rootAddrs with | false => - simp only [hindependent, Bool.not_false, if_true] at hrun + simp only [hindependent, Bool.not_false, ite_true] at hrun change EStateM.Result.error _ afterParameters = .ok () final at hrun contradiction diff --git a/Ix/Tc/Verify/Inductive/PositivityTraversal.lean b/Ix/Tc/Verify/Inductive/PositivityTraversal.lean index 4db3e0f54..07fca76b9 100644 --- a/Ix/Tc/Verify/Inductive/PositivityTraversal.lean +++ b/Ix/Tc/Verify/Inductive/PositivityTraversal.lean @@ -149,7 +149,7 @@ theorem checkPositivityDomainFuel_direct (checkPositiveRecursiveApplication id us args groups rootGroup.addrs).run methods afterWhnf = .ok () final := by unfold checkPositivityDomainFuel at hrun - simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, if_false] + simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnf dom).run methods) _ initial = _ at hrun @@ -180,7 +180,7 @@ theorem checkPositivityDomainFuel_direct_run (checkPositivityDomainFuel (fuel + 1) dom groups activeAddrs).run methods initial = .ok () final := by unfold checkPositivityDomainFuel - simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, if_false] + simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnf dom).run methods) _ initial = _ unfold EStateM.bind @@ -231,7 +231,7 @@ theorem checkPositivityDomainFuel_nested (checkNestedPositivityApplicationFuel fuel id us args groups rootGroup.addrs activeAddrs).run methods afterWhnf = .ok () final := by unfold checkPositivityDomainFuel at hrun - simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, if_false] + simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnf dom).run methods) _ initial = _ at hrun @@ -265,13 +265,13 @@ theorem checkPositivityDomainFuel_forall_success final = { afterRecursive with lctx := afterRecursive.lctx.truncate afterWhnf.lctx.size } := by unfold checkPositivityDomainFuel at hrun - simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, if_false] + simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnf dom).run methods) _ initial = _ at hrun unfold EStateM.bind at hrun rw [hwhnf] at hrun - simp only [hnegative, Bool.false_eq_true, if_false] at hrun + simp only [hnegative, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind (get : TcM m (TcState m)) _ afterWhnf = _ at hrun unfold EStateM.bind at hrun @@ -315,12 +315,12 @@ theorem checkPositivityDomainFuel_forall_negative methods initial = .error (.other "strict positivity violation") afterWhnf := by unfold checkPositivityDomainFuel - simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, if_false] + simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnf dom).run methods) _ initial = _ unfold EStateM.bind rw [hwhnf] - simp only [hnegative, if_true, throw] + simp only [hnegative, ite_true, throw] rfl end RecM diff --git a/Ix/Tc/Verify/Inductive/RecursivePiFixture.lean b/Ix/Tc/Verify/Inductive/RecursivePiFixture.lean index 0d288d901..edb0a73c3 100644 --- a/Ix/Tc/Verify/Inductive/RecursivePiFixture.lean +++ b/Ix/Tc/Verify/Inductive/RecursivePiFixture.lean @@ -375,7 +375,7 @@ def blockCatalog : BlockCatalog := fun id => ingressAfter.getBlock? id private theorem catalogFamilyNative : catalog familyId = some familyConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some familyConcrete := catalogFamilyNative @@ -383,7 +383,7 @@ theorem catalog_family : catalog familyId = some familyConcrete := private theorem catalogIntroNative : catalog introId = some introConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_intro : catalog introId = some introConcrete := catalogIntroNative diff --git a/Ix/Tc/Verify/Inductive/RecursivePiRecursorFixture.lean b/Ix/Tc/Verify/Inductive/RecursivePiRecursorFixture.lean index f73c5de7d..532d78889 100644 --- a/Ix/Tc/Verify/Inductive/RecursivePiRecursorFixture.lean +++ b/Ix/Tc/Verify/Inductive/RecursivePiRecursorFixture.lean @@ -446,7 +446,7 @@ def blockCatalog : BlockCatalog := fun id => recursorIngressAfter.getBlock? id private theorem catalogFamilyNative : catalog familyId = some RecursivePiFixture.familyConcrete := by unfold catalog - rw [if_pos (by native_decide)] + rw [ite_eq_left (by native_decide)] theorem catalog_family : catalog familyId = some RecursivePiFixture.familyConcrete := @@ -455,7 +455,7 @@ theorem catalog_family : private theorem catalogIntroNative : catalog introId = some RecursivePiFixture.introConcrete := by unfold catalog - rw [if_neg (by native_decide), if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_left (by native_decide)] theorem catalog_intro : catalog introId = some RecursivePiFixture.introConcrete := @@ -464,8 +464,8 @@ theorem catalog_intro : private theorem catalogRecursorNative : catalog recursorId = some recursorConcrete := by unfold catalog - rw [if_neg (by native_decide), if_neg (by native_decide), - if_pos (by native_decide)] + rw [ite_eq_right (by native_decide), ite_eq_right (by native_decide), + ite_eq_left (by native_decide)] theorem catalog_recursor : catalog recursorId = some recursorConcrete := catalogRecursorNative diff --git a/Ix/Tc/Verify/Inductive/RecursivePositivityTraversal.lean b/Ix/Tc/Verify/Inductive/RecursivePositivityTraversal.lean index 8e16bb435..9fb523ba3 100644 --- a/Ix/Tc/Verify/Inductive/RecursivePositivityTraversal.lean +++ b/Ix/Tc/Verify/Inductive/RecursivePositivityTraversal.lean @@ -108,7 +108,7 @@ private theorem positivityTerminal_success activeAddrs methods afterWhnf final := by have hfull := hrun unfold checkPositivityDomainFuel at hrun - simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, if_false] + simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnf dom).run methods) _ initial = _ at hrun @@ -211,7 +211,7 @@ theorem checkPositivityDomainFuel_success have hfull := hrun unfold checkPositivityDomainFuel at hrun simp only [hroot, hmentions, Bool.not_true, Bool.false_eq_true, - if_false] at hrun + ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnf dom).run methods) _ initial = _ at hrun unfold EStateM.bind at hrun @@ -226,7 +226,7 @@ theorem checkPositivityDomainFuel_success cases hnegative : exprMentionsAnyAddr innerDom rootGroup.addrs with | true => - simp only [hnegative, if_true, throw, ReaderT.run] at hrun + simp only [hnegative, ite_true, throw, ReaderT.run] at hrun contradiction | false => rcases checkPositivityDomainFuel_forall_success hroot diff --git a/Ix/Tc/Verify/Infer.lean b/Ix/Tc/Verify/Infer.lean index 8f347c140..9ae2cfd1c 100644 --- a/Ix/Tc/Verify/Infer.lean +++ b/Ix/Tc/Verify/Infer.lean @@ -113,7 +113,7 @@ theorem inferWith_inferOnlyHit unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s' = .ok s' s' from rfl] simp only [hfullMiss, hpolicy] - simp only [pure_bind, if_true] + simp only [pure_bind, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ s' = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Infer/Applications.lean b/Ix/Tc/Verify/Infer/Applications.lean index 53a71457b..d4c88e3ba 100644 --- a/Ix/Tc/Verify/Infer/Applications.lean +++ b/Ix/Tc/Verify/Infer/Applications.lean @@ -187,7 +187,7 @@ theorem inferUncached_app_wf cases inferOnly with | false => unfold inferUncached - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply RecM.WF.bind (RecM.WF.withInv <| RecM.inferCall_wf hfunSupport hfunTr) intro fTy afterFun hfunPost @@ -215,14 +215,14 @@ theorem inferUncached_app_wf rcases heager with ⟨_, rfl⟩ cases eager with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (RecM.isDefEqCall_wf haTySupport hdomSupport haTyCoreTr hdomTr) intro equal afterEq _ cases equal with | false => - simp only [Bool.not_false, if_true, pure_bind] + simp only [Bool.not_false, ite_true, pure_bind] apply RecM.WF.bind (Q₁ := fun read state => read = state) (RecM.WF.get fun _ => rfl) @@ -233,11 +233,11 @@ theorem inferUncached_app_wf intro _ _ impossible exact impossible.elim | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact finishApplication_wf hrun theory hfun harg hargTr hfTy hview hcodTr (hsubst hcodSupport) | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind (RecM.setEagerReduce_wf true) intro _ afterSet _ apply RecM.WF.bind @@ -248,7 +248,7 @@ theorem inferUncached_app_wf intro _ afterReset _ cases equal with | false => - simp only [Bool.not_false, if_true, pure_bind] + simp only [Bool.not_false, ite_true, pure_bind] apply RecM.WF.bind (Q₁ := fun read state => read = state) (RecM.WF.get fun _ => rfl) @@ -259,12 +259,12 @@ theorem inferUncached_app_wf intro _ _ impossible exact impossible.elim | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] exact finishApplication_wf hrun theory hfun harg hargTr hfTy hview hcodTr (hsubst hcodSupport) | true => unfold inferUncached - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] apply RecM.WF.bind (RecM.WF.withInv <| RecM.inferCall_wf hfunSupport hfunTr) intro fTy afterFun hfunPost diff --git a/Ix/Tc/Verify/Infer/BinderClosing.lean b/Ix/Tc/Verify/Infer/BinderClosing.lean index a9773d984..5c59fe47f 100644 --- a/Ix/Tc/Verify/Infer/BinderClosing.lean +++ b/Ix/Tc/Verify/Infer/BinderClosing.lean @@ -132,7 +132,7 @@ theorem TrKExprS.closeFVarSpec | @var _ _ _ _ e A hfind => rw [KExpr.mkVar_shape, KExpr.abstractFVarsSpec] by_cases hge : idx ≥ depth - · rw [if_pos hge, KExpr.mkVar_shape] + · rw [ite_eq_left hge, KExpr.mkVar_shape] refine .var (A := A) ?_ have hsucc : (idx + 1).toNat = idx.toNat + 1 := by rw [UInt64.toNat_add, show (1 : UInt64).toNat = 1 from rfl, @@ -141,7 +141,7 @@ theorem TrKExprS.closeFVarSpec exact W.find?_ge_rev (by rw [← hdepth] exact UInt64.le_iff_toNat_le.mp hge) hfind - · rw [if_neg hge] + · rw [ite_eq_right hge] refine .var (A := A) ?_ exact W.find?_lt_rev (by rw [← hdepth] diff --git a/Ix/Tc/Verify/Infer/BinderOpening.lean b/Ix/Tc/Verify/Infer/BinderOpening.lean index ea9092332..f57c596e6 100644 --- a/Ix/Tc/Verify/Infer/BinderOpening.lean +++ b/Ix/Tc/Verify/Infer/BinderOpening.lean @@ -156,7 +156,7 @@ theorem TrKExprS.openFVar UInt64.lt_iff_toNat_lt.mpr (by rw [hsuccNat]; omega) have hwindow : ((depth ≥ depth && depth < depth + 1) = true) := by simp [hlt] - rw [if_pos hwindow] + rw [ite_eq_left hwindow] simp exact .fvar (W.find?_hit (by simpa [hdepth] using hfind)) · by_cases hgt : depth < i @@ -171,7 +171,7 @@ theorem TrKExprS.openFVar omega have hwindow : ¬((i ≥ depth && i < depth + 1) = true) := by simp [hnltSucc] - rw [if_neg hwindow, if_pos hgeSucc, KExpr.mkVar_shape] + rw [ite_eq_right hwindow, ite_eq_left hgeSucc, KExpr.mkVar_shape] refine .var (A := A) ?_ have hOneLe : (1 : UInt64) ≤ i := UInt64.le_iff_toNat_le.mpr (by @@ -201,7 +201,7 @@ theorem TrKExprS.openFVar omega)) have hwindow : ¬((i ≥ depth && i < depth + 1) = true) := by simp [hnge] - rw [if_neg hwindow, if_neg hngeSucc] + rw [ite_eq_right hwindow, ite_eq_right hngeSucc] exact .var (W.find?_lt hlt hfind) | @fvar source fv name info e A hfind => intro fvData decl target dk depth fvName W hdepth hfresh hbig diff --git a/Ix/Tc/Verify/Infer/CacheShell.lean b/Ix/Tc/Verify/Infer/CacheShell.lean index e9166c92e..c1a34a8cb 100644 --- a/Ix/Tc/Verify/Infer/CacheShell.lean +++ b/Ix/Tc/Verify/Infer/CacheShell.lean @@ -87,7 +87,7 @@ theorem inferWith_fullMiss_success change EStateM.bind (get : TcM .anon (TcState .anon)) _ sKey = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) sKey = .ok sKey sKey from rfl] - simp only [hfullMiss, Bool.false_eq_true, if_false] + simp only [hfullMiss, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((inferUncached inferRec false source).run methods) _ sKey = _ @@ -123,7 +123,7 @@ theorem inferWith_fullMiss_error change EStateM.bind (get : TcM .anon (TcState .anon)) _ sKey = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) sKey = .ok sKey sKey from rfl] - simp only [hfullMiss, Bool.false_eq_true, if_false] + simp only [hfullMiss, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((inferUncached inferRec false source).run methods) _ sKey = _ @@ -161,7 +161,7 @@ theorem inferWith_inferOnlyMiss_success unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) sKey = .ok sKey sKey from rfl] simp only [hfullMiss] - simp only [pure_bind, if_true] + simp only [pure_bind, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ sKey = _ unfold EStateM.bind @@ -203,7 +203,7 @@ theorem inferWith_inferOnlyMiss_error unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) sKey = .ok sKey sKey from rfl] simp only [hfullMiss] - simp only [pure_bind, if_true] + simp only [pure_bind, ite_true] rw [ReaderT.run_bind] change EStateM.bind (get : TcM .anon (TcState .anon)) _ sKey = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Infer/CacheSoundness.lean b/Ix/Tc/Verify/Infer/CacheSoundness.lean index 620b3ebc9..821bf3175 100644 --- a/Ix/Tc/Verify/Infer/CacheSoundness.lean +++ b/Ix/Tc/Verify/Infer/CacheSoundness.lean @@ -199,10 +199,10 @@ theorem inferWith_wf simp only [hfullMiss] cases hpolicy : s.inferOnly with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact context.missTail_wf hmatch hsourceSupport hsource | true => - simp only [pure_bind, if_true] + simp only [pure_bind, ite_true] apply RecM.WF.bind (Q₁ := fun current after => current = afterKey /\ after = afterKey) diff --git a/Ix/Tc/Verify/Infer/CheapBeta.lean b/Ix/Tc/Verify/Infer/CheapBeta.lean index 6675d9765..99c21fbd7 100644 --- a/Ix/Tc/Verify/Infer/CheapBeta.lean +++ b/Ix/Tc/Verify/Infer/CheapBeta.lean @@ -122,7 +122,7 @@ theorem cheapBetaPlan?_simul simp only [Array.size_extract] omega by_cases hclosed : body.lbr == 0 - · simp only [hclosed, if_true, Option.some.injEq] at hplan + · simp only [hclosed, ite_true, Option.some.injEq] at hplan subst plan have hlbr : body.lbr ≤ 0 := by rw [beq_iff_eq.mp hclosed] @@ -136,8 +136,8 @@ theorem cheapBetaPlan?_simul · cases body with | var k varName varInfo => by_cases hk : k < consumed.toUInt64 - · simp only [hclosed, Bool.false_eq_true, if_false, hk, - if_true, Option.some.injEq] at hplan + · simp only [hclosed, Bool.false_eq_true, ite_false, hk, + ite_true, Option.some.injEq] at hplan subst plan have hconsumedLt : consumed < UInt64.size := by have hbodySize := KExpr.size_pos @@ -194,7 +194,7 @@ theorem cheapBetaPlan?_simul KExpr.simulSubstSpec (.var k varName varInfo) (args.extract 0 consumed).reverse 0 = args[consumed - k.toNat - 1]! := by - rw [KExpr.simulSubstSpec, if_pos hkWindow, + rw [KExpr.simulSubstSpec, ite_eq_left hkWindow, UInt64.sub_zero, KExpr.liftSpec_zero hselectedConstructed, hselected] exact ⟨_, _, _, _, rfl, hpeel, hcount.2, diff --git a/Ix/Tc/Verify/Infer/Constants.lean b/Ix/Tc/Verify/Infer/Constants.lean index 11b35141d..770f37f71 100644 --- a/Ix/Tc/Verify/Infer/Constants.lean +++ b/Ix/Tc/Verify/Infer/Constants.lean @@ -207,7 +207,7 @@ theorem inferUncached_const_wf exact hrel.uvars.trans harity.symm have hcheckNe : (c.lvls.toNat != us.size) = false := by simp [hcheck] - simp only [hcheckNe, Bool.false_eq_true, if_false, pure_bind] + simp only [hcheckNe, Bool.false_eq_true, ite_false, pure_bind] obtain ⟨hmem, resources⟩ := hcensus hsourceSupport hcatalog apply RecM.WF.mono (RecM.WF.withInv <| RecM.WF.liftTcM <| diff --git a/Ix/Tc/Verify/Infer/LambdaTypes.lean b/Ix/Tc/Verify/Infer/LambdaTypes.lean index f543138d0..78420eac6 100644 --- a/Ix/Tc/Verify/Infer/LambdaTypes.lean +++ b/Ix/Tc/Verify/Infer/LambdaTypes.lean @@ -198,7 +198,7 @@ theorem inferUncached_lam_wf cases inferOnly with | false => unfold inferUncached - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply RecM.WF.bind (RecM.WF.withInv <| RecM.inferCall_wf htySupport htyTr) intro tyTy afterTy htyPost diff --git a/Ix/Tc/Verify/Infer/LeafCases.lean b/Ix/Tc/Verify/Infer/LeafCases.lean index 9ae843527..55dc8a657 100644 --- a/Ix/Tc/Verify/Infer/LeafCases.lean +++ b/Ix/Tc/Verify/Infer/LeafCases.lean @@ -26,7 +26,7 @@ theorem lookupVar_eval {idx : UInt64} {ty result : KExpr .anon} unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] simp only - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] rw [hty] exact hlift diff --git a/Ix/Tc/Verify/Infer/LetTypes.lean b/Ix/Tc/Verify/Infer/LetTypes.lean index fe98e4165..2839a51a1 100644 --- a/Ix/Tc/Verify/Infer/LetTypes.lean +++ b/Ix/Tc/Verify/Infer/LetTypes.lean @@ -177,7 +177,7 @@ theorem inferUncached_let_wf cases inferOnly with | false => unfold inferUncached - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply RecM.WF.bind (RecM.WF.withInv <| RecM.inferCall_wf htySupport htyTr) intro tyTy afterTy htyPost @@ -200,7 +200,7 @@ theorem inferUncached_let_wf intro equal afterEq hequal cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply RecM.WF.bind (Q₁ := fun _ _ => False) (RecM.WF.throw fun _ => trivial) diff --git a/Ix/Tc/Verify/Infer/ProjectionTelescope.lean b/Ix/Tc/Verify/Infer/ProjectionTelescope.lean index 177ac930d..a20385e77 100644 --- a/Ix/Tc/Verify/Infer/ProjectionTelescope.lean +++ b/Ix/Tc/Verify/Infer/ProjectionTelescope.lean @@ -495,10 +495,10 @@ theorem inferProjFieldStep_wf currentV projectedV := hplan.selected hi cases isPropStruct with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact finishSelectedProjectionField_wf theory hview hresult | true => - simp only [if_true, pure_bind] + simp only [ite_true, pure_bind] rw [← bind_assoc] apply RecM.WF.bind (inferProjectionFieldSort_wf hwhnf hsorts hdomSupport' hdomTr') @@ -512,11 +512,11 @@ theorem inferProjFieldStep_wf obtain ⟨hprojSupport, hfits⟩ := hplan.preceding hi cases isPropStruct with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact finishPrecedingProjectionField_wf theory hsubst hcollision hview hprojSupport hfits | true => - simp only [if_true, pure_bind] + simp only [ite_true, pure_bind] rw [← bind_assoc] apply RecM.WF.bind (inferProjectionFieldSort_wf hwhnf hsorts hdomSupport' hdomTr') diff --git a/Ix/Tc/Verify/Infer/ProjectionTypes.lean b/Ix/Tc/Verify/Infer/ProjectionTypes.lean index 80a1762a7..8b0676bd7 100644 --- a/Ix/Tc/Verify/Infer/ProjectionTypes.lean +++ b/Ix/Tc/Verify/Infer/ProjectionTypes.lean @@ -233,7 +233,7 @@ theorem inferProj_wf by_cases haddr : headId.addr = structId.addr · have haddrTest : (headId.addr != structId.addr) = false := by simp [haddr] - simp only [haddrTest, Bool.false_eq_true, if_false] + simp only [haddrTest, Bool.false_eq_true, ite_false] apply RecM.WF.bind (RecM.WF.withInv <| RecM.WF.liftTcM <| TcM.tryGetConst_loaded_wf hfault headId afterWhnf) @@ -255,7 +255,7 @@ theorem inferProj_wf by_cases hctorCount : ctors.size = 1 · have hcountTest : (ctors.size != 1) = false := by simp [hctorCount] - simp only [hcountTest, Bool.false_eq_true, if_false] + simp only [hcountTest, Bool.false_eq_true, ite_false] have hclassRequest : ProjectionInductiveInstantiationRequest world requests headId levels := by @@ -314,12 +314,12 @@ theorem inferProj_wf (hfields hparameterizedSupport hparameterizedTr) · have hcountTest : (ctors.size != 1) = true := by simp [hctorCount] - simp only [hcountTest, if_true] + simp only [hcountTest, ite_true] exact RecM.WF.throw fun _ => trivial all_goals exact RecM.WF.throw fun _ => trivial · have haddrTest : (headId.addr != structId.addr) = true := by simp [haddr] - simp only [haddrTest, if_true] + simp only [haddrTest, ite_true] exact RecM.WF.throw fun _ => trivial | var | fvar | sort | app | lam | all | letE | prj | nat | str => exact RecM.WF.throw fun _ => trivial diff --git a/Ix/Tc/Verify/Ingress/Representation.lean b/Ix/Tc/Verify/Ingress/Representation.lean index 79640e35e..f34184642 100644 --- a/Ix/Tc/Verify/Ingress/Representation.lean +++ b/Ix/Tc/Verify/Ingress/Representation.lean @@ -121,7 +121,7 @@ theorem getConstVerified_true {env : Ixon.Env} (h : RepresentationWF env) unfold getConstVerified change env.consts[addr]? = some lazy at hlookup rw [hlookup] - simp only [Bool.true_or, if_true] + simp only [Bool.true_or, ite_true] rw [hhash] simp [hget] change Except.ok (some constant) = Except.ok (some constant) diff --git a/Ix/Tc/Verify/InstUniv.lean b/Ix/Tc/Verify/InstUniv.lean index 2dff7aa99..d840e17fd 100644 --- a/Ix/Tc/Verify/InstUniv.lean +++ b/Ix/Tc/Verify/InstUniv.lean @@ -913,11 +913,11 @@ theorem TcM.instantiateUnivParams_wf {S : KExpr .anon → Prop} obtain ⟨hwf, hsup⟩ := hI by_cases hemp : us.isEmpty · have hrun : TcM.instantiateUnivParams e us s = .ok e s := by - rw [TcM.instantiateUnivParams, if_pos hemp] + rw [TcM.instantiateUnivParams, ite_eq_left hemp] try rfl rw [hrun] exact ⟨⟨hwf, hsup⟩, - by rw [KExpr.instantiateUnivParamsSpec, if_pos hemp], rfl, rfl⟩ + by rw [KExpr.instantiateUnivParamsSpec, ite_eq_left hemp], rfl, rfl⟩ · have post := TcM.instUnivInner_spec hcf (e := e) (sc := {}) (s := s) hreach hwf hsup (InstUnivScratchInv.empty S us) cases hrec : TcM.instUnivInner e us {} s with @@ -926,19 +926,19 @@ theorem TcM.instantiateUnivParams_wf {S : KExpr .anon → Prop} rw [hrec] at post obtain ⟨hspec, ⟨hwf', hsup', hunivs, hframe⟩, -⟩ := post have hrun : TcM.instantiateUnivParams e us s = .ok r s' := by - rw [TcM.instantiateUnivParams, if_neg hemp] + rw [TcM.instantiateUnivParams, ite_eq_right hemp] show ((TcM.instUnivInner e us).run' {}) s = _ rw [run_run', hrec] try rfl rw [hrun] exact ⟨⟨hwf', hsup'⟩, - by rw [KExpr.instantiateUnivParamsSpec, if_neg hemp]; exact hspec, + by rw [KExpr.instantiateUnivParamsSpec, ite_eq_right hemp]; exact hspec, hframe, hunivs⟩ | error err s' => rw [hrec] at post obtain ⟨hwf', hsup', hunivs, hframe⟩ := post have hrun : TcM.instantiateUnivParams e us s = .error err s' := by - rw [TcM.instantiateUnivParams, if_neg hemp] + rw [TcM.instantiateUnivParams, ite_eq_right hemp] show ((TcM.instUnivInner e us).run' {}) s = _ rw [run_run', hrec] try rfl diff --git a/Ix/Tc/Verify/Level.lean b/Ix/Tc/Verify/Level.lean index d4f2e486f..02634646e 100644 --- a/Ix/Tc/Verify/Level.lean +++ b/Ix/Tc/Verify/Level.lean @@ -345,15 +345,15 @@ theorem isSubset_mem : | a :: as, b :: bs, h, x, hx => by rw [isSubset] at h by_cases hlt : b < a - · rw [if_pos hlt] at h + · rw [ite_eq_left hlt] at h exact List.mem_cons_of_mem b (isSubset_mem h x hx) - · rw [if_neg hlt] at h + · rw [ite_eq_right hlt] at h by_cases heq : (b == a) = true - · rw [if_pos heq] at h + · rw [ite_eq_left heq] at h rcases List.mem_cons.mp hx with rfl | hx' · exact List.mem_cons.mpr (.inl (eq_of_beq heq).symm) · exact List.mem_cons_of_mem b (isSubset_mem h x hx') - · rw [if_neg heq] at h + · rw [ite_eq_right heq] at h simp at h termination_by p q => q.length + p.length @@ -401,11 +401,11 @@ theorem evalPath_orderedInsert {ρ : List Nat} {a : UInt64} {p q : Path} evalPath ρ q n = if 0 < evalParam ρ a then evalPath ρ p n else 0 := by simp only [evalPath] by_cases ha : 0 < evalParam ρ a - · rw [if_pos ha] + · rw [ite_eq_left ha] by_cases hp : allNZ ρ p = true - · rw [if_pos ((allNZ_orderedInsert h).mpr ⟨ha, hp⟩), if_pos hp] - · rw [if_neg fun hq => hp ((allNZ_orderedInsert h).mp hq).2, if_neg hp] - · rw [if_neg ha, if_neg fun hq => ha ((allNZ_orderedInsert h).mp hq).1] + · rw [ite_eq_left ((allNZ_orderedInsert h).mpr ⟨ha, hp⟩), ite_eq_left hp] + · rw [ite_eq_right fun hq => hp ((allNZ_orderedInsert h).mp hq).2, ite_eq_right hp] + · rw [ite_eq_right ha, ite_eq_right fun hq => ha ((allNZ_orderedInsert h).mp hq).1] theorem EvalPaths.mono {ρ : List Nat} {path : Path} {n n' : Nat} (hle : n ≤ n') : EvalPaths ρ path n → EvalPaths ρ path n' @@ -482,7 +482,7 @@ private theorem forall_mem_set {α : Type _} {l : List α} {i : Nat} refine ⟨H b (List.mem_set hi b), fun j hj hne => ?_⟩ have hj' : j < (l.set i b).length := by simpa using hj have := H _ (List.getElem_mem hj') - rwa [List.getElem_set, if_neg fun h => hne h.symm] at this + rwa [List.getElem_set, ite_eq_right fun h => hne h.symm] at this · rintro ⟨hb, hrest⟩ a ha obtain ⟨j, hj, rfl⟩ := List.mem_iff_getElem.mp ha rw [List.getElem_set] @@ -602,7 +602,7 @@ private theorem insert_findD_eval {ρ : List Nat} {l : NormLevel} {path : Path} constructor · intro H have hpath : evalPath ρ path (v'.eval ρ) ≤ x := - H path _ (by rw [hfind, if_pos Std.ReflCmp.compare_self]) + H path _ (by rw [hfind, ite_eq_left Std.ReflCmp.compare_self]) rw [hv, evalPath_max, Nat.max_le] at hpath refine ⟨fun p n hf => ?_, hpath.2⟩ by_cases hcmp : compare p path = .eq @@ -611,7 +611,7 @@ private theorem insert_findD_eval {ρ : List Nat} {l : NormLevel} {path : Path} rw [RBTree.RBMap.findD, hf, Option.getD_some] rw [← hD] exact hpath.1 - · exact H p n (by rw [hfind, if_neg hcmp]; exact hf) + · exact H p n (by rw [hfind, ite_eq_right hcmp]; exact hf) · rintro ⟨hl, hnew⟩ p n hf rw [hfind] at hf split at hf @@ -794,23 +794,23 @@ private theorem normalizeAux_eval' {ρ : List Nat} : rw [NormLevel.addVar_eval, NormLevel.addConst_eval hp, evalPath_orderedInsert h₁] by_cases hz : 0 < evalParam ρ idx - · rw [if_pos hz] + · rw [ite_eq_left hz] by_cases hnz : allNZ ρ path = true - · simp only [evalPath, if_pos hnz] + · simp only [evalPath, ite_eq_left hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · simp only [evalPath, if_neg hnz] + · simp only [evalPath, ite_eq_right hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · rw [if_neg hz, Nat.eq_zero_of_not_pos hz] + · rw [ite_eq_right hz, Nat.eq_zero_of_not_pos hz] by_cases hnz : allNZ ρ path = true - · simp only [evalPath, if_pos hnz, Nat.zero_add] + · simp only [evalPath, ite_eq_left hnz, Nat.zero_add] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · simp only [evalPath, if_neg hnz] + · simp only [evalPath, ite_eq_right hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega @@ -826,11 +826,11 @@ private theorem normalizeAux_eval' {ρ : List Nat} : by_cases hnz : allNZ ρ path = true · have hle : evalParam ρ idx ≤ NormLevel.eval ρ acc := hp.mem_le hmem hnz - simp only [evalPath, if_pos hnz] + simp only [evalPath, ite_eq_left hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · simp only [evalPath, if_neg hnz] + · simp only [evalPath, ite_eq_right hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega @@ -1009,9 +1009,9 @@ private theorem normalize_param_some_eval {ρ : List Nat} {u : KUniv m} refine Nat.le_trans ?_ (Nat.le_max_right ..) rw [evalPath_orderedInsert h₁] by_cases hz : 0 < evalParam ρ idx - · rw [if_pos hz] + · rw [ite_eq_left hz] exact evalPath_mono (Nat.le_add_right ..) - · rw [if_neg hz, Nat.eq_zero_of_not_pos hz] + · rw [ite_eq_right hz, Nat.eq_zero_of_not_pos hz] exact evalPath_le.mpr fun _ => Nat.le_refl _ · rw [hvar, hconst] exact Nat.le_trans (Nat.le_max_left ..) (Nat.le_max_left ..) @@ -1019,25 +1019,25 @@ private theorem normalize_param_some_eval {ρ : List Nat} {u : KUniv m} ((acc.addConst k path).addVar idx k newPath) (by omega) hp₂, hvar, hconst, evalPath_orderedInsert h₁, evalPath_orderedInsert h₁] by_cases hnz : allNZ ρ path = true <;> by_cases hz : 0 < evalParam ρ idx - · rw [if_pos hz, if_pos hz] - simp only [evalPath, if_pos hnz, Lean.Nat.imax, - if_neg (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max, + · rw [ite_eq_left hz, ite_eq_left hz] + simp only [evalPath, ite_eq_left hnz, Lean.Nat.imax, + ite_eq_right (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max, ← Nat.add_max_add_right] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · rw [if_neg hz, if_neg hz, Nat.eq_zero_of_not_pos hz] - simp only [evalPath, if_pos hnz, Lean.Nat.imax, reduceIte, Nat.zero_add] + · rw [ite_eq_right hz, ite_eq_right hz, Nat.eq_zero_of_not_pos hz] + simp only [evalPath, ite_eq_left hnz, Lean.Nat.imax, reduceIte, Nat.zero_add] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · rw [if_pos hz, if_pos hz] - simp only [evalPath, if_neg hnz] + · rw [ite_eq_left hz, ite_eq_left hz] + simp only [evalPath, ite_eq_right hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · rw [if_neg hz, if_neg hz] - simp only [evalPath, if_neg hnz] + · rw [ite_eq_right hz, ite_eq_right hz] + simp only [evalPath, ite_eq_right hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega @@ -1074,13 +1074,13 @@ private theorem normalize_param_none_eval {ρ : List Nat} {u : KUniv m} · have hz : 0 < evalParam ρ idx := by simp only [allNZ, List.all_eq_true, decide_eq_true_eq] at hnz exact hnz idx hmem - simp only [evalPath, if_pos hnz, Lean.Nat.imax, - if_neg (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max, + simp only [evalPath, ite_eq_left hnz, Lean.Nat.imax, + ite_eq_right (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max, ← Nat.add_max_add_right] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · simp only [evalPath, if_neg hnz] + · simp only [evalPath, ite_eq_right hnz] refine ext_le fun x => ?_ simp only [Nat.max_le] omega @@ -1095,12 +1095,12 @@ private theorem normalize_param_none_eval {ρ : List Nat} {u : KUniv m} exact hnz idx hmem have hle : evalParam ρ idx ≤ NormLevel.eval ρ acc := hp.mem_le hmem hnz - simp only [evalPath, if_pos hnz, Lean.Nat.imax, - if_neg (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max] + simp only [evalPath, ite_eq_left hnz, Lean.Nat.imax, + ite_eq_right (Nat.pos_iff_ne_zero.mp hz), Nat.max_eq_max] refine ext_le fun x => ?_ simp only [Nat.max_le] omega - · simp only [evalPath, if_neg hnz] + · simp only [evalPath, ite_eq_right hnz] termination_by 3 * u.size + 1 decreasing_by all_goals omega @@ -1188,24 +1188,24 @@ theorem subsumption_eq_model (acc : NormLevel) : · split · split · rename_i h4 - try rw [if_pos h4] + try rw [ite_eq_left h4] rfl · rename_i h4 - try rw [if_neg h4] + try rw [ite_eq_right h4] rfl · split · rename_i h4 - try rw [if_pos h4] + try rw [ite_eq_left h4] rfl · rename_i h4 - try rw [if_neg h4] + try rw [ite_eq_right h4] rfl · split · rename_i h4 - try rw [if_pos h4] + try rw [ite_eq_left h4] rfl · rename_i h4 - try rw [if_neg h4] + try rw [ite_eq_right h4] rfl · rfl @@ -1736,8 +1736,8 @@ private theorem match_id_ite {β : Type _} {c : Prop} [Decidable c] = if c then (match t with | .yield b' => b' | .done b' => b') else (match e with | .yield b' => b' | .done b' => b') := by by_cases h : c - · rw [if_pos h, if_pos h] - · rw [if_neg h, if_neg h] + · rw [ite_eq_left h, ite_eq_left h] + · rw [ite_eq_right h, ite_eq_right h] /-- Strip a unit-valued `Id` bind (the do-elaborator's join-point plumbing) under the selector — definitional by `PUnit` eta. -/ @@ -2014,7 +2014,7 @@ private theorem subsumeVars_go_drop {xs ys : Array VarNode} : subst hji by_cases hoff : xs[j]!.offset > ys[yi]!.offset · exfalso - rw [if_pos hoff] at hd + rw [ite_eq_left hoff] at hd exact hd (subsumeVars_go_mono _ _ _ _ (Array.mem_push.mpr (.inr (by rw [hxi, hje])))) · have hn : ¬(ys[yi]!.offset.toNat < xs[j]!.offset.toNat) := @@ -2189,10 +2189,10 @@ private theorem foldl_max_cases : by_cases hle : init ≤ a.offset · refine .inr ⟨a, List.mem_cons_self .., ?_⟩ show (if init ≤ a.offset then a.offset else init) = a.offset - rw [if_pos hle] + rw [ite_eq_left hle] · left show (if init ≤ a.offset then a.offset else init) = init - rw [if_neg hle] + rw [ite_eq_right hle] · exact .inr ⟨v, List.mem_cons_of_mem _ hv, h⟩ /-- The hard half: every original contribution is still dominated in the @@ -2586,7 +2586,7 @@ theorem isNeverZero_eval (ρ : List Nat) : ∀ {u : KUniv m}, have hb := isNeverZero_eval ρ (u := b) (by simpa [isNeverZero] using h) show 0 < Lean.Nat.imax ((toVLevel a).eval ρ) ((toVLevel b).eval ρ) simp only [Lean.Nat.imax] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] simp only [Nat.max_eq_max, Nat.max_def] split <;> omega @@ -2814,7 +2814,7 @@ theorem toVLevel_mkIMax {a b : KUniv m} have hpos := isNeverZero_eval ρ (u := b) hnz rw [hmax] simp only [Lean.Nat.imax] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] rfl · split · -- b is zero: imax _ 0 = 0 diff --git a/Ix/Tc/Verify/NatFixture.lean b/Ix/Tc/Verify/NatFixture.lean index 70c7df3b5..84c0e1fb7 100644 --- a/Ix/Tc/Verify/NatFixture.lean +++ b/Ix/Tc/Verify/NatFixture.lean @@ -4059,10 +4059,10 @@ theorem noDeltaNatAddReduction : (noAccelState Primitives.ofAnonAddrs) from rfl] simp only rw [natAdd_ne_natSucc] - simp only [Bool.false_and, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_and, Bool.false_eq_true, ite_false, pure_bind] have hsize : ¬((#[RecM.natExprFromValue 2, RecM.natExprFromValue 3] : Array (KExpr .anon)).size < 2) := by decide - simp only [hsize, if_false] + simp only [hsize, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((RecM.isNatBinArithAddr Primitives.ofAnonAddrs.natAdd.addr).run @@ -4077,7 +4077,7 @@ theorem noDeltaNatAddReduction : unfold EStateM.bind rw [noDeltaNatAddIsPred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false, if_true] + Bool.false_eq_true, ite_false, ite_true] rw [ReaderT.run_bind] change EStateM.bind ((RecM.whnfNatReducerArg (RecM.natExprFromValue 2)).run @@ -4563,7 +4563,7 @@ theorem betaFullChargedNatOffsetStuckNone (prims : Primitives .anon) : cases hprobe : RecM.natOffsetStuckHead prims betaArg with | false => rfl | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false] + simp only [Bool.not_true, Bool.false_eq_true, ite_false] unfold betaArg rw [KExpr.mkConst_shape] simp [KExpr.collectSpine, KExpr.collectSpine.go] @@ -4638,7 +4638,7 @@ theorem betaFullWhnfStep (prims : Primitives .anon) : have hcycle : ({} : Std.HashSet Address).contains betaArg.addr = false := by change ({} : Std.HashMap Address Unit).contains betaArg.addr = false exact Std.HashMap.contains_empty - simp only [hcycle, Bool.false_eq_true, if_false, pure_bind] + simp only [hcycle, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((RecM.tryReduceNative betaArg).run betaHarnessMethods) _ @@ -5680,13 +5680,13 @@ theorem multiIotaFirstResult : KExpr.mkConst succId #[] () := by rw [KExpr.mkVar_shape, substNoIntern] change (if (2 : UInt64) ≤ 1 then _ else _) = _ - rw [if_neg (by decide)] - simp only [beq_self_eq_true, if_true] + rw [ite_eq_right (by decide)] + simp only [beq_self_eq_true, ite_true] exact KExpr.liftNoIntern_of_lbr_le (by simp) rw [KExpr.mkLam_shape] rw [substNoIntern] change (if (1 : UInt64) ≤ 0 then _ else _) = _ - rw [if_neg (by decide)] + rw [ite_eq_right (by decide)] rw [show (0 : UInt64) + 1 = 1 from rfl] rw [hty, hbody] diff --git a/Ix/Tc/Verify/RecursiveMethods/Inference.lean b/Ix/Tc/Verify/RecursiveMethods/Inference.lean index accfac3e7..65c310cb7 100644 --- a/Ix/Tc/Verify/RecursiveMethods/Inference.lean +++ b/Ix/Tc/Verify/RecursiveMethods/Inference.lean @@ -203,10 +203,10 @@ theorem inferWith_wfOn simp only [hfullMiss] cases hpolicy : s.inferOnly with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact context.missTail_wfOn hmatch hcall hsource | true => - simp only [pure_bind, if_true] + simp only [pure_bind, ite_true] apply RecM.WFOn.bind (Q1 := fun currentState after => currentState = afterKey ∧ after = afterKey) diff --git a/Ix/Tc/Verify/RecursiveMethods/ScopedInference.lean b/Ix/Tc/Verify/RecursiveMethods/ScopedInference.lean index 74e3a81c8..649fda37a 100644 --- a/Ix/Tc/Verify/RecursiveMethods/ScopedInference.lean +++ b/Ix/Tc/Verify/RecursiveMethods/ScopedInference.lean @@ -489,10 +489,10 @@ theorem inferWith_scopedWFOn simp only [hfullMiss] cases hpolicy : s.inferOnly with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact context.missTail_scopedWFOn hmatch hcall hsource | true => - simp only [pure_bind, if_true] + simp only [pure_bind, ite_true] apply RecM.ScopedWFOn.bind (Q1 := fun currentState after => currentState = afterKey ∧ after = afterKey) diff --git a/Ix/Tc/Verify/Run.lean b/Ix/Tc/Verify/Run.lean index 08f5bc69c..fa103b5c9 100644 --- a/Ix/Tc/Verify/Run.lean +++ b/Ix/Tc/Verify/Run.lean @@ -209,7 +209,7 @@ theorem abstractFVars_support_spec by_cases hfast : (fvars.isEmpty || (!body.hasFVars && body.lbr == 0)) = true · have hrun : abstractFVars body fvars it = (body, it) := by - rw [abstractFVars_eq, if_pos hfast] + rw [abstractFVars_eq, ite_eq_left hfast] rfl rw [hrun] exact ⟨by simp [KExpr.abstractFVarsResult, hfast], hwf, hsup.expr⟩ @@ -223,11 +223,11 @@ theorem abstractFVars_support_spec fvars.size.toUInt64 0 (it, {})).1, (abstractFVarsCached body (abstractFVarPositions fvars) fvars.size.toUInt64 0 (it, {})).2.1) := by - rw [abstractFVars_eq, if_neg hfast] + rw [abstractFVars_eq, ite_eq_right hfast] rfl rw [hrun] exact ⟨by - rw [KExpr.abstractFVarsResult, if_neg hfast] + rw [KExpr.abstractFVarsResult, ite_eq_right hfast] exact cached.result, cached.wf, cached.sup⟩ exact ⟨post.1, post.2.1, hsup.of_expr_univs post.2.2 diff --git a/Ix/Tc/Verify/Subst.lean b/Ix/Tc/Verify/Subst.lean index e716a7684..0027407db 100644 --- a/Ix/Tc/Verify/Subst.lean +++ b/Ix/Tc/Verify/Subst.lean @@ -234,7 +234,7 @@ theorem liftSpec_id {e : KExpr .anon} {shift cutoff : UInt64} have hlt : ¬ idx ≥ cutoff := fun hge => by have := UInt64.le_iff_toNat_le.mp hge omega - rw [mkVar_shape, liftSpec, if_neg hlt] + rw [mkVar_shape, liftSpec, ite_eq_right hlt] | fvar => rfl | sort => rfl | const => rfl @@ -463,7 +463,7 @@ private theorem liftPost_fast {S : KExpr .anon → Prop} {e : KExpr .anon} (hsc : LiftScratchInv S shift sc) : LiftPost S shift cutoff e (liftCached e shift cutoff (it, sc)) := by have hrun : liftCached e shift cutoff (it, sc) = (e, (it, sc)) := by - rw [liftCached, if_pos hfast] + rw [liftCached, ite_eq_left hfast] rfl rw [hrun] refine ⟨?_, hwf, hsup, hsc⟩ @@ -485,7 +485,7 @@ private theorem liftPost_hit {S : KExpr .anon → Prop} {e r : KExpr .anon} (hsc : LiftScratchInv S shift sc) : LiftPost S shift cutoff e (liftCached e shift cutoff (it, sc)) := by have hrun : liftCached e shift cutoff (it, sc) = (r, (it, sc)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -577,20 +577,20 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, cutoff) (it.internExpr (KExpr.mkVar (idx + shift) name)).1)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_pos hge] + rw [ite_eq_left hge] rfl rw [hrun] have hcand : KExpr.mkVar (idx + shift) name = KExpr.liftSpec (.var idx name (KExpr.mkVar idx name md).info) shift cutoff := by - rw [KExpr.liftSpec, if_pos hge] + rw [KExpr.liftSpec, ite_eq_left hge] exact liftPost_jp hcf hwf hsup hsc (hreach _ (KExpr.LiftReach.self ..)) (hreach _ (by rw [hcand]; exact KExpr.LiftReach.spec ..)) @@ -602,16 +602,16 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} (it, sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, cutoff) (.var idx name (KExpr.mkVar idx name md).info))) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_neg hge] + rw [ite_eq_right hge] rfl rw [hrun] - exact liftPost_store_self (by rw [KExpr.liftSpec, if_neg hge]) + exact liftPost_store_self (by rw [KExpr.liftSpec, ite_eq_right hge]) (hreach _ (KExpr.LiftReach.self ..)) hwf hsup hsc | @fvar id name md => intro cutoff it sc hcut hreach hwf hsup hsc @@ -633,7 +633,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} (it, sc.insert ((KExpr.fvar id name (KExpr.mkFVar id name md).info).addr, cutoff) (.fvar id name (KExpr.mkFVar id name md).info))) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -659,7 +659,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} (it, sc.insert ((KExpr.sort u (KExpr.mkSort u md).info).addr, cutoff) (.sort u (KExpr.mkSort u md).info))) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -687,7 +687,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} ((KExpr.const id us (KExpr.mkConst id us md).info).addr, cutoff) (.const id us (KExpr.mkConst id us md).info))) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -732,7 +732,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, cutoff) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -798,7 +798,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, cutoff) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -865,7 +865,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, cutoff) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -941,7 +941,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc3.insert ((KExpr.letE n ty val body nd (KExpr.mkLet n ty val body nd md).info).addr, cutoff) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -999,7 +999,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, cutoff) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1039,7 +1039,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} ((KExpr.nat v blob (KExpr.mkNat v blob md).info).addr, cutoff) (.nat v blob (KExpr.mkNat v blob md).info))) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -1067,7 +1067,7 @@ theorem liftCached_spec {S : KExpr .anon → Prop} {shift : UInt64} ((KExpr.str v blob (KExpr.mkStr v blob md).info).addr, cutoff) (.str v blob (KExpr.mkStr v blob md).info))) := by - rw [liftCached, if_neg hfast] + rw [liftCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -1092,7 +1092,7 @@ theorem lift_spec {S : KExpr .anon → Prop} {e : KExpr .anon} (∀ x, (lift e shift cutoff it).2.ExprSupport x → S x) := by by_cases hfast : (shift == 0 || decide (e.lbr ≤ cutoff)) = true · have hrun : lift e shift cutoff it = (e, it) := by - rw [lift, if_pos hfast] + rw [lift, ite_eq_left hfast] rfl rw [hrun] refine ⟨?_, hwf, hsup⟩ @@ -1106,7 +1106,7 @@ theorem lift_spec {S : KExpr .anon → Prop} {e : KExpr .anon} have hrun : lift e shift cutoff it = ((liftCached e shift cutoff (it, {})).1, (liftCached e shift cutoff (it, {})).2.1) := by - rw [lift, if_neg hfast] + rw [lift, ite_eq_right hfast] rfl rw [hrun] exact ⟨post.result, post.wf, post.sup⟩ @@ -1168,7 +1168,7 @@ theorem substSpec_id {body arg : KExpr .anon} {depth : UInt64} have hngt : ¬ idx > depth := fun h => by have := UInt64.lt_iff_toNat_lt.mp h omega - rw [mkVar_shape, substSpec, if_neg hne, if_neg hngt] + rw [mkVar_shape, substSpec, ite_eq_right hne, ite_eq_right hngt] | fvar => rfl | sort => rfl | const => rfl @@ -1374,7 +1374,7 @@ private theorem substPost_fast {S : KExpr .anon → Prop} WalkPost S (KExpr.substSpec · arg ·) depth body (substCached body arg depth (it, sc)) := by have hrun : substCached body arg depth (it, sc) = (body, (it, sc)) := by - rw [substCached, if_pos hfast] + rw [substCached, ite_eq_left hfast] rfl rw [hrun] exact ⟨(KExpr.substSpec_id hcon hcut hfast).symm, hwf, hsup, hsc⟩ @@ -1392,7 +1392,7 @@ private theorem substPost_hit {S : KExpr .anon → Prop} WalkPost S (KExpr.substSpec · arg ·) depth body (substCached body arg depth (it, sc)) := by have hrun : substCached body arg depth (it, sc) = (r, (it, sc)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -1454,20 +1454,20 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) (it1.internExpr rl).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_pos heq] + rw [ite_eq_left heq] rw [run_liftIntern_bind, hlift] try simp only [] rfl rw [hrun] have hcand : rl = KExpr.substSpec (.var idx name (KExpr.mkVar idx name md).info) arg depth := by - rw [KExpr.substSpec, if_pos heq] + rw [KExpr.substSpec, ite_eq_left heq] exact hres exact walkPost_jp hcf hwf1 hsup1 hsc (hreach _ (KExpr.SubstReach.self ..)) @@ -1483,20 +1483,20 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) (it.internExpr (KExpr.mkVar (idx - 1) name)).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_neg heq, if_pos hgt] + rw [ite_eq_right heq, ite_eq_left hgt] rfl rw [hrun] have hcand : KExpr.mkVar (idx - 1) name = KExpr.substSpec (.var idx name (KExpr.mkVar idx name md).info) arg depth := by - rw [KExpr.substSpec, if_neg heq, if_pos hgt] + rw [KExpr.substSpec, ite_eq_right heq, ite_eq_left hgt] exact walkPost_jp hcf hwf hsup hsc (hreach _ (KExpr.SubstReach.self ..)) (hreach _ (.inr (.inl hcand))) @@ -1561,7 +1561,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1628,7 +1628,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1696,7 +1696,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1773,7 +1773,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc3.insert ((KExpr.letE n ty val body nd (KExpr.mkLet n ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1832,7 +1832,7 @@ theorem substCached_spec {S : KExpr .anon → Prop} {arg : KExpr .anon} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [substCached, if_neg hfast] + rw [substCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -1875,7 +1875,7 @@ theorem subst_spec {S : KExpr .anon → Prop} {body arg : KExpr .anon} (∀ x, (subst body arg depth it).2.ExprSupport x → S x) := by by_cases hfast : body.lbr ≤ depth · have hrun : subst body arg depth it = (body, it) := by - rw [subst, if_pos hfast] + rw [subst, ite_eq_left hfast] rfl rw [hrun] exact ⟨(KExpr.substSpec_id hconBody hcut hfast).symm, hwf, hsup⟩ @@ -1885,7 +1885,7 @@ theorem subst_spec {S : KExpr .anon → Prop} {body arg : KExpr .anon} have hrun : subst body arg depth it = ((substCached body arg depth (it, {})).1, (substCached body arg depth (it, {})).2.1) := by - rw [subst, if_neg hfast] + rw [subst, ite_eq_right hfast] rfl rw [hrun] exact ⟨post.result, post.wf, post.sup⟩ @@ -1969,7 +1969,7 @@ theorem simulSubstSpec_id {body : KExpr .anon} have hge2 : ¬ (idx ≥ depth + substs.size.toUInt64) := fun h => by have := UInt64.le_iff_toNat_le.mp h omega - rw [mkVar_shape, simulSubstSpec, if_neg hb1, if_neg hge2] + rw [mkVar_shape, simulSubstSpec, ite_eq_right hb1, ite_eq_right hge2] | fvar => rfl | sort => rfl | const => rfl @@ -2092,7 +2092,7 @@ private theorem simulPost_fast {S : KExpr .anon → Prop} (simulSubstCached body substs depth (it, sc)) := by have hrun : simulSubstCached body substs depth (it, sc) = (body, (it, sc)) := by - rw [simulSubstCached, if_pos hfast] + rw [simulSubstCached, ite_eq_left hfast] rfl rw [hrun] exact ⟨(KExpr.simulSubstSpec_id hcon hbig hfast).symm, hwf, hsup, hsc⟩ @@ -2110,7 +2110,7 @@ private theorem simulPost_hit {S : KExpr .anon → Prop} (simulSubstCached body substs depth (it, sc)) := by have hrun : simulSubstCached body substs depth (it, sc) = (r, (it, sc)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -2201,13 +2201,13 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} (it, sc) = (rl, (it1, sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) rl)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_pos hin] + rw [ite_eq_left hin] rw [run_liftIntern_bind, hlift] try simp only [] rfl @@ -2215,7 +2215,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} have hcand : rl = KExpr.simulSubstSpec (.var idx name (KExpr.mkVar idx name md).info) substs depth := by - rw [KExpr.simulSubstSpec, if_pos hin] + rw [KExpr.simulSubstSpec, ite_eq_left hin] exact hres exact ⟨hcand, hwf1, hsup1, hsc.insert (hreach _ (KExpr.SimulSubstReach.self ..)) hcand⟩ @@ -2235,13 +2235,13 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} (it.internExpr (KExpr.mkVar (idx - substs.size.toUInt64) (anonName (m := .anon)))).1)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_neg hin, if_pos hge2] + rw [ite_eq_right hin, ite_eq_left hge2] rfl rw [hrun] have hcand : KExpr.mkVar (idx - substs.size.toUInt64) @@ -2249,7 +2249,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} = KExpr.simulSubstSpec (.var idx name (KExpr.mkVar idx name md).info) substs depth := by - rw [KExpr.simulSubstSpec, if_neg hin, if_pos hge2] + rw [KExpr.simulSubstSpec, ite_eq_right hin, ite_eq_left hge2] exact walkPost_jp hcf hwf hsup hsc (hreach _ (KExpr.SimulSubstReach.self ..)) (hreach _ (.inr (.inl hcand))) @@ -2319,7 +2319,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2389,7 +2389,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2460,7 +2460,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2541,7 +2541,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} (KExpr.mkLet n ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2603,7 +2603,7 @@ theorem simulSubstCached_spec {S : KExpr .anon → Prop} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [simulSubstCached, if_neg hfast] + rw [simulSubstCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -2646,7 +2646,7 @@ theorem simulSubst_spec {S : KExpr .anon → Prop} {body : KExpr .anon} (∀ x, (simulSubst body substs depth it).2.ExprSupport x → S x) := by by_cases hfast : body.lbr ≤ depth · have hrun : simulSubst body substs depth it = (body, it) := by - rw [simulSubst, if_pos hfast] + rw [simulSubst, ite_eq_left hfast] rfl rw [hrun] exact ⟨(KExpr.simulSubstSpec_id hconBody hbig hfast).symm, hwf, hsup⟩ @@ -2656,7 +2656,7 @@ theorem simulSubst_spec {S : KExpr .anon → Prop} {body : KExpr .anon} have hrun : simulSubst body substs depth it = ((simulSubstCached body substs depth (it, {})).1, (simulSubstCached body substs depth (it, {})).2.1) := by - rw [simulSubst, if_neg hfast] + rw [simulSubst, ite_eq_right hfast] rfl rw [hrun] exact ⟨post.result, post.wf, post.sup⟩ @@ -2732,7 +2732,7 @@ theorem instantiateRevSpec_id {body : KExpr .anon} have hge2 : ¬ (idx ≥ depth + fvars.size.toUInt64) := fun h => by have := UInt64.le_iff_toNat_le.mp h omega - rw [mkVar_shape, instantiateRevSpec, if_neg hb1, if_neg hge2] + rw [mkVar_shape, instantiateRevSpec, ite_eq_right hb1, ite_eq_right hge2] | fvar => rfl | sort => rfl | const => rfl @@ -2823,11 +2823,11 @@ theorem instantiateRevSpec_empty {body : KExpr .anon} have hge := UInt64.le_iff_toNat_le.mp (of_decide_eq_true h12.1) have hlt := UInt64.lt_iff_toNat_lt.mp (of_decide_eq_true h12.2) omega - rw [if_neg hb1] + rw [ite_eq_right hb1] by_cases hge : idx ≥ depth - · rw [if_pos hge, UInt64.sub_zero idx] + · rw [ite_eq_left hge, UInt64.sub_zero idx] exact (mkVar_shape idx name md).symm ▸ rfl - · rw [if_neg hge] + · rw [ite_eq_right hge] | fvar => rfl | sort => rfl | const => rfl @@ -2897,7 +2897,7 @@ private theorem instRevPost_fast {S : KExpr .anon → Prop} (instantiateRevCached body fvars depth (it, sc)) := by have hrun : instantiateRevCached body fvars depth (it, sc) = (body, (it, sc)) := by - rw [instantiateRevCached, if_pos hfast] + rw [instantiateRevCached, ite_eq_left hfast] rfl rw [hrun] exact ⟨(KExpr.instantiateRevSpec_id hcon hbig hfast).symm, hwf, hsup, hsc⟩ @@ -2915,7 +2915,7 @@ private theorem instRevPost_hit {S : KExpr .anon → Prop} (instantiateRevCached body fvars depth (it, sc)) := by have hrun : instantiateRevCached body fvars depth (it, sc) = (r, (it, sc)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -2980,13 +2980,13 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} (KExpr.mkVar idx name md).info).addr, depth) fvars[(fvars.size.toUInt64 - 1 - (idx - depth)).toNat]!)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_pos hin] + rw [ite_eq_left hin] rfl rw [hrun] have hcand : @@ -2994,7 +2994,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} = KExpr.instantiateRevSpec (.var idx name (KExpr.mkVar idx name md).info) fvars depth := by - rw [KExpr.instantiateRevSpec, if_pos hin] + rw [KExpr.instantiateRevSpec, ite_eq_left hin] exact ⟨hcand, hwf, hsup, hsc.insert (hreach _ (KExpr.InstRevReach.self ..)) hcand⟩ · by_cases hge2 : idx ≥ depth + fvars.size.toUInt64 @@ -3013,13 +3013,13 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} (it.internExpr (KExpr.mkVar (idx - fvars.size.toUInt64) (anonName (m := .anon)))).1)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_neg hin, if_pos hge2] + rw [ite_eq_right hin, ite_eq_left hge2] rfl rw [hrun] have hcand : KExpr.mkVar (idx - fvars.size.toUInt64) @@ -3027,7 +3027,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} = KExpr.instantiateRevSpec (.var idx name (KExpr.mkVar idx name md).info) fvars depth := by - rw [KExpr.instantiateRevSpec, if_neg hin, if_pos hge2] + rw [KExpr.instantiateRevSpec, ite_eq_right hin, ite_eq_left hge2] exact walkPost_jp hcf hwf hsup hsc (hreach _ (KExpr.InstRevReach.self ..)) (hreach _ (.inr (.inl hcand))) @@ -3097,7 +3097,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3167,7 +3167,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.lam n bi ty body (KExpr.mkLam n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam n bi rty rbody)).1)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3238,7 +3238,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.all n bi ty body (KExpr.mkAll n bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll n bi rty rbody)).1)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3319,7 +3319,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} (KExpr.mkLet n ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet n rty rval rbody nd)).1)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3381,7 +3381,7 @@ theorem instantiateRevCached_spec {S : KExpr .anon → Prop} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [instantiateRevCached, if_neg hfast] + rw [instantiateRevCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3423,7 +3423,7 @@ theorem instantiateRev_spec {S : KExpr .anon → Prop} {body : KExpr .anon} (∀ x, (instantiateRev body fvars it).2.ExprSupport x → S x) := by by_cases hfast : (fvars.isEmpty || body.lbr == 0) = true · have hrun : instantiateRev body fvars it = (body, it) := by - rw [instantiateRev, if_pos hfast] + rw [instantiateRev, ite_eq_left hfast] rfl rw [hrun] refine ⟨?_, hwf, hsup⟩ @@ -3441,7 +3441,7 @@ theorem instantiateRev_spec {S : KExpr .anon → Prop} {body : KExpr .anon} have hrun : instantiateRev body fvars it = ((instantiateRevCached body fvars 0 (it, {})).1, (instantiateRevCached body fvars 0 (it, {})).2.1) := by - rw [instantiateRev, if_neg hfast] + rw [instantiateRev, ite_eq_right hfast] rfl rw [hrun] exact ⟨post.result, post.wf, post.sup⟩ @@ -3553,7 +3553,7 @@ theorem abstractFVarsSpec_id {body : KExpr .anon} have hngt : ¬ (idx ≥ depth) := fun h => by have := UInt64.le_iff_toNat_le.mp h omega - rw [mkVar_shape, abstractFVarsSpec, if_neg hngt] + rw [mkVar_shape, abstractFVarsSpec, ite_eq_right hngt] | @fvar id name md => exact Bool.noConfusion (hnofv : (true : Bool) = false) | sort => rfl @@ -3684,7 +3684,7 @@ private theorem absPost_fast {S : KExpr .anon → Prop} {body : KExpr .anon} (abstractFVarsCached body pos n depth (it, sc)) := by have hrun : abstractFVarsCached body pos n depth (it, sc) = (body, (it, sc)) := by - rw [abstractFVarsCached, if_pos hfast] + rw [abstractFVarsCached, ite_eq_left hfast] rfl rw [hrun] have h12 := Bool.and_eq_true_iff.mp hfast @@ -3710,7 +3710,7 @@ private theorem absPost_hit {S : KExpr .anon → Prop} {body r : KExpr .anon} (abstractFVarsCached body pos n depth (it, sc)) := by have hrun : abstractFVarsCached body pos n depth (it, sc) = (r, (it, sc)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] rfl @@ -3761,20 +3761,20 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc.insert ((KExpr.var idx name (KExpr.mkVar idx name md).info).addr, depth) (it.internExpr (KExpr.mkVar (idx + n) name)).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] try rw [run_pure_bind] try simp only [] - rw [if_pos hge] + rw [ite_eq_left hge] rfl rw [hrun] have hcand : KExpr.mkVar (idx + n) name = KExpr.abstractFVarsSpec (.var idx name (KExpr.mkVar idx name md).info) pos n depth := by - rw [KExpr.abstractFVarsSpec, if_pos hge] + rw [KExpr.abstractFVarsSpec, ite_eq_left hge] exact walkPost_jp hcf hwf hsup hsc (hreach _ (KExpr.AbstractReach.self ..)) (hreach _ (.inr (.inl hcand))) @@ -3821,7 +3821,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} (KExpr.mkFVar id name md).info).addr, depth) (it.internExpr (KExpr.mkVar (depth + p) (anonName (m := .anon)))).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3849,7 +3849,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} (it, sc.insert ((KExpr.fvar id name (KExpr.mkFVar id name md).info).addr, depth) (.fvar id name (KExpr.mkFVar id name md).info))) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3918,7 +3918,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.app f a (KExpr.mkApp f a md).info).addr, depth) (it2.internExpr (KExpr.mkApp rf ra)).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -3989,7 +3989,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.lam nm bi ty body (KExpr.mkLam nm bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkLam nm bi rty rbody)).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -4061,7 +4061,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc2.insert ((KExpr.all nm bi ty body (KExpr.mkAll nm bi ty body md).info).addr, depth) (it2.internExpr (KExpr.mkAll nm bi rty rbody)).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -4145,7 +4145,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} (KExpr.mkLet nm ty val body nd md).info).addr, depth) (it3.internExpr (KExpr.mkLet nm rty rval rbody nd)).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] @@ -4208,7 +4208,7 @@ theorem abstractFVarsCached_spec {S : KExpr .anon → Prop} sc1.insert ((KExpr.prj id field val (KExpr.mkPrj id field val md).info).addr, depth) (it1.internExpr (KExpr.mkPrj id field rval)).1)) := by - rw [abstractFVarsCached, if_neg hfast] + rw [abstractFVarsCached, ite_eq_right hfast] try simp only [] rw [run_scratchGet_bind, hget] try simp (config := { proj := false }) only [] diff --git a/Ix/Tc/Verify/Trans.lean b/Ix/Tc/Verify/Trans.lean index 19ddd7929..5891617df 100644 --- a/Ix/Tc/Verify/Trans.lean +++ b/Ix/Tc/Verify/Trans.lean @@ -420,7 +420,7 @@ theorem find?_inr_mem : ∀ {Δ : KVLCtx} {fv : FVarId} {x : VExpr × VExpr}, rw [eq_of_beq hEq] exact List.mem_cons_self | false => - simp only [find?, next, hEq, Bool.false_eq_true, if_false, + simp only [find?, next, hEq, Bool.false_eq_true, ite_false, Option.bind_eq_bind] at h have h2 : ∃ y, find? Δ (.inr fv) = some y := by cases hf : find? Δ (.inr fv) with @@ -568,7 +568,7 @@ theorem TrKExprS.weakBV {env : Lean4Lean.VEnv} {uvars : Nat} · have hnl : ¬ (i.toNat < dk) := by have := UInt64.le_iff_toNat_le.mp hge omega - rw [if_pos hge, KExpr.mkVar_shape] + rw [ite_eq_left hge, KExpr.mkVar_shape] refine .var (A := A.liftN n k) ?_ have htn : (i + shift).toNat = i.toNat + dn := by rw [UInt64.toNat_add, hshift] @@ -579,7 +579,7 @@ theorem TrKExprS.weakBV {env : Lean4Lean.VEnv} {uvars : Nat} have : ¬ (cutoff.toNat ≤ i.toNat) := fun hh => hge (UInt64.le_iff_toNat_le.mpr hh) omega - rw [if_neg hge] + rw [ite_eq_right hge] refine .var (A := A.liftN n k) ?_ simpa [KVLCtx.liftVar, hl] using hW | @fvar Δ fv nm md e A h => @@ -727,7 +727,7 @@ theorem TrKExprS.weakBV_lbr {env : Lean4Lean.VEnv} {uvars : Nat} · have hnl : ¬ (idx.toNat < dk) := by have := UInt64.le_iff_toNat_le.mp hge omega - rw [if_pos hge, KExpr.mkVar_shape] + rw [ite_eq_left hge, KExpr.mkVar_shape] refine .var (A := A.liftN n k) ?_ have htn : (idx + shift).toNat = idx.toNat + dn := by rw [UInt64.toNat_add, hshift] @@ -738,7 +738,7 @@ theorem TrKExprS.weakBV_lbr {env : Lean4Lean.VEnv} {uvars : Nat} have : ¬ (cutoff.toNat ≤ idx.toNat) := fun hh => hge (UInt64.le_iff_toNat_le.mpr hh) omega - rw [if_neg hge] + rw [ite_eq_right hge] refine .var (A := A.liftN n k) ?_ simpa [KVLCtx.liftVar, hl] using hW | @fvar Δ id name info e A h => @@ -1232,7 +1232,7 @@ theorem TrKExprS.instN {env : Lean4Lean.VEnv} {uvars : Nat} rw [KExpr.substSpec] by_cases heq : (i == depth) = true · have hik : i.toNat = dk := by rw [eq_of_beq heq]; exact hdepth - rw [if_pos heq] + rw [ite_eq_left heq] rw [show e.inst e₀' k = e₀'.liftN k from W.find?_hit (by rw [← hik]; exact h)] exact TrKExprS.weakBV henv htp h₀ W.toKBVLift hdepth rfl @@ -1241,7 +1241,7 @@ theorem TrKExprS.instN {env : Lean4Lean.VEnv} {uvars : Nat} · have hik : dk < i.toNat := by have := UInt64.lt_iff_toNat_lt.mp hgt omega - rw [if_neg heq, if_pos hgt, KExpr.mkVar_shape] + rw [ite_eq_right heq, ite_eq_left hgt, KExpr.mkVar_shape] refine .var (A := A.inst e₀' k) ?_ have h1i : (1 : UInt64) ≤ i := UInt64.le_iff_toNat_le.mpr (by @@ -1255,7 +1255,7 @@ theorem TrKExprS.instN {env : Lean4Lean.VEnv} {uvars : Nat} have hnlt : ¬ (depth.toNat < i.toNat) := fun hh => hgt (UInt64.lt_iff_toNat_lt.mpr hh) omega - rw [if_neg heq, if_neg hgt] + rw [ite_eq_right heq, ite_eq_right hgt] exact .var (A := A.inst e₀' k) (W.find?_lt hik h) | @fvar Δ₁' fv nm md e A h => intro Δ dk k depth W hdepth hbig @@ -1368,7 +1368,7 @@ theorem TrKExprS.instN_let {env : Lean4Lean.VEnv} {uvars : Nat} rw [KExpr.substSpec] by_cases heq : (i == depth) = true · have hik : i.toNat = dk := by rw [eq_of_beq heq]; exact hdepth - rw [if_pos heq] + rw [ite_eq_left heq] have hhit : e = e₀'.liftN k := W.find?_hit (e' := e) (A := A) (by rw [← hik]; exact h) rw [hhit] @@ -1378,7 +1378,7 @@ theorem TrKExprS.instN_let {env : Lean4Lean.VEnv} {uvars : Nat} · have hik : dk < i.toNat := by have := UInt64.lt_iff_toNat_lt.mp hgt omega - rw [if_neg heq, if_pos hgt, KExpr.mkVar_shape] + rw [ite_eq_right heq, ite_eq_left hgt, KExpr.mkVar_shape] refine .var (A := A) ?_ have h1i : (1 : UInt64) ≤ i := UInt64.le_iff_toNat_le.mpr (by @@ -1392,7 +1392,7 @@ theorem TrKExprS.instN_let {env : Lean4Lean.VEnv} {uvars : Nat} have hnlt : ¬ (depth.toNat < i.toNat) := fun hh => hgt (UInt64.lt_iff_toNat_lt.mpr hh) omega - rw [if_neg heq, if_neg hgt] + rw [ite_eq_right heq, ite_eq_right hgt] exact .var (A := A) (W.find?_lt hik h) | @fvar Δ₁' fv nm md e A h => intro Δ dk k depth W hdepth hbig @@ -1499,7 +1499,7 @@ theorem TrKExprS.instN_let_lbr {env : Lean4Lean.VEnv} {uvars : Nat} rw [KExpr.substSpec] by_cases heq : (i == depth) = true · have hik : i.toNat = dk := by rw [eq_of_beq heq]; exact hdepth - rw [if_pos heq] + rw [ite_eq_left heq] have hhit : e = e₀'.liftN k := W.find?_hit (e' := e) (A := A) (by rw [← hik]; exact h) rw [hhit] @@ -1509,7 +1509,7 @@ theorem TrKExprS.instN_let_lbr {env : Lean4Lean.VEnv} {uvars : Nat} · have hik : dk < i.toNat := by have := UInt64.lt_iff_toNat_lt.mp hgt omega - rw [if_neg heq, if_pos hgt, KExpr.mkVar_shape] + rw [ite_eq_right heq, ite_eq_left hgt, KExpr.mkVar_shape] refine .var (A := A) ?_ have h1i : (1 : UInt64) ≤ i := UInt64.le_iff_toNat_le.mpr (by @@ -1523,7 +1523,7 @@ theorem TrKExprS.instN_let_lbr {env : Lean4Lean.VEnv} {uvars : Nat} have hnlt : ¬ (depth.toNat < i.toNat) := fun hh => hgt (UInt64.lt_iff_toNat_lt.mpr hh) omega - rw [if_neg heq, if_neg hgt] + rw [ite_eq_right heq, ite_eq_right hgt] exact .var (A := A) (W.find?_lt hik h) | @fvar Δ₁' fv nm md e A h => intro Δ dk k depth W hdepth hbig diff --git a/Ix/Tc/Verify/Whnf.lean b/Ix/Tc/Verify/Whnf.lean index d4067df1a..d6047c5be 100644 --- a/Ix/Tc/Verify/Whnf.lean +++ b/Ix/Tc/Verify/Whnf.lean @@ -1082,7 +1082,7 @@ theorem lookupLetVal_eval {idx : UInt64} TcM.lookupLetVal idx s = .ok (some result) s' := by unfold TcM.lookupLetVal rw [get_bind_run] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] rw [hval] change EStateM.bind (TcM.runIntern (lift val (idx + 1) 0)) (fun r => pure (some r)) s = _ @@ -1279,7 +1279,7 @@ theorem tick_success {s : TcState .anon} change EStateM.bind (get : TcM .anon (TcState .anon)) _ s = _ unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] - simp only [h, Bool.false_eq_true, if_false] + simp only [h, Bool.false_eq_true, ite_false] rfl end TcM @@ -4084,7 +4084,7 @@ theorem whnfNoDeltaImplNonLeaf_fullMiss unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s₃ = .ok s₃ s₃ from rfl] simp only - rw [if_pos hnative] + rw [ite_eq_left hnative] rfl theorem whnfNoDeltaImplNonLeaf_cheapMiss @@ -4129,7 +4129,7 @@ theorem whnfNoDeltaImplNonLeaf_cheapMiss unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s₃ = .ok s₃ s₃ from rfl] simp only - rw [if_pos hnative] + rw [ite_eq_left hnative] rfl /-- Stuck-succ mode reads and writes neither no-delta cache partition. -/ @@ -4408,7 +4408,7 @@ theorem whnfNoDeltaImplNonLeaf_wf cases hfull : flags.isFull with | true => simp only [natSuccMode_collapse_beq, Bool.not_false, - Bool.true_and, if_true] + Bool.true_and, ite_true] apply RecM.WF.bind (Q₁ := fun observed after => observed = s2 ∧ after = s2) (RecM.WF.get fun _ => ⟨rfl, rfl⟩) @@ -4449,11 +4449,11 @@ theorem whnfNoDeltaImplNonLeaf_wf cases hnative : s3.inNativeReduce with | true => simp only [Bool.not_true, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => hpost | false => simp only [Bool.not_false, Bool.true_and, - if_true] + ite_true] let next := {s3 with env := {s3.env with whnfNoDeltaCache := s3.env.whnfNoDeltaCache.insert key result}} @@ -4473,7 +4473,7 @@ theorem whnfNoDeltaImplNonLeaf_wf exact RecM.WF.pure fun _ => hpost | false => simp only [natSuccMode_collapse_beq, Bool.not_false, - Bool.true_and, if_true] + Bool.true_and, ite_true] apply RecM.WF.bind (Q₁ := fun observed after => observed = s2 ∧ after = s2) (RecM.WF.get fun _ => ⟨rfl, rfl⟩) @@ -4516,11 +4516,11 @@ theorem whnfNoDeltaImplNonLeaf_wf cases hnative : s3.inNativeReduce with | true => simp only [Bool.not_true, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => hpost | false => simp only [Bool.not_false, Bool.true_and, - if_true] + ite_true] let next := {s3 with env := {s3.env with whnfNoDeltaCheapCache := s3.env.whnfNoDeltaCheapCache.insert key result}} @@ -4665,7 +4665,7 @@ theorem whnfWithNatSuccModeNonLeaf_wf simpa [natSuccMode_collapse_beq] using hwork s2 | false => simp only [natSuccMode_collapse_beq, Bool.not_false, - Bool.true_and, if_true] + Bool.true_and, ite_true] apply RecM.WF.bind (Q₁ := fun observed after => observed = s2 ∧ after = s2) (RecM.WF.get fun _ => ⟨rfl, rfl⟩) @@ -4707,10 +4707,10 @@ theorem whnfWithNatSuccModeNonLeaf_wf cases hnative : s4.inNativeReduce with | true => simp only [Bool.not_true, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => hpost | false => - simp only [Bool.not_false, Bool.true_and, if_true] + simp only [Bool.not_false, Bool.true_and, ite_true] let next := {s4 with env := {s4.env with whnfCache := s4.env.whnfCache.insert key result}} apply RecM.WF.bind @@ -4919,7 +4919,7 @@ theorem whnfNoDeltaImpl_wf | false => simpa using hreflexive s | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] exact whnfNoDeltaImplNonLeaf_wf theory hkeyRep htransient hstep hwrites hsupport (s := s) hsource @@ -5000,7 +5000,7 @@ theorem whnfWithNatSuccMode_wf | false => simpa using hreflexive s | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] exact hshell s @@ -5336,7 +5336,7 @@ theorem whnfWithNatSuccModeNonLeaf_miss unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s₅ = .ok s₅ s₅ from rfl] simp only - rw [if_pos hnative] + rw [ite_eq_left hnative] rfl /-- Stuck-succ full WHNF still pays the miss charge but bypasses both the @@ -7684,34 +7684,34 @@ theorem computeNatBin_defeq generalize hfixed : PrimAddrs.canonical = fixed at hcompute unfold computeNatBin at hcompute by_cases hopAdd : addr == fixed.natAdd - · rw [if_pos hopAdd] at hcompute + · rw [ite_eq_left hopAdd] at hcompute have haddr := beq_iff_eq.mp hopAdd simp only [Option.some.injEq] at hcompute subst result refine ⟨``Nat.add, ?_, liftReflection htable.natAdd context.theoryPrimitives.natAdd⟩ simpa only [haddr, ← hfixed, ← hnatAdd] using htable.natAdd.2 - · rw [if_neg hopAdd] at hcompute + · rw [ite_eq_right hopAdd] at hcompute by_cases hopSub : addr == fixed.natSub - · rw [if_pos hopSub] at hcompute + · rw [ite_eq_left hopSub] at hcompute have haddr := beq_iff_eq.mp hopSub simp only [Option.some.injEq] at hcompute subst result refine ⟨``Nat.sub, ?_, liftReflection htable.natSub context.theoryPrimitives.natSub⟩ simpa only [haddr, ← hfixed, ← hnatSub] using htable.natSub.2 - · rw [if_neg hopSub] at hcompute + · rw [ite_eq_right hopSub] at hcompute by_cases hopMul : addr == fixed.natMul - · rw [if_pos hopMul] at hcompute + · rw [ite_eq_left hopMul] at hcompute have haddr := beq_iff_eq.mp hopMul simp only [Option.some.injEq] at hcompute subst result refine ⟨``Nat.mul, ?_, liftReflection htable.natMul context.theoryPrimitives.natMul⟩ simpa only [haddr, ← hfixed, ← hnatMul] using htable.natMul.2 - · rw [if_neg hopMul] at hcompute + · rw [ite_eq_right hopMul] at hcompute by_cases hopDiv : addr == fixed.natDiv - · rw [if_pos hopDiv] at hcompute + · rw [ite_eq_left hopDiv] at hcompute have haddr := beq_iff_eq.mp hopDiv simp only [Option.some.injEq] at hcompute have hresult : result = a / b := by @@ -7723,9 +7723,9 @@ theorem computeNatBin_defeq refine ⟨``Nat.div, ?_, liftReflection htable.natDiv context.theoryPrimitives.natDiv⟩ simpa only [haddr, ← hfixed, ← hnatDiv] using htable.natDiv.2 - · rw [if_neg hopDiv] at hcompute + · rw [ite_eq_right hopDiv] at hcompute by_cases hopMod : addr == fixed.natMod - · rw [if_pos hopMod] at hcompute + · rw [ite_eq_left hopMod] at hcompute have haddr := beq_iff_eq.mp hopMod simp only [Option.some.injEq] at hcompute have hresult : result = a % b := by @@ -7737,12 +7737,12 @@ theorem computeNatBin_defeq refine ⟨``Nat.mod, ?_, liftReflection htable.natMod context.theoryPrimitives.natMod⟩ simpa only [haddr, ← hfixed, ← hnatMod] using htable.natMod.2 - · rw [if_neg hopMod] at hcompute + · rw [ite_eq_right hopMod] at hcompute by_cases hopPow : addr == fixed.natPow - · rw [if_pos hopPow] at hcompute + · rw [ite_eq_left hopPow] at hcompute have haddr := beq_iff_eq.mp hopPow by_cases hbound : b ≤ 16777216 - · rw [if_pos hbound] at hcompute + · rw [ite_eq_left hbound] at hcompute simp only [Option.some.injEq] at hcompute subst result refine ⟨``Nat.pow, ?_, @@ -7750,11 +7750,11 @@ theorem computeNatBin_defeq context.theoryPrimitives.natPow⟩ simpa only [haddr, ← hfixed, ← hnatPow] using htable.natPow.2 - · rw [if_neg hbound] at hcompute + · rw [ite_eq_right hbound] at hcompute contradiction - · rw [if_neg hopPow] at hcompute + · rw [ite_eq_right hopPow] at hcompute by_cases hopGcd : addr == fixed.natGcd - · rw [if_pos hopGcd] at hcompute + · rw [ite_eq_left hopGcd] at hcompute have haddr := beq_iff_eq.mp hopGcd simp only [Option.some.injEq] at hcompute subst result @@ -7763,9 +7763,9 @@ theorem computeNatBin_defeq context.theoryPrimitives.natGcd⟩ simpa only [haddr, ← hfixed, ← hnatGcd] using htable.natGcd.2 - · rw [if_neg hopGcd] at hcompute + · rw [ite_eq_right hopGcd] at hcompute by_cases hopLand : addr == fixed.natLand - · rw [if_pos hopLand] at hcompute + · rw [ite_eq_left hopLand] at hcompute have haddr := beq_iff_eq.mp hopLand simp only [Option.some.injEq] at hcompute subst result @@ -7774,9 +7774,9 @@ theorem computeNatBin_defeq context.theoryPrimitives.natLAnd⟩ simpa only [haddr, ← hfixed, ← hnatLand] using htable.natLand.2 - · rw [if_neg hopLand] at hcompute + · rw [ite_eq_right hopLand] at hcompute by_cases hopLor : addr == fixed.natLor - · rw [if_pos hopLor] at hcompute + · rw [ite_eq_left hopLor] at hcompute have haddr := beq_iff_eq.mp hopLor simp only [Option.some.injEq] at hcompute subst result @@ -7785,9 +7785,9 @@ theorem computeNatBin_defeq context.theoryPrimitives.natLOr⟩ simpa only [haddr, ← hfixed, ← hnatLor] using htable.natLor.2 - · rw [if_neg hopLor] at hcompute + · rw [ite_eq_right hopLor] at hcompute by_cases hopXor : addr == fixed.natXor - · rw [if_pos hopXor] at hcompute + · rw [ite_eq_left hopXor] at hcompute have haddr := beq_iff_eq.mp hopXor simp only [Option.some.injEq] at hcompute subst result @@ -7796,12 +7796,12 @@ theorem computeNatBin_defeq context.theoryPrimitives.natXor⟩ simpa only [haddr, ← hfixed, ← hnatXor] using htable.natXor.2 - · rw [if_neg hopXor] at hcompute + · rw [ite_eq_right hopXor] at hcompute by_cases hopShiftLeft : addr == fixed.natShiftLeft - · rw [if_pos hopShiftLeft] at hcompute + · rw [ite_eq_left hopShiftLeft] at hcompute have haddr := beq_iff_eq.mp hopShiftLeft by_cases hbound : b < 2 ^ 64 - · rw [if_pos hbound] at hcompute + · rw [ite_eq_left hbound] at hcompute simp only [Option.some.injEq] at hcompute subst result refine ⟨``Nat.shiftLeft, ?_, @@ -7809,14 +7809,14 @@ theorem computeNatBin_defeq context.theoryPrimitives.natShiftLeft⟩ simpa only [haddr, ← hfixed, ← hnatShiftLeft] using htable.natShiftLeft.2 - · rw [if_neg hbound] at hcompute + · rw [ite_eq_right hbound] at hcompute contradiction - · rw [if_neg hopShiftLeft] at hcompute + · rw [ite_eq_right hopShiftLeft] at hcompute by_cases hopShiftRight : addr == fixed.natShiftRight - · rw [if_pos hopShiftRight] at hcompute + · rw [ite_eq_left hopShiftRight] at hcompute have haddr := beq_iff_eq.mp hopShiftRight by_cases hbound : b < 2 ^ 64 - · rw [if_pos hbound] at hcompute + · rw [ite_eq_left hbound] at hcompute simp only [Option.some.injEq] at hcompute subst result refine ⟨``Nat.shiftRight, ?_, @@ -7825,9 +7825,9 @@ theorem computeNatBin_defeq simpa only [haddr, ← hfixed, ← hnatShiftRight] using htable.natShiftRight.2 - · rw [if_neg hbound] at hcompute + · rw [ite_eq_right hbound] at hcompute contradiction - · rw [if_neg hopShiftRight] at hcompute + · rw [ite_eq_right hopShiftRight] at hcompute contradiction /-- A successful binary-Nat computation is classified as arithmetic and not @@ -7931,69 +7931,69 @@ theorem computeNatBin_classifiers generalize hfixed : PrimAddrs.canonical = fixed at hcompute unfold computeNatBin at hcompute by_cases hopAdd : addr == fixed.natAdd - · rw [if_pos hopAdd] at hcompute + · rw [ite_eq_left hopAdd] at hcompute apply classify htable.natAdd (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatAdd] using beq_iff_eq.mp hopAdd - · rw [if_neg hopAdd] at hcompute + · rw [ite_eq_right hopAdd] at hcompute by_cases hopSub : addr == fixed.natSub - · rw [if_pos hopSub] at hcompute + · rw [ite_eq_left hopSub] at hcompute apply classify htable.natSub (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatSub] using beq_iff_eq.mp hopSub - · rw [if_neg hopSub] at hcompute + · rw [ite_eq_right hopSub] at hcompute by_cases hopMul : addr == fixed.natMul - · rw [if_pos hopMul] at hcompute + · rw [ite_eq_left hopMul] at hcompute apply classify htable.natMul (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatMul] using beq_iff_eq.mp hopMul - · rw [if_neg hopMul] at hcompute + · rw [ite_eq_right hopMul] at hcompute by_cases hopDiv : addr == fixed.natDiv - · rw [if_pos hopDiv] at hcompute + · rw [ite_eq_left hopDiv] at hcompute apply classify htable.natDiv (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatDiv] using beq_iff_eq.mp hopDiv - · rw [if_neg hopDiv] at hcompute + · rw [ite_eq_right hopDiv] at hcompute by_cases hopMod : addr == fixed.natMod - · rw [if_pos hopMod] at hcompute + · rw [ite_eq_left hopMod] at hcompute apply classify htable.natMod (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatMod] using beq_iff_eq.mp hopMod - · rw [if_neg hopMod] at hcompute + · rw [ite_eq_right hopMod] at hcompute by_cases hopPow : addr == fixed.natPow - · rw [if_pos hopPow] at hcompute + · rw [ite_eq_left hopPow] at hcompute apply classify htable.natPow (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatPow] using beq_iff_eq.mp hopPow - · rw [if_neg hopPow] at hcompute + · rw [ite_eq_right hopPow] at hcompute by_cases hopGcd : addr == fixed.natGcd - · rw [if_pos hopGcd] at hcompute + · rw [ite_eq_left hopGcd] at hcompute apply classify htable.natGcd (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatGcd] using beq_iff_eq.mp hopGcd - · rw [if_neg hopGcd] at hcompute + · rw [ite_eq_right hopGcd] at hcompute by_cases hopLand : addr == fixed.natLand - · rw [if_pos hopLand] at hcompute + · rw [ite_eq_left hopLand] at hcompute apply classify htable.natLand (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatLand] using beq_iff_eq.mp hopLand - · rw [if_neg hopLand] at hcompute + · rw [ite_eq_right hopLand] at hcompute by_cases hopLor : addr == fixed.natLor - · rw [if_pos hopLor] at hcompute + · rw [ite_eq_left hopLor] at hcompute apply classify htable.natLor (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatLor] using beq_iff_eq.mp hopLor - · rw [if_neg hopLor] at hcompute + · rw [ite_eq_right hopLor] at hcompute by_cases hopXor : addr == fixed.natXor - · rw [if_pos hopXor] at hcompute + · rw [ite_eq_left hopXor] at hcompute apply classify htable.natXor (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatXor] using beq_iff_eq.mp hopXor - · rw [if_neg hopXor] at hcompute + · rw [ite_eq_right hopXor] at hcompute by_cases hopShiftLeft : addr == fixed.natShiftLeft - · rw [if_pos hopShiftLeft] at hcompute + · rw [ite_eq_left hopShiftLeft] at hcompute apply classify htable.natShiftLeft (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatShiftLeft] using beq_iff_eq.mp hopShiftLeft - · rw [if_neg hopShiftLeft] at hcompute + · rw [ite_eq_right hopShiftLeft] at hcompute by_cases hopShiftRight : addr == fixed.natShiftRight - · rw [if_pos hopShiftRight] at hcompute + · rw [ite_eq_left hopShiftRight] at hcompute apply classify htable.natShiftRight (by simp) (by decide) (by decide) simpa only [← hfixed, ← hnatShiftRight] using beq_iff_eq.mp hopShiftRight - · rw [if_neg hopShiftRight] at hcompute + · rw [ite_eq_right hopShiftRight] at hcompute contradiction /-- Either trusted binary-Nat predicate address is classified by the two @@ -8594,11 +8594,11 @@ theorem tryReduceNatWithSuccMode_bin_inv_wf ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] apply RecM.WF.bind (isNatBinArithAddr_inv_wf headId.addr) intro isArith afterArith hafterArith @@ -8618,7 +8618,7 @@ theorem tryReduceNatWithSuccMode_bin_inv_wf hargASupport hargATr hargBSupport hargBTr | true, false => simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] apply RecM.WF.bind (Q₂ := fun _ _ => True) <| whnfNatReducerArg_post_wf hargASupport hargATr intro first afterFirst hfirst @@ -8989,11 +8989,11 @@ theorem tryReduceNatWithSuccMode_binPredExact ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9005,7 +9005,7 @@ theorem tryReduceNatWithSuccMode_binPredExact unfold EStateM.bind rw [hpred] simp only [Bool.not_false, Bool.not_true, Bool.and_false, - Bool.false_eq_true, if_false, if_true] + Bool.false_eq_true, ite_false, ite_true] simpa using hhelper /-- Predicate classification has precedence even if an unconstrained method @@ -9046,11 +9046,11 @@ theorem tryReduceNatWithSuccMode_binPredAnyExact ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9063,7 +9063,7 @@ theorem tryReduceNatWithSuccMode_binPredAnyExact rw [hpred] cases isArith <;> simp only [Bool.not_false, Bool.not_true, Bool.and_false, - Bool.false_eq_true, if_false, if_true] <;> + Bool.false_eq_true, ite_false, ite_true] <;> simpa using hhelper /-- General-spine predicate routing. Predicate precedence is independent of @@ -9100,11 +9100,11 @@ theorem tryReduceNatWithSuccMode_binPredSuffixExact rw [hargs] grind rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬(args.size < 2) := by rw [hargs] grind - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9117,7 +9117,7 @@ theorem tryReduceNatWithSuccMode_binPredSuffixExact rw [hpred] cases isArith <;> simp only [Bool.not_false, Bool.not_true, Bool.and_false, - Bool.false_eq_true, if_false, if_true] <;> + Bool.false_eq_true, ite_false, ite_true] <;> simpa using hhelper /-- A predicate-helper miss is returned unchanged by the exact binary outer @@ -9154,11 +9154,11 @@ theorem tryReduceNatWithSuccMode_binPredMiss ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9170,7 +9170,7 @@ theorem tryReduceNatWithSuccMode_binPredMiss unfold EStateM.bind rw [hpred] simp only [Bool.not_false, Bool.not_true, Bool.and_false, - Bool.false_eq_true, if_false, if_true] + Bool.false_eq_true, ite_false, ite_true] simpa using hhelper /-- A predicate-helper error is propagated unchanged by the exact binary @@ -9207,11 +9207,11 @@ theorem tryReduceNatWithSuccMode_binPredError ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9223,7 +9223,7 @@ theorem tryReduceNatWithSuccMode_binPredError unfold EStateM.bind rw [hpred] simp only [Bool.not_false, Bool.not_true, Bool.and_false, - Bool.false_eq_true, if_false, if_true] + Bool.false_eq_true, ite_false, ite_true] simpa using hhelper /-- Exact production execution for the two-argument arithmetic hit. Keeping @@ -9272,11 +9272,11 @@ theorem tryReduceNatWithSuccMode_binArithExact ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9288,7 +9288,7 @@ theorem tryReduceNatWithSuccMode_binArithExact unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9354,11 +9354,11 @@ theorem tryReduceNatWithSuccMode_binArithSuffixExact rw [hargs] grind rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬(args.size < 2) := by rw [hargs] grind - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9370,7 +9370,7 @@ theorem tryReduceNatWithSuccMode_binArithSuffixExact unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [hzero] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ @@ -9386,7 +9386,7 @@ theorem tryReduceNatWithSuccMode_binArithSuffixExact rw [hextractA, hextractB] simp only rw [hcompute] - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] change EStateM.bind ((finishAppResult (natExprFromValue result) args 2).run methods) _ s₂ = _ @@ -9427,11 +9427,11 @@ theorem tryReduceNatWithSuccMode_binArithArgAMiss ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9443,7 +9443,7 @@ theorem tryReduceNatWithSuccMode_binArithArgAMiss unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9483,11 +9483,11 @@ theorem tryReduceNatWithSuccMode_binArithArgAError ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9499,7 +9499,7 @@ theorem tryReduceNatWithSuccMode_binArithArgAError unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9540,11 +9540,11 @@ theorem tryReduceNatWithSuccMode_binArithArgBMiss ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9556,7 +9556,7 @@ theorem tryReduceNatWithSuccMode_binArithArgBMiss unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9603,11 +9603,11 @@ theorem tryReduceNatWithSuccMode_binArithArgBError ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9619,7 +9619,7 @@ theorem tryReduceNatWithSuccMode_binArithArgBError unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9667,11 +9667,11 @@ theorem tryReduceNatWithSuccMode_binArithExtractAMiss ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9683,7 +9683,7 @@ theorem tryReduceNatWithSuccMode_binArithExtractAMiss unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9735,11 +9735,11 @@ theorem tryReduceNatWithSuccMode_binArithExtractBMiss ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9751,7 +9751,7 @@ theorem tryReduceNatWithSuccMode_binArithExtractBMiss unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -9805,11 +9805,11 @@ theorem tryReduceNatWithSuccMode_binArithComputeMiss ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] - simp only [Bool.and_false, Bool.false_eq_true, if_false] + simp only [Bool.and_false, Bool.false_eq_true, ite_false] have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] + rw [ite_eq_right hnotShort] simp only [pure_bind] rw [ReaderT.run_bind] change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -9821,7 +9821,7 @@ theorem tryReduceNatWithSuccMode_binArithComputeMiss unfold EStateM.bind rw [hpred] simp only [Bool.not_true, Bool.not_false, Bool.false_and, - Bool.false_eq_true, if_false] + Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ unfold EStateM.bind @@ -10088,11 +10088,11 @@ theorem complete ((#[argA, argB] : Array (KExpr .anon)).size == 1) = false := by simp rw [hnotSuccArity] at hrun - simp only [Bool.and_false, Bool.false_eq_true, if_false] at hrun + simp only [Bool.and_false, Bool.false_eq_true, ite_false] at hrun have hnotShort : ¬((#[argA, argB] : Array (KExpr .anon)).size < 2) := by simp - rw [if_neg hnotShort] at hrun + rw [ite_eq_right hnotShort] at hrun simp only [pure_bind] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -10110,7 +10110,7 @@ theorem complete cases hisPred : isPred with | false => simp only [hisArith, hisPred, Bool.not_false, - Bool.false_eq_true, if_false] at hrun + Bool.false_eq_true, ite_false] at hrun change EStateM.Result.ok none s = .ok (some result) s' at hrun cases hrun | true => @@ -10143,7 +10143,7 @@ theorem complete have hpred' : (isNatBinPredAddr headId.addr).run methods s = .ok false s := by simpa [hisPred] using hpred simp only [hisArith, hisPred, Bool.not_true, Bool.not_false, - Bool.false_and, Bool.false_eq_true, if_false] at hrun + Bool.false_and, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ at hrun @@ -11003,11 +11003,11 @@ theorem complete rw [hargs] grind rw [hnotSuccArity] at hrun - simp only [Bool.and_false, Bool.false_eq_true, if_false] at hrun + simp only [Bool.and_false, Bool.false_eq_true, ite_false] at hrun have hnotShort : ¬(args.size < 2) := by rw [hargs] grind - rw [if_neg hnotShort] at hrun + rw [ite_eq_right hnotShort] at hrun simp only [pure_bind] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = _ @@ -11025,7 +11025,7 @@ theorem complete cases hisPred : isPred with | false => simp only [hisArith, hisPred, Bool.not_false, - Bool.false_eq_true, if_false] at hrun + Bool.false_eq_true, ite_false] at hrun change EStateM.Result.ok none s = .ok (some result) s' at hrun cases hrun | true => @@ -11056,7 +11056,7 @@ theorem complete have hpred' : (isNatBinPredAddr headId.addr).run methods s = .ok false s := by simpa [hisPred] using hpred simp only [hisArith, hisPred, Bool.not_true, Bool.not_false, - Bool.false_and, Bool.false_eq_true, if_false] at hrun + Bool.false_and, Bool.false_eq_true, ite_false] at hrun rw [hzero] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = _ @@ -11122,7 +11122,7 @@ theorem complete cases hrun | some value => rw [hcompute] at hrun - simp only [if_true] at hrun + simp only [ite_true] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((finishAppResult @@ -11533,11 +11533,11 @@ theorem tryReduceNatWithSuccMode_spine_nonhit_inv rw [hargs] grind rw [hnotSuccArity] at hrun - simp only [Bool.and_false, Bool.false_eq_true, if_false] at hrun + simp only [Bool.and_false, Bool.false_eq_true, ite_false] at hrun have hnotShort : ¬(args.size < 2) := by rw [hargs] grind - rw [if_neg hnotShort] at hrun + rw [ite_eq_right hnotShort] at hrun simp only [pure_bind] at hrun rw [ReaderT.run_bind] at hrun change EStateM.bind ((isNatBinArithAddr headId.addr).run methods) _ s = @@ -11552,17 +11552,17 @@ theorem tryReduceNatWithSuccMode_spine_nonhit_inv rw [hpred] at hrun cases hisArith : isArith <;> cases hisPred : isPred · simp only [hisArith, hisPred, Bool.not_false, Bool.false_eq_true, - if_false] at hrun + ite_false] at hrun rw [← hrun] exact hI · simp only [hisArith, hisPred, Bool.not_false, Bool.not_true, - Bool.and_false, Bool.false_eq_true, if_false, if_true] at hrun + Bool.and_false, Bool.false_eq_true, ite_false, ite_true] at hrun have hhelper : (tryReduceNatPredicate headId.addr args).run methods s = outcome := by simpa using hrun exact tryReduceNatPredicate_spine_nonhit_inv context hmethods hI hargASupport hargATr hargBSupport hargBTr hargs hhelper · simp only [hisArith, hisPred, Bool.not_true, Bool.not_false, - Bool.false_and, Bool.false_eq_true, if_false] at hrun + Bool.false_and, Bool.false_eq_true, ite_false] at hrun rw [hzero, ReaderT.run_bind] at hrun change EStateM.bind ((whnfNatReducerArg argA).run methods) _ s = outcome at hrun @@ -11629,7 +11629,7 @@ theorem tryReduceNatWithSuccMode_spine_nonhit_inv exact hI₂ | some value => rw [hcompute] at hrun - simp only [if_true] at hrun + simp only [ite_true] at hrun obtain ⟨final, s₃, hfinish⟩ := finishAppResult_total (methods := methods) (s := s₂) @@ -11644,7 +11644,7 @@ theorem tryReduceNatWithSuccMode_spine_nonhit_inv rw [← hrun] trivial · simp only [hisArith, hisPred, Bool.not_true, - Bool.and_false, Bool.false_eq_true, if_false, if_true] at hrun + Bool.and_false, Bool.false_eq_true, ite_false, ite_true] at hrun have hhelper : (tryReduceNatPredicate headId.addr args).run methods s = outcome := by simpa using hrun exact tryReduceNatPredicate_spine_nonhit_inv context hmethods hI @@ -12581,7 +12581,7 @@ theorem tryReduceNatSuccAfterWhnf_stuck change EStateM.bind ((isNatSuccSpine w).run methods) _ s = _ unfold EStateM.bind rw [hclass] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rfl /-- Exact evaluator for the shared stuck-marker commit. -/ @@ -12754,7 +12754,7 @@ theorem tryReduceNatSuccAfterWhnf_succ change EStateM.bind ((isNatSuccSpine w).run methods) _ s = _ unfold EStateM.bind rw [hclass] - simp only [if_true] + simp only [ite_true] rw [harg] simpa using hpeel @@ -13239,10 +13239,10 @@ theorem tryReduceNatSuccLinearRec_effect_wf cases hsize : parts.spine.size != parts.majorIdx + 1 with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] have hadd : RecM.WF layer semantics trProj world support uvars Delta afterRead (mkNatAdd baseWhnf @@ -14554,7 +14554,7 @@ theorem whnfNoDeltaReducersStep_projectionDef rw [hstring] simp only rw [hfull] - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryReduceProjectionDefinition cur) methods) _ s₅ = _ @@ -14611,7 +14611,7 @@ theorem whnfNoDeltaReducersStep_quotFull rw [hstring] simp only rw [hfull] - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryReduceProjectionDefinition cur) methods) _ s₅ = _ @@ -14672,7 +14672,7 @@ theorem whnfNoDeltaReducersStep_quotCheap rw [hstring] simp only rw [hcheap] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryQuotReduce cur) methods) _ s₅ = _ unfold EStateM.bind @@ -14728,7 +14728,7 @@ theorem whnfNoDeltaReducersStep_doneFull rw [hstring] simp only rw [hfull] - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryReduceProjectionDefinition cur) methods) _ s₅ = _ @@ -14788,7 +14788,7 @@ theorem whnfNoDeltaReducersStep_doneCheap rw [hstring] simp only rw [hcheap] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryQuotReduce cur) methods) _ s₅ = _ unfold EStateM.bind @@ -14989,7 +14989,7 @@ theorem whnfNoDeltaReducersStep_projectionDefError rw [hstring] simp only rw [hfull] - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryReduceProjectionDefinition cur) methods) _ s₅ = _ @@ -15045,7 +15045,7 @@ theorem whnfNoDeltaReducersStep_quotFullError rw [hstring] simp only rw [hfull] - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryReduceProjectionDefinition cur) methods) _ s₅ = _ @@ -15104,7 +15104,7 @@ theorem whnfNoDeltaReducersStep_quotCheapError rw [hstring] simp only rw [hcheap] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryQuotReduce cur) methods) _ s₅ = _ unfold EStateM.bind @@ -15298,7 +15298,7 @@ theorem whnfNoDeltaReducersStep_wf | none => cases hfull : flags.isFull with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] apply RecM.WF.bind (oracle.quot hsourceSupport hsourceTr) intro quotResult s₆ hquot @@ -15314,7 +15314,7 @@ theorem whnfNoDeltaReducersStep_wf WhnfMeaning.refl hsourceTr (theory.exprWF hI.2.1 hsourceTr)⟩ | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.bind (oracle.projectionDef hsourceSupport hsourceTr) intro projectionResult s₆ hprojection diff --git a/Ix/Tc/Verify/Whnf/Beta/LambdaInstantiation.lean b/Ix/Tc/Verify/Whnf/Beta/LambdaInstantiation.lean index ebc32c44c..75474c267 100644 --- a/Ix/Tc/Verify/Whnf/Beta/LambdaInstantiation.lean +++ b/Ix/Tc/Verify/Whnf/Beta/LambdaInstantiation.lean @@ -81,7 +81,7 @@ theorem TrKExprS.instN_lbr {env : Lean4Lean.VEnv} {uvars : Nat} rw [KExpr.substSpec] by_cases heq : (i == depth) = true · have hik : i.toNat = dk := by rw [eq_of_beq heq]; exact hdepth - rw [if_pos heq] + rw [ite_eq_left heq] rw [show e.inst e₀' k = e₀'.liftN k from W.find?_hit (by rw [← hik]; exact h)] exact TrKExprS.weakBV_lbr henv htp harg h₀ W.toKBVLift hdepth rfl @@ -90,7 +90,7 @@ theorem TrKExprS.instN_lbr {env : Lean4Lean.VEnv} {uvars : Nat} · have hik : dk < i.toNat := by have := UInt64.lt_iff_toNat_lt.mp hgt omega - rw [if_neg heq, if_pos hgt, KExpr.mkVar_shape] + rw [ite_eq_right heq, ite_eq_left hgt, KExpr.mkVar_shape] refine .var (A := A.inst e₀' k) ?_ have h1i : (1 : UInt64) ≤ i := UInt64.le_iff_toNat_le.mpr (by @@ -105,7 +105,7 @@ theorem TrKExprS.instN_lbr {env : Lean4Lean.VEnv} {uvars : Nat} have hnlt : ¬(depth.toNat < i.toNat) := fun hh => hgt (UInt64.lt_iff_toNat_lt.mpr hh) omega - rw [if_neg heq, if_neg hgt] + rw [ite_eq_right heq, ite_eq_right hgt] exact .var (A := A.inst e₀' k) (W.find?_lt hik h) | @fvar Δ₁' fv nm md e A h => intro Δ dk k depth W hdepth hbig diff --git a/Ix/Tc/Verify/Whnf/Beta/LambdaPeeling.lean b/Ix/Tc/Verify/Whnf/Beta/LambdaPeeling.lean index edeed4615..d21c37ce4 100644 --- a/Ix/Tc/Verify/Whnf/Beta/LambdaPeeling.lean +++ b/Ix/Tc/Verify/Whnf/Beta/LambdaPeeling.lean @@ -42,9 +42,9 @@ theorem fuel | succ fuel ih => rw [consumeBetaLamsFuel_succ] by_cases hdone : consumed.size >= args.size - · simp only [hdone, if_true] + · simp only [hdone, ite_true] exact ⟨hpeel, hprefix, hsize⟩ - · simp only [hdone, if_false] + · simp only [hdone, ite_false] cases current with | lam name bi ty body info => have hlt : consumed.size < args.size := by omega diff --git a/Ix/Tc/Verify/Whnf/Beta/LiftSubstitution.lean b/Ix/Tc/Verify/Whnf/Beta/LiftSubstitution.lean index 722f2e9f3..97de9fac1 100644 --- a/Ix/Tc/Verify/Whnf/Beta/LiftSubstitution.lean +++ b/Ix/Tc/Verify/Whnf/Beta/LiftSubstitution.lean @@ -17,10 +17,10 @@ private theorem toNat_max_bv (a b : UInt64) : show (if a ≤ b then b else a).toNat = max a.toNat b.toNat rw [Nat.max_def] by_cases h : a ≤ b - · rw [if_pos h, if_pos (UInt64.le_iff_toNat_le.mp h)] + · rw [ite_eq_left h, ite_eq_left (UInt64.le_iff_toNat_le.mp h)] · have hn : ¬a.toNat ≤ b.toNat := fun h' => h (UInt64.le_iff_toNat_le.mpr h') - rw [if_neg h, if_neg hn] + rw [ite_eq_right h, ite_eq_right hn] /-- Saturating predecessor changes the represented natural by at most one. -/ private theorem toNat_le_sat1_add_one_bv (x : UInt64) : @@ -98,9 +98,9 @@ private theorem substSpec_liftSpec_succ_aux rw [hidxShift, hshiftCutoff] at heq' have hge' := UInt64.le_iff_toNat_le.mp hidxCutoff omega - rw [mkVar_shape, liftSpec, if_pos hidxCutoff, mkVar_shape, - substSpec, if_neg hne, if_pos hgt, hsub, - liftSpec, if_pos hidxCutoff] + rw [mkVar_shape, liftSpec, ite_eq_left hidxCutoff, mkVar_shape, + substSpec, ite_eq_right hne, ite_eq_left hgt, hsub, + liftSpec, ite_eq_left hidxCutoff] · have hidxLtNat : idx.toNat < cutoff.toNat := by have hnle : ¬cutoff.toNat ≤ idx.toNat := fun h => hidxCutoff (UInt64.le_iff_toNat_le.mpr h) @@ -120,8 +120,8 @@ private theorem substSpec_liftSpec_succ_aux have hgt' := UInt64.lt_iff_toNat_lt.mp hgt have hlt' := UInt64.lt_iff_toNat_lt.mp hlt omega - rw [mkVar_shape, liftSpec, if_neg hidxCutoff, substSpec, - if_neg hne, if_neg hngt, liftSpec, if_neg hidxCutoff] + rw [mkVar_shape, liftSpec, ite_eq_right hidxCutoff, substSpec, + ite_eq_right hne, ite_eq_right hngt, liftSpec, ite_eq_right hidxCutoff] | fvar => rfl | sort => rfl | const => rfl diff --git a/Ix/Tc/Verify/Whnf/Beta/SimultaneousSubstitution.lean b/Ix/Tc/Verify/Whnf/Beta/SimultaneousSubstitution.lean index b4f6ce3e5..98cbe6606 100644 --- a/Ix/Tc/Verify/Whnf/Beta/SimultaneousSubstitution.lean +++ b/Ix/Tc/Verify/Whnf/Beta/SimultaneousSubstitution.lean @@ -114,11 +114,11 @@ theorem simulSubstSpec_empty {body : KExpr .anon} have hge' := UInt64.le_iff_toNat_le.mp (of_decide_eq_true hge) have hlt' := UInt64.lt_iff_toNat_lt.mp (of_decide_eq_true hlt) omega - rw [if_neg hwindow] + rw [ite_eq_right hwindow] by_cases hge : idx ≥ depth - · rw [if_pos hge, UInt64.sub_zero] + · rw [ite_eq_left hge, UInt64.sub_zero] exact (mkVar_shape idx name info).symm ▸ rfl - · rw [if_neg hge] + · rw [ite_eq_right hge] | fvar => rfl | sort => rfl | const => rfl @@ -223,15 +223,15 @@ theorem simulSubstSpec_cons omega have hdirectEval : simulSubstSpec (mkVar idx name info) (#[arg] ++ rest) depth = mkVar idx name info := by - rw [mkVar_shape, simulSubstSpec, if_neg hdirectWindow, - if_neg hngeBoundary] + rw [mkVar_shape, simulSubstSpec, ite_eq_right hdirectWindow, + ite_eq_right hngeBoundary] have hrestEval : simulSubstSpec (mkVar idx name info) rest (depth + 1) = mkVar idx name info := by - rw [mkVar_shape, simulSubstSpec, if_neg hrestWindow, - if_neg hngeRestBoundary] + rw [mkVar_shape, simulSubstSpec, ite_eq_right hrestWindow, + ite_eq_right hngeRestBoundary] have hsubstEval : substSpec (mkVar idx name info) arg depth = mkVar idx name info := by - rw [mkVar_shape, substSpec, if_neg hne, if_neg hngt] + rw [mkVar_shape, substSpec, ite_eq_right hne, ite_eq_right hngt] calc simulSubstSpec (mkVar idx name info) (#[arg] ++ rest) depth = mkVar idx name info := hdirectEval @@ -274,15 +274,15 @@ theorem simulSubstSpec_cons have hsubZero : (depth - depth).toNat = 0 := by simp have hdirectEval : simulSubstSpec (mkVar depth name info) (#[arg] ++ rest) depth = liftSpec arg depth 0 := by - rw [mkVar_shape, simulSubstSpec, if_pos hdirectWindow, hsubZero, + rw [mkVar_shape, simulSubstSpec, ite_eq_left hdirectWindow, hsubZero, getElemBang_singleton_append_zero_bw] have hrestEval : simulSubstSpec (mkVar depth name info) rest (depth + 1) = mkVar depth name info := by - rw [mkVar_shape, simulSubstSpec, if_neg hrestWindow, - if_neg hngeRestBoundary] + rw [mkVar_shape, simulSubstSpec, ite_eq_right hrestWindow, + ite_eq_right hngeRestBoundary] have hsubstEval : substSpec (mkVar depth name info) arg depth = liftSpec arg depth 0 := by - rw [mkVar_shape, substSpec, if_pos heqBool] + rw [mkVar_shape, substSpec, ite_eq_left heqBool] calc simulSubstSpec (mkVar depth name info) (#[arg] ++ rest) depth = liftSpec arg depth 0 := hdirectEval @@ -355,12 +355,12 @@ theorem simulSubstSpec_cons have hdirectEval : simulSubstSpec (mkVar idx name info) (#[arg] ++ rest) depth = liftSpec rest[(idx - (depth + 1)).toNat]! depth 0 := by - rw [mkVar_shape, simulSubstSpec, if_pos hdirectGuard, + rw [mkVar_shape, simulSubstSpec, ite_eq_left hdirectGuard, hselected] have hrestEval : simulSubstSpec (mkVar idx name info) rest (depth + 1) = liftSpec rest[(idx - (depth + 1)).toNat]! (depth + 1) 0 := by - rw [mkVar_shape, simulSubstSpec, if_pos hrestGuard] + rw [mkVar_shape, simulSubstSpec, ite_eq_left hrestGuard] have hcancel := substSpec_liftSpec_succ (arg := arg) hselectedCon hcancelBig calc @@ -446,21 +446,21 @@ theorem simulSubstSpec_cons (#[arg] ++ rest) depth = mkVar (idx - (#[arg] ++ rest).size.toUInt64) (anonName (m := .anon)) := by - rw [mkVar_shape, simulSubstSpec, if_neg hdirectGuard, - if_pos hgeBoundary] + rw [mkVar_shape, simulSubstSpec, ite_eq_right hdirectGuard, + ite_eq_left hgeBoundary] have hrestEval : simulSubstSpec (mkVar idx name info) rest (depth + 1) = mkVar (idx - rest.size.toUInt64) (anonName (m := .anon)) := by - rw [mkVar_shape, simulSubstSpec, if_neg hrestGuard, - if_pos hgeRestBoundary] + rw [mkVar_shape, simulSubstSpec, ite_eq_right hrestGuard, + ite_eq_left hgeRestBoundary] have hsubstEval : substSpec (mkVar (idx - rest.size.toUInt64) (anonName (m := .anon))) arg depth = mkVar (idx - rest.size.toUInt64 - 1) (anonName (m := .anon)) := by - rw [mkVar_shape, substSpec, if_neg hqne, if_pos hqgt] + rw [mkVar_shape, substSpec, ite_eq_right hqne, ite_eq_left hqgt] calc simulSubstSpec (mkVar idx name info) (#[arg] ++ rest) depth = mkVar (idx - (#[arg] ++ rest).size.toUInt64) diff --git a/Ix/Tc/Verify/Whnf/Beta/SingletonSubstitution.lean b/Ix/Tc/Verify/Whnf/Beta/SingletonSubstitution.lean index d621c0169..6a72e39e9 100644 --- a/Ix/Tc/Verify/Whnf/Beta/SingletonSubstitution.lean +++ b/Ix/Tc/Verify/Whnf/Beta/SingletonSubstitution.lean @@ -45,7 +45,7 @@ theorem simulSubstSpec_singleton subst idx have hwindow : ((depth >= depth && depth < depth + 1) = true) := by simp [hdepthLt] - rw [if_pos hwindow, if_pos heq] + rw [ite_eq_left hwindow, ite_eq_left heq] simp · by_cases hgt : idx > depth · have hgeSucc : depth + 1 <= idx := by @@ -60,7 +60,7 @@ theorem simulSubstSpec_singleton have hwindow : ¬((idx >= depth && idx < depth + 1) = true) := by simp [hnltSucc] - rw [if_neg hwindow, if_pos hgeSucc, if_neg heq, if_pos hgt] + rw [ite_eq_right hwindow, ite_eq_left hgeSucc, ite_eq_right heq, ite_eq_left hgt] · have hne : idx.toNat ≠ depth.toNat := fun h => heq (beq_iff_eq.mpr (UInt64.toNat_inj.mp h)) have hngt : ¬(depth.toNat < idx.toNat) := fun h => @@ -76,7 +76,7 @@ theorem simulSubstSpec_singleton have hwindow : ¬((idx >= depth && idx < depth + 1) = true) := by simp [hnge] - rw [if_neg hwindow, if_neg hgeSucc, if_neg heq, if_neg hgt] + rw [ite_eq_right hwindow, ite_eq_right hgeSucc, ite_eq_right heq, ite_eq_right hgt] | fvar => rfl | sort => rfl | const => rfl diff --git a/Ix/Tc/Verify/Whnf/Driver/FullStep.lean b/Ix/Tc/Verify/Whnf/Driver/FullStep.lean index a8745f155..2752849ee 100644 --- a/Ix/Tc/Verify/Whnf/Driver/FullStep.lean +++ b/Ix/Tc/Verify/Whnf/Driver/FullStep.lean @@ -94,12 +94,12 @@ theorem wf obtain ⟨reducedV, hreducedTr, _⟩ := hreducedPost cases hcycle : seen.contains reduced.addr with | true => - simp only [if_true] + simp only [ite_true] apply RecM.WF.pure intro _ exact ⟨hreducedSupport, hprefix⟩ | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] apply RecM.WF.bind (RecM.WF.withInv (tryReduceNative_noAccel_optional_wf diff --git a/Ix/Tc/Verify/Whnf/Iota/ApplicationRequests.lean b/Ix/Tc/Verify/Whnf/Iota/ApplicationRequests.lean index ec61b5aa8..aa9b270a4 100644 --- a/Ix/Tc/Verify/Whnf/Iota/ApplicationRequests.lean +++ b/Ix/Tc/Verify/Whnf/Iota/ApplicationRequests.lean @@ -231,13 +231,13 @@ theorem tryApplyIotaCtor_state_wf_of_requests | some rule => simp only [pure_bind] by_cases hlevels : (recUs.size.toUInt64 != recr.lvls) = true - · simp only [hlevels, if_true] + · simp only [hlevels, ite_true] exact TcM.WF.pure (fun _ => trivial) - · simp only [hlevels, Bool.false_eq_true, if_false] + · simp only [hlevels, Bool.false_eq_true, ite_false] by_cases hfields : ctorFields > ctorArgs.size - · simp only [hfields, if_pos] + · simp only [hfields, ite_eq_left] exact TcM.WF.pure (fun _ => trivial) - · simp only [hfields, if_false] + · simp only [hfields, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (applyIotaRule_state_wf_of_requests hrun diff --git a/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean b/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean index da8d98de5..65cf2c546 100644 --- a/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean +++ b/Ix/Tc/Verify/Whnf/Iota/ConstructorDispatch.lean @@ -84,7 +84,7 @@ theorem eval simp [h.levelArity] rw [hlevels] simp only [Bool.false_eq_true, ↓reduceIte] - rw [if_neg (Nat.not_lt.mpr h.fieldBound)] + rw [ite_eq_right (Nat.not_lt.mpr h.fieldBound)] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run @@ -428,7 +428,7 @@ theorem tryIotaWithFlags_nonKPrefix simp only rw [hinfo] simp only - rw [if_neg (Nat.not_le.mpr hmajorBound)] + rw [ite_eq_right (Nat.not_le.mpr hmajorBound)] rw [hmajor, hk] simp only [Bool.false_eq_true, ↓reduceIte] rw [ReaderT.run_bind] diff --git a/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean b/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean index 9bcf46184..9cd462de0 100644 --- a/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean +++ b/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesis.lean @@ -199,7 +199,7 @@ theorem eval (ReaderT.run (callIsDefEq majorTyW h.ctorTy) methods) _ h.sAttempt = _ unfold EStateM.bind rw [h.typeDefEq] - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] change EStateM.bind (TcM.bumpStats (fun st => { st with kSynthRejects := st.kSynthRejects + 1 })) _ @@ -282,7 +282,7 @@ theorem eval have hlevels : (recUs.size.toUInt64 != recr.lvls) = false := by simp [h.levelArity] rw [hlevels] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ @@ -318,7 +318,7 @@ theorem eval rw [h.sameInductive] have haddrNe : (h.indId.addr != h.indId.addr) = false := by simp rw [haddrNe] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst h.indId) _ h.sInductive = _ unfold EStateM.bind rw [h.inductiveLookup] @@ -367,7 +367,7 @@ theorem tryIotaWithFlags_kPrefix simp only rw [hinfo] simp only - rw [if_neg (Nat.not_le.mpr hmajorBound)] + rw [ite_eq_right (Nat.not_le.mpr hmajorBound)] rw [hmajor, hk] simp only [↓reduceIte] rw [ReaderT.run_bind] diff --git a/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesisFallback.lean b/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesisFallback.lean index 1bc62a92a..88d24095e 100644 --- a/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesisFallback.lean +++ b/Ix/Tc/Verify/Whnf/Iota/ConstructorSynthesisFallback.lean @@ -171,7 +171,7 @@ theorem selectKSynthCandidate_missing methods s = .ok .inconclusive sf := by unfold selectKSynthCandidate rw [hsame] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst indId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -190,7 +190,7 @@ theorem selectKSynthCandidate_nonInductive methods s = .ok .inconclusive sf := by unfold selectKSynthCandidate rw [hsame] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst indId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -212,7 +212,7 @@ theorem selectKSynthCandidate_empty methods s = .ok .inconclusive sf := by unfold selectKSynthCandidate rw [hsame] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst indId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -239,7 +239,7 @@ theorem selectKSynthCandidate_selected methods s = .ok result sf := by unfold selectKSynthCandidate rw [hsame] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst indId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -267,7 +267,7 @@ theorem selectKSynthCandidate_selectedError methods s = .error err sf := by unfold selectKSynthCandidate rw [hsame] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst indId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -300,7 +300,7 @@ theorem synthCtorWhenK_majorInferMiss have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ @@ -335,7 +335,7 @@ theorem synthCtorWhenK_majorWhnfMiss have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ @@ -381,7 +381,7 @@ theorem synthCtorWhenK_nonConstHead have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ @@ -417,7 +417,7 @@ theorem synthCtorWhenK_recursorMissing have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ @@ -465,7 +465,7 @@ theorem synthCtorWhenK_majorInductiveMiss have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ @@ -574,7 +574,7 @@ theorem eval have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [h.levelArity] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec major)) methods) _ s = _ diff --git a/Ix/Tc/Verify/Whnf/Iota/Ingress.lean b/Ix/Tc/Verify/Whnf/Iota/Ingress.lean index b2b209bb7..b8ff66be5 100644 --- a/Ix/Tc/Verify/Whnf/Iota/Ingress.lean +++ b/Ix/Tc/Verify/Whnf/Iota/Ingress.lean @@ -95,7 +95,7 @@ theorem tryIotaWithFlags_state_wf_of_contexts using hcleaned cases hcheap : flags.cheapRec with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind ((whnfRec_wf (s := afterCleanup) hcleanedSupport hcleanedTr) @@ -106,7 +106,7 @@ theorem tryIotaWithFlags_state_wf_of_contexts constructorInputs recursorInputs hfault hreferences hwrites hspineMajorSupport hspineMajorTr | true => - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] apply TcM.WF.bind ((whnfCoreFlagsRec_wf (s := afterCleanup) @@ -135,7 +135,7 @@ theorem tryIotaWithFlags_state_wf_of_contexts | some recr => simp only [hinfo, pure_bind] by_cases hmajor : spine.size ≤ recr.majorIdx - · simp only [hmajor, if_pos] + · simp only [hmajor, ite_eq_left] exact TcM.WF.pure (fun _ => trivial) · simp only [hmajor] let major := spine[recr.majorIdx]! @@ -158,11 +158,11 @@ theorem tryIotaWithFlags_state_wf_of_contexts hspineTr.argument hmajorMem cases hk : recr.k with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact hpost recId recr recUs spine major afterLookup hmajorSupport hmajorTr hmajorSupport hmajorTr | true => - simp only [if_true, if_false] + simp only [ite_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (synthCtorWhenK_state_wf_of_inputs hrun kCensus diff --git a/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean b/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean index 69a561423..45242786d 100644 --- a/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean +++ b/Ix/Tc/Verify/Whnf/Iota/NatOffset.lean @@ -81,7 +81,7 @@ theorem natOffsetReaders_state_wf (fuel : Nat) : intro p after _ by_cases hsucc : (id.addr == p.natSucc.addr && args.size == 1) = true - · simp only [hsucc, if_true] + · simp only [hsucc, ite_true] rw [ReaderT.run_bind] apply TcM.WF.bind (ih.1 I methods args[0]! after) intro found afterOffset _ @@ -96,8 +96,8 @@ theorem natOffsetReaders_state_wf (fuel : Nat) : · simp only [hsucc, pure_bind] by_cases hadd : (id.addr == p.natAdd.addr && args.size == 2) = true - · simp only [hadd, if_true] - simp only [Bool.false_eq_true, if_false] + · simp only [hadd, ite_true] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (ih.2 I methods args[1]! after) intro rhs afterRhs _ @@ -137,7 +137,7 @@ theorem natOffsetReaders_state_wf (fuel : Nat) : | const id us info => by_cases hpred : (id.addr == p.natPred.addr && args.size == 1) = true - · simp only [hpred, if_true] + · simp only [hpred, ite_true] rw [ReaderT.run_bind] apply TcM.WF.bind (ih.2 I methods args[0]! after) intro value afterValue _ @@ -145,14 +145,14 @@ theorem natOffsetReaders_state_wf (fuel : Nat) : exact TcM.WF.pure (Q := fun _ _ => True) (fun _ => trivial) · simp only [hpred] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (isNatBinArithAddr_state_wf methods id.addr after) intro answer afterAddr _ by_cases hbinary : (answer && args.size == 2) = true - · simp only [hbinary, if_true] + · simp only [hbinary, ite_true] rw [ReaderT.run_bind] apply TcM.WF.bind (ih.2 I methods args[0]! afterAddr) @@ -255,7 +255,7 @@ theorem cleanupNatOffsetMajor_state_wf {I : TcState .anon → Prop} cases hsome : literal.isSome with | true => exact TcM.WF.pure (fun _ => trivial) | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] apply TcM.WF.bind (natOffset_state_wf methods e 0 afterLiteral) intro offsetResult afterOffset _ @@ -265,19 +265,19 @@ theorem cleanupNatOffsetMajor_state_wf {I : TcState .anon → Prop} | some pair => rcases pair with ⟨base, offset⟩ by_cases hzero : (offset == 0) = true - · simp only [hzero, if_true] + · simp only [hzero, ite_true] exact TcM.WF.pure (Q := fun _ _ => True) (fun _ => trivial) · simp only [hzero] by_cases hpredZero : (offset - 1 == 0) = true - · simp only [hpredZero, if_true] - simp only [Bool.false_eq_true, if_false] + · simp only [hpredZero, ite_true] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (mkNatSucc_state_wf methods base afterOffset) intro result afterResult _ exact TcM.WF.pure (Q := fun _ _ => True) (fun _ => trivial) · simp only [hpredZero] - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (mkNatAdd_state_wf methods base @@ -467,14 +467,14 @@ theorem tryIotaAfterCleanup_state_wf rcases hexpanded with ⟨hexpandedSupport, expandedV, hexpandedTr⟩ cases hcheap : flags.cheapRec with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (hmethods.whnf hexpandedSupport hexpandedTr) intro reduced afterWhnf _ exact hdispatch reduced afterWhnf | true => - simp only [if_true] + simp only [ite_true] rw [ReaderT.run_bind] apply TcM.WF.bind (hmethods.whnfCoreFlags hexpandedSupport hexpandedTr) diff --git a/Ix/Tc/Verify/Whnf/Iota/NatRecognizer.lean b/Ix/Tc/Verify/Whnf/Iota/NatRecognizer.lean index 1ad3dbf2c..cddd8044f 100644 --- a/Ix/Tc/Verify/Whnf/Iota/NatRecognizer.lean +++ b/Ix/Tc/Verify/Whnf/Iota/NatRecognizer.lean @@ -179,7 +179,7 @@ theorem eval unfold EStateM.bind rw [hlookup] simp only - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] simp only [hmajor] rfl @@ -222,7 +222,7 @@ theorem complete case recr name levelParams k isUnsafe lvls params indices motives minors block memberIdx ty rules leanAll => by_cases hminors : 2 ≤ minors.toNat - · rw [if_neg (by omega : ¬ minors.toNat < 2)] at hrun + · rw [ite_eq_right (by omega : ¬ minors.toNat < 2)] at hrun match hmajor : spine[params.toNat + motives.toNat + minors.toNat + indices.toNat]? with | none => @@ -236,7 +236,7 @@ theorem complete exact .intro hcollect haddr hlookup hminors hmajor all_goals simp at hrun · have hlt : minors.toNat < 2 := by omega - rw [if_pos hlt] at hrun + rw [ite_eq_left hlt] at hrun cases hrun · simp [haddr] at hrun diff --git a/Ix/Tc/Verify/Whnf/Iota/SelectedRule.lean b/Ix/Tc/Verify/Whnf/Iota/SelectedRule.lean index b53cf19a5..cbb5a87fc 100644 --- a/Ix/Tc/Verify/Whnf/Iota/SelectedRule.lean +++ b/Ix/Tc/Verify/Whnf/Iota/SelectedRule.lean @@ -311,7 +311,7 @@ theorem emptyInstantiation (hempty : recUs.isEmpty = true) : h.rhs = rule.rhs ∧ h.after = s := by have hrun := h.instantiate - rw [TcM.instantiateUnivParams, if_pos hempty] at hrun + rw [TcM.instantiateUnivParams, ite_eq_left hempty] at hrun have hinj := EStateM.Result.ok.inj hrun exact ⟨hinj.1.symm, hinj.2.symm⟩ diff --git a/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean b/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean index 88c530e6e..8a787f376 100644 --- a/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean +++ b/Ix/Tc/Verify/Whnf/Iota/StringLiteral.lean @@ -211,7 +211,7 @@ theorem cleanupNatOffsetMajor_str s = _ unfold EStateM.bind rw [evalNatOffsetLiteral_str] - simp only [Option.isSome, Bool.false_eq_true, if_false, pure_bind] + simp only [Option.isSome, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (natOffset (.str value blob info) 0) methods) _ s = _ diff --git a/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean b/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean index 199e21469..8d0139278 100644 --- a/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean +++ b/Ix/Tc/Verify/Whnf/Iota/StructEtaControl.lean @@ -114,7 +114,7 @@ theorem isStructLike_shapeQualified rw [hlookup] simp only rw [hshape] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (computedIsRec id) methods) _ sLookup = _ unfold EStateM.bind @@ -140,7 +140,7 @@ theorem isStructLike_recError rw [hlookup] simp only rw [hshape] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (computedIsRec id) methods) _ sLookup = _ unfold EStateM.bind @@ -297,7 +297,7 @@ theorem finishStructEtaAfterSort_success unfold StructEtaSortAdmissible at hadmissible unfold finishStructEtaAfterSort rw [hadmissible] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind, ReaderT.run_monadLift] change EStateM.bind (TcM.instantiateUnivParams rule.rhs recUs) _ s = _ unfold EStateM.bind @@ -327,7 +327,7 @@ theorem finishStructEtaAfterSort_instantiateError unfold StructEtaSortAdmissible at hadmissible unfold finishStructEtaAfterSort rw [hadmissible] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind, ReaderT.run_monadLift] change EStateM.bind (TcM.instantiateUnivParams rule.rhs recUs) _ s = _ unfold EStateM.bind @@ -355,7 +355,7 @@ theorem finishStructEtaAfterSort_finishError unfold StructEtaSortAdmissible at hadmissible unfold finishStructEtaAfterSort rw [hadmissible] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind, ReaderT.run_monadLift] change EStateM.bind (TcM.instantiateUnivParams rule.rhs recUs) _ s = _ unfold EStateM.bind @@ -418,7 +418,7 @@ theorem tryStructEtaAfterInductive_majorInferMiss change EStateM.bind (ReaderT.run (isStructLike indId) methods) _ s = _ unfold EStateM.bind rw [hstruct] - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec spine[recr.majorIdx]!)) methods) _ @@ -459,7 +459,7 @@ theorem tryStructEtaAfterInductive_sortInferMiss change EStateM.bind (ReaderT.run (isStructLike indId) methods) _ s = _ unfold EStateM.bind rw [hstruct] - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec spine[recr.majorIdx]!)) methods) _ @@ -510,7 +510,7 @@ theorem tryStructEtaAfterInductive_sortWhnfMiss change EStateM.bind (ReaderT.run (isStructLike indId) methods) _ s = _ unfold EStateM.bind rw [hstruct] - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec spine[recr.majorIdx]!)) methods) _ @@ -588,7 +588,7 @@ theorem eval change EStateM.bind (ReaderT.run (isStructLike indId) methods) _ s = _ unfold EStateM.bind rw [h.structLike] - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] change EStateM.bind (ReaderT.run (tryOptional (inferOnlyRec spine[recr.majorIdx]!)) methods) _ @@ -677,7 +677,7 @@ theorem tryStructEtaIota_levelMismatch (tryStructEtaIota recId recr recUs spine).run methods s = .ok none s := by unfold tryStructEtaIota rw [hcount] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [hlevels] rfl @@ -692,11 +692,11 @@ theorem tryStructEtaIota_recursorMissing (tryStructEtaIota recId recr recUs spine).run methods s = .ok none sf := by unfold tryStructEtaIota rw [hcount] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst recId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -714,11 +714,11 @@ theorem tryStructEtaIota_recursorError .error err sf := by unfold tryStructEtaIota rw [hcount] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] change EStateM.bind (TcM.tryGetConst recId) _ s = _ unfold EStateM.bind rw [hlookup] @@ -745,11 +745,11 @@ theorem tryStructEtaIota_majorInductiveMiss (tryStructEtaIota recId recr recUs spine).run methods s = .ok none sf := by unfold tryStructEtaIota rw [hcount] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [hlevels] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [hrule] change EStateM.bind (TcM.tryGetConst recId) _ s = _ unfold EStateM.bind @@ -825,11 +825,11 @@ theorem eval (tryStructEtaIota recId recr recUs spine).run methods s = outcome := by unfold tryStructEtaIota rw [h.ruleCount] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] have hlevelsNe : (recUs.size.toUInt64 != recr.lvls) = false := by simp [h.levelArity] rw [hlevelsNe] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [h.selectedRule] change EStateM.bind (TcM.tryGetConst recId) _ s = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Whnf/Iota/SynthesisRequests.lean b/Ix/Tc/Verify/Whnf/Iota/SynthesisRequests.lean index 7ecb711cc..a477d9f93 100644 --- a/Ix/Tc/Verify/Whnf/Iota/SynthesisRequests.lean +++ b/Ix/Tc/Verify/Whnf/Iota/SynthesisRequests.lean @@ -294,7 +294,7 @@ theorem verifyKSynthCandidate_state_wf_of_requests intro equal afterDefEq _ cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply TcM.WF.bind (TcM.bumpStats_whnf_wf (fun st : TcState .anon => @@ -386,7 +386,7 @@ theorem verifyKSynthCandidate_state_wf_of_inputs intro equal afterDefEq _ cases equal with | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply TcM.WF.bind (TcM.bumpStats_whnf_wf (fun st : TcState .anon => @@ -570,9 +570,9 @@ theorem synthCtorWhenK_state_wf_of_requests (fun _ _ => True) := by unfold synthCtorWhenK by_cases hlevels : (recUs.size.toUInt64 != recr.lvls) = true - · simp only [hlevels, if_true] + · simp only [hlevels, ite_true] exact TcM.WF.pure fun _ => trivial - · simp only [hlevels, Bool.false_eq_true, if_false] + · simp only [hlevels, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind (tryOptional_state_wf (hinfer major s)) intro foundTy afterInfer _ @@ -677,9 +677,9 @@ theorem synthCtorWhenK_state_wf_of_inputs KSynthGeneratedInput trProj world support uvars Delta result) := by unfold synthCtorWhenK by_cases hlevels : (recUs.size.toUInt64 != recr.lvls) = true - · simp only [hlevels, if_true] + · simp only [hlevels, ite_true] exact TcM.WF.pure fun _ => trivial - · simp only [hlevels, Bool.false_eq_true, if_false] + · simp only [hlevels, Bool.false_eq_true, ite_false] rw [ReaderT.run_bind] apply TcM.WF.bind ((tryOptionalInferOnlyRec_wf diff --git a/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean b/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean index 95a18174d..f0e35edcc 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/ProjectionApplication.lean @@ -27,7 +27,7 @@ theorem tryProjAppReduce_empty (hempty : args.isEmpty = true) : (tryProjAppReduce source flags).run methods s = .ok none s := by unfold tryProjAppReduce - simp only [hspine, hempty, if_true] + simp only [hspine, hempty, ite_true] rfl theorem tryProjAppReduce_notProjection @@ -40,7 +40,7 @@ theorem tryProjAppReduce_notProjection head ≠ KExpr.prj id field value info) : (tryProjAppReduce source flags).run methods s = .ok none s := by unfold tryProjAppReduce - simp only [hspine, hnonempty, Bool.false_eq_true, if_false] + simp only [hspine, hnonempty, Bool.false_eq_true, ite_false] cases head <;> simp_all theorem tryProjAppReduce_projectionWhnfError @@ -56,7 +56,7 @@ theorem tryProjAppReduce_projectionWhnfError else (whnfRec value).run methods s) = .error err s₁) : (tryProjAppReduce source flags).run methods s = .error err s₁ := by unfold tryProjAppReduce - simp only [hspine, hnonempty, Bool.false_eq_true, if_false] + simp only [hspine, hnonempty, Bool.false_eq_true, ite_false] cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals @@ -80,7 +80,7 @@ theorem tryProjAppReduce_projectionReduceError .error err s₂) : (tryProjAppReduce source flags).run methods s = .error err s₂ := by unfold tryProjAppReduce - simp only [hspine, hnonempty, Bool.false_eq_true, if_false] + simp only [hspine, hnonempty, Bool.false_eq_true, ite_false] cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals @@ -110,7 +110,7 @@ theorem tryProjAppReduce_projectionNone .ok none s₂) : (tryProjAppReduce source flags).run methods s = .ok none s₂ := by unfold tryProjAppReduce - simp only [hspine, hnonempty, Bool.false_eq_true, if_false] + simp only [hspine, hnonempty, Bool.false_eq_true, ite_false] cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals @@ -143,7 +143,7 @@ theorem tryProjAppReduce_projectionSome (tryProjAppReduce source flags).run methods s = .ok (some (result, args)) s₂ := by unfold tryProjAppReduce - simp only [hspine, hnonempty, Bool.false_eq_true, if_false] + simp only [hspine, hnonempty, Bool.false_eq_true, ite_false] cases hcheap : flags.cheapProj <;> simp only [hcheap, Bool.false_eq_true, ↓reduceIte] at hwhnf ⊢ all_goals @@ -246,7 +246,7 @@ theorem tryProjAppReduceFinished_app_optional_wf else whnfRec value).run methods s = .error err s₁ := by cases hcheap : flags.cheapProj <;> - simp only [hcheap, Bool.false_eq_true, if_false, if_true] + simp only [hcheap, Bool.false_eq_true, ite_false, ite_true] at hcallbackRun ⊢ <;> exact hcallbackRun rw [hcallbackRunReader] at hcallbackPost @@ -261,7 +261,7 @@ theorem tryProjAppReduceFinished_app_optional_wf else whnfRec value).run methods s = .ok wvalue s₁ := by cases hcheap : flags.cheapProj <;> - simp only [hcheap, Bool.false_eq_true, if_false, if_true] + simp only [hcheap, Bool.false_eq_true, ite_false, ite_true] at hcallbackRun ⊢ <;> exact hcallbackRun rw [hcallbackRunReader] at hcallbackPost diff --git a/Ix/Tc/Verify/Whnf/NoDelta/ProjectionDefinition.lean b/Ix/Tc/Verify/Whnf/NoDelta/ProjectionDefinition.lean index 3b0c84de1..f8b934c26 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/ProjectionDefinition.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/ProjectionDefinition.lean @@ -139,9 +139,9 @@ theorem tryReduceProjectionDefinition_inv_wf ⟨arity, structId, field, structArgIdx⟩ simp only by_cases hsmall : args.size < arity - · simp only [hsmall, if_pos] + · simp only [hsmall, ite_eq_left] exact RecM.WF.pure fun _ => trivial - · simp only [hsmall, if_false] + · simp only [hsmall, ite_false] let base : KExpr .anon := KExpr.mkPrj structId field args[structArgIdx]! obtain ⟨hbase, final, plan⟩ := diff --git a/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean b/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean index 96eb1258d..f46e17992 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/Quotient.lean @@ -122,16 +122,16 @@ theorem tryQuotReduceSelected_inv_wf | const mkId mkUs mkInfo => cases hctor : (mkId.addr != prims.quotCtor.addr) with | true => - simp only [hctor, if_true] + simp only [hctor, ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [hctor, Bool.false_eq_true, if_false] + simp only [hctor, Bool.false_eq_true, ite_false] cases hsize : (mkArgs.size != 3) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] let base : KExpr .anon := KExpr.mkApp args[fIdx]! mkArgs[2]! obtain ⟨hbase, final, plan⟩ := @@ -186,11 +186,11 @@ theorem tryQuotReduce_inv_wf subst afterRead cases hlift : (id.addr == prims.quotLift.addr) with | true => - simp only [if_true] + simp only [ite_true] by_cases hsize : args.size < 6 - · simp only [hsize, if_pos] + · simp only [hsize, ite_eq_left] exact RecM.WF.pure fun _ => trivial - · simp only [hsize, if_false] + · simp only [hsize, ite_false] have hfIdx : 3 < args.size := by omega have hmajorIdx : 5 < args.size := by omega exact @@ -198,17 +198,17 @@ theorem tryQuotReduce_inv_wf (semantics := semantics) (trProj := trProj) (world := world) hsourceSupport hsource hspine hfIdx hmajorIdx | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hind : (id.addr == prims.quotInd.addr) with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | true => - simp only [if_true] + simp only [ite_true] by_cases hsize : args.size < 5 - · simp only [hsize, if_pos] + · simp only [hsize, ite_eq_left] exact RecM.WF.pure fun _ => trivial - · simp only [hsize, if_false] + · simp only [hsize, ite_false] have hfIdx : 3 < args.size := by omega have hmajorIdx : 4 < args.size := by omega exact diff --git a/Ix/Tc/Verify/Whnf/NoDelta/QuotientReflection.lean b/Ix/Tc/Verify/Whnf/NoDelta/QuotientReflection.lean index 38068dd08..1d5416af6 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/QuotientReflection.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/QuotientReflection.lean @@ -540,16 +540,16 @@ theorem complete | const mkId mkUs mkInfo => cases hctor : (mkId.addr != prims.quotCtor.addr) with | true => - simp only [hctor, if_true] at hrun + simp only [hctor, ite_true] at hrun cases hrun | false => - simp only [hctor, Bool.false_eq_true, if_false] at hrun + simp only [hctor, Bool.false_eq_true, ite_false] at hrun cases hsize : (mkArgs.size != 3) with | true => - simp only [hsize, if_true] at hrun + simp only [hsize, ite_true] at hrun cases hrun | false => - simp only [hsize, Bool.false_eq_true, if_false] at hrun + simp only [hsize, Bool.false_eq_true, ite_false] at hrun rw [ReaderT.run_bind, ReaderT.run_monadLift] at hrun change EStateM.bind (TcM.intern _) _ afterWhnf = _ at hrun unfold EStateM.bind at hrun @@ -803,11 +803,11 @@ theorem of_laws simp only at hrun cases hlift : (id.addr == s.prims.quotLift.addr) with | true => - simp only [hlift, if_true] at hrun + simp only [hlift, ite_true] at hrun by_cases hsmall : args.size < 6 - · simp only [hsmall, if_pos] at hrun + · simp only [hsmall, ite_eq_left] at hrun cases hrun - · simp only [hsmall, if_false] at hrun + · simp only [hsmall, ite_false] at hrun have hmajorIdx : 5 < args.size := by omega have trace := RecM.QuotientSelectedSuccessTrace.complete hrun @@ -815,17 +815,17 @@ theorem of_laws hmethods hI hsourceSupport hsource hspine (beq_iff_eq.mp hlift) hmajorIdx | false => - simp only [hlift, Bool.false_eq_true, if_false] at hrun + simp only [hlift, Bool.false_eq_true, ite_false] at hrun cases hind : (id.addr == s.prims.quotInd.addr) with | false => - simp only [hind, Bool.false_eq_true, if_false] at hrun + simp only [hind, Bool.false_eq_true, ite_false] at hrun cases hrun | true => - simp only [hind, if_true] at hrun + simp only [hind, ite_true] at hrun by_cases hsmall : args.size < 5 - · simp only [hsmall, if_pos] at hrun + · simp only [hsmall, ite_eq_left] at hrun cases hrun - · simp only [hsmall, if_false] at hrun + · simp only [hsmall, ite_false] at hrun have hmajorIdx : 4 < args.size := by omega have trace := RecM.QuotientSelectedSuccessTrace.complete hrun diff --git a/Ix/Tc/Verify/Whnf/NoDelta/StringPrimitive.lean b/Ix/Tc/Verify/Whnf/NoDelta/StringPrimitive.lean index 99af60b5d..fa8db9fb1 100644 --- a/Ix/Tc/Verify/Whnf/NoDelta/StringPrimitive.lean +++ b/Ix/Tc/Verify/Whnf/NoDelta/StringPrimitive.lean @@ -107,10 +107,10 @@ theorem tryReduceString_inv_wf rcases spine with ⟨head, args⟩ cases hsize : args.size != 1 with | true => - simp only [hsize, if_true] + simp only [hsize, ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [hsize, Bool.false_eq_true, if_false] + simp only [hsize, Bool.false_eq_true, ite_false] cases head with | const id us headInfo => simp only [pure_bind] @@ -127,10 +127,10 @@ theorem tryReduceString_inv_wf !(id.addr == prims.stringUtf8ByteSize.addr) && !(id.addr == prims.stringToByteArray.addr)) with | true => - simp only [if_true] + simp only [ite_true] exact RecM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases harg : args[0]! with | str value blob stringInfo => unfold tryReduceStringLiteral @@ -138,7 +138,7 @@ theorem tryReduceString_inv_wf cases hutf8 : (id.addr == prims.stringUtf8ByteSize.addr) with | true => - simp only [if_true] + simp only [ite_true] let requested : KExpr .anon := natExprFromValue value.utf8ByteSize have hrequested : support requested := by @@ -153,14 +153,14 @@ theorem tryReduceString_inv_wf subst interned exact RecM.WF.pure fun _ => hrequested | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] cases hbytes : (id.addr == prims.stringToByteArray.addr) with | true => - simp only [if_true] + simp only [ite_true] cases hempty : value.isEmpty with | true => - simp only [if_true, pure_bind] + simp only [ite_true, pure_bind] let requested : KExpr .anon := KExpr.mkConst prims.byteArrayEmpty #[] have hrequested : support requested := by @@ -177,10 +177,10 @@ theorem tryReduceString_inv_wf subst interned exact RecM.WF.pure fun _ => hrequested | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact RecM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] have hback : (id.addr == prims.stringBack.addr || id.addr == diff --git a/Ix/Tc/Verify/Whnf/RuntimeContracts.lean b/Ix/Tc/Verify/Whnf/RuntimeContracts.lean index 04bdf6ff3..51fc4d6c8 100644 --- a/Ix/Tc/Verify/Whnf/RuntimeContracts.lean +++ b/Ix/Tc/Verify/Whnf/RuntimeContracts.lean @@ -301,7 +301,7 @@ theorem isTransientNatLiteralWork_wf {I : TcState .anon → Prop} cases first with | true => exact TcM.WF.pure fun _ => trivial | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rcases hcollect : source.collectSpine with ⟨head, args⟩ cases head <;> simp only all_goals try exact TcM.WF.pure fun _ => trivial @@ -378,7 +378,7 @@ theorem isTransientNatLiteralWork_noLazy {methods : Methods .anon} cases first with | true => exact ⟨true, rfl⟩ | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] rcases hcollect : source.collectSpine with ⟨head, args⟩ cases head <;> simp only all_goals try exact ⟨false, rfl⟩ diff --git a/Ix/Tc/Verify/Whnf/StructEta/Classifier.lean b/Ix/Tc/Verify/Whnf/StructEta/Classifier.lean index 250da9a2e..8a4fed26e 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/Classifier.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/Classifier.lean @@ -192,7 +192,7 @@ theorem tryStructEtaAfterInductive_wf cases structLike with | false => exact TcM.WF.pure fun _ => trivial | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind] apply TcM.WF.bind ((tryOptionalInferOnlyRec_wf @@ -258,13 +258,13 @@ theorem tryStructEtaIota_trusted_prefix_wf (fun _ _ => True) := by unfold tryStructEtaIota by_cases hrules : (recr.rules.size != 1) = true - · simp only [hrules, if_true] + · simp only [hrules, ite_true] exact TcM.WF.pure fun _ => trivial - · simp only [hrules, Bool.false_eq_true, if_false] + · simp only [hrules, Bool.false_eq_true, ite_false] by_cases hlevels : (recUs.size.toUInt64 != recr.lvls) = true - · simp only [hlevels, if_true] + · simp only [hlevels, ite_true] exact TcM.WF.pure fun _ => trivial - · simp only [hlevels, Bool.false_eq_true, if_false, pure_bind] + · simp only [hlevels, Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind, ReaderT.run_monadLift] apply TcM.WF.bind (Q₁ := fun found after => diff --git a/Ix/Tc/Verify/Whnf/StructEta/ExactMajorTelescope.lean b/Ix/Tc/Verify/Whnf/StructEta/ExactMajorTelescope.lean index d05486bb5..e2c8256bc 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/ExactMajorTelescope.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/ExactMajorTelescope.lean @@ -86,7 +86,7 @@ theorem restoreDepth_go_exact {base : TcState .anon} {n after} unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) after = .ok after after from rfl] - simp only [gt, if_true] + simp only [gt, ite_true] change EStateM.bind TcM.popLocal (fun _ => TcM.restoreDepth.go base.ctx.size _) after = _ unfold EStateM.bind diff --git a/Ix/Tc/Verify/Whnf/StructEta/ScopedClassifier.lean b/Ix/Tc/Verify/Whnf/StructEta/ScopedClassifier.lean index 1e0a0fc13..602713766 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/ScopedClassifier.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/ScopedClassifier.lean @@ -162,7 +162,7 @@ theorem scratch_computeIsRecFieldStep_scoped .ok (.next body) afterPush := by rw [scratch_computeIsRecFieldStep_run, scratch_bind_ok hrun, computeIsRecFieldStepAfterWhnf, hmentions] - simp only [Bool.false_eq_true, if_false, pure_bind] + simp only [Bool.false_eq_true, ite_false, pure_bind] rw [ReaderT.run_bind, ReaderT.run_monadLift, monadLift_self, scratch_bind_ok hpush] rfl diff --git a/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean b/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean index 9931a5689..ed0f6e264 100644 --- a/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean +++ b/Ix/Tc/Verify/Whnf/StructEta/ScopedTelescope.lean @@ -182,7 +182,7 @@ theorem scratch_restoreDepth_go else pure ()) s = .ok () final unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] - simp only [hgt, if_true] + simp only [hgt, ite_true] change EStateM.bind TcM.popLocal (fun _ => TcM.restoreDepth.go saved n) s = .ok () final unfold EStateM.bind diff --git a/Ix/Tc/Verify/Whnf/Structural/CacheShell.lean b/Ix/Tc/Verify/Whnf/Structural/CacheShell.lean index 7a43392c4..b65ad5815 100644 --- a/Ix/Tc/Verify/Whnf/Structural/CacheShell.lean +++ b/Ix/Tc/Verify/Whnf/Structural/CacheShell.lean @@ -154,12 +154,12 @@ theorem whnfCoreWithFlagsNonLeaf_wf intro transient s2 _ cases hfull : flags.isFull with | true => - simp only [if_true] + simp only [ite_true] cases transient with | true => simpa using hinner s2 | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply RecM.WF.bind (Q₁ := fun observed after => observed = s2 ∧ after = s2) (RecM.WF.get fun _ => ⟨rfl, rfl⟩) @@ -208,7 +208,7 @@ theorem whnfCoreWithFlagsNonLeaf_wf | true => simpa using hinner s2 | false => - simp only [Bool.not_false, if_true] + simp only [Bool.not_false, ite_true] apply RecM.WF.bind (Q₁ := fun observed after => observed = s2 ∧ after = s2) (RecM.WF.get fun _ => ⟨rfl, rfl⟩) @@ -328,7 +328,7 @@ theorem whnfCoreWithFlags_wf | false => simpa using hreflexive s | true => - simp only [Bool.not_true, Bool.false_eq_true, if_false, + simp only [Bool.not_true, Bool.false_eq_true, ite_false, pure_bind] exact hshell s diff --git a/Ix/Tc/Verify/Whnf/Structural/ProjectionStep.lean b/Ix/Tc/Verify/Whnf/Structural/ProjectionStep.lean index c717b7bdb..1821db137 100644 --- a/Ix/Tc/Verify/Whnf/Structural/ProjectionStep.lean +++ b/Ix/Tc/Verify/Whnf/Structural/ProjectionStep.lean @@ -79,8 +79,8 @@ theorem whnfCoreWithFlagsStep_projection_wf (whnfCoreFlagsRec value flags).run methods s else (whnfRec value).run methods s) = .error err s1 := by cases hcheap : flags.cheapProj - · simpa only [hcheap, Bool.false_eq_true, if_false] using hcallbackRun - · simpa only [hcheap, if_true] using hcallbackRun + · simpa only [hcheap, Bool.false_eq_true, ite_false] using hcallbackRun + · simpa only [hcheap, ite_true] using hcallbackRun rw [whnfCoreWithFlagsStep_projectionWhnfError hwhnf] exact ⟨hcallbackPost.1, trivial⟩ | .ok wvalue s1 => @@ -90,8 +90,8 @@ theorem whnfCoreWithFlagsStep_projection_wf (whnfCoreFlagsRec value flags).run methods s else (whnfRec value).run methods s) = .ok wvalue s1 := by cases hcheap : flags.cheapProj - · simpa only [hcheap, Bool.false_eq_true, if_false] using hcallbackRun - · simpa only [hcheap, if_true] using hcallbackRun + · simpa only [hcheap, Bool.false_eq_true, ite_false] using hcallbackRun + · simpa only [hcheap, ite_true] using hcallbackRun have hhelperPost := hhelper (id := id) (field := field) hmethods hcallbackPost.2.1 hcallbackPost.1 diff --git a/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean b/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean index 708bcf076..22e890d0f 100644 --- a/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean +++ b/Ix/Tc/Verify/Whnf/Structural/RecursiveCallbacks.lean @@ -95,10 +95,10 @@ theorem projectionValueCallback_wf have hvalueSupport := hinputs.projection hsupport cases hcheap : flags.cheapProj with | false => - simp only [Bool.false_eq_true, if_false] + simp only [Bool.false_eq_true, ite_false] exact whnfRec_wf hvalueSupport hvalueTr | true => - simp only [if_true] + simp only [ite_true] exact whnfCoreFlagsRec_wf hvalueSupport hvalueTr /-- The application-head callback is justified by the actual production diff --git a/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean b/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean index e81b293f5..4ff72e771 100644 --- a/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean +++ b/Ix/Tc/Verify/Whnf/Structural/VariableStep.lean @@ -27,7 +27,7 @@ theorem lookupLetVal_noLet unfold EStateM.bind rw [show (get : TcM .anon (TcState .anon)) s = .ok s s from rfl] simp only - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] rw [hval] rfl diff --git a/Tests/Fixtures/ixon-v4/primitives.tsv b/Tests/Fixtures/ixon-v4/primitives.tsv index 88cb2bd9a..29ee32c37 100644 --- a/Tests/Fixtures/ixon-v4/primitives.tsv +++ b/Tests/Fixtures/ixon-v4/primitives.tsv @@ -10,12 +10,12 @@ Nat.pow 5baaf05c969d2cf377312111be51bb64c600c13fa164ee722e92243b0f771bab Nat.gcd aba94bfb41351d4db36172c379a512f04219ef21dc5454d71590967d4e8f913f Nat.mod 11abbf986481c53a21c8cb21ee2581ae6238aedbec15f972959d086bef1a1985 Nat.div 824d1c53d8c1c3cf0a27f24639ec2be1ecc13d4a01c993171595edccf6949737 -Nat.bitwise 6eff55f72c856bd08aa02896fb78d93c28e11aae2be05c318b9d1f9fab8d7a53 +Nat.bitwise adaf32f49aa6fee4ac8b0742563494b381e0742d9ea685fe2456eb71b25fec08 Nat.beq d3d8ff924af9dc4b5cd869760615b3e7ee80916bb617259d45890c69f4128337 Nat.ble 9e445b9d5f8252772347872e909b5db4e7eca7086cedf4fec6de840f6b7b5f92 -Nat.land d98bed1e14cda0eea470a5a49ff7926c80eb4bc7bfbdd0c3e14d4baa5c2dd0d7 -Nat.lor 88ff34dd42e57766beefc229d8b62dabba9cef6aadcc85c88ad67323d02bbf21 -Nat.xor 1b0acdd4080abe5bc4acb5f06527cb62ad92792eb429c2b3bcb6f471d7945085 +Nat.land de8c100c22f82a5c3533c67e4370671813434a6fec5d023998ded090df4a4934 +Nat.lor 93afc1cd298c63606e5f468d1e5989ab4680d256e95d07a8642a88b5c6b858e1 +Nat.xor 77dd40d7b6ca310cc59466d1f24df4f180ef50e1b00fd850698458cd26901c5d Nat.shiftLeft 05bb657e8b9d5dc224e7ef3d53e54153ce3ac26da8d1f1b1d61069a3726566cd Nat.shiftRight 25019ff485fcf5709597cd1e07fcc3ce796776ef3f715a6d187eb5831c63b4be Bool e6eba3c8b4d19f6a1076b39fa89aec61dccbb960f83d9a62e6acf35a69c9a0a4 @@ -87,8 +87,8 @@ OfNat.ofNat cb84bffa6d7092a309630214af29d9ec4e35cd5e0003eb9cdf75ee484e24925b Unit 9232498667f765f437dedaac828e555f6cc67a20e6db28f614fdf3c262710feb PUnit._sizeOf_1 523699b6e827b74a950d4718bdf5b13c193e3c7c371aaad4d635667be74b05fa SizeOf.sizeOf ea81aee4a7d154faa8211a2594406dfdc7442020c0f29d2d0f79b4e62314da51 -String.back b052e814120ea6299aecf4e9bb2b656d67c1f9537e8f0e9f16479c98a04fde93 -String.Legacy.back 10af1decd5d2cd085adff8ae7fb44cfc5d22a89bbc40b81b809d3d556fda3e8f +String.back 616eeeb0735f93dd10891b72bb659dd80418a6e84a9ce1313ecb41b0adc7623a +String.Legacy.back 2f4e032675b915bfd44c2099b41c819971c259ec42f4b5e24fdddf20c03fe573 String.utf8ByteSize 4c086826cc679df3b6aa57a29f3d093a8a92d0de4edecef46a908d8398733dc0 String.append 0eae69f3f8b198d1ffac67b9e88d39526b1b039ff519cd87eec106f63974860c String.decEq da7bb331e098f9bf5cdabcb9609a7e953dffc609ad9d90871a14c016c52a3011 diff --git a/Tests/Ix/IxVM.lean b/Tests/Ix/IxVM.lean index 75f81739b..310d7e41a 100644 --- a/Tests/Ix/IxVM.lean +++ b/Tests/Ix/IxVM.lean @@ -445,14 +445,14 @@ private def kernelCheckEntries : List (String × Nat) := [ ("Eq.rec", 112_305_029), ("Nat", 108_730_176), ("Nat.add", 150_020_629), - ("Nat.add_comm", 295_312_785), + ("Nat.add_comm", 295_318_952), ("Nat.decEq", 348_642_490), ("Nat.decLe", 761_020_256), ("Nat.sub_le_of_le_add", 1_808_361_693), ("Nat.shiftRight_succ", 1_366_388_481), ("Trans.mk", 116_194_291), - ("Array.append_assoc", 8_271_244_910), - ("Vector.append", 8_463_566_986), + ("Array.append_assoc", 8_280_752_224), + ("Vector.append", 8_473_162_406), ("IxVMPrim.nat_add_lit", 191_123_094), ("IxVMPrim.nat_sub_lit", 206_401_042), ("IxVMPrim.nat_mul_lit", 182_766_302), @@ -462,20 +462,20 @@ private def kernelCheckEntries : List (String × Nat) := [ ("IxVMPrim.nat_succ_lit", 124_064_179), ("IxVMPrim.nat_pred_lit", 145_426_875), ("IxVMPrim.nat_gcd_lit", 2_082_584_316), - ("IxVMPrim.nat_land_lit", 3_398_695_890), - ("IxVMPrim.nat_lor_lit", 3_400_417_670), - ("IxVMPrim.nat_xor_lit", 3_419_508_852), + ("IxVMPrim.nat_land_lit", 3_406_549_841), + ("IxVMPrim.nat_lor_lit", 3_408_491_548), + ("IxVMPrim.nat_xor_lit", 3_427_263_814), ("IxVMPrim.nat_shl_lit", 212_078_257), ("IxVMPrim.nat_shr_lit", 1_345_954_472), - ("IxVMPrim.nat_pow_big", 372_254_505), + ("IxVMPrim.nat_pow_big", 372_260_819), ("IxVMPrim.nat_beq_lit", 180_547_863), ("IxVMPrim.nat_ble_lit", 175_462_141), - ("IxVMPrim.nat_cases_big", 145_027_143), + ("IxVMPrim.nat_cases_big", 145_032_616), ("IxVMPrim.nat_dec_le", 778_244_764), ("IxVMPrim.nat_dec_lt", 789_751_664), ("IxVMPrim.nat_dec_eq", 387_384_729), - ("IxVMPrim.str_size_lit", 2_404_789_933), - ("IxVMPrim.bv_to_nat_lit", 1_994_913_874), + ("IxVMPrim.str_size_lit", 2_404_805_829), + ("IxVMPrim.bv_to_nat_lit", 1_994_929_213), ("IxVMInd.Even", 185_074_012), ("IxVMInd.Odd", 185_078_955), ("IxVMInd.Even.rec", 202_844_500), @@ -491,20 +491,20 @@ private def kernelCheckEntries : List (String × Nat) := [ ("IxVMInd.DedupM.rec", 128_275_371), ("IxVMInd.DepthM", 112_305_397), ("IxVMInd.DepthM.rec", 123_506_204), - ("String.Internal.append", 2_375_681_040), - ("_private.Init.Prelude.0.Lean.extractMainModule._unsafe_rec", 3_519_021_255), - ("Lean.Syntax.rec", 2_434_931_223), + ("String.Internal.append", 2_375_696_942), + ("_private.Init.Prelude.0.Lean.extractMainModule._unsafe_rec", 3_519_054_116), + ("Lean.Syntax.rec", 2_434_947_406), ("IxVMInd.AuxTie", 303_560_632), ("IxVMInd.AuxTie.rec", 348_849_592), ("IxVMInd.HiddenIdx", 109_711_717), ("IxVMInd.HiddenIdx.rec", 113_178_609), ("IxVMInd.thmMajorUse", 477_896_745), ("IxVMInd.partialKRec", 129_810_071), - ("IxVMInd.deepRebase", 200_140_117), - ("String.Slice.Pattern.Model.NoPrefixPatternModel.rec", 3_304_553_428), - ("Lean.Widget.TaggedText.rec", 2_403_042_928), - ("Lean.Doc.Part.rec", 2_445_512_655), - ("Lean.Doc.Block.rec", 2_668_808_782), + ("IxVMInd.deepRebase", 200_146_058), + ("String.Slice.Pattern.Model.NoPrefixPatternModel.rec", 3_304_593_905), + ("Lean.Widget.TaggedText.rec", 2_403_058_919), + ("Lean.Doc.Part.rec", 2_445_520_879), + ("Lean.Doc.Block.rec", 2_668_817_107), ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A", 111_823_090), ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec", 115_300_949), ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedup1.A.rec_1", 114_539_434), @@ -514,8 +514,8 @@ private def kernelCheckEntries : List (String × Nat) := [ ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec", 124_061_154), ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec_1", 124_060_118), ("_private.Tests.Ix.Compile.Mutual.0.Tests.Ix.Compile.Mutual.AuxDedupMixed.M.rec_2", 114_539_434), - ("strOfListFoldSize", 2_673_997_843), - ("strOfListFoldSizeAscii", 2_674_602_649), + ("strOfListFoldSize", 2_674_013_882), + ("strOfListFoldSizeAscii", 2_674_618_692), ("IxVMPrim.lazy_ble_offset", 213_003_842), ("IxVMPrim.lazy_unit_cast", 523_654_301), ("IxVMPrim.sizeof_unit", 141_010_145), diff --git a/Tests/Ix/Kernel/PrimeGapsReduction.lean b/Tests/Ix/Kernel/PrimeGapsReduction.lean index 309c95110..7e6b3e81e 100644 --- a/Tests/Ix/Kernel/PrimeGapsReduction.lean +++ b/Tests/Ix/Kernel/PrimeGapsReduction.lean @@ -95,8 +95,8 @@ noncomputable def dataCheck (S n maxNib aBound sigEnc eraseEnc labelEnc : Nat) : (fun fL => Bool.rec (motive := fun _ => Bool) false (ihL (Nat.succ i)) - (Bool.and' - (Bool.and' (Nat.blt (labelSignature fL) S) + (Bool.and + (Bool.and (Nat.blt (labelSignature fL) S) (Nat.beq (labelDegree fL) (Nat.land (Nat.shiftRight uT (Nat.shiftLeft (labelSignature fL) (nat_lit 4))) @@ -117,7 +117,7 @@ noncomputable def dataCheck (S n maxNib aBound sigEnc eraseEnc labelEnc : Nat) : (Nat.add uT (Nat.shiftLeft (Nat.shiftLeft usum (nat_lit 1)) (Nat.shiftLeft s (nat_lit 4))))) - (Bool.and' (Nat.ble jSlot (nat_lit 4)) + (Bool.and (Nat.ble jSlot (nat_lit 4)) (Nat.beq (slotField eraseEnc s (nat_lit 4)) (Nat.succ (Nat.shiftLeft s (nat_lit 5)))))) (fun _ ihJ j => @@ -137,15 +137,15 @@ noncomputable def dataCheck (S n maxNib aBound sigEnc eraseEnc labelEnc : Nat) : ((fun fS => Bool.rec (motive := fun _ => Bool) false (ihT (Nat.succ t) nib (Nat.succ jSlot) (Nat.add usum nib)) - (Bool.and' - (Bool.and' (slotUsed fS) (Nat.beq (slotPart2 fS) nib)) - (Bool.and' (Nat.blt (slotTarget fS) S) + (Bool.and + (Bool.and (slotUsed fS) (Nat.beq (slotPart2 fS) nib)) + (Bool.and (Nat.blt (slotTarget fS) S) (Nat.beq (sigField sigEnc (slotTarget fS)) (eraseAt enc t))))) (slotField eraseEnc s jSlot)) - (Bool.or' (Nat.beq t (nat_lit 0)) - (Bool.not' (Nat.beq nib prev)))) - (Bool.and' (Nat.blt (nat_lit 0) nib) (Nat.ble prev nib))) + (Bool.or (Nat.beq t (nat_lit 0)) + (Bool.not (Nat.beq nib prev)))) + (Bool.and (Nat.blt (nat_lit 0) nib) (Nat.ble prev nib))) (Nat.blt t m)) (sigNib enc t)) maxNib (nat_lit 0) (nat_lit 0) (nat_lit 0) (nat_lit 0)) diff --git a/Tests/Main.lean b/Tests/Main.lean index de82bd63f..7e8f31335 100644 --- a/Tests/Main.lean +++ b/Tests/Main.lean @@ -300,8 +300,8 @@ def ignoredRunners (env : Lean.Environment) : List (String × IO UInt32) := [ let actual := (Aiur.computeStats vmEnv.compiled qc vmEnv.shapes).totalFftCost.round.toUInt64.toNat pure (LSpec.test - s!"Shard pipeline FFT matches: expected 6_236_673_618, got {actual}" - (actual = 6_236_673_618)) + s!"Shard pipeline FFT matches: expected 6_233_496_998, got {actual}" + (actual = 6_233_496_998)) LSpec.lspecIO (.ofList [("ixvm", [fullSeq, aiurSeq, arenaSeq, exploitSeq, dependencySeq, paritySeq, shardSeq])]) []), diff --git a/crates/common/src/prim_addrs.rs b/crates/common/src/prim_addrs.rs index 20d079f71..8be9d1bf4 100644 --- a/crates/common/src/prim_addrs.rs +++ b/crates/common/src/prim_addrs.rs @@ -179,7 +179,7 @@ impl PrimAddrs { "824d1c53d8c1c3cf0a27f24639ec2be1ecc13d4a01c993171595edccf6949737", ), nat_bitwise: h( - "6eff55f72c856bd08aa02896fb78d93c28e11aae2be05c318b9d1f9fab8d7a53", + "adaf32f49aa6fee4ac8b0742563494b381e0742d9ea685fe2456eb71b25fec08", ), nat_beq: h( "d3d8ff924af9dc4b5cd869760615b3e7ee80916bb617259d45890c69f4128337", @@ -188,13 +188,13 @@ impl PrimAddrs { "9e445b9d5f8252772347872e909b5db4e7eca7086cedf4fec6de840f6b7b5f92", ), nat_land: h( - "d98bed1e14cda0eea470a5a49ff7926c80eb4bc7bfbdd0c3e14d4baa5c2dd0d7", + "de8c100c22f82a5c3533c67e4370671813434a6fec5d023998ded090df4a4934", ), nat_lor: h( - "88ff34dd42e57766beefc229d8b62dabba9cef6aadcc85c88ad67323d02bbf21", + "93afc1cd298c63606e5f468d1e5989ab4680d256e95d07a8642a88b5c6b858e1", ), nat_xor: h( - "1b0acdd4080abe5bc4acb5f06527cb62ad92792eb429c2b3bcb6f471d7945085", + "77dd40d7b6ca310cc59466d1f24df4f180ef50e1b00fd850698458cd26901c5d", ), nat_shift_left: h( "05bb657e8b9d5dc224e7ef3d53e54153ce3ac26da8d1f1b1d61069a3726566cd", @@ -420,10 +420,10 @@ impl PrimAddrs { "ea81aee4a7d154faa8211a2594406dfdc7442020c0f29d2d0f79b4e62314da51", ), string_back: h( - "b052e814120ea6299aecf4e9bb2b656d67c1f9537e8f0e9f16479c98a04fde93", + "616eeeb0735f93dd10891b72bb659dd80418a6e84a9ce1313ecb41b0adc7623a", ), string_legacy_back: h( - "10af1decd5d2cd085adff8ae7fb44cfc5d22a89bbc40b81b809d3d556fda3e8f", + "2f4e032675b915bfd44c2099b41c819971c259ec42f4b5e24fdddf20c03fe573", ), string_utf8_byte_size: h( "4c086826cc679df3b6aa57a29f3d093a8a92d0de4edecef46a908d8398733dc0", diff --git a/crates/ixvm-codegen/src/aiur_ixvm.rs b/crates/ixvm-codegen/src/aiur_ixvm.rs index ece07c679..ac2b6a378 100644 --- a/crates/ixvm-codegen/src/aiur_ixvm.rs +++ b/crates/ixvm-codegen/src/aiur_ixvm.rs @@ -732,15 +732,15 @@ fn aiur_fn_179(inp: [G; IN_179], input_hash: u64, rec const INPUT_SIZE_180: usize = 0; const IN_180: usize = 0; const OUT_180: usize = 1; -fn aiur_fn_180(inp: [G; IN_180], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_180], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(217); let __v_1: G = G::from_u64(139); let __v_2: G = G::from_u64(237); let __v_3: G = G::from_u64(30); let __v_4: G = G::from_u64(20); let __v_5: G = G::from_u64(205); let __v_6: G = G::from_u64(160); let __v_7: G = G::from_u64(238); let __v_8: G = G::from_u64(164); let __v_9: G = G::from_u64(112); let __v_10: G = G::from_u64(165); let __v_11: G = G::from_u64(159); let __v_12: G = G::from_u64(247); let __v_13: G = G::from_u64(146); let __v_14: G = G::from_u64(108); let __v_15: G = G::from_u64(128); let __v_16: G = G::from_u64(235); let __v_17: G = G::from_u64(75); let __v_18: G = G::from_u64(199); let __v_19: G = G::from_u64(191); let __v_20: G = G::from_u64(189); let __v_21: G = G::from_u64(208); let __v_22: G = G::from_u64(195); let __v_23: G = G::from_u64(225); let __v_24: G = G::from_u64(77); let __v_25: G = G::from_u64(170); let __v_26: G = G::from_u64(92); let __v_27: G = G::from_u64(45); let __v_28: G = G::from_u64(215); let __v_29: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_8, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_17, __v_25, __v_26, __v_27, __v_21, __v_28]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_180] = [__v_29]; record.function_queries[180].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } +fn aiur_fn_180(inp: [G; IN_180], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_180], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(222); let __v_1: G = G::from_u64(140); let __v_2: G = G::from_u64(16); let __v_3: G = G::from_u64(12); let __v_4: G = G::from_u64(34); let __v_5: G = G::from_u64(248); let __v_6: G = G::from_u64(42); let __v_7: G = G::from_u64(92); let __v_8: G = G::from_u64(53); let __v_9: G = G::from_u64(51); let __v_10: G = G::from_u64(198); let __v_11: G = G::from_u64(126); let __v_12: G = G::from_u64(67); let __v_13: G = G::from_u64(112); let __v_14: G = G::from_u64(103); let __v_15: G = G::from_u64(24); let __v_16: G = G::from_u64(19); let __v_17: G = G::from_u64(74); let __v_18: G = G::from_u64(111); let __v_19: G = G::from_u64(236); let __v_20: G = G::from_u64(93); let __v_21: G = G::from_u64(2); let __v_22: G = G::from_u64(57); let __v_23: G = G::from_u64(152); let __v_24: G = G::from_u64(208); let __v_25: G = G::from_u64(144); let __v_26: G = G::from_u64(223); let __v_27: G = G::from_u64(73); let __v_28: G = G::from_u64(52); let __v_29: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_12, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_0, __v_24, __v_25, __v_26, __v_17, __v_27, __v_28]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_180] = [__v_29]; record.function_queries[180].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } const INPUT_SIZE_181: usize = 0; const IN_181: usize = 0; const OUT_181: usize = 1; -fn aiur_fn_181(inp: [G; IN_181], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_181], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(136); let __v_1: G = G::from_u64(255); let __v_2: G = G::from_u64(52); let __v_3: G = G::from_u64(221); let __v_4: G = G::from_u64(66); let __v_5: G = G::from_u64(229); let __v_6: G = G::from_u64(119); let __v_7: G = G::from_u64(102); let __v_8: G = G::from_u64(190); let __v_9: G = G::from_u64(239); let __v_10: G = G::from_u64(194); let __v_11: G = G::from_u64(41); let __v_12: G = G::from_u64(216); let __v_13: G = G::from_u64(182); let __v_14: G = G::from_u64(45); let __v_15: G = G::from_u64(171); let __v_16: G = G::from_u64(186); let __v_17: G = G::from_u64(156); let __v_18: G = G::from_u64(106); let __v_19: G = G::from_u64(173); let __v_20: G = G::from_u64(204); let __v_21: G = G::from_u64(133); let __v_22: G = G::from_u64(200); let __v_23: G = G::from_u64(138); let __v_24: G = G::from_u64(214); let __v_25: G = G::from_u64(115); let __v_26: G = G::from_u64(35); let __v_27: G = G::from_u64(208); let __v_28: G = G::from_u64(43); let __v_29: G = G::from_u64(191); let __v_30: G = G::from_u64(33); let __v_31: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_9, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_181] = [__v_31]; record.function_queries[181].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } +fn aiur_fn_181(inp: [G; IN_181], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_181], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(147); let __v_1: G = G::from_u64(175); let __v_2: G = G::from_u64(193); let __v_3: G = G::from_u64(205); let __v_4: G = G::from_u64(41); let __v_5: G = G::from_u64(140); let __v_6: G = G::from_u64(99); let __v_7: G = G::from_u64(96); let __v_8: G = G::from_u64(110); let __v_9: G = G::from_u64(95); let __v_10: G = G::from_u64(70); let __v_11: G = G::from_u64(141); let __v_12: G = G::from_u64(30); let __v_13: G = G::from_u64(89); let __v_14: G = G::from_u64(137); let __v_15: G = G::from_u64(171); let __v_16: G = G::from_u64(128); let __v_17: G = G::from_u64(210); let __v_18: G = G::from_u64(86); let __v_19: G = G::from_u64(233); let __v_20: G = G::from_u64(93); let __v_21: G = G::from_u64(7); let __v_22: G = G::from_u64(168); let __v_23: G = G::from_u64(100); let __v_24: G = G::from_u64(42); let __v_25: G = G::from_u64(136); let __v_26: G = G::from_u64(181); let __v_27: G = G::from_u64(198); let __v_28: G = G::from_u64(184); let __v_29: G = G::from_u64(88); let __v_30: G = G::from_u64(225); let __v_31: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_10, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_181] = [__v_31]; record.function_queries[181].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } const INPUT_SIZE_182: usize = 0; const IN_182: usize = 0; const OUT_182: usize = 1; -fn aiur_fn_182(inp: [G; IN_182], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_182], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(27); let __v_1: G = G::from_u64(10); let __v_2: G = G::from_u64(205); let __v_3: G = G::from_u64(212); let __v_4: G = G::from_u64(8); let __v_5: G = G::from_u64(190); let __v_6: G = G::from_u64(91); let __v_7: G = G::from_u64(196); let __v_8: G = G::from_u64(172); let __v_9: G = G::from_u64(181); let __v_10: G = G::from_u64(240); let __v_11: G = G::from_u64(101); let __v_12: G = G::from_u64(39); let __v_13: G = G::from_u64(203); let __v_14: G = G::from_u64(98); let __v_15: G = G::from_u64(173); let __v_16: G = G::from_u64(146); let __v_17: G = G::from_u64(121); let __v_18: G = G::from_u64(46); let __v_19: G = G::from_u64(180); let __v_20: G = G::from_u64(41); let __v_21: G = G::from_u64(194); let __v_22: G = G::from_u64(179); let __v_23: G = G::from_u64(188); let __v_24: G = G::from_u64(182); let __v_25: G = G::from_u64(244); let __v_26: G = G::from_u64(113); let __v_27: G = G::from_u64(215); let __v_28: G = G::from_u64(148); let __v_29: G = G::from_u64(80); let __v_30: G = G::from_u64(133); let __v_31: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_1, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_182] = [__v_31]; record.function_queries[182].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } +fn aiur_fn_182(inp: [G; IN_182], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_182], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(119); let __v_1: G = G::from_u64(221); let __v_2: G = G::from_u64(64); let __v_3: G = G::from_u64(215); let __v_4: G = G::from_u64(182); let __v_5: G = G::from_u64(202); let __v_6: G = G::from_u64(49); let __v_7: G = G::from_u64(12); let __v_8: G = G::from_u64(197); let __v_9: G = G::from_u64(148); let __v_10: G = G::from_u64(102); let __v_11: G = G::from_u64(209); let __v_12: G = G::from_u64(242); let __v_13: G = G::from_u64(77); let __v_14: G = G::from_u64(244); let __v_15: G = G::from_u64(241); let __v_16: G = G::from_u64(128); let __v_17: G = G::from_u64(239); let __v_18: G = G::from_u64(80); let __v_19: G = G::from_u64(225); let __v_20: G = G::from_u64(176); let __v_21: G = G::from_u64(15); let __v_22: G = G::from_u64(216); let __v_23: G = G::from_u64(105); let __v_24: G = G::from_u64(132); let __v_25: G = G::from_u64(88); let __v_26: G = G::from_u64(205); let __v_27: G = G::from_u64(38); let __v_28: G = G::from_u64(144); let __v_29: G = G::from_u64(28); let __v_30: G = G::from_u64(93); let __v_31: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_18, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_182] = [__v_31]; record.function_queries[182].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } const INPUT_SIZE_183: usize = 0; const IN_183: usize = 0; const OUT_183: usize = 1; @@ -908,11 +908,11 @@ fn aiur_fn_223(inp: [G; IN_223], input_hash: u64, rec const INPUT_SIZE_224: usize = 0; const IN_224: usize = 0; const OUT_224: usize = 1; -fn aiur_fn_224(inp: [G; IN_224], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_224], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(176); let __v_1: G = G::from_u64(82); let __v_2: G = G::from_u64(232); let __v_3: G = G::from_u64(20); let __v_4: G = G::from_u64(18); let __v_5: G = G::from_u64(14); let __v_6: G = G::from_u64(166); let __v_7: G = G::from_u64(41); let __v_8: G = G::from_u64(154); let __v_9: G = G::from_u64(236); let __v_10: G = G::from_u64(244); let __v_11: G = G::from_u64(233); let __v_12: G = G::from_u64(187); let __v_13: G = G::from_u64(43); let __v_14: G = G::from_u64(101); let __v_15: G = G::from_u64(109); let __v_16: G = G::from_u64(103); let __v_17: G = G::from_u64(193); let __v_18: G = G::from_u64(249); let __v_19: G = G::from_u64(83); let __v_20: G = G::from_u64(126); let __v_21: G = G::from_u64(143); let __v_22: G = G::from_u64(159); let __v_23: G = G::from_u64(22); let __v_24: G = G::from_u64(71); let __v_25: G = G::from_u64(156); let __v_26: G = G::from_u64(152); let __v_27: G = G::from_u64(160); let __v_28: G = G::from_u64(79); let __v_29: G = G::from_u64(222); let __v_30: G = G::from_u64(147); let __v_31: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_5, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_224] = [__v_31]; record.function_queries[224].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } +fn aiur_fn_224(inp: [G; IN_224], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_224], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(97); let __v_1: G = G::from_u64(110); let __v_2: G = G::from_u64(238); let __v_3: G = G::from_u64(176); let __v_4: G = G::from_u64(115); let __v_5: G = G::from_u64(95); let __v_6: G = G::from_u64(147); let __v_7: G = G::from_u64(221); let __v_8: G = G::from_u64(16); let __v_9: G = G::from_u64(137); let __v_10: G = G::from_u64(27); let __v_11: G = G::from_u64(114); let __v_12: G = G::from_u64(187); let __v_13: G = G::from_u64(101); let __v_14: G = G::from_u64(157); let __v_15: G = G::from_u64(216); let __v_16: G = G::from_u64(4); let __v_17: G = G::from_u64(24); let __v_18: G = G::from_u64(166); let __v_19: G = G::from_u64(232); let __v_20: G = G::from_u64(74); let __v_21: G = G::from_u64(156); let __v_22: G = G::from_u64(225); let __v_23: G = G::from_u64(49); let __v_24: G = G::from_u64(62); let __v_25: G = G::from_u64(203); let __v_26: G = G::from_u64(65); let __v_27: G = G::from_u64(173); let __v_28: G = G::from_u64(199); let __v_29: G = G::from_u64(98); let __v_30: G = G::from_u64(58); let __v_31: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_3, __v_27, __v_28, __v_29, __v_30]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_224] = [__v_31]; record.function_queries[224].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } const INPUT_SIZE_225: usize = 0; const IN_225: usize = 0; const OUT_225: usize = 1; -fn aiur_fn_225(inp: [G; IN_225], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_225], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(16); let __v_1: G = G::from_u64(175); let __v_2: G = G::from_u64(29); let __v_3: G = G::from_u64(236); let __v_4: G = G::from_u64(213); let __v_5: G = G::from_u64(210); let __v_6: G = G::from_u64(205); let __v_7: G = G::from_u64(8); let __v_8: G = G::from_u64(90); let __v_9: G = G::from_u64(223); let __v_10: G = G::from_u64(248); let __v_11: G = G::from_u64(174); let __v_12: G = G::from_u64(127); let __v_13: G = G::from_u64(180); let __v_14: G = G::from_u64(76); let __v_15: G = G::from_u64(252); let __v_16: G = G::from_u64(93); let __v_17: G = G::from_u64(34); let __v_18: G = G::from_u64(168); let __v_19: G = G::from_u64(155); let __v_20: G = G::from_u64(188); let __v_21: G = G::from_u64(64); let __v_22: G = G::from_u64(184); let __v_23: G = G::from_u64(27); let __v_24: G = G::from_u64(128); let __v_25: G = G::from_u64(157); let __v_26: G = G::from_u64(61); let __v_27: G = G::from_u64(85); let __v_28: G = G::from_u64(111); let __v_29: G = G::from_u64(218); let __v_30: G = G::from_u64(62); let __v_31: G = G::from_u64(143); let __v_32: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_26, __v_27, __v_28, __v_29, __v_30, __v_31]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_225] = [__v_32]; record.function_queries[225].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } +fn aiur_fn_225(inp: [G; IN_225], input_hash: u64, record: &mut QueryRecord, io_buffer: &mut IOBuffer,) -> Result<[G; OUT_225], ExecError> { stacker::maybe_grow((64 * 1024), ((4 * 1024) * 1024), || { let unconstrained = UNCONSTRAINED; aiur::execute::check_record_cap((&record.budget))?; let __v_0: G = G::from_u64(47); let __v_1: G = G::from_u64(78); let __v_2: G = G::from_u64(3); let __v_3: G = G::from_u64(38); let __v_4: G = G::from_u64(117); let __v_5: G = G::from_u64(185); let __v_6: G = G::from_u64(21); let __v_7: G = G::from_u64(191); let __v_8: G = G::from_u64(212); let __v_9: G = G::from_u64(76); let __v_10: G = G::from_u64(32); let __v_11: G = G::from_u64(153); let __v_12: G = G::from_u64(180); let __v_13: G = G::from_u64(28); let __v_14: G = G::from_u64(129); let __v_15: G = G::from_u64(113); let __v_16: G = G::from_u64(194); let __v_17: G = G::from_u64(89); let __v_18: G = G::from_u64(236); let __v_19: G = G::from_u64(66); let __v_20: G = G::from_u64(244); let __v_21: G = G::from_u64(181); let __v_22: G = G::from_u64(226); let __v_23: G = G::from_u64(79); let __v_24: G = G::from_u64(221); let __v_25: G = G::from_u64(223); let __v_26: G = G::from_u64(192); let __v_27: G = G::from_u64(63); let __v_28: G = G::from_u64(229); let __v_29: G = G::from_u64(115); let __v_30: G = { let __values: [G; 32] = [__v_0, __v_1, __v_2, __v_3, __v_4, __v_5, __v_6, __v_7, __v_8, __v_9, __v_10, __v_11, __v_12, __v_13, __v_14, __v_11, __v_15, __v_16, __v_17, __v_18, __v_19, __v_20, __v_21, __v_22, __v_23, __v_24, __v_25, __v_10, __v_26, __v_27, __v_28, __v_29]; let __mq = record.memory_queries.get_index_mut(12).map(|(_, q)| q).ok_or(ExecError::InvalidMemorySize(32))?; let (__hash, __hit) = __mq.lookup((&__values[..])); match __hit { Some(__i) => { if (!unconstrained) { __mq.bump_multiplicity(__i); } __mq.output_at(__i)[0] }, _ => { aiur::execute::check_store((&record.budget), __mq, 32)?; let __ptr = G::from_usize((record.pointer_base + __mq.len())); __mq.insert_hashed((&__values[..]), (&[__ptr]), G::from_bool((!unconstrained)), __hash)?; __ptr }, } }; let __ret: [G; OUT_225] = [__v_30]; record.function_queries[225].finish_hashed((&inp[..]), (&__ret[..]), (!unconstrained), input_hash)?; return Ok(__ret); }) } const INPUT_SIZE_226: usize = 0; const IN_226: usize = 0; const OUT_226: usize = 1; diff --git a/flake.lock b/flake.lock index 9a11bed12..e414a289c 100644 --- a/flake.lock +++ b/flake.lock @@ -33,17 +33,17 @@ ] }, "locked": { - "lastModified": 1788716740, - "narHash": "sha256-S1nQ6SBqwAQk0U838a3GyqVOudJcgnQfhxLiPuEIjCk=", + "lastModified": 1790877542, + "narHash": "sha256-eLXw9Jf/BQ3I/DYYvRLMrEx8quUtj7oRJRPG5mjo5CE=", "owner": "argumentcomputer", "repo": "Blake3.lean", - "rev": "78f5bc4b22de1172af8a5d91e7039128084fad3a", + "rev": "3f8b805614a0bae1c033469ff893a8f0ee85f601", "type": "github" }, "original": { "owner": "argumentcomputer", "repo": "Blake3.lean", - "rev": "78f5bc4b22de1172af8a5d91e7039128084fad3a", + "rev": "3f8b805614a0bae1c033469ff893a8f0ee85f601", "type": "github" } }, @@ -198,11 +198,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1787412565, - "narHash": "sha256-M1y7JYDUzvOSYv0DWcCCmkL2DqDfQZePsKDrQf/Or6U=", + "lastModified": 1790785453, + "narHash": "sha256-d25LPK3rcJKXkUC2XfF9jN5SlUCIwyWDffidGDqxn38=", "owner": "argumentcomputer", "repo": "lean4-nix", - "rev": "1ecad9d6f99cf3255a858861c9a2e6966cdd0290", + "rev": "e828640c7710bb571eb052d02f1adb2ed5694c5e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 075b0202f..1a7014c4d 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ # Blake3 Rust bindings for Lean blake3-lean = { - url = "github:argumentcomputer/Blake3.lean/78f5bc4b22de1172af8a5d91e7039128084fad3a"; + url = "github:argumentcomputer/Blake3.lean/3f8b805614a0bae1c033469ff893a8f0ee85f601"; # System packages, follows lean4-nix so we stay in sync inputs.lean4-nix.follows = "lean4-nix"; }; diff --git a/lake-manifest.json b/lake-manifest.json index 1f571e9bb..407a9196f 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -5,60 +5,60 @@ "type": "git", "subDir": null, "scope": "", - "rev": "a4188d7c2979378d85c6bb41fdd96c3a48a71371", + "rev": "a5621ecfe6416360d4e310c0ed40f3e79ae0710e", "name": "lean4lean", "manifestFile": "lake-manifest.json", - "inputRev": "a4188d7c2979378d85c6bb41fdd96c3a48a71371", + "inputRev": "a5621ecfe6416360d4e310c0ed40f3e79ae0710e", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover-community/batteries", "type": "git", "subDir": null, "scope": "", - "rev": "4488d40d070b9700d4d5a6aa342f0d40c31b2a2d", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", "name": "batteries", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover/lean4-cli", "type": "git", "subDir": null, "scope": "", - "rev": "6130a47896ce867c6a4a55373441e59e565bad0f", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/argumentcomputer/Blake3.lean", "type": "git", "subDir": null, "scope": "", - "rev": "78f5bc4b22de1172af8a5d91e7039128084fad3a", + "rev": "3f8b805614a0bae1c033469ff893a8f0ee85f601", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "78f5bc4b22de1172af8a5d91e7039128084fad3a", + "inputRev": "3f8b805614a0bae1c033469ff893a8f0ee85f601", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", "type": "git", "subDir": null, "scope": "", - "rev": "ab4d5eb461941837f48eb891be755c8c73e89fdd", + "rev": "d8eb3e0d9a8e33fc116e6700df0418a1d8114508", "name": "LSpec", "manifestFile": "lake-manifest.json", - "inputRev": "ab4d5eb461941837f48eb891be755c8c73e89fdd", + "inputRev": "d8eb3e0d9a8e33fc116e6700df0418a1d8114508", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover-community/plausible", "type": "git", "subDir": null, "scope": "", - "rev": "b7eb3304aeae834b12dda98993a37f6a41f6f0bb", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", "name": "plausible", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": true, "configFile": "lakefile.toml"}], "name": "ix", diff --git a/lakefile.lean b/lakefile.lean index 1d327b73a..0cd01aa82 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -5,7 +5,7 @@ package ix where version := v!"0.1.0" require LSpec from git - "https://github.com/argumentcomputer/LSpec" @ "ab4d5eb461941837f48eb891be755c8c73e89fdd" + "https://github.com/argumentcomputer/LSpec" @ "d8eb3e0d9a8e33fc116e6700df0418a1d8114508" /- Blake3 precompiles its libraries, so Lake loads their shared objects -- which bundle the C and Rust FFI objects -- into any process elaborating a module that @@ -15,13 +15,13 @@ the revision that turned precompilation on. Before it, Blake3 exposed a `blake3_rs_shared` cdylib that `ix_native_decide_dynlib` had to fetch and link; that target no longer exists. -/ require Blake3 from git - "https://github.com/argumentcomputer/Blake3.lean" @ "78f5bc4b22de1172af8a5d91e7039128084fad3a" + "https://github.com/argumentcomputer/Blake3.lean" @ "3f8b805614a0bae1c033469ff893a8f0ee85f601" require Cli from git - "https://github.com/leanprover/lean4-cli" @ "v4.33.0" + "https://github.com/leanprover/lean4-cli" @ "v4.34.0" require batteries from git - "https://github.com/leanprover-community/batteries" @ "v4.33.0" + "https://github.com/leanprover-community/batteries" @ "v4.34.0" /- Reference Lean4-in-Lean4 theory and checker. `IxTcVerify` imports its Theory/Verify specification surface, while `bench-lean4lean` and the ignored @@ -35,7 +35,7 @@ value (leanprover/lean4#14498), which the replay path in inductive-environment and projection development, and tracks Lean v4.33.1 as this package does. -/ require lean4lean from git - "https://github.com/argumentcomputer/lean4ix" @ "a4188d7c2979378d85c6bb41fdd96c3a48a71371" + "https://github.com/argumentcomputer/lean4ix" @ "a5621ecfe6416360d4e310c0ed40f3e79ae0710e" /-! ## FFI diff --git a/lean-toolchain b/lean-toolchain index a8afa7d1b..ba8ebf2db 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.1 +leanprover/lean4:v4.34.1