Answers.Body: <p>I used this <a href="http://www.gadycosteff.com/cql" rel="nofollow noreferrer">CQL</a> query to find such positions:</p>
  <pre><code>cql(input Mega_Database_2022.pgn)
  
  flipcolor {
      pinningPieces = pin from A
      pinnedPieces = pin through a
  
      line --&gt; pin from A
           --&gt; {
                   wtm
                   mate
                   pin from A == pinningPieces
                   pin through a != pinnedPieces
               }
  }
  </code></pre>
  <ul>
  <li><code>flipcolor</code>: check if a position meets the criteria for the given colours, then reverse them.</li>
  <li><code>pin from A</code>: a white piece (<code>A</code>) pins the black king. <code>from</code> is the first argument, therefore the squares of the pinning pieces are returned. These <em>shouldn't</em> change - they aren't moved.</li>
  <li><code>pin through a</code>: a black piece (<code>a</code>) is pinned against its own king. <code>through</code> is the first argument, therefore the squares of the pinned pieces are returned. These <em>should</em> change - one moved to mate the other side.</li>
  <li><code>wtm mate</code>: white has been mated.</li>
  <li><code>line --&gt; a --&gt; b</code>: the current position should match filter <code>a</code> and the position after the next move should math filter <code>b</code>.</li>
  </ul>
  <p>Running the script against Mega Database 2022 only returns 9 (!) games. All follow the same pattern: a pawn is &quot;pinned&quot; by a major piece and moves to give checkmate.</p>
  <p>Only 2 are master games:</p>
  <ol>
  <li><p><a href="https://ratings.fide.com/profile/2100738" rel="nofollow noreferrer">Rocha, Wellington Carlos</a> vs. <a href="https://ratings.fide.com/profile/2100118" rel="nofollow noreferrer">Braga, Cicero Nogueira</a> at the Paulisto Championship (1999):</p>
  <pre><code>[FEN &quot;&quot;]
  [Event &quot;Paulisto-ch final&quot;]
  [Site &quot;Americana&quot;]
  [Date &quot;1999&quot;]
  [Round &quot;5&quot;]
  [White &quot;Rocha, Wellington Carlos&quot;]
  [Black &quot;Braga, Cicero Nogueira&quot;]
  [Result &quot;1-0&quot;]
  [ECO &quot;B23&quot;]
  [WhiteElo &quot;2361&quot;]
  [BlackElo &quot;2405&quot;]
  [PlyCount &quot;81&quot;]
  [StartPly &quot;80&quot;]
  
  1. e4 c5 2. Nc3 Nc6 3. f4 g6 4. Nf3 Bg7 5. Bc4 e6 6. O-O Nge7
  7. d3 d5 8. Bb3 O-O 9. Qe1 Na5 10. exd5 Nxb3 11. axb3 exd5 12. Qf2 d4
  13. Ne4 b6 14. Bd2 Nd5 15. Rfe1 h6 16. Ne5 Kh7 17. Qf3 f5 18. Nf2 Bb7
  19. c4 dxc3 20. bxc3 Qc7 21. Qg3 Ne7 22. h4 Bf6 23. Nh3 Rg8 24. Re2 Rg7
  25. Rae1 Rd8 26.Nf2 Ba8 27. Nf3 Nd5 28. Ng5+ hxg5 29. hxg5 Be7 30. c4 Nb4
  31. Bc3 Rd4 32. Bxd4 cxd4 33. Qh3+ Kg8 34. g4 Qb7 35. gxf5 gxf5 36. Ne4 Nxd3
  37. Nf6+ Bxf6 38. Re8+ Kf7 39. Qh5+ Rg6 40. Qh7+ Rg7 41. g6# 1-0
  </code></pre>
  </li>
  <li><p><a href="https://ratings.fide.com/profile/13300857" rel="nofollow noreferrer">Petrosyan, Manuel</a> vs. <a href="https://ratings.fide.com/profile/623539" rel="nofollow noreferrer">Vachier Lagrave, Maxime</a> at a Titled Tuesday blitz on chess.com (2020)</p>
  <pre><code>[FEN &quot;&quot;]
  [Event &quot;Titled Tuesday intern op 9th June&quot;]
  [Site &quot;Chess.com INT&quot;]
  [Date &quot;2020.06.09&quot;]
  [Round &quot;4&quot;]
  [White &quot;Petrosyan, Manuel&quot;]
  [Black &quot;Vachier Lagrave, Maxime&quot;]
  [Result &quot;0-1&quot;]
  [ECO &quot;D12&quot;]
  [WhiteElo &quot;2607&quot;]
  [BlackElo &quot;2778&quot;]
  [PlyCount &quot;96&quot;]
  [EventDate &quot;2020.06.09&quot;]
  [StartPly &quot;95&quot;]
  
  1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 5. Nc3 e6 6. Nh4 Be4
  7. f3 Bg6 8. Qb3 Qc7 9. Bd2 Be7 10. Rc1 Nbd7 11. g3 dxc4 12. Bxc4 a6 13. a4
  O-O 14. Nxg6 hxg6 15. O-O b5 16. Be2 Qb6 17. Ne4 Rfc8 18. Rc2 Nxe4 19. fxe4 b4
  20. Rfc1 Qb7 21. e5 c5 22. Kf2 Rab8 23. Bf3 Qa7 24. Qd3 Rd8 25. Qe4 Qb6 26. b3
  a5 27. h4 cxd4 28. exd4 Nf8 29. Be3 Rd7 30. d5 exd5 31. Qxd5 Qd8 32. Qc4 Ne6
  33. Bg4 Rd5 34. Bxe6 fxe6 35. Qg4 Rxe5 36. Bf4 Rf5 37. Qxg6 Qd5 38. Rc8+ Rxc8
  39. Rxc8+ Bf8 40. Kg1 Qxb3 41. Re8 Rf6 42. Qg4 Qb1+ 43. Kh2 Qe4 44. Qg5 b3 45.
  Bd6 Qe2+ 46. Kh3 Qf1+ 47. Kg4 Qf5+ 48. Kh5 g6# 0-1
  </code></pre>
  </li>
  </ol>
  <p>Reference (from CQL documentation):</p>
  <ul>
  <li><a href="http://www.gadycosteff.com/cql/flipcolor.html" rel="nofollow noreferrer"><code>flipcolor</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/pin.html" rel="nofollow noreferrer"><code>pin</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/line.html" rel="nofollow noreferrer"><code>line</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/arrow.html" rel="nofollow noreferrer">Arrows: <code>--&gt;</code>, <code>&lt;--</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/wtm.html" rel="nofollow noreferrer"><code>wtm</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/mate.html" rel="nofollow noreferrer"><code>mate</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/relationaloperator.html#notequal" rel="nofollow noreferrer"><code>!=</code></a>, <a href="http://www.gadycosteff.com/cql/relationaloperator.html#equal" rel="nofollow noreferrer"><code>==</code></a></li>
  <li><a href="http://www.gadycosteff.com/cql/variables.html" rel="nofollow noreferrer">Variables</a></li>
  </ul>
  <p>Download CQL for Windows and Mac along with some examples <a href="http://www.gadycosteff.com/cql/download.html" rel="nofollow noreferrer">from the official website</a>. Email the authors for the Linux distribution.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-04T19:33:15.220Z
Answers.Text: I don't think the Petrosyan - MVL game matches. The white Pg5 is pinned, but it is the Black Pg7 that moves to deliver mate, and that seems to confuse your nice CQL search. +1 anyway, nice cql-fu and the first game is a great discovery !
Answers.UserDisplayName: Evargalo
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-05T10:14:56.020Z
Answers.Text: @Evargalo no idea what happened, the piece on g5 was a white queen.
Answers.UserDisplayName: double-beep
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-04T17:32:36.923Z
Answers.LastActivityDate: 2022-01-05T10:14:35.173Z
Answers.LastEditDate: 2022-01-05T10:14:35.173Z
Answers.UserDisplayName: double-beep
Body: <p>We know that an absolutely pinned piece (a piece pinned against its own king) can move and give a check, and the check can even be a mate.</p>
  <p>The following is an example of such a checkmate.</p>
  <pre><code>[FEN &quot;8/8/2k5/8/4p2b/r7/3RKPBr/q7 w - - 0 1&quot;]
  
  1. f4 exf3#
  </code></pre>
  <p>Source: A. Skodras, <a href="https://www.quora.com/In-chess-why-cant-an-absolutely-pinned-piece-move-to-deliver-checkmate?share=1" rel="nofollow noreferrer">Quora</a></p>
  <p><strong>I am interested in knowing whether this has ever occurred in a master game</strong>; say, both opponents are rated 2000+ and the game was competitive (e.g. in a tournament).</p>
  <p>Note: To be clear, I would like to exclude the case of a pinned piece capturing the pinning piece and checkmating the opponent king at the same time (unless it is still in absolute pin). Thanks to Evargalo for pointing this out.</p>
  <p>I suppose this happening in a game would be rare, let alone in a master game. But, the first impression (I had) that &quot;moving a pinned piece and giving check cannont be a good move&quot; is wrong.</p>
  <pre><code>[Title &quot;Schatz vs. Giegold, Hof (1928)&quot;]
  [FEN &quot;7k/pb5q/1p3p2/2p1p1p1/6P1/QP4KR/P4PP1/1B5r b - - 0 1&quot;]
  
  1... Qh4+
  </code></pre>
  <p>Source: Martin Weteschnik, <a href="https://www.pathtochessmastery.com/2012/06/book-completed-understanding-chess.html" rel="nofollow noreferrer">Understanding Chess Tactics</a> (btw, this is one of the best books on how tactics work).</p>
  <p>Here, the move 1... Qh4+ is the best move (along with 1... Rxh3+ which is a slightly slower mate).</p>
  <h2>Addendum</h2>
  <p><a href="http://www.gadycosteff.com/cql/" rel="nofollow noreferrer">CQL</a> may be the best solution for questions of this type. One way I can think of to form a CQL query is the following (and its <code>flipcolor</code> variant):</p>
  <ol>
  <li>white gives check (and mates black) in the current position,</li>
  <li>the piece last moved is X,</li>
  <li>if piece X is removed from the previous position, then white is in check.</li>
  </ol>
  <p>I don't know how (or whether) step 3 can be expressed in CQL.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-03T16:56:22.027Z
Comments.Text: You can use the filter *pin* to identify pinned pieces.
Comments.UserDisplayName: kamekura
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-03T17:21:08.300Z
Comments.Text: @kamekura Thanks. Is there a way to identify absolute pin?
Comments.UserDisplayName: Cyriac Antony
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-03T18:31:12.637Z
Comments.Text: In CQL, the value of pin is the set of squares on which there is a piece pinned against its own king by a piece of the opposing color. I.e. "pin" means absolute pin.
Comments.UserDisplayName: kamekura
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-04T07:37:31.127Z
Comments.Text: Terminological nitpick: "Absolutely" pinned means, well, absolutely. (At least in German, where the three kinds of pin are clearly distinguished: "echt", "halbecht", "unecht".) In problemists terms, you describe a "Pelle move" (a move along the pin line, which includes the very special en passant case).
Comments.UserDisplayName: Hauke Reddmann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-05T04:20:18.070Z
Comments.Text: @HaukeReddmann That's interesting. It is unfortunate that "absolute pin" in English can mean two different things. The definition I am using is "pinned to the king".
Comments.UserDisplayName: Cyriac Antony
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-04T19:26:39.373Z
Comments.Text: I imagine you want to exclude the trivial case when the pinned piece captures the pinning piece, e.g. W:Ke1,Qe2 / B:Kg8,Re8,Pf7,g7,h7 1.Qxe8#, but I don't think the current phrasing of the question address this.
Comments.UserDisplayName: Evargalo
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-05T01:40:00.863Z
Comments.Text: @Evargalo Sure. I shall add a clarification note. Thanks.
Comments.UserDisplayName: Cyriac Antony
Tags: <checkmate><master-games><pins><cql>
Title: Moving absolutely pinned piece to give checkmate: has this ever occured in a master game?
ThreadText: # Moving absolutely pinned piece to give checkmate: has this ever occured in a master game?
  
  (Asked by: username_0 on 2021-05-03)
  
  We know that an absolutely pinned piece (a piece pinned against its own king) can move and give a check, and the check can even be a mate.
  
  The following is an example of such a checkmate.
  
  ```
  [FEN "8/8/2k5/8/4p2b/r7/3RKPBr/q7 w - - 0 1"]
  
  1. f4 exf3#
  
  ```
  
  Source: A. Skodras, [Quora](https://www.quora.com/In-chess-why-cant-an-absolutely-pinned-piece-move-to-deliver-checkmate?share=1)
  
  **I am interested in knowing whether this has ever occurred in a master game**; say, both opponents are rated 2000+ and the game was competitive (e.g. in a tournament).
  
  Note: To be clear, I would like to exclude the case of a pinned piece capturing the pinning piece and checkmating the opponent king at the same time (unless it is still in absolute pin). Thanks to username_3 for pointing this out.
  
  I suppose this happening in a game would be rare, let alone in a master game. But, the first impression (I had) that "moving a pinned piece and giving check cannont be a good move" is wrong.
  
  ```
  [Title "Schatz vs. Giegold, Hof (1928)"]
  [FEN "7k/pb5q/1p3p2/2p1p1p1/6P1/QP4KR/P4PP1/1B5r b - - 0 1"]
  
  1... Qh4+
  
  ```
  
  Source: Martin Weteschnik, [Understanding Chess Tactics](https://www.pathtochessmastery.com/2012/06/book-completed-understanding-chess.html) (btw, this is one of the best books on how tactics work).
  
  Here, the move 1... Qh4+ is the best move (along with 1... Rxh3+ which is a slightly slower mate).
  
  ## Addendum
  
  [CQL](http://www.gadycosteff.com/cql/) may be the best solution for questions of this type. One way I can think of to form a CQL query is the following (and its `flipcolor` variant):
  
  1. white gives check (and mates black) in the current position,
  2. the piece last moved is X,
  3. if piece X is removed from the previous position, then white is in check.
  
  I don't know how (or whether) step 3 can be expressed in CQL.
  
  **Tags:** checkmate, master-games, pins, cql
  
  > **Comments:**
  > **username_1**: You can use the filter *pin* to identify pinned pieces.  
  > **username_0**: @username_1 Thanks. Is there a way to identify absolute pin?  
  > **username_1**: In CQL, the value of pin is the set of squares on which there is a piece pinned against its own king by a piece of the opposing color. I.e. "pin" means absolute pin.  
  > **username_2**: Terminological nitpick: "Absolutely" pinned means, well, absolutely. (At least in German, where the three kinds of pin are clearly distinguished: "echt", "halbecht", "unecht".) In problemists terms, you describe a "Pelle move" (a move along the pin line, which includes the very special en passant case).  
  > **username_0**: @username_2 That's interesting. It is unfortunate that "absolute pin" in English can mean two different things. The definition I am using is "pinned to the king".  
  > **username_3**: I imagine you want to exclude the trivial case when the pinned piece captures the pinning piece, e.g. W:Ke1,Qe2 / B:Kg8,Re8,Pf7,g7,h7 1.Qxe8#, but I don't think the current phrasing of the question address this.  
  > **username_0**: @username_3 Sure. I shall add a clarification note. Thanks.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2022-01-04. Score: 8 | Accepted answer
  
  I used this [CQL](http://www.gadycosteff.com/cql) query to find such positions:
  
  ```
  cql(input Mega_Database_2022.pgn)
  
  flipcolor {
      pinningPieces = pin from A
      pinnedPieces = pin through a
  
      line --> pin from A
           --> {
                   wtm
                   mate
                   pin from A == pinningPieces
                   pin through a != pinnedPieces
               }
  }
  
  ```
  
  * `flipcolor`: check if a position meets the criteria for the given colours, then reverse them.
  * `pin from A`: a white piece (`A`) pins the black king. `from` is the first argument, therefore the squares of the pinning pieces are returned. These *shouldn't* change - they aren't moved.
  * `pin through a`: a black piece (`a`) is pinned against its own king. `through` is the first argument, therefore the squares of the pinned pieces are returned. These *should* change - one moved to mate the other side.
  * `wtm mate`: white has been mated.
  * `line --> a --> b`: the current position should match filter `a` and the position after the next move should math filter `b`.
  
  Running the script against Mega Database 2022 only returns 9 (!) games. All follow the same pattern: a pawn is "pinned" by a major piece and moves to give checkmate.
  
  Only 2 are master games:
  
  1. [Rocha, Wellington Carlos](https://ratings.fide.com/profile/2100738) vs. [Braga, Cicero Nogueira](https://ratings.fide.com/profile/2100118) at the Paulisto Championship (1999):
  
     ```
     [FEN ""]
     [Event "Paulisto-ch final"]
     [Site "Americana"]
     [Date "1999"]
     [Round "5"]
     [White "Rocha, Wellington Carlos"]
     [Black "Braga, Cicero Nogueira"]
     [Result "1-0"]
     [ECO "B23"]
     [WhiteElo "2361"]
     [BlackElo "2405"]
     [PlyCount "81"]
     [StartPly "80"]
  
     1. e4 c5 2. Nc3 Nc6 3. f4 g6 4. Nf3 Bg7 5. Bc4 e6 6. O-O Nge7
     7. d3 d5 8. Bb3 O-O 9. Qe1 Na5 10. exd5 Nxb3 11. axb3 exd5 12. Qf2 d4
     13. Ne4 b6 14. Bd2 Nd5 15. Rfe1 h6 16. Ne5 Kh7 17. Qf3 f5 18. Nf2 Bb7
     19. c4 dxc3 20. bxc3 Qc7 21. Qg3 Ne7 22. h4 Bf6 23. Nh3 Rg8 24. Re2 Rg7
     25. Rae1 Rd8 26.Nf2 Ba8 27. Nf3 Nd5 28. Ng5+ hxg5 29. hxg5 Be7 30. c4 Nb4
     31. Bc3 Rd4 32. Bxd4 cxd4 33. Qh3+ Kg8 34. g4 Qb7 35. gxf5 gxf5 36. Ne4 Nxd3
     37. Nf6+ Bxf6 38. Re8+ Kf7 39. Qh5+ Rg6 40. Qh7+ Rg7 41. g6# 1-0
  
     ```
  2. [Petrosyan, Manuel](https://ratings.fide.com/profile/13300857) vs. [Vachier Lagrave, Maxime](https://ratings.fide.com/profile/623539) at a Titled Tuesday blitz on chess.com (2020)
  
     ```
     [FEN ""]
     [Event "Titled Tuesday intern op 9th June"]
     [Site "Chess.com INT"]
     [Date "2020.06.09"]
     [Round "4"]
     [White "Petrosyan, Manuel"]
     [Black "Vachier Lagrave, Maxime"]
     [Result "0-1"]
     [ECO "D12"]
     [WhiteElo "2607"]
     [BlackElo "2778"]
     [PlyCount "96"]
     [EventDate "2020.06.09"]
     [StartPly "95"]
  
     1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 Bf5 5. Nc3 e6 6. Nh4 Be4
     7. f3 Bg6 8. Qb3 Qc7 9. Bd2 Be7 10. Rc1 Nbd7 11. g3 dxc4 12. Bxc4 a6 13. a4
     O-O 14. Nxg6 hxg6 15. O-O b5 16. Be2 Qb6 17. Ne4 Rfc8 18. Rc2 Nxe4 19. fxe4 b4
     20. Rfc1 Qb7 21. e5 c5 22. Kf2 Rab8 23. Bf3 Qa7 24. Qd3 Rd8 25. Qe4 Qb6 26. b3
     a5 27. h4 cxd4 28. exd4 Nf8 29. Be3 Rd7 30. d5 exd5 31. Qxd5 Qd8 32. Qc4 Ne6
     33. Bg4 Rd5 34. Bxe6 fxe6 35. Qg4 Rxe5 36. Bf4 Rf5 37. Qxg6 Qd5 38. Rc8+ Rxc8
     39. Rxc8+ Bf8 40. Kg1 Qxb3 41. Re8 Rf6 42. Qg4 Qb1+ 43. Kh2 Qe4 44. Qg5 b3 45.
     Bd6 Qe2+ 46. Kh3 Qf1+ 47. Kg4 Qf5+ 48. Kh5 g6# 0-1
  
     ```
  
  Reference (from CQL documentation):
  
  * [`flipcolor`](http://www.gadycosteff.com/cql/flipcolor.html)
  * [`pin`](http://www.gadycosteff.com/cql/pin.html)
  * [`line`](http://www.gadycosteff.com/cql/line.html)
  * [Arrows: `-->`, `<--`](http://www.gadycosteff.com/cql/arrow.html)
  * [`wtm`](http://www.gadycosteff.com/cql/wtm.html)
  * [`mate`](http://www.gadycosteff.com/cql/mate.html)
  * [`!=`](http://www.gadycosteff.com/cql/relationaloperator.html#notequal), [`==`](http://www.gadycosteff.com/cql/relationaloperator.html#equal)
  * [Variables](http://www.gadycosteff.com/cql/variables.html)
  
  Download CQL for Windows and Mac along with some examples [from the official website](http://www.gadycosteff.com/cql/download.html). Email the authors for the Linux distribution.
  
  > **Comments:**
  > **username_3**: I don't think the Petrosyan - MVL game matches. The white Pg5 is pinned, but it is the Black Pg7 that moves to deliver mate, and that seems to confuse your nice CQL search. +1 anyway, nice cql-fu and the first game is a great discovery !  
  > **username_4**: @username_3 no idea what happened, the piece on g5 was a white queen.  
  
  ---
  
  