Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1e36968
Towards parametrised step-indexing in `OFE.lean`, add `SIdx` instance…
alvinylt Jul 28, 2026
9e9cd3a
Remove redundant change
alvinylt Jul 28, 2026
acbccb8
Update proofs in `OFE.lean`
alvinylt Jul 29, 2026
3d88a76
More proof updates in `OFE.lean`
alvinylt Jul 29, 2026
ee7e8cf
Update proof of `isCOFE_later`
alvinylt Jul 29, 2026
f5e71e5
Update proof for `DiscreteO.dist_inj`
alvinylt Jul 29, 2026
2feacf2
Update proofs that involve `letI`/`haveI`
alvinylt Jul 29, 2026
f59dcf0
Two more minor proof updates
alvinylt Jul 29, 2026
a6baad5
Port `bchain` as `BChain`
alvinylt Jul 29, 2026
d5ae9fd
Extend `IsCOFE` with bounded completion fields, proofs of `IsCOFE` in…
alvinylt Jul 29, 2026
858fb80
Port `bcompl`-related theorems, proofs not complete
alvinylt Jul 29, 2026
3efce59
Introduce `BFChain` definitions with `sorry` for proofs
alvinylt Jul 29, 2026
b7565a9
Fix `StepIndexFinite.lean`: `Nat`-specific formulations of `Dist.le` …
alvinylt Jul 29, 2026
a952ca9
`CMRA.lean`: `CMRA α` extends `OFE Nat α`
alvinylt Jul 29, 2026
15ac195
`COFESolver.lean`: `OFE Nat ...`, some proofs with `sorry`
alvinylt Jul 29, 2026
04cc2c7
Replace `OFE ...` with `OFE Nat ...`, `COFE ...` with `COFE Nat ...`,…
alvinylt Jul 29, 2026
54400ee
Merge remote-tracking branch 'upstream/master' into StepIndexOFE
alvinylt Jul 30, 2026
fd1b341
Update `limitPreserving_emp_valid`
alvinylt Aug 1, 2026
86d0e37
Update `Algebra/Lib/UFracAuth.lean` and `Algebra/Functions.lean`
alvinylt Aug 2, 2026
cb0943e
Fill in proofs for the new `IsCOFE` fields
alvinylt Aug 2, 2026
b9b3587
Fill in the proofs for the extra `IsCOFE` fields, trivial at the mome…
alvinylt Aug 2, 2026
60aa4f3
`sigT_cofe`: proofs for extra `IsCOFE` fields with helper lemmas
alvinylt Aug 2, 2026
29f4eba
Complete `LimitPreserving` proofs
alvinylt Aug 2, 2026
57efae6
Complete proofs in section `Fixpoint`
alvinylt Aug 2, 2026
6314a22
Proof formatting in `OFE.lean`
alvinylt Aug 3, 2026
8161923
Clean up unnecessary `local instance` declarations
alvinylt Aug 3, 2026
f99f9ae
Switch of `LimitPreserving` back to a type class
alvinylt Aug 3, 2026
ddf2c83
Remove duplicate `[SIdx SI]` assumption
alvinylt Aug 3, 2026
f2f5287
Update `IrisMath/MeasureTheory.lean`
alvinylt Aug 3, 2026
6109995
Add missing `rocq_alias` annotations, remove duplicate instance
alvinylt Aug 3, 2026
366c6bf
`ProdOF` and `SumOF`: `SI` as an implicit parameter
alvinylt Aug 3, 2026
e370972
Remove redundant `rocq_alias` entry
alvinylt Aug 3, 2026
b41c97c
chore: minor cleanup in GhostMap and StepIndexFinite
markusdemedeiros Aug 3, 2026
da2bfba
cleanup OFE
markusdemedeiros Aug 3, 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
18 changes: 9 additions & 9 deletions Iris/Iris/Algebra/Agree.lean
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ theorem map'_sameElems {f : α → β} {x y : Raw α} (h : SameElems x y) :
obtain ⟨b, hb, rfl⟩ := ha
exact ⟨b, by first | exact h.1 _ hb | exact h.2 _ hb, rfl⟩

variable [OFE α]
variable [OFE Nat α]

def dist (n : Nat) (x y : Raw α) : Prop :=
(∀ a ∈ x.car, ∃ b ∈ y.car, a ≡{n}≡ b) ∧
Expand Down Expand Up @@ -227,7 +227,7 @@ theorem toAgree_uninj {x : Raw α} : x.valid → ∃ a, ∀ n, dist n (toAgree a
· exists a; simp_all [toAgree]
· simp_all [toAgree]

variable [OFE β] {f : α → β}
variable [OFE Nat β] {f : α → β}

theorem map'_ne [OFE.NonExpansive f] {x₁ x₂ : Raw α} (h : dist n x₁ x₂) :
dist n (map' f x₁) (map' f x₂) := by
Expand Down Expand Up @@ -347,14 +347,14 @@ end Agree

namespace Agree

variable [OFE α] [OFE β]
variable [OFE Nat α] [OFE Nat β]

@[rocq_alias agree_dist]
def dist (n : Nat) : Agree α → Agree α → Prop :=
lift₂ (Raw.dist n) (fun _ _ _ _ hac hbd => propext (Raw.dist_congr hac hbd))

@[rocq_alias agree_ofe_mixin]
instance instOFE : OFE (Agree α) where
instance instOFE : OFE Nat (Agree α) where
Dist := dist
dist_eqv := by
refine ⟨Quotient.ind fun a => Raw.dist_equiv.refl a, fun {x y} h => ?_, fun {x y z} h₁ h₂ => ?_⟩
Expand Down Expand Up @@ -524,7 +524,7 @@ theorem toAgree_def {a : α} : toAgree a = Agree.mk (Agree.Raw.toAgree a) := rfl

section

variable [OFE α]
variable [OFE Nat α]

@[rocq_alias to_agree_ne]
instance instNonExpansive_toAgree : OFE.NonExpansive (@toAgree α) where
Expand Down Expand Up @@ -640,7 +640,7 @@ theorem Agree.map'_compose {f : α → β} {g : β → γ} (x : Agree α) :
Agree.map' (g ∘ f) x = Agree.map' g (Agree.map' f x) :=
x.ind fun _ => congrArg mk (Raw.ext (by simp [Raw.map'_car, List.map_map]))

variable {α β γ : Type _} [OFE α] [OFE β] [OFE γ] {f : α → β} [hne : OFE.NonExpansive f]
variable {α β γ : Type _} [OFE Nat α] [OFE Nat β] [OFE Nat γ] {f : α → β} [hne : OFE.NonExpansive f]

@[rocq_alias agree_map_ne]
instance instNonExpansive_AgreeMap' : OFE.NonExpansive (Agree.map' f) where
Expand Down Expand Up @@ -694,10 +694,10 @@ end agree_map
section agree_rfunctor

@[rocq_alias agreeRF]
abbrev AgreeRF (F : COFE.OFunctorPre) : COFE.OFunctorPre :=
abbrev AgreeRF (F : COFE.OFunctorPre Nat) : COFE.OFunctorPre Nat :=
fun A B _ _ => Agree (F A B)

instance {F} [COFE.OFunctor F] : RFunctor (AgreeRF F) where
instance {F} [COFE.OFunctor Nat F] : RFunctor (AgreeRF F) where
map f g := Agree.map (COFE.OFunctor.map f g)
map_ne.ne _ _ _ Hx _ _ Hy _ := Agree.map_ne <| COFE.OFunctor.map_ne.ne Hx Hy
map_id x := by
Expand All @@ -708,7 +708,7 @@ instance {F} [COFE.OFunctor F] : RFunctor (AgreeRF F) where
exact Agree.agree_map_ext (fun a => COFE.OFunctor.map_comp f g f' g' a)

@[rocq_alias agreeRF_contractive]
instance {F} [COFE.OFunctorContractive F] : RFunctorContractive (AgreeRF F) where
instance {F} [COFE.OFunctorContractive Nat F] : RFunctorContractive (AgreeRF F) where
map_contractive.1 H _ := Agree.map_ne (COFE.OFunctorContractive.map_contractive.1 H)

end agree_rfunctor
14 changes: 7 additions & 7 deletions Iris/Iris/Algebra/Auth.lean
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ abbrev Auth (A : Type _) [UCMRA A] :=
namespace Auth
variable [UCMRA A]

instance : OFE (Auth A) := View.instOFE
instance : OFE Nat (Auth A) := View.instOFE
instance : CMRA (Auth A) := View.instCMRA
instance : UCMRA (Auth A) := View.instUCMRA

Expand Down Expand Up @@ -464,10 +464,10 @@ theorem authViewRel_map [UCMRA A'] [UCMRA B'] (g : A' -C> B') (n : Nat) (a : A')
fun ⟨hinc, hv⟩ => ⟨CMRA.Hom.monoN g n hinc, CMRA.Hom.validN g hv⟩

@[rocq_alias authURF]
abbrev AuthURF (T : COFE.OFunctorPre) [URFunctor T] : COFE.OFunctorPre :=
abbrev AuthURF (T : COFE.OFunctorPre Nat) [URFunctor T] : COFE.OFunctorPre Nat :=
fun A B _ _ => Auth (T A B)

instance instURFunctorAuthURF {T : COFE.OFunctorPre} [URFunctor T] :
instance instURFunctorAuthURF {T : COFE.OFunctorPre Nat} [URFunctor T] :
URFunctor (AuthURF T) where
map {A A'} {B B'} _ _ _ _ f g :=
mapC
Expand All @@ -487,16 +487,16 @@ instance instURFunctorAuthURF {T : COFE.OFunctorPre} [URFunctor T] :
(congrArg (View.map _ _ · _) (funext fun _ => URFunctor.map_comp f g f' g' _))

@[rocq_alias authURF_contractive]
instance instURFunctorContractiveAuthURF {T : COFE.OFunctorPre} [URFunctorContractive T] :
instance instURFunctorContractiveAuthURF {T : COFE.OFunctorPre Nat} [URFunctorContractive T] :
URFunctorContractive (AuthURF T) where
map_contractive.1 h x := by
apply map_ne <;> apply URFunctorContractive.map_contractive.1 h

@[rocq_alias authRF]
abbrev AuthRF (T : COFE.OFunctorPre) [URFunctor T] : COFE.OFunctorPre :=
abbrev AuthRF (T : COFE.OFunctorPre Nat) [URFunctor T] : COFE.OFunctorPre Nat :=
fun A B _ _ => Auth (T A B)

instance instRFunctorAuthRF {T : COFE.OFunctorPre} [URFunctor T] :
instance instRFunctorAuthRF {T : COFE.OFunctorPre Nat} [URFunctor T] :
RFunctor (AuthRF T) where
map {A A'} {B B'} _ _ _ _ f g :=
mapC
Expand All @@ -516,7 +516,7 @@ instance instRFunctorAuthRF {T : COFE.OFunctorPre} [URFunctor T] :
(congrArg (View.map _ _ · _) (funext fun _ => URFunctor.map_comp f g f' g' _))

@[rocq_alias authRF_contractive]
instance instRFunctorContractiveAuthRF {T : COFE.OFunctorPre} [URFunctorContractive T] :
instance instRFunctorContractiveAuthRF {T : COFE.OFunctorPre Nat} [URFunctorContractive T] :
RFunctorContractive (AuthRF T) where
map_contractive.1 h x := by
apply View.map_ne <;> apply URFunctorContractive.map_contractive.1 h
Expand Down
30 changes: 15 additions & 15 deletions Iris/Iris/Algebra/BigOp.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ These are parameterized by a monoid operation and include theorems about their p

open OFE Iris.Std

@[rocq_alias big_opL, expose] public def bigOpL {M : Type u} {A : Type v} [OFE M] (op : M → M → M) {unit : M} [MonoidOps op unit]
@[rocq_alias big_opL, expose] public def bigOpL {M : Type u} {A : Type v} [OFE Nat M] (op : M → M → M) {unit : M} [MonoidOps op unit]
(Φ : Nat → A → M) (l : List A) : M :=
match l with
| [] => unit
| x :: xs => op (Φ 0 x) (bigOpL op (fun n => Φ (n + 1)) xs)

@[rocq_alias big_opM, expose] public def bigOpM {M : Type u} [OFE M] (op : M → M → M) {unit : M} [MonoidOps op unit] {K : Type _}
@[rocq_alias big_opM, expose] public def bigOpM {M : Type u} [OFE Nat M] (op : M → M → M) {unit : M} [MonoidOps op unit] {K : Type _}
{V : Type _} (Φ : K → V → M) {M' : Type _ → Type _} [LawfulFiniteMap M' K] (m : M' V) : M :=
bigOpL op (fun _ kv => Φ kv.1 kv.2) (toList m)

#rocq_ignore big_opM_aux "Not needed"
#rocq_ignore big_opM_def "Not needed"
#rocq_ignore big_opM_unseal "Not needed"

@[rocq_alias big_opS, expose] public def bigOpS {M : Type u} [OFE M] (op : M → M → M) {unit : M} [MonoidOps op unit]
@[rocq_alias big_opS, expose] public def bigOpS {M : Type u} [OFE Nat M] (op : M → M → M) {unit : M} [MonoidOps op unit]
{A : Type _} {S : Type _} [FiniteSet S A] (Φ : A → M) (m : S) : M :=
bigOpL op (fun _ x => Φ x) (toList m)

#rocq_ignore big_opS_aux "Not needed"
#rocq_ignore big_opS_def "Not needed"
#rocq_ignore big_opS_unseal "Not needed"

@[rocq_alias big_opMS, expose] public def bigOpMS {M : Type u} [OFE M] (op : M → M → M)
@[rocq_alias big_opMS, expose] public def bigOpMS {M : Type u} [OFE Nat M] (op : M → M → M)
{unit : M} [MonoidOps op unit] {A : Type _} {MS : Type _} [FiniteMultiSet MS A]
(Φ : A → M) (X : MS) : M :=
bigOpL op (fun _ x => Φ x) (FiniteMultiSet.toList X)
Expand Down Expand Up @@ -84,7 +84,7 @@ scoped macro_rules
public section
namespace BigOpL

variable {M : Type _} {A : Type _} [OFE M] {op : M → M → M} {unit : M} [MonoidOps op unit]
variable {M : Type _} {A : Type _} [OFE Nat M] {op : M → M → M} {unit : M} [MonoidOps op unit]

open MonoidOps

Expand Down Expand Up @@ -216,7 +216,7 @@ theorem bigOpL_gen_proper (R : M → M → Prop) {Φ Ψ : Nat → A → M} {l :
#rocq_ignore big_opL_ext "Merged into bigOpL_eq"

@[rocq_alias big_opL_proper_2]
theorem bigOpL_proper_2 [OFE A] {Φ Ψ : Nat → A → M} {l₁ l₂ : List A} (hlen : l₁.length = l₂.length)
theorem bigOpL_proper_2 [OFE Nat A] {Φ Ψ : Nat → A → M} {l₁ l₂ : List A} (hlen : l₁.length = l₂.length)
(hf : ∀ {k y₁ y₂}, l₁[k]? = some y₁ → l₂[k]? = some y₂ → Φ k y₁ = Ψ k y₂) :
([^ op list] k ↦ x ∈ l₁, Φ k x) = ([^ op list] k ↦ x ∈ l₂, Ψ k x) :=
bigOpL_gen_proper_2 (· = ·) rfl (· ▸ · ▸ rfl) hlen hf
Expand Down Expand Up @@ -287,7 +287,7 @@ end CMRA

section Hom

variable {M₁ : Type u} {M₂ : Type v} [OFE M₁] [OFE M₂]
variable {M₁ : Type u} {M₂ : Type v} [OFE Nat M₁] [OFE Nat M₂]
variable {op₁ : M₁ → M₁ → M₁} {op₂ : M₂ → M₂ → M₂} {unit₁ : M₁} {unit₂ : M₂}
variable [MonoidOps op₁ unit₁] [MonoidOps op₂ unit₂]
variable {B : Type w} {R : M₂ → M₂ → Prop} {f : M₁ → M₂}
Expand Down Expand Up @@ -319,7 +319,7 @@ namespace BigOpM

open scoped PartialMap

variable {M : Type u} [OFE M] {op : M → M → M} {unit : M} [MonoidOps op unit]
variable {M : Type u} [OFE Nat M] {op : M → M → M} {unit : M} [MonoidOps op unit]
variable {M' : Type _ → Type _} {K : Type _} {V : Type _}
variable [LawfulFiniteMap M' K]

Expand Down Expand Up @@ -401,7 +401,7 @@ theorem bigOpM_eq {Φ Ψ : K → V → M} {m : M' V} (hf : ∀ {k x}, get? m k =
bigOpM_gen_proper rfl (· ▸ · ▸ rfl) hf

@[rocq_alias big_opM_proper_2]
theorem bigOpM_eq_strong [OFE A] {Φ Ψ : K → A → M} {m1 m2 : M' A} (hm : ∀ k, get? m1 k = get? m2 k)
theorem bigOpM_eq_strong [OFE Nat A] {Φ Ψ : K → A → M} {m1 m2 : M' A} (hm : ∀ k, get? m1 k = get? m2 k)
(hf : ∀ {k y1 y2}, get? m1 k = some y1 → get? m2 k = some y2 → y1 = y2 → Φ k y1 = Ψ k y2) :
([^ op map] k ↦ x ∈ m1, Φ k x) = ([^ op map] k ↦ x ∈ m2, Ψ k x) :=
bigOpM_gen_proper_2 id equivalence_eq (· ▸ · ▸ rfl) (fun k => by rw [hm k])
Expand Down Expand Up @@ -577,8 +577,8 @@ theorem bigOpM_none {f : K → V → Option M} {m : M' V} :

end CMRA

variable {M₁} [OFE M₁]
variable {M₂} [OFE M₂]
variable {M₁} [OFE Nat M₁]
variable {M₂} [OFE Nat M₂]
variable {op₁ : M₁ → M₁ → M₁} {op₂ : M₂ → M₂ → M₂} {unit₁ : M₁} {unit₂ : M₂}
variable [MonoidOps op₁ unit₁] [MonoidOps op₂ unit₂]

Expand All @@ -604,7 +604,7 @@ end BigOpM

namespace BigOpS

variable {M : Type _} {A : Type _} {S : Type _} [OFE M] {op : M → M → M} {unit : M}
variable {M : Type _} {A : Type _} {S : Type _} [OFE Nat M] {op : M → M → M} {unit : M}
[MonoidOps op unit] [LawfulFiniteSet S A]

open BigOpL MonoidOps LawfulSet FiniteSet
Expand Down Expand Up @@ -717,7 +717,7 @@ end CMRA

section Homomorphism

variable {M₁ : Type u} {M₂ : Type v} [OFE M₁] [OFE M₂]
variable {M₁ : Type u} {M₂ : Type v} [OFE Nat M₁] [OFE Nat M₂]
variable {op₁ : M₁ → M₁ → M₁} {op₂ : M₂ → M₂ → M₂} {unit₁ : M₁} {unit₂ : M₂}
variable [MonoidOps op₁ unit₁] [MonoidOps op₂ unit₂]

Expand Down Expand Up @@ -747,7 +747,7 @@ end BigOpS

namespace BigOpMS

variable {M : Type _} {A : Type _} {MS : Type _} [OFE M] {op : M → M → M} {unit : M}
variable {M : Type _} {A : Type _} {MS : Type _} [OFE Nat M] {op : M → M → M} {unit : M}
[MonoidOps op unit] [LawfulFiniteMultiSet MS A]

open BigOpL MonoidOps
Expand Down Expand Up @@ -856,7 +856,7 @@ end CMRA

section Homomorphism

variable {M₁ : Type u} {M₂ : Type v} [OFE M₁] [OFE M₂]
variable {M₁ : Type u} {M₂ : Type v} [OFE Nat M₁] [OFE Nat M₂]
variable {op₁ : M₁ → M₁ → M₁} {op₂ : M₂ → M₂ → M₂} {unit₁ : M₁} {unit₂ : M₂}
variable [MonoidOps op₁ unit₁] [MonoidOps op₂ unit₂]

Expand Down
Loading