Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d20a0be
remove OFE on GName
markusdemedeiros Sep 13, 2025
d8a303b
simplify iProp
markusdemedeiros Sep 15, 2025
902ca1a
checkpoint
markusdemedeiros Sep 15, 2025
0d02c10
checkpoint
markusdemedeiros Sep 20, 2025
83e3e88
checkpoint
markusdemedeiros Sep 20, 2025
8aaf66f
checkpoint: what do to?
markusdemedeiros Sep 24, 2025
71e4004
upload
markusdemedeiros Sep 25, 2025
7b9bd1c
checkpoint
markusdemedeiros Sep 28, 2025
f2d696b
problem
markusdemedeiros Sep 28, 2025
a7d23a6
checkpoint
markusdemedeiros Oct 3, 2025
abcf1c8
update lemma
markusdemedeiros Oct 4, 2025
7e507d1
iOwn lemmas (mod casts)
markusdemedeiros Oct 4, 2025
b758480
GenMap CMRA
markusdemedeiros Oct 6, 2025
74f8d29
change to use GenMap OF
markusdemedeiros Oct 10, 2025
6028e72
finish GenMap OFunctor
markusdemedeiros Oct 10, 2025
a041597
sketching iOwn updates
markusdemedeiros Oct 10, 2025
007c593
some examples
markusdemedeiros Oct 10, 2025
d3f937c
iProp double allocation example
markusdemedeiros Oct 10, 2025
7cd4e95
nit
markusdemedeiros Oct 10, 2025
fb0fd70
checkpoint
markusdemedeiros Oct 12, 2025
162f561
checkpoint
markusdemedeiros Oct 12, 2025
c02d40a
checkpoint
markusdemedeiros Oct 13, 2025
db45a9c
more iOwn lemmas
markusdemedeiros Oct 19, 2025
d10fca4
Progress
lzy0505 Oct 28, 2025
17884b1
Remove redundant dead code
markusdemedeiros Oct 29, 2025
96226b6
checkpoint
markusdemedeiros Oct 29, 2025
1ca2700
Remove redundant ElemG lemmas
markusdemedeiros Oct 29, 2025
80ded5b
iSingleton
markusdemedeiros Oct 29, 2025
4bf2735
integrate refactorings
markusdemedeiros Oct 29, 2025
f749deb
cleanup
markusdemedeiros Oct 31, 2025
08c5d2b
basic pass
markusdemedeiros Oct 31, 2025
7852af8
checkpoint
markusdemedeiros Oct 31, 2025
3cd5f8c
sorry-free
markusdemedeiros Nov 23, 2025
ba1f540
Merge branch 'master' into zl/rfunctors
markusdemedeiros Dec 8, 2025
4dea134
Refactored proofs of [iOwn_updateP] and [iOwn_unit].
Remyjck Dec 16, 2025
8bac887
Typos
Remyjck Jan 15, 2026
f18c44f
Remove unused helper lemmas
Remyjck Jan 16, 2026
2442d5b
Fix small break
Remyjck Jan 17, 2026
733c8b4
Merge branch 'master' into remy-iprop
markusdemedeiros Jan 17, 2026
1892e3a
naming fixes
markusdemedeiros Jan 17, 2026
b67a383
more names
markusdemedeiros Jan 17, 2026
4e1ee3f
namespaces pass
markusdemedeiros Jan 17, 2026
d65cc3b
chore: pass over GenMap
markusdemedeiros Jan 17, 2026
5035709
chore: more minor refactorings
markusdemedeiros Jan 17, 2026
2a36098
Merge branch 'master' into rfunctors_cleanup
markusdemedeiros Jan 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Iris/Algebra.lean
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import Iris.Algebra.Agree
import Iris.Algebra.CMRA
import Iris.Algebra.COFESolver
import Iris.Algebra.OFE
import Iris.Algebra.DFrac
import Iris.Algebra.Excl
import Iris.Algebra.Frac
import Iris.Algebra.GenMap
import Iris.Algebra.LocalUpdates
import Iris.Algebra.IProp
import Iris.Algebra.OFE
import Iris.Algebra.Updates
import Iris.Algebra.UPred
import Iris.Algebra.Heap
45 changes: 14 additions & 31 deletions src/Iris/Algebra/CMRA.lean
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ class UCMRA (α : Type _) extends CMRA α where
unit_left_id : unit • x ≡ x
pcore_unit : pcore unit ≡ some unit

class IsUnit [CMRA α] (ε : α) : Prop where
unit_valid : ✓ ε
unit_left_id : ε • x ≡ x
pcore_unit : CMRA.pcore ε ≡ some ε

instance [UCMRA α] : IsUnit (UCMRA.unit : α) where
unit_valid := UCMRA.unit_valid
unit_left_id := UCMRA.unit_left_id
pcore_unit := UCMRA.pcore_unit

namespace CMRA
variable [CMRA α]

Expand Down Expand Up @@ -876,9 +886,6 @@ class RFunctorContractive (F : COFE.OFunctorPre) extends (RFunctor F) where
map_contractive [OFE α₁] [OFE α₂] [OFE β₁] [OFE β₂] :
Contractive (Function.uncurry (@map α₁ α₂ β₁ β₂ _ _ _ _))

variable (F T) in
def RFunctor.ap [RFunctor F] [OFE T] := F T T

attribute [instance] RFunctor.cmra


Expand Down Expand Up @@ -1034,16 +1041,16 @@ instance cmraOption : CMRA (Option α) where
rename_i x
rcases x1, x2, x with ⟨_|_, _|_, _|_⟩ <;> simp_all [op_right_dist]
pcore_ne {n} x y cx H := by
simp only [some.injEq]; rintro rfl
rcases x, y with ⟨_|x, _|y⟩ <;> simp_all [Dist, Forall₂]
simp only [Option.some.injEq]; rintro rfl
rcases x, y with ⟨_|x, _|y⟩ <;> simp_all [Dist, Option.Forall₂]
cases Hv : pcore x <;> cases Hv' : pcore y <;> simp only []
· cases pcore_ne H.symm Hv'; simp_all
· cases pcore_ne H Hv; simp_all
· obtain ⟨w, Hw1, Hw2⟩ := pcore_ne H.symm Hv'
cases Hv.symm.trans Hw1
exact Hw2.symm
validN_ne {n} x y H := by
rcases x, y with ⟨_|_, _|_⟩ <;> simp_all [Dist, Forall₂]
rcases x, y with ⟨_|_, _|_⟩ <;> simp_all [Dist, Option.Forall₂]
exact Dist.validN H |>.mp
valid_iff_validN {x} := by
rcases x with ⟨_|_⟩ <;> simp [valid_iff_validN]
Expand All @@ -1059,7 +1066,7 @@ instance cmraOption : CMRA (Option α) where
pcore_op_left {x cx} := by
rcases x, cx with ⟨_|_, _|_⟩ <;> simp_all [pcore_op_left]
pcore_idem := by
rintro (_|x) <;> simp [Equiv, Forall₂]
rintro (_|x) <;> simp [Equiv, Option.Forall₂]
rcases H : pcore x with _|y <;> simp
obtain ⟨z, Hz1, Hz2⟩ := equiv_some (pcore_idem H)
simp [Hz1, Hz2]
Expand Down Expand Up @@ -1395,27 +1402,3 @@ instance urFunctorContractiveOptionOF
map_contractive.1 := COFE.OFunctorContractive.map_contractive.1

end optionOF

section GenMap

/-
The OFE over gmaps is eqivalent to a non-depdenent discrete function to an `Option` type with a
`Leibniz` OFE.
In this setting, the CMRA is always unital, and as a consquence the oFunctors do not require
unitality in order to act as a `URFunctor(Contractive)`.
-/

variable (α β : Type _) [UCMRA β] [Leibniz β]

abbrev GenMap := α → Option β

-- #synth CMRA (Option β)
-- #synth CMRA (α -d> (Option β))
-- #synth UCMRA (α -d> (Option β))
-- The synthesized UMRA here has unit (fun x => ε) = (fun x => none).
-- For us, this is equivalent to the Rocq-iris unit ∅.

abbrev GenMapOF (C : Type _) (F : COFE.OFunctorPre) :=
DiscreteFunOF fun (_ : C) => OptionOF F

end GenMap
Loading