id
int64
1
500
thm_name
stringlengths
5
86
thm_stmt
stringlengths
30
2.63k
lean_root
stringclasses
23 values
rel_path
stringlengths
13
61
imports
listlengths
0
35
used_lib_defs
listlengths
1
144
used_repo_defs
listlengths
1
251
lib_lemmas
listlengths
1
172
repo_lemmas
listlengths
1
148
used_local_defs
listlengths
0
85
used_local_lemmas
listlengths
0
57
local_ctx
stringlengths
35
30.7k
target_theorem
stringlengths
33
1.57k
ground_truth_proof
stringlengths
6
26.5k
nesting_depth
int64
1
27
transitive_dep_count
int64
1
480
subset_aristotle
bool
2 classes
category
stringclasses
5 values
201
Intmax.isLUB_union_Merge_of_isLUB_isLUB_compat
lemma isLUB_union_Merge_of_isLUB_isLUB_compat {A B : Set (BalanceProof K₁ Kβ‚‚ C Pi V)} (h₁ : IsLUB A j₁) (hβ‚‚ : IsLUB B jβ‚‚) (h₃ : j₁ <β‰…> jβ‚‚) : IsLUB (A βˆͺ B) (j₁ <+> jβ‚‚)
FVIntmax
FVIntmax/Theorem1.lean
[ "import FVIntmax.Lemma5", "import FVIntmax.Wheels.AuthenticatedDictionary", "import FVIntmax.Request", "import FVIntmax.AttackGame", "import FVIntmax.Wheels", "import FVIntmax.Propositions", "import Mathlib", "import FVIntmax.Balance", "import FVIntmax.Lemma4", "import FVIntmax.Wheels.SignatureAgg...
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "IsLUB", "module": "Mathlib...
[ { "name": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b", "content": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b" }, { "name": "notation:51 π₁:52 \" <β‰…> \" Ο€β‚‚:52 => BalanceProof.compat π₁ Ο€β‚‚", "content": "notation:51 π₁:52 \" <β‰…> \" Ο€β‚‚:52 => BalanceProof.compat π₁...
[ { "name": "Set.mem_insert_iff", "module": "Mathlib.Data.Set.Insert" }, { "name": "Set.mem_setOf_eq", "module": "Mathlib.Data.Set.Operations" }, { "name": "Set.mem_singleton_iff", "module": "Mathlib.Data.Set.Insert" }, { "name": "Set.mem_union", "module": "Mathlib.Data.Set...
[ { "name": "proposition6", "content": "lemma proposition6 [Setoid' Y] {D₁ Dβ‚‚ : Dict X Y} :\n (βˆƒ join, IsLUB {D₁, Dβ‚‚} join) ↔ βˆ€ x, D₁ x β‰  .none ∧ Dβ‚‚ x β‰  .none β†’ D₁ x β‰… Dβ‚‚ x" }, { "name": "proposition4", "content": "lemma proposition4 [Setoid' X] {x y : Option X} :\n (βˆƒ join : Option X, IsLUB {x,...
[]
[ { "name": "Intmax.existsLUB_iff_compat", "content": "lemma existsLUB_iff_compat :\n (βˆƒ join, IsLUB {π₁, Ο€β‚‚} join) ↔ π₁ <β‰…> Ο€β‚‚" }, { "name": "Intmax.merge_le", "content": "lemma merge_le (h₁ : π₁ ≀ π₃) (hβ‚‚ : Ο€β‚‚ ≀ π₃) : π₁ <+> Ο€β‚‚ ≀ π₃" } ]
import FVIntmax.AttackGame import FVIntmax.Lemma3 import FVIntmax.Lemma4 import FVIntmax.Lemma5 import FVIntmax.Propositions import FVIntmax.Request import FVIntmax.Wheels import FVIntmax.Wheels.AuthenticatedDictionary import FVIntmax.Wheels.SignatureAggregation import Mathlib namespace Intmax open Classical...
lemma isLUB_union_Merge_of_isLUB_isLUB_compat {A B : Set (BalanceProof K₁ Kβ‚‚ C Pi V)} (h₁ : IsLUB A j₁) (hβ‚‚ : IsLUB B jβ‚‚) (h₃ : j₁ <β‰…> jβ‚‚) : IsLUB (A βˆͺ B) (j₁ <+> jβ‚‚) :=
:= by have h₃'' := h₃ obtain ⟨j, hβ‚ƒβŸ© := existsLUB_iff_compat.2 h₃ split_ands Β· simp only [IsLUB, IsLeast, upperBounds, Set.mem_insert_iff, Set.mem_singleton_iff, forall_eq_or_imp, forall_eq, Set.mem_setOf_eq, lowerBounds, and_imp, Set.mem_union] at h₁ hβ‚‚ h₃ ⊒ rcases h₁ with ⟨h₁, h₁'⟩ rcases hβ‚‚ with ...
7
52
false
Applied verif.
202
Intmax.Vec.le_trans
lemma le_trans (h₁ : v₁ ≀ vβ‚‚) (hβ‚‚ : vβ‚‚ ≀ v₃) : v₁ ≀ v₃
FVIntmax
FVIntmax/Wheels.lean
[ "import Mathlib.Logic.Embedding.Basic", "import FVIntmax.Wheels.Wheels", "import Mathlib.Tactic", "import Mathlib.Algebra.Order.Ring.Unbundled.Nonneg", "import Mathlib.Data.Finmap", "import Mathlib.Data.Set.Image", "import Mathlib.Data.Finite.Defs", "import Mathlib.Data.List.Intervals" ]
[ { "name": "Vector", "module": "Init.Data.Vector.Basic" } ]
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.CryptoAssumptions.Injective", "content": "class Injective {Ξ± Ο‰ : Type} (f : Ξ± β†’ Ο‰) where\n h : ComputationallyInfeasible (Β¬ Function.Injective f)" }, { "name": "Intmax.Vec.le", "content": "def le (v₁ vβ‚‚ : Vector Ξ± n) :=\n βˆ€ x ∈ (v₁.1.zip vβ‚‚.1), x.1 ≀ x.2" } ]
[]
import Mathlib.Algebra.Order.Ring.Unbundled.Nonneg import Mathlib.Data.Finite.Defs import Mathlib.Data.Finmap import Mathlib.Data.List.Intervals import Mathlib.Data.Set.Image import Mathlib.Logic.Embedding.Basic import Mathlib.Tactic import FVIntmax.Wheels.Wheels namespace Intmax namespace CryptoAssumptions s...
lemma le_trans (h₁ : v₁ ≀ vβ‚‚) (hβ‚‚ : vβ‚‚ ≀ v₃) : v₁ ≀ v₃ :=
:= by dsimp [(·≀·), le] at * rcases v₁ with ⟨l₁, hlβ‚βŸ© rcases vβ‚‚ with ⟨lβ‚‚, hlβ‚‚βŸ© rcases v₃ with ⟨l₃, hlβ‚ƒβŸ© simp at * induction' lβ‚‚ with hdβ‚‚ tlβ‚‚ ih generalizing l₁ l₃ n Β· rcases l₃; exact h₁; simp_all; omega Β· rcases l₃ with _ | ⟨hd₃, tlβ‚ƒβŸ© <;> [simp; skip] rcases l₁ with _ | ⟨hd₁, tlβ‚βŸ© <;> simp at * ...
2
3
false
Applied verif.
203
Intmax.monotone_TransactionsInBlocksFixed
lemma monotone_TransactionsInBlocksFixed : Monotone Ξ» (Ο€ : BalanceProof K₁ Kβ‚‚ C Pi V) ↦ TransactionsInBlocksFixed Ο€ Bstar
FVIntmax
FVIntmax/Lemma4.lean
[ "import FVIntmax.Wheels.Dictionary", "import FVIntmax.Wheels", "import FVIntmax.Balance" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Pre...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "BalanceProof", "content": "abbrev BalanceProof (K₁ Kβ‚‚ : Type) [Finite K₁] [Finite Kβ‚‚]\n ...
[ { "name": "not_and_or", "module": "Mathlib.Logic.Basic" }, { "name": "congr_fun", "module": "Batteries.Logic" }, { "name": "List.ext_get_iff", "module": "Mathlib.Data.List.Basic" } ]
[ { "name": "le_of_ext_le", "content": "lemma le_of_ext_le {Ξ± : Type} [Preorder Ξ±] {v₁ vβ‚‚ : Vector Ξ± n}\n (h : βˆ€ i : Fin n, v₁.1[i] ≀ vβ‚‚.1[i]) : v₁ ≀ vβ‚‚" }, { "name": "mem_dict_iff_mem_keys", "content": "lemma mem_dict_iff_mem_keys {dict : Dict Ξ± Ο‰} : k ∈ dict ↔ k ∈ dict.keys" }, { "name"...
[ { "name": "Intmax.length_of_TransactionsInBlocks", "content": "private abbrev length_of_TransactionsInBlocks (bs : List (Block K₁ Kβ‚‚ C Sigma V)) :\n { n : β„• // n = (TransactionsInBlocks (Classical.arbitrary _ : BalanceProof K₁ Kβ‚‚ C Pi V) bs).length } :=\n ⟨(TransactionsInBlocks (Classical.arbitrary _ : Ba...
[ { "name": "Intmax.TransactionsInBlocksFixed_le_of_TransactionsInBlocks", "content": "lemma TransactionsInBlocksFixed_le_of_TransactionsInBlocks\n (h : βˆ€ i : Fin (length_of_TransactionsInBlocks bs).1,\n (TransactionsInBlocks Ο€ bs)[i]'(by blast with Ο€ i) ≀\n (TransactionsInBlocks Ο€' bs)[i]'(by blast wi...
import FVIntmax.Balance namespace Intmax open Mathlib noncomputable section Lemma4 section HicSuntDracones section variable {Pi C Sigma : Type} {K₁ : Type} [Finite K₁] [LinearOrder K₁] {Kβ‚‚ : Type} [Finite Kβ‚‚] [LinearOrder Kβ‚‚] {V : Type} [AddCommGroup V] [Lattice V] {Ο€...
lemma monotone_TransactionsInBlocksFixed : Monotone Ξ» (Ο€ : BalanceProof K₁ Kβ‚‚ C Pi V) ↦ TransactionsInBlocksFixed Ο€ Bstar :=
:= by intros Ο€ Ο€' h dsimp apply TransactionsInBlocksFixed_le_of_TransactionsInBlocks; rintro ⟨i, hi⟩; simp generalize eq : (TransactionsInBlocks Ο€ Bstar)[i]'(by blast with Ο€) = Tstar generalize eq' : (TransactionsInBlocks Ο€' Bstar)[i]'(by clear eq; blast with Ο€') = Tstar' rcases Tstar with ⟨⟨s, r, v⟩, hβ‚βŸ© ...
9
73
false
Applied verif.
204
Intmax.compat_merge_of_compat
lemma compat_merge_of_compat : (βˆ€ Ο€', Ο€' ∈ Ο€s β†’ Ο€ <β‰…> Ο€') β†’ Ο€ <β‰…> (mergeR'' Ο€s .initial)
FVIntmax
FVIntmax/Theorem1.lean
[ "import FVIntmax.Lemma5", "import FVIntmax.Wheels.AuthenticatedDictionary", "import FVIntmax.Request", "import FVIntmax.AttackGame", "import FVIntmax.Wheels", "import FVIntmax.Propositions", "import Mathlib", "import FVIntmax.Lemma4", "import FVIntmax.Wheels.Dictionary", "import FVIntmax.Wheels.Si...
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Pre...
[ { "name": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b", "content": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b" }, { "name": "notation:51 π₁:52 \" <β‰…> \" Ο€β‚‚:52 => BalanceProof.compat π₁ Ο€β‚‚", "content": "notation:51 π₁:52 \" <β‰…> \" Ο€β‚‚:52 => BalanceProof.compat π₁...
[ { "name": "...", "module": "" } ]
[ { "name": "Merge_assoc", "content": "lemma Merge_assoc {D₃ : Dict Ξ± Ο‰} :\n Merge (Merge D₁ Dβ‚‚) D₃ = Merge D₁ (Merge Dβ‚‚ D₃)" } ]
[ { "name": "Intmax.mergeR''", "content": "def mergeR'' (Ο€s : List (BalanceProof K₁ Kβ‚‚ C Pi V)) (acc : BalanceProof K₁ Kβ‚‚ C Pi V) : BalanceProof K₁ Kβ‚‚ C Pi V :=\n match Ο€s with\n | [] => acc\n | Ο€ :: Ο€s => Dict.Merge acc (mergeR'' Ο€s Ο€)" }, { "name": "Intmax.BalanceProof.compat", "content": "de...
[ { "name": "Intmax.merge_lem_aux", "content": "private lemma merge_lem_aux :\n mergeR'' (Ο€ :: Ο€s) acc = acc <+> Ο€ <+> (mergeR'' Ο€s BalanceProof.initial)" }, { "name": "Intmax.merge_lem", "content": "lemma merge_lem :\n mergeR'' (Ο€ :: Ο€s) BalanceProof.initial = Ο€ <+> (mergeR'' Ο€s BalanceProof.in...
import FVIntmax.AttackGame import FVIntmax.Lemma3 import FVIntmax.Lemma4 import FVIntmax.Lemma5 import FVIntmax.Propositions import FVIntmax.Request import FVIntmax.Wheels import FVIntmax.Wheels.AuthenticatedDictionary import FVIntmax.Wheels.SignatureAggregation import Mathlib namespace Intmax open Classical...
lemma compat_merge_of_compat : (βˆ€ Ο€', Ο€' ∈ Ο€s β†’ Ο€ <β‰…> Ο€') β†’ Ο€ <β‰…> (mergeR'' Ο€s .initial) :=
:= by induction Ο€s generalizing Ο€ with | nil => intros Ο€ unfold BalanceProof.compat BalanceProof.initial simp | cons Ο€ Ο€s ih => intros Ο€_1 h rw [merge_lem] apply compat_lem <;> aesop
5
22
false
Applied verif.
205
Intmax.aggregateDeposits_cons
@[simp] lemma aggregateDeposits_cons {hd} {tl : List (Block K₁ Kβ‚‚ C Sigma V)} : aggregateDeposits (hd :: tl) = (if h : hd.isDepositBlock then (hd.getDeposit h).2.1 else 0) + aggregateDeposits tl
FVIntmax
FVIntmax/AttackGame.lean
[ "import FVIntmax.Wheels.AuthenticatedDictionary", "import FVIntmax.Request", "import FVIntmax.Block", "import FVIntmax.Wheels.SignatureAggregation", "import FVIntmax.BalanceProof", "import FVIntmax.Wheels" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Sigma", "module": "Init.Core" }, { "name": "Fin", "module": "Init.Prelude" }, { ...
[ { "name": "Injective", "content": "class Injective {Ξ± Ο‰ : Type} (f : Ξ± β†’ Ο‰) where\n h : ComputationallyInfeasible (Β¬ Function.Injective f)" }, { "name": "Scontract", "content": "abbrev Scontract (K₁ Kβ‚‚ V : Type) [PreWithZero V] (C Sigma : Type) :=\n List (Block K₁ Kβ‚‚ C Sigma V)" }, { "...
[ { "name": "Finset.mem_range", "module": "Mathlib.Data.Finset.Range" }, { "name": "Finset.sum_bij", "module": "Mathlib.Algebra.BigOperators.Group.Finset.Defs" }, { "name": "Finset.sum_dite_of_true", "module": "Mathlib.Algebra.BigOperators.Group.Finset.Piecewise" }, { "name": "...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.aggregateDeposits", "content": "def aggregateDeposits (Οƒ : Scontract K₁ Kβ‚‚ V C Sigma) : V :=\n βˆ‘ i : Fin Οƒ.length,\n if h : Οƒ[i].isDepositBlock\n then (Οƒ[i.1].getDeposit h).2.1\n else 0" }, { "name": "Intmax.reindex", "content": "@[simp]\nprivate def reindex : (a : β„•)...
[ { "name": "Intmax.reindex_mem", "content": "private lemma reindex_mem :\n βˆ€ (a : β„•) (ha : a ∈ Finset.range (k + 1) \\ {0}), reindex a ha ∈ Finset.range k" }, { "name": "Intmax.reindex_inj", "content": "private lemma reindex_inj :\n βˆ€ (a₁ : β„•) (ha₁ : a₁ ∈ Finset.range (k + 1) \\ {0})\n (aβ‚‚ :...
import FVIntmax.Wheels.AuthenticatedDictionary import FVIntmax.Wheels.SignatureAggregation import FVIntmax.BalanceProof import FVIntmax.Block import FVIntmax.Request import FVIntmax.Wheels namespace Intmax noncomputable section Intmax section RollupContract open Classical section variable {C : Type} [Nonempt...
@[simp] lemma aggregateDeposits_cons {hd} {tl : List (Block K₁ Kβ‚‚ C Sigma V)} : aggregateDeposits (hd :: tl) = (if h : hd.isDepositBlock then (hd.getDeposit h).2.1 else 0) + aggregateDeposits tl :=
:= by simp [aggregateDeposits] rw [ Finset.sum_fin_eq_sum_range, Finset.sum_eq_sum_diff_singleton_add (i := 0), dif_pos (show 0 < tl.length + 1 by omega) ] simp_rw [List.getElem_cons_zero (h := _)]; case h => exact Finset.mem_range.2 (by omega) let F : β„• β†’ V := Ξ» i ↦ if h : i < tl.length t...
5
28
false
Applied verif.
206
Intmax.f_transfer_source''
lemma f_transfer_source'' (h : b.isTransferBlock) (h₁ : T ∈ TransactionsInBlock Ο€ b) : (f Οƒ T) .Source = Οƒ .Source := f_transfer_source ⟨⟨b, h⟩, hβ‚βŸ©
FVIntmax
FVIntmax/Balance.lean
[ "import FVIntmax.BalanceProof", "import FVIntmax.Wheels", "import FVIntmax.Propositions", "import Mathlib", "import FVIntmax.Key", "import FVIntmax.Block", "import Mathlib.Algebra.Group.Int", "import FVIntmax.Wheels.Dictionary", "import FVIntmax.State", "import FVIntmax.Transaction" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Fin", "module": "Init.Prelud...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "Block", "content": "inductive Block (K₁ Kβ‚‚ : Type) (C Sigma : Type) (V : Type) [PreWithZero V] w...
[ { "name": "Set.image_eq_range", "module": "Mathlib.Data.Set.Image" }, { "name": "if_pos", "module": "Init.Core" }, { "name": "Finset.mem_filter", "module": "Mathlib.Data.Finset.Filter" }, { "name": "Finset.mem_sort", "module": "Mathlib.Data.Finset.Sort" }, { "name...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.TransactionsInBlock_deposit", "content": "def TransactionsInBlock_deposit\n (b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isDepositBlock }) : List (Ξ€ K₁ Kβ‚‚ V) :=\n match h : b.1 with\n | .deposit r v => [⟨(.Source, r, v), by admit /- proof elided -/\n ⟩]\n | .withdrawal .. | .transfer .. => b...
[ { "name": "Intmax.V'_eq_range", "content": "private lemma V'_eq_range {b : S K₁ Kβ‚‚ V} {T : Ξ€ K₁ Kβ‚‚ V} {k : Kbar K₁ Kβ‚‚} :\n V' b T k =\n Set.range Ξ» (x : { x : (Ξ€c K₁ Kβ‚‚ V Γ— S K₁ Kβ‚‚ V) // (T, b) ≀ (↑x.1, x.2) }) ↦ fc ↑x k" }, { "name": "Intmax.f_eq_f'", "content": "lemma f_eq_f' : f = f' (K₁ :=...
import Mathlib import Mathlib.Algebra.Group.Int import FVIntmax.BalanceProof import FVIntmax.Block import FVIntmax.Key import FVIntmax.Propositions import FVIntmax.State import FVIntmax.Transaction import FVIntmax.Wheels import FVIntmax.Wheels.Dictionary namespace Intmax noncomputable section open Classical...
lemma f_transfer_source'' (h : b.isTransferBlock) (h₁ : T ∈ TransactionsInBlock Ο€ b) : (f Οƒ T) .Source = Οƒ .Source :=
:= f_transfer_source ⟨⟨b, h⟩, hβ‚βŸ©
6
90
false
Applied verif.
207
Intmax.sum_f_le_sum
lemma sum_f_le_sum : βˆ‘ (k : Kbar K₁ Kβ‚‚), f b T k ≀ βˆ‘ (k : Kbar K₁ Kβ‚‚), b k
FVIntmax
FVIntmax/Lemma3.lean
[ "import FVIntmax.Balance" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Set", "module": "Mathlib.Data.Set...
[ { "name": "isComplete", "content": "def isComplete (Ο„ : Ξ€ K₁ Kβ‚‚ V) :=\n match Ο„ with | ⟨(_, _, v), _⟩ => v.isSome" }, { "name": "Ξ€", "content": "abbrev Ξ€ (K₁ Kβ‚‚ V : Type) [PreWithZero V] := { Ο„ : Ξ€' K₁ Kβ‚‚ V // Ο„.isValid }" }, { "name": "Ξ€'", "content": "abbrev Ξ€' (K₁ Kβ‚‚ V : Type) [P...
[ { "name": "Finset.sum_add_distrib", "module": "Mathlib.Algebra.BigOperators.Group.Finset.Basic" }, { "name": "Finset.sum_smul", "module": "Mathlib.Algebra.Module.BigOperators" }, { "name": "Finset.sum_le_sum", "module": "Mathlib.Algebra.Order.BigOperators.Group.Finset" }, { "...
[ { "name": "f_IsGLB_of_V'", "content": "lemma f_IsGLB_of_V' {b : S K₁ Kβ‚‚ V} {T : Ξ€ K₁ Kβ‚‚ V} {k : Kbar K₁ Kβ‚‚} :\n IsGLB (V' b T k) (f b T k)" } ]
[]
[ { "name": "Intmax.sum_fc_eq_sum", "content": "@[simp]\nlemma sum_fc_eq_sum : βˆ‘ (k : Kbar K₁ Kβ‚‚), fc (Tc, b) k = βˆ‘ (k : Kbar K₁ Kβ‚‚), b k" } ]
import FVIntmax.Balance namespace Intmax section Lemma3 variable {Pi C Sigma : Type} {K₁ : Type} [Finite K₁] {Kβ‚‚ : Type} [Finite Kβ‚‚] {V : Type} [Lattice V] [AddCommGroup V] [CovariantClass V V (Β· + Β·) (Β· ≀ Β·)] [CovariantClass V V (Function.swap (Β· + Β·)) (Β· ≀ Β·)] variable {Tc : Ξ€c K...
lemma sum_f_le_sum : βˆ‘ (k : Kbar K₁ Kβ‚‚), f b T k ≀ βˆ‘ (k : Kbar K₁ Kβ‚‚), b k :=
:= by by_cases eq : T.isComplete Β· conv_rhs => rw [←sum_fc_eq_sum (Tc := ⟨T, eq⟩)] refine' Finset.sum_le_sum (Ξ» k _ ↦ _) have fcInV' : fc (⟨T, eq⟩, b) k ∈ V' b T k := by dsimp [V'] rw [Set.mem_image] use (⟨T, eq⟩, b) simp exact f_IsGLB_of_V'.1 fcInV' Β· rcases T with ⟨⟨s, r, v⟩,...
5
38
false
Applied verif.
208
Intmax.v_transactionsInBlocks
lemma v_transactionsInBlocks {s r v v'} {eq₁ eqβ‚‚} {i} (h : Ο€ ≀ Ο€') (hβ‚€ : i < (TransactionsInBlocks Ο€ Bstar).length) (h₁ : (TransactionsInBlocks Ο€ Bstar)[i] = ⟨(s, r, v), eqβ‚βŸ©) (hβ‚‚ : (TransactionsInBlocks Ο€' Bstar)[i]'(by blast with Ο€) = ⟨(s, r, v'), eqβ‚‚βŸ©) : v ≀ v'
FVIntmax
FVIntmax/Lemma4.lean
[ "import FVIntmax.Wheels.Dictionary", "import FVIntmax.Wheels", "import FVIntmax.Balance" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Fi...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "v'", "content": "def v' (v : Vβ‚Š) (b : S K₁ Kβ‚‚ V) (s : Kbar K₁ Kβ‚‚) : Vβ‚Š :=\n match h : s with\n ...
[ { "name": "not_and_or", "module": "Mathlib.Logic.Basic" }, { "name": "congr_fun", "module": "Batteries.Logic" } ]
[ { "name": "mem_dict_iff_mem_keys", "content": "lemma mem_dict_iff_mem_keys {dict : Dict Ξ± Ο‰} : k ∈ dict ↔ k ∈ dict.keys" }, { "name": "eq_of_BalanceProof_le", "content": "lemma eq_of_BalanceProof_le (h : Ο€ ≀ Ο€') (h₁ : k ∈ Ο€) (hβ‚‚ : k ∈ Ο€') :\n ((Ο€ k).get h₁).2 = ((Ο€' k).get hβ‚‚).2" }, { "...
[]
[ { "name": "Intmax.delta_TransactionsInBlock_transfer", "content": "private lemma delta_TransactionsInBlock_transfer\n {b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isTransferBlock }}\n (h : Ο€ ≀ Ο€') : \n βˆ€ i : β„•, (hlen : i < (TransactionsInBlock_transfer Ο€ b).length) β†’\n (TransactionsInBlock_transfer Ο€ b)[i]'h...
import FVIntmax.Balance namespace Intmax open Mathlib noncomputable section Lemma4 section HicSuntDracones section variable {Pi C Sigma : Type} {K₁ : Type} [Finite K₁] [LinearOrder K₁] {Kβ‚‚ : Type} [Finite Kβ‚‚] [LinearOrder Kβ‚‚] {V : Type} [AddCommGroup V] [Lattice V] {Ο€...
lemma v_transactionsInBlocks {s r v v'} {eq₁ eqβ‚‚} {i} (h : Ο€ ≀ Ο€') (hβ‚€ : i < (TransactionsInBlocks Ο€ Bstar).length) (h₁ : (TransactionsInBlocks Ο€ Bstar)[i] = ⟨(s, r, v), eqβ‚βŸ©) (hβ‚‚ : (TransactionsInBlocks Ο€' Bstar)[i]'(by blast with Ο€) = ⟨(s, r, v'), eqβ‚‚βŸ©) : v ≀ v' :=
:= by unfold TransactionsInBlocks at h₁ hβ‚‚ apply List.map_eq_project_triple at h₁ apply List.map_eq_project_triple at hβ‚‚ rw [←h₁, ←hβ‚‚] apply List.map_join_unnecessarily_specific (by ext x; simp; rw [length_transactionsInBlock]) intros b i h₃ unfold TransactionsInBlock match h' : b with | Block.transfe...
7
57
false
Applied verif.
209
Intmax.lemma3
lemma lemma3 : Bal Ο€ bs .Source ≀ 0
FVIntmax
FVIntmax/Lemma3.lean
[ "import FVIntmax.Balance" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Set", "module": "Mathlib.Data.Set...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "fStar", "content": "def fStar (Ts : List (Ξ€ K₁ Kβ‚‚ V)) (sβ‚€ : S K₁ Kβ‚‚ V) : S K₁ Kβ‚‚ V :=\n Ts.fold...
[ { "name": "Finset.sum_add_distrib", "module": "Mathlib.Algebra.BigOperators.Group.Finset.Basic" }, { "name": "Finset.sum_smul", "module": "Mathlib.Algebra.Module.BigOperators" }, { "name": "Finset.sum_le_sum", "module": "Mathlib.Algebra.Order.BigOperators.Group.Finset" }, { "...
[ { "name": "f_IsGLB_of_V'", "content": "lemma f_IsGLB_of_V' {b : S K₁ Kβ‚‚ V} {T : Ξ€ K₁ Kβ‚‚ V} {k : Kbar K₁ Kβ‚‚} :\n IsGLB (V' b T k) (f b T k)" } ]
[]
[ { "name": "Intmax.sum_fc_eq_sum", "content": "@[simp]\nlemma sum_fc_eq_sum : βˆ‘ (k : Kbar K₁ Kβ‚‚), fc (Tc, b) k = βˆ‘ (k : Kbar K₁ Kβ‚‚), b k" }, { "name": "Intmax.sum_f_le_sum", "content": "lemma sum_f_le_sum : βˆ‘ (k : Kbar K₁ Kβ‚‚), f b T k ≀ βˆ‘ (k : Kbar K₁ Kβ‚‚), b k" }, { "name": "Intmax.sum_fS...
import FVIntmax.Balance namespace Intmax section Lemma3 variable {Pi C Sigma : Type} {K₁ : Type} [Finite K₁] {Kβ‚‚ : Type} [Finite Kβ‚‚] {V : Type} [Lattice V] [AddCommGroup V] [CovariantClass V V (Β· + Β·) (Β· ≀ Β·)] [CovariantClass V V (Function.swap (Β· + Β·)) (Β· ≀ Β·)] variable {Tc : Ξ€c K...
lemma lemma3 : Bal Ο€ bs .Source ≀ 0 :=
:= by dsimp [Bal] generalize eq : TransactionsInBlocks Ο€ _ = blocks generalize eq₁ : S.initial K₁ Kβ‚‚ V = sβ‚€ generalize eqβ‚‚ : fStar blocks sβ‚€ = f have : βˆ‘ x ∈ {Kbar.Source}, f x = βˆ‘ x : Kbar K₁ Kβ‚‚, f x - βˆ‘ x ∈ Finset.univ \ {Kbar.Source}, f x := by simp rw [←Finset.sum_singleton (a := Kbar.Source) ...
9
75
false
Applied verif.
210
Intmax.proposition4
lemma proposition4 [Setoid' X] {x y : Option X} : (βˆƒ join : Option X, IsLUB {x, y, .none} join) ↔ (x β‰  .none ∧ y β‰  .none β†’ x β‰… y)
FVIntmax
FVIntmax/Propositions.lean
[ "import Mathlib.Order.Bounds.Basic", "import FVIntmax.Wheels.Dictionary", "import Aesop", "import Mathlib.Order.Bounds.Defs", "import Mathlib.Order.Defs" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "IsLUB", "module": "Mathlib.Order.Bounds.Defs" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Iff", "module": "Init.Core" }, { "name": "IsLeast", "module": "Mathlib.O...
[ { "name": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b", "content": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b" } ]
[ { "name": "le_trans", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "mem_upperBounds", "module": "Mathlib.Order.Bounds.Basic" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.iso", "content": "def iso {X : Type} [Preorder X] (a b : X) := a ≀ b ∧ b ≀ a" }, { "name": "Intmax.IsEquivRel", "content": "def IsEquivRel {X : Type} [Preorder X] := βˆ€ a b : X, a ≀ b ↔ a β‰… b" }, { "name": "Intmax.Setoid'", "content": "class Setoid' (X : Type) extend...
[ { "name": "Intmax.iso_rfl", "content": "@[simp, refl]\nlemma iso_rfl : a β‰… a" }, { "name": "Intmax.iso_trans", "content": "@[trans]\nlemma iso_trans : (a β‰… b) β†’ (b β‰… c) β†’ a β‰… c" }, { "name": "Intmax.proposition2", "content": "lemma proposition2 [Setoid' X] {x y : X} :\n (βˆƒ join : X,...
import Mathlib.Order.Bounds.Basic import Mathlib.Order.Bounds.Defs import Mathlib.Order.Defs import Aesop import FVIntmax.Wheels.Dictionary namespace Intmax def iso {X : Type} [Preorder X] (a b : X) := a ≀ b ∧ b ≀ a notation:51 (priority := high) a:52 " β‰… " b:52 => iso a b section iso variable {X : Type} [Preo...
lemma proposition4 [Setoid' X] {x y : Option X} : (βˆƒ join : Option X, IsLUB {x, y, .none} join) ↔ (x β‰  .none ∧ y β‰  .none β†’ x β‰… y) :=
:= by refine' Iff.intro (Ξ» h ⟨h₁, hβ‚‚βŸ© ↦ _) (Ξ» h ↦ _) Β· rcases x with _ | x <;> rcases y with _ | y <;> [rfl; simp at h₁; simp at hβ‚‚; skip] simp rw [←proposition3'] at h rcases h with ⟨join, h⟩ obtain ⟨h₁, hβ‚‚βŸ© := proposition2' h exact iso_trans h₁ hβ‚‚.symm Β· rcases x with _ | x <;> rcases y with...
3
19
false
Applied verif.
211
Intmax.sender_transactionsInBlock
lemma sender_transactionsInBlock : (TransactionsInBlock π₁ b).map (Ξ» s ↦ s.1.1) = (TransactionsInBlock Ο€β‚‚ b).map (Ξ» s ↦ s.1.1)
FVIntmax
FVIntmax/Balance.lean
[ "import FVIntmax.BalanceProof", "import FVIntmax.Wheels", "import FVIntmax.Propositions", "import Mathlib", "import FVIntmax.Key", "import FVIntmax.Block", "import Mathlib.Algebra.Group.Int", "import FVIntmax.Wheels.Dictionary", "import FVIntmax.State", "import FVIntmax.Transaction" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Fin", "module": "Init.Prelud...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "Block", "content": "inductive Block (K₁ Kβ‚‚ : Type) (C Sigma : Type) (V : Type) [PreWithZero V] w...
[ { "name": "Finset.length_sort", "module": "Mathlib.Data.Finset.Sort" }, { "name": "List.length_attach", "module": "Init.Data.List.Attach" }, { "name": "List.length_map", "module": "Init.Data.List.Lemmas" }, { "name": "exists_and_left", "module": "Init.PropLemmas" }, {...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.TransactionsInBlock_deposit", "content": "def TransactionsInBlock_deposit\n (b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isDepositBlock }) : List (Ξ€ K₁ Kβ‚‚ V) :=\n match h : b.1 with\n | .deposit r v => [⟨(.Source, r, v), by admit /- proof elided -/\n ⟩]\n | .withdrawal .. | .transfer .. => b...
[ { "name": "Intmax.length_TransactionsInBlock_transfer", "content": "lemma length_TransactionsInBlock_transfer\n {b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isTransferBlock }} :\n βˆ€ (π₁ Ο€β‚‚ : BalanceProof K₁ Kβ‚‚ C Pi V),\n (TransactionsInBlock_transfer π₁ b).length =\n (TransactionsInBlock_transfer Ο€β‚‚ b).len...
import Mathlib import Mathlib.Algebra.Group.Int import FVIntmax.BalanceProof import FVIntmax.Block import FVIntmax.Key import FVIntmax.Propositions import FVIntmax.State import FVIntmax.Transaction import FVIntmax.Wheels import FVIntmax.Wheels.Dictionary namespace Intmax noncomputable section open Classical...
lemma sender_transactionsInBlock : (TransactionsInBlock π₁ b).map (Ξ» s ↦ s.1.1) = (TransactionsInBlock Ο€β‚‚ b).map (Ξ» s ↦ s.1.1) :=
:= by apply List.ext_get (by simp; rw [length_transactionsInBlock]) intros n h₁ hβ‚‚ simp; unfold TransactionsInBlock match b with | Block.deposit .. => simp [TransactionsInBlock_deposit] | Block.transfer .. => simp [TransactionsInBlock_transfer] | Block.withdrawal .. => simp [TransactionsInBlock_withd...
5
48
false
Applied verif.
212
Intmax.receiver_transactionsInBlock
lemma receiver_transactionsInBlock : (TransactionsInBlock π₁ b).map (Ξ» s ↦ s.1.2.1) = (TransactionsInBlock Ο€β‚‚ b).map (Ξ» s ↦ s.1.2.1)
FVIntmax
FVIntmax/Balance.lean
[ "import FVIntmax.BalanceProof", "import FVIntmax.Wheels", "import FVIntmax.Propositions", "import Mathlib", "import FVIntmax.Key", "import FVIntmax.Block", "import Mathlib.Algebra.Group.Int", "import FVIntmax.Wheels.Dictionary", "import FVIntmax.State", "import FVIntmax.Transaction" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Fin", "module": "Init.Prelud...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "Block", "content": "inductive Block (K₁ Kβ‚‚ : Type) (C Sigma : Type) (V : Type) [PreWithZero V] w...
[ { "name": "Finset.length_sort", "module": "Mathlib.Data.Finset.Sort" }, { "name": "List.length_attach", "module": "Init.Data.List.Attach" }, { "name": "List.length_map", "module": "Init.Data.List.Lemmas" }, { "name": "exists_and_left", "module": "Init.PropLemmas" }, {...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.TransactionsInBlock_deposit", "content": "def TransactionsInBlock_deposit\n (b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isDepositBlock }) : List (Ξ€ K₁ Kβ‚‚ V) :=\n match h : b.1 with\n | .deposit r v => [⟨(.Source, r, v), by admit /- proof elided -/\n ⟩]\n | .withdrawal .. | .transfer .. => b...
[ { "name": "Intmax.length_TransactionsInBlock_transfer", "content": "lemma length_TransactionsInBlock_transfer\n {b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isTransferBlock }} :\n βˆ€ (π₁ Ο€β‚‚ : BalanceProof K₁ Kβ‚‚ C Pi V),\n (TransactionsInBlock_transfer π₁ b).length =\n (TransactionsInBlock_transfer Ο€β‚‚ b).len...
import Mathlib import Mathlib.Algebra.Group.Int import FVIntmax.BalanceProof import FVIntmax.Block import FVIntmax.Key import FVIntmax.Propositions import FVIntmax.State import FVIntmax.Transaction import FVIntmax.Wheels import FVIntmax.Wheels.Dictionary namespace Intmax noncomputable section open Classical...
lemma receiver_transactionsInBlock : (TransactionsInBlock π₁ b).map (Ξ» s ↦ s.1.2.1) = (TransactionsInBlock Ο€β‚‚ b).map (Ξ» s ↦ s.1.2.1) :=
:= by apply List.ext_get (by simp; rw [length_transactionsInBlock]) intros n h₁ hβ‚‚ simp; unfold TransactionsInBlock match b with | Block.deposit .. => simp [TransactionsInBlock_deposit] | Block.transfer .. => simp [TransactionsInBlock_transfer] | Block.withdrawal .. => simp [TransactionsInBlock_withd...
5
48
false
Applied verif.
213
Intmax.f_withdrawal_block_source
lemma f_withdrawal_block_source (h : b.isWithdrawalBlock) : ((TransactionsInBlock Ο€ b).foldl f Οƒ) .Source = Οƒ .Source + βˆ‘ k : K₁, (b.getWithdrawal h k).1 βŠ“ Οƒ k
FVIntmax
FVIntmax/Balance.lean
[ "import FVIntmax.BalanceProof", "import FVIntmax.Wheels", "import FVIntmax.Propositions", "import Mathlib", "import FVIntmax.Key", "import FVIntmax.Block", "import Mathlib.Algebra.Group.Int", "import FVIntmax.Wheels.Dictionary", "import FVIntmax.State", "import FVIntmax.Transaction" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Finite", "module": "Mathlib.Data.Finite.Defs" }, { "name": "Fin", "module": "Init.Prelud...
[ { "name": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$", "content": "local macro:max (priority := high) \"β†ͺ\" b:term : term => `(⟨$b, by admit /- proof elided -/\n⟩)" }, { "name": "Block", "content": "inductive Block (K₁ Kβ‚‚ : Type) (C Sigma : Type) (V : Type) [PreWithZero V] w...
[ { "name": "Finset.filter_eq'", "module": "Mathlib.Data.Finset.Basic" }, { "name": "Finset.filter_or", "module": "Mathlib.Data.Finset.Basic" }, { "name": "Finset.mem_univ", "module": "Mathlib.Data.Fintype.Defs" }, { "name": "Finset.sum_congr", "module": "Mathlib.Algebra.Bi...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.TransactionsInBlock_deposit", "content": "def TransactionsInBlock_deposit\n (b : { b : Block K₁ Kβ‚‚ C Sigma V // b.isDepositBlock }) : List (Ξ€ K₁ Kβ‚‚ V) :=\n match h : b.1 with\n | .deposit r v => [⟨(.Source, r, v), by admit /- proof elided -/\n ⟩]\n | .withdrawal .. | .transfer .. => b...
[ { "name": "Intmax.e_def", "content": "@[simp]\nlemma e_def : e i = Ξ» j ↦ if i = j then 1 else 0" }, { "name": "Intmax.v'_key_eq_meet", "content": "@[simp]\nlemma v'_key_eq_meet {k : Key K₁ Kβ‚‚} : v' v b (Kbar.key k) = ⟨v βŠ“ b k, by simp⟩" }, { "name": "Intmax.V'_eq_range", "content": "...
import Mathlib import Mathlib.Algebra.Group.Int import FVIntmax.BalanceProof import FVIntmax.Block import FVIntmax.Key import FVIntmax.Propositions import FVIntmax.State import FVIntmax.Transaction import FVIntmax.Wheels import FVIntmax.Wheels.Dictionary namespace Intmax noncomputable section open Classical...
lemma f_withdrawal_block_source (h : b.isWithdrawalBlock) : ((TransactionsInBlock Ο€ b).foldl f Οƒ) .Source = Οƒ .Source + βˆ‘ k : K₁, (b.getWithdrawal h k).1 βŠ“ Οƒ k :=
:= by simp only [TransactionsInBlock] split <;> [simp at h; simp at h; skip] next B => simp only [f_eq_f', TransactionsInBlock_withdrawal, List.pure_def, List.bind_eq_flatMap, exists_eq, Set.setOf_true, Set.toFinset_univ, Finset.mem_sort, Finset.mem_univ, forall_const, List.flatMap_subtype, List.unattac...
6
105
false
Applied verif.
214
Intmax.monotone_f
lemma monotone_f (h₁ : b₁ ≀ bβ‚‚) (hβ‚‚ : T₁ ≀ Tβ‚‚) : f b₁ T₁ k ≀ f bβ‚‚ Tβ‚‚ k
FVIntmax
FVIntmax/Lemma4.lean
[ "import FVIntmax.Balance" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Set", "module": "Mathlib.Data.Set...
[ { "name": "f", "content": "def f (b : S K₁ Kβ‚‚ V) (T : Ξ€ K₁ Kβ‚‚ V) : S K₁ Kβ‚‚ V :=\n ⟨\n Ξ» k ↦\n have : InfSet V := infV b T k\n β¨… x : boundedBelow b T, fc x.1 k,\n by admit /- proof elided -/\n ⟩" }, { "name": "infV", "content": "def infV (b : S K₁ Kβ‚‚ V) (T : Ξ€ K₁ Kβ‚‚ V) (k : Kbar...
[ { "name": "le_isGLB_iff", "module": "Mathlib.Order.Bounds.Basic" }, { "name": "mem_lowerBounds", "module": "Mathlib.Order.Bounds.Basic" } ]
[ { "name": "V'_sset_V'_of_le", "content": "lemma V'_sset_V'_of_le {b₁ bβ‚‚ : S K₁ Kβ‚‚ V} {T₁ Tβ‚‚ : Ξ€ K₁ Kβ‚‚ V} {k : Kbar K₁ Kβ‚‚}\n (h : b₁ ≀ bβ‚‚) (h₁ : T₁ ≀ Tβ‚‚) : \n V' bβ‚‚ Tβ‚‚ k βŠ† V' b₁ T₁ k" }, { "name": "boundedBelow_sset_boundedBelow_of_le", "content": "lemma boundedBelow_sset_boundedBelow_of_le {b₁...
[]
[]
import FVIntmax.Balance namespace Intmax open Mathlib noncomputable section Lemma4 section HicSuntDracones section variable {Pi C Sigma : Type} {K₁ : Type} [Finite K₁] [LinearOrder K₁] {Kβ‚‚ : Type} [Finite Kβ‚‚] [LinearOrder Kβ‚‚] {V : Type} [AddCommGroup V] [Lattice V] {Ο€...
lemma monotone_f (h₁ : b₁ ≀ bβ‚‚) (hβ‚‚ : T₁ ≀ Tβ‚‚) : f b₁ T₁ k ≀ f bβ‚‚ Tβ‚‚ k :=
:= by obtain ⟨inf₁, -⟩ := f_IsGLB_of_V' (b := b₁) (T := T₁) (k := k) have infβ‚‚ := f_IsGLB_of_V' (b := bβ‚‚) (T := Tβ‚‚) (k := k) have := V'_sset_V'_of_le (k := k) h₁ hβ‚‚ rw [le_isGLB_iff infβ‚‚, mem_lowerBounds] aesop
8
36
false
Applied verif.
215
Intmax.proposition6
lemma proposition6 [Setoid' Y] {D₁ Dβ‚‚ : Dict X Y} : (βˆƒ join, IsLUB {D₁, Dβ‚‚} join) ↔ βˆ€ x, D₁ x β‰  .none ∧ Dβ‚‚ x β‰  .none β†’ D₁ x β‰… Dβ‚‚ x
FVIntmax
FVIntmax/Propositions.lean
[ "import Mathlib.Order.Bounds.Basic", "import FVIntmax.Wheels.Dictionary", "import Aesop", "import Mathlib.Order.Bounds.Defs", "import Mathlib.Order.Defs" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "IsLUB", "module": "Mathlib.Order.Bounds.Defs" }, { "name": "IsLeast", "module": "Mathlib.Order.Bounds.Defs" }, { "name": "Prod", "mo...
[ { "name": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b", "content": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b" }, { "name": "Merge", "content": "def Merge (D₁ Dβ‚‚ : Dict Ξ± Ο‰) : Dict Ξ± Ο‰ := D\n where D := Ξ» x ↦ First (D₁ x) (Dβ‚‚ x)" }, { "name": "First", ...
[ { "name": "le_trans", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "mem_upperBounds", "module": "Mathlib.Order.Bounds.Basic" }, { "name": "isLUB_pi", "module": "Mathlib.Order.Bounds.Image" } ]
[ { "name": "mem_iff_isSome", "content": "lemma mem_iff_isSome {m : Dict Ξ± Ο‰} {x : Ξ±} : x ∈ m ↔ (m x).isSome" } ]
[ { "name": "Intmax.iso", "content": "def iso {X : Type} [Preorder X] (a b : X) := a ≀ b ∧ b ≀ a" }, { "name": "Intmax.IsEquivRel", "content": "def IsEquivRel {X : Type} [Preorder X] := βˆ€ a b : X, a ≀ b ↔ a β‰… b" }, { "name": "Intmax.Setoid'", "content": "class Setoid' (X : Type) extend...
[ { "name": "Intmax.iso_rfl", "content": "@[simp, refl]\nlemma iso_rfl : a β‰… a" }, { "name": "Intmax.iso_trans", "content": "@[trans]\nlemma iso_trans : (a β‰… b) β†’ (b β‰… c) β†’ a β‰… c" }, { "name": "Intmax.proposition2", "content": "lemma proposition2 [Setoid' X] {x y : X} :\n (βˆƒ join : X,...
import Mathlib.Order.Bounds.Basic import Mathlib.Order.Bounds.Defs import Mathlib.Order.Defs import Aesop import FVIntmax.Wheels.Dictionary namespace Intmax def iso {X : Type} [Preorder X] (a b : X) := a ≀ b ∧ b ≀ a notation:51 (priority := high) a:52 " β‰… " b:52 => iso a b section iso variable {X : Type} [Preo...
lemma proposition6 [Setoid' Y] {D₁ Dβ‚‚ : Dict X Y} : (βˆƒ join, IsLUB {D₁, Dβ‚‚} join) ↔ βˆ€ x, D₁ x β‰  .none ∧ Dβ‚‚ x β‰  .none β†’ D₁ x β‰… Dβ‚‚ x :=
:= by refine' ⟨λ h ↦ _, Ξ» h ↦ _⟩ simp_rw [proposition5] at h simp_rw [←proposition4] aesop use D₁.Merge Dβ‚‚ exact proposition6_aux h
4
30
false
Applied verif.
216
Intmax.proposition6'
lemma proposition6' [Setoid' Y] {D₁ Dβ‚‚ join : Dict X Y} (h : IsLUB {D₁, Dβ‚‚} join) : join β‰… Dict.Merge D₁ Dβ‚‚
FVIntmax
FVIntmax/Propositions.lean
[ "import Mathlib.Order.Bounds.Basic", "import FVIntmax.Wheels.Dictionary", "import Aesop", "import Mathlib.Order.Bounds.Defs", "import Mathlib.Order.Defs" ]
[ { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "IsLUB", "module": "Mathlib.Order.Bounds.Defs" }, { "name": "Function.eval", "module": "Mathlib.Logic.Function.Basic" }, { "name": "Set",...
[ { "name": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b", "content": "notation:51 (priority := high) a:52 \" β‰… \" b:52 => iso a b" }, { "name": "Merge", "content": "def Merge (D₁ Dβ‚‚ : Dict Ξ± Ο‰) : Dict Ξ± Ο‰ := D\n where D := Ξ» x ↦ First (D₁ x) (Dβ‚‚ x)" }, { "name": "First", ...
[ { "name": "isLUB_pi", "module": "Mathlib.Order.Bounds.Image" }, { "name": "le_trans", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "mem_upperBounds", "module": "Mathlib.Order.Bounds.Basic" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.iso", "content": "def iso {X : Type} [Preorder X] (a b : X) := a ≀ b ∧ b ≀ a" }, { "name": "Intmax.IsEquivRel", "content": "def IsEquivRel {X : Type} [Preorder X] := βˆ€ a b : X, a ≀ b ↔ a β‰… b" }, { "name": "Intmax.Setoid'", "content": "class Setoid' (X : Type) extend...
[ { "name": "Intmax.iso_rfl", "content": "@[simp, refl]\nlemma iso_rfl : a β‰… a" }, { "name": "Intmax.iso_symm", "content": "@[symm]\nlemma iso_symm : (a β‰… b) ↔ b β‰… a" }, { "name": "Intmax.iso_trans", "content": "@[trans]\nlemma iso_trans : (a β‰… b) β†’ (b β‰… c) β†’ a β‰… c" }, { "name"...
import Mathlib.Order.Bounds.Basic import Mathlib.Order.Bounds.Defs import Mathlib.Order.Defs import Aesop import FVIntmax.Wheels.Dictionary namespace Intmax def iso {X : Type} [Preorder X] (a b : X) := a ≀ b ∧ b ≀ a notation:51 (priority := high) a:52 " β‰… " b:52 => iso a b section iso variable {X : Type} [Preo...
lemma proposition6' [Setoid' Y] {D₁ Dβ‚‚ join : Dict X Y} (h : IsLUB {D₁, Dβ‚‚} join) : join β‰… Dict.Merge D₁ Dβ‚‚ :=
:= by unfold Dict.Merge Dict.Merge.D apply proposition5' (hβ‚€ := h) intros x rw [iso_symm] apply proposition4' revert x rw [proposition5] at h simpa
5
30
false
Applied verif.
217
Intmax.computeBalance'_eq_zero
lemma computeBalance'_eq_zero : computeBalance' Οƒ v = v + computeBalance' Οƒ 0
FVIntmax
FVIntmax/AttackGame.lean
[ "import FVIntmax.Wheels.AuthenticatedDictionary", "import FVIntmax.Request", "import FVIntmax.Block", "import FVIntmax.Wheels.SignatureAggregation", "import FVIntmax.BalanceProof", "import FVIntmax.Wheels" ]
[ { "name": "Sigma", "module": "Init.Core" }, { "name": "Preorder", "module": "Mathlib.Order.Defs.PartialOrder" }, { "name": "Zero", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" } ]
[ { "name": "Block", "content": "inductive Block (K₁ Kβ‚‚ : Type) (C Sigma : Type) (V : Type) [PreWithZero V] where\n \n | deposit (recipient : Kβ‚‚) (amount : Vβ‚Š)\n \n | transfer (aggregator : K₁) (extradata : ExtraDataT) (commitment : C) (senders : List Kβ‚‚) (sigma : Sigma)\n \n | withdrawal (withdrawal...
[ { "name": "sub_eq_add_neg", "module": "Mathlib.Algebra.Group.Defs" }, { "name": "add_assoc", "module": "Mathlib.Algebra.Group.Defs" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Intmax.Block.updateBalance", "content": "def Block.updateBalance (bal : V) (block : Block K₁ Kβ‚‚ C Sigma V) : V :=\n match block with\n \n | .deposit _ v => bal + v\n \n | .transfer .. => bal\n \n | .withdrawal B => bal - βˆ‘ k : K₁, (B k).1" }, { "name": "Intmax.computeBalance'"...
[ { "name": "Intmax.Block.updateBalance_eq_zero", "content": "lemma Block.updateBalance_eq_zero :\n block.updateBalance v = v + block.updateBalance 0" }, { "name": "Intmax.computeBalance'_cons", "content": "@[simp]\nlemma computeBalance'_cons : computeBalance' (hd :: Οƒ) v =\n ...
import FVIntmax.Wheels.AuthenticatedDictionary import FVIntmax.Wheels.SignatureAggregation import FVIntmax.BalanceProof import FVIntmax.Block import FVIntmax.Request import FVIntmax.Wheels namespace Intmax noncomputable section Intmax section RollupContract open Classical section variable {C : Type} [Nonempt...
lemma computeBalance'_eq_zero : computeBalance' Οƒ v = v + computeBalance' Οƒ 0 :=
:= by induction' Οƒ with hd tl ih generalizing v Β· simp Β· rw [computeBalance'_cons, computeBalance'_cons, ih, Block.updateBalance_eq_zero] nth_rw 2 [ih] exact add_assoc v _ _
3
15
false
Applied verif.
218
evalFuel_sound
theorem evalFuel_sound : evalFuel n c = some v β†’ c ″⋆ v
IntroEffects
IntroEffects/Eval.lean
[ "import IntroEffects.SmallStep" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "Vector", "module": "Init.Data.Vector.Basic" }, { "name": "Bool", "module": "Init.Prelude" }, { "name":...
[ { "name": "scoped syntax num : embedded", "content": "scoped syntax num : embedded" }, { "name": "instantiateComp", "content": "def instantiateComp (what : Value) (comp : Computation) : Computation :=\n instantiateComputationLvl what 0 comp" }, { "name": "instantiateComputationLvl", ...
[ { "name": "List.find?_some", "module": "Init.Data.List.Find" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "evalSingleStep", "content": "def evalSingleStep : Computation β†’ Option Computation\n \n| .app (.lam body) v => some <| instantiateComp v body\n \n| .app (.recfun body) v => some <| instantiate2 (.recfun body) v body\n| .ite (.bool true) c₁ _ => some c₁\n| .ite (.bool false) _ cβ‚‚ => some cβ‚‚\n \n| ...
[ { "name": "evalSingleStep_sound", "content": "theorem evalSingleStep_sound {c c' : Computation} :\n evalSingleStep c = some c' β†’ c β€³ c'" } ]
import IntroEffects.SmallStep def evalSingleStep : Computation β†’ Option Computation | .app (.lam body) v => some <| instantiateComp v body | .app (.recfun body) v => some <| instantiate2 (.recfun body) v body | .ite (.bool true) c₁ _ => some c₁ | .ite (.bool false) _ cβ‚‚ => some cβ‚‚ | .bind (.ret v) c => some <| i...
theorem evalFuel_sound : evalFuel n c = some v β†’ c ″⋆ v :=
:= by induction h : n generalizing c with | zero => simp [evalFuel] | succ n ih => cases hstep : evalSingleStep c with | none => cases c <;> try grind [evalFuel] all_goals ( simp [evalFuel] intro h; rw [←h]; constructor) | some c' => cases c with | ret | opCall =>...
8
34
false
Semantics
219
evalFuelRet_complete_aux
theorem evalFuelRet_complete_aux (h : c ″⋆ r) : βˆ€v, r= .ret v β†’ βˆƒn, evalFuel n c = some (.ret v)
IntroEffects
IntroEffects/Eval.lean
[ "import IntroEffects.SmallStep" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "Vector", "module": "Init.Data.Vector.Basic" }, { "name": "Bool", "module": "Init.Prelude" }, { "name":...
[ { "name": "scoped syntax num : embedded", "content": "scoped syntax num : embedded" }, { "name": "instantiateComp", "content": "def instantiateComp (what : Value) (comp : Computation) : Computation :=\n instantiateComputationLvl what 0 comp" }, { "name": "instantiateComputationLvl", ...
[ { "name": "trans", "module": "Mathlib.Order.Defs.Unbundled" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "evalSingleStep", "content": "def evalSingleStep : Computation β†’ Option Computation\n \n| .app (.lam body) v => some <| instantiateComp v body\n \n| .app (.recfun body) v => some <| instantiate2 (.recfun body) v body\n| .ite (.bool true) c₁ _ => some c₁\n| .ite (.bool false) _ cβ‚‚ => some cβ‚‚\n \n| ...
[ { "name": "evalSingleStep_complete", "content": "theorem evalSingleStep_complete {c c' : Computation} :\n c β€³ c' β†’ evalSingleStep c = (some c')" }, { "name": "evalFuel_step", "content": "theorem evalFuel_step (h : c β€³ c') : evalFuel (n + 1) c = evalFuel n c'" } ]
import IntroEffects.SmallStep def evalSingleStep : Computation β†’ Option Computation | .app (.lam body) v => some <| instantiateComp v body | .app (.recfun body) v => some <| instantiate2 (.recfun body) v body | .ite (.bool true) c₁ _ => some c₁ | .ite (.bool false) _ cβ‚‚ => some cβ‚‚ | .bind (.ret v) c => some <| i...
theorem evalFuelRet_complete_aux (h : c ″⋆ r) : βˆ€v, r= .ret v β†’ βˆƒn, evalFuel n c = some (.ret v) :=
:= by induction h with | refl c' => intro v hv exact ⟨1, by grind [evalFuel]⟩ | @trans c1 c2 c3 hStep hTail ih => intro v hv obtain ⟨n, ihFuel⟩ := ih v hv refine ⟨n+1, ?_⟩ simp [evalFuel_step hStep, ihFuel]
8
34
false
Semantics
220
evalFuelOpCall_complete_aux
theorem evalFuelOpCall_complete_aux (h : c ″⋆ r) : βˆ€v, r = .opCall name v comp β†’ βˆƒn, evalFuel n c = some (.opCall name v comp)
IntroEffects
IntroEffects/Eval.lean
[ "import IntroEffects.SmallStep" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "Vector", "module": "Init.Data.Vector.Basic" }, { "name": "Bool", "module": "Init.Prelude" }, { "name":...
[ { "name": "scoped syntax num : embedded", "content": "scoped syntax num : embedded" }, { "name": "instantiateComp", "content": "def instantiateComp (what : Value) (comp : Computation) : Computation :=\n instantiateComputationLvl what 0 comp" }, { "name": "instantiateComputationLvl", ...
[ { "name": "trans", "module": "Mathlib.Order.Defs.Unbundled" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "evalSingleStep", "content": "def evalSingleStep : Computation β†’ Option Computation\n \n| .app (.lam body) v => some <| instantiateComp v body\n \n| .app (.recfun body) v => some <| instantiate2 (.recfun body) v body\n| .ite (.bool true) c₁ _ => some c₁\n| .ite (.bool false) _ cβ‚‚ => some cβ‚‚\n \n| ...
[ { "name": "evalSingleStep_complete", "content": "theorem evalSingleStep_complete {c c' : Computation} :\n c β€³ c' β†’ evalSingleStep c = (some c')" }, { "name": "evalFuel_step", "content": "theorem evalFuel_step (h : c β€³ c') : evalFuel (n + 1) c = evalFuel n c'" } ]
import IntroEffects.SmallStep def evalSingleStep : Computation β†’ Option Computation | .app (.lam body) v => some <| instantiateComp v body | .app (.recfun body) v => some <| instantiate2 (.recfun body) v body | .ite (.bool true) c₁ _ => some c₁ | .ite (.bool false) _ cβ‚‚ => some cβ‚‚ | .bind (.ret v) c => some <| i...
theorem evalFuelOpCall_complete_aux (h : c ″⋆ r) : βˆ€v, r = .opCall name v comp β†’ βˆƒn, evalFuel n c = some (.opCall name v comp) :=
:= by induction h with | refl c' => intro v hv exact ⟨1, by grind [evalFuel]⟩ | @trans c1 c2 c3 hStep hTail ih => intro v hv obtain ⟨n, ihFuel⟩ := ih v hv refine ⟨n+1, ?_⟩ simp [evalFuel_step hStep, ihFuel]
8
34
false
Semantics
221
Iris.Agree.op_inv
theorem Agree.op_inv {x y : Agree Ξ±} : (x.op y).valid β†’ x ≑ y
iris-lean
src/Iris/Algebra/Agree.lean
[ "import Iris.Algebra.CMRA", "import src.Iris.Algebra.CMRA", "import src.Iris.Algebra.OFE", "import Iris.Algebra.OFE" ]
[ { "name": "List", "module": "Init.Prelude" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" } ]
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x", "content": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x" }, { "name": "n...
[ { "name": "List.mem_append", "module": "Init.Data.List.Lemmas" } ]
[ { "name": "_root_.Iris.OFE.Dist.validN", "content": "theorem _root_.Iris.OFE.Dist.validN : (x : Ξ±) ≑{n}≑ y β†’ (βœ“{n} x ↔ βœ“{n} y)" }, { "name": "validN_iff", "content": "theorem validN_iff {x y : Ξ±} (e : x ≑{n}≑ y) : βœ“{n} x ↔ βœ“{n} y" }, { "name": "IncludedN.validN", "content": "theorem ...
[ { "name": "Iris.Agree", "content": "@[ext]\nstructure Agree where\n car : List Ξ±\n not_nil : car β‰  []" }, { "name": "Iris.Agree.dist", "content": "def Agree.dist (n : Nat) (x y : Agree Ξ±) : Prop :=\n (βˆ€ a ∈ x.car, βˆƒ b ∈ y.car, a ≑{n}≑ b) ∧\n (βˆ€ b ∈ y.car, βˆƒ a ∈ x.car, a ≑{n}≑ b)" }, { ...
[ { "name": "Iris.mem_of_agree", "content": "theorem mem_of_agree (x : Agree Ξ±) : βˆƒ a, a ∈ x.car" }, { "name": "Iris.Agree.equiv_def", "content": "theorem Agree.equiv_def {x y : Agree Ξ±} : x ≑ y ↔ βˆ€ n, Agree.dist n x y" }, { "name": "Iris.Agree.validN_iff", "content": "theorem Agree.va...
import Iris.Algebra.CMRA import Iris.Algebra.OFE namespace Iris section agree variable {Ξ± : Type u} variable (Ξ±) in @[ext] structure Agree where car : List Ξ± not_nil : car β‰  [] variable [OFE Ξ±] def Agree.dist (n : Nat) (x y : Agree Ξ±) : Prop := (βˆ€ a ∈ x.car, βˆƒ b ∈ y.car, a ≑{n}≑ b) ∧ (βˆ€ b ∈ y.car, βˆƒ a ∈...
theorem Agree.op_inv {x y : Agree Ξ±} : (x.op y).valid β†’ x ≑ y :=
:= by simp [valid, equiv_def] intro h n exact op_invN (h n)
8
58
false
Framework
222
Iris.OFE.ContractiveHom.fixpoint_ind
@[elab_as_elim] theorem OFE.ContractiveHom.fixpoint_ind [COFE Ξ±] [Inhabited Ξ±] (f : Ξ± -c> Ξ±) (P : Ξ± β†’ Prop) (HProper : βˆ€ A B : Ξ±, A ≑ B β†’ P A β†’ P B) (x : Ξ±) (Hbase : P x) (Hind : βˆ€ x, P x β†’ P (f x)) (Hlim : LimitPreserving P) : P f.fixpoint
iris-lean
src/Iris/Algebra/OFE.lean
[ "import src/Iris/Algebra/Excl.lean", "import src/Iris/Algebra/Agree.lean", "import src/Iris/Algebra/UPred.lean", "import src/Iris/Algebra/COFESolver.lean", "import src/Iris/Instances/UPred/Instance.lean", "import src/Iris/Algebra/Agree_task.lean", "import src/Iris/Algebra/CMRA.lean", "import src/Iris/...
[ { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { ...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y", "content": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y" }, ...
[ { "name": "Nat.lt_of_le_of_ne", "module": "Init.Prelude" }, { "name": "Nat.le_of_lt_succ", "module": "Init.Prelude" }, { "name": "Nat.lt_succ_self", "module": "Init.Prelude" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Iris.OFE", "content": "class OFE (Ξ± : Type _) where\n Equiv : Ξ± β†’ Ξ± β†’ Prop\n Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop\n dist_eqv : Equivalence (Dist n)\n equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y\n dist_lt : Dist n x y β†’ m < n β†’ Dist m x y" }, { "name": "Iris.OFE.NonExpansive", "content": "class...
[ { "name": "Iris.OFE.Dist.lt", "content": "theorem Dist.lt [OFE Ξ±] {m n} {x y : Ξ±} : x ≑{n}≑ y β†’ m < n β†’ x ≑{m}≑ y" }, { "name": "Iris.OFE.Dist.le", "content": "theorem Dist.le [OFE Ξ±] {m n} {x y : Ξ±} (h : x ≑{n}≑ y) (h' : m ≀ n) : x ≑{m}≑ y" }, { "name": "Iris.OFE.Dist.rfl", "content...
namespace Iris class OFE (Ξ± : Type _) where Equiv : Ξ± β†’ Ξ± β†’ Prop Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop dist_eqv : Equivalence (Dist n) equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y dist_lt : Dist n x y β†’ m < n β†’ Dist m x y open OFE scoped infix:40 " ≑ " => OFE.Equiv scoped notation:40 x " ≑{" n "}≑ " y:41 => OFE.Dist n x ...
@[elab_as_elim] theorem OFE.ContractiveHom.fixpoint_ind [COFE Ξ±] [Inhabited Ξ±] (f : Ξ± -c> Ξ±) (P : Ξ± β†’ Prop) (HProper : βˆ€ A B : Ξ±, A ≑ B β†’ P A β†’ P B) (x : Ξ±) (Hbase : P x) (Hind : βˆ€ x, P x β†’ P (f x)) (Hlim : LimitPreserving P) : P f.fixpoint :=
:= by let chain : Chain α := by refine ⟨fun i => Nat.repeat f (i + 1) x, fun {n i} H => ?_⟩ induction n generalizing i with | zero => simp [Nat.repeat] | succ _ IH => cases i <;> simp at H exact Contractive.succ _ <| IH H refine HProper _ _ (fixpoint_unique (x := COFE.compl chain) ?_) ?_...
5
47
true
Framework
223
Iris.BI.wand_iff_exists_persistently
theorem wand_iff_exists_persistently [BI PROP] [BIAffine PROP] {P Q : PROP} : (P -βˆ— Q) ⊣⊒ βˆƒ R, R βˆ— <pers> (P βˆ— R β†’ Q)
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_elim_l'", "content": "theorem and_elim_l' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_elim_r'", "content": "theorem and_elim_r' [BI PROP] {P Q R : PROP} (h : Q ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.imp_elim'", "content": "theor...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem wand_iff_exists_persistently [BI PROP] [BIAffine PROP] {P Q : PROP} : (P -βˆ— Q) ⊣⊒ βˆƒ R, R βˆ— <pers> (P βˆ— R β†’ Q) :=
:= by constructor Β· refine (sep_true.2.trans ?_).trans (exists_intro iprop(P -βˆ— Q)) exact sep_mono_r <| persistently_pure.2.trans <| persistently_intro' <| imp_intro <| (and_mono persistently_pure.1 wand_elim_r).trans and_elim_r Β· exact exists_elim fun R => wand_intro' <| sep_assoc.2.trans <| and_...
6
89
false
Framework
224
Iris.COFE.OFunctor.Fix.Impl.Tower.embed_up
theorem Tower.embed_up (x : A F k) : Tower.embed (k+1) (up F k x) ≑ Tower.embed k x
iris-lean
src/Iris/Algebra/COFESolver.lean
[ "import Iris.Algebra.OFE" ]
[ { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "ULift", "module": "Init.Prelude" }, { "name": "Unit", "module": "Init.Prelude" }, { "name": "Option"...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "COFE.OFunctor.constOF_RFunctor", "content": "instance COFE.OFunctor.constOF_RFunctor [CMRA B] : RFunctor (constOF B) where\n map f ...
[ { "name": "congrArg", "module": "Init.Prelude" }, { "name": "symm", "module": "Mathlib.Order.Defs.Unbundled" }, { "name": "Nat.add_assoc", "module": "Init.Data.Nat.Basic" }, { "name": "Nat.add_left_cancel", "module": "Init.Data.Nat.Basic" }, { "name": "Nat.add_lef...
[ { "name": "exact", "content": "theorem exact [BI PROP] (Q : PROP) : Q ⊒ Q" } ]
[ { "name": "Iris.COFE.OFunctor.Fix.Impl.A'", "content": "def A' : Nat β†’ Ξ£ Ξ± : Type u, COFE Ξ±\n | 0 => ⟨ULift Unit, inferInstance⟩\n | n+1 => let ⟨A, _⟩ := A' n; ⟨F A A, inferInstance⟩" }, { "name": "Iris.COFE.OFunctor.Fix.Impl.A", "content": "def A (n : Nat) : Type u := (A' F n).1" }, { ...
[ { "name": "Iris.COFE.OFunctor.Fix.Impl.down_up", "content": "theorem down_up : βˆ€ {k} x, down F k (up F k x) ≑ x\n | 0, ⟨()⟩ => .rfl\n | _+1, _ => (map_comp ..).symm.trans <|\n (map_ne.eqv down_up down_up _).trans (map_id _)" }, { "name": "Iris.COFE.OFunctor.Fix.Impl.eqToHom_up", "content": ...
import Iris.Algebra.OFE namespace Iris.COFE.OFunctor open OFE variable {F : βˆ€ Ξ± Ξ² [OFE Ξ±] [OFE Ξ²], Type u} [OFunctorContractive F] variable [βˆ€ Ξ± [COFE Ξ±], IsCOFE (F Ξ± Ξ±)] variable [inh : Inhabited (F (ULift Unit) (ULift Unit))] namespace Fix.Impl variable (F) in def A' : Nat β†’ Ξ£ Ξ± : Type u, COFE Ξ± | 0 => ⟨ULi...
theorem Tower.embed_up (x : A F k) : Tower.embed (k+1) (up F k x) ≑ Tower.embed k x :=
:= by refine equiv_dist.2 fun n i => ?_ dsimp [Tower.embed, embed]; split <;> rename_i h₁ Β· simp [Nat.le_of_succ_le h₁] suffices βˆ€ a b (e₁ : k + 1 + a = i) (eβ‚‚ : k+b = i), eqToHom e₁ (upN F a (up F k x)) = eqToHom eβ‚‚ (upN F b x) from this .. β–Έ .rfl rintro a b eq rfl rw [Nat.add_right_comm, Nat.a...
8
43
false
Framework
225
Iris.not_add_le_self
theorem not_add_le_self {a b : Ξ±} : Β¬ a + b ≀ a
iris-lean
src/Iris/Algebra/Frac.lean
[ "import Iris.Algebra.CMRA", "import Iris.Algebra.OFE" ]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "...", "content": "..." } ]
[ { "name": "mt", "module": "Init.Core" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Iris.NumericFraction", "content": "class NumericFraction (Ξ± : Type _) extends One Ξ±, Add Ξ±, LE Ξ±, LT Ξ± where\n add_comm : βˆ€ a b : Ξ±, a + b = b + a\n add_assoc : βˆ€ a b c : Ξ±, a + (b + c) = (a + b) + c\n add_left_cancel : βˆ€ {a b c : Ξ±}, a + b = a + c β†’ b = c\n le_def : βˆ€ {a b : Ξ±}, a ≀ b ↔ a = ...
[ { "name": "Iris.add_ne_self", "content": "theorem add_ne_self {a b : Ξ±} : a + b β‰  a" }, { "name": "Iris.not_add_lt_self", "content": "theorem not_add_lt_self {a b : Ξ±} : Β¬a + b < a" } ]
import Iris.Algebra.CMRA import Iris.Algebra.OFE namespace Iris namespace Fraction variable [Fraction Ξ±] end Fraction open Fraction OFE CMRA section NumericFraction class NumericFraction (Ξ± : Type _) extends One Ξ±, Add Ξ±, LE Ξ±, LT Ξ± where add_comm : βˆ€ a b : Ξ±, a + b = b + a add_assoc : βˆ€ a b c : Ξ±, a + (b +...
theorem not_add_le_self {a b : Ξ±} : Β¬ a + b ≀ a :=
:= fun H => by obtain H | H := le_def.mp H Β· exact add_ne_self H Β· exact not_add_lt_self H
3
4
false
Framework
226
Iris.BI.imp_iff_exists_persistently
theorem imp_iff_exists_persistently [BI PROP] [BIAffine PROP] {P Q : PROP} : (P β†’ Q) ⊣⊒ βˆƒ R, R ∧ <pers> (P ∧ R -βˆ— Q)
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_elim_l'", "content": "theorem and_elim_l' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_elim_r'", "content": "theorem and_elim_r' [BI PROP] {P Q R : PROP} (h : Q ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_symm", "content": "theore...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem imp_iff_exists_persistently [BI PROP] [BIAffine PROP] {P Q : PROP} : (P β†’ Q) ⊣⊒ βˆƒ R, R ∧ <pers> (P ∧ R -βˆ— Q) :=
:= by constructor Β· refine (and_true.2.trans ?_).trans (exists_intro iprop(P β†’ Q)) exact and_mono_r <| persistently_emp.2.trans <| persistently_mono <| wand_intro <| emp_sep.1.trans imp_elim_r Β· exact exists_elim fun R => imp_intro' <| and_assoc.2.trans <| persistently_and_intuitionistically_sep_r...
5
75
false
Framework
227
Iris.COFE.OFunctor.Fix.Impl.downN_upN
theorem downN_upN {k} (x : A F k) : βˆ€ {i}, downN F i (upN F i x) ≑ x | 0 => .rfl | n+1 => ((downN F n).ne.eqv (down_up ..)).trans (downN_upN _)
iris-lean
src/Iris/Algebra/COFESolver.lean
[ "import Iris.Algebra.OFE" ]
[ { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "ULift", "module": "Init.Prelude" }, { "name": "Unit", "module": "Init.Prelude" }, { "name": "Option"...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "COFE.OFunctor.constOF_RFunctor", "content": "instance COFE.OFunctor.constOF_RFunctor [CMRA B] : RFunctor (constOF B) where\n map f ...
[ { "name": "symm", "module": "Mathlib.Order.Defs.Unbundled" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Iris.COFE.OFunctor.Fix.Impl.A'", "content": "def A' : Nat β†’ Ξ£ Ξ± : Type u, COFE Ξ±\n | 0 => ⟨ULift Unit, inferInstance⟩\n | n+1 => let ⟨A, _⟩ := A' n; ⟨F A A, inferInstance⟩" }, { "name": "Iris.COFE.OFunctor.Fix.Impl.A", "content": "def A (n : Nat) : Type u := (A' F n).1" }, { ...
[ { "name": "Iris.COFE.OFunctor.Fix.Impl.down_up", "content": "theorem down_up : βˆ€ {k} x, down F k (up F k x) ≑ x\n | 0, ⟨()⟩ => .rfl\n | _+1, _ => (map_comp ..).symm.trans <|\n (map_ne.eqv down_up down_up _).trans (map_id _)" } ]
import Iris.Algebra.OFE namespace Iris.COFE.OFunctor open OFE variable {F : βˆ€ Ξ± Ξ² [OFE Ξ±] [OFE Ξ²], Type u} [OFunctorContractive F] variable [βˆ€ Ξ± [COFE Ξ±], IsCOFE (F Ξ± Ξ±)] variable [inh : Inhabited (F (ULift Unit) (ULift Unit))] namespace Fix.Impl variable (F) in def A' : Nat β†’ Ξ£ Ξ± : Type u, COFE Ξ± | 0 => ⟨ULi...
theorem downN_upN {k} (x : A F k) : βˆ€ {i}, downN F i (upN F i x) ≑ x :=
| 0 => .rfl | n+1 => ((downN F n).ne.eqv (down_up ..)).trans (downN_upN _)
8
27
false
Framework
228
Iris.BI.persistently_sep
theorem persistently_sep [BI PROP] [BIPositive PROP] {P Q : PROP} : <pers> (P βˆ— Q) ⊣⊒ <pers> P βˆ— <pers> Q
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_elim_l'", "content": "theorem and_elim_l' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_elim_r'", "content": "theorem and_elim_r' [BI PROP] {P Q R : PROP} (h : Q ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_symm", "content": "theore...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem persistently_sep [BI PROP] [BIPositive PROP] {P Q : PROP} : <pers> (P βˆ— Q) ⊣⊒ <pers> P βˆ— <pers> Q :=
:= by refine ⟨persistently_affinely.2.trans ?_, persistently_sep_2⟩ refine persistently_mono affinely_sep.1 |>.trans ?_ |>.trans persistently_and_persistently_sep.1 exact and_intro (persistently_mono <| (sep_mono_r affinely_elim_emp).trans <| sep_emp.1.trans affinely_elim) (persistently_mono <| (sep_mono_...
7
89
false
Framework
229
Iris.BI.loeb_wand_intuitionistically
theorem loeb_wand_intuitionistically [BI PROP] [BILoeb PROP] {P : PROP} : β–‘ (β–‘ β–· P -βˆ— P) ⊒ P
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_elim_l'", "content": "theorem and_elim_l' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_elim_r'", "content": "theorem and_elim_r' [BI PROP] {P Q R : PROP} (h : Q ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_symm", "content": "theore...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem loeb_wand_intuitionistically [BI PROP] [BILoeb PROP] {P : PROP} : β–‘ (β–‘ β–· P -βˆ— P) ⊒ P :=
:= by refine .trans ?_ intuitionistically_elim refine .trans ?_ loeb refine imp_intro' ?_ refine (and_mono (later_mono persistently_of_intuitionistically) .rfl).trans ?_ refine (and_mono later_persistently.mp .rfl).trans ?_ refine persistently_and_intuitionistically_sep_l.mp.trans ?_ refine (sep_mono intu...
6
91
false
Framework
230
Iris.BI.plainly_persistently_elim
theorem plainly_persistently_elim : β–  <pers> P ⊣⊒ β–  P
iris-lean
src/Iris/BI/Plainly.lean
[ "import Iris.Algebra", "import Iris.BI.DerivedLaws", "import src.Iris.Algebra.CMRA", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import src.Iris.BI.DerivedLaws", "import src/Iris/Instances/UPred/Instance.lean", "import Iris.BI.BI", "import Iris.BI.Classes" ]
[ { "name": "Lean.MonadQuotation", "module": "Init.Prelude" }, { "name": "Lean.MonadRef", "module": "Init.Prelude" }, { "name": "Monad", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option", "module": "Init.Prelude" }, ...
[ { "name": "syntax term:26 \" ==βˆ— \" term:25 : term", "content": "syntax term:26 \" ==βˆ— \" term:25 : term\n\nsyntax term \"={ \" term \" , \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }[ \" term \" ]β–·=βˆ— \" term : term\n\nsyntax term \"={ \" te...
[ { "name": "...", "module": "" } ]
[ { "name": "imp_intro'", "content": "theorem imp_intro' [BI PROP] {P Q R : PROP} (h : Q ∧ P ⊒ R) : P ⊒ Q β†’ R" }, { "name": "and_comm", "content": "theorem and_comm [BI PROP] {P Q : PROP} : P ∧ Q ⊣⊒ Q ∧ P" }, { "name": "and_symm", "content": "theorem and_symm [BI PROP] {P Q : PROP} : P...
[ { "name": "Iris.Plainly", "content": "class Plainly (PROP : Type _) where\n plainly : PROP β†’ PROP" }, { "name": "Iris.Plainly.plainlyIf", "content": "def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP :=\n iprop(if p then β–  P else P)" }, { "name": "...
[ { "name": "Iris.BI.plainly_forall_2", "content": "theorem plainly_forall_2 {Ξ¨ : Ξ± β†’ PROP} : (βˆ€ a, β–  (Ξ¨ a)) ⊒ β–  (βˆ€ a, Ξ¨ a)" } ]
import Iris.BI.Classes import Iris.BI.BI import Iris.BI.DerivedLaws import Iris.Algebra namespace Iris open BI class Plainly (PROP : Type _) where plainly : PROP β†’ PROP def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP := iprop(if p then β–  P else P) class BIPlainly (PRO...
theorem plainly_persistently_elim : β–  <pers> P ⊣⊒ β–  P :=
:= by constructor Β· refine (true_and.2.trans <| and_mono emp_intro .rfl).trans ?_ refine .trans ?_ (mono <| and_forall_bool.2.trans persistently_and_emp_elim) refine and_forall_bool.1.trans ?_ refine .trans ?_ plainly_forall_2 refine forall_mono ?_ exact (Β·.casesOn .rfl .rfl) Β· exact idem.tran...
6
75
false
Framework
231
Iris.fixpoint_unique
theorem fixpoint_unique [COFE Ξ±] [Inhabited Ξ±] {f : Ξ± -c> Ξ±} {x : Ξ±} (H : x ≑ f x) : x ≑ fixpoint f
iris-lean
src/Iris/Algebra/OFE.lean
[ "import src/Iris/Algebra/Excl.lean", "import src/Iris/Instances/UPred/Instance.lean", "import src/Iris/Algebra/UPred.lean", "import src/Iris/Algebra/CMRA.lean", "import src/Iris/Algebra/Agree_task.lean", "import src/Iris/Algebra/COFESolver.lean", "import src/Iris/Algebra/Heap.lean" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "na...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y", "content": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y" }, ...
[ { "name": "Nat.lt_of_le_of_ne", "module": "Init.Prelude" }, { "name": "Nat.le_of_lt_succ", "module": "Init.Prelude" }, { "name": "Nat.lt_succ_self", "module": "Init.Prelude" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Iris.OFE", "content": "class OFE (Ξ± : Type _) where\n Equiv : Ξ± β†’ Ξ± β†’ Prop\n Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop\n dist_eqv : Equivalence (Dist n)\n equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y\n dist_lt : Dist n x y β†’ m < n β†’ Dist m x y" }, { "name": "Iris.OFE.NonExpansive", "content": "class...
[ { "name": "Iris.OFE.Dist.lt", "content": "theorem Dist.lt [OFE Ξ±] {m n} {x y : Ξ±} : x ≑{n}≑ y β†’ m < n β†’ x ≑{m}≑ y" }, { "name": "Iris.OFE.Dist.le", "content": "theorem Dist.le [OFE Ξ±] {m n} {x y : Ξ±} (h : x ≑{n}≑ y) (h' : m ≀ n) : x ≑{m}≑ y" }, { "name": "Iris.OFE.Dist.rfl", "content...
namespace Iris class OFE (Ξ± : Type _) where Equiv : Ξ± β†’ Ξ± β†’ Prop Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop dist_eqv : Equivalence (Dist n) equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y dist_lt : Dist n x y β†’ m < n β†’ Dist m x y open OFE scoped infix:40 " ≑ " => OFE.Equiv scoped notation:40 x " ≑{" n "}≑ " y:41 => OFE.Dist n x ...
theorem fixpoint_unique [COFE Ξ±] [Inhabited Ξ±] {f : Ξ± -c> Ξ±} {x : Ξ±} (H : x ≑ f x) : x ≑ fixpoint f :=
:= by refine equiv_dist.mpr fun n => ?_ induction n with refine H.dist.trans <| .trans ?_ (fixpoint_unfold f).dist.symm | zero => exact Contractive.zero f.f | succ _ IH => exact Contractive.succ f.f IH
6
45
false
Framework
232
Iris.fixpoint_unfold
theorem fixpoint_unfold [COFE Ξ±] [Inhabited Ξ±] (f : Ξ± -c> Ξ±) : fixpoint f ≑ f (fixpoint f)
iris-lean
src/Iris/Algebra/OFE.lean
[ "import src/Iris/Algebra/Excl.lean", "import src/Iris/Instances/UPred/Instance.lean", "import src/Iris/Algebra/UPred.lean", "import src/Iris/Algebra/CMRA.lean", "import src/Iris/Algebra/Agree_task.lean", "import src/Iris/Algebra/COFESolver.lean", "import src/Iris/Algebra/Heap.lean" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "na...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y", "content": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y" }, ...
[ { "name": "Nat.lt_of_le_of_ne", "module": "Init.Prelude" }, { "name": "Nat.le_of_lt_succ", "module": "Init.Prelude" }, { "name": "Nat.lt_succ_self", "module": "Init.Prelude" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Iris.OFE", "content": "class OFE (Ξ± : Type _) where\n Equiv : Ξ± β†’ Ξ± β†’ Prop\n Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop\n dist_eqv : Equivalence (Dist n)\n equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y\n dist_lt : Dist n x y β†’ m < n β†’ Dist m x y" }, { "name": "Iris.OFE.NonExpansive", "content": "class...
[ { "name": "Iris.OFE.Dist.lt", "content": "theorem Dist.lt [OFE Ξ±] {m n} {x y : Ξ±} : x ≑{n}≑ y β†’ m < n β†’ x ≑{m}≑ y" }, { "name": "Iris.OFE.Dist.le", "content": "theorem Dist.le [OFE Ξ±] {m n} {x y : Ξ±} (h : x ≑{n}≑ y) (h' : m ≀ n) : x ≑{m}≑ y" }, { "name": "Iris.OFE.Dist.rfl", "content...
namespace Iris class OFE (Ξ± : Type _) where Equiv : Ξ± β†’ Ξ± β†’ Prop Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop dist_eqv : Equivalence (Dist n) equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y dist_lt : Dist n x y β†’ m < n β†’ Dist m x y open OFE scoped infix:40 " ≑ " => OFE.Equiv scoped notation:40 x " ≑{" n "}≑ " y:41 => OFE.Dist n x ...
theorem fixpoint_unfold [COFE Ξ±] [Inhabited Ξ±] (f : Ξ± -c> Ξ±) : fixpoint f ≑ f (fixpoint f) :=
:= by refine equiv_dist.mpr fun n => ?_ apply COFE.conv_compl.trans refine .trans ?_ (NonExpansive.ne COFE.conv_compl.symm) induction n with | zero => exact Contractive.zero f.f | succ _ IH => exact (Contractive.succ f.f IH.symm).symm
4
41
false
Framework
233
Iris.BI.loeb
theorem loeb [BI PROP] [BILoeb PROP] {P : PROP} : (β–· P β†’ P) ⊒ P
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_elim_l'", "content": "theorem and_elim_l' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_elim_r'", "content": "theorem and_elim_r' [BI PROP] {P Q R : PROP} (h : Q ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_symm", "content": "theore...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem loeb [BI PROP] [BILoeb PROP] {P : PROP} : (β–· P β†’ P) ⊒ P :=
:= by apply entails_impl_true.mpr apply BILoeb.loeb_weak apply imp_intro apply (and_mono .rfl and_self.mpr).trans apply (and_mono .rfl (and_mono later_intro .rfl)).trans apply (and_mono later_impl .rfl).trans apply and_assoc.mpr.trans apply (and_mono imp_elim_l .rfl).trans exact imp_elim_r
7
68
false
Framework
234
Iris.BI.plainly_and_sep
theorem plainly_and_sep : β–  (P ∧ Q) ⊒ β–  (P βˆ— Q)
iris-lean
src/Iris/BI/Plainly.lean
[ "import Iris.Algebra", "import src.Iris.BI.DerivedLaws", "import src/Iris/Instances/UPred/Instance.lean", "import Iris.BI.DerivedLaws", "import Iris.BI.BI", "import src.Iris.BI.BI", "import Iris.BI.Classes" ]
[ { "name": "Lean.MonadQuotation", "module": "Init.Prelude" }, { "name": "Lean.MonadRef", "module": "Init.Prelude" }, { "name": "Monad", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option", "module": "Init.Prelude" }, ...
[ { "name": "syntax term:26 \" ==βˆ— \" term:25 : term", "content": "syntax term:26 \" ==βˆ— \" term:25 : term\n\nsyntax term \"={ \" term \" , \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }[ \" term \" ]β–·=βˆ— \" term : term\n\nsyntax term \"={ \" te...
[ { "name": "...", "module": "" } ]
[ { "name": "persistently_and_sep_assoc", "content": "theorem persistently_and_sep_assoc [BI PROP] {P Q R : PROP} :\n <pers> P ∧ (Q βˆ— R) ⊣⊒ (<pers> P ∧ Q) βˆ— R" }, { "name": "and_mono_l", "content": "theorem and_mono_l [BI PROP] {P P' Q : PROP} (h : P ⊒ P') : P ∧ Q ⊒ P' ∧ Q" }, { "name":...
[ { "name": "Iris.Plainly", "content": "class Plainly (PROP : Type _) where\n plainly : PROP β†’ PROP" }, { "name": "Iris.Plainly.plainlyIf", "content": "def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP :=\n iprop(if p then β–  P else P)" }, { "name": "...
[ { "name": "Iris.BI.persistently_elim_plainly", "content": "theorem persistently_elim_plainly : <pers> β–  P ⊣⊒ β–  P" }, { "name": "Iris.BI.plainly_forall_2", "content": "theorem plainly_forall_2 {Ξ¨ : Ξ± β†’ PROP} : (βˆ€ a, β–  (Ξ¨ a)) ⊒ β–  (βˆ€ a, Ξ¨ a)" }, { "name": "Iris.BI.plainly_and_sep_assoc", ...
import Iris.BI.Classes import Iris.BI.BI import Iris.BI.DerivedLaws import Iris.Algebra namespace Iris open BI class Plainly (PROP : Type _) where plainly : PROP β†’ PROP def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP := iprop(if p then β–  P else P) class BIPlainly (PRO...
theorem plainly_and_sep : β–  (P ∧ Q) ⊒ β–  (P βˆ— Q) :=
:= by refine (plainly_and.mp.trans <| (and_mono idem .rfl).trans plainly_and.mpr).trans ?_ refine (mono <| and_mono .rfl emp_sep.mpr).trans ?_ refine (mono <| plainly_and_sep_assoc.1).trans ?_ refine (mono <| sep_mono and_comm.mp .rfl).trans ?_ exact (mono <| sep_mono plainly_and_emp_elim .rfl).trans .rfl
6
55
false
Framework
235
Iris.BI.later_exists_false
theorem later_exists_false [BI PROP] {Ξ¦ : Ξ± β†’ PROP} : (β–· βˆƒ a, Ξ¦ a) ⊒ β–· False ∨ βˆƒ a, β–· Ξ¦ a
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.or_intro_r'", "content": "theorem or_intro_r' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ⊒ Q ∨ R" }, { "name": "Iris.BI.imp_intro'", "content": "theorem imp_intro' [BI PROP] {P Q R : PROP} (h : Q ∧ P ⊒ R) : P ⊒ Q β†’ R" }, { "name": "Iris.BI.exists_intro", "content": "...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem later_exists_false [BI PROP] {Ξ¦ : Ξ± β†’ PROP} : (β–· βˆƒ a, Ξ¦ a) ⊒ β–· False ∨ βˆƒ a, β–· Ξ¦ a :=
:= by apply later_sExists_false.trans apply or_elim · apply or_intro_l · refine or_intro_r' <| exists_elim ?_ intro P refine imp_elim <| pure_elim' ?_ rintro ⟨a, rfl⟩ exact imp_intro' <| exists_intro' a and_elim_l
4
52
false
Framework
236
Iris.DFrac.update_discard
theorem DFrac.update_discard {dq : DFrac F} : dq ~~> .discard
iris-lean
src/Iris/Algebra/DFrac.lean
[ "import Iris.Algebra.CMRA", "import Iris.Algebra.Updates", "import src.Iris.Algebra.Frac", "import Iris.Algebra.OFE", "import Iris.Algebra.LocalUpdates", "import src.Iris.Algebra.CMRA", "import Iris.Algebra.Frac" ]
[ { "name": "Add", "module": "Init.Prelude" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option....
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x", "content": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x" }, { "name": "F...
[ { "name": "...", "module": "" } ]
[ { "name": "Fractional.of_add_right", "content": "theorem Fractional.of_add_right {a a' : Ξ±} (H : Fractional (a + a')) : Fractional a'" }, { "name": "valid_iff_validN'", "content": "theorem valid_iff_validN' [Discrete Ξ±] (n) {x : Ξ±} : βœ“ x ↔ βœ“{n} x" }, { "name": "validN_of_le", "conten...
[ { "name": "Iris.DFrac", "content": "inductive DFrac (F : Type _) where\n \n| own (f : F) : DFrac F\n \n| discard : DFrac F\n \n| ownDiscard (f : F) : DFrac F" }, { "name": "Iris.valid", "content": "def valid : DFrac F β†’ Prop\n | .own f => Proper f\n | .discard => True\n | .ownDisc...
[ { "name": "Iris.valid_op_own", "content": "theorem valid_op_own {dq : DFrac F} {q : F} : βœ“ dq β€’ own q β†’ Fractional q" } ]
import Iris.Algebra.CMRA import Iris.Algebra.OFE import Iris.Algebra.Frac import Iris.Algebra.Updates import Iris.Algebra.LocalUpdates namespace Iris inductive DFrac (F : Type _) where | own (f : F) : DFrac F | discard : DFrac F | ownDiscard (f : F) : DFrac F section dfrac open DFrac Fraction OFE.Discrete...
theorem DFrac.update_discard {dq : DFrac F} : dq ~~> .discard :=
:= by intros n q H apply (CMRA.valid_iff_validN' n).mp have H' := (CMRA.valid_iff_validN' n).mpr H simp [CMRA.op?] at H' ⊒ rcases q with (_|⟨q|_|q⟩) <;> simp [CMRA.Valid, valid, CMRA.op, op] · cases dq <;> first | exact valid_op_own H | exact H · cases dq <;> first | exact Fractional.of_add_right H | exac...
3
31
false
Framework
237
Iris.local_update_unital_discrete
theorem local_update_unital_discrete [CMRA.Discrete Ξ±] (x y x' y' : Ξ±) : (x, y) ~l~> (x', y') ↔ βˆ€ z, βœ“ x β†’ x ≑ y β€’ z β†’ (βœ“ x' ∧ x' ≑ y' β€’ z)
iris-lean
src/Iris/Algebra/LocalUpdates.lean
[ "import Iris.Algebra.CMRA", "import src.Iris.Algebra.CMRA", "import src.Iris.Algebra.OFE" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { ...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x", "content": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x" }, { "name": "n...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "Included.trans", "content": "theorem Included.trans : (x : Ξ±) β‰Ό y β†’ y β‰Ό z β†’ x β‰Ό z" }, { "name": "inc_trans", "content": "theorem inc_trans {x y z : Ξ±} : x β‰Ό y...
[ { "name": "Iris.LocalUpdate", "content": "def LocalUpdate [CMRA Ξ±] (x y : Ξ± Γ— Ξ±) : Prop :=\n βˆ€n mz, βœ“{n} x.1 β†’ x.1 ≑{n}≑ x.2 β€’? mz β†’ βœ“{n} y.1 ∧ y.1 ≑{n}≑ y.2 β€’? mz" } ]
[ { "name": "Iris.local_update_unital", "content": "theorem local_update_unital {x y x' y' : Ξ±} :\n (x, y) ~l~> (x', y') ↔ βˆ€ n z, βœ“{n} x β†’ x ≑{n}≑ y β€’ z β†’ (βœ“{n} x' ∧ x' ≑{n}≑ y' β€’ z)" } ]
import Iris.Algebra.CMRA namespace Iris def LocalUpdate [CMRA Ξ±] (x y : Ξ± Γ— Ξ±) : Prop := βˆ€n mz, βœ“{n} x.1 β†’ x.1 ≑{n}≑ x.2 β€’? mz β†’ βœ“{n} y.1 ∧ y.1 ≑{n}≑ y.2 β€’? mz infixr:50 " ~l~> " => LocalUpdate section localUpdate section CMRA variable [CMRA Ξ±] end CMRA section UCMRA variable [UCMRA Ξ±]
theorem local_update_unital_discrete [CMRA.Discrete Ξ±] (x y x' y' : Ξ±) : (x, y) ~l~> (x', y') ↔ βˆ€ z, βœ“ x β†’ x ≑ y β€’ z β†’ (βœ“ x' ∧ x' ≑ y' β€’ z) :=
where mp h z vx e := have ⟨vx', e'⟩ := h 0 (some z) (CMRA.Valid.validN vx) e.dist ⟨CMRA.discrete_valid vx', OFE.discrete_0 e'⟩ mpr h := by refine local_update_unital.mpr fun n z vnx e => ?_ have ⟨vx', e'⟩ := h z ((CMRA.valid_iff_validN' n).mpr vnx) (OFE.discrete e) exact ⟨vx'.validN, e'.dist⟩
5
51
false
Framework
238
Iris.BI.persistently_and_sep_assoc
theorem persistently_and_sep_assoc [BI PROP] {P Q R : PROP} : <pers> P ∧ (Q βˆ— R) ⊣⊒ (<pers> P ∧ Q) βˆ— R
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_elim_l'", "content": "theorem and_elim_l' [BI PROP] {P Q R : PROP} (h : P ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_elim_r'", "content": "theorem and_elim_r' [BI PROP] {P Q R : PROP} (h : Q ⊒ R) : P ∧ Q ⊒ R" }, { "name": "Iris.BI.and_mono", "content": "@[rw_m...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem persistently_and_sep_assoc [BI PROP] {P Q R : PROP} : <pers> P ∧ (Q βˆ— R) ⊣⊒ (<pers> P ∧ Q) βˆ— R :=
:= by constructor Β· refine (and_mono_l persistently_idem_2).trans <| persistently_and_affinely_sep.trans <| sep_assoc.2.trans <| sep_mono_l <| and_intro ?_ ?_ Β· exact (sep_mono_l and_elim_r).trans persistently_absorb_l Β· exact (sep_mono_l and_elim_l).trans emp_sep.1 Β· exact and_intro ((sep_mono_l an...
4
56
false
Framework
239
Iris.UpdateP.iso
theorem UpdateP.iso (gf : βˆ€ x, g (f x) ≑ x) (g_op : βˆ€ y1 y2, g (y1 β€’ y2) ≑ g y1 β€’ g y2) (g_validN : βˆ€ n y, βœ“{n} (g y) ↔ βœ“{n} y) (uyp : y ~~>: P) (pq : βˆ€ y', P y' β†’ Q (g y')) : g y ~~>: Q
iris-lean
src/Iris/Algebra/Updates.lean
[ "import Iris.Algebra.CMRA", "import src.Iris.Algebra.CMRA", "import src.Iris.Algebra.OFE" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { ...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x", "content": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x" }, { "name": "C...
[ { "name": "...", "module": "" } ]
[ { "name": "op_right_eqv", "content": "theorem op_right_eqv (x : Ξ±) {y z : Ξ±} (e : y ≑ z) : x β€’ y ≑ x β€’ z" }, { "name": "Equiv.rfl", "content": "@[simp, refl] theorem Equiv.rfl [OFE Ξ±] {x : Ξ±} : x ≑ x" }, { "name": "equiv_eqv", "content": "theorem equiv_eqv [ofe : OFE Ξ±] : Equivalence...
[ { "name": "Iris.UpdateP", "content": "def UpdateP [CMRA Ξ±] (x : Ξ±) (P : Ξ± β†’ Prop) := βˆ€ n mz,\n βœ“{n} (x β€’? mz) β†’ βˆƒ y, P y ∧ βœ“{n} (y β€’? mz)" }, { "name": "Iris.Update", "content": "def Update [CMRA Ξ±] (x y : Ξ±) := βˆ€ n mz,\n βœ“{n} (x β€’? mz) β†’ βœ“{n} (y β€’? mz)" } ]
[]
import Iris.Algebra.CMRA namespace Iris def UpdateP [CMRA Ξ±] (x : Ξ±) (P : Ξ± β†’ Prop) := βˆ€ n mz, βœ“{n} (x β€’? mz) β†’ βˆƒ y, P y ∧ βœ“{n} (y β€’? mz) infixr:50 " ~~>: " => UpdateP def Update [CMRA Ξ±] (x y : Ξ±) := βˆ€ n mz, βœ“{n} (x β€’? mz) β†’ βœ“{n} (y β€’? mz) infixr:50 " ~~> " => Update section updates variable [CMRA Ξ±] [CMRA ...
theorem UpdateP.iso (gf : βˆ€ x, g (f x) ≑ x) (g_op : βˆ€ y1 y2, g (y1 β€’ y2) ≑ g y1 β€’ g y2) (g_validN : βˆ€ n y, βœ“{n} (g y) ↔ βœ“{n} y) (uyp : y ~~>: P) (pq : βˆ€ y', P y' β†’ Q (g y')) : g y ~~>: Q :=
:= by intro n mz v have : βœ“{n} y β€’? Option.map f mz := match mz with | none => (g_validN n _).mp v | some z => have : g y β€’ z ≑ g (y β€’ f z) := (CMRA.op_right_eqv _ (gf z).symm).trans (g_op y (f z)).symm (g_validN n _).mp (CMRA.validN_ne this.dist v) have ⟨x, px, vx⟩ := uyp n (mz.ma...
4
31
false
Framework
240
Iris.OFE.equiv_eqv
theorem equiv_eqv [ofe : OFE Ξ±] : Equivalence ofe.Equiv
iris-lean
src/Iris/Algebra/OFE.lean
[ "import src/Iris/Algebra/CMRA.lean", "import src/Iris/Instances/UPred/Instance.lean", "import src/Iris/Algebra/Agree_task.lean", "import src/Iris/Algebra/COFESolver.lean", "import src/Iris/Algebra/Heap.lean" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Dist", "module": "Mathlib.Topology.MetricSp...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y", "content": "notation:50 x \" β‰Ό{\" n \"} \" y:51 => IncludedN n x y" }, ...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Iris.OFE", "content": "class OFE (Ξ± : Type _) where\n Equiv : Ξ± β†’ Ξ± β†’ Prop\n Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop\n dist_eqv : Equivalence (Dist n)\n equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y\n dist_lt : Dist n x y β†’ m < n β†’ Dist m x y" } ]
[ { "name": "Iris.OFE.Dist.rfl", "content": "@[simp, refl] theorem Dist.rfl [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ x" }, { "name": "Iris.OFE.Dist.symm", "content": "@[symm] theorem Dist.symm [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ x" }, { "name": "Iris.OFE.Dist.trans", "content": "theorem Dis...
namespace Iris class OFE (Ξ± : Type _) where Equiv : Ξ± β†’ Ξ± β†’ Prop Dist : Nat β†’ Ξ± β†’ Ξ± β†’ Prop dist_eqv : Equivalence (Dist n) equiv_dist : Equiv x y ↔ βˆ€ n, Dist n x y dist_lt : Dist n x y β†’ m < n β†’ Dist m x y open OFE scoped infix:40 " ≑ " => OFE.Equiv scoped notation:40 x " ≑{" n "}≑ " y:41 => OFE.Dist n x ...
theorem equiv_eqv [ofe : OFE Ξ±] : Equivalence ofe.Equiv :=
:= by constructor Β· rintro x; rw [ofe.equiv_dist]; rintro n; exact Dist.rfl Β· rintro x y; simp [ofe.equiv_dist]; rintro h n; exact Dist.symm (h n) Β· rintro x y z; simp [ofe.equiv_dist]; rintro h₁ hβ‚‚ n; exact Dist.trans (h₁ n) (hβ‚‚ n)
3
14
false
Framework
241
Iris.BI.plainly_sep
theorem plainly_sep [BIPositive PROP] : β–  (P βˆ— Q) ⊣⊒ β–  P βˆ— β–  Q
iris-lean
src/Iris/BI/Plainly.lean
[ "import Iris.Algebra", "import src.Iris.BI.DerivedLaws", "import src/Iris/Instances/UPred/Instance.lean", "import Iris.BI.DerivedLaws", "import Iris.BI.BI", "import src.Iris.BI.BI", "import Iris.BI.Classes" ]
[ { "name": "Lean.MonadQuotation", "module": "Init.Prelude" }, { "name": "Lean.MonadRef", "module": "Init.Prelude" }, { "name": "Monad", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option", "module": "Init.Prelude" }, ...
[ { "name": "syntax term:26 \" ==βˆ— \" term:25 : term", "content": "syntax term:26 \" ==βˆ— \" term:25 : term\n\nsyntax term \"={ \" term \" , \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }[ \" term \" ]β–·=βˆ— \" term : term\n\nsyntax term \"={ \" te...
[ { "name": "...", "module": "" } ]
[ { "name": "persistently_and_sep_assoc", "content": "theorem persistently_and_sep_assoc [BI PROP] {P Q R : PROP} :\n <pers> P ∧ (Q βˆ— R) ⊣⊒ (<pers> P ∧ Q) βˆ— R" }, { "name": "and_mono_l", "content": "theorem and_mono_l [BI PROP] {P P' Q : PROP} (h : P ⊒ P') : P ∧ Q ⊒ P' ∧ Q" }, { "name":...
[ { "name": "Iris.Plainly", "content": "class Plainly (PROP : Type _) where\n plainly : PROP β†’ PROP" }, { "name": "Iris.Plainly.plainlyIf", "content": "def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP :=\n iprop(if p then β–  P else P)" }, { "name": "...
[ { "name": "Iris.BI.persistently_elim_plainly", "content": "theorem persistently_elim_plainly : <pers> β–  P ⊣⊒ β–  P" }, { "name": "Iris.BI.plainly_forall_2", "content": "theorem plainly_forall_2 {Ξ¨ : Ξ± β†’ PROP} : (βˆ€ a, β–  (Ξ¨ a)) ⊒ β–  (βˆ€ a, Ξ¨ a)" }, { "name": "Iris.BI.plainly_and_sep_assoc", ...
import Iris.BI.Classes import Iris.BI.BI import Iris.BI.DerivedLaws import Iris.Algebra namespace Iris open BI class Plainly (PROP : Type _) where plainly : PROP β†’ PROP def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP := iprop(if p then β–  P else P) class BIPlainly (PRO...
theorem plainly_sep [BIPositive PROP] : β–  (P βˆ— Q) ⊣⊒ β–  P βˆ— β–  Q :=
:= by refine ⟨?_, plainly_sep_2⟩ refine plainly_affinely_elim.mpr.trans ?_ refine (mono <| affinely_sep.mp).trans ?_ refine .trans ?_ and_sep_plainly.mp refine and_intro (mono ?_) (mono ?_) · exact ((sep_mono .rfl affinely_elim_emp).trans sep_emp.mp).trans affinely_elim · exact ((sep_mono affinely_elim_em...
7
72
false
Framework
242
Iris.Agree.toAgree_uninj
theorem Agree.toAgree_uninj {x : Agree Ξ±} : βœ“ x β†’ βˆƒ a, toAgree a ≑ x
iris-lean
src/Iris/Algebra/Agree.lean
[ "import Iris.Algebra.CMRA", "import src.Iris.Algebra.CMRA", "import src.Iris.Algebra.OFE", "import Iris.Algebra.OFE" ]
[ { "name": "List", "module": "Init.Prelude" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "na...
[ { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y" }, { "name": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x", "content": "notation:50 \"βœ“{\" n \"} \" x:51 => ValidN n x" }, { "name": "n...
[ { "name": "...", "module": "" } ]
[ { "name": "_root_.Iris.OFE.Dist.validN", "content": "theorem _root_.Iris.OFE.Dist.validN : (x : Ξ±) ≑{n}≑ y β†’ (βœ“{n} x ↔ βœ“{n} y)" }, { "name": "validN_iff", "content": "theorem validN_iff {x y : Ξ±} (e : x ≑{n}≑ y) : βœ“{n} x ↔ βœ“{n} y" }, { "name": "IncludedN.validN", "content": "theorem ...
[ { "name": "Iris.Agree", "content": "@[ext]\nstructure Agree where\n car : List Ξ±\n not_nil : car β‰  []" }, { "name": "Iris.toAgree", "content": "def toAgree (a : Ξ±) : Agree Ξ± := ⟨[a], by admit /- proof elided -/\n⟩" }, { "name": "Iris.Agree.dist", "content": "def Agree.dist (n : Nat...
[ { "name": "Iris.mem_of_agree", "content": "theorem mem_of_agree (x : Agree Ξ±) : βˆƒ a, a ∈ x.car" }, { "name": "Iris.Agree.equiv_def", "content": "theorem Agree.equiv_def {x y : Agree Ξ±} : x ≑ y ↔ βˆ€ n, Agree.dist n x y" }, { "name": "Iris.Agree.validN_iff", "content": "theorem Agree.va...
import Iris.Algebra.CMRA import Iris.Algebra.OFE namespace Iris section agree variable {Ξ± : Type u} variable (Ξ±) in @[ext] structure Agree where car : List Ξ± not_nil : car β‰  [] def toAgree (a : Ξ±) : Agree Ξ± := ⟨[a], by admit /- proof elided -/ ⟩ variable [OFE Ξ±] def Agree.dist (n : Nat) (x y : Agree Ξ±) : P...
theorem Agree.toAgree_uninj {x : Agree Ξ±} : βœ“ x β†’ βˆƒ a, toAgree a ≑ x :=
:= by simp only [valid_def, valid, validN_iff, equiv_def] obtain ⟨a, ha⟩ := mem_of_agree x intro h; exists a; intro n constructor <;> intros · exists a; simp_all [toAgree] · simp_all [toAgree]
7
53
false
Framework
243
Iris.BI.plainly_sep_dup
theorem plainly_sep_dup : β–  P ⊣⊒ β–  P βˆ— β–  P
iris-lean
src/Iris/BI/Plainly.lean
[ "import Iris.Algebra", "import Iris.BI.DerivedLaws", "import src.Iris.Algebra.CMRA", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import src.Iris.BI.DerivedLaws", "import src/Iris/Instances/UPred/Instance.lean", "import Iris.BI.BI", "import Iris.BI.Classes" ]
[ { "name": "Lean.MonadQuotation", "module": "Init.Prelude" }, { "name": "Lean.MonadRef", "module": "Init.Prelude" }, { "name": "Monad", "module": "Init.Prelude" }, { "name": "m", "module": "QqTest.matching" }, { "name": "Option", "module": "Init.Prelude" }, ...
[ { "name": "syntax term:26 \" ==βˆ— \" term:25 : term", "content": "syntax term:26 \" ==βˆ— \" term:25 : term\n\nsyntax term \"={ \" term \" , \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }=βˆ— \" term : term\n\nsyntax term \"={ \" term \" }[ \" term \" ]β–·=βˆ— \" term : term\n\nsyntax term \"={ \" te...
[ { "name": "...", "module": "" } ]
[ { "name": "persistently_and_sep_assoc", "content": "theorem persistently_and_sep_assoc [BI PROP] {P Q R : PROP} :\n <pers> P ∧ (Q βˆ— R) ⊣⊒ (<pers> P ∧ Q) βˆ— R" }, { "name": "and_mono_l", "content": "theorem and_mono_l [BI PROP] {P P' Q : PROP} (h : P ⊒ P') : P ∧ Q ⊒ P' ∧ Q" }, { "name":...
[ { "name": "Iris.Plainly", "content": "class Plainly (PROP : Type _) where\n plainly : PROP β†’ PROP" }, { "name": "Iris.Plainly.plainlyIf", "content": "def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP :=\n iprop(if p then β–  P else P)" }, { "name": "...
[ { "name": "Iris.BI.persistently_elim_plainly", "content": "theorem persistently_elim_plainly : <pers> β–  P ⊣⊒ β–  P" }, { "name": "Iris.BI.plainly_and_sep_assoc", "content": "theorem plainly_and_sep_assoc : β–  P ∧ (Q βˆ— R) ⊣⊒ (β–  P ∧ Q) βˆ— R" } ]
import Iris.BI.Classes import Iris.BI.BI import Iris.BI.DerivedLaws import Iris.Algebra namespace Iris open BI class Plainly (PROP : Type _) where plainly : PROP β†’ PROP def Plainly.plainlyIf [Iris.BI.BIBase PROP] [Plainly PROP] (p : Bool) (P : PROP) : PROP := iprop(if p then β–  P else P) class BIPlainly (PRO...
theorem plainly_sep_dup : β–  P ⊣⊒ β–  P βˆ— β–  P :=
:= by refine ⟨?_, plainly_absorb⟩ refine and_self.2.trans ?_ refine ((and_mono .rfl emp_sep.2).trans plainly_and_sep_assoc.1).trans ?_ exact (sep_mono and_elim_l .rfl).trans .rfl
6
72
false
Framework
244
Iris.BI.later_and
theorem later_and [BI PROP] {P Q : PROP} : β–· (P ∧ Q) ⊣⊒ β–· P ∧ β–· Q
iris-lean
src/Iris/BI/DerivedLaws.lean
[ "import Iris.BI.Extensions", "import Iris.Std.TC", "import Iris.Std.Classes", "import Iris.BI.BI", "import src.Iris.Algebra.OFE", "import src.Iris.BI.BI", "import Iris.BI.Classes", "import Iris.Std.Rewrite" ]
[ { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.merge", "module": "Init.Data.Option.Basic" }, { "name": "id", "module": "Init.Prelude" }, { "name": "Equivalence", "module": "Init.Core" }, { "name": "Nat", "module": "Init.Prelude" }, { ...
[ { "name": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do", "content": "macro \"βˆƒ\" xs:explicitBinders \", \" b:term : term => do\n return βŸ¨β† expandExplicitBinders ``BIBase.exists xs b⟩" }, { "name": "scoped notation:40 x \" ≑{\" n \"}≑ \" y:41 => OFE.Dist n x y", "content": "scoped ...
[ { "name": "...", "module": "" } ]
[ { "name": "Dist.trans", "content": "theorem Dist.trans [OFE Ξ±] {n} {x : Ξ±} : x ≑{n}≑ y β†’ y ≑{n}≑ z β†’ x ≑{n}≑ z" }, { "name": "BIBase.BiEntails.trans", "content": "theorem BIBase.BiEntails.trans [BI PROP] {P Q R : PROP} (h1 : P ⊣⊒ Q) (h2 : Q ⊣⊒ R) : P ⊣⊒ R" }, { "name": "BIBase.Entails.tr...
[]
[ { "name": "Iris.BI.and_symm", "content": "theorem and_symm [BI PROP] {P Q : PROP} : P ∧ Q ⊒ Q ∧ P" }, { "name": "Iris.BI.imp_intro'", "content": "theorem imp_intro' [BI PROP] {P Q R : PROP} (h : Q ∧ P ⊒ R) : P ⊒ Q β†’ R" }, { "name": "Iris.BI.imp_elim'", "content": "theorem imp_elim' [...
import Iris.BI.Classes import Iris.BI.Extensions import Iris.BI.BI import Iris.Std.Classes import Iris.Std.Rewrite import Iris.Std.TC namespace Iris.BI open Iris.Std BI
theorem later_and [BI PROP] {P Q : PROP} : β–· (P ∧ Q) ⊣⊒ β–· P ∧ β–· Q :=
:= by constructor Β· refine (later_mono and_forall_bool.mp).trans ?_ refine .trans ?_ and_forall_bool.mpr refine (later_forall).mp.trans (forall_mono ?_) exact (Β·.casesOn .rfl .rfl) Β· refine .trans ?_ (later_mono and_forall_bool.mpr) refine and_forall_bool.mp.trans ?_ refine .trans (forall_mono...
6
59
false
Framework
245
Juvix.Core.Main.Value.Approx.Indexed.preserved_step
lemma Value.Approx.Indexed.preserved_step {k} : (βˆ€ k' < k, Preservation k') β†’ Preservation k
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v" }, { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env e", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env ...
[ { "name": "List.Forallβ‚‚.get", "module": "Mathlib.Data.List.Forall2" }, { "name": "List.Forallβ‚‚.length_eq", "module": "Mathlib.Data.List.Forall2" }, { "name": "List.getElem?_eq_some_iff", "module": "Init.Data.List.Lemmas" }, { "name": "List.get_eq_getElem", "module": "Init...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed", "content": "def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop :=\n (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨\n (βˆƒ c, v₁ = Value.const c ∧ vβ‚‚ = Value.const c) ∨\n (βˆƒ ctr_name args_rev args_rev',\n v₁ = Value.constr_app ctr_name args_rev ∧\n vβ‚‚ = ...
[ { "name": "Juvix.Core.Main.Env.Approx.Indexed'.get", "content": "lemma Env.Approx.Indexed'.get {n i : Nat} {env env' o₁}\n (h₁ : env ≲ₑ'(n) env')\n (hβ‚‚ : env[i]? = some o₁) :\n βˆƒ oβ‚‚, env'[i]? = some oβ‚‚ ∧ o₁ ≲ₒ'(n) oβ‚‚" }, { "name": "Juvix.Core.Main.Env.Approx.Indexed'.value", "content": "lemma...
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop := (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨ (βˆƒ c...
lemma Value.Approx.Indexed.preserved_step {k} : (βˆ€ k' < k, Preservation k') β†’ Preservation k :=
:= by intro ihk intro m n env env' e v hβ‚€ h₁ hβ‚‚ induction hβ‚‚ generalizing m env' case var env i v h => obtain ⟨v', hget, happrox⟩ := Env.Approx.Indexed'.value h₁ h exists v' constructor Β· apply Eval.var aesop Β· apply Value.Approx.Indexed.anti_monotone Β· assumption Β· linarit...
4
68
true
Semantics
246
Juvix.Core.Main.Value.Approx.Indexed.refl
@[refl] lemma Value.Approx.Indexed.refl {n} v : v ≲α΅₯(n) v
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v" }, { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env e", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env ...
[ { "name": "and_self", "module": "Init.SimpLemmas" }, { "name": "exists_and_left", "module": "Init.PropLemmas" }, { "name": "exists_const", "module": "Init.PropLemmas" }, { "name": "exists_eq_left'", "module": "Init.PropLemmas" }, { "name": "false_and", "module...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed", "content": "def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop :=\n (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨\n (βˆƒ c, v₁ = Value.const c ∧ vβ‚‚ = Value.const c) ∨\n (βˆƒ ctr_name args_rev args_rev',\n v₁ = Value.constr_app ctr_name args_rev ∧\n vβ‚‚ = ...
[ { "name": "Juvix.Core.Main.Env.Approx.Indexed'.get", "content": "lemma Env.Approx.Indexed'.get {n i : Nat} {env env' o₁}\n (h₁ : env ≲ₑ'(n) env')\n (hβ‚‚ : env[i]? = some o₁) :\n βˆƒ oβ‚‚, env'[i]? = some oβ‚‚ ∧ o₁ ≲ₒ'(n) oβ‚‚" }, { "name": "Juvix.Core.Main.Env.Approx.Indexed'.value", "content": "lemma...
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop := (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨ (βˆƒ c...
@[refl] lemma Value.Approx.Indexed.refl {n} v : v ≲α΅₯(n) v :=
:= by revert n suffices βˆ€ n, βˆ€ k ≀ n, v ≲α΅₯(k) v by intro k exact this k k k.le_refl intro n induction n generalizing v with | zero => intros k hk cases v case unit => exact Value.Approx.Indexed.unit case const c => exact Value.Approx.Indexed.const case constr_app ctr_na...
7
80
true
Semantics
247
Juvix.Core.Main.Eval.toIndexed
lemma Eval.toIndexed {env e v} (h : env ⊒ e ↦ v) : βˆƒ n, env ⊒ e ↦(n) v
juvix-lean
Juvix/Core/Main/Semantics/Eval/Indexed.lean
[ "import Mathlib.Tactic.Linarith", "import Juvix.Core.Main.Semantics.Eval" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "syntax:100 expr:100 ppSpace expr:101 : expr", "content": "syntax:100 expr:100 ppSpace expr:101 : expr\n\nsyntax:50 expr:50 \" + \" expr:51 : expr\n\nsyntax:50 expr:50 \" - \" expr:50 : expr\n\nsyntax:60 expr:60 \" * \" expr:61 : expr\n\nsyntax:60 expr:60 \" / \" expr:60 : expr\n\nsyntax \"case \"...
[ { "name": "...", "module": "" } ]
[ { "name": "Termination.var", "content": "lemma Termination.var {env name i v} :\n env[i]? = some (Object.value v) β†’\n env ⊒ Expr.var name i ↓" }, { "name": "Termination.var_rec", "content": "lemma Termination.var_rec {env name i env' e} :\n env[i]? = some (Object.delayed env' e) β†’\n env'...
[ { "name": "Juvix.Core.Main.Eval.Indexed", "content": "inductive Eval.Indexed : Nat β†’ Env β†’ Expr β†’ Value β†’ Prop where\n | var {n env name idx val} :\n env[idx]? = some (Object.value val) β†’\n Eval.Indexed n env (Expr.var name idx) val\n | var_rec {n env name idx env' expr val} :\n env[idx]? = some ...
[ { "name": "Juvix.Core.Main.Eval.Indexed.monotone", "content": "lemma Eval.Indexed.monotone {n n' env e v} (h : env ⊒ e ↦(n) v) (h' : n ≀ n') : env ⊒ e ↦(n') v" } ]
import Juvix.Core.Main.Semantics.Eval import Mathlib.Tactic.Linarith namespace Juvix.Core.Main inductive Eval.Indexed : Nat β†’ Env β†’ Expr β†’ Value β†’ Prop where | var {n env name idx val} : env[idx]? = some (Object.value val) β†’ Eval.Indexed n env (Expr.var name idx) val | var_rec {n env name idx env' expr v...
lemma Eval.toIndexed {env e v} (h : env ⊒ e ↦ v) : βˆƒ n, env ⊒ e ↦(n) v :=
:= by induction h case var => exists 0; apply Eval.Indexed.var; assumption case var_rec ih => obtain ⟨n, ih⟩ := ih exists n apply Eval.Indexed.var_rec <;> assumption case unit => exists 0; apply Eval.Indexed.unit case const => exists 0; apply Eval.Indexed.const case constr => exi...
3
24
true
Semantics
248
Juvix.Core.Main.Termination.recur
lemma Termination.recur {env name e} : Object.delayed env (Expr.recur name e) :: env ⊒ e ↓ β†’ env ⊒ Expr.recur name e ↓
juvix-lean
Juvix/Core/Main/Tactics/Termination.lean
[ "import Juvix.Core.Main.Tactics.Base" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "syntax:100 expr:100 ppSpace expr:101 : expr", "content": "syntax:100 expr:100 ppSpace expr:101 : expr\n\nsyntax:50 expr:50 \" + \" expr:51 : expr\n\nsyntax:50 expr:50 \" - \" expr:50 : expr\n\nsyntax:60 expr:60 \" * \" expr:61 : expr\n\nsyntax:60 expr:60 \" / \" expr:60 : expr" }, { "name...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[]
import Juvix.Core.Main.Tactics.Base namespace Juvix.Core.Main
lemma Termination.recur {env name e} : Object.delayed env (Expr.recur name e) :: env ⊒ e ↓ β†’ env ⊒ Expr.recur name e ↓ :=
:= by unfold Eval.Defined intro h obtain ⟨w, h⟩ := h exists w · apply Juvix.Core.Main.Eval.recur exact h
4
19
false
Semantics
249
Juvix.Core.Main.Value.Approx.Indexed.trans
@[trans] lemma Value.Approx.Indexed.trans {n v₁ vβ‚‚ v₃} : v₁ ≲α΅₯(n) vβ‚‚ β†’ vβ‚‚ ≲α΅₯ v₃ β†’ v₁ ≲α΅₯(n) v₃
juvix-lean
Juvix/Core/Main/Semantics/Approx.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed", "import Juvix.Utils" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Inde", "content": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Indexed n v v'" }, { "name": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v v'", "content": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v...
[ { "name": "IsEmpty.forall_iff", "module": "Mathlib.Logic.IsEmpty" }, { "name": "implies_true", "module": "Init.SimpLemmas" }, { "name": "nonpos_iff_eq_zero", "module": "Mathlib.Algebra.Order.Monoid.Canonical.Defs" }, { "name": "not_lt_zero'", "module": "Mathlib.Algebra.Or...
[ { "name": "Value.Approx.Indexed.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.Indexed.invert {n v v'} :\n v ≲α΅₯(n) v' β†’\n Value.Approx.Indexed.Inversion n v v'" }, { "name": "Value.Approx.Indexed.constr_app", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.cons...
[ { "name": "Juvix.Core.Main.Value.Approx", "content": "def Value.Approx (v v' : Value) : Prop :=\n βˆ€ n, v ≲α΅₯(n) v'" }, { "name": "Juvix.Core.Main.Value.Approx.Inversion", "content": "@[aesop safe cases]\ninductive Value.Approx.Inversion : Value -> Value -> Prop where\n | unit : Value.Approx.Inv...
[ { "name": "Juvix.Core.Main.Value.Approx.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.invert {v v'} :\n v ≲α΅₯ v' β†’\n Value.Approx.Inversion v v'" } ]
import Juvix.Core.Main.Semantics.Approx.Indexed namespace Juvix.Core.Main def Value.Approx (v v' : Value) : Prop := βˆ€ n, v ≲α΅₯(n) v' notation:40 v:40 " ≲α΅₯ " v':40 => Value.Approx v v' notation:40 args₁:40 " ≲ₐ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Approx args₁ argsβ‚‚ notation:40 e:40 " β‰²βŸ¨" env:40 ", " env':40 "⟩ " e':4...
@[trans] lemma Value.Approx.Indexed.trans {n v₁ vβ‚‚ v₃} : v₁ ≲α΅₯(n) vβ‚‚ β†’ vβ‚‚ ≲α΅₯ v₃ β†’ v₁ ≲α΅₯(n) v₃ :=
:= by revert n suffices βˆ€ n, βˆ€ k ≀ n, v₁ ≲α΅₯(k) vβ‚‚ β†’ vβ‚‚ ≲α΅₯ v₃ β†’ v₁ ≲α΅₯(k) v₃ by intro k exact this k k k.le_refl intros n induction n generalizing v₁ vβ‚‚ v₃ with | zero => intros k hk h₁ hβ‚‚ invert h₁ case unit => invert hβ‚‚ case unit => exact Value.Approx.Indexed.unit c...
3
33
true
Semantics
250
Juvix.Core.Main.Value.Approx.Indexed.anti_monotone
lemma Value.Approx.Indexed.anti_monotone {n n' v₁ vβ‚‚} (h : v₁ ≲α΅₯(n) vβ‚‚) (h' : n' ≀ n) : v₁ ≲α΅₯(n') vβ‚‚
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v" }, { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env e", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env ...
[ { "name": "and_self", "module": "Init.SimpLemmas" }, { "name": "exists_and_left", "module": "Init.PropLemmas" }, { "name": "exists_const", "module": "Init.PropLemmas" }, { "name": "exists_eq_left'", "module": "Init.PropLemmas" }, { "name": "false_and", "module...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed", "content": "def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop :=\n (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨\n (βˆƒ c, v₁ = Value.const c ∧ vβ‚‚ = Value.const c) ∨\n (βˆƒ ctr_name args_rev args_rev',\n v₁ = Value.constr_app ctr_name args_rev ∧\n vβ‚‚ = ...
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed.unit", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.unit {n} : Value.unit ≲α΅₯(n) Value.unit" }, { "name": "Juvix.Core.Main.Value.Approx.Indexed.const", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.const {n c} : Valu...
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop := (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨ (βˆƒ c...
lemma Value.Approx.Indexed.anti_monotone {n n' v₁ vβ‚‚} (h : v₁ ≲α΅₯(n) vβ‚‚) (h' : n' ≀ n) : v₁ ≲α΅₯(n') vβ‚‚ :=
:= by revert n n' suffices βˆ€ n, v₁ ≲α΅₯(n) vβ‚‚ β†’ βˆ€ k ≀ n, v₁ ≲α΅₯(k) vβ‚‚ by intro n n' h hn exact this n h n' hn intro n induction n generalizing v₁ vβ‚‚ with | zero => intros h k hk invert h case unit => exact Value.Approx.Indexed.unit case const => exact Value.Approx.Indexed.cons...
3
34
true
Semantics
251
Juvix.Core.Main.Expr.Approx.Context.preserved
lemma Expr.Approx.Context.preserved (e₁ eβ‚‚ : Expr) : e₁ ≲ eβ‚‚ β†’ βˆ€ (C : Context) env₁ envβ‚‚ v₁, env₁ ≲ₑ envβ‚‚ β†’ env₁ ⊒ C.subst e₁ ↦ v₁ β†’ βˆƒ vβ‚‚, envβ‚‚ ⊒ C.subst eβ‚‚ ↦ vβ‚‚ ∧ v₁ ≲α΅₯ vβ‚‚
juvix-lean
Juvix/Core/Main/Semantics/Approx/Soundness.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed", "import Juvix.Core.Main.Semantics.Approx", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Juvix.Core.Main.Semantics.Approx.Contextual", "import Juvix.Core.Main.Semantics.Eval" ]
[ { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" }, { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" ...
[ { "name": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Exp", "content": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param env env' e e'" }, { "name": "notation:40 e₁:40 \" ≲ \" eβ‚‚:40 => Expr.Approx e₁ eβ‚‚", "content": "notation:40 e₁:40 \" ≲ \" e...
[ { "name": "List.forallβ‚‚_cons", "module": "Batteries.Data.List.Basic" }, { "name": "List.forallβ‚‚_same", "module": "Mathlib.Data.List.Forall2" } ]
[ { "name": "Expr.Approx.toIndexed", "content": "lemma Expr.Approx.toIndexed {e₁ eβ‚‚} : e₁ ≲ eβ‚‚ β†’ βˆ€ n, e₁ ≲'(n) eβ‚‚" }, { "name": "Value.Approx.Indexed.trans", "content": "@[trans]\nlemma Value.Approx.Indexed.trans {n v₁ vβ‚‚ v₃} : v₁ ≲α΅₯(n) vβ‚‚ β†’ vβ‚‚ ≲α΅₯ v₃ β†’ v₁ ≲α΅₯(n) v₃" }, { "name": "Value.Appr...
[ { "name": "Juvix.Core.Main.Context.Indexed.Preserved", "content": "def Context.Indexed.Preserved (k : Nat) : Prop :=\n βˆ€ n m,\n n + m < k β†’\n βˆ€ e₁ eβ‚‚,\n e₁ ≲'(n + m) eβ‚‚ β†’ βˆ€ (C : Context) env₁ envβ‚‚ v₁,\n env₁ ≲ₑ'(n + m) envβ‚‚ β†’\n env₁ ⊒ C.subst e₁ ↦(n) v₁ β†’\n βˆƒ vβ‚‚, envβ‚‚ ⊒ C.subst eβ‚‚...
[ { "name": "Juvix.Core.Main.Expr.Approx.Context.Indexed.preserved_step", "content": "lemma Expr.Approx.Context.Indexed.preserved_step (k : Nat) :\n Context.Indexed.Preserved k β†’ Context.Indexed.Preserved (k + 1)" }, { "name": "Juvix.Core.Main.Expr.Approx.Context.Indexed.preserved", "content": "l...
import Juvix.Core.Main.Semantics.Approx import Juvix.Core.Main.Semantics.Approx.Contextual namespace Juvix.Core.Main def Context.Indexed.Preserved (k : Nat) : Prop := βˆ€ n m, n + m < k β†’ βˆ€ e₁ eβ‚‚, e₁ ≲'(n + m) eβ‚‚ β†’ βˆ€ (C : Context) env₁ envβ‚‚ v₁, env₁ ≲ₑ'(n + m) envβ‚‚ β†’ env₁ ⊒ C.subst e₁ ↦(n) ...
lemma Expr.Approx.Context.preserved (e₁ eβ‚‚ : Expr) : e₁ ≲ eβ‚‚ β†’ βˆ€ (C : Context) env₁ envβ‚‚ v₁, env₁ ≲ₑ envβ‚‚ β†’ env₁ ⊒ C.subst e₁ ↦ v₁ β†’ βˆƒ vβ‚‚, envβ‚‚ ⊒ C.subst eβ‚‚ ↦ vβ‚‚ ∧ v₁ ≲α΅₯ vβ‚‚ :=
:= by intro happrox C env₁ envβ‚‚ v₁ henv heval obtain ⟨n, heval'⟩ := Eval.toIndexed heval have happrox' : e₁ ≲'(n + 0) eβ‚‚ := by apply Expr.Approx.toIndexed happrox have henv' : env₁ ≲ₑ'(n + 0) envβ‚‚ := by apply Env.Approx.toIndexed henv obtain ⟨vβ‚‚, hevalβ‚‚, happroxβ‚‚βŸ© := Expr.Approx.Context.Indexed.preserved (n +...
5
84
false
Semantics
252
Juvix.Core.Main.Value.Approx.closure
@[aesop unsafe apply] lemma Value.Approx.closure {env₁ body₁ envβ‚‚ bodyβ‚‚} : (βˆ€ a₁ aβ‚‚, a₁ ≲α΅₯ aβ‚‚ β†’ body₁ β‰²βŸ¨a₁ ∷ env₁, aβ‚‚ ∷ envβ‚‚βŸ© bodyβ‚‚) β†’ Value.closure env₁ body₁ ≲α΅₯ Value.closure envβ‚‚ bodyβ‚‚
juvix-lean
Juvix/Core/Main/Semantics/Approx.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed", "import Juvix.Utils" ]
[ { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, ...
[ { "name": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Exp", "content": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param env env' e e'" }, { "name": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v v'", "content": "notation:40 v:40 \" ≲α΅₯ \" v...
[ { "name": "IsEmpty.forall_iff", "module": "Mathlib.Logic.IsEmpty" }, { "name": "implies_true", "module": "Init.SimpLemmas" }, { "name": "nonpos_iff_eq_zero", "module": "Mathlib.Algebra.Order.Monoid.Canonical.Defs" }, { "name": "not_lt_zero'", "module": "Mathlib.Algebra.Or...
[ { "name": "Value.Approx.Indexed.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.Indexed.invert {n v v'} :\n v ≲α΅₯(n) v' β†’\n Value.Approx.Indexed.Inversion n v v'" }, { "name": "Value.Approx.Indexed.constr_app", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.cons...
[ { "name": "Juvix.Core.Main.Value.Approx", "content": "def Value.Approx (v v' : Value) : Prop :=\n βˆ€ n, v ≲α΅₯(n) v'" }, { "name": "Juvix.Core.Main.Expr.Approx.Param", "content": "def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Expr) : Prop :=\n (βˆ€ v₁, env₁ ⊒ e₁ ↦ v₁ β†’ βˆƒ vβ‚‚, envβ‚‚ ⊒ eβ‚‚ ↦ vβ‚‚ ∧ v₁ ...
[ { "name": "Juvix.Core.Main.Value.Approx.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.invert {v v'} :\n v ≲α΅₯ v' β†’\n Value.Approx.Inversion v v'" }, { "name": "Juvix.Core.Main.Value.Approx.Indexed.trans", "content": "@[trans]\nlemma Value.Approx.Indexed.trans {n v₁ vβ‚‚ v₃} : ...
import Juvix.Core.Main.Semantics.Approx.Indexed namespace Juvix.Core.Main def Value.Approx (v v' : Value) : Prop := βˆ€ n, v ≲α΅₯(n) v' notation:40 v:40 " ≲α΅₯ " v':40 => Value.Approx v v' notation:40 args₁:40 " ≲ₐ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Approx args₁ argsβ‚‚ def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Exp...
@[aesop unsafe apply] lemma Value.Approx.closure {env₁ body₁ envβ‚‚ bodyβ‚‚} : (βˆ€ a₁ aβ‚‚, a₁ ≲α΅₯ aβ‚‚ β†’ body₁ β‰²βŸ¨a₁ ∷ env₁, aβ‚‚ ∷ envβ‚‚βŸ© bodyβ‚‚) β†’ Value.closure env₁ body₁ ≲α΅₯ Value.closure envβ‚‚ bodyβ‚‚ :=
:= by intro h n apply Value.Approx.Indexed.closure intro n₁ nβ‚‚ hn a₁ aβ‚‚ v₁ happrox heval have h₁ : βˆƒ v₁', aβ‚‚ ∷ env₁ ⊒ body₁ ↦ v₁' ∧ v₁ ≲α΅₯(nβ‚‚) v₁' := by apply Indexed.preserved nβ‚‚ n₁ (a₁ ∷ env₁) (aβ‚‚ ∷ env₁) body₁ v₁ Β· simp [Env.Approx.Indexed'] constructor Β· constructor have : nβ‚‚ + n₁...
4
68
false
Semantics
253
Juvix.Core.Main.Object.Approx.Indexed'.anti_monotone
lemma Object.Approx.Indexed'.anti_monotone {n n' o₁ oβ‚‚} (h : o₁ ≲ₒ'(n) oβ‚‚) (h' : n' ≀ n) : o₁ ≲ₒ'(n') oβ‚‚ := match h with | @Object.Approx.Indexed'.value n v₁ vβ‚‚ happrox => by apply Object.Approx.Indexed'.value Β· apply Value.Approx.Indexed.anti_monotone Β· assumption Β· assumption |...
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v" }, { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env e", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env ...
[ { "name": "and_self", "module": "Init.SimpLemmas" }, { "name": "exists_and_left", "module": "Init.PropLemmas" }, { "name": "exists_const", "module": "Init.PropLemmas" }, { "name": "exists_eq_left'", "module": "Init.PropLemmas" }, { "name": "false_and", "module...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed", "content": "def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop :=\n (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨\n (βˆƒ c, v₁ = Value.const c ∧ vβ‚‚ = Value.const c) ∨\n (βˆƒ ctr_name args_rev args_rev',\n v₁ = Value.constr_app ctr_name args_rev ∧\n vβ‚‚ = ...
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed.unit", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.unit {n} : Value.unit ≲α΅₯(n) Value.unit" }, { "name": "Juvix.Core.Main.Value.Approx.Indexed.const", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.const {n c} : Valu...
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop := (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨ (βˆƒ c...
lemma Object.Approx.Indexed'.anti_monotone {n n' o₁ oβ‚‚} (h : o₁ ≲ₒ'(n) oβ‚‚) (h' : n' ≀ n) : o₁ ≲ₒ'(n') oβ‚‚ :=
:= match h with | @Object.Approx.Indexed'.value n v₁ vβ‚‚ happrox => by apply Object.Approx.Indexed'.value Β· apply Value.Approx.Indexed.anti_monotone Β· assumption Β· assumption | @Object.Approx.Indexed'.delayed n env₁ envβ‚‚ e₁ eβ‚‚ happrox => by apply Object.Approx.Indexed'.delay...
3
47
false
Semantics
254
Juvix.Core.Main.Value.Approx.closure_inv
lemma Value.Approx.closure_inv {env₁ body₁ envβ‚‚ bodyβ‚‚} (h : Value.closure env₁ body₁ ≲α΅₯ Value.closure envβ‚‚ bodyβ‚‚) : βˆ€ a₁ aβ‚‚, a₁ ≲α΅₯ aβ‚‚ β†’ body₁ β‰²βŸ¨a₁ ∷ env₁, aβ‚‚ ∷ envβ‚‚βŸ© bodyβ‚‚
juvix-lean
Juvix/Core/Main/Semantics/Approx.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Inde", "content": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Indexed n v v'" }, { "name": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v v'", "content": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v...
[ { "name": "IsEmpty.forall_iff", "module": "Mathlib.Logic.IsEmpty" }, { "name": "implies_true", "module": "Init.SimpLemmas" }, { "name": "nonpos_iff_eq_zero", "module": "Mathlib.Algebra.Order.Monoid.Canonical.Defs" }, { "name": "not_lt_zero'", "module": "Mathlib.Algebra.Or...
[ { "name": "Value.Approx.Indexed.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.Indexed.invert {n v v'} :\n v ≲α΅₯(n) v' β†’\n Value.Approx.Indexed.Inversion n v v'" }, { "name": "Value.Approx.Indexed.constr_app", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.cons...
[ { "name": "Juvix.Core.Main.Value.Approx", "content": "def Value.Approx (v v' : Value) : Prop :=\n βˆ€ n, v ≲α΅₯(n) v'" }, { "name": "Juvix.Core.Main.Expr.Approx.Param", "content": "def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Expr) : Prop :=\n (βˆ€ v₁, env₁ ⊒ e₁ ↦ v₁ β†’ βˆƒ vβ‚‚, envβ‚‚ ⊒ eβ‚‚ ↦ vβ‚‚ ∧ v₁ ...
[]
import Juvix.Core.Main.Semantics.Approx.Indexed namespace Juvix.Core.Main def Value.Approx (v v' : Value) : Prop := βˆ€ n, v ≲α΅₯(n) v' notation:40 v:40 " ≲α΅₯ " v':40 => Value.Approx v v' notation:40 args₁:40 " ≲ₐ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Approx args₁ argsβ‚‚ def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Exp...
lemma Value.Approx.closure_inv {env₁ body₁ envβ‚‚ bodyβ‚‚} (h : Value.closure env₁ body₁ ≲α΅₯ Value.closure envβ‚‚ bodyβ‚‚) : βˆ€ a₁ aβ‚‚, a₁ ≲α΅₯ aβ‚‚ β†’ body₁ β‰²βŸ¨a₁ ∷ env₁, aβ‚‚ ∷ envβ‚‚βŸ© bodyβ‚‚ :=
:= by intro a₁ aβ‚‚ ha v₁ h' suffices βˆ€ n, βˆƒ vβ‚‚, (aβ‚‚ ∷ envβ‚‚) ⊒ bodyβ‚‚ ↦ vβ‚‚ ∧ v₁ ≲α΅₯(n) vβ‚‚ by obtain ⟨vβ‚‚, _, _⟩ := this 0 exists vβ‚‚ constructor Β· assumption Β· intro n obtain ⟨vβ‚‚', _, _⟩ := this n have : vβ‚‚ = vβ‚‚' := by apply Eval.deterministic <;> assumption subst this ...
5
72
false
Semantics
255
Juvix.Core.Main.Value.Approx.preserved
theorem Value.Approx.preserved : βˆ€ env env' e v, env ≲ₑ env' β†’ env ⊒ e ↦ v β†’ βˆƒ v', env' ⊒ e ↦ v' ∧ v ≲α΅₯ v'
juvix-lean
Juvix/Core/Main/Semantics/Approx.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed", "import Juvix.Core.Main.Semantics.Eval", "import Juvix.Core.Main.Semantics.Eval.Indexed" ]
[ { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" }, { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" ...
[ { "name": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Exp", "content": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param env env' e e'" }, { "name": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v v'", "content": "notation:40 v:40 \" ≲α΅₯ \" v...
[ { "name": "...", "module": "" } ]
[ { "name": "Eval.Indexed.toEval", "content": "lemma Eval.Indexed.toEval {n env e v} (h : env ⊒ e ↦(n) v) : env ⊒ e ↦ v" }, { "name": "Value.Approx.Indexed.preserved", "content": "theorem Value.Approx.Indexed.preserved :\n βˆ€ m n env env' e v,\n env ≲ₑ'(m + n) env' β†’\n env ⊒ e ↦(n) v β†’\n ...
[ { "name": "Juvix.Core.Main.Value.Approx", "content": "def Value.Approx (v v' : Value) : Prop :=\n βˆ€ n, v ≲α΅₯(n) v'" }, { "name": "Juvix.Core.Main.Expr.Approx.Param", "content": "def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Expr) : Prop :=\n (βˆ€ v₁, env₁ ⊒ e₁ ↦ v₁ β†’ βˆƒ vβ‚‚, envβ‚‚ ⊒ eβ‚‚ ↦ vβ‚‚ ∧ v₁ ...
[ { "name": "Juvix.Core.Main.Env.Approx.cons", "content": "lemma Env.Approx.cons {env₁ envβ‚‚ o₁ oβ‚‚} :\n o₁ ≲ₒ oβ‚‚ β†’ env₁ ≲ₑ envβ‚‚ β†’ (o₁ :: env₁) ≲ₑ (oβ‚‚ :: envβ‚‚)" }, { "name": "Juvix.Core.Main.Object.Approx.toIndexed", "content": "lemma Object.Approx.toIndexed {o₁ oβ‚‚} : o₁ ≲ₒ oβ‚‚ β†’ βˆ€ n, o₁ ≲ₒ'(n) oβ‚‚" ...
import Juvix.Core.Main.Semantics.Approx.Indexed namespace Juvix.Core.Main def Value.Approx (v v' : Value) : Prop := βˆ€ n, v ≲α΅₯(n) v' notation:40 v:40 " ≲α΅₯ " v':40 => Value.Approx v v' notation:40 args₁:40 " ≲ₐ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Approx args₁ argsβ‚‚ def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Exp...
theorem Value.Approx.preserved : βˆ€ env env' e v, env ≲ₑ env' β†’ env ⊒ e ↦ v β†’ βˆƒ v', env' ⊒ e ↦ v' ∧ v ≲α΅₯ v' :=
:= by intro env env' e v h₁ hβ‚‚ suffices βˆ€ n, βˆƒ v', env' ⊒ e ↦ v' ∧ v ≲α΅₯(n) v' by obtain ⟨v', heval', happrox'⟩ := this 0 exists v' constructor Β· assumption Β· intro n obtain ⟨v'', heval'', happrox''⟩ := this n have : v' = v'' := by apply Eval.deterministic <;> assumption ...
4
66
false
Semantics
256
Juvix.Core.Main.Env.Approx.Indexed'.delayed
lemma Env.Approx.Indexed'.delayed {n i : Nat} {env₁ envβ‚‚ env e} (h₁ : env₁ ≲ₑ'(n) envβ‚‚) (hβ‚‚ : env₁[i]? = some (Object.delayed env e)) : (βˆƒ env' e', e ≲(n)⟨env, env'⟩ e' ∧ envβ‚‚[i]? = some (Object.delayed env' e')) ∨ βˆƒ env', env ≲ₑ'(n) env' ∧ envβ‚‚[i]? = some (Object.delayed env' e)
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" } ]
[ { "name": "notation:40 e:40 \" ≲(\" n:40 \")⟨\" env:40 \", \" env':40 \"⟩ \" e'", "content": "notation:40 e:40 \" ≲(\" n:40 \")⟨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param.Indexed n env env' e e'" }, { "name": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Inde", "co...
[ { "name": "List.Forallβ‚‚.get", "module": "Mathlib.Data.List.Forall2" }, { "name": "List.Forallβ‚‚.length_eq", "module": "Mathlib.Data.List.Forall2" }, { "name": "List.getElem?_eq_some_iff", "module": "Init.Data.List.Lemmas" }, { "name": "List.get_eq_getElem", "module": "Init...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Object.Approx.Indexed'", "content": "inductive Object.Approx.Indexed' (n : Nat) : Object β†’ Object β†’ Prop where\n | value {v₁ vβ‚‚} :\n v₁ ≲α΅₯(n) vβ‚‚ β†’\n Object.Approx.Indexed' n (Object.value v₁) (Object.value vβ‚‚)\n | delayed {env₁ envβ‚‚ e₁ eβ‚‚} :\n e₁ ≲(n)⟨env₁, envβ‚‚βŸ© eβ‚‚ β†’\n...
[ { "name": "Juvix.Core.Main.Env.Approx.Indexed'.get", "content": "lemma Env.Approx.Indexed'.get {n i : Nat} {env env' o₁}\n (h₁ : env ≲ₑ'(n) env')\n (hβ‚‚ : env[i]? = some o₁) :\n βˆƒ oβ‚‚, env'[i]? = some oβ‚‚ ∧ o₁ ≲ₒ'(n) oβ‚‚" }, { "name": "Juvix.Core.Main.Env.Approx.Indexed'.value", "content": "lemma...
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main notation:40 v:40 " ≲α΅₯(" n:40 ") " v':40 => Value.Approx.Indexed n v v' notation:40 args₁:40 " ≲ₐ(" n:40 ")...
lemma Env.Approx.Indexed'.delayed {n i : Nat} {env₁ envβ‚‚ env e} (h₁ : env₁ ≲ₑ'(n) envβ‚‚) (hβ‚‚ : env₁[i]? = some (Object.delayed env e)) : (βˆƒ env' e', e ≲(n)⟨env, env'⟩ e' ∧ envβ‚‚[i]? = some (Object.delayed env' e')) ∨ βˆƒ env', env ≲ₑ'(n) env' ∧ envβ‚‚[i]? = some (Object.delayed env' e) :=
:= by obtain ⟨o, h, happrox⟩ := Env.Approx.Indexed'.get h₁ hβ‚‚ cases h₃ : o case value v => rw [h₃] at happrox contradiction case delayed env' e' => rw [h₃] at happrox cases happrox case delayed h => left subst h₃ exists env' exists e' case delayed_eq => righ...
3
15
false
Semantics
257
Juvix.Core.Main.Value.Approx.Indexed.preserved'
lemma Value.Approx.Indexed.preserved' {k} : Preservation k
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↦ \" v:40 => Eval env e v" }, { "name": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env e", "content": "notation:40 env:40 \" ⊒ \" e:40 \" ↓\" => Eval.Defined env ...
[ { "name": "and_self", "module": "Init.SimpLemmas" }, { "name": "exists_and_left", "module": "Init.PropLemmas" }, { "name": "exists_const", "module": "Init.PropLemmas" }, { "name": "exists_eq_left'", "module": "Init.PropLemmas" }, { "name": "false_and", "module...
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Value.Approx.Indexed", "content": "def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop :=\n (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨\n (βˆƒ c, v₁ = Value.const c ∧ vβ‚‚ = Value.const c) ∨\n (βˆƒ ctr_name args_rev args_rev',\n v₁ = Value.constr_app ctr_name args_rev ∧\n vβ‚‚ = ...
[ { "name": "Juvix.Core.Main.Env.Approx.Indexed'.get", "content": "lemma Env.Approx.Indexed'.get {n i : Nat} {env env' o₁}\n (h₁ : env ≲ₑ'(n) env')\n (hβ‚‚ : env[i]? = some o₁) :\n βˆƒ oβ‚‚, env'[i]? = some oβ‚‚ ∧ o₁ ≲ₒ'(n) oβ‚‚" }, { "name": "Juvix.Core.Main.Env.Approx.Indexed'.value", "content": "lemma...
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main def Value.Approx.Indexed (n : Nat) (v₁ vβ‚‚ : Value) : Prop := (v₁ = Value.unit ∧ vβ‚‚ = Value.unit) ∨ (βˆƒ c...
lemma Value.Approx.Indexed.preserved' {k} : Preservation k :=
:= by suffices βˆ€ k' ≀ k, Preservation k' by aesop induction k with | zero => intro k' hk' refine preserved_step ?_ intro k hk linarith | succ k ih => intro k' hk' cases hk' case succ.refl => refine preserved_step ?_ intro k' hk' apply ih linarith case ...
9
80
false
Semantics
258
Juvix.Core.Main.Object.Approx.Indexed'.refl'
lemma Object.Approx.Indexed'.refl' {n o} (h : βˆ€ v, v ≲α΅₯(n) v) : o ≲ₒ'(n) o
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" }, { "name": "List.Forallβ‚‚.cons", "module": "Batteries.Data.List.Basic" }, { "name": "List.Forallβ‚‚.nil", ...
[ { "name": "notation:40 e:40 \" ≲(\" n:40 \")⟨\" env:40 \", \" env':40 \"⟩ \" e'", "content": "notation:40 e:40 \" ≲(\" n:40 \")⟨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param.Indexed n env env' e e'" }, { "name": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Inde", "co...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Object.Approx.Indexed'", "content": "inductive Object.Approx.Indexed' (n : Nat) : Object β†’ Object β†’ Prop where\n | value {v₁ vβ‚‚} :\n v₁ ≲α΅₯(n) vβ‚‚ β†’\n Object.Approx.Indexed' n (Object.value v₁) (Object.value vβ‚‚)\n | delayed {env₁ envβ‚‚ e₁ eβ‚‚} :\n e₁ ≲(n)⟨env₁, envβ‚‚βŸ© eβ‚‚ β†’\n...
[ { "name": "Juvix.Core.Main.Env.Approx.Indexed'.refl'", "content": " lemma Env.Approx.Indexed'.refl' {n env} (h : βˆ€ v, v ≲α΅₯(n) v) : env ≲ₑ'(n) env" } ]
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main notation:40 v:40 " ≲α΅₯(" n:40 ") " v':40 => Value.Approx.Indexed n v v' notation:40 args₁:40 " ≲ₐ(" n:40 ")...
lemma Object.Approx.Indexed'.refl' {n o} (h : βˆ€ v, v ≲α΅₯(n) v) : o ≲ₒ'(n) o :=
:= by cases o case value v => apply Object.Approx.Indexed'.value apply h case delayed env e => apply Object.Approx.Indexed'.delayed_eq exact Env.Approx.Indexed'.refl' h
3
14
false
Semantics
259
Juvix.Core.Main.Expr.Equiv.eval_const
lemma Expr.Equiv.eval_const {op a₁ aβ‚‚ i₁ iβ‚‚ i₃} : a₁ β‰ˆ Expr.const (Constant.int i₁) β†’ aβ‚‚ β‰ˆ Expr.const (Constant.int iβ‚‚) β†’ i₃ = eval_binop_int op i₁ iβ‚‚ β†’ Expr.binop op a₁ aβ‚‚ β‰ˆ Expr.const (Constant.int i₃)
juvix-lean
Juvix/Core/Main/Semantics/Equiv.lean
[ "import Juvix.Core.Main.Semantics.Approx" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "List", "module": "Init.Prelude" }, { "na...
[ { "name": "notation:40 e₁:40 \" ≲ \" eβ‚‚:40 => Expr.Approx e₁ eβ‚‚", "content": "notation:40 e₁:40 \" ≲ \" eβ‚‚:40 => Expr.Approx e₁ eβ‚‚" }, { "name": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Exp", "content": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.A...
[ { "name": "...", "module": "" } ]
[ { "name": "Expr.Approx.eval_const₁", "content": "lemma Expr.Approx.eval_const₁ {op a₁ aβ‚‚ i₁ iβ‚‚ i₃} :\n a₁ ≲ Expr.const (Constant.int i₁) β†’\n aβ‚‚ ≲ Expr.const (Constant.int iβ‚‚) β†’\n i₃ = eval_binop_int op i₁ iβ‚‚ β†’\n Expr.binop op a₁ aβ‚‚ ≲\n Expr.const (Constant.int i₃)" }, { "name": "Expr.Approx.c...
[ { "name": "Juvix.Core.Main.Expr.Equiv", "content": "def Expr.Equiv (e₁ eβ‚‚ : Expr) : Prop :=\n e₁ ≲ eβ‚‚ ∧ eβ‚‚ ≲ e₁" } ]
[]
import Juvix.Core.Main.Semantics.Approx namespace Juvix.Core.Main notation:40 v:40 " β‰ˆα΅₯ " v':40 => Value.Equiv v v' notation:40 args₁:40 " β‰ˆβ‚ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Equiv args₁ argsβ‚‚ notation:40 v:40 " β‰ˆβ‚’ " v':40 => Object.Equiv v v' notation:40 env₁:40 " β‰ˆβ‚‘ " envβ‚‚:40 => Env.Equiv env₁ envβ‚‚ notation:40 ...
lemma Expr.Equiv.eval_const {op a₁ aβ‚‚ i₁ iβ‚‚ i₃} : a₁ β‰ˆ Expr.const (Constant.int i₁) β†’ aβ‚‚ β‰ˆ Expr.const (Constant.int iβ‚‚) β†’ i₃ = eval_binop_int op i₁ iβ‚‚ β†’ Expr.binop op a₁ aβ‚‚ β‰ˆ Expr.const (Constant.int i₃) :=
:= by simp only [Expr.Equiv] intro h₁ hβ‚‚ h₃ constructor Β· apply Expr.Approx.eval_const₁ (op := op) (i₁ := i₁) (iβ‚‚ := iβ‚‚) <;> simp_all only Β· apply Expr.Approx.eval_constβ‚‚ (op := op) (i₁ := i₁) (iβ‚‚ := iβ‚‚) <;> simp_all only
3
40
false
Semantics
260
Juvix.Core.Main.Env.Approx.Indexed'.from_delayed
lemma Env.Approx.Indexed'.from_delayed {n env₁ envβ‚‚ l} (h : env₁ ≲ₑ'(n) envβ‚‚) : List.map (Object.delayed env₁) l ≲ₑ'(n) List.map (Object.delayed envβ‚‚) l
juvix-lean
Juvix/Core/Main/Semantics/Approx/Indexed.lean
[ "import Juvix.Utils", "import Juvix.Core.Main.Semantics.Eval.Indexed", "import Mathlib.Tactic.Linarith", "import Mathlib.Data.List.Forall2", "import Juvix.Core.Main.Semantics.Eval", "import Aesop" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" }, { "name": "List.map", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚.cons", "module": "Batteries....
[ { "name": "notation:40 e:40 \" ≲(\" n:40 \")⟨\" env:40 \", \" env':40 \"⟩ \" e'", "content": "notation:40 e:40 \" ≲(\" n:40 \")⟨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param.Indexed n env env' e e'" }, { "name": "notation:40 v:40 \" ≲α΅₯(\" n:40 \") \" v':40 => Value.Approx.Inde", "co...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Object.Approx.Indexed'", "content": "inductive Object.Approx.Indexed' (n : Nat) : Object β†’ Object β†’ Prop where\n | value {v₁ vβ‚‚} :\n v₁ ≲α΅₯(n) vβ‚‚ β†’\n Object.Approx.Indexed' n (Object.value v₁) (Object.value vβ‚‚)\n | delayed {env₁ envβ‚‚ e₁ eβ‚‚} :\n e₁ ≲(n)⟨env₁, envβ‚‚βŸ© eβ‚‚ β†’\n...
[]
import Juvix.Core.Main.Semantics.Eval import Juvix.Core.Main.Semantics.Eval.Indexed import Juvix.Utils import Mathlib.Tactic.Linarith import Mathlib.Data.List.Forall2 import Aesop namespace Juvix.Core.Main notation:40 v:40 " ≲α΅₯(" n:40 ") " v':40 => Value.Approx.Indexed n v v' notation:40 args₁:40 " ≲ₐ(" n:40 ")...
lemma Env.Approx.Indexed'.from_delayed {n env₁ envβ‚‚ l} (h : env₁ ≲ₑ'(n) envβ‚‚) : List.map (Object.delayed env₁) l ≲ₑ'(n) List.map (Object.delayed envβ‚‚) l :=
:= by induction l case nil => exact List.Forallβ‚‚.nil case cons e l' h' => simp apply List.Forallβ‚‚.cons Β· apply Object.Approx.Indexed'.delayed_eq assumption Β· assumption
3
12
false
Semantics
261
Juvix.Core.Main.Termination.binop
lemma Termination.binop {env op e₁ eβ‚‚ c₁ cβ‚‚} : env ⊒ e₁ ↦ Value.const (Constant.int c₁) β†’ env ⊒ eβ‚‚ ↦ Value.const (Constant.int cβ‚‚) β†’ env ⊒ Expr.binop op e₁ eβ‚‚ ↓
juvix-lean
Juvix/Core/Main/Tactics/Termination.lean
[ "import Juvix.Core.Main.Tactics.Base" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "syntax:100 expr:100 ppSpace expr:101 : expr", "content": "syntax:100 expr:100 ppSpace expr:101 : expr\n\nsyntax:50 expr:50 \" + \" expr:51 : expr\n\nsyntax:50 expr:50 \" - \" expr:50 : expr\n\nsyntax:60 expr:60 \" * \" expr:61 : expr\n\nsyntax:60 expr:60 \" / \" expr:60 : expr" }, { "name...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[]
import Juvix.Core.Main.Tactics.Base namespace Juvix.Core.Main
lemma Termination.binop {env op e₁ eβ‚‚ c₁ cβ‚‚} : env ⊒ e₁ ↦ Value.const (Constant.int c₁) β†’ env ⊒ eβ‚‚ ↦ Value.const (Constant.int cβ‚‚) β†’ env ⊒ Expr.binop op e₁ eβ‚‚ ↓ :=
:= by intro h₁ hβ‚‚ constructor apply Juvix.Core.Main.Eval.binop Β· assumption Β· assumption
4
18
false
Semantics
262
Juvix.Core.Main.Object.Approx.trans
@[trans] lemma Object.Approx.trans {o₁ oβ‚‚ o₃} : o₁ ≲ₒ oβ‚‚ β†’ oβ‚‚ ≲ₒ o₃ β†’ o₁ ≲ₒ o₃
juvix-lean
Juvix/Core/Main/Semantics/Approx.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed", "import Juvix.Utils" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Exp", "content": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param env env' e e'" }, { "name": "notation:40 e₁:40 \" ≲ \" eβ‚‚:40 => Expr.Approx e₁ eβ‚‚", "content": "notation:40 e₁:40 \" ≲ \" e...
[ { "name": "IsEmpty.forall_iff", "module": "Mathlib.Logic.IsEmpty" }, { "name": "implies_true", "module": "Init.SimpLemmas" }, { "name": "nonpos_iff_eq_zero", "module": "Mathlib.Algebra.Order.Monoid.Canonical.Defs" }, { "name": "not_lt_zero'", "module": "Mathlib.Algebra.Or...
[ { "name": "Value.Approx.Indexed.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.Indexed.invert {n v v'} :\n v ≲α΅₯(n) v' β†’\n Value.Approx.Indexed.Inversion n v v'" }, { "name": "Value.Approx.Indexed.constr_app", "content": "@[aesop unsafe apply]\nlemma Value.Approx.Indexed.cons...
[ { "name": "Juvix.Core.Main.Value.Approx", "content": "def Value.Approx (v v' : Value) : Prop :=\n βˆ€ n, v ≲α΅₯(n) v'" }, { "name": "Juvix.Core.Main.Expr.Approx.Param", "content": "def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Expr) : Prop :=\n (βˆ€ v₁, env₁ ⊒ e₁ ↦ v₁ β†’ βˆƒ vβ‚‚, envβ‚‚ ⊒ eβ‚‚ ↦ vβ‚‚ ∧ v₁ ...
[ { "name": "Juvix.Core.Main.Value.Approx.invert", "content": "@[aesop unsafe destruct]\nlemma Value.Approx.invert {v v'} :\n v ≲α΅₯ v' β†’\n Value.Approx.Inversion v v'" }, { "name": "Juvix.Core.Main.Value.Approx.Indexed.trans", "content": "@[trans]\nlemma Value.Approx.Indexed.trans {n v₁ vβ‚‚ v₃} : ...
import Juvix.Core.Main.Semantics.Approx.Indexed namespace Juvix.Core.Main def Value.Approx (v v' : Value) : Prop := βˆ€ n, v ≲α΅₯(n) v' notation:40 v:40 " ≲α΅₯ " v':40 => Value.Approx v v' notation:40 args₁:40 " ≲ₐ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Approx args₁ argsβ‚‚ def Expr.Approx.Param (env₁ envβ‚‚ : Env) (e₁ eβ‚‚ : Exp...
@[trans] lemma Object.Approx.trans {o₁ oβ‚‚ o₃} : o₁ ≲ₒ oβ‚‚ β†’ oβ‚‚ ≲ₒ o₃ β†’ o₁ ≲ₒ o₃ :=
:= by intros h₁ hβ‚‚ cases h₁ case value v₁ vβ‚‚ happrox => cases hβ‚‚ case value v₃ happrox' => apply Object.Approx.value trans vβ‚‚ <;> assumption case delayed env₁ envβ‚‚ e₁ eβ‚‚ happrox => cases hβ‚‚ case delayed envβ‚‚' eβ‚‚' happrox' => apply Object.Approx.delayed exact Expr.Approx.P...
6
39
false
Semantics
263
Juvix.Core.Main.Env.Approx.cons_value
lemma Env.Approx.cons_value {v₁ vβ‚‚ env} : v₁ ≲α΅₯ vβ‚‚ β†’ v₁ ∷ env ≲ₑ vβ‚‚ ∷ env
juvix-lean
Juvix/Core/Main/Semantics/Approx.lean
[ "import Juvix.Core.Main.Semantics.Approx.Indexed" ]
[ { "name": "List", "module": "Init.Prelude" }, { "name": "List.Forallβ‚‚", "module": "Batteries.Data.List.Basic" }, { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" ...
[ { "name": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Exp", "content": "notation:40 e:40 \" β‰²βŸ¨\" env:40 \", \" env':40 \"⟩ \" e':40 => Expr.Approx.Param env env' e e'" }, { "name": "notation:40 v:40 \" ≲α΅₯ \" v':40 => Value.Approx v v'", "content": "notation:40 v:40 \" ≲α΅₯ \" v...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Juvix.Core.Main.Value.Approx", "content": "def Value.Approx (v v' : Value) : Prop :=\n βˆ€ n, v ≲α΅₯(n) v'" }, { "name": "Juvix.Core.Main.Object.Approx", "content": "inductive Object.Approx : Object β†’ Object β†’ Prop where\n | value {v₁ vβ‚‚} : v₁ ≲α΅₯ vβ‚‚ β†’ Object.Approx (Object.value v₁) (Ob...
[ { "name": "Juvix.Core.Main.Value.Approx.refl", "content": "@[refl]\nlemma Value.Approx.refl v : v ≲α΅₯ v" }, { "name": "Juvix.Core.Main.Object.Approx.refl", "content": "@[refl]\nlemma Object.Approx.refl {o} : o ≲ₒ o" }, { "name": "Juvix.Core.Main.Env.Approx.refl", "content": "@[refl]\n...
import Juvix.Core.Main.Semantics.Approx.Indexed namespace Juvix.Core.Main def Value.Approx (v v' : Value) : Prop := βˆ€ n, v ≲α΅₯(n) v' notation:40 v:40 " ≲α΅₯ " v':40 => Value.Approx v v' notation:40 args₁:40 " ≲ₐ " argsβ‚‚:40 => List.Forallβ‚‚ Value.Approx args₁ argsβ‚‚ notation:40 e:40 " β‰²βŸ¨" env:40 ", " env':40 "⟩ " e':4...
lemma Env.Approx.cons_value {v₁ vβ‚‚ env} : v₁ ≲α΅₯ vβ‚‚ β†’ v₁ ∷ env ≲ₑ vβ‚‚ ∷ env :=
:= by intro h apply Env.Approx.cons Β· apply Object.Approx.value assumption Β· apply Env.Approx.refl
4
26
false
Semantics
264
Juvix.Core.Main.Termination.branch_matches
lemma Termination.branch_matches {env name vnames args_rev e e'} : args_rev.map Object.value ++ env ⊒ e ↓ β†’ Value.constr_app name args_rev ∷ env ⊒ Expr.branch name vnames e e' ↓
juvix-lean
Juvix/Core/Main/Tactics/Termination.lean
[ "import Juvix.Core.Main.Tactics.Base" ]
[ { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "String", "module": "Init.Prelude" }, { "...
[ { "name": "syntax:100 expr:100 ppSpace expr:101 : expr", "content": "syntax:100 expr:100 ppSpace expr:101 : expr\n\nsyntax:50 expr:50 \" + \" expr:51 : expr\n\nsyntax:50 expr:50 \" - \" expr:50 : expr\n\nsyntax:60 expr:60 \" * \" expr:61 : expr\n\nsyntax:60 expr:60 \" / \" expr:60 : expr" }, { "name...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[]
import Juvix.Core.Main.Tactics.Base namespace Juvix.Core.Main
lemma Termination.branch_matches {env name vnames args_rev e e'} : args_rev.map Object.value ++ env ⊒ e ↓ β†’ Value.constr_app name args_rev ∷ env ⊒ Expr.branch name vnames e e' ↓ :=
:= by intro h obtain ⟨w, h⟩ := h constructor apply Juvix.Core.Main.Eval.branch_matches assumption
4
18
false
Semantics
265
eval_bool_completeness
theorem eval_bool_completeness (e: BoolExpr V): BoolStepStar V val e (BoolExpr.Const (eval_bool V val e))
LeanExprEvaluator
ExprEval/Basic.lean
[ "import ExprEval.Steps", "import ExprEval.Lemmas", "import ExprEval.Expr" ]
[ { "name": "And", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" }, { "name": "Eq", "module": "Init.Prelude" }, { "name": "Not", "module": "Init.Prelude" }, { "name": "Or", "module": "Init.Prelude" }, { "name": "Add", "module...
[ { "name": "BoolStepStar", "content": "def BoolStepStar (V: Type) := StepStar (Step := BoolStep V) V" }, { "name": "BoolStep", "content": "inductive BoolStep: (val: V -> Int) -> (BoolExpr V) -> (BoolExpr V) -> Prop where\n | notIsBoolNot (b: Bool): BoolStep val\n (BoolExpr.Not (BoolExpr...
[ { "name": "Int.not_lt", "module": "Init.Data.Int.Order" }, { "name": "bne_iff_ne", "module": "Init.SimpLemmas" }, { "name": "decide_eq_false", "module": "Init.Prelude" }, { "name": "decide_eq_true", "module": "Init.Prelude" }, { "name": "eq_false_of_ne_true", ...
[ { "name": "BoolStepStar.andStepLeft", "content": "theorem BoolStepStar.andStepLeft (e₁ e₁' eβ‚‚: BoolExpr V):\n BoolStepStar V val e₁ e₁' -> BoolStepStar V val\n (BoolExpr.And e₁ eβ‚‚)\n (BoolExpr.And e₁' eβ‚‚)" }, { "name": "chasles_step_star", "content": "theorem chasles...
[]
[ { "name": "eval_completeness", "content": " theorem eval_completeness (e: ArExpr V) : ArStepStar V val e (ArExpr.Const (eval V val e))" } ]
import ExprEval.Steps import ExprEval.Lemmas variable (V: Type)
theorem eval_bool_completeness (e: BoolExpr V): BoolStepStar V val e (BoolExpr.Const (eval_bool V val e)) :=
:= by cases e with | Const b => simp [eval_bool] apply BoolStepStar.refl | Not e => simp [eval_bool] have ihn := eval_bool_completeness e (val := val) have h := BoolStepStar.notStep e _ ihn have h1 := BoolStep.notIsBoolNot (...
4
60
true
Semantics
266
eval_completeness
theorem eval_completeness (e: ArExpr V) : ArStepStar V val e (ArExpr.Const (eval V val e))
LeanExprEvaluator
ExprEval/Basic.lean
[ "import ExprEval.Steps", "import ExprEval.Lemmas", "import ExprEval.Expr" ]
[ { "name": "Add", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "Mul", "module": "Init.Prelude" }, { "name": "Sub", "module": "Init.Prelude" }, { "name": "And", "module": "Init.Prelude" }, { "name": "Bool", ...
[ { "name": "ArStep", "content": "inductive ArStep: (val: V -> Int) -> (ArExpr V) -> (ArExpr V) -> Prop where\n | getVarValue (var: V) :\n ArStep\n val\n (ArExpr.Var var)\n (ArExpr.Const (val var))\n | addConstConst(n₁ nβ‚‚: Int) :\n ArStep\n val\n...
[ { "name": "Int.not_lt", "module": "Init.Data.Int.Order" }, { "name": "bne_iff_ne", "module": "Init.SimpLemmas" }, { "name": "decide_eq_false", "module": "Init.Prelude" }, { "name": "decide_eq_true", "module": "Init.Prelude" }, { "name": "eq_false_of_ne_true", ...
[ { "name": "arstepstar_add_right", "content": "theorem arstepstar_add_right (n: Int) (eβ‚‚ eβ‚‚': ArExpr V) :\n ArStepStar V val eβ‚‚ eβ‚‚' ->\n ArStepStar V val\n (ArExpr.Add (ArExpr.Const n) eβ‚‚)\n (ArExpr.Add (ArExpr.Const n) eβ‚‚')"...
[]
[]
import ExprEval.Steps import ExprEval.Lemmas variable (V: Type)
theorem eval_completeness (e: ArExpr V) : ArStepStar V val e (ArExpr.Const (eval V val e)) :=
:= by cases e with | Const x => simp [eval] exact ArStepStar.refl _ _ | Add e₁ eβ‚‚ => have ih1 := eval_completeness e₁ (val := val) have ih2 := eval_completeness eβ‚‚ (val := val) simp [eval] have a := arstepstar_add_left _ _ e...
4
60
true
Semantics
267
boolstep_preserves_eval_bool
theorem boolstep_preserves_eval_bool (e e': BoolExpr V): BoolStep V val e e' -> eval_bool V val e = eval_bool V val e'
LeanExprEvaluator
ExprEval/Lemmas.lean
[ "import ExprEval.Steps", "import ExprEval.Expr" ]
[ { "name": "Add", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "Mul", "module": "Init.Prelude" }, { "name": "Sub", "module": "Init.Prelude" }, { "name": "And", "module": "Init.Prelude" }, { "name": "Bool", ...
[ { "name": "BoolExpr", "content": "inductive BoolExpr : Type\n | Const: Bool -> BoolExpr\n | Less: ArExpr -> ArExpr -> BoolExpr\n | Eq: ArExpr -> ArExpr -> BoolExpr\n | Not : BoolExpr -> BoolExpr\n | And : BoolExpr -> BoolExpr -> BoolExpr\n | Or : BoolExpr -> BoolExp...
[ { "name": "bne_iff_ne", "module": "Init.SimpLemmas" }, { "name": "Int.mul_eq_mul_right_iff", "module": "Init.Data.Int.Lemmas" }, { "name": "beq_eq_false_iff_ne", "module": "Init.SimpLemmas" }, { "name": "beq_iff_eq", "module": "Init.Core" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[ { "name": "arstep_preserve_eval", "content": " theorem arstep_preserve_eval (e e': ArExpr V): (ArStep V val) e e' -> eval V val e = eval V val e'" } ]
import ExprEval.Expr import ExprEval.Steps
theorem boolstep_preserves_eval_bool (e e': BoolExpr V): BoolStep V val e e' -> eval_bool V val e = eval_bool V val e' :=
:= by intro h cases h with | notIsBoolNot b => simp [eval_bool] | andLeftTrue e => simp [eval_bool] | orLeftFalse e => simp [eval_bool] | andLeftShortCircuit e => simp [eval_bool] | orLeftShortCircuit e => simp [eval_bool] | lessConstConstTrue n1 n2 h => ...
3
33
false
Semantics
268
arstep_preserve_eval
theorem arstep_preserve_eval (e e': ArExpr V): (ArStep V val) e e' -> eval V val e = eval V val e'
LeanExprEvaluator
ExprEval/Lemmas.lean
[ "import ExprEval.Steps", "import ExprEval.Expr" ]
[ { "name": "Add", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "Mul", "module": "Init.Prelude" }, { "name": "Sub", "module": "Init.Prelude" }, { "name": "And", "module": "Init.Prelude" }, { "name": "Bool", ...
[ { "name": "ArStep", "content": "inductive ArStep: (val: V -> Int) -> (ArExpr V) -> (ArExpr V) -> Prop where\n | getVarValue (var: V) :\n ArStep\n val\n (ArExpr.Var var)\n (ArExpr.Const (val var))\n | addConstConst(n₁ nβ‚‚: Int) :\n ArStep\n val\n...
[ { "name": "Int.mul_eq_mul_right_iff", "module": "Init.Data.Int.Lemmas" }, { "name": "beq_eq_false_iff_ne", "module": "Init.SimpLemmas" }, { "name": "beq_iff_eq", "module": "Init.Core" }, { "name": "bne_iff_ne", "module": "Init.SimpLemmas" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[]
import ExprEval.Expr import ExprEval.Steps
theorem arstep_preserve_eval (e e': ArExpr V): (ArStep V val) e e' -> eval V val e = eval V val e' :=
:= by intro h cases h with | addConstConst n₁ nβ‚‚ | subConstConst n₁ nβ‚‚ | mulConstConst n₁ nβ‚‚ => simp [eval] | subLeft e₁ e₁' eβ‚‚ step | addLeft e₁ e₁' eβ‚‚ step => simp [eval] exact arstep_preserve_eval e₁ ...
4
33
true
Semantics
269
boolstepstar_preserves_eval_bool
theorem boolstepstar_preserves_eval_bool (e e': BoolExpr V): BoolStepStar V val e e' -> eval_bool V val e = eval_bool V val e'
LeanExprEvaluator
ExprEval/Lemmas.lean
[ "import ExprEval.Steps", "import ExprEval.Expr" ]
[ { "name": "Add", "module": "Init.Prelude" }, { "name": "Int", "module": "Init.Data.Int.Basic" }, { "name": "Mul", "module": "Init.Prelude" }, { "name": "Sub", "module": "Init.Prelude" }, { "name": "And", "module": "Init.Prelude" }, { "name": "Bool", ...
[ { "name": "BoolExpr", "content": "inductive BoolExpr : Type\n | Const: Bool -> BoolExpr\n | Less: ArExpr -> ArExpr -> BoolExpr\n | Eq: ArExpr -> ArExpr -> BoolExpr\n | Not : BoolExpr -> BoolExpr\n | And : BoolExpr -> BoolExpr -> BoolExpr\n | Or : BoolExpr -> BoolExp...
[ { "name": "Int.mul_eq_mul_right_iff", "module": "Init.Data.Int.Lemmas" }, { "name": "beq_eq_false_iff_ne", "module": "Init.SimpLemmas" }, { "name": "beq_iff_eq", "module": "Init.Core" }, { "name": "bne_iff_ne", "module": "Init.SimpLemmas" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[ { "name": "arstep_preserve_eval", "content": " theorem arstep_preserve_eval (e e': ArExpr V): (ArStep V val) e e' -> eval V val e = eval V val e'" }, { "name": "boolstep_preserves_eval_bool", "content": " theorem boolstep_preserves_eval_bool (e e': BoolExpr V):\n BoolStep V val e e'...
import ExprEval.Expr import ExprEval.Steps
theorem boolstepstar_preserves_eval_bool (e e': BoolExpr V): BoolStepStar V val e e' -> eval_bool V val e = eval_bool V val e' :=
:= by intro h induction h with | refl => rfl | trans _ _ _ h_step _ ihn => rw [<- ihn] exact boolstep_preserves_eval_bool _ _ h_step
4
35
false
Semantics
270
arstepstar_preserves_eval
theorem arstepstar_preserves_eval (e e': ArExpr V) : ArStepStar V val e e' -> eval V val e = eval V val e'
LeanExprEvaluator
ExprEval/Lemmas.lean
[ "import ExprEval.Steps", "import ExprEval.Expr" ]
[ { "name": "And", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" }, { "name": "Eq", "module": "Init.Prelude" }, { "name": "Not", "module": "Init.Prelude" }, { "name": "Or", "module": "Init.Prelude" }, { "name": "Add", "module...
[ { "name": "ArExpr", "content": "inductive ArExpr: Type\n | Const: Int -> ArExpr\n | Add: ArExpr -> ArExpr -> ArExpr\n | Sub: ArExpr -> ArExpr -> ArExpr\n | Mul: ArExpr -> ArExpr -> ArExpr\n | Var: V -> ArExpr\n | If : BoolExpr -> ArExpr -> ArExpr -> ArExpr\n\n in...
[ { "name": "bne_iff_ne", "module": "Init.SimpLemmas" }, { "name": "Int.mul_eq_mul_right_iff", "module": "Init.Data.Int.Lemmas" }, { "name": "beq_eq_false_iff_ne", "module": "Init.SimpLemmas" }, { "name": "beq_iff_eq", "module": "Init.Core" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[ { "name": "arstep_preserve_eval", "content": " theorem arstep_preserve_eval (e e': ArExpr V): (ArStep V val) e e' -> eval V val e = eval V val e'" } ]
import ExprEval.Expr import ExprEval.Steps
theorem arstepstar_preserves_eval (e e': ArExpr V) : ArStepStar V val e e' -> eval V val e = eval V val e' :=
:= by intro h induction h with | refl _ => rfl | trans _ _ _ h1 _ ih => rw [arstep_preserve_eval _ _ h1, ih]
3
35
false
Semantics
271
TM.progress
theorem progress t T : HasType t T β†’ value t ∨ βˆƒ t', Step t t'
lean-formal-reasoning-program
Frap/Types.lean
[ "import Frap.SmallStep" ]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "syntax term \"==>\" term : term", "content": "syntax term \"==>\" term : term\n\nsyntax term \"~~>\" term : term\n\nsyntax term \"~~>*\" term : term\n\nsyntax:30 term \" =[ \" imp \" ]=> \" term : term\n\nsyntax term \"!->\" term \"; \" term : term\n\nsyntax:36 term \"<<->>\" term : term" }, ...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "TM.Tm", "content": "inductive Tm : Type :=\n | tru : Tm\n | fls : Tm\n | ite : Tm β†’ Tm β†’ Tm β†’ Tm\n | zro : Tm\n | scc : Tm β†’ Tm\n | prd : Tm β†’ Tm\n | iszero : Tm β†’ Tm" }, { "name": "TM.BValue", "content": "inductive BValue : Tm β†’ Prop :=\n | bv_true : BValue tru\n | bv_false ...
[ { "name": "TM.bool_canonical", "content": "theorem bool_canonical t : HasType t bool β†’ value t β†’ BValue t" }, { "name": "TM.nat_canonical", "content": "theorem nat_canonical t : HasType t nat β†’ value t β†’ NValue t" } ]
import Frap.SmallStep namespace TM inductive Tm : Type := | tru : Tm | fls : Tm | ite : Tm β†’ Tm β†’ Tm β†’ Tm | zro : Tm | scc : Tm β†’ Tm | prd : Tm β†’ Tm | iszero : Tm β†’ Tm open Tm inductive BValue : Tm β†’ Prop := | bv_true : BValue tru | bv_false : BValue fls inductive NValue : Tm β†’ Prop := | nv_0 :...
theorem progress t T : HasType t T β†’ value t ∨ βˆƒ t', Step t t' :=
:= by intro ht induction ht with | t_if t₁ tβ‚‚ t₃ T => rename_i ih₁ ihβ‚‚ ih₃ right; cases ih₁ . -- t₁ is a value have h : BValue t₁ := by apply bool_canonical <;> assumption cases h . exists tβ‚‚; apply st_ifTrue . exists t₃; apply st_ifFalse . -- t₁ can take a step ...
2
16
true
Semantics
272
Imp.fold_constants_com_sound
theorem fold_constants_com_sound : ctrans_sound fold_constants_com
lean-formal-reasoning-program
Frap/Trans.lean
[ "import Frap.Exercises.Equiv", "import Frap.Equiv" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" } ]
[ { "name": "syntax \"<[\" term \"]>\" : imp", "content": "syntax \"<[\" term \"]>\" : imp\n\nsyntax \"<{\" imp \"}>\" : term\n\nsyntax \"false\" : imp\n\nsyntax \"false\" : term\n\nsyntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp\n\nsyntax \"true\" : imp\n\nsyntax \"true\" : term\n\nsynt...
[ { "name": "...", "module": "" } ]
[ { "name": "if_true", "content": "theorem if_true b c₁ cβ‚‚\n : bequiv b <{true}> β†’ cequiv <{if <[b]> then <[c₁]> else <[cβ‚‚]> end}> c₁" }, { "name": "if_false", "content": "theorem if_false b c₁ cβ‚‚\n : bequiv b <{false}> β†’ cequiv <{if <[b]> then <[c₁]> else <[cβ‚‚]> end}> cβ‚‚" }, { "name...
[ { "name": "Imp.atrans_sound", "content": "def atrans_sound (atrans : AExp β†’ AExp) :=\n βˆ€ (a : AExp), aequiv a (atrans a)" }, { "name": "Imp.btrans_sound", "content": "def btrans_sound (btrans : BExp β†’ BExp) :=\n βˆ€ (b : BExp), bequiv b (btrans b)" }, { "name": "Imp.ctrans_sound", "c...
[ { "name": "Imp.while_true", "content": "theorem while_true b c :\n bequiv b <{true}> β†’ cequiv <{while <[b]> do <[c]> end}> loop" }, { "name": "Imp.sym_bequiv", "content": "theorem sym_bequiv b₁ bβ‚‚ : bequiv b₁ bβ‚‚ β†’ bequiv bβ‚‚ b₁" }, { "name": "Imp.sym_cequiv", "content": "theorem sy...
import Frap.Equiv import Frap.Exercises.Equiv namespace Imp open AExp open BExp open Com open CEval def atrans_sound (atrans : AExp β†’ AExp) := βˆ€ (a : AExp), aequiv a (atrans a) def btrans_sound (btrans : BExp β†’ BExp) := βˆ€ (b : BExp), bequiv b (btrans b) def ctrans_sound (ctrans : Com β†’ Com) := βˆ€ (c : Com...
theorem fold_constants_com_sound : ctrans_sound fold_constants_com :=
:= by intro c; induction c with simp [fold_constants_com] | c_asgn => apply c_asgn_congruence apply fold_constants_aexp_sound | c_seq => apply c_seq_congruence <;> assumption | c_if b c₁ cβ‚‚ ih1 ih2 => split . apply trans_cequiv _ c₁ . apply if_true rename_i heq; rw [← heq] ...
5
40
true
Semantics
273
CImp.par_loop_any_x
theorem par_loop_any_x n : βˆƒ st', Multi CStep (par_loop, empty) (c_skip, st') ∧ st' x = n
lean-formal-reasoning-program
Frap/SmallStepImp.lean
[ "import Frap.SmallStep", "import Frap.Equiv" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "And", "module": "Init.Prelude" } ]
[ { "name": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : im", "content": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp" }, { "name": "macro_rules", "content": "macro_rules\n | `(term|true) => `(Bool.true)\n | `(term|false) => `(Bool.false)\n | `(te...
[ { "name": "...", "module": "" } ]
[ { "name": "multi_R", "content": "theorem multi_R (X : Type) (R : relation X) x y : R x y β†’ Multi R x y" }, { "name": "multi_trans", "content": "theorem multi_trans (X : Type) (R : relation X) x y z\n : Multi R x y β†’ Multi R y z β†’ Multi R x z" } ]
[ { "name": "AVal", "content": "inductive AVal : AExp β†’ Prop :=\n | av_num : βˆ€ n, AVal (a_num n)" }, { "name": "AStep", "content": "inductive AStep (st : State) : AExp β†’ AExp β†’ Prop :=\n | as_id : βˆ€ v, AStep st (a_id v) (a_num (st v))\n | as_plus1 : βˆ€ a₁ a₁' aβ‚‚,\n AStep st a₁ a₁'\n β†’ ...
[ { "name": "CImp.par_body_n__Sn", "content": "theorem par_body_n__Sn n st\n : st x = n ∧ st y = 0\n β†’ Multi CStep (par_loop, st) (par_loop, x !-> n + 1; st)" }, { "name": "CImp.par_body_n", "content": "theorem par_body_n n st\n : st x = 0 ∧ st y = 0\n β†’ βˆƒ st', Multi CStep (par_loo...
import Frap.Equiv import Frap.SmallStep open Imp open AExp open BExp open Com open Multi inductive AVal : AExp β†’ Prop := | av_num : βˆ€ n, AVal (a_num n) inductive AStep (st : State) : AExp β†’ AExp β†’ Prop := | as_id : βˆ€ v, AStep st (a_id v) (a_num (st v)) | as_plus1 : βˆ€ a₁ a₁' aβ‚‚, AStep st a₁ a₁' ...
theorem par_loop_any_x n : βˆƒ st', Multi CStep (par_loop, empty) (c_skip, st') ∧ st' x = n :=
:= by let h := par_body_n n empty simp [empty] at h obtain ⟨st', ⟨h', ⟨hx, _⟩⟩⟩ := h exists y !-> 1; st' constructor . apply multi_trans . apply h' . apply multi_step . apply cs_par1; apply cs_asgn . apply multi_step . apply cs_par2; apply cs_while . apply multi_step ...
3
27
true
Semantics
274
Imp.fold_constants_bexp_sound
theorem fold_constants_bexp_sound : btrans_sound fold_constants_bexp
lean-formal-reasoning-program
Frap/Trans.lean
[ "import Frap.Exercises.Equiv", "import Frap.Equiv" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" } ]
[ { "name": "syntax \"<{\" imp \"}>\" : term", "content": "syntax \"<{\" imp \"}>\" : term\n\nsyntax \"false\" : imp\n\nsyntax \"false\" : term\n\nsyntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp\n\nsyntax \"true\" : imp\n\nsyntax \"true\" : term" }, { "name": "macro_rules", "...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Imp.atrans_sound", "content": "def atrans_sound (atrans : AExp β†’ AExp) :=\n βˆ€ (a : AExp), aequiv a (atrans a)" }, { "name": "Imp.btrans_sound", "content": "def btrans_sound (btrans : BExp β†’ BExp) :=\n βˆ€ (b : BExp), bequiv b (btrans b)" }, { "name": "Imp.fold_constants_aexp",...
[ { "name": "Imp.fold_constants_aexp_sound", "content": "theorem fold_constants_aexp_sound : atrans_sound fold_constants_aexp" } ]
import Frap.Equiv import Frap.Exercises.Equiv namespace Imp open AExp open BExp open Com open CEval def atrans_sound (atrans : AExp β†’ AExp) := βˆ€ (a : AExp), aequiv a (atrans a) def btrans_sound (btrans : BExp β†’ BExp) := βˆ€ (b : BExp), bequiv b (btrans b) def fold_constants_aexp (a : AExp) : AExp := match ...
theorem fold_constants_bexp_sound : btrans_sound fold_constants_bexp :=
:= by intro b st; induction b with simp [fold_constants_bexp] | b_eq a1 a2 => rw [fold_constants_aexp_sound a1, fold_constants_aexp_sound a2] split . rename_i hm simp at hm obtain ⟨⟩ := hm split <;> simp [*] . rename_i hm simp at hm obtain ⟨⟩ := hm simp [*] | b_...
5
21
true
Semantics
275
step_normalizing
theorem step_normalizing : normalizing Step
lean-formal-reasoning-program
Frap/SmallStep.lean
[]
[ { "name": "Nat", "module": "Init.Prelude" } ]
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Tm", "content": "inductive Tm : Type :=\n | c : Nat β†’ Tm \n | p : Tm β†’ Tm β†’ Tm" }, { "name": "SimpleArith1.Step", "content": "inductive Step : Tm β†’ Tm β†’ Prop :=\n | st_plusConstConst n₁ nβ‚‚ : Step (p (c n₁) (c nβ‚‚)) (c (n₁ + nβ‚‚))\n | st_plus1 t₁ t₁' tβ‚‚ : Step t₁ t₁' β†’ Step (p ...
[ { "name": "strong_progress", "content": "theorem strong_progress t : Value t ∨ βˆƒt', Step t t'" }, { "name": "value_is_nf", "content": "theorem value_is_nf v : Value v β†’ normal_form Step v" }, { "name": "nf_is_value", "content": "theorem nf_is_value t : normal_form Step t β†’ Value t" ...
inductive Tm : Type := | c : Nat β†’ Tm | p : Tm β†’ Tm β†’ Tm open Tm open Eval namespace SimpleArith1 inductive Step : Tm β†’ Tm β†’ Prop := | st_plusConstConst n₁ nβ‚‚ : Step (p (c n₁) (c nβ‚‚)) (c (n₁ + nβ‚‚)) | st_plus1 t₁ t₁' tβ‚‚ : Step t₁ t₁' β†’ Step (p t₁ tβ‚‚) (p t₁' tβ‚‚) | st_plus2 n₁ tβ‚‚ tβ‚‚' : Step tβ‚‚ tβ‚‚' ...
theorem step_normalizing : normalizing Step :=
:= by unfold normalizing intro t induction t with | c n => exists c n constructor . apply multi_refl . rw [nf_same_as_value]; apply v_const | p t₁ tβ‚‚ ih₁ ihβ‚‚ => obtain ⟨t₁', ⟨hs₁, hnβ‚βŸ©βŸ© := ih₁ obtain ⟨tβ‚‚', ⟨hsβ‚‚, hnβ‚‚βŸ©βŸ© := ihβ‚‚ rw [nf_same_as_value] at hn₁ rw [nf_same_as_value] at...
3
17
true
Semantics
276
Imp.optimize_0plus_com_sound
theorem optimize_0plus_com_sound : ctrans_sound optimize_0plus_com
lean-formal-reasoning-program
Frap/Exercises/Trans.lean
[ "import Frap.Trans" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" } ]
[ { "name": "syntax \"<{\" imp \"}>\" : term", "content": "syntax \"<{\" imp \"}>\" : term\n\nsyntax:21 \"while\" imp:20 \"do\" imp:20 \"end\" : imp\n\nsyntax \"<[\" term \"]>\" : imp\n\nsyntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp\n\nsyntax \"false\" : imp\n\nsyntax \"false\" : term\...
[ { "name": "...", "module": "" } ]
[ { "name": "c_while_congruence", "content": "theorem c_while_congruence b b' c c'\n : bequiv b b' β†’ cequiv c c'\n β†’ cequiv <{while <[b]> do <[c]> end}> <{while <[b']> do <[c']> end}>" }, { "name": "sym_bequiv", "content": "theorem sym_bequiv b₁ bβ‚‚ : bequiv b₁ bβ‚‚ β†’ bequiv bβ‚‚ b₁" }, { ...
[ { "name": "Imp.optimize_0plus_aexp", "content": "def optimize_0plus_aexp (a : AExp) : AExp :=\n match a with\n | a_num _ => a\n | a_id _ => a\n | a_plus (a_num 0) aβ‚‚ => optimize_0plus_aexp aβ‚‚\n | a_plus a₁ aβ‚‚ => a_plus (optimize_0plus_aexp a₁) (optimize_0plus_aexp aβ‚‚)\n | a_minus a₁ aβ‚‚ => a_minus (opt...
[ { "name": "Imp.optimize_0plus_aexp_sound", "content": "theorem optimize_0plus_aexp_sound : atrans_sound optimize_0plus_aexp" }, { "name": "Imp.optimize_0plus_bexp_sound", "content": "theorem optimize_0plus_bexp_sound : btrans_sound optimize_0plus_bexp" } ]
import Frap.Trans namespace Hidden.AExp open AExp end Hidden.AExp namespace Imp open AExp open BExp open Com open CEval def optimize_0plus_aexp (a : AExp) : AExp := match a with | a_num _ => a | a_id _ => a | a_plus (a_num 0) aβ‚‚ => optimize_0plus_aexp aβ‚‚ | a_plus a₁ aβ‚‚ => a_plus (optimize_0plus_aexp ...
theorem optimize_0plus_com_sound : ctrans_sound optimize_0plus_com :=
:= by intros c induction c with simp [*] at * | c_skip => apply refl_cequiv | c_asgn => apply c_asgn_congruence; apply optimize_0plus_aexp_sound | c_seq => apply c_seq_congruence . assumption . assumption | c_if => apply c_if_congruence . apply optimize_0plus_bexp_sound . assumption ...
6
35
false
Semantics
277
Tree.balance_BST
theorem balance_BST {Ξ± : Type u} c (l : Tree Ξ±) k vk (r : Tree Ξ±) : ForallTree (fun x _ => x < k) l -> ForallTree (fun x _ => x > k) r -> BST l -> BST r -> BST (balance c l k vk r)
lean-formal-reasoning-program
Frap/RedBlack.lean
[]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" } ]
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Color", "content": "inductive Color where\n | red\n | black" }, { "name": "Tree", "content": "inductive Tree (Ξ± : Type u) where\n | empty : Tree Ξ±\n | tree (c: Color) (l : Tree Ξ±) (k : Nat) (v : Ξ±) (r : Tree Ξ±) : Tree Ξ±" }, { "name": "Tree.ex_tree", "content": "def ex...
[ { "name": "Tree.forallTree_imp", "content": "theorem forallTree_imp {Ξ± : Type u} (P Q : Nat β†’ Ξ± β†’ Prop) t\n : ForallTree P t β†’ (βˆ€ k v, P k v β†’ Q k v) β†’ ForallTree Q t" }, { "name": "Tree.forallTree_lt", "content": "theorem forallTree_lt {Ξ± : Type u} (t : Tree Ξ±) k k'\n : ForallTree (fun x ...
inductive Color where | red | black inductive Tree (Ξ± : Type u) where | empty : Tree Ξ± | tree (c: Color) (l : Tree Ξ±) (k : Nat) (v : Ξ±) (r : Tree Ξ±) : Tree Ξ± namespace Tree open Color def ex_tree : Tree String := tree black (tree red empty 2 "two" empty) 4 "four" (tree red empty 5 "five" empty) def bala...
theorem balance_BST {Ξ± : Type u} c (l : Tree Ξ±) k vk (r : Tree Ξ±) : ForallTree (fun x _ => x < k) l -> ForallTree (fun x _ => x > k) r -> BST l -> BST r -> BST (balance c l k vk r) :=
:= by intro hlk hkr hbl hbr; simp split . constructor <;> assumption . split . -- we are in the case where `x` is left child of `y` cases l <;> repeat simp [*] at * rcases hbl with ⟨⟩ | ⟨_, _, _, _, _, hxy, hyc, hbx, hbc⟩ rcases hlk with ⟨⟩ | ⟨_, _, _, _, _, hyz, hxz, hzc⟩ rcases hbx...
2
11
true
Semantics
278
permutation_app_comm
theorem permutation_app_comm (l l' : List Ξ±) : Permutation (l ++ l') (l' ++ l)
lean-formal-reasoning-program
Frap/Sort.lean
[]
[ { "name": "List", "module": "Init.Prelude" } ]
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "append_assoc", "content": "theorem append_assoc (as bs cs : List Ξ±)\n : (as ++ bs) ++ cs = as ++ (bs ++ cs)" } ]
[ { "name": "Permutation", "content": "inductive Permutation {Ξ± : Type} : List Ξ± β†’ List Ξ± β†’ Prop :=\n | perm_nil : Permutation [] []\n | perm_skip x l l'\n : Permutation l l' β†’ Permutation (x::l) (x::l')\n | perm_swap x y l : Permutation (y::x::l) (x::y::l)\n | perm_trans l l' l''\n : Permutatio...
[ { "name": "permutation_refl", "content": "theorem permutation_refl (l : List Ξ±) : Permutation l l" }, { "name": "permutation_symm", "content": "theorem permutation_symm (l l' : List Ξ±)\n : Permutation l l' β†’ Permutation l' l" }, { "name": "permutation_app_tail", "content": "theore...
inductive Permutation {Ξ± : Type} : List Ξ± β†’ List Ξ± β†’ Prop := | perm_nil : Permutation [] [] | perm_skip x l l' : Permutation l l' β†’ Permutation (x::l) (x::l') | perm_swap x y l : Permutation (y::x::l) (x::y::l) | perm_trans l l' l'' : Permutation l l' β†’ Permutation l' l'' β†’ Permutation l l''...
theorem permutation_app_comm (l l' : List Ξ±) : Permutation (l ++ l') (l' ++ l) :=
:= by induction l with simp | nil => apply permutation_refl | cons a al ih => -- a :: (al ++ l') -- al ++ l' ++ [a] -- l' ++ al ++ [a] -- l' ++ (al ++ [a]) -- l' ++ a :: al apply perm_trans . apply permutation_cons_append . apply perm_trans . apply permutation_app_tail; exact...
2
8
false
Semantics
279
Hidden.Nat.add_comm
theorem add_comm (m n : Nat) : m + n = n + m
lean-formal-reasoning-program
Frap/Inductive.lean
[]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Hidden.Nat", "content": "inductive Nat where\n | zero : Nat\n | succ : Nat β†’ Nat" } ]
[ { "name": "Hidden.Nat.add_zero", "content": "theorem add_zero (m : Nat) : m + zero = m" }, { "name": "Hidden.Nat.add_succ", "content": "theorem add_succ (m n : Nat) : m + succ n = succ (m + n)" }, { "name": "Hidden.Nat.zero_add", "content": "theorem zero_add (n : Nat) : zero + n = n"...
section rewriting variable (Ξ± : Type) (a b c d : Ξ±) -- a, b, c, d are elements of some type /- ## Rewriting Recall our equality proof from last time. -/ example : a = b β†’ c = b β†’ c = d β†’ a = d := by intro hab hcb hcd apply Eq.trans . exact hab . apply Eq.trans . apply Eq.symm exact hcb . exac...
theorem add_comm (m n : Nat) : m + n = n + m :=
:= by induction n with | zero => rw [add_zero] rw [zero_add] | succ n' ih => rw [add_succ] rw [ih] rw [succ_add] /- Alternatively, if the supporting fact is only useful within a single theorem, we can embed the proof within, using the -/ example (m n : Nat) : m + n = n + m := by ...
1
5
false
Semantics
280
Hidden.List.Palindrome.Palindrome_rev
theorem Palindrome_rev {Ξ± : Type} (l : List Ξ±) : Palindrome l β†’ l = reverse l
lean-formal-reasoning-program
Frap/Exercises/IndProp.lean
[]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Hidden.List", "content": "inductive List (Ξ± : Type u) where\n | nil : List Ξ±\n | cons : Ξ± β†’ List Ξ± β†’ List Ξ±" }, { "name": "Hidden.List.reverse", "content": "def reverse {Ξ± : Type u} (as : List Ξ±) : List Ξ± :=\n match as with\n | nil => nil\n | cons a as' => reverse as' ++ ...
[ { "name": "Hidden.List.nil_append", "content": "theorem nil_append (as : List Ξ±) : nil ++ as = as" }, { "name": "Hidden.List.cons_append", "content": "theorem cons_append (a : Ξ±) (as bs : List Ξ±)\n : (cons a as) ++ bs = cons a (as ++ bs)" }, { "name": "Hidden.List.append_nil", ...
namespace Hidden inductive List (Ξ± : Type u) where | nil : List Ξ± | cons : Ξ± β†’ List Ξ± β†’ List Ξ± namespace List def reverse {Ξ± : Type u} (as : List Ξ±) : List Ξ± := match as with | nil => nil | cons a as' => reverse as' ++ cons a nil inductive Palindrome {Ξ± : Type} : List Ξ± β†’ Prop where | nil : Pali...
theorem Palindrome_rev {Ξ± : Type} (l : List Ξ±) : Palindrome l β†’ l = reverse l :=
:= by intro lPal induction lPal with | nil => rfl | single x => rfl | sandwich x xs xsPal xsRev => rw [reverse_append, reverse, reverse, nil_append, reverse, ←xsRev] rw [cons_append, ←append_assoc, cons_append, nil_append, cons_append]
2
8
false
Semantics
281
Imp.Hoare.hoare_while
theorem hoare_while P b c : {* fun st => P st ∧ beval st b *} c {* P *} β†’ {* P *} c_while b c {* fun st => P st ∧ Β¬(beval st b) *}
lean-formal-reasoning-program
Frap/Hoare.lean
[ "import Frap.Trans" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" } ]
[ { "name": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : im", "content": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp\n\nsyntax \"false\" : imp\n\nsyntax \"false\" : term\n\nsyntax \"true\" : imp\n\nsyntax \"true\" : term\n\nsyntax \"<{\" imp \"}>\" : term\n\nsy...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[]
import Frap.Trans namespace Imp open AExp open BExp open Com open CEval namespace Hoare infix:36 " ->> " => assert_implies
theorem hoare_while P b c : {* fun st => P st ∧ beval st b *} c {* P *} β†’ {* P *} c_while b c {* fun st => P st ∧ Β¬(beval st b) *} :=
:= by intro hHoare st st' hPre hEval -- we proceed by induction on `hEval` generalize hloop : c_while b c = cmd at * induction hEval with simp at * | e_whileFalse => constructor . exact hPre . simp [*] | e_whileTrue => simp [*] at * rename_i ih apply ih apply hHoare . constru...
4
15
true
Semantics
282
Tree.bst_insert_of_bst
theorem bst_insert_of_bst {Ξ± : Type u} (k : Nat) (v : Ξ±) (t : Tree Ξ±) : BST t β†’ BST (insert k v t)
lean-formal-reasoning-program
Frap/ADT.lean
[]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" } ]
[ { "name": "...", "content": "..." } ]
[ { "name": "Nat.le_antisymm", "module": "Init.Prelude" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Tree", "content": "inductive Tree (Ξ± : Type u) where\n | empty : Tree Ξ±\n | tree (l : Tree Ξ±) (k : Nat) (v : Ξ±) (r : Tree Ξ±) : Tree Ξ±" }, { "name": "Tree.ex_tree", "content": "def ex_tree : Tree String :=\n tree (tree empty 2 \"two\" empty) 4 \"four\" (tree empty 5 \"five\" empty)...
[ { "name": "Tree.forall_insert_of_forall", "content": "theorem forall_insert_of_forall {Ξ± : Type u} (P : Nat β†’ Ξ± β†’ Prop) (t : Tree Ξ±)\n : ForallTree P t β†’ βˆ€ k v, P k v β†’ ForallTree P (insert k v t)" } ]
inductive Tree (Ξ± : Type u) where | empty : Tree Ξ± | tree (l : Tree Ξ±) (k : Nat) (v : Ξ±) (r : Tree Ξ±) : Tree Ξ± namespace Tree def ex_tree : Tree String := tree (tree empty 2 "two" empty) 4 "four" (tree empty 5 "five" empty) def insert {Ξ± : Type u} (x : Nat) (v : Ξ±) (t : Tree Ξ±) : Tree Ξ± := match t with | ...
theorem bst_insert_of_bst {Ξ± : Type u} (k : Nat) (v : Ξ±) (t : Tree Ξ±) : BST t β†’ BST (insert k v t) :=
:= by intro hbst induction hbst with | empty => constructor <;> constructor | tree l k' v' r hlt hgt hbstl hbstr => unfold insert split . constructor . apply forall_insert_of_forall . assumption . assumption . assumption . assumption . assumption . split ...
4
11
false
Semantics
283
Hidden.List.Palindrome.Palindrome_app_rev
theorem Palindrome_app_rev {Ξ± : Type} (l : List Ξ±) : Palindrome (l ++ reverse l)
lean-formal-reasoning-program
Frap/Exercises/IndProp.lean
[]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Hidden.List", "content": "inductive List (Ξ± : Type u) where\n | nil : List Ξ±\n | cons : Ξ± β†’ List Ξ± β†’ List Ξ±" }, { "name": "Hidden.List.reverse", "content": "def reverse {Ξ± : Type u} (as : List Ξ±) : List Ξ± :=\n match as with\n | nil => nil\n | cons a as' => reverse as' ++ ...
[ { "name": "Hidden.List.nil_append", "content": "theorem nil_append (as : List Ξ±) : nil ++ as = as" }, { "name": "Hidden.List.cons_append", "content": "theorem cons_append (a : Ξ±) (as bs : List Ξ±)\n : (cons a as) ++ bs = cons a (as ++ bs)" }, { "name": "Hidden.List.append_assoc", ...
namespace Hidden inductive List (Ξ± : Type u) where | nil : List Ξ± | cons : Ξ± β†’ List Ξ± β†’ List Ξ± namespace List def reverse {Ξ± : Type u} (as : List Ξ±) : List Ξ± := match as with | nil => nil | cons a as' => reverse as' ++ cons a nil inductive Palindrome {Ξ± : Type} : List Ξ± β†’ Prop where | nil : Pali...
theorem Palindrome_app_rev {Ξ± : Type} (l : List Ξ±) : Palindrome (l ++ reverse l) :=
:= by induction l with | nil => rw [nil_append, reverse]; exact nil | cons x xs ih => rw [cons_append, reverse, ←append_assoc, ←cons_append] apply sandwich x exact ih
2
6
false
Semantics
284
Hidden.Nat.mul_assoc
theorem mul_assoc (m n k : Nat) : m * n * k = m * (n * k)
lean-formal-reasoning-program
Frap/Inductive.lean
[]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Hidden.Nat", "content": "inductive Nat where\n | zero : Nat\n | succ : Nat β†’ Nat" }, { "name": "Hidden.Nat.add", "content": "def add (m n : Nat) : Nat :=\n match n with\n | zero => m\n | succ n' => succ (add m n')" } ]
[ { "name": "Hidden.Nat.add_succ", "content": "theorem add_succ (m n : Nat) : m + succ n = succ (m + n)" }, { "name": "Hidden.Nat.add_assoc", "content": "theorem add_assoc (m n k : Nat) : m + n + k = m + (n + k)" }, { "name": "Hidden.Nat.mul_succ", "content": "theorem mul_succ (m n : N...
section rewriting variable (Ξ± : Type) (a b c d : Ξ±) -- a, b, c, d are elements of some type /- ## Rewriting Recall our equality proof from last time. -/ example : a = b β†’ c = b β†’ c = d β†’ a = d := by intro hab hcb hcd apply Eq.trans . exact hab . apply Eq.trans . apply Eq.symm exact hcb . exac...
theorem mul_assoc (m n k : Nat) : m * n * k = m * (n * k) :=
:= by induction k with | zero => rfl | succ k' ih => rw [mul_succ, mul_succ, ih, add_infix, add_infix] have nat_distrib (m n k : Nat) : m * n + m * k = m * (n + k) := by -- distributive property from left induction k with | zero => rfl | succ k' ih => ...
2
6
false
Semantics
285
permutation_cons_app
theorem permutation_cons_app (l l₁ lβ‚‚ : List Ξ±) : Permutation l (l₁ ++ lβ‚‚) β†’ Permutation (a :: l) (l₁ ++ a :: lβ‚‚)
lean-formal-reasoning-program
Frap/Sort.lean
[]
[ { "name": "List", "module": "Init.Prelude" } ]
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "append_assoc", "content": "theorem append_assoc (as bs cs : List Ξ±)\n : (as ++ bs) ++ cs = as ++ (bs ++ cs)" } ]
[ { "name": "Permutation", "content": "inductive Permutation {Ξ± : Type} : List Ξ± β†’ List Ξ± β†’ Prop :=\n | perm_nil : Permutation [] []\n | perm_skip x l l'\n : Permutation l l' β†’ Permutation (x::l) (x::l')\n | perm_swap x y l : Permutation (y::x::l) (x::y::l)\n | perm_trans l l' l''\n : Permutatio...
[ { "name": "permutation_refl", "content": "theorem permutation_refl (l : List Ξ±) : Permutation l l" }, { "name": "permutation_symm", "content": "theorem permutation_symm (l l' : List Ξ±)\n : Permutation l l' β†’ Permutation l' l" }, { "name": "permutation_app_head", "content": "theore...
inductive Permutation {Ξ± : Type} : List Ξ± β†’ List Ξ± β†’ Prop := | perm_nil : Permutation [] [] | perm_skip x l l' : Permutation l l' β†’ Permutation (x::l) (x::l') | perm_swap x y l : Permutation (y::x::l) (x::y::l) | perm_trans l l' l'' : Permutation l l' β†’ Permutation l' l'' β†’ Permutation l l''...
theorem permutation_cons_app (l l₁ lβ‚‚ : List Ξ±) : Permutation l (l₁ ++ lβ‚‚) β†’ Permutation (a :: l) (l₁ ++ a :: lβ‚‚) :=
:= by intro h -- a :: l -- a :: (l₁ ++ lβ‚‚) -- l₁ ++ lβ‚‚ ++ [a] -- l₁ ++ (lβ‚‚ ++ [a]) -- l₁ ++ a :: lβ‚‚ apply perm_trans . apply perm_skip; exact h . apply perm_trans . apply permutation_cons_append . rw [List.append_assoc] apply permutation_app_head apply permutation_symm apply ...
2
7
false
Semantics
286
TM.soundness
theorem soundness t t' T : HasType t T β†’ multistep t t' β†’ Β¬ stuck t'
lean-formal-reasoning-program
Frap/Types.lean
[ "import Frap.SmallStep" ]
[ { "name": "And", "module": "Init.Prelude" } ]
[ { "name": "syntax term \"==>\" term : term", "content": "syntax term \"==>\" term : term\n\nsyntax term \"~~>\" term : term\n\nsyntax term \"~~>*\" term : term\n\nsyntax:30 term \" =[ \" imp \" ]=> \" term : term\n\nsyntax term \"!->\" term \"; \" term : term\n\nsyntax:36 term \"<<->>\" term : term" }, ...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "TM.Tm", "content": "inductive Tm : Type :=\n | tru : Tm\n | fls : Tm\n | ite : Tm β†’ Tm β†’ Tm β†’ Tm\n | zro : Tm\n | scc : Tm β†’ Tm\n | prd : Tm β†’ Tm\n | iszero : Tm β†’ Tm" }, { "name": "TM.BValue", "content": "inductive BValue : Tm β†’ Prop :=\n | bv_true : BValue tru\n | bv_false ...
[ { "name": "TM.bool_canonical", "content": "theorem bool_canonical t : HasType t bool β†’ value t β†’ BValue t" }, { "name": "TM.nat_canonical", "content": "theorem nat_canonical t : HasType t nat β†’ value t β†’ NValue t" }, { "name": "TM.progress", "content": "theorem progress t T\n : Ha...
import Frap.SmallStep namespace TM inductive Tm : Type := | tru : Tm | fls : Tm | ite : Tm β†’ Tm β†’ Tm β†’ Tm | zro : Tm | scc : Tm β†’ Tm | prd : Tm β†’ Tm | iszero : Tm β†’ Tm open Tm inductive BValue : Tm β†’ Prop := | bv_true : BValue tru | bv_false : BValue fls inductive NValue : Tm β†’ Prop := | nv_0 :...
theorem soundness t t' T : HasType t T β†’ multistep t t' β†’ Β¬ stuck t' :=
:= by intro hT P induction P with (intro contra; obtain ⟨R, S⟩ := contra) | multi_refl => cases (progress _ _ hT) . -- value simp [*] at * . -- step simp [step_normal_form, normal_form, *] at * | multi_step => rename_i ih; apply ih . apply preservation . apply hT . as...
4
26
false
Semantics
287
CImp.par_body_n
theorem par_body_n n st : st x = 0 ∧ st y = 0 β†’ βˆƒ st', Multi CStep (par_loop, st) (par_loop, st') ∧ st' x = n ∧ st' y = 0
lean-formal-reasoning-program
Frap/SmallStepImp.lean
[ "import Frap.SmallStep", "import Frap.Equiv" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "And", "module": "Init.Prelude" } ]
[ { "name": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : im", "content": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp" }, { "name": "macro_rules", "content": "macro_rules\n | `(term|true) => `(Bool.true)\n | `(term|false) => `(Bool.false)\n | `(te...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "AVal", "content": "inductive AVal : AExp β†’ Prop :=\n | av_num : βˆ€ n, AVal (a_num n)" }, { "name": "AStep", "content": "inductive AStep (st : State) : AExp β†’ AExp β†’ Prop :=\n | as_id : βˆ€ v, AStep st (a_id v) (a_num (st v))\n | as_plus1 : βˆ€ a₁ a₁' aβ‚‚,\n AStep st a₁ a₁'\n β†’ ...
[ { "name": "CImp.par_body_n__Sn", "content": "theorem par_body_n__Sn n st\n : st x = n ∧ st y = 0\n β†’ Multi CStep (par_loop, st) (par_loop, x !-> n + 1; st)" } ]
import Frap.Equiv import Frap.SmallStep open Imp open AExp open BExp open Com open Multi inductive AVal : AExp β†’ Prop := | av_num : βˆ€ n, AVal (a_num n) inductive AStep (st : State) : AExp β†’ AExp β†’ Prop := | as_id : βˆ€ v, AStep st (a_id v) (a_num (st v)) | as_plus1 : βˆ€ a₁ a₁' aβ‚‚, AStep st a₁ a₁' ...
theorem par_body_n n st : st x = 0 ∧ st y = 0 β†’ βˆƒ st', Multi CStep (par_loop, st) (par_loop, st') ∧ st' x = n ∧ st' y = 0 :=
:= by intro h obtain ⟨hx, hy⟩ := h induction n with | zero => exists st apply And.intro . apply multi_refl . apply And.intro . apply hx . apply hy | succ n' hn' => obtain ⟨st', ⟨h', ⟨hx', hy'⟩⟩⟩ := hn' constructor apply And.intro . apply multi_tr...
3
24
false
Semantics
288
Imp.Hoare.hoare_if
theorem hoare_if P Q b c₁ cβ‚‚ : {* fun st => P st ∧ beval st b *} c₁ {* Q *} β†’ {* fun st => P st ∧ Β¬(beval st b) *} cβ‚‚ {* Q *} β†’ {* P *} c_if b c₁ cβ‚‚ {* Q *}
lean-formal-reasoning-program
Frap/Hoare.lean
[ "import Frap.Trans" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": "Bool", "module": "Init.Prelude" } ]
[ { "name": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : im", "content": "syntax:21 \"if\" imp:20 \"then\" imp:20 \"else\" imp:20 \"end\" : imp\n\nsyntax \"false\" : imp\n\nsyntax \"false\" : term\n\nsyntax \"true\" : imp\n\nsyntax \"true\" : term\n\nsyntax \"<{\" imp \"}>\" : term\n\nsy...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Imp.Hoare.Assertion", "content": "abbrev Assertion := State β†’ Prop" }, { "name": "Imp.Hoare.assert_implies", "content": "def assert_implies (P Q : Assertion) : Prop :=\n βˆ€ st, P st β†’ Q st" }, { "name": "Imp.Hoare.valid_hoare_triple", "content": "def valid_hoare_triple (P ...
[ { "name": "Imp.Hoare.hoare_asgn", "content": "theorem hoare_asgn Q x a :\n {* fun st => Q (st[x ↦ aeval st a]) *} c_asgn x a {* Q *}" }, { "name": "Imp.Hoare.hoare_consequence_pre", "content": "theorem hoare_consequence_pre P P' Q c :\n {* P' *} c {* Q *}\n β†’ P ->> P'\n β†’ {* P *} c {...
import Frap.Trans namespace Imp open AExp open BExp open Com open CEval namespace Hoare abbrev Assertion := State β†’ Prop def assert_implies (P Q : Assertion) : Prop := βˆ€ st, P st β†’ Q st infix:36 " ->> " => assert_implies def valid_hoare_triple (P : Assertion) (c : Com) (Q : Assertion) : Prop := βˆ€ st st', ...
theorem hoare_if P Q b c₁ cβ‚‚ : {* fun st => P st ∧ beval st b *} c₁ {* Q *} β†’ {* fun st => P st ∧ Β¬(beval st b) *} cβ‚‚ {* Q *} β†’ {* P *} c_if b c₁ cβ‚‚ {* Q *} :=
:= by intro hTrue hFalse st st' hPre hEval cases hEval . -- e_ifTrue rename_i hb hc₁ apply hTrue . constructor . exact hPre . exact hb . exact hc₁ . -- e_ifFalse rename_i hb hcβ‚‚ apply hFalse . constructor . exact hPre . simp [hb] . exact hcβ‚‚ example : ...
4
21
false
Semantics
289
Hidden.List.reverse_append
theorem reverse_append {Ξ± : Type u} (as bs : List Ξ±) : reverse (as ++ bs) = reverse bs ++ reverse as
lean-formal-reasoning-program
Frap/Exercises/IndProp.lean
[]
[ { "name": "structure BitVec (w : Nat) where", "module": "" }, { "name": "/-- Construct a `BitVec w` from a number less than `2^w`.", "module": "" }, { "name": "O(1), because we use `Fin` as the internal representation of a bitvector. -/", "module": "" }, { "name": "ofFin ::",...
[ { "name": "...", "content": "..." } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "Hidden.List", "content": "inductive List (Ξ± : Type u) where\n | nil : List Ξ±\n | cons : Ξ± β†’ List Ξ± β†’ List Ξ±" }, { "name": "Hidden.List.reverse", "content": "def reverse {Ξ± : Type u} (as : List Ξ±) : List Ξ± :=\n match as with\n | nil => nil\n | cons a as' => reverse as' ++ ...
[ { "name": "Hidden.List.nil_append", "content": "theorem nil_append (as : List Ξ±) : nil ++ as = as" }, { "name": "Hidden.List.cons_append", "content": "theorem cons_append (a : Ξ±) (as bs : List Ξ±)\n : (cons a as) ++ bs = cons a (as ++ bs)" }, { "name": "Hidden.List.append_nil", ...
namespace Hidden inductive List (Ξ± : Type u) where | nil : List Ξ± | cons : Ξ± β†’ List Ξ± β†’ List Ξ± namespace List def reverse {Ξ± : Type u} (as : List Ξ±) : List Ξ± := match as with | nil => nil | cons a as' => reverse as' ++ cons a nil
theorem reverse_append {Ξ± : Type u} (as bs : List Ξ±) : reverse (as ++ bs) = reverse bs ++ reverse as :=
:= by induction as with | nil => rw [nil_append, reverse, append_nil] | cons a as' ih => rw [cons_append, reverse, reverse, ih, append_assoc]
2
7
false
Semantics
290
and_associative
theorem and_associative (p q r : Prop) : (p ∧ q) ∧ r ↔ p ∧ (q ∧ r)
lean-formal-reasoning-program
Frap/Propositional.lean
[]
[ { "name": "Iff", "module": "Init.Core" } ]
[ { "name": "Iff", "content": "inductive Iff : Prop β†’ Prop β†’ Prop where\n | intro : (a β†’ b) β†’ (b β†’ a) β†’ Iff a b" } ]
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[ { "name": "and_commutative", "content": "theorem and_commutative (p q : Prop) : p ∧ q ↔ q ∧ p" } ]
import Mathlib.Computability.NFA import Mathlib.Data.FinEnum import Mathlib.Data.Rel import Mathlib.Data.Vector.Basic import Blase.AutoStructs.ForLean open Set open Mathlib open SetRel -- this is better because card is defeq to n instance (α : Type) : Inter (Language α) := ⟨Set.inter⟩ instance (α : Type) : Union (Lan...
theorem and_associative (p q r : Prop) : (p ∧ q) ∧ r ↔ p ∧ (q ∧ r) :=
:= by constructor . intro h cases h with | intro hpq hr => cases hpq with | intro hp hq => apply And.intro . exact hp . apply And.intro . exact hq . exact hr . intro h cases h with | intro hp hqr => cases hqr with | intro hq hr =>...
2
3
false
Semantics
291
While.WellTyped.some_ty
theorem WellTyped.some_ty {e ty} : e.ty = some ty β†’ WellTyped e ty
lean-hoare
Hoare/While/Types.lean
[ "import Hoare.While.Syntax" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "bool", "module": "Init.Control.Basic" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.isSome", "module": "Init.Data.Option.Basi...
[ { "name": "syntax num : nexpr", "content": "syntax num : nexpr\n\nsyntax \"if \" bexpr \" then \" com \" else \" com \" fi\" : com" }, { "name": "macro_rules", "content": "macro_rules\n| `([nexpr| $n:num]) => `(Expr.num $n)\n| `([nexpr| $x:ident]) => `(Expr.var $(Lean.quote x.getId.toString))\n|...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "While.Ty", "content": "inductive Ty\n| num : Ty\n| bool : Ty\nderiving Repr, DecidableEq" }, { "name": "While.WellTyped", "content": "inductive WellTyped : Expr β†’ Ty β†’ Prop\n| num : WellTyped (Expr.num _) Ty.num\n| bool : WellTyped (Expr.bool _) Ty.bool\n| add : βˆ€ e1 e2, WellTyped e1 ...
[ { "name": "While.WellTyped.ty_some", "content": "theorem WellTyped.ty_some {e ty} : WellTyped e ty β†’ e.ty = some ty" } ]
import Hoare.While.Syntax namespace While inductive Ty | num : Ty | bool : Ty deriving Repr, DecidableEq inductive WellTyped : Expr β†’ Ty β†’ Prop | num : WellTyped (Expr.num _) Ty.num | bool : WellTyped (Expr.bool _) Ty.bool | add : βˆ€ e1 e2, WellTyped e1 Ty.num β†’ WellTyped e2 Ty.num β†’ WellTyped (Expr.add e1 e2) Ty...
theorem WellTyped.some_ty {e ty} : e.ty = some ty β†’ WellTyped e ty :=
:= by intro h induction e generalizing ty <;> simp_all [Expr.ty] case num _ => rw [← h]; exact WellTyped.num case bool _ => rw [← h]; exact WellTyped.bool case add e1 e2 ih_e1 ih_e2 => have h' := h.2.symm; subst h'; exact WellTyped.add e1 e2 ih_e1 ih_e2 case sub e1 e2 ih_e1 ih_e2 => have h' := h.2.s...
3
13
false
Semantics
292
While.WellTyped.ty_some
theorem WellTyped.ty_some {e ty} : WellTyped e ty β†’ e.ty = some ty
lean-hoare
Hoare/While/Types.lean
[ "import Hoare.While.Syntax" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "bool", "module": "Init.Control.Basic" }, { "name": "Option", "module": "Init.Prelude" }, { "name": "Option.isSome", "module": "Init.Data.Option.Basi...
[ { "name": "syntax num : nexpr", "content": "syntax num : nexpr\n\nsyntax \"if \" bexpr \" then \" com \" else \" com \" fi\" : com" }, { "name": "macro_rules", "content": "macro_rules\n| `([nexpr| $n:num]) => `(Expr.num $n)\n| `([nexpr| $x:ident]) => `(Expr.var $(Lean.quote x.getId.toString))\n|...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "While.Ty", "content": "inductive Ty\n| num : Ty\n| bool : Ty\nderiving Repr, DecidableEq" }, { "name": "While.WellTyped", "content": "inductive WellTyped : Expr β†’ Ty β†’ Prop\n| num : WellTyped (Expr.num _) Ty.num\n| bool : WellTyped (Expr.bool _) Ty.bool\n| add : βˆ€ e1 e2, WellTyped e1 ...
[]
import Hoare.While.Syntax namespace While inductive Ty | num : Ty | bool : Ty deriving Repr, DecidableEq inductive WellTyped : Expr β†’ Ty β†’ Prop | num : WellTyped (Expr.num _) Ty.num | bool : WellTyped (Expr.bool _) Ty.bool | add : βˆ€ e1 e2, WellTyped e1 Ty.num β†’ WellTyped e2 Ty.num β†’ WellTyped (Expr.add e1 e2) Ty...
theorem WellTyped.ty_some {e ty} : WellTyped e ty β†’ e.ty = some ty :=
:= by intro h induction h case num => rfl case bool => rfl case add _ _ h1 h2 => simp [Expr.ty, h1, h2] case sub _ _ h1 h2 => simp [Expr.ty, h1, h2] case mul _ _ h1 h2 => simp [Expr.ty, h1, h2] case eq e1 _ _ h1 h2 => simp [Expr.ty, h1, h2] case lt _ _ h1 h2 => simp [Expr.ty, h1, h...
4
13
false
Semantics
293
While.WellTyped.not_eq_not_eq_ty
theorem WellTyped.not_eq_not_eq_ty {e1 e2 : Expr} {t1 t2 : Ty} : WellTyped e1 t1 β†’ WellTyped e2 t2 β†’ t1 β‰  t2 β†’ βˆ€ t, Β¬ (WellTyped (Expr.eq e1 e2) t)
lean-hoare
Hoare/While/Types.lean
[ "import Hoare.While.Syntax" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "bool", "module": "Init.Control.Basic" } ]
[ { "name": "Expr", "content": "inductive Expr\n| num : Nat β†’ Expr\n| bool : Bool β†’ Expr\n| var : String β†’ Expr\n| add : Expr β†’ Expr β†’ Expr\n| sub : Expr β†’ Expr β†’ Expr\n| mul : Expr β†’ Expr β†’ Expr\n| eq : Expr β†’ Expr β†’ Expr\n| lt : Expr β†’ Expr β†’ Expr\n| gt : Expr β†’ Expr β†’ Expr\n| le : Expr β†’ Expr β†’ Expr\n| ge ...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "While.Ty", "content": "inductive Ty\n| num : Ty\n| bool : Ty\nderiving Repr, DecidableEq" }, { "name": "While.WellTyped", "content": "inductive WellTyped : Expr β†’ Ty β†’ Prop\n| num : WellTyped (Expr.num _) Ty.num\n| bool : WellTyped (Expr.bool _) Ty.bool\n| add : βˆ€ e1 e2, WellTyped e1 ...
[ { "name": "While.WellTyped.unique", "content": "theorem WellTyped.unique : βˆ€ {e t1 t2}, WellTyped e t1 β†’ WellTyped e t2 β†’ t1 = t2" } ]
import Hoare.While.Syntax namespace While inductive Ty | num : Ty | bool : Ty deriving Repr, DecidableEq
theorem WellTyped.not_eq_not_eq_ty {e1 e2 : Expr} {t1 t2 : Ty} : WellTyped e1 t1 β†’ WellTyped e2 t2 β†’ t1 β‰  t2 β†’ βˆ€ t, Β¬ (WellTyped (Expr.eq e1 e2) t) :=
:= by intro h1 h2 h3 t h4 cases h4 Β· case eq t h1' h2' => have ht1 : t1 = t := WellTyped.unique h1 h1' have ht2 : t2 = t := WellTyped.unique h2 h2' rw [ht1, ht2] at h3 contradiction
2
6
false
Semantics
294
While.WellTyped.not_welltyped_not_eq_ty
theorem WellTyped.not_welltyped_not_eq_ty {e1 e2 : Expr} {t : Ty} : WellTyped e1 t β†’ Β¬ WellTyped e2 t β†’ βˆ€ t', Β¬ (WellTyped (Expr.eq e1 e2) t')
lean-hoare
Hoare/While/Types.lean
[ "import Hoare.While.Syntax" ]
[ { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "bool", "module": "Init.Control.Basic" } ]
[ { "name": "Expr", "content": "inductive Expr\n| num : Nat β†’ Expr\n| bool : Bool β†’ Expr\n| var : String β†’ Expr\n| add : Expr β†’ Expr β†’ Expr\n| sub : Expr β†’ Expr β†’ Expr\n| mul : Expr β†’ Expr β†’ Expr\n| eq : Expr β†’ Expr β†’ Expr\n| lt : Expr β†’ Expr β†’ Expr\n| gt : Expr β†’ Expr β†’ Expr\n| le : Expr β†’ Expr β†’ Expr\n| ge ...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[ { "name": "While.Ty", "content": "inductive Ty\n| num : Ty\n| bool : Ty\nderiving Repr, DecidableEq" }, { "name": "While.WellTyped", "content": "inductive WellTyped : Expr β†’ Ty β†’ Prop\n| num : WellTyped (Expr.num _) Ty.num\n| bool : WellTyped (Expr.bool _) Ty.bool\n| add : βˆ€ e1 e2, WellTyped e1 ...
[ { "name": "While.WellTyped.unique", "content": "theorem WellTyped.unique : βˆ€ {e t1 t2}, WellTyped e t1 β†’ WellTyped e t2 β†’ t1 = t2" } ]
import Hoare.While.Syntax namespace While inductive Ty | num : Ty | bool : Ty deriving Repr, DecidableEq
theorem WellTyped.not_welltyped_not_eq_ty {e1 e2 : Expr} {t : Ty} : WellTyped e1 t β†’ Β¬ WellTyped e2 t β†’ βˆ€ t', Β¬ (WellTyped (Expr.eq e1 e2) t') :=
:= by intro h1 h2 t' h3 cases h3 Β· case eq t' h1' h2' => have ht : t = t' := WellTyped.unique h1 h1' apply h2 rw [ht] exact h2'
2
6
false
Semantics
295
processOneElem_spec
omit [Fintype S] in lemma processOneElem_spec {st : worklist.St A S} (s : State) (sa : S) (k : β„•) : βˆ€ a sa', (f sa)[k]? = some (a, sa') β†’ processOneElem_mot inits final f s sa k st β†’ processOneElem_mot inits final f s sa (k+1) (processOneElem A S final s st (a, sa'))
lean-mlir
Blase/Blase/AutoStructs/Worklist.lean
[ "import Blase.Blase.AutoStructs.Basic", "import Blase.Blase.AutoStructs.ForLean", "import Blase.AutoStructs.Basic" ]
[ { "name": "Nat", "module": "Init.Prelude" }, { "name": "BEq", "module": "Init.Prelude" }, { "name": "DecidableEq", "module": "Init.Prelude" }, { "name": "FinEnum", "module": "Mathlib.Data.FinEnum" }, { "name": "Hashable", "module": "Init.Prelude" }, { ...
[ { "name": "RawCNFA.statesFinset", "content": "instance RawCNFA.statesFinset (m : RawCNFA A) : Fintype m.states := (Finset.range m.stateMax).fintypeCoeSort" }, { "name": "State", "content": "abbrev State := Nat" }, { "name": "RawCNFA.WF", "content": "structure RawCNFA.WF (m : RawCNFA ...
[ { "name": "Std.HashMap.getElem?_insert", "module": "Std.Data.HashMap.Lemmas" }, { "name": "getElem?_eq_none_iff", "module": "Init.GetElem" }, { "name": "Set.mem_setOf_eq", "module": "Mathlib.Data.Set.Operations" }, { "name": "true_and", "module": "Init.SimpLemmas" }, ...
[ { "name": "Std.HashMap.get?_none_not_mem", "content": "@[aesop 50% unsafe]\ntheorem Std.HashMap.get?_none_not_mem [BEq K] [LawfulBEq K] [Hashable K] [LawfulHashable K] {m : Std.HashMap K V} {k : K} : m.get? k = none β†’ k βˆ‰ m" }, { "name": "Std.HashMap.mem_of_getElem?", "content": "@[aesop 50% uns...
[ { "name": "nfa", "content": "def nfa : NFA A S where\n start := { sa | sa ∈ inits }\n accept := { sa | final sa }\n step sa a := { sa' | (a, sa') ∈ f sa }" }, { "name": "worklist.St", "content": "structure worklist.St where\n m : RawCNFA A\n map : Std.HashMap S State := βˆ…\n worklist : Arra...
[ { "name": "addOrCreate_preserves_map", "content": "omit [Fintype S] [LawfulBEq A] in\nlemma addOrCreate_preserves_map (st : worklist.St A S) (final? : Bool) (sa sa' : S) :\n let (_, st') := st.addOrCreateState _ _ final? sa'\n st.map[sa]? = some s β†’\n st'.map[sa]? = some s" }, { "name": "p...
import Blase.AutoStructs.Basic open SetRel section nfa variable {A : Type} [BEq A] [LawfulBEq A] [Hashable A] [DecidableEq A] [FinEnum A] variable {S : Type} [Fintype S] [BEq S] [LawfulBEq S] [Hashable S] [DecidableEq S] variable (inits : Array S) (final : S β†’ Bool) (f : S β†’ Array (A Γ— S)) def nfa : NFA A S where...
omit [Fintype S] in lemma processOneElem_spec {st : worklist.St A S} (s : State) (sa : S) (k : β„•) : βˆ€ a sa', (f sa)[k]? = some (a, sa') β†’ processOneElem_mot inits final f s sa k st β†’ processOneElem_mot inits final f s sa (k+1) (processOneElem A S final s st (a, sa')) :=
:= by intro a sa' hf ⟨hmap, hvisited, inv, hsim⟩ have hmem : βˆ€ s (sa : S), st.map[sa]? = some s β†’ s ∈ st.m.states := by intros; apply inv.map_states; assumption have hwf : st.m.WF := by apply inv.wf have inv' := processOneElem_inv inits final f s sa k a sa' hf ⟨hmap, hvisited, inv, hsim⟩ unfold processOneElem...
5
79
false
Compiler
296
formula_language_case_atom
lemma formula_language_case_atom : let Ο† := Formula.atom rel t1 t2 Ο†.language = Ξ» (bvs : BitVecs Ο†.arity) => Ο†.sat (fun k => bvs.bvs.get k)
lean-mlir
Blase/Blase/AutoStructs/Defs.lean
[ "import Blase.SingleWidth.Defs", "import Blase.Blase.AutoStructs.ForMathlib", "import Blase.AutoStructs.ForMathlib" ]
[ { "name": "Fin", "module": "Init.Prelude" }, { "name": "Fin.last", "module": "Init.Data.Fin.Basic" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "Fin.castLE", "module": "Init.Data.Fin.Basic" }, { "name": "BitVec", "module": "Init.Prelude" }, { ...
[ { "name": "syntax \"max\" : MLIR.Pretty.uniform_op", "content": "syntax \"max\" : MLIR.Pretty.uniform_op" }, { "name": "macro_rules", "content": "macro_rules\n | `(mlir_op| $res:mlir_op_operand = const ($x)\n $[: $outer_type]? ) => do\n let outer_type ← outer_type.getDM `(mlir_type| _...
[ { "name": "Nat.add_comm", "module": "Init.Data.Nat.Basic" }, { "name": "Fin.val_last", "module": "Init.Data.Fin.Lemmas" }, { "name": "Nat.mod_eq_of_lt", "module": "Init.Data.Nat.Div.Basic" }, { "name": "Set.mem_setOf_eq", "module": "Mathlib.Data.Set.Operations" }, { ...
[ { "name": "List.Vector.append_get_ge", "content": "@[simp]\nlemma List.Vector.append_get_ge {x : List.Vector Ξ± n} {y : List.Vector Ξ± m} {i : Fin (n+m)} (hlt: n ≀ i) :\n (x ++ y).get i = y.get ((i.cast (Nat.add_comm n m) |>.subNat n hlt))" }, { "name": "List.Vector.append_get_lt", "content": "...
[ { "name": "liftMaxSucc1", "content": "def liftMaxSucc1 (n m : Nat) : Fin (n + 1) β†’ Fin (max n m + 2) :=\n fun k => if _ : k = n then Fin.last (max n m) else k.castLE (by admit /- proof elided -/\n )" }, { "name": "liftMaxSucc2", "content": "def liftMaxSucc2 (n m : Nat) : Fin (m + 1) β†’ Fin (max...
[ { "name": "evalFin_eq", "content": "lemma evalFin_eq {t : Term} {vars1 : Fin t.arity β†’ BitVec w1} {vars2 : Fin t.arity β†’ BitVec w2} :\n βˆ€ (heq : w1 = w2),\n (βˆ€ n, vars1 n = heq β–Έ vars2 n) β†’\n t.evalFinBV vars1 = heq β–Έ t.evalFinBV vars2" }, { "name": "evalRelation_coe", "content": "@[sim...
import Blase.AutoStructs.ForMathlib import Blase.SingleWidth.Defs open Fin.NatCast def liftMaxSucc1 (n m : Nat) : Fin (n + 1) β†’ Fin (max n m + 2) := fun k => if _ : k = n then Fin.last (max n m) else k.castLE (by admit /- proof elided -/ ) def liftMaxSucc2 (n m : Nat) : Fin (m + 1) β†’ Fin (max n m + 2) := fun ...
lemma formula_language_case_atom : let Ο† :=
:= Formula.atom rel t1 t2 Ο†.language = Ξ» (bvs : BitVecs Ο†.arity) => Ο†.sat (fun k => bvs.bvs.get k) := by unfold Formula.language rintro Ο† let n := Ο†.arity unfold Ο† dsimp (config := { zeta := false }) lift_lets intros l1 l2 lrel l ext bvs constructor Β· intros h; simp at h obtain ⟨bvsb, h, heq...
5
73
false
Compiler
297
TermBinop.alt_lang
lemma TermBinop.alt_lang {t₁ tβ‚‚ : Term} (op : TermBinop) : (op.subst_arity' β–Έ (op.subst t₁ tβ‚‚).language) = let lop : Set (BitVecs 3) := op.openTerm_arity β–Έ op.openTerm.language let lop' : Set (BitVecs ((t₁.arity βŠ” tβ‚‚.arity) + 3)) := lop.lift (liftLast3 (max t₁.arity tβ‚‚.arity)) let l₁ := t₁.language.lift (...
lean-mlir
Blase/Blase/AutoStructs/FormulaToAuto.lean
[ "import Blase.SingleWidth.Defs", "import Blase.AutoStructs.Constructions", "import Blase.Blase.Fast.BitStream", "import Mathlib.Data.Nat.Size -- TODO: remove and get rid of shiftLeft_eq_mul_pow use", "import Blase.Blase.AutoStructs.ForMathlib", "import Blase.AutoStructs.Defs", "import Mathlib.Tactic.Fin...
[ { "name": "Inhabited", "module": "Init.Prelude" }, { "name": "Lean.ToExpr", "module": "Lean.ToExpr" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "Repr", "module": "Init.Data.Repr" }, { "name": "Bool", "module": "Init.Prelude" }, { "name": ...
[ { "name": "syntax \"xor\" : MLIR.Pretty.uniform_op", "content": "syntax \"xor\" : MLIR.Pretty.uniform_op\n\nsyntax \"max\" : MLIR.Pretty.uniform_op" }, { "name": "macro_rules", "content": "macro_rules\n | `(mlir_op| $res:mlir_op_operand = const ($x)\n $[: $outer_type]? ) => do\n let o...
[ { "name": "Nat.add_comm", "module": "Init.Data.Nat.Basic" }, { "name": "Fin.add_def", "module": "Init.Data.Fin.Lemmas" }, { "name": "Fin.castLE_castLE", "module": "Init.Data.Fin.Lemmas" }, { "name": "Nat.le_of_eq", "module": "Init.Data.Nat.Basic" }, { "name": "Nat...
[ { "name": "List.Vector.append_get_ge", "content": "@[simp]\nlemma List.Vector.append_get_ge {x : List.Vector Ξ± n} {y : List.Vector Ξ± m} {i : Fin (n+m)} (hlt: n ≀ i) :\n (x ++ y).get i = y.get ((i.cast (Nat.add_comm n m) |>.subNat n hlt))" }, { "name": "List.Vector.append_get_lt", "content": "...
[ { "name": "liftOp", "content": "def liftOp n : Fin (n + 1) β†’ Fin (n + 3) :=\n fun k =>\n if k = n then Fin.last (n+2) else k.castLE (by admit /- proof elided -/\n )" }, { "name": "liftOp_unchanged", "content": "@[simp]\ndef liftOp_unchanged (k : Fin n) : liftOp n k.castSucc = k.castLE (by...
[ { "name": "TermBinop.subst_arity'", "content": "lemma TermBinop.subst_arity' {op : TermBinop} : (op.subst t₁ tβ‚‚).arity + 1= t₁.arity βŠ” tβ‚‚.arity + 1" }, { "name": "BitVecs.cast_eq", "content": "@[simp]\nlemma BitVecs.cast_eq (x : BitVecs n) (h : n = n') : h β–Έ x = x.cast h" } ]
import Batteries.Data.Fin.Basic import Batteries.Data.Fin.Lemmas import Blase.SingleWidth.Defs import Blase.AutoStructs.Constructions import Blase.AutoStructs.Defs import Blase.AutoStructs.FiniteStateMachine import Mathlib.Tactic.Ring import Mathlib.Data.Nat.Size -- TODO: remove and get rid of shiftLeft_eq_mul_p...
lemma TermBinop.alt_lang {t₁ tβ‚‚ : Term} (op : TermBinop) : (op.subst_arity' β–Έ (op.subst t₁ tβ‚‚).language) = let lop : Set (BitVecs 3) :=
:= op.openTerm_arity β–Έ op.openTerm.language let lop' : Set (BitVecs ((t₁.arity βŠ” tβ‚‚.arity) + 3)) := lop.lift (liftLast3 (max t₁.arity tβ‚‚.arity)) let l₁ := t₁.language.lift (liftMaxSuccSucc1 t₁.arity tβ‚‚.arity) let lβ‚‚ := tβ‚‚.language.lift (liftMaxSuccSucc2 t₁.arity tβ‚‚.arity) let l := l₁ ∩ lβ‚‚ ∩ lop' l.p...
4
57
false
Compiler
298
Predicate.eval_eq_denote
theorem Predicate.eval_eq_denote (w : Nat) (p : Predicate) (vars : List (BitVec w)) : (p.eval (vars.map .ofBitVecSext) w = false) ↔ p.denote w vars
lean-mlir
Blase/Blase/Fast/Defs.lean
[ "import Blase.SingleWidth.Defs", "import Mathlib.Data.Fin.Basic", "import Mathlib.Data.Bool.Basic", "import Blase.Fast.BitStream", "import Blase.Blase.Fast.BitStream" ]
[ { "name": "Bool", "module": "Init.Prelude" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "Int.xor", "module": "Mathlib.Data.Int.Bitwise" }, { "name": "List", "module": "Init.Prelude" }, { "name": "Nat.testBit", "module": "Init.Data.Nat.Bitwise.Basi...
[ { "name": "syntax \"slt\" : MLIR.Pretty.uniform_op", "content": "syntax \"slt\" : MLIR.Pretty.uniform_op" }, { "name": "macro_rules", "content": "macro_rules\n | `(mlir_op| $res:mlir_op_operand = const ($x)\n $[: $outer_type]? ) => do\n let outer_type ← outer_type.getDM `(mlir_type| _...
[ { "name": "BitVec.lt_def", "module": "Init.Data.BitVec.Lemmas" }, { "name": "BitVec.of_length_zero", "module": "Init.Data.BitVec.Lemmas" }, { "name": "BitVec.ult_eq_not_carry", "module": "Init.Data.BitVec.Bitblast" }, { "name": "BitVec.eq_of_getLsbD_eq", "module": "Init.D...
[ { "name": "subAux_eq_BitVec_carry", "content": "@[simp] theorem subAux_eq_BitVec_carry (a b : BitStream) (w i : Nat) (hi : i < w) :\n (a.subAux b i).2 = !(BitVec.carry (i + 1) (a.toBitVec w) ((~~~b).toBitVec w) true)" }, { "name": "scanOr_true_iff", "content": "theorem scanOr_true_iff (s : Bi...
[ { "name": "Term.eval", "content": "def Term.eval (t : Term) (vars : List BitStream) : BitStream :=\n match t with\n | var n => vars.getD n default\n | zero => BitStream.zero\n | one => BitStream.one\n | negOne => BitStream.negOne\n | ofNat n => BitStream.ofNat n\n | and ...
[ { "name": "Term.eval_eq_denote", "content": "@[simp] theorem Term.eval_eq_denote (t : Term) (w : Nat) (vars : List (BitVec w)) :\n (t.eval (vars.map BitStream.ofBitVecSext)).toBitVec w = t.denote w vars" }, { "name": "Term.eval_eq_denote_apply", "content": "theorem Term.eval_eq_denote_apply (...
import Mathlib.Data.Bool.Basic import Mathlib.Data.Fin.Basic import Blase.Fast.BitStream import Blase.SingleWidth.Defs open Term open BitStream in def Term.eval (t : Term) (vars : List BitStream) : BitStream := match t with | var n => vars.getD n default | zero => BitStream.zero | one ...
theorem Predicate.eval_eq_denote (w : Nat) (p : Predicate) (vars : List (BitVec w)) : (p.eval (vars.map .ofBitVecSext) w = false) ↔ p.denote w vars :=
:= by induction p generalizing vars w case width wp n => cases wp <;> simp [eval, denote] case binary p a b => cases p with | eq => simp [eval, denote]; apply evalEq_denote_false_iff | neq => simp [eval, denote]; apply evalNeq_denote | ult => simp [eval, denote] rw [BitVec.ult_notation...
9
96
false
Compiler
299
eq_true_iff_of_eq_false_iff
theorem eq_true_iff_of_eq_false_iff (b : Bool) (rhs : Prop) (h : (b = false) ↔ rhs) : (b = true) ↔ Β¬ rhs
lean-mlir
Blase/Blase/Fast/Defs.lean
[ "import Blase.SingleWidth.Defs", "import Mathlib.Data.Fin.Basic", "import Blase.Fast.BitStream", "import Mathlib.Data.Bool.Basic" ]
[ { "name": "Bool", "module": "Init.Prelude" } ]
[ { "name": "Term", "content": "inductive Term : Type\n| var : Nat β†’ Term\n \n| zero : Term\n \n| negOne : Term\n \n| one : Term\n \n| ofNat (n : Nat) : Term\n \n| and : Term β†’ Term β†’ Term\n \n| or : Term β†’ Term β†’ Term\n \n| xor : Term β†’ Term β†’ Term\n \n| not : Term β†’ Term\n \n| add : Term β†’ Term β†’ Term\n \n|...
[ { "name": "...", "module": "" } ]
[ { "name": "List.getElem_append_left{Ξ±", "content": "theorem List.getElem_append_left{Ξ± : Type u_1} {l₁ lβ‚‚ : List Ξ±} {i : Nat} (hn : i < l₁.length) :\\n(l₁ ++ lβ‚‚)[i] = l₁[i]" } ]
[]
[]
import Mathlib.Data.Bool.Basic import Mathlib.Data.Fin.Basic import Blase.Fast.BitStream import Blase.SingleWidth.Defs open Term open BitStream in open BitStream in section Predicate end Predicate
theorem eq_true_iff_of_eq_false_iff (b : Bool) (rhs : Prop) (h : (b = false) ↔ rhs) : (b = true) ↔ Β¬ rhs :=
:= by constructor Β· intros h' apply h.not.mp simp [h'] Β· intros h' by_contra hcontra simp at hcontra have := h.mp hcontra exact h' this
1
2
false
Compiler
300
ReflectVerif.BvDecide.KInductionCircuits.FSM.carryWith_congrEnv_envBitstream_set_of_le
theorem FSM.carryWith_congrEnv_envBitstream_set_of_le (fsm : FSM arity) (s0 : fsm.Ξ± β†’ Bool) (env : arity β†’ BitStream) (n : Nat) (v : arity β†’ Bool) (k : Nat) (hk : k ≀ n) : fsm.carryWith s0 (envBitstream_set env n v) k = fsm.carryWith s0 env k
lean-mlir
Blase/Blase/KInduction/KInduction.lean
[ "import Blase.Fast.Defs", "import Blase.Vars", "import Blase.Fast.ForLean", "import Lean.Meta.ForEachExpr", "import Mathlib.Data.Bool.Basic", "import Mathlib.Data.Finset.Defs", "import Blase.Fast.FiniteStateMachine", "import Blase.SingleWidth.Syntax", "import Lean.Meta.Tactic.Simp.BuiltinSimprocs.Bi...
[ { "name": "Bool", "module": "Init.Prelude" }, { "name": "Nat", "module": "Init.Prelude" }, { "name": "Vector", "module": "Init.Data.Vector.Basic" }, { "name": "Fin", "module": "Init.Prelude" }, { "name": "String", "module": "Init.Prelude" }, { "name": ...
[ { "name": "syntax \"llvm.and\" : MLIR.Pretty.uniform_op", "content": "syntax \"llvm.and\" : MLIR.Pretty.uniform_op\n\nsyntax \"llvm.ashr\" : MLIR.Pretty.exact_op\n\nsyntax \"llvm.add\" : MLIR.Pretty.overflow_op\n\nsyntax \"llvm.return\" : MLIR.Pretty.uniform_op\n\nsyntax \"return\" : MLIR.Pr...
[ { "name": "...", "module": "" } ]
[ { "name": "carryWith_congrEnv", "content": "theorem carryWith_congrEnv {p : FSM arity}\n {carryState : p.Ξ± β†’ Bool} {x y : arity β†’ BitStream} {n : Nat}\n (h : βˆ€ a i, i < n β†’ x a i = y a i) :\n p.carryWith carryState x n = p.carryWith carryState y n" }, { "name": "carry_congrEnv", "conten...
[ { "name": "ReflectVerif.BvDecide.KInductionCircuits", "content": "structure KInductionCircuits {arity : Type _}\n [DecidableEq arity] [Fintype arity] [Hashable arity] (fsm : FSM arity) (n : Nat) where\n \n cInitCarryAssignCirc : Circuit (Vars fsm.Ξ± arity 0)\n \n cSuccCarryAssignCirc : Circuit (Vars fsm...
[]
import Mathlib.Data.Bool.Basic import Mathlib.Data.Fin.Basic import Mathlib.Data.Finset.Basic import Mathlib.Data.Finset.Defs import Mathlib.Data.Multiset.FinsetOps import Blase.Fast.BitStream import Blase.Fast.Defs import Blase.Fast.FiniteStateMachine import Blase.Fast.Decide import Blase.SingleWidth.Syntax ...
theorem FSM.carryWith_congrEnv_envBitstream_set_of_le (fsm : FSM arity) (s0 : fsm.Ξ± β†’ Bool) (env : arity β†’ BitStream) (n : Nat) (v : arity β†’ Bool) (k : Nat) (hk : k ≀ n) : fsm.carryWith s0 (envBitstream_set env n v) k = fsm.carryWith s0 env k :=
:= by apply FSM.carryWith_congrEnv intros a l hl simp [envBitstream_set] intros hcontra; omega
5
33
false
Compiler