AFTD Auto-Formalizing Theoretical Domains

IndexedLOrder.image_erase_collision_preserves

theoremverifiedformalizationimported Lean

IndexedLOrder.image_erase_collision_preserves

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Classical in
variable {T : Type*} [Inhabited T] in
variable {I : Type*} in
variable [IST : IndexedLOrder I T] in
set_option quotPrecheck false in
variable (σ : Finset T) (C : Finset I) in
variable [DecidableEq T] [DecidableEq I] in
open Classical in
variable (c : T → I) (σ : Finset T) (C : Finset I) in
variable {c σ C} in
omit [DecidableEq T] [Inhabited T] IST in
lemma IndexedLOrder.image_erase_collision_preserves [DecidableEq T] (σ : Finset T) (c : T → I)
    (x y : T) (hx_in_σ : x ∈ σ) (hy_in_σ : y ∈ σ) (hxy_ne : x ≠ y) (hcxy_eq : c x = c y) :
    (σ.erase x).image c = σ.image c ∧ (σ.erase y).image c = σ.image c
Formalizes
EconCSLib, `IndexedLOrder.image_erase_collision_preserves`
Lean proof
By xbei (from the file's git history), from github.com/gametheoryinlean/EconCSLib at 1a88f809b538 (Copyright (c) 2026 EconCSLib contributors. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.30.0.
Verified
08 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Classical invariable {T : Type*} [Inhabited T] invariable {I : Type*} invariable [IST : IndexedLOrder I T] inset_option quotPrecheck false invariable (σ : Finset T) (C : Finset I) invariable [DecidableEq T] [DecidableEq I] inopen Classical invariable (c : T → I) (σ : Finset T) (C : Finset I) invariable {c σ C} inomit [DecidableEq T] [Inhabited T] IST inlemma IndexedLOrder.image_erase_collision_preserves [DecidableEq T] (σ : Finset T) (c : T → I)    (x y : T) (hx_in_σ : x ∈ σ) (hy_in_σ : y ∈ σ) (hxy_ne : x ≠ y) (hcxy_eq : c x = c y) :    (σ.erase x).image c = σ.image c ∧ (σ.erase y).image c = σ.image c := by  constructor  · ext z    simp only [Finset.mem_image]    constructor    · intro ⟨w, hw_in_erased, hw_eq⟩      have hw_in_σ : w ∈ σ := by        rw [Finset.mem_erase] at hw_in_erased        exact hw_in_erased.2      exact ⟨w, hw_in_σ, hw_eq⟩    · intro ⟨w, hw_in_σ, hw_eq⟩      by_cases h : w = x      · subst h        use y        constructor        · rw [Finset.mem_erase]          exact ⟨hxy_ne.symm, hy_in_σ⟩        · rw [←hcxy_eq, hw_eq]      · use w        exact ⟨Finset.mem_erase.mpr ⟨h, hw_in_σ⟩, hw_eq⟩  · ext z    simp only [Finset.mem_image]    constructor    · intro ⟨w, hw_in_erased, hw_eq⟩      have hw_in_σ : w ∈ σ := by        rw [Finset.mem_erase] at hw_in_erased        exact hw_in_erased.2      exact ⟨w, hw_in_σ, hw_eq⟩    · intro ⟨w, hw_in_σ, hw_eq⟩      by_cases h : w = y      · subst h        use x        constructor        · rw [Finset.mem_erase]          exact ⟨hxy_ne, hx_in_σ⟩        · rw [hcxy_eq, hw_eq]      · use w        exact ⟨Finset.mem_erase.mpr ⟨h, hw_in_σ⟩, hw_eq⟩
See it in the graphDiscuss this resultChallenge it