l3lab/ntp-mathlib huggingface dataset:
theorem indicator_ae_eq_zero_of_restrict_ae_eq_zero (hs : MeasurableSet s)
    (hf : f =ᵐ[μ.restrict s] 0) : s.indicator f =ᵐ[μ] 0 := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs] at hf
  filter_upwards [hf] with x hx
  by_cases hxs : x ∈ s
  · 

Proof state:
case pos
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
hs : MeasurableSet s
hf : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = OfNat.ofNat 0 x
x : α
hx : x ∈ s → f x = OfNat.ofNat 0 x
hxs : x ∈ s
⊢ indicator s f x = OfNat.ofNat 0 x

Next tactic:
simp only [hxs, hx hxs, Set.indicator_of_mem]
theorem indicator_ae_eq_zero_of_restrict_ae_eq_zero (hs : MeasurableSet s)
    (hf : f =ᵐ[μ.restrict s] 0) : s.indicator f =ᵐ[μ] 0 := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs] at hf
  filter_upwards [hf] with x hx
  by_cases hxs : x ∈ s
  · simp only [hxs, hx hxs, Set.indicator_of_mem]
  · 

Proof state:
case neg
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
hs : MeasurableSet s
hf : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = OfNat.ofNat 0 x
x : α
hx : x ∈ s → f x = OfNat.ofNat 0 x
hxs : x ∉ s
⊢ indicator s f x = OfNat.ofNat 0 x

Next tactic:
simp [hx, hxs]
theorem indicator_ae_eq_of_ae_eq_set (hst : s =ᵐ[μ] t) : s.indicator f =ᵐ[μ] t.indicator f := by
  

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
hst : s =ᶠ[ae μ] t
⊢ indicator s f =ᶠ[ae μ] indicator t f

Next tactic:
classical exact piecewise_ae_eq_of_ae_eq_set hst
theorem indicator_ae_eq_of_ae_eq_set (hst : s =ᵐ[μ] t) : s.indicator f =ᵐ[μ] t.indicator f := by
  classical 

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
hst : s =ᶠ[ae μ] t
⊢ indicator s f =ᶠ[ae μ] indicator t f

Next tactic:
exact piecewise_ae_eq_of_ae_eq_set hst
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
⊢ f =ᶠ[ae (Measure.restrict μ s)] g ↔ indicator s f =ᶠ[ae μ] indicator s g

Next tactic:
rw [Filter.EventuallyEq, ae_restrict_iff' hs]
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
⊢ (∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x) ↔ indicator s f =ᶠ[ae μ] indicator s g

Next tactic:
refine' ⟨fun h => _, fun h => _⟩
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> 

Proof state:
case refine'_1
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x
⊢ indicator s f =ᶠ[ae μ] indicator s g

Next tactic:
filter_upwards [h] with x hx
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> 

Proof state:
case refine'_2
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : indicator s f =ᶠ[ae μ] indicator s g
⊢ ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x

Next tactic:
filter_upwards [h] with x hx
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> filter_upwards [h] with x hx
  · 

Proof state:
case h
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x
x : α
hx : x ∈ s → f x = g x
⊢ indicator s f x = indicator s g x

Next tactic:
by_cases hxs : x ∈ s
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> filter_upwards [h] with x hx
  · by_cases hxs : x ∈ s
    · 

Proof state:
case pos
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x
x : α
hx : x ∈ s → f x = g x
hxs : x ∈ s
⊢ indicator s f x = indicator s g x

Next tactic:
simp [hxs, hx hxs]
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> filter_upwards [h] with x hx
  · by_cases hxs : x ∈ s
    · simp [hxs, hx hxs]
    · 

Proof state:
case neg
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x
x : α
hx : x ∈ s → f x = g x
hxs : x ∉ s
⊢ indicator s f x = indicator s g x

Next tactic:
simp [hxs]
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> filter_upwards [h] with x hx
  · by_cases hxs : x ∈ s
    · simp [hxs, hx hxs]
    · simp [hxs]
  · 

Proof state:
case h
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : indicator s f =ᶠ[ae μ] indicator s g
x : α
hx : indicator s f x = indicator s g x
⊢ x ∈ s → f x = g x

Next tactic:
intro hxs
theorem ae_eq_restrict_iff_indicator_ae_eq {g : α → β} (hs : MeasurableSet s) :
    f =ᵐ[μ.restrict s] g ↔ s.indicator f =ᵐ[μ] s.indicator g := by
  rw [Filter.EventuallyEq, ae_restrict_iff' hs]
  refine' ⟨fun h => _, fun h => _⟩ <;> filter_upwards [h] with x hx
  · by_cases hxs : x ∈ s
    · simp [hxs, hx hxs]
    · simp [hxs]
  · intro hxs
    

Proof state:
case h
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
inst✝¹ : MeasurableSpace α
μ : Measure α
s t : Set α
f : α → β
inst✝ : Zero β
g : α → β
hs : MeasurableSet s
h : indicator s f =ᶠ[ae μ] indicator s g
x : α
hx : indicator s f x = indicator s g x
hxs : x ∈ s
⊢ f x = g x

Next tactic:
simpa [hxs] using hx
theorem toList_cons (a : Lists α) (l) : toList (cons a l) = a :: l.toList := by 

Proof state:
α : Type u_1
a : Lists α
l : Lists' α true
⊢ toList (cons a l) = a :: toList l

Next tactic:
simp
@[simp]
theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l := by 

Proof state:
α : Type u_1
l : List (Lists α)
⊢ toList (ofList l) = l

Next tactic:
induction l
@[simp]
theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l := by induction l <;> 

Proof state:
case nil
α : Type u_1
⊢ toList (ofList []) = []

Next tactic:
simp [*]
@[simp]
theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l := by induction l <;> 

Proof state:
case cons
α : Type u_1
head✝ : Lists α
tail✝ : List (Lists α)
tail_ih✝ : toList (ofList tail✝) = tail✝
⊢ toList (ofList (head✝ :: tail✝)) = head✝ :: tail✝

Next tactic:
simp [*]
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by 

Proof state:
α : Type u_1
b : Bool
h : true = b
l : Lists' α b
⊢ Lists' α true

Next tactic:
rw [h]
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; 

Proof state:
α : Type u_1
b : Bool
h : true = b
l : Lists' α b
⊢ Lists' α b

Next tactic:
exact l
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    

Proof state:
α : Type u_1
b : Bool
h : true = b
l : Lists' α b
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α b) l;
  ofList (toList l') = l'

Next tactic:
induction l with
    | atom => cases h
    -- Porting note: case nil was not covered.
    | nil => simp
    | cons' b a _ IH =>
      intro l'
      -- Porting note: Previous code was:
      -- change l' with cons' a l
      --
      -- This can be removed.
      simpa [cons] using IH rfl
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    

Proof state:
case atom
α : Type u_1
b : Bool
a✝ : α
h : true = false
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α false) (atom a✝);
  ofList (toList l') = l'

Next tactic:
| atom => cases h
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    | atom => 

Proof state:
case atom
α : Type u_1
b : Bool
a✝ : α
h : true = false
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α false) (atom a✝);
  ofList (toList l') = l'

Next tactic:
cases h
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    | atom => cases h
    -- Porting note: case nil was not covered.
    

Proof state:
case nil
α : Type u_1
b : Bool
h : true = true
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α true) nil;
  ofList (toList l') = l'

Next tactic:
| nil => simp
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    | atom => cases h
    -- Porting note: case nil was not covered.
    | nil => 

Proof state:
case nil
α : Type u_1
b : Bool
h : true = true
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α true) nil;
  ofList (toList l') = l'

Next tactic:
simp
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    | atom => cases h
    -- Porting note: case nil was not covered.
    | nil => simp
    

Proof state:
case cons'
α : Type u_1
b✝¹ b✝ : Bool
b : Lists' α b✝
a : Lists' α true
a_ih✝ :
  ∀ (h : true = b✝),
    let l' := Eq.mpr (_ : Lists' α true = Lists' α b✝) b;
    ofList (toList l') = l'
IH :
  ∀ (h : true = true),
    let l' := Eq.mpr (_ : Lists' α true = Lists' α true) a;
    ofList (toList l') = l'
h : true = true
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α true) (cons' b a);
  ofList (toList l') = l'

Next tactic:
| cons' b a _ IH =>
      intro l'
      -- Porting note: Previous code was:
      -- change l' with cons' a l
      --
      -- This can be removed.
      simpa [cons] using IH rfl
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    | atom => cases h
    -- Porting note: case nil was not covered.
    | nil => simp
    | cons' b a _ IH =>
      

Proof state:
case cons'
α : Type u_1
b✝¹ b✝ : Bool
b : Lists' α b✝
a : Lists' α true
a_ih✝ :
  ∀ (h : true = b✝),
    let l' := Eq.mpr (_ : Lists' α true = Lists' α b✝) b;
    ofList (toList l') = l'
IH :
  ∀ (h : true = true),
    let l' := Eq.mpr (_ : Lists' α true = Lists' α true) a;
    ofList (toList l') = l'
h : true = true
⊢ let l' := Eq.mpr (_ : Lists' α true = Lists' α true) (cons' b a);
  ofList (toList l') = l'

Next tactic:
intro l'
@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l :=
  suffices
    ∀ (b) (h : true = b) (l : Lists' α b),
      let l' : Lists' α true := by rw [h]; exact l
      ofList (toList l') = l'
    from this _ rfl
  fun b h l => by
    induction l with
    | atom => cases h
    -- Porting note: case nil was not covered.
    | nil => simp
    | cons' b a _ IH =>
      intro l'
      -- Porting note: Previous code was:
      -- change l' with cons' a l
      --
      -- This can be removed.
      

Proof state:
case cons'
α : Type u_1
b✝¹ b✝ : Bool
b : Lists' α b✝
a : Lists' α true
a_ih✝ :
  ∀ (h : true = b✝),
    let l' := Eq.mpr (_ : Lists' α true = Lists' α b✝) b;
    ofList (toList l') = l'
IH :
  ∀ (h : true = true),
    let l' := Eq.mpr (_ : Lists' α true = Lists' α true) a;
    ofList (toList l') = l'
h : true = true
l' : Lists' α true := Eq.mpr (_ : Lists' α true = Lists' α true) (cons' b a)
⊢ ofList (toList l') = l'

Next tactic:
simpa [cons] using IH rfl
@[simp]
theorem mem_cons {a y l} : a ∈ @cons α y l ↔ a ~ y ∨ a ∈ l := by
  

Proof state:
α : Type u_1
a y : Lists α
l : Lists' α true
⊢ a ∈ cons y l ↔ a ~ y ∨ a ∈ l

Next tactic:
simp [mem_def, or_and_right, exists_or]
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  

Proof state:
α : Type u_1
a : Lists α
l₁ l₂ : Lists' α true
⊢ cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  

Proof state:
α : Type u_1
a : Lists α
l₁ l₂ : Lists' α true
h : cons a l₁ ⊆ l₂
⊢ a ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
generalize h' : Lists'.cons a l₁ = l₁' at h
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  

Proof state:
α : Type u_1
a : Lists α
l₁ l₂ l₁' : Lists' α true
h' : cons a l₁ = l₁'
h : l₁' ⊆ l₂
⊢ a ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
cases' h with l a' a'' l l' e m s
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  cases' h with l a' a'' l l' e m s;
  · 

Proof state:
case nil
α : Type u_1
a : Lists α
l₁ l₂ : Lists' α true
h' : cons a l₁ = nil
⊢ a ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
cases a
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  cases' h with l a' a'' l l' e m s;
  · cases a
    

Proof state:
case nil.mk
α : Type u_1
l₁ l₂ : Lists' α true
fst✝ : Bool
snd✝ : Lists' α fst✝
h' : cons { fst := fst✝, snd := snd✝ } l₁ = nil
⊢ { fst := fst✝, snd := snd✝ } ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
cases h'
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  cases' h with l a' a'' l l' e m s;
  · cases a
    cases h'
  

Proof state:
case cons
α : Type u_1
a : Lists α
l₁ l₂ : Lists' α true
a' a'' : Lists α
l : Lists' α true
e : a' ~ a''
h' : cons a l₁ = cons a' l
m : a'' ∈ toList l₂
s : Subset l l₂
⊢ a ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
cases a
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  cases' h with l a' a'' l l' e m s;
  · cases a
    cases h'
  cases a; 

Proof state:
case cons.mk
α : Type u_1
l₁ l₂ : Lists' α true
a' a'' : Lists α
l : Lists' α true
e : a' ~ a''
m : a'' ∈ toList l₂
s : Subset l l₂
fst✝ : Bool
snd✝ : Lists' α fst✝
h' : cons { fst := fst✝, snd := snd✝ } l₁ = cons a' l
⊢ { fst := fst✝, snd := snd✝ } ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
cases a'
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  cases' h with l a' a'' l l' e m s;
  · cases a
    cases h'
  cases a; cases a'; 

Proof state:
case cons.mk.mk
α : Type u_1
l₁ l₂ : Lists' α true
a'' : Lists α
l : Lists' α true
m : a'' ∈ toList l₂
s : Subset l l₂
fst✝¹ : Bool
snd✝¹ : Lists' α fst✝¹
fst✝ : Bool
snd✝ : Lists' α fst✝
e : { fst := fst✝, snd := snd✝ } ~ a''
h' : cons { fst := fst✝¹, snd := snd✝¹ } l₁ = cons { fst := fst✝, snd := snd✝ } l
⊢ { fst := fst✝¹, snd := snd✝¹ } ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
cases h'
theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ := by
  refine' ⟨fun h => _, fun ⟨⟨a', m, e⟩, s⟩ => Subset.cons e m s⟩
  generalize h' : Lists'.cons a l₁ = l₁' at h
  cases' h with l a' a'' l l' e m s;
  · cases a
    cases h'
  cases a; cases a'; cases h'; 

Proof state:
case cons.mk.mk.refl
α : Type u_1
l₁ l₂ : Lists' α true
a'' : Lists α
m : a'' ∈ toList l₂
fst✝ : Bool
snd✝ : Lists' α fst✝
e : { fst := fst✝, snd := snd✝ } ~ a''
s : Subset l₁ l₂
⊢ { fst := fst✝, snd := snd✝ } ∈ l₂ ∧ l₁ ⊆ l₂

Next tactic:
exact ⟨⟨_, m, e⟩, s⟩
theorem ofList_subset {l₁ l₂ : List (Lists α)} (h : l₁ ⊆ l₂) :
    Lists'.ofList l₁ ⊆ Lists'.ofList l₂ := by
  

Proof state:
α : Type u_1
l₁ l₂ : List (Lists α)
h : l₁ ⊆ l₂
⊢ ofList l₁ ⊆ ofList l₂

Next tactic:
induction' l₁ with _ _ l₁_ih
theorem ofList_subset {l₁ l₂ : List (Lists α)} (h : l₁ ⊆ l₂) :
    Lists'.ofList l₁ ⊆ Lists'.ofList l₂ := by
  induction' l₁ with _ _ l₁_ih; · 

Proof state:
case nil
α : Type u_1
l₂ : List (Lists α)
h : [] ⊆ l₂
⊢ ofList [] ⊆ ofList l₂

Next tactic:
exact Subset.nil
theorem ofList_subset {l₁ l₂ : List (Lists α)} (h : l₁ ⊆ l₂) :
    Lists'.ofList l₁ ⊆ Lists'.ofList l₂ := by
  induction' l₁ with _ _ l₁_ih; · exact Subset.nil
  

Proof state:
case cons
α : Type u_1
l₂ : List (Lists α)
head✝ : Lists α
tail✝ : List (Lists α)
l₁_ih : tail✝ ⊆ l₂ → ofList tail✝ ⊆ ofList l₂
h : head✝ :: tail✝ ⊆ l₂
⊢ ofList (head✝ :: tail✝) ⊆ ofList l₂

Next tactic:
refine' Subset.cons (Lists.Equiv.refl _) _ (l₁_ih (List.subset_of_cons_subset h))
theorem ofList_subset {l₁ l₂ : List (Lists α)} (h : l₁ ⊆ l₂) :
    Lists'.ofList l₁ ⊆ Lists'.ofList l₂ := by
  induction' l₁ with _ _ l₁_ih; · exact Subset.nil
  refine' Subset.cons (Lists.Equiv.refl _) _ (l₁_ih (List.subset_of_cons_subset h))
  

Proof state:
case cons
α : Type u_1
l₂ : List (Lists α)
head✝ : Lists α
tail✝ : List (Lists α)
l₁_ih : tail✝ ⊆ l₂ → ofList tail✝ ⊆ ofList l₂
h : head✝ :: tail✝ ⊆ l₂
⊢ head✝ ∈ toList (ofList l₂)

Next tactic:
simp at h
theorem ofList_subset {l₁ l₂ : List (Lists α)} (h : l₁ ⊆ l₂) :
    Lists'.ofList l₁ ⊆ Lists'.ofList l₂ := by
  induction' l₁ with _ _ l₁_ih; · exact Subset.nil
  refine' Subset.cons (Lists.Equiv.refl _) _ (l₁_ih (List.subset_of_cons_subset h))
  simp at h; 

Proof state:
case cons
α : Type u_1
l₂ : List (Lists α)
head✝ : Lists α
tail✝ : List (Lists α)
l₁_ih : tail✝ ⊆ l₂ → ofList tail✝ ⊆ ofList l₂
h : head✝ ∈ l₂ ∧ tail✝ ⊆ l₂
⊢ head✝ ∈ toList (ofList l₂)

Next tactic:
simp [h]
@[refl]
theorem Subset.refl {l : Lists' α true} : l ⊆ l := by
  

Proof state:
α : Type u_1
l : Lists' α true
⊢ l ⊆ l

Next tactic:
rw [← Lists'.of_toList l]
@[refl]
theorem Subset.refl {l : Lists' α true} : l ⊆ l := by
  rw [← Lists'.of_toList l]; 

Proof state:
α : Type u_1
l : Lists' α true
⊢ ofList (toList l) ⊆ ofList (toList l)

Next tactic:
exact ofList_subset (List.Subset.refl _)
theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := by
  

Proof state:
α : Type u_1
l : Lists' α true
⊢ l ⊆ nil → l = nil

Next tactic:
rw [← of_toList l]
theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := by
  rw [← of_toList l]
  

Proof state:
α : Type u_1
l : Lists' α true
⊢ ofList (toList l) ⊆ nil → ofList (toList l) = nil

Next tactic:
induction toList l
theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := by
  rw [← of_toList l]
  induction toList l <;> 

Proof state:
case nil
α : Type u_1
l : Lists' α true
⊢ ofList [] ⊆ nil → ofList [] = nil

Next tactic:
intro h
theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := by
  rw [← of_toList l]
  induction toList l <;> 

Proof state:
case cons
α : Type u_1
l : Lists' α true
head✝ : Lists α
tail✝ : List (Lists α)
tail_ih✝ : ofList tail✝ ⊆ nil → ofList tail✝ = nil
⊢ ofList (head✝ :: tail✝) ⊆ nil → ofList (head✝ :: tail✝) = nil

Next tactic:
intro h
theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := by
  rw [← of_toList l]
  induction toList l <;> intro h
  · 

Proof state:
case nil
α : Type u_1
l : Lists' α true
h : ofList [] ⊆ nil
⊢ ofList [] = nil

Next tactic:
rfl
theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := by
  rw [← of_toList l]
  induction toList l <;> intro h
  · rfl
  · 

Proof state:
case cons
α : Type u_1
l : Lists' α true
head✝ : Lists α
tail✝ : List (Lists α)
tail_ih✝ : ofList tail✝ ⊆ nil → ofList tail✝ = nil
h : ofList (head✝ :: tail✝) ⊆ nil
⊢ ofList (head✝ :: tail✝) = nil

Next tactic:
rcases cons_subset.1 h with ⟨⟨_, ⟨⟩, _⟩, _⟩
theorem mem_of_subset' {a} : ∀ {l₁ l₂ : Lists' α true} (_ : l₁ ⊆ l₂) (_ : a ∈ l₁.toList), a ∈ l₂
  | nil, _, Lists'.Subset.nil, h => by 

Proof state:
α : Type u_1
a : Lists α
x✝ : Lists' α true
h : a ∈ toList nil
⊢ a ∈ x✝

Next tactic:
cases h
theorem mem_of_subset' {a} : ∀ {l₁ l₂ : Lists' α true} (_ : l₁ ⊆ l₂) (_ : a ∈ l₁.toList), a ∈ l₂
  | nil, _, Lists'.Subset.nil, h => by cases h
  | cons' a0 l0, l₂, s, h => by
    

Proof state:
α : Type u_1
a : Lists α
b✝ : Bool
a0 : Lists' α b✝
l0 l₂ : Lists' α true
s : cons' a0 l0 ⊆ l₂
h : a ∈ toList (cons' a0 l0)
⊢ a ∈ l₂

Next tactic:
cases' s with _ _ _ _ _ e m s
theorem mem_of_subset' {a} : ∀ {l₁ l₂ : Lists' α true} (_ : l₁ ⊆ l₂) (_ : a ∈ l₁.toList), a ∈ l₂
  | nil, _, Lists'.Subset.nil, h => by cases h
  | cons' a0 l0, l₂, s, h => by
    cases' s with _ _ _ _ _ e m s
    

Proof state:
case cons
α : Type u_1
a : Lists α
l0 l₂ : Lists' α true
a✝ a'✝ : Lists α
e : a✝ ~ a'✝
h : a ∈ toList (cons' a✝.snd l0)
m : a'✝ ∈ toList l₂
s : Subset l0 l₂
⊢ a ∈ l₂

Next tactic:
simp only [toList, Sigma.eta, List.find?, List.mem_cons] at h
theorem mem_of_subset' {a} : ∀ {l₁ l₂ : Lists' α true} (_ : l₁ ⊆ l₂) (_ : a ∈ l₁.toList), a ∈ l₂
  | nil, _, Lists'.Subset.nil, h => by cases h
  | cons' a0 l0, l₂, s, h => by
    cases' s with _ _ _ _ _ e m s
    simp only [toList, Sigma.eta, List.find?, List.mem_cons] at h
    

Proof state:
case cons
α : Type u_1
a : Lists α
l0 l₂ : Lists' α true
a✝ a'✝ : Lists α
e : a✝ ~ a'✝
m : a'✝ ∈ toList l₂
s : Subset l0 l₂
h : a = a✝ ∨ a ∈ toList l0
⊢ a ∈ l₂

Next tactic:
rcases h with (rfl | h)