Zulip Chat Archive

Stream: mathlib4

Topic: Fixing Finset.induction


Jeremy Tan (Apr 14 2023 at 11:09):

How do I get the Finset.induction line here to work and the interβ‚› function to compile?

import Mathlib.Analysis.Convex.Extreme
import Mathlib.Analysis.Convex.Function
import Mathlib.Topology.Algebra.Module.Basic
import Mathlib.Topology.Order.Basic

open Classical Affine BigOperators Set

section PreorderSemiring

variable (π•œ : Type _) {E : Type _} [TopologicalSpace π•œ] [Semiring π•œ] [Preorder π•œ] [AddCommMonoid E]
  [TopologicalSpace E] [Module π•œ E] {A B : Set E}

def IsExposed (A B : Set E) : Prop :=
  B.Nonempty β†’ βˆƒ l : E β†’L[π•œ] π•œ, B = { x ∈ A | βˆ€ y ∈ A, l y ≀ l x }

end PreorderSemiring

variable {π•œ : Type _} {E : Type _} [TopologicalSpace π•œ] [OrderedRing π•œ] [AddCommMonoid E]
  [TopologicalSpace E] [Module π•œ E] {A B : Set E}

theorem interβ‚› [ContinuousAdd π•œ] {F : Finset (Set E)} (hF : F.Nonempty)
    (hAF : βˆ€ B ∈ F, IsExposed π•œ A B) : IsExposed π•œ A (β‹‚β‚€ F) := by
  revert hF F
  refine' Finset.induction _ _ -- here
  Β· rintro h
    exfalso
    exact not_nonempty_empty h
  rintro C F _ hF _ hCF
  rw [Finset.coe_insert, interβ‚›_insert]
  obtain rfl | hFnemp := F.eq_empty_or_nonempty
  Β· rw [Finset.coe_empty, interβ‚›_empty, inter_univ]
    exact hCF C (Finset.mem_singleton_self C)
  exact (hCF C (Finset.mem_insert_self C F)).inter
    (hF hFnemp fun B hB => hCF B (Finset.mem_insert_of_mem hB))

Eric Wieser (Apr 14 2023 at 11:11):

I would recommend induction F using finset.induction (and dropping the revert too)

Jeremy Tan (Apr 15 2023 at 16:24):

It's from !4#3453. With the original code (refine' Finset.induction _ _) I get the error message

type mismatch
  fun s => Finset.induction ?m.24263 ?m.24264 s
has type
  Finset ?m.24260 β†’ (βˆ€ (B : Set E), B ∈ F✝ β†’ IsExposed π•œ A B) β†’ IsExposed π•œ A (β‹‚β‚€ ↑F✝) : Prop
but is expected to have type
  Finset.Nonempty F✝ β†’ (βˆ€ (B : Set E), B ∈ F✝ β†’ IsExposed π•œ A B) β†’ IsExposed π•œ A (β‹‚β‚€ ↑F✝) : Prop
the following variables have been introduced by the implicit lambda feature
  F✝ : Finset (Set E)
you can disable implicit lambdas using `@` or writing a lambda expression with `{}` or `[]` binder annotations.

which suggests to me that deleting an implicit variable somewhere should solve everything, but how do I do that?

Jeremy Tan (Apr 15 2023 at 16:26):

Or how can I go on with the code I already have in !4#3453?

Eric Wieser (Apr 15 2023 at 16:49):

Did you try my suggestion above?


Last updated: Dec 20 2023 at 11:08 UTC