Zulip Chat Archive

Stream: general

Topic: help with supr proof


Bernd Losert (Jul 15 2022 at 20:26):

import tactic
import order.filter.partial
import data.fin.tuple

example {α : Type*} (n₁ n₂ : ) :  :=
begin
  have g₁ : fin (n₁ + 1)  filter α, sorry,
  have g₂ : fin (n₂ + 1)  filter α, sorry,
  let n := n₁ + n₂,
  have hn : n + 2 = n₁ + 1 + (n₂ + 1), by ring_nf,
  let g : fin (n + 2)  filter α := fin.append hn g₁ g₂,
  have : supr g₁  supr g,
  begin
    refine supr_mono' _,
    intros i,
    use i,
    sorry,
  end,
  exact 0
end

The family g of filters is basically the family g₁ followed by the family g₂. And I want to show supr g₁ ≤ supr g and supr g₂ ≤ supr g. This is straighforward on paper, but I'm having trouble writing this formally in Lean. Any tips?

I wonder if it would be easier to just use sets of filters instead of fin-indexed families.

Adam Topaz (Jul 15 2022 at 20:27):

is there a supr_sum_eq_sup lemma somewhere?

Adam Topaz (Jul 15 2022 at 20:28):

docs#supr_sum

Adam Topaz (Jul 15 2022 at 20:28):

so if you can identify g with the supr over the sum type, that would let you reduce to le_sup_left and le_sup_right

Adam Topaz (Jul 15 2022 at 20:29):

or you could just use docs#supr_le

Bernd Losert (Jul 15 2022 at 20:31):

I had an attempt using supr_le, but I didn't get very far.

Bernd Losert (Jul 15 2022 at 20:32):

Using the sum seems interesting.

Bernd Losert (Jul 15 2022 at 20:33):

Hmm..., but I can't use a sum since I need to deal with fin indexed families only.

Adam Topaz (Jul 15 2022 at 20:34):

example {α : Type*} (n₁ n₂ : ) :  :=
begin
  have g₁ : fin (n₁ + 1)  filter α, sorry,
  have g₂ : fin (n₂ + 1)  filter α, sorry,
  let n := n₁ + n₂,
  have hn : n + 2 = n₁ + 1 + (n₂ + 1), by ring_nf,
  let g : fin (n + 2)  filter α := fin.append hn g₁ g₂,
  have : supr g₁  supr g,
  begin
    apply supr_le _, intros i,
    have : g₁ i = g i,
    { sorry },
    rw this,
    apply le_supr g,
  end,
  exact 0
end

Adam Topaz (Jul 15 2022 at 20:34):

I don't know how hard that sorry is with the current api for fin.append

Yakov Pechersky (Jul 15 2022 at 20:34):

docs#fin_sum_fin_equiv

Bernd Losert (Jul 15 2022 at 20:37):

Ah, fin_sum_fin_equiv is pretty handy here.

Adam Topaz (Jul 15 2022 at 20:38):

Maybe fin.append should be redefined using fin_sum_fin_equiv?

Bernd Losert (Jul 15 2022 at 20:39):

I'm thinking though... maybe I should just redefine g₁, g₂, g to be finite sets. I think it will be easier this way to prove the corresponding Sup inequalities.

Adam Topaz (Jul 15 2022 at 20:39):

working with indexed families is almost always better when you're using supr and infi

Adam Topaz (Jul 15 2022 at 20:39):

you could use arbitrary indexing types satisfying [fintype _] and use the sum type instead of the append

Bernd Losert (Jul 15 2022 at 20:41):

Yeah. However, indexed families feels too sophisticated to me, at least in Lean. I'm more comfortable dealing with sets.

Adam Topaz (Jul 15 2022 at 20:45):

It's much easier if you use types, e.g.

example {α : Type*} (a b : Type*) :  :=
begin
  have g₁ : a  filter α, sorry,
  have g₂ : b  filter α, sorry,
  let g : a  b  filter α := λ t, sum.rec_on t g₁ g₂,
  have : supr g₁  supr g,
  begin
    rw [supr_le_iff], intros i,
    have : g₁ i = g (sum.inl i) := rfl,
    rw this, apply le_supr g (sum.inl i),
  end,
  exact 0
end

Bernd Losert (Jul 15 2022 at 20:48):

Nice. I'll try this out if I can't get a set-based proof going. Thanks a lot.

Yakov Pechersky (Jul 15 2022 at 21:24):

You'd have to prove this:

  have :  (x), (fin.append hn g₁ g₂ x =
    (λ (i : fin (n₁ + 1)  fin (n₂ + 1)),
      sum.cases_on i g₁ g₂ : fin (n₁ + 1)  fin (n₂ + 1)  filter α)
      (fin_sum_fin_equiv.symm (fin.cast hn x))),

Yakov Pechersky (Jul 15 2022 at 21:24):

Which requires some lemmas about the application of fin.append which I don't see right now

Yakov Pechersky (Jul 15 2022 at 21:24):

And some of these:

lemma assist {α ι ι' : Type*} [complete_lattice α] (e : ι'  ι) (f : ι  α) :
  supr f  supr (f  e) :=
begin
  rw le_supr_iff,
  intros a hg,
  refine supr_le (λ i, _),
  refine (hg (e.symm i)).trans' _,
  simp
end

lemma assist' {α ι ι' : Type*} [complete_lattice α] (e : ι'  ι) (f : ι  α) :
  supr (f  e)  supr f :=
begin
  rw le_supr_iff,
  intros a hg,
  refine supr_le (λ i, _),
  refine (hg (e i)).trans' _,
  simp
end

Yakov Pechersky (Jul 15 2022 at 21:25):

or something of that natrue


Last updated: Dec 20 2023 at 11:08 UTC