state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β ⊢ image (fun i => b ↑i) univ = erase (image b univ) k
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
apply subset_antisymm
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β ⊢ image (fun i => b ↑i) univ ⊆ erase (image b univ) k
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rw [image_subset_iff]
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm ·
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β ⊢ ∀ x ∈ univ, b ↑x ∈ erase (image b univ) k
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
intro i _
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff]
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β i : { a // b a ≠ k } a✝ : i ∈ univ ⊢ b ↑i ∈ erase (image b univ) k
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
apply mem_erase_of_ne_of_mem i.2 (mem_image_of_mem _ (mem_univ _))
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff] intro i _
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β ⊢ erase (image b univ) k ⊆ image (fun i => b ↑i) univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
intro i hi
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff] intro i _ apply mem_erase_of_ne_of_mem i.2 (mem_image_of_mem _ (mem_univ _)) ·
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β i : β hi : i ∈ erase (image b univ) k ⊢ i ∈ image (fun i => b ↑i) univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rw [mem_image]
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff] intro i _ apply mem_erase_of_ne_of_mem i.2 (mem_image_of_mem _ (mem_univ _)) · intro...
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β i : β hi : i ∈ erase (image b univ) k ⊢ ∃ a ∈ univ, b ↑a = i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rcases mem_image.1 (erase_subset _ _ hi) with ⟨a, _, ha⟩
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff] intro i _ apply mem_erase_of_ne_of_mem i.2 (mem_image_of_mem _ (mem_univ _)) · intro...
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a.intro.intro α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β i : β hi : i ∈ erase (image b univ) k a : α left✝ : a ∈ univ ha : b a = i ⊢ ∃ a ∈ univ, b ↑a = i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
subst ha
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff] intro i _ apply mem_erase_of_ne_of_mem i.2 (mem_image_of_mem _ (mem_univ _)) · intro...
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
case a.intro.intro α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β k : β b : α → β a : α left✝ : a ∈ univ hi : b a ∈ erase (image b univ) k ⊢ ∃ a_1 ∈ univ, b ↑a_1 = b a
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
exact ⟨⟨a, ne_of_mem_erase hi⟩, mem_univ _, rfl⟩
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k := by apply subset_antisymm · rw [image_subset_iff] intro i _ apply mem_erase_of_ne_of_mem i.2 (mem_image_of_mem _ (mem_univ _)) · intro...
Mathlib.Data.Fintype.Sum.47_0.wOnqEoxEwKMN7BR
theorem image_subtype_ne_univ_eq_image_erase [Fintype α] [DecidableEq β] (k : β) (b : α → β) : image (fun i : { a // b a ≠ k } => b ↑i) univ = (image b univ).erase k
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : k ∈ image b univ p : β → Prop inst✝ : DecidablePred p hp : ¬p k ⊢ image (fun i => b ↑i) univ ⊂ image b univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
constructor
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case left α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : k ∈ image b univ p : β → Prop inst✝ : DecidablePred p hp : ¬p k ⊢ image (fun i => b ↑i) univ ⊆ image b univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
intro x hx
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor ·
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case left α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : k ∈ image b univ p : β → Prop inst✝ : DecidablePred p hp : ¬p k x : β hx : x ∈ image (fun i => b ↑i) univ ⊢ x ∈ image b univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rcases mem_image.1 hx with ⟨y, _, hy⟩
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case left.intro.intro α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : k ∈ image b univ p : β → Prop inst✝ : DecidablePred p hp : ¬p k x : β hx : x ∈ image (fun i => b ↑i) univ y : { a // p (b a) } left✝ : y ∈ univ hy : b ↑y = x ⊢ x ∈ image b univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
exact hy ▸ mem_image_of_mem b (mem_univ (y : α))
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : k ∈ image b univ p : β → Prop inst✝ : DecidablePred p hp : ¬p k ⊢ ¬image b univ ⊆ image (fun i => b ↑i) univ
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
intro h
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : k ∈ image b univ p : β → Prop inst✝ : DecidablePred p hp : ¬p k h : image b univ ⊆ image (fun i => b ↑i) univ ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rw [mem_image] at hk
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β hk : ∃ a ∈ univ, b a = k p : β → Prop inst✝ : DecidablePred p hp : ¬p k h : image b univ ⊆ image (fun i => b ↑i) univ ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rcases hk with ⟨k', _, hk'⟩
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right.intro.intro α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β k : β b : α → β p : β → Prop inst✝ : DecidablePred p hp : ¬p k h : image b univ ⊆ image (fun i => b ↑i) univ k' : α left✝ : k' ∈ univ hk' : b k' = k ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
subst hk'
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right.intro.intro α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β b : α → β p : β → Prop inst✝ : DecidablePred p h : image b univ ⊆ image (fun i => b ↑i) univ k' : α left✝ : k' ∈ univ hp : ¬p (b k') ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
have := h (mem_image_of_mem b (mem_univ k'))
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right.intro.intro α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β b : α → β p : β → Prop inst✝ : DecidablePred p h : image b univ ⊆ image (fun i => b ↑i) univ k' : α left✝ : k' ∈ univ hp : ¬p (b k') this : b k' ∈ image (fun i => b ↑i) univ ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rw [mem_image] at this
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right.intro.intro α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β b : α → β p : β → Prop inst✝ : DecidablePred p h : image b univ ⊆ image (fun i => b ↑i) univ k' : α left✝ : k' ∈ univ hp : ¬p (b k') this : ∃ a ∈ univ, b ↑a = b k' ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rcases this with ⟨j, _, hj'⟩
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
case right.intro.intro.intro.intro α : Type u_1 β : Type u_2 inst✝² : Fintype α inst✝¹ : DecidableEq β b : α → β p : β → Prop inst✝ : DecidablePred p h : image b univ ⊆ image (fun i => b ↑i) univ k' : α left✝¹ : k' ∈ univ hp : ¬p (b k') j : { a // p (b a) } left✝ : j ∈ univ hj' : b ↑j = b k' ⊢ False
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
exact hp (hj' ▸ j.2)
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ := by constructor · intro x hx rcases mem_image.1 hx with ⟨y, _, hy⟩ ...
Mathlib.Data.Fintype.Sum.60_0.wOnqEoxEwKMN7BR
theorem image_subtype_univ_ssubset_image_univ [Fintype α] [DecidableEq β] (k : β) (b : α → β) (hk : k ∈ Finset.image b univ) (p : β → Prop) [DecidablePred p] (hp : ¬p k) : image (fun i : { a // p (b a) } => b ↑i) univ ⊂ image b univ
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t s : Finset α f : α → β hfst : image f s ⊆ t hfs : Set.InjOn f ↑s ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
classical induction' s using Finset.induction with a s has H generalizing f · obtain ⟨e⟩ : Nonempty (α ≃ ↥t) := by rwa [← Fintype.card_eq, Fintype.card_coe] use e simp have hfst' : Finset.image f s ⊆ t := (Finset.image_mono _ (s.subset_insert a)).trans hfst have hfs' : Set.InjOn f s := hfs.m...
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t s : Finset α f : α → β hfst : image f s ⊆ t hfs : Set.InjOn f ↑s ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
induction' s using Finset.induction with a s has H generalizing f
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case empty α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t f : α → β hfst : image f ∅ ⊆ t hfs : Set.InjOn f ↑∅ ⊢ ∃ g, ∀ i ∈ ∅, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
obtain ⟨e⟩ : Nonempty (α ≃ ↥t) := by rwa [← Fintype.card_eq, Fintype.card_coe]
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t f : α → β hfst : image f ∅ ⊆ t hfs : Set.InjOn f ↑∅ ⊢ Nonempty (α ≃ { x // x ∈ t })
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rwa [← Fintype.card_eq, Fintype.card_coe]
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case empty.intro α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t f : α → β hfst : image f ∅ ⊆ t hfs : Set.InjOn f ↑∅ e : α ≃ { x // x ∈ t } ⊢ ∃ g, ∀ i ∈ ∅, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
use e
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t f : α → β hfst : image f ∅ ⊆ t hfs : Set.InjOn f ↑∅ e : α ≃ { x // x ∈ t } ⊢ ∀ i ∈ ∅, ↑(e i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simp
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case insert α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) ⊢ ∃ g, ∀ i ∈ i...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
have hfst' : Finset.image f s ⊆ t := (Finset.image_mono _ (s.subset_insert a)).trans hfst
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case insert α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image ...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
have hfs' : Set.InjOn f s := hfs.mono (s.subset_insert a)
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case insert α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image ...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
obtain ⟨g', hg'⟩ := H hfst' hfs'
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case insert.intro α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : ...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
have hfat : f a ∈ t := hfst (mem_image_of_mem _ (s.mem_insert_self a))
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case insert.intro α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : ...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
use g'.trans (Equiv.swap (⟨f a, hfat⟩ : t) (g' a))
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image f s ⊆...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simp_rw [mem_insert]
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image f s ⊆...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rintro i (rfl | hi)
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h.inl α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t s : Finset α H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst' : image f s ⊆ t hfs' : Set.InjOn f ↑s g' : α ≃ { x // x ∈ t } hg' : ∀ i ∈ s, ↑(g' i) = f i ...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simp
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h.inr α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image f...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rw [Equiv.trans_apply, Equiv.swap_apply_of_ne_of_ne, hg' _ hi]
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h.inr.a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
exact ne_of_apply_ne Subtype.val (ne_of_eq_of_ne (hg' _ hi) <| hfs.ne (subset_insert _ _ hi) (mem_insert_self _ _) <| ne_of_mem_of_not_mem hi has)
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
case h.inr.a α : Type u_1 β : Type u_2 inst✝¹ : Fintype α inst✝ : DecidableEq β t : Finset β hαt : Fintype.card α = card t a : α s : Finset α has : a ∉ s H : ∀ {f : α → β}, image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i f : α → β hfst : image f (insert a s) ⊆ t hfs : Set.InjOn f ↑(insert a s) hfst' : image...
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
exact g'.injective.ne (ne_of_mem_of_not_mem hi has)
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib.Data.Fintype.Sum.77_0.wOnqEoxEwKMN7BR
/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finse...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
classical let s' : Finset α := s.toFinset have hfst' : s'.image f ⊆ t := by simpa [← Finset.coe_subset] using hfst have hfs' : Set.InjOn f s' := by simpa using hfs obtain ⟨g, hg⟩ := Finset.exists_equiv_extend_of_card_eq hαt hfst' hfs' refine' ⟨g, fun i hi => _⟩ apply hg simpa using hi
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
let s' : Finset α := s.toFinset
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
have hfst' : s'.image f ⊆ t := by simpa [← Finset.coe_subset] using hfst
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s ⊢ Finset.image f s' ⊆ t
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simpa [← Finset.coe_subset] using hfst
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s hfst' : Finset.image f s' ⊆ t ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
have hfs' : Set.InjOn f s' := by simpa using hfs
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s hfst' : Finset.image f s' ⊆ t ⊢ InjOn f ↑s'
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simpa using hfs
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s hfst' : Finset.image f s' ⊆ t hfs' : InjOn f ↑s' ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
obtain ⟨g, hg⟩ := Finset.exists_equiv_extend_of_card_eq hαt hfst' hfs'
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
case intro α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s hfst' : Finset.image f s' ⊆ t hfs' : InjOn f ↑s' g : α ≃ { x // x ∈ t } hg : ∀ i ∈ s', ↑(g i) = f i ⊢ ∃ g, ∀ i ∈ s, ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
refine' ⟨g, fun i hi => _⟩
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
case intro α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s hfst' : Finset.image f s' ⊆ t hfs' : InjOn f ↑s' g : α ≃ { x // x ∈ t } hg : ∀ i ∈ s', ↑(g i) = f i i : α hi : i ∈ s ⊢ ↑(g i) = f i
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
apply hg
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
case intro.a α : Type u_1 β : Type u_2 inst✝ : Fintype α t : Finset β hαt : Fintype.card α = card t s : Set α f : α → β hfst : MapsTo f s ↑t hfs : InjOn f s s' : Finset α := toFinset s hfst' : Finset.image f s' ⊆ t hfs' : InjOn f ↑s' g : α ≃ { x // x ∈ t } hg : ∀ i ∈ s', ↑(g i) = f i i : α hi : i ∈ s ⊢ i ∈ s'
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simpa using hi
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib.Data.Fintype.Sum.103_0.wOnqEoxEwKMN7BR
/-- Any injection from a set `s` in a fintype `α` to a finset `t` of the same cardinality as `α` can be extended to a bijection between `α` and `t`. -/ theorem Set.MapsTo.exists_equiv_extend_of_card_eq [Fintype α] {t : Finset β} (hαt : Fintype.card α = t.card) {s : Set α} {f : α → β} (hfst : s.MapsTo f t) (hfs ...
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 p q : α → Prop inst✝² : Fintype { x // p x } inst✝¹ : Fintype { x // q x } inst✝ : Fintype { x // p x ∨ q x } ⊢ card { x // p x ∨ q x } ≤ card { x // p x } + card { x // q x }
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
classical convert Fintype.card_le_of_embedding (subtypeOrLeftEmbedding p q) rw [Fintype.card_sum]
theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x } := by
Mathlib.Data.Fintype.Sum.118_0.wOnqEoxEwKMN7BR
theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x }
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 p q : α → Prop inst✝² : Fintype { x // p x } inst✝¹ : Fintype { x // q x } inst✝ : Fintype { x // p x ∨ q x } ⊢ card { x // p x ∨ q x } ≤ card { x // p x } + card { x // q x }
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
convert Fintype.card_le_of_embedding (subtypeOrLeftEmbedding p q)
theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x } := by classical
Mathlib.Data.Fintype.Sum.118_0.wOnqEoxEwKMN7BR
theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x }
Mathlib_Data_Fintype_Sum
case h.e'_4 α : Type u_1 β : Type u_2 p q : α → Prop inst✝² : Fintype { x // p x } inst✝¹ : Fintype { x // q x } inst✝ : Fintype { x // p x ∨ q x } ⊢ card { x // p x } + card { x // q x } = card ({ x // p x } ⊕ { x // q x })
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
rw [Fintype.card_sum]
theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x } := by classical convert Fintype.card_le_of_embedding (subtypeOrLeftEmbedding p q)
Mathlib.Data.Fintype.Sum.118_0.wOnqEoxEwKMN7BR
theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x }
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 p q : α → Prop h : Disjoint p q inst✝² : Fintype { x // p x } inst✝¹ : Fintype { x // q x } inst✝ : Fintype { x // p x ∨ q x } ⊢ card { x // p x ∨ q x } = card { x // p x } + card { x // q x }
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
classical convert Fintype.card_congr (subtypeOrEquiv p q h) simp
theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x } := by
Mathlib.Data.Fintype.Sum.126_0.wOnqEoxEwKMN7BR
theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x }
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 p q : α → Prop h : Disjoint p q inst✝² : Fintype { x // p x } inst✝¹ : Fintype { x // q x } inst✝ : Fintype { x // p x ∨ q x } ⊢ card { x // p x ∨ q x } = card { x // p x } + card { x // q x }
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
convert Fintype.card_congr (subtypeOrEquiv p q h)
theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x } := by classical
Mathlib.Data.Fintype.Sum.126_0.wOnqEoxEwKMN7BR
theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x }
Mathlib_Data_Fintype_Sum
case h.e'_3 α : Type u_1 β : Type u_2 p q : α → Prop h : Disjoint p q inst✝² : Fintype { x // p x } inst✝¹ : Fintype { x // q x } inst✝ : Fintype { x // p x ∨ q x } ⊢ card { x // p x } + card { x // q x } = card ({ x // p x } ⊕ { x // q x })
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
simp
theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x } := by classical convert Fintype.card_congr (subtypeOrEquiv p q h...
Mathlib.Data.Fintype.Sum.126_0.wOnqEoxEwKMN7BR
theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }] [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] : Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x }
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 ⊢ Infinite (α ⊕ β) ↔ Infinite α ∨ Infinite β
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
refine' ⟨fun H => _, fun H => H.elim (@Sum.infinite_of_left α β) (@Sum.infinite_of_right α β)⟩
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β := by
Mathlib.Data.Fintype.Sum.138_0.wOnqEoxEwKMN7BR
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 H : Infinite (α ⊕ β) ⊢ Infinite α ∨ Infinite β
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
contrapose! H
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β := by refine' ⟨fun H => _, fun H => H.elim (@Sum.infinite_of_left α β) (@Sum.infinite_of_right α β)⟩
Mathlib.Data.Fintype.Sum.138_0.wOnqEoxEwKMN7BR
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 H : ¬Infinite α ∧ ¬Infinite β ⊢ ¬Infinite (α ⊕ β)
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
haveI := fintypeOfNotInfinite H.1
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β := by refine' ⟨fun H => _, fun H => H.elim (@Sum.infinite_of_left α β) (@Sum.infinite_of_right α β)⟩ contrapose! H;
Mathlib.Data.Fintype.Sum.138_0.wOnqEoxEwKMN7BR
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 H : ¬Infinite α ∧ ¬Infinite β this : Fintype α ⊢ ¬Infinite (α ⊕ β)
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
haveI := fintypeOfNotInfinite H.2
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β := by refine' ⟨fun H => _, fun H => H.elim (@Sum.infinite_of_left α β) (@Sum.infinite_of_right α β)⟩ contrapose! H; haveI := fintypeOfNotInfinite H.1;
Mathlib.Data.Fintype.Sum.138_0.wOnqEoxEwKMN7BR
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β
Mathlib_Data_Fintype_Sum
α : Type u_1 β : Type u_2 H : ¬Infinite α ∧ ¬Infinite β this✝ : Fintype α this : Fintype β ⊢ ¬Infinite (α ⊕ β)
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ import Mathlib.Data.Fintype.Card import Mathlib.Data.Finset.Sum import Mathlib.Logic.Embedding.Set #align_import data.fintype.sum from "leanprover-community/mathlib"...
exact Infinite.false
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β := by refine' ⟨fun H => _, fun H => H.elim (@Sum.infinite_of_left α β) (@Sum.infinite_of_right α β)⟩ contrapose! H; haveI := fintypeOfNotInfinite H.1; haveI := fintypeOfNotInfinite H.2
Mathlib.Data.Fintype.Sum.138_0.wOnqEoxEwKMN7BR
@[simp] theorem infinite_sum : Infinite (Sum α β) ↔ Infinite α ∨ Infinite β
Mathlib_Data_Fintype_Sum
m : Type u → Type u inst✝ : Monad m α β : Type u f : β → α → β ⊢ ∀ (x y : FreeMonoid α), OneHom.toFun { toFun := fun xs => op (flip (List.foldl f) (FreeMonoid.toList xs)), map_one' := (_ : (fun xs => op (flip (List.foldl f) (FreeMonoid.toList xs))) 1 = (fu...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
intros
@[simps] def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β where toFun xs := op <| flip (List.foldl f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by
Mathlib.Control.Fold.120_0.ilkJEkQU7vZZ6HB
@[simps] def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β where toFun xs
Mathlib_Control_Fold
m : Type u → Type u inst✝ : Monad m α β : Type u f : β → α → β x✝ y✝ : FreeMonoid α ⊢ OneHom.toFun { toFun := fun xs => op (flip (List.foldl f) (FreeMonoid.toList xs)), map_one' := (_ : (fun xs => op (flip (List.foldl f) (FreeMonoid.toList xs))) 1 = (fun xs => op (flip ...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj]
@[simps] def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β where toFun xs := op <| flip (List.foldl f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros;
Mathlib.Control.Fold.120_0.ilkJEkQU7vZZ6HB
@[simps] def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β where toFun xs
Mathlib_Control_Fold
m : Type u → Type u inst✝ : Monad m α β : Type u f : β → α → β x✝ y✝ : FreeMonoid α ⊢ (op fun a => List.foldl f (List.foldl f a (FreeMonoid.toList x✝)) (FreeMonoid.toList y✝)) = (op fun a => List.foldl f a (FreeMonoid.toList x✝)) * op fun a => List.foldl f a (FreeMonoid.toList y✝)
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rfl
@[simps] def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β where toFun xs := op <| flip (List.foldl f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros; simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj];
Mathlib.Control.Fold.120_0.ilkJEkQU7vZZ6HB
@[simps] def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β where toFun xs
Mathlib_Control_Fold
m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : β → α → m β ⊢ ∀ (x y : FreeMonoid α), OneHom.toFun { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := (_ : (fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
intros
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs := op <| flip (List.foldlM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by
Mathlib.Control.Fold.163_0.ilkJEkQU7vZZ6HB
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs
Mathlib_Control_Fold
m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : β → α → m β x✝ y✝ : FreeMonoid α ⊢ OneHom.toFun { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := (_ : (fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs))) 1 = ...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
apply unop_injective
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs := op <| flip (List.foldlM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros;
Mathlib.Control.Fold.163_0.ilkJEkQU7vZZ6HB
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs
Mathlib_Control_Fold
case a m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : β → α → m β x✝ y✝ : FreeMonoid α ⊢ unop (OneHom.toFun { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := (_ : (fun xs => op (flip (List.foldlM f) (FreeMono...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
funext
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs := op <| flip (List.foldlM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros; apply unop_injective;
Mathlib.Control.Fold.163_0.ilkJEkQU7vZZ6HB
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs
Mathlib_Control_Fold
case a.h m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : β → α → m β x✝¹ y✝ : FreeMonoid α x✝ : KleisliCat.mk m β ⊢ unop (OneHom.toFun { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := (_ : (fun xs => op (flip...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
apply List.foldlM_append
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs := op <| flip (List.foldlM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros; apply unop_injective; funext;
Mathlib.Control.Fold.163_0.ilkJEkQU7vZZ6HB
@[simps] def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β where toFun xs
Mathlib_Control_Fold
m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : α → β → m β ⊢ ∀ (x y : FreeMonoid α), OneHom.toFun { toFun := fun xs => flip (List.foldrM f) (FreeMonoid.toList xs), map_one' := (_ : (fun xs => flip (List.foldrM f) (FreeMonoid.toList xs)) 1 = ...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
intros
@[simps] def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β where toFun xs := flip (List.foldrM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by
Mathlib.Control.Fold.184_0.ilkJEkQU7vZZ6HB
@[simps] def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β where toFun xs
Mathlib_Control_Fold
m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : α → β → m β x✝ y✝ : FreeMonoid α ⊢ OneHom.toFun { toFun := fun xs => flip (List.foldrM f) (FreeMonoid.toList xs), map_one' := (_ : (fun xs => flip (List.foldrM f) (FreeMonoid.toList xs)) 1 = (fu...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
funext
@[simps] def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β where toFun xs := flip (List.foldrM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros;
Mathlib.Control.Fold.184_0.ilkJEkQU7vZZ6HB
@[simps] def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β where toFun xs
Mathlib_Control_Fold
case h m : Type u → Type u inst✝¹ : Monad m α β : Type u inst✝ : LawfulMonad m f : α → β → m β x✝¹ y✝ : FreeMonoid α x✝ : KleisliCat.mk m β ⊢ OneHom.toFun { toFun := fun xs => flip (List.foldrM f) (FreeMonoid.toList xs), map_one' := (_ : (fun xs => flip (List.foldrM f) (FreeMonoid.to...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
apply List.foldrM_append
@[simps] def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β where toFun xs := flip (List.foldrM f) (FreeMonoid.toList xs) map_one' := rfl map_mul' := by intros; funext;
Mathlib.Control.Fold.184_0.ilkJEkQU7vZZ6HB
@[simps] def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β where toFun xs
Mathlib_Control_Fold
α β γ : Type u inst✝¹ : Monoid α inst✝ : Monoid β f : α →* β ⊢ ∀ {α_1 : Type ?u.11039} (x : α_1), (fun x => ⇑f) α_1 (pure x) = pure x
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
intros
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _ := f preserves_seq' := by intros; simp only [Seq.seq, map_mul] preserves_pure' := by
Mathlib.Control.Fold.256_0.ilkJEkQU7vZZ6HB
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _
Mathlib_Control_Fold
α β γ : Type u inst✝¹ : Monoid α inst✝ : Monoid β f : α →* β α✝ : Type ?u.11039 x✝ : α✝ ⊢ (fun x => ⇑f) α✝ (pure x✝) = pure x✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [map_one, pure]
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _ := f preserves_seq' := by intros; simp only [Seq.seq, map_mul] preserves_pure' := by intros;
Mathlib.Control.Fold.256_0.ilkJEkQU7vZZ6HB
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _
Mathlib_Control_Fold
α β γ : Type u inst✝¹ : Monoid α inst✝ : Monoid β f : α →* β ⊢ ∀ {α_1 β_1 : Type ?u.11039} (x : Const α (α_1 → β_1)) (y : Const α α_1), (fun x => ⇑f) β_1 (Seq.seq x fun x => y) = Seq.seq ((fun x => ⇑f) (α_1 → β_1) x) fun x => (fun x => ⇑f) α_1 y
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
intros
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _ := f preserves_seq' := by
Mathlib.Control.Fold.256_0.ilkJEkQU7vZZ6HB
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _
Mathlib_Control_Fold
α β γ : Type u inst✝¹ : Monoid α inst✝ : Monoid β f : α →* β α✝ β✝ : Type ?u.11039 x✝ : Const α (α✝ → β✝) y✝ : Const α α✝ ⊢ (fun x => ⇑f) β✝ (Seq.seq x✝ fun x => y✝) = Seq.seq ((fun x => ⇑f) (α✝ → β✝) x✝) fun x => (fun x => ⇑f) α✝ y✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [Seq.seq, map_mul]
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _ := f preserves_seq' := by intros;
Mathlib.Control.Fold.256_0.ilkJEkQU7vZZ6HB
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝³ : Traversable t inst✝² : LawfulTraversable t m : Type u → Type u inst✝¹ : Monad m inst✝ : LawfulMonad m f : α → β → m α ⊢ ⇑(foldlM.ofFreeMonoid f) ∘ FreeMonoid.of = foldlM.mk ∘ flip f
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
ext1 x
@[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
Mathlib.Control.Fold.317_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f
Mathlib_Control_Fold
case h α β γ : Type u t : Type u → Type u inst✝³ : Traversable t inst✝² : LawfulTraversable t m : Type u → Type u inst✝¹ : Monad m inst✝ : LawfulMonad m f : α → β → m α x : β ⊢ (⇑(foldlM.ofFreeMonoid f) ∘ FreeMonoid.of) x = (foldlM.mk ∘ flip f) x
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp [(· ∘ ·), foldlM.ofFreeMonoid, foldlM.mk, flip]
@[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by ext1 x
Mathlib.Control.Fold.317_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f
Mathlib_Control_Fold
case h α β γ : Type u t : Type u → Type u inst✝³ : Traversable t inst✝² : LawfulTraversable t m : Type u → Type u inst✝¹ : Monad m inst✝ : LawfulMonad m f : α → β → m α x : β ⊢ (fun a => f a x) = fun a => f a x
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rfl
@[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by ext1 x simp [(· ∘ ·), foldlM.ofFreeMonoid, foldlM.mk, flip]
Mathlib.Control.Fold.317_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝³ : Traversable t inst✝² : LawfulTraversable t m : Type u → Type u inst✝¹ : Monad m inst✝ : LawfulMonad m f : β → α → m α ⊢ ⇑(foldrM.ofFreeMonoid f) ∘ FreeMonoid.of = foldrM.mk ∘ f
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
ext
@[simp] theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) : foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by
Mathlib.Control.Fold.325_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) : foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f
Mathlib_Control_Fold
case h α β γ : Type u t : Type u → Type u inst✝³ : Traversable t inst✝² : LawfulTraversable t m : Type u → Type u inst✝¹ : Monad m inst✝ : LawfulMonad m f : β → α → m α x✝ : β ⊢ (⇑(foldrM.ofFreeMonoid f) ∘ FreeMonoid.of) x✝ = (foldrM.mk ∘ f) x✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, flip]
@[simp] theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) : foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by ext
Mathlib.Control.Fold.325_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) : foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : t α ⊢ FreeMonoid.toList (foldMap FreeMonoid.of xs) = FreeMonoid.toList (List.reverse (List.reverse (foldMap FreeMonoid.of xs)))
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [List.reverse_reverse]
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) := Eq.symm <| calc FreeMonoid.toList (foldMap FreeMonoid.of xs) = FreeMonoid.toList (foldMap FreeMonoid.of xs).reverse.reverse := by
Mathlib.Control.Fold.332_0.ilkJEkQU7vZZ6HB
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : t α ⊢ FreeMonoid.toList (List.reverse (List.reverse (foldMap FreeMonoid.of xs))) = FreeMonoid.toList (List.reverse (List.foldr cons [] (List.reverse (foldMap FreeMonoid.of xs))))
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [List.foldr_eta]
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) := Eq.symm <| calc FreeMonoid.toList (foldMap FreeMonoid.of xs) = FreeMonoid.toList (foldMap FreeMonoid.of xs).reverse.reverse := by simp only [List.reverse_reverse] _ = FreeMonoid.toList (Lis...
Mathlib.Control.Fold.332_0.ilkJEkQU7vZZ6HB
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : t α ⊢ FreeMonoid.toList (List.reverse (List.foldr cons [] (List.reverse (foldMap FreeMonoid.of xs)))) = List.reverse (unop ((Foldl.ofFreeMonoid (flip cons)) (foldMap FreeMonoid.of xs)) [])
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp [flip, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) := Eq.symm <| calc FreeMonoid.toList (foldMap FreeMonoid.of xs) = FreeMonoid.toList (foldMap FreeMonoid.of xs).reverse.reverse := by simp only [List.reverse_reverse] _ = FreeMonoid.toList (Lis...
Mathlib.Control.Fold.332_0.ilkJEkQU7vZZ6HB
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : t α ⊢ List.reverse (unop ((Foldl.ofFreeMonoid (flip cons)) (foldMap FreeMonoid.of xs)) []) = toList xs
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rw [foldMap_hom_free (Foldl.ofFreeMonoid (flip <| @cons α))]
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) := Eq.symm <| calc FreeMonoid.toList (foldMap FreeMonoid.of xs) = FreeMonoid.toList (foldMap FreeMonoid.of xs).reverse.reverse := by simp only [List.reverse_reverse] _ = FreeMonoid.toList (Lis...
Mathlib.Control.Fold.332_0.ilkJEkQU7vZZ6HB
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : t α ⊢ List.reverse (unop (foldMap (⇑(Foldl.ofFreeMonoid (flip cons)) ∘ FreeMonoid.of) xs) []) = toList xs
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [toList, foldl, List.reverse_inj, Foldl.get, foldl.ofFreeMonoid_comp_of, Function.comp_apply]
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) := Eq.symm <| calc FreeMonoid.toList (foldMap FreeMonoid.of xs) = FreeMonoid.toList (foldMap FreeMonoid.of xs).reverse.reverse := by simp only [List.reverse_reverse] _ = FreeMonoid.toList (Lis...
Mathlib.Control.Fold.332_0.ilkJEkQU7vZZ6HB
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝² : Traversable t inst✝¹ : LawfulTraversable t inst✝ : Monoid γ f : α → β g : β → γ xs : t α ⊢ foldMap g (f <$> xs) = foldMap (g ∘ f) xs
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [foldMap, traverse_map, Function.comp]
theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) : foldMap g (f <$> xs) = foldMap (g ∘ f) xs := by
Mathlib.Control.Fold.348_0.ilkJEkQU7vZZ6HB
theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) : foldMap g (f <$> xs) = foldMap (g ∘ f) xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t f : α → β → α xs : t β x : α ⊢ foldl f x xs = List.foldl f x (toList xs)
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rw [← FreeMonoid.toList_ofList (toList xs), ← foldl.unop_ofFreeMonoid]
theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) : foldl f x xs = List.foldl f x (toList xs) := by
Mathlib.Control.Fold.352_0.ilkJEkQU7vZZ6HB
theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) : foldl f x xs = List.foldl f x (toList xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t f : α → β → α xs : t β x : α ⊢ foldl f x xs = unop ((Foldl.ofFreeMonoid f) (FreeMonoid.ofList (toList xs))) x
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [foldl, toList_spec, foldMap_hom_free, foldl.ofFreeMonoid_comp_of, Foldl.get, FreeMonoid.ofList_toList]
theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) : foldl f x xs = List.foldl f x (toList xs) := by rw [← FreeMonoid.toList_ofList (toList xs), ← foldl.unop_ofFreeMonoid]
Mathlib.Control.Fold.352_0.ilkJEkQU7vZZ6HB
theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) : foldl f x xs = List.foldl f x (toList xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t f : α → β → β xs : t α x : β ⊢ foldr f x xs = List.foldr f x (toList xs)
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
change _ = Foldr.ofFreeMonoid _ (FreeMonoid.ofList <| toList xs) _
theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) : foldr f x xs = List.foldr f x (toList xs) := by
Mathlib.Control.Fold.359_0.ilkJEkQU7vZZ6HB
theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) : foldr f x xs = List.foldr f x (toList xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t f : α → β → β xs : t α x : β ⊢ foldr f x xs = (Foldr.ofFreeMonoid f) (FreeMonoid.ofList (toList xs)) x
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rw [toList_spec, foldr, Foldr.get, FreeMonoid.ofList_toList, foldMap_hom_free, foldr.ofFreeMonoid_comp_of]
theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) : foldr f x xs = List.foldr f x (toList xs) := by change _ = Foldr.ofFreeMonoid _ (FreeMonoid.ofList <| toList xs) _
Mathlib.Control.Fold.359_0.ilkJEkQU7vZZ6HB
theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) : foldr f x xs = List.foldr f x (toList xs)
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t f : α → β xs : t α ⊢ toList (f <$> xs) = f <$> toList xs
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [toList_spec, Free.map_eq_map, foldMap_hom, foldMap_map, FreeMonoid.ofList_toList, FreeMonoid.map_of, (· ∘ ·)]
theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toList xs := by
Mathlib.Control.Fold.366_0.ilkJEkQU7vZZ6HB
theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toList xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t g : β → γ f : α → γ → α a : α l : t β ⊢ foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [foldl, foldMap_map, (· ∘ ·), flip]
@[simp] theorem foldl_map (g : β → γ) (f : α → γ → α) (a : α) (l : t β) : foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l := by
Mathlib.Control.Fold.371_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldl_map (g : β → γ) (f : α → γ → α) (a : α) (l : t β) : foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t g : β → γ f : γ → α → α a : α l : t β ⊢ foldr f a (g <$> l) = foldr (f ∘ g) a l
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [foldr, foldMap_map, (· ∘ ·), flip]
@[simp] theorem foldr_map (g : β → γ) (f : γ → α → α) (a : α) (l : t β) : foldr f a (g <$> l) = foldr (f ∘ g) a l := by
Mathlib.Control.Fold.377_0.ilkJEkQU7vZZ6HB
@[simp] theorem foldr_map (g : β → γ) (f : γ → α → α) (a : α) (l : t β) : foldr f a (g <$> l) = foldr (f ∘ g) a l
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : List α ⊢ toList xs = xs
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
simp only [toList_spec, foldMap, traverse]
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t xs : List α ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) xs) = xs
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
induction xs
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse]
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
case nil α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) []) = [] case cons α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t head✝ : α tail✝ : List α tail_ih✝ : FreeMonoid.toList (Li...
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
case nil => rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) []) = []
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
case nil => rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) []) = []
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs case nil =>
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
case cons α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t head✝ : α tail✝ : List α tail_ih✝ : FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) tail✝) = tail✝ ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) (head✝ :: tail✝)) = head✝ :: tail✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
case cons _ _ ih => conv_rhs => rw [← ih]; rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs case nil => rfl
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t head✝ : α tail✝ : List α ih : FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) tail✝) = tail✝ ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) (head✝ :: tail✝)) = head✝ :: tail✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
case cons _ _ ih => conv_rhs => rw [← ih]; rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs case nil => rfl
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t head✝ : α tail✝ : List α ih : FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) tail✝) = tail✝ ⊢ FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) (head✝ :: tail✝)) = head✝ :: tail✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
conv_rhs => rw [← ih]; rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs case nil => rfl case cons _ _ ih =>
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold
α β γ : Type u t : Type u → Type u inst✝¹ : Traversable t inst✝ : LawfulTraversable t head✝ : α tail✝ : List α ih : FreeMonoid.toList (List.traverse (Const.mk' ∘ FreeMonoid.of) tail✝) = tail✝ | head✝ :: tail✝
/- Copyright (c) 2018 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon, Sean Leather -/ import Mathlib.Algebra.Group.Opposite import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Control.Traversable.Instances import Mathlib.Control.Traversable....
rw [← ih]; rfl
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs := by simp only [toList_spec, foldMap, traverse] induction xs case nil => rfl case cons _ _ ih => conv_rhs =>
Mathlib.Control.Fold.382_0.ilkJEkQU7vZZ6HB
@[simp] theorem toList_eq_self {xs : List α} : toList xs = xs
Mathlib_Control_Fold