Skip to content

feat: monotone tactic - #595

Open
oliversoeser wants to merge 88 commits into
leanprover-community:masterfrom
oliversoeser:mono-tactic
Open

feat: monotone tactic#595
oliversoeser wants to merge 88 commits into
leanprover-community:masterfrom
oliversoeser:mono-tactic

Conversation

@oliversoeser

@oliversoeser oliversoeser commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Implements the monotone tactic for proving the monotonicity of functions on Iris predicates and extends nonexp to handle uncurried functions

Depends on #558

Checklist

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

refine BI.sep_ne.ne ?_ ?_
· exact Hwp m m_n _ _ _
· exact BI.BigSepL.bigSepL_dist <| fun _ => Hwp m m_n _ _ _
distLater_dist := by contractive

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.

🔥

@MackieLoeffel

Copy link
Copy Markdown
Collaborator

Can you create this PR as a stacked pull request on top of #558? This would make it easier to review this PR.

Copyright (c) 2026 Oliver Soeser. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Oliver Soeser
-/

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.

I think this file should be in the BI folder, next to the Fixpoint file.


open Iris BI OFE Iris.Std

class MonotonePred [BI PROP] [OFE A]

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.

Can this be unified with BIMonoPred?

monotone : ∀ (Φ Ψ : A → PROP),
⊢ (□ ∀ x, Φ x -∗ Ψ x) -∗ ∀ x, F Φ x -∗ F Ψ x

class AntitonePred [BI PROP] [OFE A]

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.

Can we unify AntitonePred and MonotonePred, maybe with a boolean which says whether the wand is flipped? This would hopefully avoid the need for the duplicated instances below.


@[expose] public section

open Iris BI OFE Iris.Std

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.

I am wondering if it makes more sense to follow the design of PartialOrder / CCPO in the standard library more closely. The design there seems quite nice since it for example allows n-ary predicates very naturally.
I have something like the following in mind. I have not fully thought it through, so I am not fully sure if it will work, but might be worth playing around with a bit.

class BIPartialOrder PROP [BI PROP] (α : Sort u) where
  /--
  A “less-or-equal-to” or “approximates” relation.
  -/
  rel : α → α → PROP
  /-- The “less-or-equal-to” or “approximates” relation is reflexive. -/
  rel_refl : ∀ {x}, ⊢ rel x x
  /-- The “less-or-equal-to” or “approximates” relation is transitive. -/
  rel_trans : ∀ {x y z}, rel x y -∗ rel y z -∗ rel x z

scoped infix:50 " ⊑ᵢ " => BIPartialOrder.rel

def monotone {α β} PROP [BI PROP] [BIPartialOrder PROP α] [BIPartialOrder PROP β] (f : α → β) : Prop :=
  ∀ x y, ⊢@{PROP} (□ x ⊑ᵢ y) -∗ f x ⊑ᵢ f y

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