Skip to content

RFC: add simp lemmas for quantification over Fin 0 #10629

@fgdorais

Description

@fgdorais

Proposal

I propose to add the following two theorems to Init.Data.Fin.Lemmas:

@[simp] theorem forall_fin_zero {p : Fin 0Prop} : (∀ i, p i) ↔ True := ...

@[simp] theorem exists_fin_zero {p : Fin 0Prop} : (∃ i, p i) ↔ False := ...

This file already contains similar theorems forall_fin_one, forall_fin_two, exists_fin_one, exists_fin_two. These four theorems should probably have attribute simp but this is not formally part of this RFC.

It is clear that these two theorems are handy to quickly deal with trivial situations. The necessity for these two theorems hasn't been apparent since Mathlib has IsEmpty.forall_iff and IsEmpty.exists_iff as simp lemmas. Unfortunately, the former triggers on every ∀ _, _ statement, which is a bad idea for simp. This needs to be corrected. The two theorems proposed here will help with that effort by reducing the amount of breakage when the simp attribute is removed from IsEmpty.forall_iff and IsEmpty.exists_iff.

The tentative PR #10627 which implements this has no consequences in Lean. The tentative port in Batteries PR batteries#1433 causes no downstream issues in Batteries nor Mathlib. There seems to be no negative consequences to adding the two proposed theorems.

Impact

Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-mediumWe may work on this issue if we find the timeRFCRequest for comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions