Skip to content

feat: notations for internalCmraValid, internalEq, internalIncluded#519

Open
alvinylt wants to merge 4 commits into
leanprover-community:masterfrom
ISTA-PLV:Notations
Open

feat: notations for internalCmraValid, internalEq, internalIncluded#519
alvinylt wants to merge 4 commits into
leanprover-community:masterfrom
ISTA-PLV:Notations

Conversation

@alvinylt

Copy link
Copy Markdown
Contributor

Description

Port the notations for internalCmraValid, internalEq, internalIncluded.

Addresses #300 and #234.

Checklist

  • My code follows the mathlib naming and code style conventions
  • I have added my name to the authors section of any appropriate files

@markusdemedeiros

Copy link
Copy Markdown
Collaborator

Looks great. I was a little hesitant that there would be situations where the symbols were ambiguous, but I suppose this shows that's not the case--do you agree?

@alvinylt

Copy link
Copy Markdown
Contributor Author

Looks great. I was a little hesitant that there would be situations where the symbols were ambiguous, but I suppose this shows that's not the case--do you agree?

We are reusing the symbols for CMRA.Included and for CMRA.Valid, but there is no ambiguity as CMRA.Included a b and CMRA.Valid a are of type Prop while internalCmraIncluded a b and internalCmraValid a are of type PROP, so it's not possible that we accidentally use the wrong symbol as it would not be type-correct.

Same for the distinction between internalEq and equivalence.

@markusdemedeiros

Copy link
Copy Markdown
Collaborator

Sounds great. The only overlap would be a BI instance for Prop itself, but perhaps we should cross that bridge when we come to it. If so, a fix would be to put the CMRA and BI notations in different scopes.

Nice work!

@lzy0505 lzy0505 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Only nitpicking


@[rocq_alias pure_internal_eq]
theorem of_pure {A : Type _} [OFE A] {x y : A} : ⌜x ≡ y⌝ ⊢ internalEq (PROP := PROP) x y :=
theorem of_pure {A : Type _} [OFE A] {x y : A} : ⌜x ≡ y⌝ ⊢ (iprop(x ≡ y) : PROP) :=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
theorem of_pure {A : Type _} [OFE A] {x y : A} : ⌜x ≡ y⌝ ⊢ (iprop(x ≡ y) : PROP) :=
theorem of_pure {A : Type _} [OFE A] {x y : A} : ⌜x ≡ y⌝ ⊢@{PROP} x ≡ y :=

@[rocq_alias fun_extI]
theorem fun_extI {A : Type _} {B : A → Type _} [OFEFun B] {f g : (x : A) → B x} :
(∀ x, internalEq (f x) (g x)) ⊢ internalEq (PROP := PROP) f g :=
(∀ x, (f x) (g x)) ⊢@{PROP} f ≡ g :=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(∀ x, (f x)(g x)) ⊢@{PROP} f ≡ g :=
(∀ x, f x ≡ g x) ⊢@{PROP} f ≡ g :=

@[rocq_alias combine_sep_gives_own]
instance combineSepGives_iOwn {γ} {a1 a2 : F.ap (IProp GF)} :
CombineSepGives (iOwn γ a1) (iOwn γ a2) (internalCmraValid (a1 • a2)) where
CombineSepGives (iOwn γ a1) (iOwn γ a2) iprop(✓ (a1 • a2)) where

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CombineSepGives (iOwn γ a1) (iOwn γ a2) iprop(✓ (a1 • a2)) where
CombineSepGives (iOwn γ a1) (iOwn γ a2) iprop(✓ a1 • a2) where

@markusdemedeiros
markusdemedeiros self-requested a review July 17, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants