Skip to content

Add Local Updates - #49

Closed
suhr wants to merge 3 commits into
leanprover-community:masterfrom
suhr:local-update
Closed

Add Local Updates#49
suhr wants to merge 3 commits into
leanprover-community:masterfrom
suhr:local-update

Conversation

@suhr

@suhr suhr commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

See #27. Uses #66.

Do we have CMRAs for Unit and products?

@markusdemedeiros

Copy link
Copy Markdown
Collaborator

Good catch, I don't actually think we do. Feel free to add them (Unit should be like 1 line using ofDiscrete)

@suhr

suhr commented Jun 22, 2025

Copy link
Copy Markdown
Contributor Author

In local_updates.v, alloc_option_local_update is proved like so:

  Lemma alloc_option_local_update {A : cmra} (x : A) y :
    ✓ x →
    (None, y) ~l~> (Some x, Some x).
  Proof.
    move=>Hx. apply local_update_unital=> n z _ /= Heq. split.
    { rewrite Some_validN. apply cmra_valid_validN. done. }
    destruct z as [z|]; last done. destruct y; inversion Heq.
  Qed.

But in Lean, the proof turned out to be vacuous:

  theorem alloc_option_local_update {α : Type} [CMRA α]
      {x : α} (y : α) (_: ✓ x): (none, y) ~l~> (some x, some x) :=
    fun _ mz _ e =>
      match mz with
      | .none           => False.elim e
      | .some .none     => False.elim e
      | .some (.some _) => False.elim e

That's sus, is the instance of CMRA (Option α) defined correctly?

@suhr
suhr marked this pull request as ready for review June 23, 2025 11:51
@suhr

suhr commented Jun 23, 2025

Copy link
Copy Markdown
Contributor Author

Fixed this, and now the PR is ready for review.

@markusdemedeiros markusdemedeiros mentioned this pull request Jun 23, 2025
@markusdemedeiros

Copy link
Copy Markdown
Collaborator

Nice work! Mario is too busy to review and merge PR's right now but if you wanted to do more, #58 should be very accessible to you.

@markusdemedeiros markusdemedeiros mentioned this pull request Jun 23, 2025
@suhr suhr mentioned this pull request Jun 24, 2025
@suhr suhr mentioned this pull request Jun 30, 2025
@markusdemedeiros

Copy link
Copy Markdown
Collaborator

See: #70

@suhr
suhr deleted the local-update branch May 4, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants